Commit | Line | Data |
---|---|---|
41504c39 PM |
1 | /* |
2 | * SH7722 Setup | |
3 | * | |
520588f4 | 4 | * Copyright (C) 2006 - 2007 Paul Mundt |
41504c39 PM |
5 | * |
6 | * This file is subject to the terms and conditions of the GNU General Public | |
7 | * License. See the file "COPYING" in the main directory of this archive | |
8 | * for more details. | |
9 | */ | |
10 | #include <linux/platform_device.h> | |
11 | #include <linux/init.h> | |
12 | #include <linux/serial.h> | |
520588f4 | 13 | #include <linux/mm.h> |
5bbeafca | 14 | #include <asm/mmzone.h> |
41504c39 PM |
15 | #include <asm/sci.h> |
16 | ||
17 | static struct plat_sci_port sci_platform_data[] = { | |
18 | { | |
19 | .mapbase = 0xffe00000, | |
20 | .flags = UPF_BOOT_AUTOCONF, | |
21 | .type = PORT_SCIF, | |
22 | .irqs = { 80, 81, 83, 82 }, | |
23 | }, { | |
24 | .flags = 0, | |
25 | } | |
26 | }; | |
27 | ||
28 | static struct platform_device sci_device = { | |
29 | .name = "sh-sci", | |
30 | .id = -1, | |
31 | .dev = { | |
32 | .platform_data = sci_platform_data, | |
33 | }, | |
34 | }; | |
35 | ||
36 | static struct platform_device *sh7722_devices[] __initdata = { | |
37 | &sci_device, | |
38 | }; | |
39 | ||
40 | static int __init sh7722_devices_setup(void) | |
41 | { | |
42 | return platform_add_devices(sh7722_devices, | |
43 | ARRAY_SIZE(sh7722_devices)); | |
44 | } | |
45 | __initcall(sh7722_devices_setup); | |
46 | ||
68abdbbb | 47 | static struct ipr_data ipr_irq_table[] = { |
41504c39 PM |
48 | /* IRQ, IPR-idx, shift, prio */ |
49 | { 16, 0, 12, 2 }, /* TMU0 */ | |
50 | { 17, 0, 8, 2 }, /* TMU1 */ | |
05c8690d PM |
51 | { 80, 6, 12, 3 }, /* SCIF ERI */ |
52 | { 81, 6, 12, 3 }, /* SCIF RXI */ | |
53 | { 82, 6, 12, 3 }, /* SCIF BRI */ | |
54 | { 83, 6, 12, 3 }, /* SCIF TXI */ | |
41504c39 PM |
55 | }; |
56 | ||
57 | static unsigned long ipr_offsets[] = { | |
58 | 0xa4080000, /* 0: IPRA */ | |
59 | 0xa4080004, /* 1: IPRB */ | |
60 | 0xa4080008, /* 2: IPRC */ | |
61 | 0xa408000c, /* 3: IPRD */ | |
62 | 0xa4080010, /* 4: IPRE */ | |
63 | 0xa4080014, /* 5: IPRF */ | |
64 | 0xa4080018, /* 6: IPRG */ | |
65 | 0xa408001c, /* 7: IPRH */ | |
66 | 0xa4080020, /* 8: IPRI */ | |
67 | 0xa4080024, /* 9: IPRJ */ | |
68 | 0xa4080028, /* 10: IPRK */ | |
69 | 0xa408002c, /* 11: IPRL */ | |
70 | }; | |
71 | ||
68abdbbb MD |
72 | static struct ipr_desc ipr_irq_desc = { |
73 | .ipr_offsets = ipr_offsets, | |
74 | .nr_offsets = ARRAY_SIZE(ipr_offsets), | |
75 | ||
76 | .ipr_data = ipr_irq_table, | |
77 | .nr_irqs = ARRAY_SIZE(ipr_irq_table), | |
78 | ||
79 | .chip = { | |
80 | .name = "IPR-sh7722", | |
81 | }, | |
82 | }; | |
41504c39 PM |
83 | |
84 | void __init init_IRQ_ipr(void) | |
85 | { | |
68abdbbb | 86 | register_ipr_controller(&ipr_irq_desc); |
41504c39 | 87 | } |
520588f4 PM |
88 | |
89 | void __init plat_mem_setup(void) | |
90 | { | |
91 | /* Register the URAM space as Node 1 */ | |
92 | setup_bootmem_node(1, 0x055f0000, 0x05610000); | |
93 | } |