2010-11-17 17:59:31 +07:00
|
|
|
/*
|
|
|
|
* sh73a0 processor support
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Takashi Yoshii
|
|
|
|
* Copyright (C) 2010 Magnus Damm
|
|
|
|
* Copyright (C) 2008 Yoshihiro Shimoda
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/irq.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <linux/input.h>
|
|
|
|
#include <linux/io.h>
|
2014-06-20 23:53:09 +07:00
|
|
|
|
2015-01-09 20:08:49 +07:00
|
|
|
#include <asm/hardware/cache-l2x0.h>
|
2012-02-29 19:37:27 +07:00
|
|
|
#include <asm/mach/map.h>
|
2010-11-17 17:59:31 +07:00
|
|
|
#include <asm/mach/arch.h>
|
2012-03-06 15:36:45 +07:00
|
|
|
#include <asm/mach/time.h>
|
2014-06-20 23:53:09 +07:00
|
|
|
|
2014-06-17 14:47:37 +07:00
|
|
|
#include "common.h"
|
2014-06-20 23:53:09 +07:00
|
|
|
#include "sh73a0.h"
|
2010-11-17 17:59:31 +07:00
|
|
|
|
2012-02-29 19:37:27 +07:00
|
|
|
static struct map_desc sh73a0_io_desc[] __initdata = {
|
2014-11-14 23:07:07 +07:00
|
|
|
/* create a 1:1 identity mapping for 0xe6xxxxxx
|
2012-02-29 19:37:27 +07:00
|
|
|
* used by CPGA, INTC and PFC.
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
.virtual = 0xe6000000,
|
|
|
|
.pfn = __phys_to_pfn(0xe6000000),
|
|
|
|
.length = 256 << 20,
|
|
|
|
.type = MT_DEVICE_NONSHARED
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2015-06-17 16:31:20 +07:00
|
|
|
static void __init sh73a0_map_io(void)
|
2012-02-29 19:37:27 +07:00
|
|
|
{
|
ARM: shmobile: Add early debugging support using SCIF(A)
Add serial port debug macros for the SCIF(A) serial ports.
This includes all supported shmobile SoCs, except for EMEV2.
The configuration logic (both Kconfig and #ifdef) is more complicated than
one would expect, for several reasons:
1. Not all SoCs have the same serial devices, and they're not always
at the same addresses.
2. There are two different types: SCIF and SCIFA. Fortunately they can
easily be distinguished by physical address.
3. Not all boards use the same serial port for the console.
The defaults correspond to the boards that are supported in
mainline. If you want to use a different serial port, just change
the value of CONFIG_DEBUG_UART_PHYS, and the rest will auto-adapt.
4. debug_ll_io_init() maps the SCIF(A) registers to a fixed virtual
address. 0xfdxxxxxx was chosen, as it should lie below VMALLOC_END
= 0xff000000, and must not conflict with the 2 MiB reserved region
at PCI_IO_VIRT_BASE = 0xfee00000.
- On SoCs not using the legacy machine_desc.map_io(),
debug_ll_io_init() is called by the ARM core code.
- On SoCs using the legacy machine_desc.map_io(),
debug_ll_io_init() must be called explicitly. Calls are added
for r8a7740, r8a7779, sh7372, and sh73a0.
This was derived from the r8a7790 version by Laurent Pinchart.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
2014-11-14 22:49:47 +07:00
|
|
|
debug_ll_io_init();
|
2012-02-29 19:37:27 +07:00
|
|
|
iotable_init(sh73a0_io_desc, ARRAY_SIZE(sh73a0_io_desc));
|
|
|
|
}
|
|
|
|
|
2015-01-09 20:08:49 +07:00
|
|
|
static void __init sh73a0_generic_init(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_CACHE_L2X0
|
|
|
|
/* Shared attribute override enable, 64K*8way */
|
|
|
|
l2x0_init(IOMEM(0xf0100000), 0x00400000, 0xc20f0fff);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2015-07-28 05:27:52 +07:00
|
|
|
static const char *const sh73a0_boards_compat_dt[] __initconst = {
|
2012-11-21 20:00:15 +07:00
|
|
|
"renesas,sh73a0",
|
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
|
|
|
|
DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)")
|
2013-02-15 19:38:20 +07:00
|
|
|
.smp = smp_ops(sh73a0_smp_ops),
|
2012-11-21 20:00:15 +07:00
|
|
|
.map_io = sh73a0_map_io,
|
2014-10-17 19:24:39 +07:00
|
|
|
.init_early = shmobile_init_delay,
|
2015-01-09 20:08:49 +07:00
|
|
|
.init_machine = sh73a0_generic_init,
|
2014-07-31 06:32:15 +07:00
|
|
|
.init_late = shmobile_init_late,
|
2012-11-21 20:00:15 +07:00
|
|
|
.dt_compat = sh73a0_boards_compat_dt,
|
|
|
|
MACHINE_END
|