Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * r8a7779 processor support
0004  *
0005  * Copyright (C) 2011, 2013  Renesas Solutions Corp.
0006  * Copyright (C) 2011  Magnus Damm
0007  * Copyright (C) 2013  Cogent Embedded, Inc.
0008  */
0009 #include <linux/init.h>
0010 #include <linux/irqchip.h>
0011 
0012 #include <asm/mach/arch.h>
0013 #include <asm/mach/map.h>
0014 
0015 #include "common.h"
0016 #include "r8a7779.h"
0017 
0018 #define HPBREG_BASE 0xfe700000
0019 
0020 /* IRQ */
0021 #define INT2SMSKCR0 0x822a0 /* Interrupt Submask Clear Register 0 */
0022 #define INT2SMSKCR1 0x822a4 /* Interrupt Submask Clear Register 1 */
0023 #define INT2SMSKCR2 0x822a8 /* Interrupt Submask Clear Register 2 */
0024 #define INT2SMSKCR3 0x822ac /* Interrupt Submask Clear Register 3 */
0025 #define INT2SMSKCR4 0x822b0 /* Interrupt Submask Clear Register 4 */
0026 
0027 #define INT2NTSR0   0x00060 /* Interrupt Notification Select Register 0 */
0028 #define INT2NTSR1   0x00064 /* Interrupt Notification Select Register 1 */
0029 
0030 static void __init r8a7779_init_irq_dt(void)
0031 {
0032     void __iomem *base = ioremap(HPBREG_BASE, 0x00100000);
0033 
0034     irqchip_init();
0035 
0036     /* route all interrupts to ARM */
0037     writel(0xffffffff, base + INT2NTSR0);
0038     writel(0x3fffffff, base + INT2NTSR1);
0039 
0040     /* unmask all known interrupts in INTCS2 */
0041     writel(0xfffffff0, base + INT2SMSKCR0);
0042     writel(0xfff7ffff, base + INT2SMSKCR1);
0043     writel(0xfffbffdf, base + INT2SMSKCR2);
0044     writel(0xbffffffc, base + INT2SMSKCR3);
0045     writel(0x003fee3f, base + INT2SMSKCR4);
0046 
0047     iounmap(base);
0048 }
0049 
0050 static const char *const r8a7779_compat_dt[] __initconst = {
0051     "renesas,r8a7779",
0052     NULL
0053 };
0054 
0055 DT_MACHINE_START(R8A7779_DT, "Generic R8A7779 (Flattened Device Tree)")
0056     .smp        = smp_ops(r8a7779_smp_ops),
0057     .init_irq   = r8a7779_init_irq_dt,
0058     .init_late  = shmobile_init_late,
0059     .dt_compat  = r8a7779_compat_dt,
0060 MACHINE_END