2018-06-14 09:56:06 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2010-11-17 18:59:31 +08:00
|
|
|
/*
|
|
|
|
* sh73a0 processor support
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Takashi Yoshii
|
|
|
|
* Copyright (C) 2010 Magnus Damm
|
|
|
|
* Copyright (C) 2008 Yoshihiro Shimoda
|
|
|
|
*/
|
|
|
|
#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-21 00:53:09 +08:00
|
|
|
|
2015-01-09 21:08:49 +08:00
|
|
|
#include <asm/hardware/cache-l2x0.h>
|
2012-02-29 20:37:27 +08:00
|
|
|
#include <asm/mach/map.h>
|
2010-11-17 18:59:31 +08:00
|
|
|
#include <asm/mach/arch.h>
|
2012-03-06 16:36:45 +08:00
|
|
|
#include <asm/mach/time.h>
|
2014-06-21 00:53:09 +08:00
|
|
|
|
2014-06-17 15:47:37 +08:00
|
|
|
#include "common.h"
|
2014-06-21 00:53:09 +08:00
|
|
|
#include "sh73a0.h"
|
2010-11-17 18:59:31 +08:00
|
|
|
|
2012-02-29 20:37:27 +08:00
|
|
|
static struct map_desc sh73a0_io_desc[] __initdata = {
|
2014-11-15 00:07:07 +08:00
|
|
|
/* create a 1:1 identity mapping for 0xe6xxxxxx
|
2012-02-29 20:37:27 +08:00
|
|
|
* used by CPGA, INTC and PFC.
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
.virtual = 0xe6000000,
|
|
|
|
.pfn = __phys_to_pfn(0xe6000000),
|
|
|
|
.length = 256 << 20,
|
|
|
|
.type = MT_DEVICE_NONSHARED
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2015-06-17 17:31:20 +08:00
|
|
|
static void __init sh73a0_map_io(void)
|
2012-02-29 20:37:27 +08: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 23:49:47 +08:00
|
|
|
debug_ll_io_init();
|
2012-02-29 20:37:27 +08:00
|
|
|
iotable_init(sh73a0_io_desc, ARRAY_SIZE(sh73a0_io_desc));
|
|
|
|
}
|
|
|
|
|
2015-01-09 21:08:49 +08: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 06:27:52 +08:00
|
|
|
static const char *const sh73a0_boards_compat_dt[] __initconst = {
|
2012-11-21 21:00:15 +08:00
|
|
|
"renesas,sh73a0",
|
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
|
|
|
|
DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)")
|
2013-02-15 20:38:20 +08:00
|
|
|
.smp = smp_ops(sh73a0_smp_ops),
|
2012-11-21 21:00:15 +08:00
|
|
|
.map_io = sh73a0_map_io,
|
2014-10-17 20:24:39 +08:00
|
|
|
.init_early = shmobile_init_delay,
|
2015-01-09 21:08:49 +08:00
|
|
|
.init_machine = sh73a0_generic_init,
|
2014-07-31 07:32:15 +08:00
|
|
|
.init_late = shmobile_init_late,
|
2012-11-21 21:00:15 +08:00
|
|
|
.dt_compat = sh73a0_boards_compat_dt,
|
|
|
|
MACHINE_END
|