diff options
author | Paul Mackerras <paulus@samba.org> | 2008-01-23 23:29:14 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-01-23 23:29:14 -0500 |
commit | dcb571be2019ae677bc5ed64437dbc87ae1eb67f (patch) | |
tree | 1b93f9ea3568be4dcc49ffb2adc0d3ab0a02b47f /arch/powerpc/kernel | |
parent | 9156ad48338e0306e508ead5c0d9986050744475 (diff) | |
parent | 96f39c1718091d63dc1c5012d566737ea0d2a20c (diff) |
Merge branch 'for-2.6.25' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc into for-2.6.25
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/head_fsl_booke.S | 20 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 8 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci_32.c | 58 | ||||
-rw-r--r-- | arch/powerpc/kernel/rio.c | 52 |
5 files changed, 71 insertions, 68 deletions
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index d9b377070caa..58dbfeff9b4d 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -70,6 +70,7 @@ pci64-$(CONFIG_PPC64) += pci_dn.o isa-bridge.o | |||
70 | obj-$(CONFIG_PCI) += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \ | 70 | obj-$(CONFIG_PCI) += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \ |
71 | pci-common.o | 71 | pci-common.o |
72 | obj-$(CONFIG_PCI_MSI) += msi.o | 72 | obj-$(CONFIG_PCI_MSI) += msi.o |
73 | obj-$(CONFIG_RAPIDIO) += rio.o | ||
73 | obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o \ | 74 | obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o \ |
74 | machine_kexec_$(CONFIG_WORD_SIZE).o | 75 | machine_kexec_$(CONFIG_WORD_SIZE).o |
75 | obj-$(CONFIG_AUDIT) += audit.o | 76 | obj-$(CONFIG_AUDIT) += audit.o |
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S index 7aecb39a5a45..d9cc2c288d9e 100644 --- a/arch/powerpc/kernel/head_fsl_booke.S +++ b/arch/powerpc/kernel/head_fsl_booke.S | |||
@@ -73,8 +73,8 @@ _ENTRY(_start); | |||
73 | /* We try to not make any assumptions about how the boot loader | 73 | /* We try to not make any assumptions about how the boot loader |
74 | * setup or used the TLBs. We invalidate all mappings from the | 74 | * setup or used the TLBs. We invalidate all mappings from the |
75 | * boot loader and load a single entry in TLB1[0] to map the | 75 | * boot loader and load a single entry in TLB1[0] to map the |
76 | * first 16M of kernel memory. Any boot info passed from the | 76 | * first 64M of kernel memory. Any boot info passed from the |
77 | * bootloader needs to live in this first 16M. | 77 | * bootloader needs to live in this first 64M. |
78 | * | 78 | * |
79 | * Requirement on bootloader: | 79 | * Requirement on bootloader: |
80 | * - The page we're executing in needs to reside in TLB1 and | 80 | * - The page we're executing in needs to reside in TLB1 and |
@@ -167,7 +167,7 @@ skpinv: addi r6,r6,1 /* Increment */ | |||
167 | mtspr SPRN_MAS0,r7 | 167 | mtspr SPRN_MAS0,r7 |
168 | tlbre | 168 | tlbre |
169 | 169 | ||
170 | /* Just modify the entry ID and EPN for the temp mapping */ | 170 | /* Just modify the entry ID, EPN and RPN for the temp mapping */ |
171 | lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ | 171 | lis r7,0x1000 /* Set MAS0(TLBSEL) = 1 */ |
172 | rlwimi r7,r5,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */ | 172 | rlwimi r7,r5,16,4,15 /* Setup MAS0 = TLBSEL | ESEL(r5) */ |
173 | mtspr SPRN_MAS0,r7 | 173 | mtspr SPRN_MAS0,r7 |
@@ -177,9 +177,12 @@ skpinv: addi r6,r6,1 /* Increment */ | |||
177 | ori r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_4K))@l | 177 | ori r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_4K))@l |
178 | mtspr SPRN_MAS1,r6 | 178 | mtspr SPRN_MAS1,r6 |
179 | mfspr r6,SPRN_MAS2 | 179 | mfspr r6,SPRN_MAS2 |
180 | li r7,0 /* temp EPN = 0 */ | 180 | lis r7,PHYSICAL_START@h |
181 | rlwimi r7,r6,0,20,31 | 181 | rlwimi r7,r6,0,20,31 |
182 | mtspr SPRN_MAS2,r7 | 182 | mtspr SPRN_MAS2,r7 |
183 | mfspr r6,SPRN_MAS3 | ||
184 | rlwimi r7,r6,0,20,31 | ||
185 | mtspr SPRN_MAS3,r7 | ||
183 | tlbwe | 186 | tlbwe |
184 | 187 | ||
185 | xori r6,r4,1 | 188 | xori r6,r4,1 |
@@ -222,11 +225,11 @@ skpinv: addi r6,r6,1 /* Increment */ | |||
222 | lis r6,0x1000 /* Set MAS0(TLBSEL) = TLB1(1), ESEL = 0 */ | 225 | lis r6,0x1000 /* Set MAS0(TLBSEL) = TLB1(1), ESEL = 0 */ |
223 | mtspr SPRN_MAS0,r6 | 226 | mtspr SPRN_MAS0,r6 |
224 | lis r6,(MAS1_VALID|MAS1_IPROT)@h | 227 | lis r6,(MAS1_VALID|MAS1_IPROT)@h |
225 | ori r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_16M))@l | 228 | ori r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_64M))@l |
226 | mtspr SPRN_MAS1,r6 | 229 | mtspr SPRN_MAS1,r6 |
227 | li r7,0 | 230 | li r7,0 |
228 | lis r6,KERNELBASE@h | 231 | lis r6,PAGE_OFFSET@h |
229 | ori r6,r6,KERNELBASE@l | 232 | ori r6,r6,PAGE_OFFSET@l |
230 | rlwimi r6,r7,0,20,31 | 233 | rlwimi r6,r7,0,20,31 |
231 | mtspr SPRN_MAS2,r6 | 234 | mtspr SPRN_MAS2,r6 |
232 | li r7,(MAS3_SX|MAS3_SW|MAS3_SR) | 235 | li r7,(MAS3_SX|MAS3_SW|MAS3_SR) |
@@ -234,6 +237,9 @@ skpinv: addi r6,r6,1 /* Increment */ | |||
234 | tlbwe | 237 | tlbwe |
235 | 238 | ||
236 | /* 7. Jump to KERNELBASE mapping */ | 239 | /* 7. Jump to KERNELBASE mapping */ |
240 | lis r6,KERNELBASE@h | ||
241 | ori r6,r6,KERNELBASE@l | ||
242 | rlwimi r6,r7,0,20,31 | ||
237 | lis r7,MSR_KERNEL@h | 243 | lis r7,MSR_KERNEL@h |
238 | ori r7,r7,MSR_KERNEL@l | 244 | ori r7,r7,MSR_KERNEL@l |
239 | bl 1f /* Find our address */ | 245 | bl 1f /* Find our address */ |
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index d394d41b61d5..980fe32895c0 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -792,9 +792,10 @@ static void __devinit __pcibios_fixup_bus(struct pci_bus *bus) | |||
792 | for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) { | 792 | for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) { |
793 | if ((res = bus->resource[i]) == NULL) | 793 | if ((res = bus->resource[i]) == NULL) |
794 | continue; | 794 | continue; |
795 | if (!res->flags || bus->self->transparent) | 795 | if (!res->flags) |
796 | continue; | ||
797 | if (i >= 3 && bus->self->transparent) | ||
796 | continue; | 798 | continue; |
797 | |||
798 | /* On PowerMac, Apple leaves bridge windows open over | 799 | /* On PowerMac, Apple leaves bridge windows open over |
799 | * an inaccessible region of memory space (0...fffff) | 800 | * an inaccessible region of memory space (0...fffff) |
800 | * which is somewhat bogus, but that's what they think | 801 | * which is somewhat bogus, but that's what they think |
@@ -806,7 +807,8 @@ static void __devinit __pcibios_fixup_bus(struct pci_bus *bus) | |||
806 | * equal to the pci_mem_offset of the host bridge and | 807 | * equal to the pci_mem_offset of the host bridge and |
807 | * their size is smaller than 1M. | 808 | * their size is smaller than 1M. |
808 | */ | 809 | */ |
809 | if (res->start == hose->pci_mem_offset && | 810 | if (res->flags & IORESOURCE_MEM && |
811 | res->start == hose->pci_mem_offset && | ||
810 | res->end < 0x100000) { | 812 | res->end < 0x100000) { |
811 | printk(KERN_INFO | 813 | printk(KERN_INFO |
812 | "PCI: Closing bogus Apple Firmware" | 814 | "PCI: Closing bogus Apple Firmware" |
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index 14e300f85ce4..88db4ffaf11c 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c | |||
@@ -94,64 +94,6 @@ fixup_cpc710_pci64(struct pci_dev* dev) | |||
94 | } | 94 | } |
95 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64); | 95 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64); |
96 | 96 | ||
97 | |||
98 | void __init | ||
99 | update_bridge_resource(struct pci_dev *dev, struct resource *res) | ||
100 | { | ||
101 | u8 io_base_lo, io_limit_lo; | ||
102 | u16 mem_base, mem_limit; | ||
103 | u16 cmd; | ||
104 | resource_size_t start, end, off; | ||
105 | struct pci_controller *hose = dev->sysdata; | ||
106 | |||
107 | if (!hose) { | ||
108 | printk("update_bridge_base: no hose?\n"); | ||
109 | return; | ||
110 | } | ||
111 | pci_read_config_word(dev, PCI_COMMAND, &cmd); | ||
112 | pci_write_config_word(dev, PCI_COMMAND, | ||
113 | cmd & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY)); | ||
114 | if (res->flags & IORESOURCE_IO) { | ||
115 | off = (unsigned long) hose->io_base_virt - isa_io_base; | ||
116 | start = res->start - off; | ||
117 | end = res->end - off; | ||
118 | io_base_lo = (start >> 8) & PCI_IO_RANGE_MASK; | ||
119 | io_limit_lo = (end >> 8) & PCI_IO_RANGE_MASK; | ||
120 | if (end > 0xffff) | ||
121 | io_base_lo |= PCI_IO_RANGE_TYPE_32; | ||
122 | else | ||
123 | io_base_lo |= PCI_IO_RANGE_TYPE_16; | ||
124 | pci_write_config_word(dev, PCI_IO_BASE_UPPER16, | ||
125 | start >> 16); | ||
126 | pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16, | ||
127 | end >> 16); | ||
128 | pci_write_config_byte(dev, PCI_IO_BASE, io_base_lo); | ||
129 | pci_write_config_byte(dev, PCI_IO_LIMIT, io_limit_lo); | ||
130 | |||
131 | } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH)) | ||
132 | == IORESOURCE_MEM) { | ||
133 | off = hose->pci_mem_offset; | ||
134 | mem_base = ((res->start - off) >> 16) & PCI_MEMORY_RANGE_MASK; | ||
135 | mem_limit = ((res->end - off) >> 16) & PCI_MEMORY_RANGE_MASK; | ||
136 | pci_write_config_word(dev, PCI_MEMORY_BASE, mem_base); | ||
137 | pci_write_config_word(dev, PCI_MEMORY_LIMIT, mem_limit); | ||
138 | |||
139 | } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH)) | ||
140 | == (IORESOURCE_MEM | IORESOURCE_PREFETCH)) { | ||
141 | off = hose->pci_mem_offset; | ||
142 | mem_base = ((res->start - off) >> 16) & PCI_PREF_RANGE_MASK; | ||
143 | mem_limit = ((res->end - off) >> 16) & PCI_PREF_RANGE_MASK; | ||
144 | pci_write_config_word(dev, PCI_PREF_MEMORY_BASE, mem_base); | ||
145 | pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, mem_limit); | ||
146 | |||
147 | } else { | ||
148 | DBG(KERN_ERR "PCI: ugh, bridge %s res has flags=%lx\n", | ||
149 | pci_name(dev), res->flags); | ||
150 | } | ||
151 | pci_write_config_word(dev, PCI_COMMAND, cmd); | ||
152 | } | ||
153 | |||
154 | |||
155 | #ifdef CONFIG_PPC_OF | 97 | #ifdef CONFIG_PPC_OF |
156 | /* | 98 | /* |
157 | * Functions below are used on OpenFirmware machines. | 99 | * Functions below are used on OpenFirmware machines. |
diff --git a/arch/powerpc/kernel/rio.c b/arch/powerpc/kernel/rio.c new file mode 100644 index 000000000000..29487fedfc76 --- /dev/null +++ b/arch/powerpc/kernel/rio.c | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * RapidIO PPC32 support | ||
3 | * | ||
4 | * Copyright 2005 MontaVista Software, Inc. | ||
5 | * Matt Porter <mporter@kernel.crashing.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | */ | ||
12 | |||
13 | #include <linux/init.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/rio.h> | ||
16 | |||
17 | #include <asm/rio.h> | ||
18 | |||
19 | /** | ||
20 | * platform_rio_init - Do platform specific RIO init | ||
21 | * | ||
22 | * Any platform specific initialization of RapdIO | ||
23 | * hardware is done here as well as registration | ||
24 | * of any active master ports in the system. | ||
25 | */ | ||
26 | void __attribute__ ((weak)) | ||
27 | platform_rio_init(void) | ||
28 | { | ||
29 | printk(KERN_WARNING "RIO: No platform_rio_init() present\n"); | ||
30 | } | ||
31 | |||
32 | /** | ||
33 | * ppc_rio_init - Do PPC32 RIO init | ||
34 | * | ||
35 | * Calls platform-specific RIO init code and then calls | ||
36 | * rio_init_mports() to initialize any master ports that | ||
37 | * have been registered with the RIO subsystem. | ||
38 | */ | ||
39 | static int __init ppc_rio_init(void) | ||
40 | { | ||
41 | printk(KERN_INFO "RIO: RapidIO init\n"); | ||
42 | |||
43 | /* Platform specific initialization */ | ||
44 | platform_rio_init(); | ||
45 | |||
46 | /* Enumerate all registered ports */ | ||
47 | rio_init_mports(); | ||
48 | |||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | subsys_initcall(ppc_rio_init); | ||