diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-01-13 19:13:49 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-13 21:19:18 -0500 |
commit | 575e321606c5673efabf28c0fa075e198980c44e (patch) | |
tree | 0d9f9c1a78946aca34af74f701dc3f7cf251e47a /arch | |
parent | 91dc182ca6e25ee8b648ed2fb2a41859ead34903 (diff) |
[PATCH] powerpc: Make CHRP build again
This makes CHRP build again, although it's untested because my Pegasos
is currently in pieces.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/chrp/pci.c | 27 | ||||
-rw-r--r-- | arch/powerpc/platforms/chrp/setup.c | 7 | ||||
-rw-r--r-- | arch/powerpc/platforms/chrp/time.c | 7 |
3 files changed, 26 insertions, 15 deletions
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c index 82c429d487f3..00c52f27ef4f 100644 --- a/arch/powerpc/platforms/chrp/pci.c +++ b/arch/powerpc/platforms/chrp/pci.c | |||
@@ -135,12 +135,13 @@ int __init | |||
135 | hydra_init(void) | 135 | hydra_init(void) |
136 | { | 136 | { |
137 | struct device_node *np; | 137 | struct device_node *np; |
138 | struct resource r; | ||
138 | 139 | ||
139 | np = find_devices("mac-io"); | 140 | np = find_devices("mac-io"); |
140 | if (np == NULL || np->n_addrs == 0) | 141 | if (np == NULL || of_address_to_resource(np, 0, &r)) |
141 | return 0; | 142 | return 0; |
142 | Hydra = ioremap(np->addrs[0].address, np->addrs[0].size); | 143 | Hydra = ioremap(r.start, r.end-r.start); |
143 | printk("Hydra Mac I/O at %lx\n", np->addrs[0].address); | 144 | printk("Hydra Mac I/O at %lx\n", r.start); |
144 | printk("Hydra Feature_Control was %x", | 145 | printk("Hydra Feature_Control was %x", |
145 | in_le32(&Hydra->Feature_Control)); | 146 | in_le32(&Hydra->Feature_Control)); |
146 | out_le32(&Hydra->Feature_Control, (HYDRA_FC_SCC_CELL_EN | | 147 | out_le32(&Hydra->Feature_Control, (HYDRA_FC_SCC_CELL_EN | |
@@ -177,18 +178,24 @@ setup_python(struct pci_controller *hose, struct device_node *dev) | |||
177 | { | 178 | { |
178 | u32 __iomem *reg; | 179 | u32 __iomem *reg; |
179 | u32 val; | 180 | u32 val; |
180 | unsigned long addr = dev->addrs[0].address; | 181 | struct resource r; |
181 | 182 | ||
182 | setup_indirect_pci(hose, addr + 0xf8000, addr + 0xf8010); | 183 | if (of_address_to_resource(dev, 0, &r)) { |
184 | printk(KERN_ERR "No address for Python PCI controller\n"); | ||
185 | return; | ||
186 | } | ||
183 | 187 | ||
184 | /* Clear the magic go-slow bit */ | 188 | /* Clear the magic go-slow bit */ |
185 | reg = ioremap(dev->addrs[0].address + 0xf6000, 0x40); | 189 | reg = ioremap(r.start + 0xf6000, 0x40); |
190 | BUG_ON(!reg); | ||
186 | val = in_be32(®[12]); | 191 | val = in_be32(®[12]); |
187 | if (val & PRG_CL_RESET_VALID) { | 192 | if (val & PRG_CL_RESET_VALID) { |
188 | out_be32(®[12], val & ~PRG_CL_RESET_VALID); | 193 | out_be32(®[12], val & ~PRG_CL_RESET_VALID); |
189 | in_be32(®[12]); | 194 | in_be32(®[12]); |
190 | } | 195 | } |
191 | iounmap(reg); | 196 | iounmap(reg); |
197 | |||
198 | setup_indirect_pci(hose, r.start + 0xf8000, r.start + 0xf8010); | ||
192 | } | 199 | } |
193 | 200 | ||
194 | /* Marvell Discovery II based Pegasos 2 */ | 201 | /* Marvell Discovery II based Pegasos 2 */ |
@@ -218,7 +225,7 @@ chrp_find_bridges(void) | |||
218 | char *model, *machine; | 225 | char *model, *machine; |
219 | int is_longtrail = 0, is_mot = 0, is_pegasos = 0; | 226 | int is_longtrail = 0, is_mot = 0, is_pegasos = 0; |
220 | struct device_node *root = find_path_device("/"); | 227 | struct device_node *root = find_path_device("/"); |
221 | 228 | struct resource r; | |
222 | /* | 229 | /* |
223 | * The PCI host bridge nodes on some machines don't have | 230 | * The PCI host bridge nodes on some machines don't have |
224 | * properties to adequately identify them, so we have to | 231 | * properties to adequately identify them, so we have to |
@@ -238,7 +245,7 @@ chrp_find_bridges(void) | |||
238 | continue; | 245 | continue; |
239 | ++index; | 246 | ++index; |
240 | /* The GG2 bridge on the LongTrail doesn't have an address */ | 247 | /* The GG2 bridge on the LongTrail doesn't have an address */ |
241 | if (dev->n_addrs < 1 && !is_longtrail) { | 248 | if (of_address_to_resource(dev, 0, &r) && !is_longtrail) { |
242 | printk(KERN_WARNING "Can't use %s: no address\n", | 249 | printk(KERN_WARNING "Can't use %s: no address\n", |
243 | dev->full_name); | 250 | dev->full_name); |
244 | continue; | 251 | continue; |
@@ -255,8 +262,8 @@ chrp_find_bridges(void) | |||
255 | printk(KERN_INFO "PCI buses %d..%d", | 262 | printk(KERN_INFO "PCI buses %d..%d", |
256 | bus_range[0], bus_range[1]); | 263 | bus_range[0], bus_range[1]); |
257 | printk(" controlled by %s", dev->type); | 264 | printk(" controlled by %s", dev->type); |
258 | if (dev->n_addrs > 0) | 265 | if (!is_longtrail) |
259 | printk(" at %lx", dev->addrs[0].address); | 266 | printk(" at %lx", r.start); |
260 | printk("\n"); | 267 | printk("\n"); |
261 | 268 | ||
262 | hose = pcibios_alloc_controller(); | 269 | hose = pcibios_alloc_controller(); |
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c index 4ec8ba737e7d..2dc87aa5962f 100644 --- a/arch/powerpc/platforms/chrp/setup.c +++ b/arch/powerpc/platforms/chrp/setup.c | |||
@@ -352,9 +352,10 @@ static void __init chrp_find_openpic(void) | |||
352 | opaddr = opprop[na-1]; /* assume 32-bit */ | 352 | opaddr = opprop[na-1]; /* assume 32-bit */ |
353 | oplen /= na * sizeof(unsigned int); | 353 | oplen /= na * sizeof(unsigned int); |
354 | } else { | 354 | } else { |
355 | if (np->n_addrs == 0) | 355 | struct resource r; |
356 | if (of_address_to_resource(np, 0, &r)) | ||
356 | return; | 357 | return; |
357 | opaddr = np->addrs[0].address; | 358 | opaddr = r.start; |
358 | oplen = 0; | 359 | oplen = 0; |
359 | } | 360 | } |
360 | 361 | ||
@@ -377,7 +378,7 @@ static void __init chrp_find_openpic(void) | |||
377 | */ | 378 | */ |
378 | if (oplen < len) { | 379 | if (oplen < len) { |
379 | printk(KERN_ERR "Insufficient addresses for distributed" | 380 | printk(KERN_ERR "Insufficient addresses for distributed" |
380 | " OpenPIC (%d < %d)\n", np->n_addrs, len); | 381 | " OpenPIC (%d < %d)\n", oplen, len); |
381 | len = oplen; | 382 | len = oplen; |
382 | } | 383 | } |
383 | 384 | ||
diff --git a/arch/powerpc/platforms/chrp/time.c b/arch/powerpc/platforms/chrp/time.c index 737ee5d9f0aa..36a0f97bb7b1 100644 --- a/arch/powerpc/platforms/chrp/time.c +++ b/arch/powerpc/platforms/chrp/time.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/mc146818rtc.h> | 21 | #include <linux/mc146818rtc.h> |
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/bcd.h> | 23 | #include <linux/bcd.h> |
24 | #include <linux/ioport.h> | ||
24 | 25 | ||
25 | #include <asm/io.h> | 26 | #include <asm/io.h> |
26 | #include <asm/nvram.h> | 27 | #include <asm/nvram.h> |
@@ -37,14 +38,16 @@ static int nvram_data = NVRAM_DATA; | |||
37 | long __init chrp_time_init(void) | 38 | long __init chrp_time_init(void) |
38 | { | 39 | { |
39 | struct device_node *rtcs; | 40 | struct device_node *rtcs; |
41 | struct resource r; | ||
40 | int base; | 42 | int base; |
41 | 43 | ||
42 | rtcs = find_compatible_devices("rtc", "pnpPNP,b00"); | 44 | rtcs = find_compatible_devices("rtc", "pnpPNP,b00"); |
43 | if (rtcs == NULL) | 45 | if (rtcs == NULL) |
44 | rtcs = find_compatible_devices("rtc", "ds1385-rtc"); | 46 | rtcs = find_compatible_devices("rtc", "ds1385-rtc"); |
45 | if (rtcs == NULL || rtcs->addrs == NULL) | 47 | if (rtcs == NULL || of_address_to_resource(rtcs, 0, &r)) |
46 | return 0; | 48 | return 0; |
47 | base = rtcs->addrs[0].address; | 49 | |
50 | base = r.start; | ||
48 | nvram_as1 = 0; | 51 | nvram_as1 = 0; |
49 | nvram_as0 = base; | 52 | nvram_as0 = base; |
50 | nvram_data = base + 1; | 53 | nvram_data = base + 1; |