diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-29 14:28:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-29 14:28:30 -0500 |
commit | 76babde121d2ffef04ca692ce64ef9f8a9866086 (patch) | |
tree | 294923bbb4974258d86d223e35eee691abacdfb1 /arch/ppc/platforms/lite5200.c | |
parent | e71ac6032edf77a1e4a81f3e3b260807e94b37a5 (diff) | |
parent | 15e812ad849e142e3dfc984d33c4d8042389f148 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (67 commits)
[PATCH] powerpc: Remove oprofile spinlock backtrace code
[PATCH] powerpc: Add oprofile calltrace support to all powerpc cpus
[PATCH] powerpc: Add oprofile calltrace support
[PATCH] for_each_possible_cpu: ppc
[PATCH] for_each_possible_cpu: powerpc
[PATCH] lock PTE before updating it in 440/BookE page fault handler
[PATCH] powerpc: Kill _machine and hard-coded platform numbers
ppc: Fix compile error in arch/ppc/lib/strcase.c
[PATCH] git-powerpc: WARN was a dumb idea
[PATCH] powerpc: a couple of trivial compile warning fixes
powerpc: remove OCP references
powerpc: Make uImage default build output for MPC8540 ADS
powerpc: move math-emu over to arch/powerpc
powerpc: use memparse() for mem= command line parsing
ppc: fix strncasecmp prototype
[PATCH] powerpc: make ISA floppies work again
[PATCH] powerpc: Fix some initcall return values
[PATCH] powerpc: Workaround for pSeries RTAS bug
[PATCH] spufs: fix __init/__exit annotations
[PATCH] powerpc: add hvc backend for rtas
...
Diffstat (limited to 'arch/ppc/platforms/lite5200.c')
-rw-r--r-- | arch/ppc/platforms/lite5200.c | 71 |
1 files changed, 40 insertions, 31 deletions
diff --git a/arch/ppc/platforms/lite5200.c b/arch/ppc/platforms/lite5200.c index 5171b53bccb5..fecbe9adc9e0 100644 --- a/arch/ppc/platforms/lite5200.c +++ b/arch/ppc/platforms/lite5200.c | |||
@@ -34,8 +34,7 @@ | |||
34 | #include <asm/mpc52xx.h> | 34 | #include <asm/mpc52xx.h> |
35 | #include <asm/ppc_sys.h> | 35 | #include <asm/ppc_sys.h> |
36 | #include <asm/machdep.h> | 36 | #include <asm/machdep.h> |
37 | 37 | #include <asm/pci-bridge.h> | |
38 | #include <syslib/mpc52xx_pci.h> | ||
39 | 38 | ||
40 | 39 | ||
41 | extern int powersave_nap; | 40 | extern int powersave_nap; |
@@ -68,44 +67,53 @@ lite5200_show_cpuinfo(struct seq_file *m) | |||
68 | } | 67 | } |
69 | 68 | ||
70 | #ifdef CONFIG_PCI | 69 | #ifdef CONFIG_PCI |
70 | #ifdef CONFIG_LITE5200B | ||
71 | static int | ||
72 | lite5200_map_irq(struct pci_dev *dev, unsigned char idsel, | ||
73 | unsigned char pin) | ||
74 | { | ||
75 | static char pci_irq_table[][4] = | ||
76 | /* | ||
77 | * PCI IDSEL/INTPIN->INTLINE | ||
78 | * A B C D | ||
79 | */ | ||
80 | { | ||
81 | {MPC52xx_IRQ0, MPC52xx_IRQ1, MPC52xx_IRQ2, MPC52xx_IRQ3}, | ||
82 | {MPC52xx_IRQ1, MPC52xx_IRQ2, MPC52xx_IRQ3, MPC52xx_IRQ0}, | ||
83 | }; | ||
84 | |||
85 | const long min_idsel = 24, max_idsel = 25, irqs_per_slot = 4; | ||
86 | return PCI_IRQ_TABLE_LOOKUP; | ||
87 | } | ||
88 | #else /* Original Lite */ | ||
71 | static int | 89 | static int |
72 | lite5200_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) | 90 | lite5200_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) |
73 | { | 91 | { |
74 | return (pin == 1) && (idsel==24) ? MPC52xx_IRQ0 : -1; | 92 | return (pin == 1) && (idsel==24) ? MPC52xx_IRQ0 : -1; |
75 | } | 93 | } |
76 | #endif | 94 | #endif |
95 | #endif | ||
77 | 96 | ||
78 | static void __init | 97 | static void __init |
79 | lite5200_setup_cpu(void) | 98 | lite5200_setup_cpu(void) |
80 | { | 99 | { |
81 | struct mpc52xx_cdm __iomem *cdm; | ||
82 | struct mpc52xx_gpio __iomem *gpio; | 100 | struct mpc52xx_gpio __iomem *gpio; |
83 | struct mpc52xx_intr __iomem *intr; | 101 | struct mpc52xx_intr __iomem *intr; |
84 | struct mpc52xx_xlb __iomem *xlb; | ||
85 | 102 | ||
86 | u32 port_config; | 103 | u32 port_config; |
87 | u32 intr_ctrl; | 104 | u32 intr_ctrl; |
88 | 105 | ||
89 | /* Map zones */ | 106 | /* Map zones */ |
90 | cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE); | ||
91 | gpio = ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE); | 107 | gpio = ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE); |
92 | xlb = ioremap(MPC52xx_PA(MPC52xx_XLB_OFFSET), MPC52xx_XLB_SIZE); | ||
93 | intr = ioremap(MPC52xx_PA(MPC52xx_INTR_OFFSET), MPC52xx_INTR_SIZE); | 108 | intr = ioremap(MPC52xx_PA(MPC52xx_INTR_OFFSET), MPC52xx_INTR_SIZE); |
94 | 109 | ||
95 | if (!cdm || !gpio || !xlb || !intr) { | 110 | if (!gpio || !intr) { |
96 | printk("lite5200.c: Error while mapping CDM/GPIO/XLB/INTR during" | 111 | printk(KERN_ERR __FILE__ ": " |
97 | "lite5200_setup_cpu\n"); | 112 | "Error while mapping GPIO/INTR during " |
113 | "lite5200_setup_cpu\n"); | ||
98 | goto unmap_regs; | 114 | goto unmap_regs; |
99 | } | 115 | } |
100 | 116 | ||
101 | /* Use internal 48 Mhz */ | ||
102 | out_8(&cdm->ext_48mhz_en, 0x00); | ||
103 | out_8(&cdm->fd_enable, 0x01); | ||
104 | if (in_be32(&cdm->rstcfg) & 0x40) /* Assumes 33Mhz clock */ | ||
105 | out_be16(&cdm->fd_counters, 0x0001); | ||
106 | else | ||
107 | out_be16(&cdm->fd_counters, 0x5555); | ||
108 | |||
109 | /* Get port mux config */ | 117 | /* Get port mux config */ |
110 | port_config = in_be32(&gpio->port_config); | 118 | port_config = in_be32(&gpio->port_config); |
111 | 119 | ||
@@ -116,29 +124,29 @@ lite5200_setup_cpu(void) | |||
116 | port_config &= ~0x00007000; /* Differential mode - USB1 only */ | 124 | port_config &= ~0x00007000; /* Differential mode - USB1 only */ |
117 | port_config |= 0x00001000; | 125 | port_config |= 0x00001000; |
118 | 126 | ||
127 | /* ATA CS is on csb_4/5 */ | ||
128 | port_config &= ~0x03000000; | ||
129 | port_config |= 0x01000000; | ||
130 | |||
119 | /* Commit port config */ | 131 | /* Commit port config */ |
120 | out_be32(&gpio->port_config, port_config); | 132 | out_be32(&gpio->port_config, port_config); |
121 | 133 | ||
122 | /* Configure the XLB Arbiter */ | 134 | /* IRQ[0-3] setup */ |
123 | out_be32(&xlb->master_pri_enable, 0xff); | ||
124 | out_be32(&xlb->master_priority, 0x11111111); | ||
125 | |||
126 | /* Enable ram snooping for 1GB window */ | ||
127 | out_be32(&xlb->config, in_be32(&xlb->config) | MPC52xx_XLB_CFG_SNOOP); | ||
128 | out_be32(&xlb->snoop_window, MPC52xx_PCI_TARGET_MEM | 0x1d); | ||
129 | |||
130 | /* IRQ[0-3] setup : IRQ0 - Level Active Low */ | ||
131 | /* IRQ[1-3] - Level Active High */ | ||
132 | intr_ctrl = in_be32(&intr->ctrl); | 135 | intr_ctrl = in_be32(&intr->ctrl); |
133 | intr_ctrl &= ~0x00ff0000; | 136 | intr_ctrl &= ~0x00ff0000; |
134 | intr_ctrl |= 0x00c00000; | 137 | #ifdef CONFIG_LITE5200B |
138 | /* IRQ[0-3] Level Active Low */ | ||
139 | intr_ctrl |= 0x00ff0000; | ||
140 | #else | ||
141 | /* IRQ0 Level Active Low | ||
142 | * IRQ[1-3] Level Active High */ | ||
143 | intr_ctrl |= 0x00c00000; | ||
144 | #endif | ||
135 | out_be32(&intr->ctrl, intr_ctrl); | 145 | out_be32(&intr->ctrl, intr_ctrl); |
136 | 146 | ||
137 | /* Unmap reg zone */ | 147 | /* Unmap reg zone */ |
138 | unmap_regs: | 148 | unmap_regs: |
139 | if (cdm) iounmap(cdm); | ||
140 | if (gpio) iounmap(gpio); | 149 | if (gpio) iounmap(gpio); |
141 | if (xlb) iounmap(xlb); | ||
142 | if (intr) iounmap(intr); | 150 | if (intr) iounmap(intr); |
143 | } | 151 | } |
144 | 152 | ||
@@ -146,7 +154,8 @@ static void __init | |||
146 | lite5200_setup_arch(void) | 154 | lite5200_setup_arch(void) |
147 | { | 155 | { |
148 | /* CPU & Port mux setup */ | 156 | /* CPU & Port mux setup */ |
149 | lite5200_setup_cpu(); | 157 | mpc52xx_setup_cpu(); /* Generic */ |
158 | lite5200_setup_cpu(); /* Platform specific */ | ||
150 | 159 | ||
151 | #ifdef CONFIG_PCI | 160 | #ifdef CONFIG_PCI |
152 | /* PCI Bridge setup */ | 161 | /* PCI Bridge setup */ |