diff options
Diffstat (limited to 'arch/powerpc')
32 files changed, 151 insertions, 118 deletions
diff --git a/arch/powerpc/boot/dts/mpc5121.dtsi b/arch/powerpc/boot/dts/mpc5121.dtsi index bd14c00e5146..2d7cb04ac962 100644 --- a/arch/powerpc/boot/dts/mpc5121.dtsi +++ b/arch/powerpc/boot/dts/mpc5121.dtsi | |||
@@ -77,7 +77,6 @@ | |||
77 | compatible = "fsl,mpc5121-immr"; | 77 | compatible = "fsl,mpc5121-immr"; |
78 | #address-cells = <1>; | 78 | #address-cells = <1>; |
79 | #size-cells = <1>; | 79 | #size-cells = <1>; |
80 | #interrupt-cells = <2>; | ||
81 | ranges = <0x0 0x80000000 0x400000>; | 80 | ranges = <0x0 0x80000000 0x400000>; |
82 | reg = <0x80000000 0x400000>; | 81 | reg = <0x80000000 0x400000>; |
83 | bus-frequency = <66000000>; /* 66 MHz ips bus */ | 82 | bus-frequency = <66000000>; /* 66 MHz ips bus */ |
diff --git a/arch/powerpc/boot/dts/mpc5125twr.dts b/arch/powerpc/boot/dts/mpc5125twr.dts index 4177b62240c2..a618dfc13e4c 100644 --- a/arch/powerpc/boot/dts/mpc5125twr.dts +++ b/arch/powerpc/boot/dts/mpc5125twr.dts | |||
@@ -58,7 +58,6 @@ | |||
58 | compatible = "fsl,mpc5121-immr"; | 58 | compatible = "fsl,mpc5121-immr"; |
59 | #address-cells = <1>; | 59 | #address-cells = <1>; |
60 | #size-cells = <1>; | 60 | #size-cells = <1>; |
61 | #interrupt-cells = <2>; | ||
62 | ranges = <0x0 0x80000000 0x400000>; | 61 | ranges = <0x0 0x80000000 0x400000>; |
63 | reg = <0x80000000 0x400000>; | 62 | reg = <0x80000000 0x400000>; |
64 | bus-frequency = <66000000>; // 66 MHz ips bus | 63 | bus-frequency = <66000000>; // 66 MHz ips bus |
@@ -189,6 +188,10 @@ | |||
189 | reg = <0xA000 0x1000>; | 188 | reg = <0xA000 0x1000>; |
190 | }; | 189 | }; |
191 | 190 | ||
191 | // disable USB1 port | ||
192 | // TODO: | ||
193 | // correct pinmux config and fix USB3320 ulpi dependency | ||
194 | // before re-enabling it | ||
192 | usb@3000 { | 195 | usb@3000 { |
193 | compatible = "fsl,mpc5121-usb2-dr"; | 196 | compatible = "fsl,mpc5121-usb2-dr"; |
194 | reg = <0x3000 0x400>; | 197 | reg = <0x3000 0x400>; |
@@ -197,6 +200,7 @@ | |||
197 | interrupts = <43 0x8>; | 200 | interrupts = <43 0x8>; |
198 | dr_mode = "host"; | 201 | dr_mode = "host"; |
199 | phy_type = "ulpi"; | 202 | phy_type = "ulpi"; |
203 | status = "disabled"; | ||
200 | }; | 204 | }; |
201 | 205 | ||
202 | // 5125 PSCs are not 52xx or 5121 PSC compatible | 206 | // 5125 PSCs are not 52xx or 5121 PSC compatible |
diff --git a/arch/powerpc/configs/52xx/cm5200_defconfig b/arch/powerpc/configs/52xx/cm5200_defconfig index 69b57daf402e..0b88c7b30bb9 100644 --- a/arch/powerpc/configs/52xx/cm5200_defconfig +++ b/arch/powerpc/configs/52xx/cm5200_defconfig | |||
@@ -12,7 +12,6 @@ CONFIG_EXPERT=y | |||
12 | CONFIG_PPC_MPC52xx=y | 12 | CONFIG_PPC_MPC52xx=y |
13 | CONFIG_PPC_MPC5200_SIMPLE=y | 13 | CONFIG_PPC_MPC5200_SIMPLE=y |
14 | # CONFIG_PPC_PMAC is not set | 14 | # CONFIG_PPC_PMAC is not set |
15 | CONFIG_PPC_BESTCOMM=y | ||
16 | CONFIG_SPARSE_IRQ=y | 15 | CONFIG_SPARSE_IRQ=y |
17 | CONFIG_PM=y | 16 | CONFIG_PM=y |
18 | # CONFIG_PCI is not set | 17 | # CONFIG_PCI is not set |
@@ -71,6 +70,8 @@ CONFIG_USB_DEVICEFS=y | |||
71 | CONFIG_USB_OHCI_HCD=y | 70 | CONFIG_USB_OHCI_HCD=y |
72 | CONFIG_USB_OHCI_HCD_PPC_OF_BE=y | 71 | CONFIG_USB_OHCI_HCD_PPC_OF_BE=y |
73 | CONFIG_USB_STORAGE=y | 72 | CONFIG_USB_STORAGE=y |
73 | CONFIG_DMADEVICES=y | ||
74 | CONFIG_PPC_BESTCOMM=y | ||
74 | CONFIG_EXT2_FS=y | 75 | CONFIG_EXT2_FS=y |
75 | CONFIG_EXT3_FS=y | 76 | CONFIG_EXT3_FS=y |
76 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | 77 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set |
diff --git a/arch/powerpc/configs/52xx/lite5200b_defconfig b/arch/powerpc/configs/52xx/lite5200b_defconfig index f3638ae0a627..104a332e79ab 100644 --- a/arch/powerpc/configs/52xx/lite5200b_defconfig +++ b/arch/powerpc/configs/52xx/lite5200b_defconfig | |||
@@ -15,7 +15,6 @@ CONFIG_PPC_MPC52xx=y | |||
15 | CONFIG_PPC_MPC5200_SIMPLE=y | 15 | CONFIG_PPC_MPC5200_SIMPLE=y |
16 | CONFIG_PPC_LITE5200=y | 16 | CONFIG_PPC_LITE5200=y |
17 | # CONFIG_PPC_PMAC is not set | 17 | # CONFIG_PPC_PMAC is not set |
18 | CONFIG_PPC_BESTCOMM=y | ||
19 | CONFIG_NO_HZ=y | 18 | CONFIG_NO_HZ=y |
20 | CONFIG_HIGH_RES_TIMERS=y | 19 | CONFIG_HIGH_RES_TIMERS=y |
21 | CONFIG_SPARSE_IRQ=y | 20 | CONFIG_SPARSE_IRQ=y |
@@ -59,6 +58,8 @@ CONFIG_I2C_CHARDEV=y | |||
59 | CONFIG_I2C_MPC=y | 58 | CONFIG_I2C_MPC=y |
60 | # CONFIG_HWMON is not set | 59 | # CONFIG_HWMON is not set |
61 | CONFIG_VIDEO_OUTPUT_CONTROL=m | 60 | CONFIG_VIDEO_OUTPUT_CONTROL=m |
61 | CONFIG_DMADEVICES=y | ||
62 | CONFIG_PPC_BESTCOMM=y | ||
62 | CONFIG_EXT2_FS=y | 63 | CONFIG_EXT2_FS=y |
63 | CONFIG_EXT3_FS=y | 64 | CONFIG_EXT3_FS=y |
64 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | 65 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set |
diff --git a/arch/powerpc/configs/52xx/motionpro_defconfig b/arch/powerpc/configs/52xx/motionpro_defconfig index 0c7de9620ea6..0d13ad7e4478 100644 --- a/arch/powerpc/configs/52xx/motionpro_defconfig +++ b/arch/powerpc/configs/52xx/motionpro_defconfig | |||
@@ -12,7 +12,6 @@ CONFIG_EXPERT=y | |||
12 | CONFIG_PPC_MPC52xx=y | 12 | CONFIG_PPC_MPC52xx=y |
13 | CONFIG_PPC_MPC5200_SIMPLE=y | 13 | CONFIG_PPC_MPC5200_SIMPLE=y |
14 | # CONFIG_PPC_PMAC is not set | 14 | # CONFIG_PPC_PMAC is not set |
15 | CONFIG_PPC_BESTCOMM=y | ||
16 | CONFIG_SPARSE_IRQ=y | 15 | CONFIG_SPARSE_IRQ=y |
17 | CONFIG_PM=y | 16 | CONFIG_PM=y |
18 | # CONFIG_PCI is not set | 17 | # CONFIG_PCI is not set |
@@ -84,6 +83,8 @@ CONFIG_LEDS_TRIGGERS=y | |||
84 | CONFIG_LEDS_TRIGGER_TIMER=y | 83 | CONFIG_LEDS_TRIGGER_TIMER=y |
85 | CONFIG_RTC_CLASS=y | 84 | CONFIG_RTC_CLASS=y |
86 | CONFIG_RTC_DRV_DS1307=y | 85 | CONFIG_RTC_DRV_DS1307=y |
86 | CONFIG_DMADEVICES=y | ||
87 | CONFIG_PPC_BESTCOMM=y | ||
87 | CONFIG_EXT2_FS=y | 88 | CONFIG_EXT2_FS=y |
88 | CONFIG_EXT3_FS=y | 89 | CONFIG_EXT3_FS=y |
89 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | 90 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set |
diff --git a/arch/powerpc/configs/52xx/pcm030_defconfig b/arch/powerpc/configs/52xx/pcm030_defconfig index 22e719575c60..430aa182fa1c 100644 --- a/arch/powerpc/configs/52xx/pcm030_defconfig +++ b/arch/powerpc/configs/52xx/pcm030_defconfig | |||
@@ -21,7 +21,6 @@ CONFIG_MODULE_UNLOAD=y | |||
21 | CONFIG_PPC_MPC52xx=y | 21 | CONFIG_PPC_MPC52xx=y |
22 | CONFIG_PPC_MPC5200_SIMPLE=y | 22 | CONFIG_PPC_MPC5200_SIMPLE=y |
23 | # CONFIG_PPC_PMAC is not set | 23 | # CONFIG_PPC_PMAC is not set |
24 | CONFIG_PPC_BESTCOMM=y | ||
25 | CONFIG_NO_HZ=y | 24 | CONFIG_NO_HZ=y |
26 | CONFIG_HIGH_RES_TIMERS=y | 25 | CONFIG_HIGH_RES_TIMERS=y |
27 | CONFIG_HZ_100=y | 26 | CONFIG_HZ_100=y |
@@ -87,6 +86,8 @@ CONFIG_USB_OHCI_HCD_PPC_OF_BE=y | |||
87 | CONFIG_USB_STORAGE=m | 86 | CONFIG_USB_STORAGE=m |
88 | CONFIG_RTC_CLASS=y | 87 | CONFIG_RTC_CLASS=y |
89 | CONFIG_RTC_DRV_PCF8563=m | 88 | CONFIG_RTC_DRV_PCF8563=m |
89 | CONFIG_DMADEVICES=y | ||
90 | CONFIG_PPC_BESTCOMM=y | ||
90 | CONFIG_EXT2_FS=m | 91 | CONFIG_EXT2_FS=m |
91 | CONFIG_EXT3_FS=m | 92 | CONFIG_EXT3_FS=m |
92 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | 93 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set |
diff --git a/arch/powerpc/configs/52xx/tqm5200_defconfig b/arch/powerpc/configs/52xx/tqm5200_defconfig index 716a37be16e3..7af4c5bb7c63 100644 --- a/arch/powerpc/configs/52xx/tqm5200_defconfig +++ b/arch/powerpc/configs/52xx/tqm5200_defconfig | |||
@@ -17,7 +17,6 @@ CONFIG_PPC_MPC52xx=y | |||
17 | CONFIG_PPC_MPC5200_SIMPLE=y | 17 | CONFIG_PPC_MPC5200_SIMPLE=y |
18 | CONFIG_PPC_MPC5200_BUGFIX=y | 18 | CONFIG_PPC_MPC5200_BUGFIX=y |
19 | # CONFIG_PPC_PMAC is not set | 19 | # CONFIG_PPC_PMAC is not set |
20 | CONFIG_PPC_BESTCOMM=y | ||
21 | CONFIG_PM=y | 20 | CONFIG_PM=y |
22 | # CONFIG_PCI is not set | 21 | # CONFIG_PCI is not set |
23 | CONFIG_NET=y | 22 | CONFIG_NET=y |
@@ -86,6 +85,8 @@ CONFIG_USB_STORAGE=y | |||
86 | CONFIG_RTC_CLASS=y | 85 | CONFIG_RTC_CLASS=y |
87 | CONFIG_RTC_DRV_DS1307=y | 86 | CONFIG_RTC_DRV_DS1307=y |
88 | CONFIG_RTC_DRV_DS1374=y | 87 | CONFIG_RTC_DRV_DS1374=y |
88 | CONFIG_DMADEVICES=y | ||
89 | CONFIG_PPC_BESTCOMM=y | ||
89 | CONFIG_EXT2_FS=y | 90 | CONFIG_EXT2_FS=y |
90 | CONFIG_EXT3_FS=y | 91 | CONFIG_EXT3_FS=y |
91 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | 92 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set |
diff --git a/arch/powerpc/configs/mpc5200_defconfig b/arch/powerpc/configs/mpc5200_defconfig index 6640a35bebb7..8b682d1cf4d6 100644 --- a/arch/powerpc/configs/mpc5200_defconfig +++ b/arch/powerpc/configs/mpc5200_defconfig | |||
@@ -15,7 +15,6 @@ CONFIG_PPC_MEDIA5200=y | |||
15 | CONFIG_PPC_MPC5200_BUGFIX=y | 15 | CONFIG_PPC_MPC5200_BUGFIX=y |
16 | CONFIG_PPC_MPC5200_LPBFIFO=m | 16 | CONFIG_PPC_MPC5200_LPBFIFO=m |
17 | # CONFIG_PPC_PMAC is not set | 17 | # CONFIG_PPC_PMAC is not set |
18 | CONFIG_PPC_BESTCOMM=y | ||
19 | CONFIG_SIMPLE_GPIO=y | 18 | CONFIG_SIMPLE_GPIO=y |
20 | CONFIG_NO_HZ=y | 19 | CONFIG_NO_HZ=y |
21 | CONFIG_HIGH_RES_TIMERS=y | 20 | CONFIG_HIGH_RES_TIMERS=y |
@@ -125,6 +124,8 @@ CONFIG_RTC_CLASS=y | |||
125 | CONFIG_RTC_DRV_DS1307=y | 124 | CONFIG_RTC_DRV_DS1307=y |
126 | CONFIG_RTC_DRV_DS1374=y | 125 | CONFIG_RTC_DRV_DS1374=y |
127 | CONFIG_RTC_DRV_PCF8563=m | 126 | CONFIG_RTC_DRV_PCF8563=m |
127 | CONFIG_DMADEVICES=y | ||
128 | CONFIG_PPC_BESTCOMM=y | ||
128 | CONFIG_EXT2_FS=y | 129 | CONFIG_EXT2_FS=y |
129 | CONFIG_EXT3_FS=y | 130 | CONFIG_EXT3_FS=y |
130 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | 131 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set |
diff --git a/arch/powerpc/configs/pasemi_defconfig b/arch/powerpc/configs/pasemi_defconfig index bd8a6f71944f..cec044a3ff69 100644 --- a/arch/powerpc/configs/pasemi_defconfig +++ b/arch/powerpc/configs/pasemi_defconfig | |||
@@ -2,7 +2,6 @@ CONFIG_PPC64=y | |||
2 | CONFIG_ALTIVEC=y | 2 | CONFIG_ALTIVEC=y |
3 | CONFIG_SMP=y | 3 | CONFIG_SMP=y |
4 | CONFIG_NR_CPUS=2 | 4 | CONFIG_NR_CPUS=2 |
5 | CONFIG_EXPERIMENTAL=y | ||
6 | CONFIG_SYSVIPC=y | 5 | CONFIG_SYSVIPC=y |
7 | CONFIG_NO_HZ=y | 6 | CONFIG_NO_HZ=y |
8 | CONFIG_HIGH_RES_TIMERS=y | 7 | CONFIG_HIGH_RES_TIMERS=y |
@@ -45,8 +44,9 @@ CONFIG_INET_AH=y | |||
45 | CONFIG_INET_ESP=y | 44 | CONFIG_INET_ESP=y |
46 | # CONFIG_IPV6 is not set | 45 | # CONFIG_IPV6 is not set |
47 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 46 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
47 | CONFIG_DEVTMPFS=y | ||
48 | CONFIG_DEVTMPFS_MOUNT=y | ||
48 | CONFIG_MTD=y | 49 | CONFIG_MTD=y |
49 | CONFIG_MTD_CHAR=y | ||
50 | CONFIG_MTD_BLOCK=y | 50 | CONFIG_MTD_BLOCK=y |
51 | CONFIG_MTD_SLRAM=y | 51 | CONFIG_MTD_SLRAM=y |
52 | CONFIG_MTD_PHRAM=y | 52 | CONFIG_MTD_PHRAM=y |
@@ -88,7 +88,6 @@ CONFIG_BLK_DEV_DM=y | |||
88 | CONFIG_DM_CRYPT=y | 88 | CONFIG_DM_CRYPT=y |
89 | CONFIG_NETDEVICES=y | 89 | CONFIG_NETDEVICES=y |
90 | CONFIG_DUMMY=y | 90 | CONFIG_DUMMY=y |
91 | CONFIG_MII=y | ||
92 | CONFIG_TIGON3=y | 91 | CONFIG_TIGON3=y |
93 | CONFIG_E1000=y | 92 | CONFIG_E1000=y |
94 | CONFIG_PASEMI_MAC=y | 93 | CONFIG_PASEMI_MAC=y |
@@ -174,8 +173,8 @@ CONFIG_NLS_CODEPAGE_437=y | |||
174 | CONFIG_NLS_ISO8859_1=y | 173 | CONFIG_NLS_ISO8859_1=y |
175 | CONFIG_CRC_CCITT=y | 174 | CONFIG_CRC_CCITT=y |
176 | CONFIG_PRINTK_TIME=y | 175 | CONFIG_PRINTK_TIME=y |
177 | CONFIG_MAGIC_SYSRQ=y | ||
178 | CONFIG_DEBUG_FS=y | 176 | CONFIG_DEBUG_FS=y |
177 | CONFIG_MAGIC_SYSRQ=y | ||
179 | CONFIG_DEBUG_KERNEL=y | 178 | CONFIG_DEBUG_KERNEL=y |
180 | CONFIG_DETECT_HUNG_TASK=y | 179 | CONFIG_DETECT_HUNG_TASK=y |
181 | # CONFIG_SCHED_DEBUG is not set | 180 | # CONFIG_SCHED_DEBUG is not set |
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h index ff4e2e80856d..66830618cc19 100644 --- a/arch/powerpc/include/asm/exception-64s.h +++ b/arch/powerpc/include/asm/exception-64s.h | |||
@@ -284,7 +284,7 @@ do_kvm_##n: \ | |||
284 | subi r1,r1,INT_FRAME_SIZE; /* alloc frame on kernel stack */ \ | 284 | subi r1,r1,INT_FRAME_SIZE; /* alloc frame on kernel stack */ \ |
285 | beq- 1f; \ | 285 | beq- 1f; \ |
286 | ld r1,PACAKSAVE(r13); /* kernel stack to use */ \ | 286 | ld r1,PACAKSAVE(r13); /* kernel stack to use */ \ |
287 | 1: cmpdi cr1,r1,0; /* check if r1 is in userspace */ \ | 287 | 1: cmpdi cr1,r1,-INT_FRAME_SIZE; /* check if r1 is in userspace */ \ |
288 | blt+ cr1,3f; /* abort if it is */ \ | 288 | blt+ cr1,3f; /* abort if it is */ \ |
289 | li r1,(n); /* will be reloaded later */ \ | 289 | li r1,(n); /* will be reloaded later */ \ |
290 | sth r1,PACA_TRAP_SAVE(r13); \ | 290 | sth r1,PACA_TRAP_SAVE(r13); \ |
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h index aded1b81bfd6..a4041e9ed550 100644 --- a/arch/powerpc/include/asm/opal.h +++ b/arch/powerpc/include/asm/opal.h | |||
@@ -811,13 +811,13 @@ int64_t opal_pci_next_error(uint64_t phb_id, uint64_t *first_frozen_pe, | |||
811 | int64_t opal_pci_poll(uint64_t phb_id); | 811 | int64_t opal_pci_poll(uint64_t phb_id); |
812 | int64_t opal_return_cpu(void); | 812 | int64_t opal_return_cpu(void); |
813 | 813 | ||
814 | int64_t opal_xscom_read(uint32_t gcid, uint32_t pcb_addr, uint64_t *val); | 814 | int64_t opal_xscom_read(uint32_t gcid, uint32_t pcb_addr, __be64 *val); |
815 | int64_t opal_xscom_write(uint32_t gcid, uint32_t pcb_addr, uint64_t val); | 815 | int64_t opal_xscom_write(uint32_t gcid, uint32_t pcb_addr, uint64_t val); |
816 | 816 | ||
817 | int64_t opal_lpc_write(uint32_t chip_id, enum OpalLPCAddressType addr_type, | 817 | int64_t opal_lpc_write(uint32_t chip_id, enum OpalLPCAddressType addr_type, |
818 | uint32_t addr, uint32_t data, uint32_t sz); | 818 | uint32_t addr, uint32_t data, uint32_t sz); |
819 | int64_t opal_lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type, | 819 | int64_t opal_lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type, |
820 | uint32_t addr, uint32_t *data, uint32_t sz); | 820 | uint32_t addr, __be32 *data, uint32_t sz); |
821 | int64_t opal_validate_flash(uint64_t buffer, uint32_t *size, uint32_t *result); | 821 | int64_t opal_validate_flash(uint64_t buffer, uint32_t *size, uint32_t *result); |
822 | int64_t opal_manage_flash(uint8_t op); | 822 | int64_t opal_manage_flash(uint8_t op); |
823 | int64_t opal_update_flash(uint64_t blk_list); | 823 | int64_t opal_update_flash(uint64_t blk_list); |
diff --git a/arch/powerpc/include/asm/pgalloc-32.h b/arch/powerpc/include/asm/pgalloc-32.h index 27b2386f738a..842846c1b711 100644 --- a/arch/powerpc/include/asm/pgalloc-32.h +++ b/arch/powerpc/include/asm/pgalloc-32.h | |||
@@ -84,10 +84,8 @@ static inline void pgtable_free_tlb(struct mmu_gather *tlb, | |||
84 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, | 84 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, |
85 | unsigned long address) | 85 | unsigned long address) |
86 | { | 86 | { |
87 | struct page *page = page_address(table); | ||
88 | |||
89 | tlb_flush_pgtable(tlb, address); | 87 | tlb_flush_pgtable(tlb, address); |
90 | pgtable_page_dtor(page); | 88 | pgtable_page_dtor(table); |
91 | pgtable_free_tlb(tlb, page, 0); | 89 | pgtable_free_tlb(tlb, page_address(table), 0); |
92 | } | 90 | } |
93 | #endif /* _ASM_POWERPC_PGALLOC_32_H */ | 91 | #endif /* _ASM_POWERPC_PGALLOC_32_H */ |
diff --git a/arch/powerpc/include/asm/pgalloc-64.h b/arch/powerpc/include/asm/pgalloc-64.h index 694012877bf7..4b0be20fcbfd 100644 --- a/arch/powerpc/include/asm/pgalloc-64.h +++ b/arch/powerpc/include/asm/pgalloc-64.h | |||
@@ -148,11 +148,9 @@ static inline void pgtable_free_tlb(struct mmu_gather *tlb, | |||
148 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, | 148 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, |
149 | unsigned long address) | 149 | unsigned long address) |
150 | { | 150 | { |
151 | struct page *page = page_address(table); | ||
152 | |||
153 | tlb_flush_pgtable(tlb, address); | 151 | tlb_flush_pgtable(tlb, address); |
154 | pgtable_page_dtor(page); | 152 | pgtable_page_dtor(table); |
155 | pgtable_free_tlb(tlb, page, 0); | 153 | pgtable_free_tlb(tlb, page_address(table), 0); |
156 | } | 154 | } |
157 | 155 | ||
158 | #else /* if CONFIG_PPC_64K_PAGES */ | 156 | #else /* if CONFIG_PPC_64K_PAGES */ |
diff --git a/arch/powerpc/include/asm/unaligned.h b/arch/powerpc/include/asm/unaligned.h index 5f1b1e3c2137..8296381ae432 100644 --- a/arch/powerpc/include/asm/unaligned.h +++ b/arch/powerpc/include/asm/unaligned.h | |||
@@ -4,13 +4,18 @@ | |||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | /* | 6 | /* |
7 | * The PowerPC can do unaligned accesses itself in big endian mode. | 7 | * The PowerPC can do unaligned accesses itself based on its endian mode. |
8 | */ | 8 | */ |
9 | #include <linux/unaligned/access_ok.h> | 9 | #include <linux/unaligned/access_ok.h> |
10 | #include <linux/unaligned/generic.h> | 10 | #include <linux/unaligned/generic.h> |
11 | 11 | ||
12 | #ifdef __LITTLE_ENDIAN__ | ||
13 | #define get_unaligned __get_unaligned_le | ||
14 | #define put_unaligned __put_unaligned_le | ||
15 | #else | ||
12 | #define get_unaligned __get_unaligned_be | 16 | #define get_unaligned __get_unaligned_be |
13 | #define put_unaligned __put_unaligned_be | 17 | #define put_unaligned __put_unaligned_be |
18 | #endif | ||
14 | 19 | ||
15 | #endif /* __KERNEL__ */ | 20 | #endif /* __KERNEL__ */ |
16 | #endif /* _ASM_POWERPC_UNALIGNED_H */ | 21 | #endif /* _ASM_POWERPC_UNALIGNED_H */ |
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c index 779a78c26435..11c1d069d920 100644 --- a/arch/powerpc/kernel/crash_dump.c +++ b/arch/powerpc/kernel/crash_dump.c | |||
@@ -124,15 +124,15 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, | |||
124 | void crash_free_reserved_phys_range(unsigned long begin, unsigned long end) | 124 | void crash_free_reserved_phys_range(unsigned long begin, unsigned long end) |
125 | { | 125 | { |
126 | unsigned long addr; | 126 | unsigned long addr; |
127 | const u32 *basep, *sizep; | 127 | const __be32 *basep, *sizep; |
128 | unsigned int rtas_start = 0, rtas_end = 0; | 128 | unsigned int rtas_start = 0, rtas_end = 0; |
129 | 129 | ||
130 | basep = of_get_property(rtas.dev, "linux,rtas-base", NULL); | 130 | basep = of_get_property(rtas.dev, "linux,rtas-base", NULL); |
131 | sizep = of_get_property(rtas.dev, "rtas-size", NULL); | 131 | sizep = of_get_property(rtas.dev, "rtas-size", NULL); |
132 | 132 | ||
133 | if (basep && sizep) { | 133 | if (basep && sizep) { |
134 | rtas_start = *basep; | 134 | rtas_start = be32_to_cpup(basep); |
135 | rtas_end = *basep + *sizep; | 135 | rtas_end = rtas_start + be32_to_cpup(sizep); |
136 | } | 136 | } |
137 | 137 | ||
138 | for (addr = begin; addr < end; addr += PAGE_SIZE) { | 138 | for (addr = begin; addr < end; addr += PAGE_SIZE) { |
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 2ae41aba4053..4f0946de2d5c 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -80,6 +80,7 @@ END_FTR_SECTION(0, 1) | |||
80 | * of the function that the cpu should jump to to continue | 80 | * of the function that the cpu should jump to to continue |
81 | * initialization. | 81 | * initialization. |
82 | */ | 82 | */ |
83 | .balign 8 | ||
83 | .globl __secondary_hold_spinloop | 84 | .globl __secondary_hold_spinloop |
84 | __secondary_hold_spinloop: | 85 | __secondary_hold_spinloop: |
85 | .llong 0x0 | 86 | .llong 0x0 |
@@ -470,6 +471,7 @@ _STATIC(__after_prom_start) | |||
470 | mtctr r8 | 471 | mtctr r8 |
471 | bctr | 472 | bctr |
472 | 473 | ||
474 | .balign 8 | ||
473 | p_end: .llong _end - _stext | 475 | p_end: .llong _end - _stext |
474 | 476 | ||
475 | 4: /* Now copy the rest of the kernel up to _end */ | 477 | 4: /* Now copy the rest of the kernel up to _end */ |
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index 88a7fb458dfd..75d4f7340da8 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c | |||
@@ -148,7 +148,7 @@ void __init reserve_crashkernel(void) | |||
148 | * a small SLB (128MB) since the crash kernel needs to place | 148 | * a small SLB (128MB) since the crash kernel needs to place |
149 | * itself and some stacks to be in the first segment. | 149 | * itself and some stacks to be in the first segment. |
150 | */ | 150 | */ |
151 | crashk_res.start = min(0x80000000ULL, (ppc64_rma_size / 2)); | 151 | crashk_res.start = min(0x8000000ULL, (ppc64_rma_size / 2)); |
152 | #else | 152 | #else |
153 | crashk_res.start = KDUMP_KERNELBASE; | 153 | crashk_res.start = KDUMP_KERNELBASE; |
154 | #endif | 154 | #endif |
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S index a9f7a79a3a40..3d0249599d52 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S | |||
@@ -252,8 +252,8 @@ _GLOBAL(__bswapdi2) | |||
252 | or r3,r7,r9 | 252 | or r3,r7,r9 |
253 | blr | 253 | blr |
254 | 254 | ||
255 | #if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) | ||
256 | 255 | ||
256 | #ifdef CONFIG_PPC_EARLY_DEBUG_BOOTX | ||
257 | _GLOBAL(rmci_on) | 257 | _GLOBAL(rmci_on) |
258 | sync | 258 | sync |
259 | isync | 259 | isync |
@@ -283,6 +283,9 @@ _GLOBAL(rmci_off) | |||
283 | isync | 283 | isync |
284 | sync | 284 | sync |
285 | blr | 285 | blr |
286 | #endif /* CONFIG_PPC_EARLY_DEBUG_BOOTX */ | ||
287 | |||
288 | #if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) | ||
286 | 289 | ||
287 | /* | 290 | /* |
288 | * Do an IO access in real mode | 291 | * Do an IO access in real mode |
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index 75fb40498b41..2e3d2bf536c5 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c | |||
@@ -1555,7 +1555,7 @@ long arch_ptrace(struct task_struct *child, long request, | |||
1555 | 1555 | ||
1556 | flush_fp_to_thread(child); | 1556 | flush_fp_to_thread(child); |
1557 | if (fpidx < (PT_FPSCR - PT_FPR0)) | 1557 | if (fpidx < (PT_FPSCR - PT_FPR0)) |
1558 | memcpy(&tmp, &child->thread.fp_state.fpr, | 1558 | memcpy(&tmp, &child->thread.TS_FPR(fpidx), |
1559 | sizeof(long)); | 1559 | sizeof(long)); |
1560 | else | 1560 | else |
1561 | tmp = child->thread.fp_state.fpscr; | 1561 | tmp = child->thread.fp_state.fpscr; |
@@ -1588,7 +1588,7 @@ long arch_ptrace(struct task_struct *child, long request, | |||
1588 | 1588 | ||
1589 | flush_fp_to_thread(child); | 1589 | flush_fp_to_thread(child); |
1590 | if (fpidx < (PT_FPSCR - PT_FPR0)) | 1590 | if (fpidx < (PT_FPSCR - PT_FPR0)) |
1591 | memcpy(&child->thread.fp_state.fpr, &data, | 1591 | memcpy(&child->thread.TS_FPR(fpidx), &data, |
1592 | sizeof(long)); | 1592 | sizeof(long)); |
1593 | else | 1593 | else |
1594 | child->thread.fp_state.fpscr = data; | 1594 | child->thread.fp_state.fpscr = data; |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index febc80445d25..bc76cc6b419c 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -479,7 +479,7 @@ void __init smp_setup_cpu_maps(void) | |||
479 | if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) && | 479 | if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) && |
480 | (dn = of_find_node_by_path("/rtas"))) { | 480 | (dn = of_find_node_by_path("/rtas"))) { |
481 | int num_addr_cell, num_size_cell, maxcpus; | 481 | int num_addr_cell, num_size_cell, maxcpus; |
482 | const unsigned int *ireg; | 482 | const __be32 *ireg; |
483 | 483 | ||
484 | num_addr_cell = of_n_addr_cells(dn); | 484 | num_addr_cell = of_n_addr_cells(dn); |
485 | num_size_cell = of_n_size_cells(dn); | 485 | num_size_cell = of_n_size_cells(dn); |
@@ -489,7 +489,7 @@ void __init smp_setup_cpu_maps(void) | |||
489 | if (!ireg) | 489 | if (!ireg) |
490 | goto out; | 490 | goto out; |
491 | 491 | ||
492 | maxcpus = ireg[num_addr_cell + num_size_cell]; | 492 | maxcpus = be32_to_cpup(ireg + num_addr_cell + num_size_cell); |
493 | 493 | ||
494 | /* Double maxcpus for processors which have SMT capability */ | 494 | /* Double maxcpus for processors which have SMT capability */ |
495 | if (cpu_has_feature(CPU_FTR_SMT)) | 495 | if (cpu_has_feature(CPU_FTR_SMT)) |
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 19d654b0150a..ac2621af3154 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
@@ -575,7 +575,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle) | |||
575 | int cpu_to_core_id(int cpu) | 575 | int cpu_to_core_id(int cpu) |
576 | { | 576 | { |
577 | struct device_node *np; | 577 | struct device_node *np; |
578 | const int *reg; | 578 | const __be32 *reg; |
579 | int id = -1; | 579 | int id = -1; |
580 | 580 | ||
581 | np = of_get_cpu_node(cpu, NULL); | 581 | np = of_get_cpu_node(cpu, NULL); |
@@ -586,7 +586,7 @@ int cpu_to_core_id(int cpu) | |||
586 | if (!reg) | 586 | if (!reg) |
587 | goto out; | 587 | goto out; |
588 | 588 | ||
589 | id = *reg; | 589 | id = be32_to_cpup(reg); |
590 | out: | 590 | out: |
591 | of_node_put(np); | 591 | of_node_put(np); |
592 | return id; | 592 | return id; |
diff --git a/arch/powerpc/lib/copyuser_64.S b/arch/powerpc/lib/copyuser_64.S index d73a59014900..596a285c0755 100644 --- a/arch/powerpc/lib/copyuser_64.S +++ b/arch/powerpc/lib/copyuser_64.S | |||
@@ -9,6 +9,14 @@ | |||
9 | #include <asm/processor.h> | 9 | #include <asm/processor.h> |
10 | #include <asm/ppc_asm.h> | 10 | #include <asm/ppc_asm.h> |
11 | 11 | ||
12 | #ifdef __BIG_ENDIAN__ | ||
13 | #define sLd sld /* Shift towards low-numbered address. */ | ||
14 | #define sHd srd /* Shift towards high-numbered address. */ | ||
15 | #else | ||
16 | #define sLd srd /* Shift towards low-numbered address. */ | ||
17 | #define sHd sld /* Shift towards high-numbered address. */ | ||
18 | #endif | ||
19 | |||
12 | .align 7 | 20 | .align 7 |
13 | _GLOBAL(__copy_tofrom_user) | 21 | _GLOBAL(__copy_tofrom_user) |
14 | BEGIN_FTR_SECTION | 22 | BEGIN_FTR_SECTION |
@@ -118,10 +126,10 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
118 | 126 | ||
119 | 24: ld r9,0(r4) /* 3+2n loads, 2+2n stores */ | 127 | 24: ld r9,0(r4) /* 3+2n loads, 2+2n stores */ |
120 | 25: ld r0,8(r4) | 128 | 25: ld r0,8(r4) |
121 | sld r6,r9,r10 | 129 | sLd r6,r9,r10 |
122 | 26: ldu r9,16(r4) | 130 | 26: ldu r9,16(r4) |
123 | srd r7,r0,r11 | 131 | sHd r7,r0,r11 |
124 | sld r8,r0,r10 | 132 | sLd r8,r0,r10 |
125 | or r7,r7,r6 | 133 | or r7,r7,r6 |
126 | blt cr6,79f | 134 | blt cr6,79f |
127 | 27: ld r0,8(r4) | 135 | 27: ld r0,8(r4) |
@@ -129,35 +137,35 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
129 | 137 | ||
130 | 28: ld r0,0(r4) /* 4+2n loads, 3+2n stores */ | 138 | 28: ld r0,0(r4) /* 4+2n loads, 3+2n stores */ |
131 | 29: ldu r9,8(r4) | 139 | 29: ldu r9,8(r4) |
132 | sld r8,r0,r10 | 140 | sLd r8,r0,r10 |
133 | addi r3,r3,-8 | 141 | addi r3,r3,-8 |
134 | blt cr6,5f | 142 | blt cr6,5f |
135 | 30: ld r0,8(r4) | 143 | 30: ld r0,8(r4) |
136 | srd r12,r9,r11 | 144 | sHd r12,r9,r11 |
137 | sld r6,r9,r10 | 145 | sLd r6,r9,r10 |
138 | 31: ldu r9,16(r4) | 146 | 31: ldu r9,16(r4) |
139 | or r12,r8,r12 | 147 | or r12,r8,r12 |
140 | srd r7,r0,r11 | 148 | sHd r7,r0,r11 |
141 | sld r8,r0,r10 | 149 | sLd r8,r0,r10 |
142 | addi r3,r3,16 | 150 | addi r3,r3,16 |
143 | beq cr6,78f | 151 | beq cr6,78f |
144 | 152 | ||
145 | 1: or r7,r7,r6 | 153 | 1: or r7,r7,r6 |
146 | 32: ld r0,8(r4) | 154 | 32: ld r0,8(r4) |
147 | 76: std r12,8(r3) | 155 | 76: std r12,8(r3) |
148 | 2: srd r12,r9,r11 | 156 | 2: sHd r12,r9,r11 |
149 | sld r6,r9,r10 | 157 | sLd r6,r9,r10 |
150 | 33: ldu r9,16(r4) | 158 | 33: ldu r9,16(r4) |
151 | or r12,r8,r12 | 159 | or r12,r8,r12 |
152 | 77: stdu r7,16(r3) | 160 | 77: stdu r7,16(r3) |
153 | srd r7,r0,r11 | 161 | sHd r7,r0,r11 |
154 | sld r8,r0,r10 | 162 | sLd r8,r0,r10 |
155 | bdnz 1b | 163 | bdnz 1b |
156 | 164 | ||
157 | 78: std r12,8(r3) | 165 | 78: std r12,8(r3) |
158 | or r7,r7,r6 | 166 | or r7,r7,r6 |
159 | 79: std r7,16(r3) | 167 | 79: std r7,16(r3) |
160 | 5: srd r12,r9,r11 | 168 | 5: sHd r12,r9,r11 |
161 | or r12,r8,r12 | 169 | or r12,r8,r12 |
162 | 80: std r12,24(r3) | 170 | 80: std r12,24(r3) |
163 | bne 6f | 171 | bne 6f |
@@ -165,23 +173,38 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
165 | blr | 173 | blr |
166 | 6: cmpwi cr1,r5,8 | 174 | 6: cmpwi cr1,r5,8 |
167 | addi r3,r3,32 | 175 | addi r3,r3,32 |
168 | sld r9,r9,r10 | 176 | sLd r9,r9,r10 |
169 | ble cr1,7f | 177 | ble cr1,7f |
170 | 34: ld r0,8(r4) | 178 | 34: ld r0,8(r4) |
171 | srd r7,r0,r11 | 179 | sHd r7,r0,r11 |
172 | or r9,r7,r9 | 180 | or r9,r7,r9 |
173 | 7: | 181 | 7: |
174 | bf cr7*4+1,1f | 182 | bf cr7*4+1,1f |
183 | #ifdef __BIG_ENDIAN__ | ||
175 | rotldi r9,r9,32 | 184 | rotldi r9,r9,32 |
185 | #endif | ||
176 | 94: stw r9,0(r3) | 186 | 94: stw r9,0(r3) |
187 | #ifdef __LITTLE_ENDIAN__ | ||
188 | rotrdi r9,r9,32 | ||
189 | #endif | ||
177 | addi r3,r3,4 | 190 | addi r3,r3,4 |
178 | 1: bf cr7*4+2,2f | 191 | 1: bf cr7*4+2,2f |
192 | #ifdef __BIG_ENDIAN__ | ||
179 | rotldi r9,r9,16 | 193 | rotldi r9,r9,16 |
194 | #endif | ||
180 | 95: sth r9,0(r3) | 195 | 95: sth r9,0(r3) |
196 | #ifdef __LITTLE_ENDIAN__ | ||
197 | rotrdi r9,r9,16 | ||
198 | #endif | ||
181 | addi r3,r3,2 | 199 | addi r3,r3,2 |
182 | 2: bf cr7*4+3,3f | 200 | 2: bf cr7*4+3,3f |
201 | #ifdef __BIG_ENDIAN__ | ||
183 | rotldi r9,r9,8 | 202 | rotldi r9,r9,8 |
203 | #endif | ||
184 | 96: stb r9,0(r3) | 204 | 96: stb r9,0(r3) |
205 | #ifdef __LITTLE_ENDIAN__ | ||
206 | rotrdi r9,r9,8 | ||
207 | #endif | ||
185 | 3: li r3,0 | 208 | 3: li r3,0 |
186 | blr | 209 | blr |
187 | 210 | ||
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c index 31320c641c92..9b1db254898a 100644 --- a/arch/powerpc/platforms/powernv/eeh-ioda.c +++ b/arch/powerpc/platforms/powernv/eeh-ioda.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include "powernv.h" | 36 | #include "powernv.h" |
37 | #include "pci.h" | 37 | #include "pci.h" |
38 | 38 | ||
39 | static char *hub_diag = NULL; | ||
40 | static int ioda_eeh_nb_init = 0; | 39 | static int ioda_eeh_nb_init = 0; |
41 | 40 | ||
42 | static int ioda_eeh_event(struct notifier_block *nb, | 41 | static int ioda_eeh_event(struct notifier_block *nb, |
@@ -140,15 +139,6 @@ static int ioda_eeh_post_init(struct pci_controller *hose) | |||
140 | ioda_eeh_nb_init = 1; | 139 | ioda_eeh_nb_init = 1; |
141 | } | 140 | } |
142 | 141 | ||
143 | /* We needn't HUB diag-data on PHB3 */ | ||
144 | if (phb->type == PNV_PHB_IODA1 && !hub_diag) { | ||
145 | hub_diag = (char *)__get_free_page(GFP_KERNEL | __GFP_ZERO); | ||
146 | if (!hub_diag) { | ||
147 | pr_err("%s: Out of memory !\n", __func__); | ||
148 | return -ENOMEM; | ||
149 | } | ||
150 | } | ||
151 | |||
152 | #ifdef CONFIG_DEBUG_FS | 142 | #ifdef CONFIG_DEBUG_FS |
153 | if (phb->dbgfs) { | 143 | if (phb->dbgfs) { |
154 | debugfs_create_file("err_injct_outbound", 0600, | 144 | debugfs_create_file("err_injct_outbound", 0600, |
@@ -630,11 +620,10 @@ static void ioda_eeh_hub_diag_common(struct OpalIoP7IOCErrorData *data) | |||
630 | static void ioda_eeh_hub_diag(struct pci_controller *hose) | 620 | static void ioda_eeh_hub_diag(struct pci_controller *hose) |
631 | { | 621 | { |
632 | struct pnv_phb *phb = hose->private_data; | 622 | struct pnv_phb *phb = hose->private_data; |
633 | struct OpalIoP7IOCErrorData *data; | 623 | struct OpalIoP7IOCErrorData *data = &phb->diag.hub_diag; |
634 | long rc; | 624 | long rc; |
635 | 625 | ||
636 | data = (struct OpalIoP7IOCErrorData *)ioda_eeh_hub_diag; | 626 | rc = opal_pci_get_hub_diag_data(phb->hub_id, data, sizeof(*data)); |
637 | rc = opal_pci_get_hub_diag_data(phb->hub_id, data, PAGE_SIZE); | ||
638 | if (rc != OPAL_SUCCESS) { | 627 | if (rc != OPAL_SUCCESS) { |
639 | pr_warning("%s: Failed to get HUB#%llx diag-data (%ld)\n", | 628 | pr_warning("%s: Failed to get HUB#%llx diag-data (%ld)\n", |
640 | __func__, phb->hub_id, rc); | 629 | __func__, phb->hub_id, rc); |
diff --git a/arch/powerpc/platforms/powernv/opal-lpc.c b/arch/powerpc/platforms/powernv/opal-lpc.c index e7e59e4f9892..79d83cad3d67 100644 --- a/arch/powerpc/platforms/powernv/opal-lpc.c +++ b/arch/powerpc/platforms/powernv/opal-lpc.c | |||
@@ -24,25 +24,25 @@ static int opal_lpc_chip_id = -1; | |||
24 | static u8 opal_lpc_inb(unsigned long port) | 24 | static u8 opal_lpc_inb(unsigned long port) |
25 | { | 25 | { |
26 | int64_t rc; | 26 | int64_t rc; |
27 | uint32_t data; | 27 | __be32 data; |
28 | 28 | ||
29 | if (opal_lpc_chip_id < 0 || port > 0xffff) | 29 | if (opal_lpc_chip_id < 0 || port > 0xffff) |
30 | return 0xff; | 30 | return 0xff; |
31 | rc = opal_lpc_read(opal_lpc_chip_id, OPAL_LPC_IO, port, &data, 1); | 31 | rc = opal_lpc_read(opal_lpc_chip_id, OPAL_LPC_IO, port, &data, 1); |
32 | return rc ? 0xff : data; | 32 | return rc ? 0xff : be32_to_cpu(data); |
33 | } | 33 | } |
34 | 34 | ||
35 | static __le16 __opal_lpc_inw(unsigned long port) | 35 | static __le16 __opal_lpc_inw(unsigned long port) |
36 | { | 36 | { |
37 | int64_t rc; | 37 | int64_t rc; |
38 | uint32_t data; | 38 | __be32 data; |
39 | 39 | ||
40 | if (opal_lpc_chip_id < 0 || port > 0xfffe) | 40 | if (opal_lpc_chip_id < 0 || port > 0xfffe) |
41 | return 0xffff; | 41 | return 0xffff; |
42 | if (port & 1) | 42 | if (port & 1) |
43 | return (__le16)opal_lpc_inb(port) << 8 | opal_lpc_inb(port + 1); | 43 | return (__le16)opal_lpc_inb(port) << 8 | opal_lpc_inb(port + 1); |
44 | rc = opal_lpc_read(opal_lpc_chip_id, OPAL_LPC_IO, port, &data, 2); | 44 | rc = opal_lpc_read(opal_lpc_chip_id, OPAL_LPC_IO, port, &data, 2); |
45 | return rc ? 0xffff : data; | 45 | return rc ? 0xffff : be32_to_cpu(data); |
46 | } | 46 | } |
47 | static u16 opal_lpc_inw(unsigned long port) | 47 | static u16 opal_lpc_inw(unsigned long port) |
48 | { | 48 | { |
@@ -52,7 +52,7 @@ static u16 opal_lpc_inw(unsigned long port) | |||
52 | static __le32 __opal_lpc_inl(unsigned long port) | 52 | static __le32 __opal_lpc_inl(unsigned long port) |
53 | { | 53 | { |
54 | int64_t rc; | 54 | int64_t rc; |
55 | uint32_t data; | 55 | __be32 data; |
56 | 56 | ||
57 | if (opal_lpc_chip_id < 0 || port > 0xfffc) | 57 | if (opal_lpc_chip_id < 0 || port > 0xfffc) |
58 | return 0xffffffff; | 58 | return 0xffffffff; |
@@ -62,7 +62,7 @@ static __le32 __opal_lpc_inl(unsigned long port) | |||
62 | (__le32)opal_lpc_inb(port + 2) << 8 | | 62 | (__le32)opal_lpc_inb(port + 2) << 8 | |
63 | opal_lpc_inb(port + 3); | 63 | opal_lpc_inb(port + 3); |
64 | rc = opal_lpc_read(opal_lpc_chip_id, OPAL_LPC_IO, port, &data, 4); | 64 | rc = opal_lpc_read(opal_lpc_chip_id, OPAL_LPC_IO, port, &data, 4); |
65 | return rc ? 0xffffffff : data; | 65 | return rc ? 0xffffffff : be32_to_cpu(data); |
66 | } | 66 | } |
67 | 67 | ||
68 | static u32 opal_lpc_inl(unsigned long port) | 68 | static u32 opal_lpc_inl(unsigned long port) |
diff --git a/arch/powerpc/platforms/powernv/opal-xscom.c b/arch/powerpc/platforms/powernv/opal-xscom.c index 4d99a8fd55ac..4fbf276ac99e 100644 --- a/arch/powerpc/platforms/powernv/opal-xscom.c +++ b/arch/powerpc/platforms/powernv/opal-xscom.c | |||
@@ -96,9 +96,11 @@ static int opal_scom_read(scom_map_t map, u64 reg, u64 *value) | |||
96 | { | 96 | { |
97 | struct opal_scom_map *m = map; | 97 | struct opal_scom_map *m = map; |
98 | int64_t rc; | 98 | int64_t rc; |
99 | __be64 v; | ||
99 | 100 | ||
100 | reg = opal_scom_unmangle(reg); | 101 | reg = opal_scom_unmangle(reg); |
101 | rc = opal_xscom_read(m->chip, m->addr + reg, (uint64_t *)__pa(value)); | 102 | rc = opal_xscom_read(m->chip, m->addr + reg, (__be64 *)__pa(&v)); |
103 | *value = be64_to_cpu(v); | ||
102 | return opal_xscom_err_xlate(rc); | 104 | return opal_xscom_err_xlate(rc); |
103 | } | 105 | } |
104 | 106 | ||
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 614356cac466..f0e68714696e 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c | |||
@@ -720,6 +720,7 @@ static void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb *phb, | |||
720 | tbl->it_type = TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE; | 720 | tbl->it_type = TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE; |
721 | } | 721 | } |
722 | iommu_init_table(tbl, phb->hose->node); | 722 | iommu_init_table(tbl, phb->hose->node); |
723 | iommu_register_group(tbl, pci_domain_nr(pe->pbus), pe->pe_number); | ||
723 | 724 | ||
724 | if (pe->pdev) | 725 | if (pe->pdev) |
725 | set_iommu_table_base_and_group(&pe->pdev->dev, tbl); | 726 | set_iommu_table_base_and_group(&pe->pdev->dev, tbl); |
diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h index 9a11ff0c5c0b..13f1942a9a5f 100644 --- a/arch/powerpc/platforms/powernv/pci.h +++ b/arch/powerpc/platforms/powernv/pci.h | |||
@@ -172,12 +172,14 @@ struct pnv_phb { | |||
172 | } ioda; | 172 | } ioda; |
173 | }; | 173 | }; |
174 | 174 | ||
175 | /* PHB status structure */ | 175 | /* PHB and hub status structure */ |
176 | union { | 176 | union { |
177 | unsigned char blob[PNV_PCI_DIAG_BUF_SIZE]; | 177 | unsigned char blob[PNV_PCI_DIAG_BUF_SIZE]; |
178 | struct OpalIoP7IOCPhbErrorData p7ioc; | 178 | struct OpalIoP7IOCPhbErrorData p7ioc; |
179 | struct OpalIoPhb3ErrorData phb3; | 179 | struct OpalIoPhb3ErrorData phb3; |
180 | struct OpalIoP7IOCErrorData hub_diag; | ||
180 | } diag; | 181 | } diag; |
182 | |||
181 | }; | 183 | }; |
182 | 184 | ||
183 | extern struct pci_ops pnv_pci_ops; | 185 | extern struct pci_ops pnv_pci_ops; |
diff --git a/arch/powerpc/platforms/pseries/lparcfg.c b/arch/powerpc/platforms/pseries/lparcfg.c index e738007eae64..c9fecf09b8fa 100644 --- a/arch/powerpc/platforms/pseries/lparcfg.c +++ b/arch/powerpc/platforms/pseries/lparcfg.c | |||
@@ -157,7 +157,7 @@ static void parse_ppp_data(struct seq_file *m) | |||
157 | { | 157 | { |
158 | struct hvcall_ppp_data ppp_data; | 158 | struct hvcall_ppp_data ppp_data; |
159 | struct device_node *root; | 159 | struct device_node *root; |
160 | const int *perf_level; | 160 | const __be32 *perf_level; |
161 | int rc; | 161 | int rc; |
162 | 162 | ||
163 | rc = h_get_ppp(&ppp_data); | 163 | rc = h_get_ppp(&ppp_data); |
@@ -201,7 +201,7 @@ static void parse_ppp_data(struct seq_file *m) | |||
201 | perf_level = of_get_property(root, | 201 | perf_level = of_get_property(root, |
202 | "ibm,partition-performance-parameters-level", | 202 | "ibm,partition-performance-parameters-level", |
203 | NULL); | 203 | NULL); |
204 | if (perf_level && (*perf_level >= 1)) { | 204 | if (perf_level && (be32_to_cpup(perf_level) >= 1)) { |
205 | seq_printf(m, | 205 | seq_printf(m, |
206 | "physical_procs_allocated_to_virtualization=%d\n", | 206 | "physical_procs_allocated_to_virtualization=%d\n", |
207 | ppp_data.phys_platform_procs); | 207 | ppp_data.phys_platform_procs); |
@@ -435,7 +435,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v) | |||
435 | int partition_potential_processors; | 435 | int partition_potential_processors; |
436 | int partition_active_processors; | 436 | int partition_active_processors; |
437 | struct device_node *rtas_node; | 437 | struct device_node *rtas_node; |
438 | const int *lrdrp = NULL; | 438 | const __be32 *lrdrp = NULL; |
439 | 439 | ||
440 | rtas_node = of_find_node_by_path("/rtas"); | 440 | rtas_node = of_find_node_by_path("/rtas"); |
441 | if (rtas_node) | 441 | if (rtas_node) |
@@ -444,7 +444,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v) | |||
444 | if (lrdrp == NULL) { | 444 | if (lrdrp == NULL) { |
445 | partition_potential_processors = vdso_data->processorCount; | 445 | partition_potential_processors = vdso_data->processorCount; |
446 | } else { | 446 | } else { |
447 | partition_potential_processors = *(lrdrp + 4); | 447 | partition_potential_processors = be32_to_cpup(lrdrp + 4); |
448 | } | 448 | } |
449 | of_node_put(rtas_node); | 449 | of_node_put(rtas_node); |
450 | 450 | ||
@@ -654,7 +654,7 @@ static int lparcfg_data(struct seq_file *m, void *v) | |||
654 | const char *model = ""; | 654 | const char *model = ""; |
655 | const char *system_id = ""; | 655 | const char *system_id = ""; |
656 | const char *tmp; | 656 | const char *tmp; |
657 | const unsigned int *lp_index_ptr; | 657 | const __be32 *lp_index_ptr; |
658 | unsigned int lp_index = 0; | 658 | unsigned int lp_index = 0; |
659 | 659 | ||
660 | seq_printf(m, "%s %s\n", MODULE_NAME, MODULE_VERS); | 660 | seq_printf(m, "%s %s\n", MODULE_NAME, MODULE_VERS); |
@@ -670,7 +670,7 @@ static int lparcfg_data(struct seq_file *m, void *v) | |||
670 | lp_index_ptr = of_get_property(rootdn, "ibm,partition-no", | 670 | lp_index_ptr = of_get_property(rootdn, "ibm,partition-no", |
671 | NULL); | 671 | NULL); |
672 | if (lp_index_ptr) | 672 | if (lp_index_ptr) |
673 | lp_index = *lp_index_ptr; | 673 | lp_index = be32_to_cpup(lp_index_ptr); |
674 | of_node_put(rootdn); | 674 | of_node_put(rootdn); |
675 | } | 675 | } |
676 | seq_printf(m, "serial_number=%s\n", system_id); | 676 | seq_printf(m, "serial_number=%s\n", system_id); |
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c index 6d2f0abce6fa..0c882e83c4ce 100644 --- a/arch/powerpc/platforms/pseries/msi.c +++ b/arch/powerpc/platforms/pseries/msi.c | |||
@@ -130,7 +130,8 @@ static int check_req(struct pci_dev *pdev, int nvec, char *prop_name) | |||
130 | { | 130 | { |
131 | struct device_node *dn; | 131 | struct device_node *dn; |
132 | struct pci_dn *pdn; | 132 | struct pci_dn *pdn; |
133 | const u32 *req_msi; | 133 | const __be32 *p; |
134 | u32 req_msi; | ||
134 | 135 | ||
135 | pdn = pci_get_pdn(pdev); | 136 | pdn = pci_get_pdn(pdev); |
136 | if (!pdn) | 137 | if (!pdn) |
@@ -138,19 +139,20 @@ static int check_req(struct pci_dev *pdev, int nvec, char *prop_name) | |||
138 | 139 | ||
139 | dn = pdn->node; | 140 | dn = pdn->node; |
140 | 141 | ||
141 | req_msi = of_get_property(dn, prop_name, NULL); | 142 | p = of_get_property(dn, prop_name, NULL); |
142 | if (!req_msi) { | 143 | if (!p) { |
143 | pr_debug("rtas_msi: No %s on %s\n", prop_name, dn->full_name); | 144 | pr_debug("rtas_msi: No %s on %s\n", prop_name, dn->full_name); |
144 | return -ENOENT; | 145 | return -ENOENT; |
145 | } | 146 | } |
146 | 147 | ||
147 | if (*req_msi < nvec) { | 148 | req_msi = be32_to_cpup(p); |
149 | if (req_msi < nvec) { | ||
148 | pr_debug("rtas_msi: %s requests < %d MSIs\n", prop_name, nvec); | 150 | pr_debug("rtas_msi: %s requests < %d MSIs\n", prop_name, nvec); |
149 | 151 | ||
150 | if (*req_msi == 0) /* Be paranoid */ | 152 | if (req_msi == 0) /* Be paranoid */ |
151 | return -ENOSPC; | 153 | return -ENOSPC; |
152 | 154 | ||
153 | return *req_msi; | 155 | return req_msi; |
154 | } | 156 | } |
155 | 157 | ||
156 | return 0; | 158 | return 0; |
@@ -171,7 +173,7 @@ static int check_req_msix(struct pci_dev *pdev, int nvec) | |||
171 | static struct device_node *find_pe_total_msi(struct pci_dev *dev, int *total) | 173 | static struct device_node *find_pe_total_msi(struct pci_dev *dev, int *total) |
172 | { | 174 | { |
173 | struct device_node *dn; | 175 | struct device_node *dn; |
174 | const u32 *p; | 176 | const __be32 *p; |
175 | 177 | ||
176 | dn = of_node_get(pci_device_to_OF_node(dev)); | 178 | dn = of_node_get(pci_device_to_OF_node(dev)); |
177 | while (dn) { | 179 | while (dn) { |
@@ -179,7 +181,7 @@ static struct device_node *find_pe_total_msi(struct pci_dev *dev, int *total) | |||
179 | if (p) { | 181 | if (p) { |
180 | pr_debug("rtas_msi: found prop on dn %s\n", | 182 | pr_debug("rtas_msi: found prop on dn %s\n", |
181 | dn->full_name); | 183 | dn->full_name); |
182 | *total = *p; | 184 | *total = be32_to_cpup(p); |
183 | return dn; | 185 | return dn; |
184 | } | 186 | } |
185 | 187 | ||
@@ -232,13 +234,13 @@ struct msi_counts { | |||
232 | static void *count_non_bridge_devices(struct device_node *dn, void *data) | 234 | static void *count_non_bridge_devices(struct device_node *dn, void *data) |
233 | { | 235 | { |
234 | struct msi_counts *counts = data; | 236 | struct msi_counts *counts = data; |
235 | const u32 *p; | 237 | const __be32 *p; |
236 | u32 class; | 238 | u32 class; |
237 | 239 | ||
238 | pr_debug("rtas_msi: counting %s\n", dn->full_name); | 240 | pr_debug("rtas_msi: counting %s\n", dn->full_name); |
239 | 241 | ||
240 | p = of_get_property(dn, "class-code", NULL); | 242 | p = of_get_property(dn, "class-code", NULL); |
241 | class = p ? *p : 0; | 243 | class = p ? be32_to_cpup(p) : 0; |
242 | 244 | ||
243 | if ((class >> 8) != PCI_CLASS_BRIDGE_PCI) | 245 | if ((class >> 8) != PCI_CLASS_BRIDGE_PCI) |
244 | counts->num_devices++; | 246 | counts->num_devices++; |
@@ -249,7 +251,7 @@ static void *count_non_bridge_devices(struct device_node *dn, void *data) | |||
249 | static void *count_spare_msis(struct device_node *dn, void *data) | 251 | static void *count_spare_msis(struct device_node *dn, void *data) |
250 | { | 252 | { |
251 | struct msi_counts *counts = data; | 253 | struct msi_counts *counts = data; |
252 | const u32 *p; | 254 | const __be32 *p; |
253 | int req; | 255 | int req; |
254 | 256 | ||
255 | if (dn == counts->requestor) | 257 | if (dn == counts->requestor) |
@@ -260,11 +262,11 @@ static void *count_spare_msis(struct device_node *dn, void *data) | |||
260 | req = 0; | 262 | req = 0; |
261 | p = of_get_property(dn, "ibm,req#msi", NULL); | 263 | p = of_get_property(dn, "ibm,req#msi", NULL); |
262 | if (p) | 264 | if (p) |
263 | req = *p; | 265 | req = be32_to_cpup(p); |
264 | 266 | ||
265 | p = of_get_property(dn, "ibm,req#msi-x", NULL); | 267 | p = of_get_property(dn, "ibm,req#msi-x", NULL); |
266 | if (p) | 268 | if (p) |
267 | req = max(req, (int)*p); | 269 | req = max(req, (int)be32_to_cpup(p)); |
268 | } | 270 | } |
269 | 271 | ||
270 | if (req < counts->quota) | 272 | if (req < counts->quota) |
diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c index 7bfaf58d4664..d7096f2f7751 100644 --- a/arch/powerpc/platforms/pseries/nvram.c +++ b/arch/powerpc/platforms/pseries/nvram.c | |||
@@ -43,8 +43,8 @@ static char nvram_buf[NVRW_CNT]; /* assume this is in the first 4GB */ | |||
43 | static DEFINE_SPINLOCK(nvram_lock); | 43 | static DEFINE_SPINLOCK(nvram_lock); |
44 | 44 | ||
45 | struct err_log_info { | 45 | struct err_log_info { |
46 | int error_type; | 46 | __be32 error_type; |
47 | unsigned int seq_num; | 47 | __be32 seq_num; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | struct nvram_os_partition { | 50 | struct nvram_os_partition { |
@@ -79,9 +79,9 @@ static const char *pseries_nvram_os_partitions[] = { | |||
79 | }; | 79 | }; |
80 | 80 | ||
81 | struct oops_log_info { | 81 | struct oops_log_info { |
82 | u16 version; | 82 | __be16 version; |
83 | u16 report_length; | 83 | __be16 report_length; |
84 | u64 timestamp; | 84 | __be64 timestamp; |
85 | } __attribute__((packed)); | 85 | } __attribute__((packed)); |
86 | 86 | ||
87 | static void oops_to_nvram(struct kmsg_dumper *dumper, | 87 | static void oops_to_nvram(struct kmsg_dumper *dumper, |
@@ -291,8 +291,8 @@ int nvram_write_os_partition(struct nvram_os_partition *part, char * buff, | |||
291 | length = part->size; | 291 | length = part->size; |
292 | } | 292 | } |
293 | 293 | ||
294 | info.error_type = err_type; | 294 | info.error_type = cpu_to_be32(err_type); |
295 | info.seq_num = error_log_cnt; | 295 | info.seq_num = cpu_to_be32(error_log_cnt); |
296 | 296 | ||
297 | tmp_index = part->index; | 297 | tmp_index = part->index; |
298 | 298 | ||
@@ -364,8 +364,8 @@ int nvram_read_partition(struct nvram_os_partition *part, char *buff, | |||
364 | } | 364 | } |
365 | 365 | ||
366 | if (part->os_partition) { | 366 | if (part->os_partition) { |
367 | *error_log_cnt = info.seq_num; | 367 | *error_log_cnt = be32_to_cpu(info.seq_num); |
368 | *err_type = info.error_type; | 368 | *err_type = be32_to_cpu(info.error_type); |
369 | } | 369 | } |
370 | 370 | ||
371 | return 0; | 371 | return 0; |
@@ -529,9 +529,9 @@ static int zip_oops(size_t text_len) | |||
529 | pr_err("nvram: logging uncompressed oops/panic report\n"); | 529 | pr_err("nvram: logging uncompressed oops/panic report\n"); |
530 | return -1; | 530 | return -1; |
531 | } | 531 | } |
532 | oops_hdr->version = OOPS_HDR_VERSION; | 532 | oops_hdr->version = cpu_to_be16(OOPS_HDR_VERSION); |
533 | oops_hdr->report_length = (u16) zipped_len; | 533 | oops_hdr->report_length = cpu_to_be16(zipped_len); |
534 | oops_hdr->timestamp = get_seconds(); | 534 | oops_hdr->timestamp = cpu_to_be64(get_seconds()); |
535 | return 0; | 535 | return 0; |
536 | } | 536 | } |
537 | 537 | ||
@@ -574,9 +574,9 @@ static int nvram_pstore_write(enum pstore_type_id type, | |||
574 | clobbering_unread_rtas_event()) | 574 | clobbering_unread_rtas_event()) |
575 | return -1; | 575 | return -1; |
576 | 576 | ||
577 | oops_hdr->version = OOPS_HDR_VERSION; | 577 | oops_hdr->version = cpu_to_be16(OOPS_HDR_VERSION); |
578 | oops_hdr->report_length = (u16) size; | 578 | oops_hdr->report_length = cpu_to_be16(size); |
579 | oops_hdr->timestamp = get_seconds(); | 579 | oops_hdr->timestamp = cpu_to_be64(get_seconds()); |
580 | 580 | ||
581 | if (compressed) | 581 | if (compressed) |
582 | err_type = ERR_TYPE_KERNEL_PANIC_GZ; | 582 | err_type = ERR_TYPE_KERNEL_PANIC_GZ; |
@@ -670,16 +670,16 @@ static ssize_t nvram_pstore_read(u64 *id, enum pstore_type_id *type, | |||
670 | size_t length, hdr_size; | 670 | size_t length, hdr_size; |
671 | 671 | ||
672 | oops_hdr = (struct oops_log_info *)buff; | 672 | oops_hdr = (struct oops_log_info *)buff; |
673 | if (oops_hdr->version < OOPS_HDR_VERSION) { | 673 | if (be16_to_cpu(oops_hdr->version) < OOPS_HDR_VERSION) { |
674 | /* Old format oops header had 2-byte record size */ | 674 | /* Old format oops header had 2-byte record size */ |
675 | hdr_size = sizeof(u16); | 675 | hdr_size = sizeof(u16); |
676 | length = oops_hdr->version; | 676 | length = be16_to_cpu(oops_hdr->version); |
677 | time->tv_sec = 0; | 677 | time->tv_sec = 0; |
678 | time->tv_nsec = 0; | 678 | time->tv_nsec = 0; |
679 | } else { | 679 | } else { |
680 | hdr_size = sizeof(*oops_hdr); | 680 | hdr_size = sizeof(*oops_hdr); |
681 | length = oops_hdr->report_length; | 681 | length = be16_to_cpu(oops_hdr->report_length); |
682 | time->tv_sec = oops_hdr->timestamp; | 682 | time->tv_sec = be64_to_cpu(oops_hdr->timestamp); |
683 | time->tv_nsec = 0; | 683 | time->tv_nsec = 0; |
684 | } | 684 | } |
685 | *buf = kmalloc(length, GFP_KERNEL); | 685 | *buf = kmalloc(length, GFP_KERNEL); |
@@ -889,13 +889,13 @@ static void oops_to_nvram(struct kmsg_dumper *dumper, | |||
889 | kmsg_dump_get_buffer(dumper, false, | 889 | kmsg_dump_get_buffer(dumper, false, |
890 | oops_data, oops_data_sz, &text_len); | 890 | oops_data, oops_data_sz, &text_len); |
891 | err_type = ERR_TYPE_KERNEL_PANIC; | 891 | err_type = ERR_TYPE_KERNEL_PANIC; |
892 | oops_hdr->version = OOPS_HDR_VERSION; | 892 | oops_hdr->version = cpu_to_be16(OOPS_HDR_VERSION); |
893 | oops_hdr->report_length = (u16) text_len; | 893 | oops_hdr->report_length = cpu_to_be16(text_len); |
894 | oops_hdr->timestamp = get_seconds(); | 894 | oops_hdr->timestamp = cpu_to_be64(get_seconds()); |
895 | } | 895 | } |
896 | 896 | ||
897 | (void) nvram_write_os_partition(&oops_log_partition, oops_buf, | 897 | (void) nvram_write_os_partition(&oops_log_partition, oops_buf, |
898 | (int) (sizeof(*oops_hdr) + oops_hdr->report_length), err_type, | 898 | (int) (sizeof(*oops_hdr) + text_len), err_type, |
899 | ++oops_count); | 899 | ++oops_count); |
900 | 900 | ||
901 | spin_unlock_irqrestore(&lock, flags); | 901 | spin_unlock_irqrestore(&lock, flags); |
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c index 5f93856cdf47..70670a2d9cf2 100644 --- a/arch/powerpc/platforms/pseries/pci.c +++ b/arch/powerpc/platforms/pseries/pci.c | |||
@@ -113,7 +113,7 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge) | |||
113 | { | 113 | { |
114 | struct device_node *dn, *pdn; | 114 | struct device_node *dn, *pdn; |
115 | struct pci_bus *bus; | 115 | struct pci_bus *bus; |
116 | const uint32_t *pcie_link_speed_stats; | 116 | const __be32 *pcie_link_speed_stats; |
117 | 117 | ||
118 | bus = bridge->bus; | 118 | bus = bridge->bus; |
119 | 119 | ||
@@ -122,7 +122,7 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge) | |||
122 | return 0; | 122 | return 0; |
123 | 123 | ||
124 | for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) { | 124 | for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) { |
125 | pcie_link_speed_stats = (const uint32_t *) of_get_property(pdn, | 125 | pcie_link_speed_stats = of_get_property(pdn, |
126 | "ibm,pcie-link-speed-stats", NULL); | 126 | "ibm,pcie-link-speed-stats", NULL); |
127 | if (pcie_link_speed_stats) | 127 | if (pcie_link_speed_stats) |
128 | break; | 128 | break; |
@@ -135,7 +135,7 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge) | |||
135 | return 0; | 135 | return 0; |
136 | } | 136 | } |
137 | 137 | ||
138 | switch (pcie_link_speed_stats[0]) { | 138 | switch (be32_to_cpup(pcie_link_speed_stats)) { |
139 | case 0x01: | 139 | case 0x01: |
140 | bus->max_bus_speed = PCIE_SPEED_2_5GT; | 140 | bus->max_bus_speed = PCIE_SPEED_2_5GT; |
141 | break; | 141 | break; |
@@ -147,7 +147,7 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge) | |||
147 | break; | 147 | break; |
148 | } | 148 | } |
149 | 149 | ||
150 | switch (pcie_link_speed_stats[1]) { | 150 | switch (be32_to_cpup(pcie_link_speed_stats)) { |
151 | case 0x01: | 151 | case 0x01: |
152 | bus->cur_bus_speed = PCIE_SPEED_2_5GT; | 152 | bus->cur_bus_speed = PCIE_SPEED_2_5GT; |
153 | break; | 153 | break; |
diff --git a/arch/powerpc/sysdev/ppc4xx_ocm.c b/arch/powerpc/sysdev/ppc4xx_ocm.c index b7c43453236d..85d9e37f5ccb 100644 --- a/arch/powerpc/sysdev/ppc4xx_ocm.c +++ b/arch/powerpc/sysdev/ppc4xx_ocm.c | |||
@@ -339,7 +339,7 @@ void *ppc4xx_ocm_alloc(phys_addr_t *phys, int size, int align, | |||
339 | if (IS_ERR_VALUE(offset)) | 339 | if (IS_ERR_VALUE(offset)) |
340 | continue; | 340 | continue; |
341 | 341 | ||
342 | ocm_blk = kzalloc(sizeof(struct ocm_block *), GFP_KERNEL); | 342 | ocm_blk = kzalloc(sizeof(struct ocm_block), GFP_KERNEL); |
343 | if (!ocm_blk) { | 343 | if (!ocm_blk) { |
344 | printk(KERN_ERR "PPC4XX OCM: could not allocate ocm block"); | 344 | printk(KERN_ERR "PPC4XX OCM: could not allocate ocm block"); |
345 | rh_free(ocm_reg->rh, offset); | 345 | rh_free(ocm_reg->rh, offset); |