aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-15 21:28:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-15 21:28:46 -0400
commitf26a3988917913b3d11b2bd741601a2c64ab9204 (patch)
tree69b3da12c23ebe30a4ed0563648eb1bca5e83185
parentac0e9c30b1cb22c01f3edbb94857de2bae7611ca (diff)
parentfaa5b9daa8bd8a18b5b1f3a8dd79261503f7cdd3 (diff)
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: [POWERPC] macintosh: Replace deprecated __initcall with device_initcall [POWERPC] cell: Fix section mismatches in io-workarounds code [POWERPC] spufs: Fix compile error [POWERPC] Fix uninitialized variable bug in copy_{to|from}_user [POWERPC] Add null pointer check to of_find_property [POWERPC] vmemmap fixes to use smaller pages [POWERPC] spufs: Fix pointer reference in find_victim [POWERPC] 85xx: SBC8548 - Add flash support and HW Rev reporting [POWERPC] 85xx: Fix some sparse warnings for 85xx MDS [POWERPC] 83xx: Enable DMA engine on the MPC8377 MDS board. [POWERPC] 86xx: mpc8610_hpcd: fix second serial port [POWERPC] 86xx: mpc8610_hpcd: add support for NOR and NAND flashes [POWERPC] 85xx: Add 8568 PHY workarounds to board code [POWERPC] 86xx: mpc8610_hpcd: use ULI526X driver for on-board ethernet
-rw-r--r--arch/powerpc/boot/dts/mpc8377_mds.dts27
-rw-r--r--arch/powerpc/boot/dts/mpc8610_hpcd.dts60
-rw-r--r--arch/powerpc/boot/dts/sbc8548.dts94
-rw-r--r--arch/powerpc/configs/mpc8610_hpcd_defconfig95
-rw-r--r--arch/powerpc/mm/hash_utils_64.c28
-rw-r--r--arch/powerpc/mm/init_64.c10
-rw-r--r--arch/powerpc/mm/slb.c16
-rw-r--r--arch/powerpc/mm/slb_low.S16
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c121
-rw-r--r--arch/powerpc/platforms/85xx/sbc8548.c30
-rw-r--r--arch/powerpc/platforms/86xx/mpc8610_hpcd.c15
-rw-r--r--arch/powerpc/platforms/cell/io-workarounds.c6
-rw-r--r--arch/powerpc/platforms/cell/io-workarounds.h6
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c1
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c2
-rw-r--r--drivers/macintosh/adb.c2
-rw-r--r--drivers/of/base.c3
-rw-r--r--include/asm-powerpc/mmu-hash64.h1
-rw-r--r--include/asm-powerpc/pgtable-ppc64.h10
-rw-r--r--include/asm-powerpc/uaccess.h4
20 files changed, 508 insertions, 39 deletions
diff --git a/arch/powerpc/boot/dts/mpc8377_mds.dts b/arch/powerpc/boot/dts/mpc8377_mds.dts
index eac8e1b59496..1e7802cc31ae 100644
--- a/arch/powerpc/boot/dts/mpc8377_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8377_mds.dts
@@ -268,6 +268,33 @@
268 interrupt-parent = <&ipic>; 268 interrupt-parent = <&ipic>;
269 }; 269 };
270 270
271 dma@82a8 {
272 #address-cells = <1>;
273 #size-cells = <1>;
274 compatible = "fsl,mpc8349-dma";
275 reg = <0x82a8 4>;
276 ranges = <0 0x8100 0x1a8>;
277 interrupt-parent = <&ipic>;
278 interrupts = <0x47 8>;
279 cell-index = <0>;
280 dma-channel@0 {
281 compatible = "fsl,mpc8349-dma-channel";
282 reg = <0 0x80>;
283 };
284 dma-channel@80 {
285 compatible = "fsl,mpc8349-dma-channel";
286 reg = <0x80 0x80>;
287 };
288 dma-channel@100 {
289 compatible = "fsl,mpc8349-dma-channel";
290 reg = <0x100 0x80>;
291 };
292 dma-channel@180 {
293 compatible = "fsl,mpc8349-dma-channel";
294 reg = <0x180 0x28>;
295 };
296 };
297
271 /* IPIC 298 /* IPIC
272 * interrupts cell = <intr #, sense> 299 * interrupts cell = <intr #, sense>
273 * sense values match linux IORESOURCE_IRQ_* defines: 300 * sense values match linux IORESOURCE_IRQ_* defines:
diff --git a/arch/powerpc/boot/dts/mpc8610_hpcd.dts b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
index bba234eb14a9..08a780d89807 100644
--- a/arch/powerpc/boot/dts/mpc8610_hpcd.dts
+++ b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
@@ -46,9 +46,63 @@
46 reg = <0x00000000 0x20000000>; // 512M at 0x0 46 reg = <0x00000000 0x20000000>; // 512M at 0x0
47 }; 47 };
48 48
49 board-control@e8000000 { 49 localbus@e0005000 {
50 compatible = "fsl,fpga-pixis"; 50 #address-cells = <2>;
51 reg = <0xe8000000 32>; // pixis at 0xe8000000 51 #size-cells = <1>;
52 compatible = "fsl,mpc8610-elbc", "fsl,elbc", "simple-bus";
53 reg = <0xe0005000 0x1000>;
54 interrupts = <19 2>;
55 interrupt-parent = <&mpic>;
56 ranges = <0 0 0xf8000000 0x08000000
57 1 0 0xf0000000 0x08000000
58 2 0 0xe8400000 0x00008000
59 4 0 0xe8440000 0x00008000
60 5 0 0xe8480000 0x00008000
61 6 0 0xe84c0000 0x00008000
62 3 0 0xe8000000 0x00000020>;
63
64 flash@0,0 {
65 compatible = "cfi-flash";
66 reg = <0 0 0x8000000>;
67 bank-width = <2>;
68 device-width = <1>;
69 };
70
71 flash@1,0 {
72 compatible = "cfi-flash";
73 reg = <1 0 0x8000000>;
74 bank-width = <2>;
75 device-width = <1>;
76 };
77
78 flash@2,0 {
79 compatible = "fsl,mpc8610-fcm-nand",
80 "fsl,elbc-fcm-nand";
81 reg = <2 0 0x8000>;
82 };
83
84 flash@4,0 {
85 compatible = "fsl,mpc8610-fcm-nand",
86 "fsl,elbc-fcm-nand";
87 reg = <4 0 0x8000>;
88 };
89
90 flash@5,0 {
91 compatible = "fsl,mpc8610-fcm-nand",
92 "fsl,elbc-fcm-nand";
93 reg = <5 0 0x8000>;
94 };
95
96 flash@6,0 {
97 compatible = "fsl,mpc8610-fcm-nand",
98 "fsl,elbc-fcm-nand";
99 reg = <6 0 0x8000>;
100 };
101
102 board-control@3,0 {
103 compatible = "fsl,fpga-pixis";
104 reg = <3 0 0x20>;
105 };
52 }; 106 };
53 107
54 soc@e0000000 { 108 soc@e0000000 {
diff --git a/arch/powerpc/boot/dts/sbc8548.dts b/arch/powerpc/boot/dts/sbc8548.dts
index b86e65d926c1..22d967178fe9 100644
--- a/arch/powerpc/boot/dts/sbc8548.dts
+++ b/arch/powerpc/boot/dts/sbc8548.dts
@@ -52,6 +52,99 @@
52 reg = <0x00000000 0x10000000>; 52 reg = <0x00000000 0x10000000>;
53 }; 53 };
54 54
55 localbus@e0000000 {
56 #address-cells = <2>;
57 #size-cells = <1>;
58 compatible = "simple-bus";
59 reg = <0xe0000000 0x5000>;
60 interrupt-parent = <&mpic>;
61
62 ranges = <0x0 0x0 0xff800000 0x00800000 /*8MB Flash*/
63 0x3 0x0 0xf0000000 0x04000000 /*64MB SDRAM*/
64 0x4 0x0 0xf4000000 0x04000000 /*64MB SDRAM*/
65 0x5 0x0 0xf8000000 0x00b10000 /* EPLD */
66 0x6 0x0 0xfb800000 0x04000000>; /*64MB Flash*/
67
68
69 flash@0,0 {
70 #address-cells = <1>;
71 #size-cells = <1>;
72 compatible = "cfi-flash";
73 reg = <0x0 0x0 0x800000>;
74 bank-width = <1>;
75 device-width = <1>;
76 partition@0x0 {
77 label = "space";
78 reg = <0x00000000 0x00100000>;
79 };
80 partition@0x100000 {
81 label = "bootloader";
82 reg = <0x00100000 0x00700000>;
83 read-only;
84 };
85 };
86
87 epld@5,0 {
88 compatible = "wrs,epld-localbus";
89 #address-cells = <2>;
90 #size-cells = <1>;
91 reg = <0x5 0x0 0x00b10000>;
92 ranges = <
93 0x0 0x0 0x5 0x000000 0x1fff /* LED */
94 0x1 0x0 0x5 0x100000 0x1fff /* Switches */
95 0x3 0x0 0x5 0x300000 0x1fff /* HW Rev. */
96 0xb 0x0 0x5 0xb00000 0x1fff /* EEPROM */
97 >;
98
99 led@0,0 {
100 compatible = "led";
101 reg = <0x0 0x0 0x1fff>;
102 };
103
104 switches@1,0 {
105 compatible = "switches";
106 reg = <0x1 0x0 0x1fff>;
107 };
108
109 hw-rev@3,0 {
110 compatible = "hw-rev";
111 reg = <0x3 0x0 0x1fff>;
112 };
113
114 eeprom@b,0 {
115 compatible = "eeprom";
116 reg = <0xb 0 0x1fff>;
117 };
118
119 };
120
121 alt-flash@6,0 {
122 #address-cells = <1>;
123 #size-cells = <1>;
124 reg = <0x6 0x0 0x04000000>;
125 compatible = "cfi-flash";
126 bank-width = <4>;
127 device-width = <1>;
128 partition@0x0 {
129 label = "bootloader";
130 reg = <0x00000000 0x00100000>;
131 read-only;
132 };
133 partition@0x00100000 {
134 label = "file-system";
135 reg = <0x00100000 0x01f00000>;
136 };
137 partition@0x02000000 {
138 label = "boot-config";
139 reg = <0x02000000 0x00100000>;
140 };
141 partition@0x02100000 {
142 label = "space";
143 reg = <0x02100000 0x01f00000>;
144 };
145 };
146 };
147
55 soc8548@e0000000 { 148 soc8548@e0000000 {
56 #address-cells = <1>; 149 #address-cells = <1>;
57 #size-cells = <1>; 150 #size-cells = <1>;
@@ -59,6 +152,7 @@
59 ranges = <0x00000000 0xe0000000 0x00100000>; 152 ranges = <0x00000000 0xe0000000 0x00100000>;
60 reg = <0xe0000000 0x00001000>; // CCSRBAR 153 reg = <0xe0000000 0x00001000>; // CCSRBAR
61 bus-frequency = <0>; 154 bus-frequency = <0>;
155 compatible = "simple-bus";
62 156
63 memory-controller@2000 { 157 memory-controller@2000 {
64 compatible = "fsl,8548-memory-controller"; 158 compatible = "fsl,8548-memory-controller";
diff --git a/arch/powerpc/configs/mpc8610_hpcd_defconfig b/arch/powerpc/configs/mpc8610_hpcd_defconfig
index 9270afe7594d..7e5b9ce58d89 100644
--- a/arch/powerpc/configs/mpc8610_hpcd_defconfig
+++ b/arch/powerpc/configs/mpc8610_hpcd_defconfig
@@ -358,7 +358,93 @@ CONFIG_FW_LOADER=y
358# CONFIG_DEBUG_DEVRES is not set 358# CONFIG_DEBUG_DEVRES is not set
359# CONFIG_SYS_HYPERVISOR is not set 359# CONFIG_SYS_HYPERVISOR is not set
360# CONFIG_CONNECTOR is not set 360# CONFIG_CONNECTOR is not set
361# CONFIG_MTD is not set 361CONFIG_MTD=y
362# CONFIG_MTD_DEBUG is not set
363# CONFIG_MTD_CONCAT is not set
364CONFIG_MTD_PARTITIONS=y
365# CONFIG_MTD_REDBOOT_PARTS is not set
366CONFIG_MTD_CMDLINE_PARTS=y
367# CONFIG_MTD_OF_PARTS is not set
368# CONFIG_MTD_AR7_PARTS is not set
369
370#
371# User Modules And Translation Layers
372#
373CONFIG_MTD_CHAR=y
374CONFIG_MTD_BLKDEVS=y
375CONFIG_MTD_BLOCK=y
376# CONFIG_FTL is not set
377# CONFIG_NFTL is not set
378# CONFIG_INFTL is not set
379# CONFIG_RFD_FTL is not set
380# CONFIG_SSFDC is not set
381# CONFIG_MTD_OOPS is not set
382
383#
384# RAM/ROM/Flash chip drivers
385#
386CONFIG_MTD_CFI=y
387# CONFIG_MTD_JEDECPROBE is not set
388CONFIG_MTD_GEN_PROBE=y
389# CONFIG_MTD_CFI_ADV_OPTIONS is not set
390CONFIG_MTD_MAP_BANK_WIDTH_1=y
391CONFIG_MTD_MAP_BANK_WIDTH_2=y
392CONFIG_MTD_MAP_BANK_WIDTH_4=y
393# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
394# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
395# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
396CONFIG_MTD_CFI_I1=y
397CONFIG_MTD_CFI_I2=y
398# CONFIG_MTD_CFI_I4 is not set
399# CONFIG_MTD_CFI_I8 is not set
400# CONFIG_MTD_CFI_INTELEXT is not set
401CONFIG_MTD_CFI_AMDSTD=y
402# CONFIG_MTD_CFI_STAA is not set
403CONFIG_MTD_CFI_UTIL=y
404# CONFIG_MTD_RAM is not set
405# CONFIG_MTD_ROM is not set
406# CONFIG_MTD_ABSENT is not set
407
408#
409# Mapping drivers for chip access
410#
411# CONFIG_MTD_COMPLEX_MAPPINGS is not set
412# CONFIG_MTD_PHYSMAP is not set
413CONFIG_MTD_PHYSMAP_OF=y
414# CONFIG_MTD_INTEL_VR_NOR is not set
415# CONFIG_MTD_PLATRAM is not set
416
417#
418# Self-contained MTD device drivers
419#
420# CONFIG_MTD_PMC551 is not set
421# CONFIG_MTD_SLRAM is not set
422# CONFIG_MTD_PHRAM is not set
423# CONFIG_MTD_MTDRAM is not set
424# CONFIG_MTD_BLOCK2MTD is not set
425
426#
427# Disk-On-Chip Device Drivers
428#
429# CONFIG_MTD_DOC2000 is not set
430# CONFIG_MTD_DOC2001 is not set
431# CONFIG_MTD_DOC2001PLUS is not set
432CONFIG_MTD_NAND=y
433# CONFIG_MTD_NAND_VERIFY_WRITE is not set
434# CONFIG_MTD_NAND_ECC_SMC is not set
435# CONFIG_MTD_NAND_MUSEUM_IDS is not set
436CONFIG_MTD_NAND_IDS=y
437# CONFIG_MTD_NAND_DISKONCHIP is not set
438# CONFIG_MTD_NAND_CAFE is not set
439# CONFIG_MTD_NAND_NANDSIM is not set
440# CONFIG_MTD_NAND_PLATFORM is not set
441CONFIG_MTD_NAND_FSL_ELBC=y
442# CONFIG_MTD_ONENAND is not set
443
444#
445# UBI - Unsorted block images
446#
447# CONFIG_MTD_UBI is not set
362CONFIG_OF_DEVICE=y 448CONFIG_OF_DEVICE=y
363# CONFIG_PARPORT is not set 449# CONFIG_PARPORT is not set
364CONFIG_BLK_DEV=y 450CONFIG_BLK_DEV=y
@@ -567,14 +653,11 @@ CONFIG_MII=y
567# CONFIG_NET_VENDOR_3COM is not set 653# CONFIG_NET_VENDOR_3COM is not set
568CONFIG_NET_TULIP=y 654CONFIG_NET_TULIP=y
569# CONFIG_DE2104X is not set 655# CONFIG_DE2104X is not set
570CONFIG_TULIP=y 656# CONFIG_TULIP is not set
571# CONFIG_TULIP_MWI is not set
572CONFIG_TULIP_MMIO=y
573# CONFIG_TULIP_NAPI is not set
574# CONFIG_DE4X5 is not set 657# CONFIG_DE4X5 is not set
575# CONFIG_WINBOND_840 is not set 658# CONFIG_WINBOND_840 is not set
576# CONFIG_DM9102 is not set 659# CONFIG_DM9102 is not set
577# CONFIG_ULI526X is not set 660CONFIG_ULI526X=y
578# CONFIG_HP100 is not set 661# CONFIG_HP100 is not set
579# CONFIG_IBM_NEW_EMAC_ZMII is not set 662# CONFIG_IBM_NEW_EMAC_ZMII is not set
580# CONFIG_IBM_NEW_EMAC_RGMII is not set 663# CONFIG_IBM_NEW_EMAC_RGMII is not set
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 2b5a399f6fa6..0f2d239d94c4 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -94,6 +94,9 @@ unsigned long htab_hash_mask;
94int mmu_linear_psize = MMU_PAGE_4K; 94int mmu_linear_psize = MMU_PAGE_4K;
95int mmu_virtual_psize = MMU_PAGE_4K; 95int mmu_virtual_psize = MMU_PAGE_4K;
96int mmu_vmalloc_psize = MMU_PAGE_4K; 96int mmu_vmalloc_psize = MMU_PAGE_4K;
97#ifdef CONFIG_SPARSEMEM_VMEMMAP
98int mmu_vmemmap_psize = MMU_PAGE_4K;
99#endif
97int mmu_io_psize = MMU_PAGE_4K; 100int mmu_io_psize = MMU_PAGE_4K;
98int mmu_kernel_ssize = MMU_SEGSIZE_256M; 101int mmu_kernel_ssize = MMU_SEGSIZE_256M;
99int mmu_highuser_ssize = MMU_SEGSIZE_256M; 102int mmu_highuser_ssize = MMU_SEGSIZE_256M;
@@ -387,11 +390,32 @@ static void __init htab_init_page_sizes(void)
387 } 390 }
388#endif /* CONFIG_PPC_64K_PAGES */ 391#endif /* CONFIG_PPC_64K_PAGES */
389 392
393#ifdef CONFIG_SPARSEMEM_VMEMMAP
394 /* We try to use 16M pages for vmemmap if that is supported
395 * and we have at least 1G of RAM at boot
396 */
397 if (mmu_psize_defs[MMU_PAGE_16M].shift &&
398 lmb_phys_mem_size() >= 0x40000000)
399 mmu_vmemmap_psize = MMU_PAGE_16M;
400 else if (mmu_psize_defs[MMU_PAGE_64K].shift)
401 mmu_vmemmap_psize = MMU_PAGE_64K;
402 else
403 mmu_vmemmap_psize = MMU_PAGE_4K;
404#endif /* CONFIG_SPARSEMEM_VMEMMAP */
405
390 printk(KERN_DEBUG "Page orders: linear mapping = %d, " 406 printk(KERN_DEBUG "Page orders: linear mapping = %d, "
391 "virtual = %d, io = %d\n", 407 "virtual = %d, io = %d"
408#ifdef CONFIG_SPARSEMEM_VMEMMAP
409 ", vmemmap = %d"
410#endif
411 "\n",
392 mmu_psize_defs[mmu_linear_psize].shift, 412 mmu_psize_defs[mmu_linear_psize].shift,
393 mmu_psize_defs[mmu_virtual_psize].shift, 413 mmu_psize_defs[mmu_virtual_psize].shift,
394 mmu_psize_defs[mmu_io_psize].shift); 414 mmu_psize_defs[mmu_io_psize].shift
415#ifdef CONFIG_SPARSEMEM_VMEMMAP
416 ,mmu_psize_defs[mmu_vmemmap_psize].shift
417#endif
418 );
395 419
396#ifdef CONFIG_HUGETLB_PAGE 420#ifdef CONFIG_HUGETLB_PAGE
397 /* Init large page size. Currently, we pick 16M or 1M depending 421 /* Init large page size. Currently, we pick 16M or 1M depending
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index c5ac532a0161..6aa65375abf5 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -19,6 +19,8 @@
19 * 19 *
20 */ 20 */
21 21
22#undef DEBUG
23
22#include <linux/signal.h> 24#include <linux/signal.h>
23#include <linux/sched.h> 25#include <linux/sched.h>
24#include <linux/kernel.h> 26#include <linux/kernel.h>
@@ -208,12 +210,12 @@ int __meminit vmemmap_populated(unsigned long start, int page_size)
208} 210}
209 211
210int __meminit vmemmap_populate(struct page *start_page, 212int __meminit vmemmap_populate(struct page *start_page,
211 unsigned long nr_pages, int node) 213 unsigned long nr_pages, int node)
212{ 214{
213 unsigned long mode_rw; 215 unsigned long mode_rw;
214 unsigned long start = (unsigned long)start_page; 216 unsigned long start = (unsigned long)start_page;
215 unsigned long end = (unsigned long)(start_page + nr_pages); 217 unsigned long end = (unsigned long)(start_page + nr_pages);
216 unsigned long page_size = 1 << mmu_psize_defs[mmu_linear_psize].shift; 218 unsigned long page_size = 1 << mmu_psize_defs[mmu_vmemmap_psize].shift;
217 219
218 mode_rw = _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX; 220 mode_rw = _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX;
219 221
@@ -235,11 +237,11 @@ int __meminit vmemmap_populate(struct page *start_page,
235 start, p, __pa(p)); 237 start, p, __pa(p));
236 238
237 mapped = htab_bolt_mapping(start, start + page_size, 239 mapped = htab_bolt_mapping(start, start + page_size,
238 __pa(p), mode_rw, mmu_linear_psize, 240 __pa(p), mode_rw, mmu_vmemmap_psize,
239 mmu_kernel_ssize); 241 mmu_kernel_ssize);
240 BUG_ON(mapped < 0); 242 BUG_ON(mapped < 0);
241 } 243 }
242 244
243 return 0; 245 return 0;
244} 246}
245#endif 247#endif /* CONFIG_SPARSEMEM_VMEMMAP */
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index cf8705e32d60..89497fb04280 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -28,7 +28,7 @@
28#include <asm/udbg.h> 28#include <asm/udbg.h>
29 29
30#ifdef DEBUG 30#ifdef DEBUG
31#define DBG(fmt...) udbg_printf(fmt) 31#define DBG(fmt...) printk(fmt)
32#else 32#else
33#define DBG pr_debug 33#define DBG pr_debug
34#endif 34#endif
@@ -263,13 +263,19 @@ void slb_initialize(void)
263 extern unsigned int *slb_miss_kernel_load_linear; 263 extern unsigned int *slb_miss_kernel_load_linear;
264 extern unsigned int *slb_miss_kernel_load_io; 264 extern unsigned int *slb_miss_kernel_load_io;
265 extern unsigned int *slb_compare_rr_to_size; 265 extern unsigned int *slb_compare_rr_to_size;
266#ifdef CONFIG_SPARSEMEM_VMEMMAP
267 extern unsigned int *slb_miss_kernel_load_vmemmap;
268 unsigned long vmemmap_llp;
269#endif
266 270
267 /* Prepare our SLB miss handler based on our page size */ 271 /* Prepare our SLB miss handler based on our page size */
268 linear_llp = mmu_psize_defs[mmu_linear_psize].sllp; 272 linear_llp = mmu_psize_defs[mmu_linear_psize].sllp;
269 io_llp = mmu_psize_defs[mmu_io_psize].sllp; 273 io_llp = mmu_psize_defs[mmu_io_psize].sllp;
270 vmalloc_llp = mmu_psize_defs[mmu_vmalloc_psize].sllp; 274 vmalloc_llp = mmu_psize_defs[mmu_vmalloc_psize].sllp;
271 get_paca()->vmalloc_sllp = SLB_VSID_KERNEL | vmalloc_llp; 275 get_paca()->vmalloc_sllp = SLB_VSID_KERNEL | vmalloc_llp;
272 276#ifdef CONFIG_SPARSEMEM_VMEMMAP
277 vmemmap_llp = mmu_psize_defs[mmu_vmemmap_psize].sllp;
278#endif
273 if (!slb_encoding_inited) { 279 if (!slb_encoding_inited) {
274 slb_encoding_inited = 1; 280 slb_encoding_inited = 1;
275 patch_slb_encoding(slb_miss_kernel_load_linear, 281 patch_slb_encoding(slb_miss_kernel_load_linear,
@@ -281,6 +287,12 @@ void slb_initialize(void)
281 287
282 DBG("SLB: linear LLP = %04lx\n", linear_llp); 288 DBG("SLB: linear LLP = %04lx\n", linear_llp);
283 DBG("SLB: io LLP = %04lx\n", io_llp); 289 DBG("SLB: io LLP = %04lx\n", io_llp);
290
291#ifdef CONFIG_SPARSEMEM_VMEMMAP
292 patch_slb_encoding(slb_miss_kernel_load_vmemmap,
293 SLB_VSID_KERNEL | vmemmap_llp);
294 DBG("SLB: vmemmap LLP = %04lx\n", vmemmap_llp);
295#endif
284 } 296 }
285 297
286 get_paca()->stab_rr = SLB_NUM_BOLTED; 298 get_paca()->stab_rr = SLB_NUM_BOLTED;
diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
index 657f6b37e9df..bc44dc4b5c67 100644
--- a/arch/powerpc/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
@@ -47,8 +47,7 @@ _GLOBAL(slb_allocate_realmode)
47 * it to VSID 0, which is reserved as a bad VSID - one which 47 * it to VSID 0, which is reserved as a bad VSID - one which
48 * will never have any pages in it. */ 48 * will never have any pages in it. */
49 49
50 /* Check if hitting the linear mapping of the vmalloc/ioremap 50 /* Check if hitting the linear mapping or some other kernel space
51 * kernel space
52 */ 51 */
53 bne cr7,1f 52 bne cr7,1f
54 53
@@ -62,7 +61,18 @@ BEGIN_FTR_SECTION
62END_FTR_SECTION_IFCLR(CPU_FTR_1T_SEGMENT) 61END_FTR_SECTION_IFCLR(CPU_FTR_1T_SEGMENT)
63 b slb_finish_load_1T 62 b slb_finish_load_1T
64 63
651: /* vmalloc/ioremap mapping encoding bits, the "li" instructions below 641:
65#ifdef CONFIG_SPARSEMEM_VMEMMAP
66 /* Check virtual memmap region. To be patches at kernel boot */
67 cmpldi cr0,r9,0xf
68 bne 1f
69_GLOBAL(slb_miss_kernel_load_vmemmap)
70 li r11,0
71 b 6f
721:
73#endif /* CONFIG_SPARSEMEM_VMEMMAP */
74
75 /* vmalloc/ioremap mapping encoding bits, the "li" instructions below
66 * will be patched by the kernel at boot 76 * will be patched by the kernel at boot
67 */ 77 */
68BEGIN_FTR_SECTION 78BEGIN_FTR_SECTION
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 25f8bc75e838..43a459f63e31 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -32,6 +32,7 @@
32#include <linux/fsl_devices.h> 32#include <linux/fsl_devices.h>
33#include <linux/of_platform.h> 33#include <linux/of_platform.h>
34#include <linux/of_device.h> 34#include <linux/of_device.h>
35#include <linux/phy.h>
35 36
36#include <asm/system.h> 37#include <asm/system.h>
37#include <asm/atomic.h> 38#include <asm/atomic.h>
@@ -56,6 +57,95 @@
56#define DBG(fmt...) 57#define DBG(fmt...)
57#endif 58#endif
58 59
60#define MV88E1111_SCR 0x10
61#define MV88E1111_SCR_125CLK 0x0010
62static int mpc8568_fixup_125_clock(struct phy_device *phydev)
63{
64 int scr;
65 int err;
66
67 /* Workaround for the 125 CLK Toggle */
68 scr = phy_read(phydev, MV88E1111_SCR);
69
70 if (scr < 0)
71 return scr;
72
73 err = phy_write(phydev, MV88E1111_SCR, scr & ~(MV88E1111_SCR_125CLK));
74
75 if (err)
76 return err;
77
78 err = phy_write(phydev, MII_BMCR, BMCR_RESET);
79
80 if (err)
81 return err;
82
83 scr = phy_read(phydev, MV88E1111_SCR);
84
85 if (scr < 0)
86 return err;
87
88 err = phy_write(phydev, MV88E1111_SCR, scr | 0x0008);
89
90 return err;
91}
92
93static int mpc8568_mds_phy_fixups(struct phy_device *phydev)
94{
95 int temp;
96 int err;
97
98 /* Errata */
99 err = phy_write(phydev,29, 0x0006);
100
101 if (err)
102 return err;
103
104 temp = phy_read(phydev, 30);
105
106 if (temp < 0)
107 return temp;
108
109 temp = (temp & (~0x8000)) | 0x4000;
110 err = phy_write(phydev,30, temp);
111
112 if (err)
113 return err;
114
115 err = phy_write(phydev,29, 0x000a);
116
117 if (err)
118 return err;
119
120 temp = phy_read(phydev, 30);
121
122 if (temp < 0)
123 return temp;
124
125 temp = phy_read(phydev, 30);
126
127 if (temp < 0)
128 return temp;
129
130 temp &= ~0x0020;
131
132 err = phy_write(phydev,30,temp);
133
134 if (err)
135 return err;
136
137 /* Disable automatic MDI/MDIX selection */
138 temp = phy_read(phydev, 16);
139
140 if (temp < 0)
141 return temp;
142
143 temp &= ~0x0060;
144 err = phy_write(phydev,16,temp);
145
146 return err;
147}
148
59/* ************************************************************************ 149/* ************************************************************************
60 * 150 *
61 * Setup the architecture 151 * Setup the architecture
@@ -64,7 +154,7 @@
64static void __init mpc85xx_mds_setup_arch(void) 154static void __init mpc85xx_mds_setup_arch(void)
65{ 155{
66 struct device_node *np; 156 struct device_node *np;
67 static u8 *bcsr_regs = NULL; 157 static u8 __iomem *bcsr_regs = NULL;
68 158
69 if (ppc_md.progress) 159 if (ppc_md.progress)
70 ppc_md.progress("mpc85xx_mds_setup_arch()", 0); 160 ppc_md.progress("mpc85xx_mds_setup_arch()", 0);
@@ -138,6 +228,35 @@ static void __init mpc85xx_mds_setup_arch(void)
138#endif /* CONFIG_QUICC_ENGINE */ 228#endif /* CONFIG_QUICC_ENGINE */
139} 229}
140 230
231
232static int __init board_fixups(void)
233{
234 char phy_id[BUS_ID_SIZE];
235 char *compstrs[2] = {"fsl,gianfar-mdio", "fsl,ucc-mdio"};
236 struct device_node *mdio;
237 struct resource res;
238 int i;
239
240 for (i = 0; i < ARRAY_SIZE(compstrs); i++) {
241 mdio = of_find_compatible_node(NULL, NULL, compstrs[i]);
242
243 of_address_to_resource(mdio, 0, &res);
244 snprintf(phy_id, BUS_ID_SIZE, "%x:%02x", res.start, 1);
245
246 phy_register_fixup_for_id(phy_id, mpc8568_fixup_125_clock);
247 phy_register_fixup_for_id(phy_id, mpc8568_mds_phy_fixups);
248
249 /* Register a workaround for errata */
250 snprintf(phy_id, BUS_ID_SIZE, "%x:%02x", res.start, 7);
251 phy_register_fixup_for_id(phy_id, mpc8568_mds_phy_fixups);
252
253 of_node_put(mdio);
254 }
255
256 return 0;
257}
258machine_arch_initcall(mpc85xx_mds, board_fixups);
259
141static struct of_device_id mpc85xx_ids[] = { 260static struct of_device_id mpc85xx_ids[] = {
142 { .type = "soc", }, 261 { .type = "soc", },
143 { .compatible = "soc", }, 262 { .compatible = "soc", },
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c
index 488facb99fe8..b9246ea0928a 100644
--- a/arch/powerpc/platforms/85xx/sbc8548.c
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -49,6 +49,8 @@
49#include <sysdev/fsl_soc.h> 49#include <sysdev/fsl_soc.h>
50#include <sysdev/fsl_pci.h> 50#include <sysdev/fsl_pci.h>
51 51
52static int sbc_rev;
53
52static void __init sbc8548_pic_init(void) 54static void __init sbc8548_pic_init(void)
53{ 55{
54 struct mpic *mpic; 56 struct mpic *mpic;
@@ -79,6 +81,30 @@ static void __init sbc8548_pic_init(void)
79 mpic_init(mpic); 81 mpic_init(mpic);
80} 82}
81 83
84/* Extract the HW Rev from the EPLD on the board */
85static int __init sbc8548_hw_rev(void)
86{
87 struct device_node *np;
88 struct resource res;
89 unsigned int *rev;
90 int board_rev = 0;
91
92 np = of_find_compatible_node(NULL, NULL, "hw-rev");
93 if (np == NULL) {
94 printk("No HW-REV found in DTB.\n");
95 return -ENODEV;
96 }
97
98 of_address_to_resource(np, 0, &res);
99 of_node_put(np);
100
101 rev = ioremap(res.start,sizeof(unsigned int));
102 board_rev = (*rev) >> 28;
103 iounmap(rev);
104
105 return board_rev;
106}
107
82/* 108/*
83 * Setup the architecture 109 * Setup the architecture
84 */ 110 */
@@ -104,6 +130,7 @@ static void __init sbc8548_setup_arch(void)
104 } 130 }
105 } 131 }
106#endif 132#endif
133 sbc_rev = sbc8548_hw_rev();
107} 134}
108 135
109static void sbc8548_show_cpuinfo(struct seq_file *m) 136static void sbc8548_show_cpuinfo(struct seq_file *m)
@@ -115,7 +142,7 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
115 svid = mfspr(SPRN_SVR); 142 svid = mfspr(SPRN_SVR);
116 143
117 seq_printf(m, "Vendor\t\t: Wind River\n"); 144 seq_printf(m, "Vendor\t\t: Wind River\n");
118 seq_printf(m, "Machine\t\t: SBC8548\n"); 145 seq_printf(m, "Machine\t\t: SBC8548 v%d\n", sbc_rev);
119 seq_printf(m, "PVR\t\t: 0x%x\n", pvid); 146 seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
120 seq_printf(m, "SVR\t\t: 0x%x\n", svid); 147 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
121 148
@@ -130,6 +157,7 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
130static struct of_device_id __initdata of_bus_ids[] = { 157static struct of_device_id __initdata of_bus_ids[] = {
131 { .name = "soc", }, 158 { .name = "soc", },
132 { .type = "soc", }, 159 { .type = "soc", },
160 { .compatible = "simple-bus", },
133 {}, 161 {},
134}; 162};
135 163
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
index 5e1e8cf14e75..dea13208bf64 100644
--- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
+++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
@@ -43,6 +43,7 @@ static unsigned char *pixis_bdcfg0, *pixis_arch;
43 43
44static struct of_device_id __initdata mpc8610_ids[] = { 44static struct of_device_id __initdata mpc8610_ids[] = {
45 { .compatible = "fsl,mpc8610-immr", }, 45 { .compatible = "fsl,mpc8610-immr", },
46 { .compatible = "simple-bus", },
46 {} 47 {}
47}; 48};
48 49
@@ -216,11 +217,21 @@ void mpc8610hpcd_set_gamma_table(int monitor_port, char *gamma_table_base)
216 } 217 }
217} 218}
218 219
220#define PX_BRDCFG0_DVISEL (1 << 3)
221#define PX_BRDCFG0_DLINK (1 << 4)
222#define PX_BRDCFG0_DIU_MASK (PX_BRDCFG0_DVISEL | PX_BRDCFG0_DLINK)
223
219void mpc8610hpcd_set_monitor_port(int monitor_port) 224void mpc8610hpcd_set_monitor_port(int monitor_port)
220{ 225{
221 static const u8 bdcfg[] = {0xBD, 0xB5, 0xA5}; 226 static const u8 bdcfg[] = {
227 PX_BRDCFG0_DVISEL | PX_BRDCFG0_DLINK,
228 PX_BRDCFG0_DLINK,
229 0,
230 };
231
222 if (monitor_port < 3) 232 if (monitor_port < 3)
223 *pixis_bdcfg0 = bdcfg[monitor_port]; 233 clrsetbits_8(pixis_bdcfg0, PX_BRDCFG0_DIU_MASK,
234 bdcfg[monitor_port]);
224} 235}
225 236
226void mpc8610hpcd_set_pixel_clock(unsigned int pixclock) 237void mpc8610hpcd_set_pixel_clock(unsigned int pixclock)
diff --git a/arch/powerpc/platforms/cell/io-workarounds.c b/arch/powerpc/platforms/cell/io-workarounds.c
index 3b84e8be314c..b5f84e8f0899 100644
--- a/arch/powerpc/platforms/cell/io-workarounds.c
+++ b/arch/powerpc/platforms/cell/io-workarounds.c
@@ -118,7 +118,7 @@ static void iowa_##name at \
118#undef DEF_PCI_AC_RET 118#undef DEF_PCI_AC_RET
119#undef DEF_PCI_AC_NORET 119#undef DEF_PCI_AC_NORET
120 120
121static struct ppc_pci_io __initdata iowa_pci_io = { 121static const struct ppc_pci_io __devinitconst iowa_pci_io = {
122 122
123#define DEF_PCI_AC_RET(name, ret, at, al, space, aa) .name = iowa_##name, 123#define DEF_PCI_AC_RET(name, ret, at, al, space, aa) .name = iowa_##name,
124#define DEF_PCI_AC_NORET(name, at, al, space, aa) .name = iowa_##name, 124#define DEF_PCI_AC_NORET(name, at, al, space, aa) .name = iowa_##name,
@@ -146,7 +146,7 @@ static void __iomem *iowa_ioremap(unsigned long addr, unsigned long size,
146} 146}
147 147
148/* Regist new bus to support workaround */ 148/* Regist new bus to support workaround */
149void __init iowa_register_bus(struct pci_controller *phb, 149void __devinit iowa_register_bus(struct pci_controller *phb,
150 struct ppc_pci_io *ops, 150 struct ppc_pci_io *ops,
151 int (*initfunc)(struct iowa_bus *, void *), void *data) 151 int (*initfunc)(struct iowa_bus *, void *), void *data)
152{ 152{
@@ -173,7 +173,7 @@ void __init iowa_register_bus(struct pci_controller *phb,
173} 173}
174 174
175/* enable IO workaround */ 175/* enable IO workaround */
176void __init io_workaround_init(void) 176void __devinit io_workaround_init(void)
177{ 177{
178 static int io_workaround_inited; 178 static int io_workaround_inited;
179 179
diff --git a/arch/powerpc/platforms/cell/io-workarounds.h b/arch/powerpc/platforms/cell/io-workarounds.h
index 79d8ed3d510f..6efc7782ebf2 100644
--- a/arch/powerpc/platforms/cell/io-workarounds.h
+++ b/arch/powerpc/platforms/cell/io-workarounds.h
@@ -31,9 +31,9 @@ struct iowa_bus {
31 void *private; 31 void *private;
32}; 32};
33 33
34void __init io_workaround_init(void); 34void __devinit io_workaround_init(void);
35void __init iowa_register_bus(struct pci_controller *, struct ppc_pci_io *, 35void __devinit iowa_register_bus(struct pci_controller *, struct ppc_pci_io *,
36 int (*)(struct iowa_bus *, void *), void *); 36 int (*)(struct iowa_bus *, void *), void *);
37struct iowa_bus *iowa_mem_find_bus(const PCI_IO_ADDR); 37struct iowa_bus *iowa_mem_find_bus(const PCI_IO_ADDR);
38struct iowa_bus *iowa_pio_find_bus(unsigned long); 38struct iowa_bus *iowa_pio_find_bus(unsigned long);
39 39
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 80911a373400..c81341ff75b5 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -32,6 +32,7 @@
32#include <linux/marker.h> 32#include <linux/marker.h>
33 33
34#include <asm/io.h> 34#include <asm/io.h>
35#include <asm/time.h>
35#include <asm/spu.h> 36#include <asm/spu.h>
36#include <asm/spu_info.h> 37#include <asm/spu_info.h>
37#include <asm/uaccess.h> 38#include <asm/uaccess.h>
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 2e411f23462b..745dd51ec37f 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -659,7 +659,7 @@ static struct spu *find_victim(struct spu_context *ctx)
659 659
660 victim->stats.invol_ctx_switch++; 660 victim->stats.invol_ctx_switch++;
661 spu->stats.invol_ctx_switch++; 661 spu->stats.invol_ctx_switch++;
662 if (test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags)) 662 if (test_bit(SPU_SCHED_SPU_RUN, &victim->sched_flags))
663 spu_add_to_rq(victim); 663 spu_add_to_rq(victim);
664 664
665 mutex_unlock(&victim->state_mutex); 665 mutex_unlock(&victim->state_mutex);
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index b8b9e44f7f4e..dbaad39020a1 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -334,7 +334,7 @@ int __init adb_init(void)
334 return 0; 334 return 0;
335} 335}
336 336
337__initcall(adb_init); 337device_initcall(adb_init);
338 338
339static int 339static int
340do_adb_reset_bus(void) 340do_adb_reset_bus(void)
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 9bd7c4a31253..23ffb7c0caf2 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -65,6 +65,9 @@ struct property *of_find_property(const struct device_node *np,
65{ 65{
66 struct property *pp; 66 struct property *pp;
67 67
68 if (!np)
69 return NULL;
70
68 read_lock(&devtree_lock); 71 read_lock(&devtree_lock);
69 for (pp = np->properties; pp != 0; pp = pp->next) { 72 for (pp = np->properties; pp != 0; pp = pp->next) {
70 if (of_prop_cmp(pp->name, name) == 0) { 73 if (of_prop_cmp(pp->name, name) == 0) {
diff --git a/include/asm-powerpc/mmu-hash64.h b/include/asm-powerpc/mmu-hash64.h
index 0dff76776044..39c5c5f62bf5 100644
--- a/include/asm-powerpc/mmu-hash64.h
+++ b/include/asm-powerpc/mmu-hash64.h
@@ -177,6 +177,7 @@ extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT];
177extern int mmu_linear_psize; 177extern int mmu_linear_psize;
178extern int mmu_virtual_psize; 178extern int mmu_virtual_psize;
179extern int mmu_vmalloc_psize; 179extern int mmu_vmalloc_psize;
180extern int mmu_vmemmap_psize;
180extern int mmu_io_psize; 181extern int mmu_io_psize;
181extern int mmu_kernel_ssize; 182extern int mmu_kernel_ssize;
182extern int mmu_highuser_ssize; 183extern int mmu_highuser_ssize;
diff --git a/include/asm-powerpc/pgtable-ppc64.h b/include/asm-powerpc/pgtable-ppc64.h
index 27f18695f7d6..cc6a43ba41d0 100644
--- a/include/asm-powerpc/pgtable-ppc64.h
+++ b/include/asm-powerpc/pgtable-ppc64.h
@@ -65,15 +65,15 @@
65 65
66#define VMALLOC_REGION_ID (REGION_ID(VMALLOC_START)) 66#define VMALLOC_REGION_ID (REGION_ID(VMALLOC_START))
67#define KERNEL_REGION_ID (REGION_ID(PAGE_OFFSET)) 67#define KERNEL_REGION_ID (REGION_ID(PAGE_OFFSET))
68#define VMEMMAP_REGION_ID (0xfUL)
68#define USER_REGION_ID (0UL) 69#define USER_REGION_ID (0UL)
69 70
70/* 71/*
71 * Defines the address of the vmemap area, in the top 16th of the 72 * Defines the address of the vmemap area, in its own region
72 * kernel region.
73 */ 73 */
74#define VMEMMAP_BASE (ASM_CONST(CONFIG_KERNEL_START) + \ 74#define VMEMMAP_BASE (VMEMMAP_REGION_ID << REGION_SHIFT)
75 (0xfUL << (REGION_SHIFT - 4))) 75#define vmemmap ((struct page *)VMEMMAP_BASE)
76#define vmemmap ((struct page *)VMEMMAP_BASE) 76
77 77
78/* 78/*
79 * Common bits in a linux-style PTE. These match the bits in the 79 * Common bits in a linux-style PTE. These match the bits in the
diff --git a/include/asm-powerpc/uaccess.h b/include/asm-powerpc/uaccess.h
index 8e798e3758bc..1a0736f8803f 100644
--- a/include/asm-powerpc/uaccess.h
+++ b/include/asm-powerpc/uaccess.h
@@ -380,7 +380,7 @@ static inline unsigned long __copy_from_user_inatomic(void *to,
380 const void __user *from, unsigned long n) 380 const void __user *from, unsigned long n)
381{ 381{
382 if (__builtin_constant_p(n) && (n <= 8)) { 382 if (__builtin_constant_p(n) && (n <= 8)) {
383 unsigned long ret; 383 unsigned long ret = 1;
384 384
385 switch (n) { 385 switch (n) {
386 case 1: 386 case 1:
@@ -406,7 +406,7 @@ static inline unsigned long __copy_to_user_inatomic(void __user *to,
406 const void *from, unsigned long n) 406 const void *from, unsigned long n)
407{ 407{
408 if (__builtin_constant_p(n) && (n <= 8)) { 408 if (__builtin_constant_p(n) && (n <= 8)) {
409 unsigned long ret; 409 unsigned long ret = 1;
410 410
411 switch (n) { 411 switch (n) {
412 case 1: 412 case 1: