diff options
author | Manuel Lauss <manuel.lauss@googlemail.com> | 2011-08-12 05:39:44 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2011-10-24 18:34:24 -0400 |
commit | 7517de348663b08a808aff44b5300e817157a568 (patch) | |
tree | b70b0bdbb30f2ef796c4ca319ad922e7686ca51c /arch/mips/alchemy/gpr/platform.c | |
parent | 7cc2e272da3d88c0de9e05b32729402785bd9206 (diff) |
MIPS: Alchemy: Redo PCI as platform driver
- Rewrite Alchemy PCI support as a platform driver.
- Fixup boards which have PCI.
Run-tested on DB1500 and DB1550.
Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
To: Linux-MIPS <linux-mips@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/2706/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
delete mode 100644 arch/mips/alchemy/common/pci.c
delete mode 100644 arch/mips/pci/fixup-au1000.c
delete mode 100644 arch/mips/pci/ops-au1000.c
create mode 100644 arch/mips/pci/pci-alchemy.c
Diffstat (limited to 'arch/mips/alchemy/gpr/platform.c')
-rw-r--r-- | arch/mips/alchemy/gpr/platform.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/arch/mips/alchemy/gpr/platform.c b/arch/mips/alchemy/gpr/platform.c index 14b46629cfc8..982ce85db60d 100644 --- a/arch/mips/alchemy/gpr/platform.c +++ b/arch/mips/alchemy/gpr/platform.c | |||
@@ -167,6 +167,45 @@ static struct i2c_board_info gpr_i2c_info[] __initdata = { | |||
167 | } | 167 | } |
168 | }; | 168 | }; |
169 | 169 | ||
170 | |||
171 | |||
172 | static struct resource alchemy_pci_host_res[] = { | ||
173 | [0] = { | ||
174 | .start = AU1500_PCI_PHYS_ADDR, | ||
175 | .end = AU1500_PCI_PHYS_ADDR + 0xfff, | ||
176 | .flags = IORESOURCE_MEM, | ||
177 | }, | ||
178 | }; | ||
179 | |||
180 | static int gpr_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin) | ||
181 | { | ||
182 | if ((slot == 0) && (pin == 1)) | ||
183 | return AU1550_PCI_INTA; | ||
184 | else if ((slot == 0) && (pin == 2)) | ||
185 | return AU1550_PCI_INTB; | ||
186 | |||
187 | return -1; | ||
188 | } | ||
189 | |||
190 | static struct alchemy_pci_platdata gpr_pci_pd = { | ||
191 | .board_map_irq = gpr_map_pci_irq, | ||
192 | .pci_cfg_set = PCI_CONFIG_AEN | PCI_CONFIG_R2H | PCI_CONFIG_R1H | | ||
193 | PCI_CONFIG_CH | | ||
194 | #if defined(__MIPSEB__) | ||
195 | PCI_CONFIG_SIC_HWA_DAT | PCI_CONFIG_SM, | ||
196 | #else | ||
197 | 0, | ||
198 | #endif | ||
199 | }; | ||
200 | |||
201 | static struct platform_device gpr_pci_host_dev = { | ||
202 | .dev.platform_data = &gpr_pci_pd, | ||
203 | .name = "alchemy-pci", | ||
204 | .id = 0, | ||
205 | .num_resources = ARRAY_SIZE(alchemy_pci_host_res), | ||
206 | .resource = alchemy_pci_host_res, | ||
207 | }; | ||
208 | |||
170 | static struct platform_device *gpr_devices[] __initdata = { | 209 | static struct platform_device *gpr_devices[] __initdata = { |
171 | &gpr_wdt_device, | 210 | &gpr_wdt_device, |
172 | &gpr_mtd_device, | 211 | &gpr_mtd_device, |
@@ -174,6 +213,14 @@ static struct platform_device *gpr_devices[] __initdata = { | |||
174 | &gpr_led_devices, | 213 | &gpr_led_devices, |
175 | }; | 214 | }; |
176 | 215 | ||
216 | static int __init gpr_pci_init(void) | ||
217 | { | ||
218 | return platform_device_register(&gpr_pci_host_dev); | ||
219 | } | ||
220 | /* must be arch_initcall; MIPS PCI scans busses in a subsys_initcall */ | ||
221 | arch_initcall(gpr_pci_init); | ||
222 | |||
223 | |||
177 | static int __init gpr_dev_init(void) | 224 | static int __init gpr_dev_init(void) |
178 | { | 225 | { |
179 | i2c_register_board_info(0, gpr_i2c_info, ARRAY_SIZE(gpr_i2c_info)); | 226 | i2c_register_board_info(0, gpr_i2c_info, ARRAY_SIZE(gpr_i2c_info)); |