2011-11-11 03:45:52 +01:00
|
|
|
/*
|
|
|
|
* R8A7740 processor support
|
|
|
|
*
|
|
|
|
* Copyright (C) 2011 Renesas Solutions Corp.
|
|
|
|
* Copyright (C) 2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
|
|
|
|
*
|
|
|
|
* 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>
|
2011-11-11 03:46:23 +01:00
|
|
|
#include <linux/io.h>
|
2013-08-02 08:39:44 +02:00
|
|
|
#include <linux/irqchip.h>
|
|
|
|
#include <linux/irqchip/arm-gic.h>
|
2014-06-20 18:53:03 +02:00
|
|
|
|
2012-02-29 13:37:35 +01:00
|
|
|
#include <asm/mach/map.h>
|
2011-11-11 03:45:52 +01:00
|
|
|
#include <asm/mach/arch.h>
|
2012-03-06 09:36:53 +01:00
|
|
|
#include <asm/mach/time.h>
|
2014-06-20 18:53:03 +02:00
|
|
|
|
2014-06-17 09:47:37 +02:00
|
|
|
#include "common.h"
|
2011-11-11 03:45:52 +01:00
|
|
|
|
2012-06-12 11:36:21 +02:00
|
|
|
/*
|
|
|
|
* r8a7740 chip has lasting errata on MERAM buffer.
|
|
|
|
* this is work-around for it.
|
|
|
|
* see
|
|
|
|
* "Media RAM (MERAM)" on r8a7740 documentation
|
|
|
|
*/
|
|
|
|
#define MEBUFCNTR 0xFE950098
|
2015-06-17 11:31:24 +02:00
|
|
|
static void __init r8a7740_meram_workaround(void)
|
2012-06-12 11:36:21 +02:00
|
|
|
{
|
|
|
|
void __iomem *reg;
|
|
|
|
|
|
|
|
reg = ioremap_nocache(MEBUFCNTR, 4);
|
|
|
|
if (reg) {
|
|
|
|
iowrite32(0x01600164, reg);
|
|
|
|
iounmap(reg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-17 11:31:24 +02:00
|
|
|
static void __init r8a7740_init_irq_of(void)
|
2013-08-02 08:39:44 +02:00
|
|
|
{
|
|
|
|
void __iomem *intc_prio_base = ioremap_nocache(0xe6900010, 0x10);
|
|
|
|
void __iomem *intc_msk_base = ioremap_nocache(0xe6900040, 0x10);
|
|
|
|
void __iomem *pfc_inta_ctrl = ioremap_nocache(0xe605807c, 0x4);
|
|
|
|
|
|
|
|
irqchip_init();
|
|
|
|
|
|
|
|
/* route signals to GIC */
|
|
|
|
iowrite32(0x0, pfc_inta_ctrl);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* To mask the shared interrupt to SPI 149 we must ensure to set
|
|
|
|
* PRIO *and* MASK. Else we run into IRQ floods when registering
|
|
|
|
* the intc_irqpin devices
|
|
|
|
*/
|
|
|
|
iowrite32(0x0, intc_prio_base + 0x0);
|
|
|
|
iowrite32(0x0, intc_prio_base + 0x4);
|
|
|
|
iowrite32(0x0, intc_prio_base + 0x8);
|
|
|
|
iowrite32(0x0, intc_prio_base + 0xc);
|
|
|
|
iowrite8(0xff, intc_msk_base + 0x0);
|
|
|
|
iowrite8(0xff, intc_msk_base + 0x4);
|
|
|
|
iowrite8(0xff, intc_msk_base + 0x8);
|
|
|
|
iowrite8(0xff, intc_msk_base + 0xc);
|
|
|
|
|
|
|
|
iounmap(intc_prio_base);
|
|
|
|
iounmap(intc_msk_base);
|
|
|
|
iounmap(pfc_inta_ctrl);
|
|
|
|
}
|
|
|
|
|
2013-04-17 12:34:05 +02:00
|
|
|
static void __init r8a7740_generic_init(void)
|
|
|
|
{
|
2014-08-25 05:36:53 +02:00
|
|
|
r8a7740_meram_workaround();
|
2013-04-17 12:34:05 +02:00
|
|
|
}
|
|
|
|
|
2015-07-28 00:27:52 +02:00
|
|
|
static const char *const r8a7740_boards_compat_dt[] __initconst = {
|
2012-07-06 10:08:07 +02:00
|
|
|
"renesas,r8a7740",
|
|
|
|
NULL,
|
|
|
|
};
|
|
|
|
|
2012-10-22 07:15:13 +02:00
|
|
|
DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
|
2015-11-23 14:56:01 +01:00
|
|
|
.l2c_aux_val = 0,
|
|
|
|
.l2c_aux_mask = ~0,
|
2014-05-08 01:32:38 +02:00
|
|
|
.init_early = shmobile_init_delay,
|
2013-04-17 12:34:05 +02:00
|
|
|
.init_irq = r8a7740_init_irq_of,
|
|
|
|
.init_machine = r8a7740_generic_init,
|
2014-05-12 01:10:50 +02:00
|
|
|
.init_late = shmobile_init_late,
|
2012-07-06 10:08:07 +02:00
|
|
|
.dt_compat = r8a7740_boards_compat_dt,
|
|
|
|
MACHINE_END
|