diff options
author | Vitaly Bordug <vbordug@ru.mvista.com> | 2005-09-16 22:28:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-17 14:50:01 -0400 |
commit | 514ccd4e6c414d8064d53235f7fc09fc02ec2078 (patch) | |
tree | 37f0b4f70fab7cf3ef1bf80cee430950744ecb1b /arch | |
parent | 0faf3d3d08bb20d803ba090a1bc1ffedaea6ced6 (diff) |
[PATCH] ppc32: Add ppc_sys descriptions for PowerQUICC I devices
Added ppc_sys device and system definitions for PowerQUICC I devices. This
will allow drivers for PQI to be proper platform device drivers. Currently
sys section contains only MPC885 and MPC866. Identification should be done
with identify_ppc_sys_by_name call, with board-specific "name" string
passed, since PQI do not have any register that could identify the SOC.
Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ppc/syslib/Makefile | 3 | ||||
-rw-r--r-- | arch/ppc/syslib/mpc8xx_devices.c | 224 | ||||
-rw-r--r-- | arch/ppc/syslib/mpc8xx_sys.c | 61 |
3 files changed, 287 insertions, 1 deletions
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile index 8b9b226005d1..b8d08f33f7ee 100644 --- a/arch/ppc/syslib/Makefile +++ b/arch/ppc/syslib/Makefile | |||
@@ -34,7 +34,8 @@ ifeq ($(CONFIG_40x),y) | |||
34 | obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o ppc405_pci.o | 34 | obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o ppc405_pci.o |
35 | endif | 35 | endif |
36 | endif | 36 | endif |
37 | obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) | 37 | obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \ |
38 | ppc_sys.o mpc8xx_devices.o mpc8xx_sys.o | ||
38 | ifeq ($(CONFIG_8xx),y) | 39 | ifeq ($(CONFIG_8xx),y) |
39 | obj-$(CONFIG_PCI) += qspan_pci.o i8259.o | 40 | obj-$(CONFIG_PCI) += qspan_pci.o i8259.o |
40 | endif | 41 | endif |
diff --git a/arch/ppc/syslib/mpc8xx_devices.c b/arch/ppc/syslib/mpc8xx_devices.c new file mode 100644 index 000000000000..2b5f0e701687 --- /dev/null +++ b/arch/ppc/syslib/mpc8xx_devices.c | |||
@@ -0,0 +1,224 @@ | |||
1 | /* | ||
2 | * arch/ppc/syslib/mpc8xx_devices.c | ||
3 | * | ||
4 | * MPC8xx Device descriptions | ||
5 | * | ||
6 | * Maintainer: Kumar Gala <kumar.gala@freescale.com> | ||
7 | * | ||
8 | * Copyright 2005 MontaVista Software, Inc. by Vitaly Bordug<vbordug@ru.mvista.com> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | */ | ||
15 | |||
16 | #include <linux/init.h> | ||
17 | #include <linux/module.h> | ||
18 | #include <linux/device.h> | ||
19 | #include <linux/serial_8250.h> | ||
20 | #include <linux/mii.h> | ||
21 | #include <asm/commproc.h> | ||
22 | #include <asm/mpc8xx.h> | ||
23 | #include <asm/irq.h> | ||
24 | #include <asm/ppc_sys.h> | ||
25 | |||
26 | /* We use offsets for IORESOURCE_MEM to do not set dependences at compile time. | ||
27 | * They will get fixed up by mach_mpc8xx_fixup | ||
28 | */ | ||
29 | |||
30 | struct platform_device ppc_sys_platform_devices[] = { | ||
31 | [MPC8xx_CPM_FEC1] = { | ||
32 | .name = "fsl-cpm-fec", | ||
33 | .id = 1, | ||
34 | .num_resources = 2, | ||
35 | .resource = (struct resource[]) { | ||
36 | { | ||
37 | .name = "regs", | ||
38 | .start = 0xe00, | ||
39 | .end = 0xe88, | ||
40 | .flags = IORESOURCE_MEM, | ||
41 | }, | ||
42 | { | ||
43 | .name = "interrupt", | ||
44 | .start = MPC8xx_INT_FEC1, | ||
45 | .end = MPC8xx_INT_FEC1, | ||
46 | .flags = IORESOURCE_IRQ, | ||
47 | }, | ||
48 | }, | ||
49 | }, | ||
50 | [MPC8xx_CPM_FEC2] = { | ||
51 | .name = "fsl-cpm-fec", | ||
52 | .id = 2, | ||
53 | .num_resources = 2, | ||
54 | .resource = (struct resource[]) { | ||
55 | { | ||
56 | .name = "regs", | ||
57 | .start = 0x1e00, | ||
58 | .end = 0x1e88, | ||
59 | .flags = IORESOURCE_MEM, | ||
60 | }, | ||
61 | { | ||
62 | .name = "interrupt", | ||
63 | .start = MPC8xx_INT_FEC2, | ||
64 | .end = MPC8xx_INT_FEC2, | ||
65 | .flags = IORESOURCE_IRQ, | ||
66 | }, | ||
67 | }, | ||
68 | }, | ||
69 | [MPC8xx_CPM_SCC1] = { | ||
70 | .name = "fsl-cpm-scc", | ||
71 | .id = 1, | ||
72 | .num_resources = 3, | ||
73 | .resource = (struct resource[]) { | ||
74 | { | ||
75 | .name = "regs", | ||
76 | .start = 0xa00, | ||
77 | .end = 0xa18, | ||
78 | .flags = IORESOURCE_MEM, | ||
79 | }, | ||
80 | { | ||
81 | .name = "pram", | ||
82 | .start = 0x3c00, | ||
83 | .end = 0x3c80, | ||
84 | .flags = IORESOURCE_MEM, | ||
85 | }, | ||
86 | { | ||
87 | .name = "interrupt", | ||
88 | .start = MPC8xx_INT_SCC1, | ||
89 | .end = MPC8xx_INT_SCC1, | ||
90 | .flags = IORESOURCE_IRQ, | ||
91 | }, | ||
92 | }, | ||
93 | }, | ||
94 | [MPC8xx_CPM_SCC2] = { | ||
95 | .name = "fsl-cpm-scc", | ||
96 | .id = 2, | ||
97 | .num_resources = 3, | ||
98 | .resource = (struct resource[]) { | ||
99 | { | ||
100 | .name = "regs", | ||
101 | .start = 0xa20, | ||
102 | .end = 0xa38, | ||
103 | .flags = IORESOURCE_MEM, | ||
104 | }, | ||
105 | { | ||
106 | .name = "pram", | ||
107 | .start = 0x3d00, | ||
108 | .end = 0x3d80, | ||
109 | .flags = IORESOURCE_MEM, | ||
110 | }, | ||
111 | |||
112 | { | ||
113 | .name = "interrupt", | ||
114 | .start = MPC8xx_INT_SCC2, | ||
115 | .end = MPC8xx_INT_SCC2, | ||
116 | .flags = IORESOURCE_IRQ, | ||
117 | }, | ||
118 | }, | ||
119 | }, | ||
120 | [MPC8xx_CPM_SCC3] = { | ||
121 | .name = "fsl-cpm-scc", | ||
122 | .id = 3, | ||
123 | .num_resources = 3, | ||
124 | .resource = (struct resource[]) { | ||
125 | { | ||
126 | .name = "regs", | ||
127 | .start = 0xa40, | ||
128 | .end = 0xa58, | ||
129 | .flags = IORESOURCE_MEM, | ||
130 | }, | ||
131 | { | ||
132 | .name = "pram", | ||
133 | .start = 0x3e00, | ||
134 | .end = 0x3e80, | ||
135 | .flags = IORESOURCE_MEM, | ||
136 | }, | ||
137 | |||
138 | { | ||
139 | .name = "interrupt", | ||
140 | .start = MPC8xx_INT_SCC3, | ||
141 | .end = MPC8xx_INT_SCC3, | ||
142 | .flags = IORESOURCE_IRQ, | ||
143 | }, | ||
144 | }, | ||
145 | }, | ||
146 | [MPC8xx_CPM_SCC4] = { | ||
147 | .name = "fsl-cpm-scc", | ||
148 | .id = 4, | ||
149 | .num_resources = 3, | ||
150 | .resource = (struct resource[]) { | ||
151 | { | ||
152 | .name = "regs", | ||
153 | .start = 0xa60, | ||
154 | .end = 0xa78, | ||
155 | .flags = IORESOURCE_MEM, | ||
156 | }, | ||
157 | { | ||
158 | .name = "pram", | ||
159 | .start = 0x3f00, | ||
160 | .end = 0x3f80, | ||
161 | .flags = IORESOURCE_MEM, | ||
162 | }, | ||
163 | |||
164 | { | ||
165 | .name = "interrupt", | ||
166 | .start = MPC8xx_INT_SCC4, | ||
167 | .end = MPC8xx_INT_SCC4, | ||
168 | .flags = IORESOURCE_IRQ, | ||
169 | }, | ||
170 | }, | ||
171 | }, | ||
172 | [MPC8xx_CPM_SMC1] = { | ||
173 | .name = "fsl-cpm-smc", | ||
174 | .id = 1, | ||
175 | .num_resources = 2, | ||
176 | .resource = (struct resource[]) { | ||
177 | { | ||
178 | .name = "regs", | ||
179 | .start = 0xa82, | ||
180 | .end = 0xa91, | ||
181 | .flags = IORESOURCE_MEM, | ||
182 | }, | ||
183 | { | ||
184 | .name = "interrupt", | ||
185 | .start = MPC8xx_INT_SMC1, | ||
186 | .end = MPC8xx_INT_SMC1, | ||
187 | .flags = IORESOURCE_IRQ, | ||
188 | }, | ||
189 | }, | ||
190 | }, | ||
191 | [MPC8xx_CPM_SMC2] = { | ||
192 | .name = "fsl-cpm-smc", | ||
193 | .id = 2, | ||
194 | .num_resources = 2, | ||
195 | .resource = (struct resource[]) { | ||
196 | { | ||
197 | .name = "regs", | ||
198 | .start = 0xa92, | ||
199 | .end = 0xaa1, | ||
200 | .flags = IORESOURCE_MEM, | ||
201 | }, | ||
202 | { | ||
203 | .name = "interrupt", | ||
204 | .start = MPC8xx_INT_SMC2, | ||
205 | .end = MPC8xx_INT_SMC2, | ||
206 | .flags = IORESOURCE_IRQ, | ||
207 | }, | ||
208 | }, | ||
209 | }, | ||
210 | }; | ||
211 | |||
212 | static int __init mach_mpc8xx_fixup(struct platform_device *pdev) | ||
213 | { | ||
214 | ppc_sys_fixup_mem_resource (pdev, IMAP_ADDR); | ||
215 | return 0; | ||
216 | } | ||
217 | |||
218 | static int __init mach_mpc8xx_init(void) | ||
219 | { | ||
220 | ppc_sys_device_fixup = mach_mpc8xx_fixup; | ||
221 | return 0; | ||
222 | } | ||
223 | |||
224 | postcore_initcall(mach_mpc8xx_init); | ||
diff --git a/arch/ppc/syslib/mpc8xx_sys.c b/arch/ppc/syslib/mpc8xx_sys.c new file mode 100644 index 000000000000..a532ccc861c0 --- /dev/null +++ b/arch/ppc/syslib/mpc8xx_sys.c | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * arch/ppc/platforms/mpc8xx_sys.c | ||
3 | * | ||
4 | * MPC8xx System descriptions | ||
5 | * | ||
6 | * Maintainer: Kumar Gala <kumar.gala@freescale.com> | ||
7 | * | ||
8 | * Copyright 2005 MontaVista Software, Inc. by Vitaly Bordug <vbordug@ru.mvista.com> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
13 | * option) any later version. | ||
14 | */ | ||
15 | |||
16 | #include <linux/init.h> | ||
17 | #include <linux/module.h> | ||
18 | #include <linux/device.h> | ||
19 | #include <asm/ppc_sys.h> | ||
20 | |||
21 | struct ppc_sys_spec *cur_ppc_sys_spec; | ||
22 | struct ppc_sys_spec ppc_sys_specs[] = { | ||
23 | { | ||
24 | .ppc_sys_name = "MPC86X", | ||
25 | .mask = 0xFFFFFFFF, | ||
26 | .value = 0x00000000, | ||
27 | .num_devices = 2, | ||
28 | .device_list = (enum ppc_sys_devices[]) | ||
29 | { | ||
30 | MPC8xx_CPM_FEC1, | ||
31 | MPC8xx_CPM_SCC1, | ||
32 | MPC8xx_CPM_SCC2, | ||
33 | MPC8xx_CPM_SCC3, | ||
34 | MPC8xx_CPM_SCC4, | ||
35 | MPC8xx_CPM_SMC1, | ||
36 | MPC8xx_CPM_SMC2, | ||
37 | }, | ||
38 | }, | ||
39 | { | ||
40 | .ppc_sys_name = "MPC885", | ||
41 | .mask = 0xFFFFFFFF, | ||
42 | .value = 0x00000000, | ||
43 | .num_devices = 3, | ||
44 | .device_list = (enum ppc_sys_devices[]) | ||
45 | { | ||
46 | MPC8xx_CPM_FEC1, | ||
47 | MPC8xx_CPM_FEC2, | ||
48 | MPC8xx_CPM_SCC1, | ||
49 | MPC8xx_CPM_SCC2, | ||
50 | MPC8xx_CPM_SCC3, | ||
51 | MPC8xx_CPM_SCC4, | ||
52 | MPC8xx_CPM_SMC1, | ||
53 | MPC8xx_CPM_SMC2, | ||
54 | }, | ||
55 | }, | ||
56 | { /* default match */ | ||
57 | .ppc_sys_name = "", | ||
58 | .mask = 0x00000000, | ||
59 | .value = 0x00000000, | ||
60 | }, | ||
61 | }; | ||