aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/alchemy/devboards/pb1500
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/alchemy/devboards/pb1500')
-rw-r--r--arch/mips/alchemy/devboards/pb1500/board_setup.c33
-rw-r--r--arch/mips/alchemy/devboards/pb1500/platform.c48
2 files changed, 59 insertions, 22 deletions
diff --git a/arch/mips/alchemy/devboards/pb1500/board_setup.c b/arch/mips/alchemy/devboards/pb1500/board_setup.c
index 3b4fa3206969..37c1883b5ea9 100644
--- a/arch/mips/alchemy/devboards/pb1500/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1500/board_setup.c
@@ -33,13 +33,6 @@
33 33
34#include <prom.h> 34#include <prom.h>
35 35
36
37char irq_tab_alchemy[][5] __initdata = {
38 [12] = { -1, AU1500_PCI_INTA, 0xff, 0xff, 0xff }, /* IDSEL 12 - HPT370 */
39 [13] = { -1, AU1500_PCI_INTA, AU1500_PCI_INTB, AU1500_PCI_INTC, AU1500_PCI_INTD }, /* IDSEL 13 - PCI slot */
40};
41
42
43const char *get_system_type(void) 36const char *get_system_type(void)
44{ 37{
45 return "Alchemy Pb1500"; 38 return "Alchemy Pb1500";
@@ -101,20 +94,18 @@ void __init board_setup(void)
101#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */ 94#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */
102 95
103#ifdef CONFIG_PCI 96#ifdef CONFIG_PCI
104 /* Setup PCI bus controller */ 97 {
105 au_writel(0, Au1500_PCI_CMEM); 98 void __iomem *base =
106 au_writel(0x00003fff, Au1500_CFG_BASE); 99 (void __iomem *)KSEG1ADDR(AU1500_PCI_PHYS_ADDR);
107#if defined(__MIPSEB__) 100 /* Setup PCI bus controller */
108 au_writel(0xf | (2 << 6) | (1 << 4), Au1500_PCI_CFG); 101 __raw_writel(0x00003fff, base + PCI_REG_CMEM);
109#else 102 __raw_writel(0xf0000000, base + PCI_REG_MWMASK_DEV);
110 au_writel(0xf, Au1500_PCI_CFG); 103 __raw_writel(0, base + PCI_REG_MWBASE_REV_CCL);
111#endif 104 __raw_writel(0x02a00356, base + PCI_REG_STATCMD);
112 au_writel(0xf0000000, Au1500_PCI_MWMASK_DEV); 105 __raw_writel(0x00003c04, base + PCI_REG_PARAM);
113 au_writel(0, Au1500_PCI_MWBASE_REV_CCL); 106 __raw_writel(0x00000008, base + PCI_REG_MBAR);
114 au_writel(0x02a00356, Au1500_PCI_STATCMD); 107 wmb();
115 au_writel(0x00003c04, Au1500_PCI_HDRTYPE); 108 }
116 au_writel(0x00000008, Au1500_PCI_MBAR);
117 au_sync();
118#endif 109#endif
119 110
120 /* Enable sys bus clock divider when IDLE state or no bus activity. */ 111 /* Enable sys bus clock divider when IDLE state or no bus activity. */
diff --git a/arch/mips/alchemy/devboards/pb1500/platform.c b/arch/mips/alchemy/devboards/pb1500/platform.c
index 42b0e6b8cd58..9f0b5a0b4795 100644
--- a/arch/mips/alchemy/devboards/pb1500/platform.c
+++ b/arch/mips/alchemy/devboards/pb1500/platform.c
@@ -19,11 +19,56 @@
19 */ 19 */
20 20
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/platform_device.h>
22#include <asm/mach-au1x00/au1000.h> 23#include <asm/mach-au1x00/au1000.h>
23#include <asm/mach-db1x00/bcsr.h> 24#include <asm/mach-db1x00/bcsr.h>
24 25
25#include "../platform.h" 26#include "../platform.h"
26 27
28static int pb1500_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin)
29{
30 if ((slot < 12) || (slot > 13) || pin == 0)
31 return -1;
32 if (slot == 12)
33 return (pin == 1) ? AU1500_PCI_INTA : 0xff;
34 if (slot == 13) {
35 switch (pin) {
36 case 1: return AU1500_PCI_INTA;
37 case 2: return AU1500_PCI_INTB;
38 case 3: return AU1500_PCI_INTC;
39 case 4: return AU1500_PCI_INTD;
40 }
41 }
42 return -1;
43}
44
45static struct resource alchemy_pci_host_res[] = {
46 [0] = {
47 .start = AU1500_PCI_PHYS_ADDR,
48 .end = AU1500_PCI_PHYS_ADDR + 0xfff,
49 .flags = IORESOURCE_MEM,
50 },
51};
52
53static struct alchemy_pci_platdata pb1500_pci_pd = {
54 .board_map_irq = pb1500_map_pci_irq,
55 .pci_cfg_set = PCI_CONFIG_AEN | PCI_CONFIG_R2H | PCI_CONFIG_R1H |
56 PCI_CONFIG_CH |
57#if defined(__MIPSEB__)
58 PCI_CONFIG_SIC_HWA_DAT | PCI_CONFIG_SM,
59#else
60 0,
61#endif
62};
63
64static struct platform_device pb1500_pci_host = {
65 .dev.platform_data = &pb1500_pci_pd,
66 .name = "alchemy-pci",
67 .id = 0,
68 .num_resources = ARRAY_SIZE(alchemy_pci_host_res),
69 .resource = alchemy_pci_host_res,
70};
71
27static int __init pb1500_dev_init(void) 72static int __init pb1500_dev_init(void)
28{ 73{
29 int swapped; 74 int swapped;
@@ -41,7 +86,8 @@ static int __init pb1500_dev_init(void)
41 86
42 swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT; 87 swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT;
43 db1x_register_norflash(64 * 1024 * 1024, 4, swapped); 88 db1x_register_norflash(64 * 1024 * 1024, 4, swapped);
89 platform_device_register(&pb1500_pci_host);
44 90
45 return 0; 91 return 0;
46} 92}
47device_initcall(pb1500_dev_init); 93arch_initcall(pb1500_dev_init);