setup-sh7722.c 2.2 KB
Newer Older
P
Paul Mundt 已提交
1 2 3
/*
 * SH7722 Setup
 *
P
Paul Mundt 已提交
4
 *  Copyright (C) 2006 - 2007  Paul Mundt
P
Paul Mundt 已提交
5 6 7 8 9 10 11 12
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 */
#include <linux/platform_device.h>
#include <linux/init.h>
#include <linux/serial.h>
P
Paul Mundt 已提交
13
#include <linux/mm.h>
P
Paul Mundt 已提交
14
#include <asm/mmzone.h>
P
Paul Mundt 已提交
15 16 17 18 19 20 21
#include <asm/sci.h>

static struct plat_sci_port sci_platform_data[] = {
	{
		.mapbase	= 0xffe00000,
		.flags		= UPF_BOOT_AUTOCONF,
		.type		= PORT_SCIF,
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
		.irqs		= { 80, 80, 80, 80 },
	},
	{
		.mapbase	= 0xffe10000,
		.flags		= UPF_BOOT_AUTOCONF,
		.type		= PORT_SCIF,
		.irqs		= { 81, 81, 81, 81 },
	},
	{
		.mapbase	= 0xffe20000,
		.flags		= UPF_BOOT_AUTOCONF,
		.type		= PORT_SCIF,
		.irqs		= { 82, 82, 82, 82 },
	},
	{
P
Paul Mundt 已提交
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
		.flags = 0,
	}
};

static struct platform_device sci_device = {
	.name		= "sh-sci",
	.id		= -1,
	.dev		= {
		.platform_data	= sci_platform_data,
	},
};

static struct platform_device *sh7722_devices[] __initdata = {
	&sci_device,
};

static int __init sh7722_devices_setup(void)
{
	return platform_add_devices(sh7722_devices,
				    ARRAY_SIZE(sh7722_devices));
}
__initcall(sh7722_devices_setup);

M
Magnus Damm 已提交
60
static struct ipr_data ipr_irq_table[] = {
P
Paul Mundt 已提交
61 62 63
	/* IRQ, IPR-idx, shift, prio */
	{ 16, 0, 12, 2 }, /* TMU0 */
	{ 17, 0,  8, 2 }, /* TMU1 */
64 65 66
	{ 80, 6, 12, 3 }, /* SCIF0 */
	{ 81, 6, 8, 3 },  /* SCIF1 */
	{ 82, 6, 4, 3 },  /* SCIF2 */
P
Paul Mundt 已提交
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
};

static unsigned long ipr_offsets[] = {
	0xa4080000, /*  0: IPRA */
	0xa4080004, /*  1: IPRB */
	0xa4080008, /*  2: IPRC */
	0xa408000c, /*  3: IPRD */
	0xa4080010, /*  4: IPRE */
	0xa4080014, /*  5: IPRF */
	0xa4080018, /*  6: IPRG */
	0xa408001c, /*  7: IPRH */
	0xa4080020, /*  8: IPRI */
	0xa4080024, /*  9: IPRJ */
	0xa4080028, /* 10: IPRK */
	0xa408002c, /* 11: IPRL */
};

M
Magnus Damm 已提交
84 85 86 87 88 89 90 91 92 93 94
static struct ipr_desc ipr_irq_desc = {
	.ipr_offsets	= ipr_offsets,
	.nr_offsets	= ARRAY_SIZE(ipr_offsets),

	.ipr_data	= ipr_irq_table,
	.nr_irqs	= ARRAY_SIZE(ipr_irq_table),

	.chip = {
		.name	= "IPR-sh7722",
	},
};
P
Paul Mundt 已提交
95 96 97

void __init init_IRQ_ipr(void)
{
M
Magnus Damm 已提交
98
	register_ipr_controller(&ipr_irq_desc);
P
Paul Mundt 已提交
99
}
P
Paul Mundt 已提交
100 101 102 103 104 105

void __init plat_mem_setup(void)
{
	/* Register the URAM space as Node 1 */
	setup_bootmem_node(1, 0x055f0000, 0x05610000);
}