xref: /openbmc/linux/arch/sh/kernel/cpu/sh2/setup-sh7619.c (revision 90015c89386ffb8967422fbe9f5e7babf1dc2c5e)
19d4436a6SYoshinori Sato /*
29d4436a6SYoshinori Sato  * SH7619 Setup
39d4436a6SYoshinori Sato  *
49d4436a6SYoshinori Sato  *  Copyright (C) 2006  Yoshinori Sato
59d4436a6SYoshinori Sato  *
69d4436a6SYoshinori Sato  * This file is subject to the terms and conditions of the GNU General Public
79d4436a6SYoshinori Sato  * License.  See the file "COPYING" in the main directory of this archive
89d4436a6SYoshinori Sato  * for more details.
99d4436a6SYoshinori Sato  */
109d4436a6SYoshinori Sato #include <linux/platform_device.h>
119d4436a6SYoshinori Sato #include <linux/init.h>
129d4436a6SYoshinori Sato #include <linux/serial.h>
139d4436a6SYoshinori Sato #include <asm/sci.h>
149d4436a6SYoshinori Sato 
159d4436a6SYoshinori Sato static struct plat_sci_port sci_platform_data[] = {
169d4436a6SYoshinori Sato 	{
179d4436a6SYoshinori Sato 		.mapbase	= 0xf8400000,
189d4436a6SYoshinori Sato 		.flags		= UPF_BOOT_AUTOCONF,
199d4436a6SYoshinori Sato 		.type		= PORT_SCIF,
209d4436a6SYoshinori Sato 		.irqs		=  { 88, 89, 91, 90},
219d4436a6SYoshinori Sato 	}, {
229d4436a6SYoshinori Sato 		.mapbase	= 0xf8410000,
239d4436a6SYoshinori Sato 		.flags		= UPF_BOOT_AUTOCONF,
249d4436a6SYoshinori Sato 		.type		= PORT_SCIF,
259d4436a6SYoshinori Sato 		.irqs		=  { 92, 93, 95, 94},
269d4436a6SYoshinori Sato 	}, {
279d4436a6SYoshinori Sato 		.mapbase	= 0xf8420000,
289d4436a6SYoshinori Sato 		.flags		= UPF_BOOT_AUTOCONF,
299d4436a6SYoshinori Sato 		.type		= PORT_SCIF,
309d4436a6SYoshinori Sato 		.irqs		=  { 96, 97, 99, 98},
319d4436a6SYoshinori Sato 	}, {
329d4436a6SYoshinori Sato 		.flags = 0,
339d4436a6SYoshinori Sato 	}
349d4436a6SYoshinori Sato };
359d4436a6SYoshinori Sato 
369d4436a6SYoshinori Sato static struct platform_device sci_device = {
379d4436a6SYoshinori Sato 	.name		= "sh-sci",
389d4436a6SYoshinori Sato 	.id		= -1,
399d4436a6SYoshinori Sato 	.dev		= {
409d4436a6SYoshinori Sato 		.platform_data	= sci_platform_data,
419d4436a6SYoshinori Sato 	},
429d4436a6SYoshinori Sato };
439d4436a6SYoshinori Sato 
449d4436a6SYoshinori Sato static struct platform_device *sh7619_devices[] __initdata = {
459d4436a6SYoshinori Sato 	&sci_device,
469d4436a6SYoshinori Sato };
479d4436a6SYoshinori Sato 
489d4436a6SYoshinori Sato static int __init sh7619_devices_setup(void)
499d4436a6SYoshinori Sato {
509d4436a6SYoshinori Sato 	return platform_add_devices(sh7619_devices,
519d4436a6SYoshinori Sato 				    ARRAY_SIZE(sh7619_devices));
529d4436a6SYoshinori Sato }
539d4436a6SYoshinori Sato __initcall(sh7619_devices_setup);
54780a1568SYoshinori Sato 
5568abdbbbSMagnus Damm static struct ipr_data ipr_irq_table[] = {
565c67cd05SYoshinori Sato 	{ 86, 0,  4, 2 },	/* CMI0 */
575c67cd05SYoshinori Sato 	{ 88, 1, 12, 3 },	/* SCIF0_ERI */
585c67cd05SYoshinori Sato 	{ 89, 1, 12, 3 },	/* SCIF0_RXI */
595c67cd05SYoshinori Sato 	{ 90, 1, 12, 3 },	/* SCIF0_BRI */
605c67cd05SYoshinori Sato 	{ 91, 1, 12, 3 },	/* SCIF0_TXI */
615c67cd05SYoshinori Sato 	{ 92, 1,  8, 3 },	/* SCIF1_ERI */
625c67cd05SYoshinori Sato 	{ 93, 1,  8, 3 },	/* SCIF1_RXI */
635c67cd05SYoshinori Sato 	{ 94, 1,  8, 3 },	/* SCIF1_BRI */
645c67cd05SYoshinori Sato 	{ 95, 1,  8, 3 },	/* SCIF1_TXI */
655c67cd05SYoshinori Sato 	{ 96, 1,  4, 3 },	/* SCIF2_ERI */
665c67cd05SYoshinori Sato 	{ 97, 1,  4, 3 },	/* SCIF2_RXI */
675c67cd05SYoshinori Sato 	{ 98, 1,  4, 3 },	/* SCIF2_BRI */
685c67cd05SYoshinori Sato 	{ 99, 1,  4, 3 },	/* SCIF2_TXI */
69780a1568SYoshinori Sato };
70780a1568SYoshinori Sato 
7168abdbbbSMagnus Damm static unsigned long ipr_offsets[] = {
725c67cd05SYoshinori Sato 	0xf8080000,	/* IPRC */
735c67cd05SYoshinori Sato 	0xf8080002,	/* IPRD */
745c67cd05SYoshinori Sato 	0xf8080004,	/* IPRE */
755c67cd05SYoshinori Sato 	0xf8080006,	/* IPRF */
765c67cd05SYoshinori Sato 	0xf8080008,	/* IPRG */
775c67cd05SYoshinori Sato };
785c67cd05SYoshinori Sato 
7968abdbbbSMagnus Damm static struct ipr_desc ipr_irq_desc = {
8068abdbbbSMagnus Damm 	.ipr_offsets	= ipr_offsets,
8168abdbbbSMagnus Damm 	.nr_offsets	= ARRAY_SIZE(ipr_offsets),
8268abdbbbSMagnus Damm 
8368abdbbbSMagnus Damm 	.ipr_data	= ipr_irq_table,
8468abdbbbSMagnus Damm 	.nr_irqs	= ARRAY_SIZE(ipr_irq_table),
8568abdbbbSMagnus Damm 
8668abdbbbSMagnus Damm 	.chip = {
8768abdbbbSMagnus Damm 		.name	= "IPR-sh7619",
8868abdbbbSMagnus Damm 	},
8968abdbbbSMagnus Damm };
905c67cd05SYoshinori Sato 
91*90015c89SMagnus Damm void __init plat_irq_setup(void)
92780a1568SYoshinori Sato {
9368abdbbbSMagnus Damm 	register_ipr_controller(&ipr_irq_desc);
94780a1568SYoshinori Sato }
95