2018-06-14 09:56:06 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2011-12-14 00:36:12 +08:00
|
|
|
/*
|
|
|
|
* r8a7779 processor support
|
|
|
|
*
|
2013-04-05 02:53:50 +08:00
|
|
|
* Copyright (C) 2011, 2013 Renesas Solutions Corp.
|
2011-12-14 00:36:12 +08:00
|
|
|
* Copyright (C) 2011 Magnus Damm
|
2013-04-05 02:53:50 +08:00
|
|
|
* Copyright (C) 2013 Cogent Embedded, Inc.
|
2011-12-14 00:36:12 +08:00
|
|
|
*/
|
|
|
|
#include <linux/init.h>
|
2013-08-02 14:39:56 +08:00
|
|
|
#include <linux/irqchip.h>
|
2014-06-21 00:53:05 +08:00
|
|
|
|
2011-12-14 00:36:12 +08:00
|
|
|
#include <asm/mach/arch.h>
|
2012-02-29 20:37:43 +08:00
|
|
|
#include <asm/mach/map.h>
|
2014-06-21 00:53:05 +08:00
|
|
|
|
2014-06-17 15:47:37 +08:00
|
|
|
#include "common.h"
|
2014-06-21 00:53:05 +08:00
|
|
|
#include "r8a7779.h"
|
2012-02-29 20:37:43 +08:00
|
|
|
|
2020-11-17 18:30:17 +08:00
|
|
|
#define HPBREG_BASE 0xfe700000
|
|
|
|
|
2013-08-02 14:39:56 +08:00
|
|
|
/* IRQ */
|
2020-11-17 18:30:17 +08:00
|
|
|
#define INT2SMSKCR0 0x822a0 /* Interrupt Submask Clear Register 0 */
|
|
|
|
#define INT2SMSKCR1 0x822a4 /* Interrupt Submask Clear Register 1 */
|
|
|
|
#define INT2SMSKCR2 0x822a8 /* Interrupt Submask Clear Register 2 */
|
|
|
|
#define INT2SMSKCR3 0x822ac /* Interrupt Submask Clear Register 3 */
|
|
|
|
#define INT2SMSKCR4 0x822b0 /* Interrupt Submask Clear Register 4 */
|
2013-08-02 14:39:56 +08:00
|
|
|
|
2020-11-17 18:30:17 +08:00
|
|
|
#define INT2NTSR0 0x00060 /* Interrupt Notification Select Register 0 */
|
|
|
|
#define INT2NTSR1 0x00064 /* Interrupt Notification Select Register 1 */
|
2013-08-02 14:39:56 +08:00
|
|
|
|
2015-07-16 15:54:03 +08:00
|
|
|
static void __init r8a7779_init_irq_dt(void)
|
2013-10-02 16:38:23 +08:00
|
|
|
{
|
2020-11-17 18:30:17 +08:00
|
|
|
void __iomem *base = ioremap(HPBREG_BASE, 0x00100000);
|
|
|
|
|
2013-08-02 14:39:56 +08:00
|
|
|
irqchip_init();
|
2015-07-16 15:54:03 +08:00
|
|
|
|
2013-08-02 14:39:56 +08:00
|
|
|
/* route all interrupts to ARM */
|
2020-11-17 22:24:47 +08:00
|
|
|
writel(0xffffffff, base + INT2NTSR0);
|
|
|
|
writel(0x3fffffff, base + INT2NTSR1);
|
2013-08-02 14:39:56 +08:00
|
|
|
|
|
|
|
/* unmask all known interrupts in INTCS2 */
|
2020-11-17 22:24:47 +08:00
|
|
|
writel(0xfffffff0, base + INT2SMSKCR0);
|
|
|
|
writel(0xfff7ffff, base + INT2SMSKCR1);
|
|
|
|
writel(0xfffbffdf, base + INT2SMSKCR2);
|
|
|
|
writel(0xbffffffc, base + INT2SMSKCR3);
|
|
|
|
writel(0x003fee3f, base + INT2SMSKCR4);
|
2020-11-17 18:30:17 +08:00
|
|
|
|
|
|
|
iounmap(base);
|
2013-08-02 14:39:56 +08:00
|
|
|
}
|
|
|
|
|
2015-07-28 06:27:52 +08:00
|
|
|
static const char *const r8a7779_compat_dt[] __initconst = {
|
2012-11-21 21:00:15 +08:00
|
|
|
"renesas,r8a7779",
|
2022-03-03 20:50:54 +08:00
|
|
|
NULL
|
2012-11-21 21:00:15 +08:00
|
|
|
};
|
|
|
|
|
2013-03-04 15:11:20 +08:00
|
|
|
DT_MACHINE_START(R8A7779_DT, "Generic R8A7779 (Flattened Device Tree)")
|
2015-07-13 14:15:02 +08:00
|
|
|
.smp = smp_ops(r8a7779_smp_ops),
|
2012-11-21 21:00:15 +08:00
|
|
|
.init_irq = r8a7779_init_irq_dt,
|
2014-07-31 07:32:33 +08:00
|
|
|
.init_late = shmobile_init_late,
|
2012-11-21 21:00:15 +08:00
|
|
|
.dt_compat = r8a7779_compat_dt,
|
|
|
|
MACHINE_END
|