diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2010-02-26 14:04:15 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-02-26 14:06:24 -0500 |
commit | a7790532f5b7358c33a6b1834dc2b318de209f31 (patch) | |
tree | 0ceb9e24b3f54cb5c8453fb5a218e2a94a0f1cce /arch/mn10300/unit-asb2305 | |
parent | 2764fb4244cc1bc08df3667924ca4a972e90ac70 (diff) | |
parent | 60b341b778cc2929df16c0a504c91621b3c6a4ad (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
The SmartMedia FTL code depends on new kfifo bits from 2.6.33
Diffstat (limited to 'arch/mn10300/unit-asb2305')
-rw-r--r-- | arch/mn10300/unit-asb2305/include/unit/serial.h | 2 | ||||
-rw-r--r-- | arch/mn10300/unit-asb2305/include/unit/timex.h | 2 | ||||
-rw-r--r-- | arch/mn10300/unit-asb2305/leds.c | 4 | ||||
-rw-r--r-- | arch/mn10300/unit-asb2305/pci-asb2305.c | 39 | ||||
-rw-r--r-- | arch/mn10300/unit-asb2305/pci-asb2305.h | 1 | ||||
-rw-r--r-- | arch/mn10300/unit-asb2305/pci.c | 62 | ||||
-rw-r--r-- | arch/mn10300/unit-asb2305/unit-init.c | 5 |
7 files changed, 44 insertions, 71 deletions
diff --git a/arch/mn10300/unit-asb2305/include/unit/serial.h b/arch/mn10300/unit-asb2305/include/unit/serial.h index 3bfc90938787..8086cc092cec 100644 --- a/arch/mn10300/unit-asb2305/include/unit/serial.h +++ b/arch/mn10300/unit-asb2305/include/unit/serial.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #ifndef _ASM_UNIT_SERIAL_H | 11 | #ifndef _ASM_UNIT_SERIAL_H |
12 | #define _ASM_UNIT_SERIAL_H | 12 | #define _ASM_UNIT_SERIAL_H |
13 | 13 | ||
14 | #include <asm/cpu/cpu-regs.h> | 14 | #include <asm/cpu-regs.h> |
15 | #include <proc/irq.h> | 15 | #include <proc/irq.h> |
16 | #include <linux/serial_reg.h> | 16 | #include <linux/serial_reg.h> |
17 | 17 | ||
diff --git a/arch/mn10300/unit-asb2305/include/unit/timex.h b/arch/mn10300/unit-asb2305/include/unit/timex.h index a71c49aa85eb..d1c72d59fa9f 100644 --- a/arch/mn10300/unit-asb2305/include/unit/timex.h +++ b/arch/mn10300/unit-asb2305/include/unit/timex.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
16 | #endif /* __ASSEMBLY__ */ | 16 | #endif /* __ASSEMBLY__ */ |
17 | 17 | ||
18 | #include <asm/cpu/timer-regs.h> | 18 | #include <asm/timer-regs.h> |
19 | #include <unit/clock.h> | 19 | #include <unit/clock.h> |
20 | 20 | ||
21 | /* | 21 | /* |
diff --git a/arch/mn10300/unit-asb2305/leds.c b/arch/mn10300/unit-asb2305/leds.c index d345ff9042d5..6f8de9954026 100644 --- a/arch/mn10300/unit-asb2305/leds.c +++ b/arch/mn10300/unit-asb2305/leds.c | |||
@@ -13,8 +13,8 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <asm/io.h> | 14 | #include <asm/io.h> |
15 | #include <asm/processor.h> | 15 | #include <asm/processor.h> |
16 | #include <asm/cpu/intctl-regs.h> | 16 | #include <asm/intctl-regs.h> |
17 | #include <asm/cpu/rtc-regs.h> | 17 | #include <asm/rtc-regs.h> |
18 | #include <unit/leds.h> | 18 | #include <unit/leds.h> |
19 | 19 | ||
20 | static const u8 asb2305_led_hex_tbl[16] = { | 20 | static const u8 asb2305_led_hex_tbl[16] = { |
diff --git a/arch/mn10300/unit-asb2305/pci-asb2305.c b/arch/mn10300/unit-asb2305/pci-asb2305.c index d100ca788468..78cd134ddf7d 100644 --- a/arch/mn10300/unit-asb2305/pci-asb2305.c +++ b/arch/mn10300/unit-asb2305/pci-asb2305.c | |||
@@ -218,45 +218,6 @@ void __init pcibios_resource_survey(void) | |||
218 | pcibios_allocate_resources(1); | 218 | pcibios_allocate_resources(1); |
219 | } | 219 | } |
220 | 220 | ||
221 | int pcibios_enable_resources(struct pci_dev *dev, int mask) | ||
222 | { | ||
223 | u16 cmd, old_cmd; | ||
224 | int idx; | ||
225 | struct resource *r; | ||
226 | |||
227 | pci_read_config_word(dev, PCI_COMMAND, &cmd); | ||
228 | old_cmd = cmd; | ||
229 | |||
230 | for (idx = 0; idx < 6; idx++) { | ||
231 | /* Only set up the requested stuff */ | ||
232 | if (!(mask & (1 << idx))) | ||
233 | continue; | ||
234 | |||
235 | r = &dev->resource[idx]; | ||
236 | |||
237 | if (!r->start && r->end) { | ||
238 | printk(KERN_ERR | ||
239 | "PCI: Device %s not available because of" | ||
240 | " resource collisions\n", | ||
241 | pci_name(dev)); | ||
242 | return -EINVAL; | ||
243 | } | ||
244 | |||
245 | if (r->flags & IORESOURCE_IO) | ||
246 | cmd |= PCI_COMMAND_IO; | ||
247 | if (r->flags & IORESOURCE_MEM) | ||
248 | cmd |= PCI_COMMAND_MEMORY; | ||
249 | } | ||
250 | |||
251 | if (dev->resource[PCI_ROM_RESOURCE].start) | ||
252 | cmd |= PCI_COMMAND_MEMORY; | ||
253 | |||
254 | if (cmd != old_cmd) | ||
255 | pci_write_config_word(dev, PCI_COMMAND, cmd); | ||
256 | |||
257 | return 0; | ||
258 | } | ||
259 | |||
260 | /* | 221 | /* |
261 | * If we set up a device for bus mastering, we need to check the latency | 222 | * If we set up a device for bus mastering, we need to check the latency |
262 | * timer as certain crappy BIOSes forget to set it properly. | 223 | * timer as certain crappy BIOSes forget to set it properly. |
diff --git a/arch/mn10300/unit-asb2305/pci-asb2305.h b/arch/mn10300/unit-asb2305/pci-asb2305.h index 9763d1ce343a..c3fa294b6e28 100644 --- a/arch/mn10300/unit-asb2305/pci-asb2305.h +++ b/arch/mn10300/unit-asb2305/pci-asb2305.h | |||
@@ -34,7 +34,6 @@ extern unsigned int pci_probe; | |||
34 | extern unsigned int pcibios_max_latency; | 34 | extern unsigned int pcibios_max_latency; |
35 | 35 | ||
36 | extern void pcibios_resource_survey(void); | 36 | extern void pcibios_resource_survey(void); |
37 | extern int pcibios_enable_resources(struct pci_dev *dev, int mask); | ||
38 | 37 | ||
39 | /* pci.c */ | 38 | /* pci.c */ |
40 | 39 | ||
diff --git a/arch/mn10300/unit-asb2305/pci.c b/arch/mn10300/unit-asb2305/pci.c index 07dbbcda3b2e..2cb7e75ba1c0 100644 --- a/arch/mn10300/unit-asb2305/pci.c +++ b/arch/mn10300/unit-asb2305/pci.c | |||
@@ -27,6 +27,29 @@ struct pci_bus *pci_root_bus; | |||
27 | struct pci_ops *pci_root_ops; | 27 | struct pci_ops *pci_root_ops; |
28 | 28 | ||
29 | /* | 29 | /* |
30 | * The accessible PCI window does not cover the entire CPU address space, but | ||
31 | * there are devices we want to access outside of that window, so we need to | ||
32 | * insert specific PCI bus resources instead of using the platform-level bus | ||
33 | * resources directly for the PCI root bus. | ||
34 | * | ||
35 | * These are configured and inserted by pcibios_init() and are attached to the | ||
36 | * root bus by pcibios_fixup_bus(). | ||
37 | */ | ||
38 | static struct resource pci_ioport_resource = { | ||
39 | .name = "PCI IO", | ||
40 | .start = 0xbe000000, | ||
41 | .end = 0xbe03ffff, | ||
42 | .flags = IORESOURCE_IO, | ||
43 | }; | ||
44 | |||
45 | static struct resource pci_iomem_resource = { | ||
46 | .name = "PCI mem", | ||
47 | .start = 0xb8000000, | ||
48 | .end = 0xbbffffff, | ||
49 | .flags = IORESOURCE_MEM, | ||
50 | }; | ||
51 | |||
52 | /* | ||
30 | * Functions for accessing PCI configuration space | 53 | * Functions for accessing PCI configuration space |
31 | */ | 54 | */ |
32 | 55 | ||
@@ -279,7 +302,7 @@ static int __init pci_sanity_check(struct pci_ops *o) | |||
279 | (x == PCI_VENDOR_ID_INTEL || x == PCI_VENDOR_ID_COMPAQ))) | 302 | (x == PCI_VENDOR_ID_INTEL || x == PCI_VENDOR_ID_COMPAQ))) |
280 | return 1; | 303 | return 1; |
281 | 304 | ||
282 | printk(KERN_ERROR "PCI: Sanity check failed\n"); | 305 | printk(KERN_ERR "PCI: Sanity check failed\n"); |
283 | return 0; | 306 | return 0; |
284 | } | 307 | } |
285 | 308 | ||
@@ -297,6 +320,7 @@ static int __init pci_check_direct(void) | |||
297 | printk(KERN_INFO "PCI: Using configuration ampci\n"); | 320 | printk(KERN_INFO "PCI: Using configuration ampci\n"); |
298 | request_mem_region(0xBE040000, 256, "AMPCI bridge"); | 321 | request_mem_region(0xBE040000, 256, "AMPCI bridge"); |
299 | request_mem_region(0xBFFFFFF4, 12, "PCI ampci"); | 322 | request_mem_region(0xBFFFFFF4, 12, "PCI ampci"); |
323 | request_mem_region(0xBC000000, 32 * 1024 * 1024, "PCI SRAM"); | ||
300 | return 0; | 324 | return 0; |
301 | } | 325 | } |
302 | 326 | ||
@@ -358,6 +382,11 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus) | |||
358 | { | 382 | { |
359 | struct pci_dev *dev; | 383 | struct pci_dev *dev; |
360 | 384 | ||
385 | if (bus->number == 0) { | ||
386 | bus->resource[0] = &pci_ioport_resource; | ||
387 | bus->resource[1] = &pci_iomem_resource; | ||
388 | } | ||
389 | |||
361 | if (bus->self) { | 390 | if (bus->self) { |
362 | pci_read_bridge_bases(bus); | 391 | pci_read_bridge_bases(bus); |
363 | pcibios_fixup_device_resources(bus->self); | 392 | pcibios_fixup_device_resources(bus->self); |
@@ -380,6 +409,11 @@ static int __init pcibios_init(void) | |||
380 | iomem_resource.start = 0xA0000000; | 409 | iomem_resource.start = 0xA0000000; |
381 | iomem_resource.end = 0xDFFFFFFF; | 410 | iomem_resource.end = 0xDFFFFFFF; |
382 | 411 | ||
412 | if (insert_resource(&iomem_resource, &pci_iomem_resource) < 0) | ||
413 | panic("Unable to insert PCI IOMEM resource\n"); | ||
414 | if (insert_resource(&ioport_resource, &pci_ioport_resource) < 0) | ||
415 | panic("Unable to insert PCI IOPORT resource\n"); | ||
416 | |||
383 | if (!pci_probe) | 417 | if (!pci_probe) |
384 | return 0; | 418 | return 0; |
385 | 419 | ||
@@ -391,32 +425,11 @@ static int __init pcibios_init(void) | |||
391 | printk(KERN_INFO "PCI: Probing PCI hardware [mempage %08x]\n", | 425 | printk(KERN_INFO "PCI: Probing PCI hardware [mempage %08x]\n", |
392 | MEM_PAGING_REG); | 426 | MEM_PAGING_REG); |
393 | 427 | ||
394 | { | 428 | pci_root_bus = pci_scan_bus(0, &pci_direct_ampci, NULL); |
395 | #if 0 | ||
396 | static struct pci_bus am33_root_bus = { | ||
397 | .children = LIST_HEAD_INIT(am33_root_bus.children), | ||
398 | .devices = LIST_HEAD_INIT(am33_root_bus.devices), | ||
399 | .number = 0, | ||
400 | .secondary = 0, | ||
401 | .resource = { &ioport_resource, &iomem_resource }, | ||
402 | }; | ||
403 | |||
404 | am33_root_bus.ops = pci_root_ops; | ||
405 | list_add_tail(&am33_root_bus.node, &pci_root_buses); | ||
406 | |||
407 | am33_root_bus.subordinate = pci_do_scan_bus(0); | ||
408 | |||
409 | pci_root_bus = &am33_root_bus; | ||
410 | #else | ||
411 | pci_root_bus = pci_scan_bus(0, &pci_direct_ampci, NULL); | ||
412 | #endif | ||
413 | } | ||
414 | 429 | ||
415 | pcibios_irq_init(); | 430 | pcibios_irq_init(); |
416 | pcibios_fixup_irqs(); | 431 | pcibios_fixup_irqs(); |
417 | #if 0 | ||
418 | pcibios_resource_survey(); | 432 | pcibios_resource_survey(); |
419 | #endif | ||
420 | return 0; | 433 | return 0; |
421 | } | 434 | } |
422 | 435 | ||
@@ -440,7 +453,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
440 | { | 453 | { |
441 | int err; | 454 | int err; |
442 | 455 | ||
443 | err = pcibios_enable_resources(dev, mask); | 456 | err = pci_enable_resources(dev, mask); |
444 | if (err == 0) | 457 | if (err == 0) |
445 | pcibios_enable_irq(dev); | 458 | pcibios_enable_irq(dev); |
446 | return err; | 459 | return err; |
@@ -455,6 +468,7 @@ static void __init unit_disable_pcnet(struct pci_bus *bus, struct pci_ops *o) | |||
455 | 468 | ||
456 | bus->number = 0; | 469 | bus->number = 0; |
457 | 470 | ||
471 | o->read (bus, PCI_DEVFN(2, 0), PCI_VENDOR_ID, 4, &x); | ||
458 | o->read (bus, PCI_DEVFN(2, 0), PCI_COMMAND, 2, &x); | 472 | o->read (bus, PCI_DEVFN(2, 0), PCI_COMMAND, 2, &x); |
459 | x |= PCI_COMMAND_MASTER | | 473 | x |= PCI_COMMAND_MASTER | |
460 | PCI_COMMAND_IO | PCI_COMMAND_MEMORY | | 474 | PCI_COMMAND_IO | PCI_COMMAND_MEMORY | |
diff --git a/arch/mn10300/unit-asb2305/unit-init.c b/arch/mn10300/unit-asb2305/unit-init.c index 1c452cc3f6e9..a76c8e0ab90f 100644 --- a/arch/mn10300/unit-asb2305/unit-init.c +++ b/arch/mn10300/unit-asb2305/unit-init.c | |||
@@ -15,9 +15,8 @@ | |||
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/setup.h> | 16 | #include <asm/setup.h> |
17 | #include <asm/processor.h> | 17 | #include <asm/processor.h> |
18 | #include <asm/cpu/intctl-regs.h> | 18 | #include <asm/intctl-regs.h> |
19 | #include <asm/cpu/rtc-regs.h> | 19 | #include <asm/serial-regs.h> |
20 | #include <asm/cpu/serial-regs.h> | ||
21 | #include <unit/serial.h> | 20 | #include <unit/serial.h> |
22 | 21 | ||
23 | /* | 22 | /* |