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