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