18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * linux/arch/sh/boards/se/7721/irq.c
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2008  Renesas Solutions Corp.
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci#include <linux/init.h>
88c2ecf20Sopenharmony_ci#include <linux/irq.h>
98c2ecf20Sopenharmony_ci#include <linux/interrupt.h>
108c2ecf20Sopenharmony_ci#include <linux/io.h>
118c2ecf20Sopenharmony_ci#include <mach-se/mach/se7721.h>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_cienum {
148c2ecf20Sopenharmony_ci	UNUSED = 0,
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci	/* board specific interrupt sources */
178c2ecf20Sopenharmony_ci	MRSHPC,
188c2ecf20Sopenharmony_ci};
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_cistatic struct intc_vect vectors[] __initdata = {
218c2ecf20Sopenharmony_ci	INTC_IRQ(MRSHPC, MRSHPC_IRQ0),
228c2ecf20Sopenharmony_ci};
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_cistatic struct intc_prio_reg prio_registers[] __initdata = {
258c2ecf20Sopenharmony_ci	{ FPGA_ILSR6, 0, 8, 4, /* IRLMSK */
268c2ecf20Sopenharmony_ci	  { 0, MRSHPC } },
278c2ecf20Sopenharmony_ci};
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_cistatic DECLARE_INTC_DESC(intc_desc, "SE7721", vectors,
308c2ecf20Sopenharmony_ci			 NULL, NULL, prio_registers, NULL);
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci/*
338c2ecf20Sopenharmony_ci * Initialize IRQ setting
348c2ecf20Sopenharmony_ci */
358c2ecf20Sopenharmony_civoid __init init_se7721_IRQ(void)
368c2ecf20Sopenharmony_ci{
378c2ecf20Sopenharmony_ci	/* PPCR */
388c2ecf20Sopenharmony_ci	__raw_writew(__raw_readw(0xa4050118) & ~0x00ff, 0xa4050118);
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci	register_intc_controller(&intc_desc);
418c2ecf20Sopenharmony_ci	intc_set_priority(MRSHPC_IRQ0, 0xf - MRSHPC_IRQ0);
428c2ecf20Sopenharmony_ci}
43