blob: c3af2c8925ba0b7fe729b86d4054c91513d4ce8c [file] [log] [blame]
Wolfram Sangc44e1822018-06-14 10:56:06 +09001// SPDX-License-Identifier: GPL-2.0
Magnus Dammf411fad2011-12-14 01:36:12 +09002/*
3 * r8a7779 processor support
4 *
Sergei Shtylyovdace48d2013-04-04 18:53:50 +00005 * Copyright (C) 2011, 2013 Renesas Solutions Corp.
Magnus Dammf411fad2011-12-14 01:36:12 +09006 * Copyright (C) 2011 Magnus Damm
Sergei Shtylyovdace48d2013-04-04 18:53:50 +00007 * Copyright (C) 2013 Cogent Embedded, Inc.
Magnus Dammf411fad2011-12-14 01:36:12 +09008 */
Magnus Dammf411fad2011-12-14 01:36:12 +09009#include <linux/init.h>
Kuninori Morimoto5b3859d2013-08-01 23:39:56 -070010#include <linux/irqchip.h>
Geert Uytterhoeven1b553532014-06-20 18:53:05 +020011
Magnus Dammf411fad2011-12-14 01:36:12 +090012#include <asm/mach/arch.h>
Magnus Damm3e353b872012-02-29 21:37:43 +090013#include <asm/mach/map.h>
Geert Uytterhoeven1b553532014-06-20 18:53:05 +020014
Magnus Dammfd44aa52014-06-17 16:47:37 +090015#include "common.h"
Geert Uytterhoeven1b553532014-06-20 18:53:05 +020016#include "r8a7779.h"
Magnus Damm3e353b872012-02-29 21:37:43 +090017
Geert Uytterhoevencaf67a932020-11-17 11:30:17 +010018#define HPBREG_BASE 0xfe700000
Kuninori Morimoto5b3859d2013-08-01 23:39:56 -070019
Geert Uytterhoevencaf67a932020-11-17 11:30:17 +010020/* IRQ */
21#define INT2SMSKCR0 0x822a0 /* Interrupt Submask Clear Register 0 */
22#define INT2SMSKCR1 0x822a4 /* Interrupt Submask Clear Register 1 */
23#define INT2SMSKCR2 0x822a8 /* Interrupt Submask Clear Register 2 */
24#define INT2SMSKCR3 0x822ac /* Interrupt Submask Clear Register 3 */
25#define INT2SMSKCR4 0x822b0 /* Interrupt Submask Clear Register 4 */
26
27#define INT2NTSR0 0x00060 /* Interrupt Notification Select Register 0 */
28#define INT2NTSR1 0x00064 /* Interrupt Notification Select Register 1 */
Kuninori Morimoto5b3859d2013-08-01 23:39:56 -070029
Magnus Dammc99cd902015-07-16 16:54:03 +090030static void __init r8a7779_init_irq_dt(void)
Kuninori Morimoto5b3859d2013-08-01 23:39:56 -070031{
Geert Uytterhoevencaf67a932020-11-17 11:30:17 +010032 void __iomem *base = ioremap(HPBREG_BASE, 0x00100000);
33
Kuninori Morimoto5b3859d2013-08-01 23:39:56 -070034 irqchip_init();
Magnus Dammc99cd902015-07-16 16:54:03 +090035
Kuninori Morimoto5b3859d2013-08-01 23:39:56 -070036 /* route all interrupts to ARM */
Geert Uytterhoevend4a617c2020-11-17 15:24:47 +010037 writel(0xffffffff, base + INT2NTSR0);
38 writel(0x3fffffff, base + INT2NTSR1);
Kuninori Morimoto5b3859d2013-08-01 23:39:56 -070039
40 /* unmask all known interrupts in INTCS2 */
Geert Uytterhoevend4a617c2020-11-17 15:24:47 +010041 writel(0xfffffff0, base + INT2SMSKCR0);
42 writel(0xfff7ffff, base + INT2SMSKCR1);
43 writel(0xfffbffdf, base + INT2SMSKCR2);
44 writel(0xbffffffc, base + INT2SMSKCR3);
45 writel(0x003fee3f, base + INT2SMSKCR4);
Geert Uytterhoevencaf67a932020-11-17 11:30:17 +010046
47 iounmap(base);
Kuninori Morimoto5b3859d2013-08-01 23:39:56 -070048}
49
Nicolas Pitre19c233b2015-07-27 18:27:52 -040050static const char *const r8a7779_compat_dt[] __initconst = {
Simon Horman10e8d4f2012-11-21 22:00:15 +090051 "renesas,r8a7779",
Geert Uytterhoeven3238f822022-03-03 13:50:54 +010052 NULL
Simon Horman10e8d4f2012-11-21 22:00:15 +090053};
54
Kuninori Morimotoabe0e142013-03-03 23:11:20 -080055DT_MACHINE_START(R8A7779_DT, "Generic R8A7779 (Flattened Device Tree)")
Magnus Damm44ade5e2015-07-13 15:15:02 +090056 .smp = smp_ops(r8a7779_smp_ops),
Simon Horman10e8d4f2012-11-21 22:00:15 +090057 .init_irq = r8a7779_init_irq_dt,
Magnus Dammd5b00b92014-07-31 08:32:33 +090058 .init_late = shmobile_init_late,
Simon Horman10e8d4f2012-11-21 22:00:15 +090059 .dt_compat = r8a7779_compat_dt,
60MACHINE_END