diff options
author | Kumar Gala <galak@freescale.com> | 2005-09-03 18:55:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 03:05:59 -0400 |
commit | 66d2cc95d14b5d750a9c58209fddb62eb139eaab (patch) | |
tree | 7397b11eeb20801423e88975ecc1a79a81cf70e4 /arch/ppc/platforms | |
parent | cc9c540b6c4c883d7ff250c17647dedfa4184ca6 (diff) |
[PATCH] ppc32: Added PCI support MPC83xx
Adds support for the two PCI busses on MPC83xx and the MPC834x SYS/PIBS
reference board.
The code initializes PCI inbound/outbound windows, allocates and registers
PCI memory/io space. Be aware that setup of the PCI buses on the PIBs
board is expected to be done by the firmware.
Signed-off-by: Tony Li <tony.li@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/ppc/platforms')
-rw-r--r-- | arch/ppc/platforms/83xx/mpc834x_sys.c | 35 | ||||
-rw-r--r-- | arch/ppc/platforms/83xx/mpc834x_sys.h | 40 |
2 files changed, 52 insertions, 23 deletions
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.c b/arch/ppc/platforms/83xx/mpc834x_sys.c index ddd04d4c1ea9..b38a851a64ec 100644 --- a/arch/ppc/platforms/83xx/mpc834x_sys.c +++ b/arch/ppc/platforms/83xx/mpc834x_sys.c | |||
@@ -62,9 +62,29 @@ extern unsigned long total_memory; /* in mm/init */ | |||
62 | unsigned char __res[sizeof (bd_t)]; | 62 | unsigned char __res[sizeof (bd_t)]; |
63 | 63 | ||
64 | #ifdef CONFIG_PCI | 64 | #ifdef CONFIG_PCI |
65 | #error "PCI is not supported" | 65 | int |
66 | /* NEED mpc83xx_map_irq & mpc83xx_exclude_device | 66 | mpc83xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) |
67 | see platforms/85xx/mpc85xx_ads_common.c */ | 67 | { |
68 | static char pci_irq_table[][4] = | ||
69 | /* | ||
70 | * PCI IDSEL/INTPIN->INTLINE | ||
71 | * A B C D | ||
72 | */ | ||
73 | { | ||
74 | {PIRQA, PIRQB, PIRQC, PIRQD}, /* idsel 0x11 */ | ||
75 | {PIRQC, PIRQD, PIRQA, PIRQB}, /* idsel 0x12 */ | ||
76 | {PIRQD, PIRQA, PIRQB, PIRQC} /* idsel 0x13 */ | ||
77 | }; | ||
78 | |||
79 | const long min_idsel = 0x11, max_idsel = 0x13, irqs_per_slot = 4; | ||
80 | return PCI_IRQ_TABLE_LOOKUP; | ||
81 | } | ||
82 | |||
83 | int | ||
84 | mpc83xx_exclude_device(u_char bus, u_char devfn) | ||
85 | { | ||
86 | return PCIBIOS_SUCCESSFUL; | ||
87 | } | ||
68 | #endif /* CONFIG_PCI */ | 88 | #endif /* CONFIG_PCI */ |
69 | 89 | ||
70 | /* ************************************************************************ | 90 | /* ************************************************************************ |
@@ -88,7 +108,7 @@ mpc834x_sys_setup_arch(void) | |||
88 | 108 | ||
89 | #ifdef CONFIG_PCI | 109 | #ifdef CONFIG_PCI |
90 | /* setup PCI host bridges */ | 110 | /* setup PCI host bridges */ |
91 | mpc83xx_sys_setup_hose(); | 111 | mpc83xx_setup_hose(); |
92 | #endif | 112 | #endif |
93 | mpc83xx_early_serial_map(); | 113 | mpc83xx_early_serial_map(); |
94 | 114 | ||
@@ -175,10 +195,17 @@ mpc834x_sys_init_IRQ(void) | |||
175 | IRQ_SENSE_LEVEL, /* EXT 1 */ | 195 | IRQ_SENSE_LEVEL, /* EXT 1 */ |
176 | IRQ_SENSE_LEVEL, /* EXT 2 */ | 196 | IRQ_SENSE_LEVEL, /* EXT 2 */ |
177 | 0, /* EXT 3 */ | 197 | 0, /* EXT 3 */ |
198 | #ifdef CONFIG_PCI | ||
199 | IRQ_SENSE_LEVEL, /* EXT 4 */ | ||
200 | IRQ_SENSE_LEVEL, /* EXT 5 */ | ||
201 | IRQ_SENSE_LEVEL, /* EXT 6 */ | ||
202 | IRQ_SENSE_LEVEL, /* EXT 7 */ | ||
203 | #else | ||
178 | 0, /* EXT 4 */ | 204 | 0, /* EXT 4 */ |
179 | 0, /* EXT 5 */ | 205 | 0, /* EXT 5 */ |
180 | 0, /* EXT 6 */ | 206 | 0, /* EXT 6 */ |
181 | 0, /* EXT 7 */ | 207 | 0, /* EXT 7 */ |
208 | #endif | ||
182 | }; | 209 | }; |
183 | 210 | ||
184 | ipic_init(binfo->bi_immr_base + 0x00700, 0, MPC83xx_IPIC_IRQ_OFFSET, senses, 8); | 211 | ipic_init(binfo->bi_immr_base + 0x00700, 0, MPC83xx_IPIC_IRQ_OFFSET, senses, 8); |
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.h b/arch/ppc/platforms/83xx/mpc834x_sys.h index a2f6e49d7151..1584cd77a9ef 100644 --- a/arch/ppc/platforms/83xx/mpc834x_sys.h +++ b/arch/ppc/platforms/83xx/mpc834x_sys.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #define VIRT_IMMRBAR ((uint)0xfe000000) | 26 | #define VIRT_IMMRBAR ((uint)0xfe000000) |
27 | 27 | ||
28 | #define BCSR_PHYS_ADDR ((uint)0xf8000000) | 28 | #define BCSR_PHYS_ADDR ((uint)0xf8000000) |
29 | #define BCSR_SIZE ((uint)(32 * 1024)) | 29 | #define BCSR_SIZE ((uint)(128 * 1024)) |
30 | 30 | ||
31 | #define BCSR_MISC_REG2_OFF 0x07 | 31 | #define BCSR_MISC_REG2_OFF 0x07 |
32 | #define BCSR_MISC_REG2_PORESET 0x01 | 32 | #define BCSR_MISC_REG2_PORESET 0x01 |
@@ -34,23 +34,25 @@ | |||
34 | #define BCSR_MISC_REG3_OFF 0x08 | 34 | #define BCSR_MISC_REG3_OFF 0x08 |
35 | #define BCSR_MISC_REG3_CNFLOCK 0x80 | 35 | #define BCSR_MISC_REG3_CNFLOCK 0x80 |
36 | 36 | ||
37 | #ifdef CONFIG_PCI | 37 | #define PIRQA MPC83xx_IRQ_EXT4 |
38 | /* PCI interrupt controller */ | 38 | #define PIRQB MPC83xx_IRQ_EXT5 |
39 | #define PIRQA MPC83xx_IRQ_IRQ4 | 39 | #define PIRQC MPC83xx_IRQ_EXT6 |
40 | #define PIRQB MPC83xx_IRQ_IRQ5 | 40 | #define PIRQD MPC83xx_IRQ_EXT7 |
41 | #define PIRQC MPC83xx_IRQ_IRQ6 | 41 | |
42 | #define PIRQD MPC83xx_IRQ_IRQ7 | 42 | #define MPC83xx_PCI1_LOWER_IO 0x00000000 |
43 | 43 | #define MPC83xx_PCI1_UPPER_IO 0x00ffffff | |
44 | #define MPC834x_SYS_PCI1_LOWER_IO 0x00000000 | 44 | #define MPC83xx_PCI1_LOWER_MEM 0x80000000 |
45 | #define MPC834x_SYS_PCI1_UPPER_IO 0x00ffffff | 45 | #define MPC83xx_PCI1_UPPER_MEM 0x9fffffff |
46 | 46 | #define MPC83xx_PCI1_IO_BASE 0xe2000000 | |
47 | #define MPC834x_SYS_PCI1_LOWER_MEM 0x80000000 | 47 | #define MPC83xx_PCI1_MEM_OFFSET 0x00000000 |
48 | #define MPC834x_SYS_PCI1_UPPER_MEM 0x9fffffff | 48 | #define MPC83xx_PCI1_IO_SIZE 0x01000000 |
49 | 49 | ||
50 | #define MPC834x_SYS_PCI1_IO_BASE 0xe2000000 | 50 | #define MPC83xx_PCI2_LOWER_IO 0x00000000 |
51 | #define MPC834x_SYS_PCI1_MEM_OFFSET 0x00000000 | 51 | #define MPC83xx_PCI2_UPPER_IO 0x00ffffff |
52 | 52 | #define MPC83xx_PCI2_LOWER_MEM 0xa0000000 | |
53 | #define MPC834x_SYS_PCI1_IO_SIZE 0x01000000 | 53 | #define MPC83xx_PCI2_UPPER_MEM 0xbfffffff |
54 | #endif /* CONFIG_PCI */ | 54 | #define MPC83xx_PCI2_IO_BASE 0xe3000000 |
55 | #define MPC83xx_PCI2_MEM_OFFSET 0x00000000 | ||
56 | #define MPC83xx_PCI2_IO_SIZE 0x01000000 | ||
55 | 57 | ||
56 | #endif /* __MACH_MPC83XX_SYS_H__ */ | 58 | #endif /* __MACH_MPC83XX_SYS_H__ */ |