2018-06-13 19:56:06 -06:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2011-12-13 09:36:12 -07:00
|
|
|
/*
|
|
|
|
* r8a7779 processor support
|
|
|
|
*
|
2013-04-04 12:53:50 -06:00
|
|
|
* Copyright (C) 2011, 2013 Renesas Solutions Corp.
|
2011-12-13 09:36:12 -07:00
|
|
|
* Copyright (C) 2011 Magnus Damm
|
2013-04-04 12:53:50 -06:00
|
|
|
* Copyright (C) 2013 Cogent Embedded, Inc.
|
2011-12-13 09:36:12 -07:00
|
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/irq.h>
|
2013-08-02 00:39:56 -06:00
|
|
|
#include <linux/irqchip.h>
|
|
|
|
#include <linux/irqchip/arm-gic.h>
|
2014-06-20 10:53:05 -06:00
|
|
|
|
2011-12-13 09:36:12 -07:00
|
|
|
#include <asm/mach/arch.h>
|
2012-02-29 05:37:43 -07:00
|
|
|
#include <asm/mach/map.h>
|
2014-06-20 10:53:05 -06:00
|
|
|
|
2014-06-17 01:47:37 -06:00
|
|
|
#include "common.h"
|
2014-06-20 10:53:05 -06:00
|
|
|
#include "r8a7779.h"
|
2012-02-29 05:37:43 -07:00
|
|
|
|
|
|
|
static struct map_desc r8a7779_io_desc[] __initdata = {
|
2014-11-14 09:07:05 -07:00
|
|
|
/* 2M identity mapping for 0xf0000000 (MPCORE) */
|
2012-02-29 05:37:43 -07:00
|
|
|
{
|
|
|
|
.virtual = 0xf0000000,
|
|
|
|
.pfn = __phys_to_pfn(0xf0000000),
|
|
|
|
.length = SZ_2M,
|
|
|
|
.type = MT_DEVICE_NONSHARED
|
|
|
|
},
|
2014-11-14 09:07:05 -07:00
|
|
|
/* 16M identity mapping for 0xfexxxxxx (DMAC-S/HPBREG/INTC2/LRAM/DBSC) */
|
2012-02-29 05:37:43 -07:00
|
|
|
{
|
|
|
|
.virtual = 0xfe000000,
|
|
|
|
.pfn = __phys_to_pfn(0xfe000000),
|
|
|
|
.length = SZ_16M,
|
|
|
|
.type = MT_DEVICE_NONSHARED
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2015-07-16 01:54:03 -06:00
|
|
|
static void __init r8a7779_map_io(void)
|
2012-02-29 05:37:43 -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 08:49:47 -07:00
|
|
|
debug_ll_io_init();
|
2012-02-29 05:37:43 -07:00
|
|
|
iotable_init(r8a7779_io_desc, ARRAY_SIZE(r8a7779_io_desc));
|
|
|
|
}
|
2011-12-13 09:36:12 -07:00
|
|
|
|
2013-08-02 00:39:56 -06:00
|
|
|
/* IRQ */
|
|
|
|
#define INT2SMSKCR0 IOMEM(0xfe7822a0)
|
|
|
|
#define INT2SMSKCR1 IOMEM(0xfe7822a4)
|
|
|
|
#define INT2SMSKCR2 IOMEM(0xfe7822a8)
|
|
|
|
#define INT2SMSKCR3 IOMEM(0xfe7822ac)
|
|
|
|
#define INT2SMSKCR4 IOMEM(0xfe7822b0)
|
|
|
|
|
|
|
|
#define INT2NTSR0 IOMEM(0xfe700060)
|
|
|
|
#define INT2NTSR1 IOMEM(0xfe700064)
|
|
|
|
|
2015-07-16 01:54:03 -06:00
|
|
|
static void __init r8a7779_init_irq_dt(void)
|
2013-10-02 02:38:23 -06:00
|
|
|
{
|
2013-08-02 00:39:56 -06:00
|
|
|
irqchip_init();
|
2015-07-16 01:54:03 -06:00
|
|
|
|
2013-08-02 00:39:56 -06:00
|
|
|
/* route all interrupts to ARM */
|
|
|
|
__raw_writel(0xffffffff, INT2NTSR0);
|
|
|
|
__raw_writel(0x3fffffff, INT2NTSR1);
|
|
|
|
|
|
|
|
/* unmask all known interrupts in INTCS2 */
|
|
|
|
__raw_writel(0xfffffff0, INT2SMSKCR0);
|
|
|
|
__raw_writel(0xfff7ffff, INT2SMSKCR1);
|
|
|
|
__raw_writel(0xfffbffdf, INT2SMSKCR2);
|
|
|
|
__raw_writel(0xbffffffc, INT2SMSKCR3);
|
|
|
|
__raw_writel(0x003fee3f, INT2SMSKCR4);
|
|
|
|
}
|
|
|
|
|
2015-07-27 16:27:52 -06:00
|
|
|
static const char *const r8a7779_compat_dt[] __initconst = {
|
2012-11-21 06:00:15 -07:00
|
|
|
"renesas,r8a7779",
|
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
|
2013-03-04 00:11:20 -07:00
|
|
|
DT_MACHINE_START(R8A7779_DT, "Generic R8A7779 (Flattened Device Tree)")
|
2015-07-13 00:15:02 -06:00
|
|
|
.smp = smp_ops(r8a7779_smp_ops),
|
2012-11-21 06:00:15 -07:00
|
|
|
.map_io = r8a7779_map_io,
|
2014-05-15 22:42:59 -06:00
|
|
|
.init_early = shmobile_init_delay,
|
2012-11-21 06:00:15 -07:00
|
|
|
.init_irq = r8a7779_init_irq_dt,
|
2014-07-30 17:32:33 -06:00
|
|
|
.init_late = shmobile_init_late,
|
2012-11-21 06:00:15 -07:00
|
|
|
.dt_compat = r8a7779_compat_dt,
|
|
|
|
MACHINE_END
|