Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc

Pull powerpc updates from Ben Herrenschmidt:
"Here is the bulk of the powerpc changes for this merge window. It got
a bit delayed in part because I wasn't paying attention, and in part
because I discovered I had a core PCI change without a PCI maintainer
ack in it. Bjorn eventually agreed it was ok to merge it though we'll
probably improve it later and I didn't want to rebase to add his ack.

There is going to be a bit more next week, essentially fixes that I
still want to sort through and test.

The biggest item this time is the support to build the ppc64 LE kernel
with our new v2 ABI. We previously supported v2 userspace but the
kernel itself was a tougher nut to crack. This is now sorted mostly
thanks to Anton and Rusty.

We also have a fairly big series from Cedric that add support for
64-bit LE zImage boot wrapper. This was made harder by the fact that
traditionally our zImage wrapper was always 32-bit, but our new LE
toolchains don't really support 32-bit anymore (it's somewhat there
but not really "supported") so we didn't want to rely on it. This
meant more churn that just endian fixes.

This brings some more LE bits as well, such as the ability to run in
LE mode without a hypervisor (ie. under OPAL firmware) by doing the
right OPAL call to reinitialize the CPU to take HV interrupts in the
right mode and the usual pile of endian fixes.

There's another series from Gavin adding EEH improvements (one day we
*will* have a release with less than 20 EEH patches, I promise!).

Another highlight is the support for the "Split core" functionality on
P8 by Michael. This allows a P8 core to be split into "sub cores" of
4 threads which allows the subcores to run different guests under KVM
(the HW still doesn't support a partition per thread).

And then the usual misc bits and fixes ..."

[ Further delayed by gmail deciding that BenH is a dirty spammer.
Google knows. ]

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (155 commits)
powerpc/powernv: Add missing include to LPC code
selftests/powerpc: Test the THP bug we fixed in the previous commit
powerpc/mm: Check paca psize is up to date for huge mappings
powerpc/powernv: Pass buffer size to OPAL validate flash call
powerpc/pseries: hcall functions are exported to modules, need _GLOBAL_TOC()
powerpc: Exported functions __clear_user and copy_page use r2 so need _GLOBAL_TOC()
powerpc/powernv: Set memory_block_size_bytes to 256MB
powerpc: Allow ppc_md platform hook to override memory_block_size_bytes
powerpc/powernv: Fix endian issues in memory error handling code
powerpc/eeh: Skip eeh sysfs when eeh is disabled
powerpc: 64bit sendfile is capped at 2GB
powerpc/powernv: Provide debugfs access to the LPC bus via OPAL
powerpc/serial: Use saner flags when creating legacy ports
powerpc: Add cpu family documentation
powerpc/xmon: Fix up xmon format strings
powerpc/powernv: Add calls to support little endian host
powerpc: Document sysfs DSCR interface
powerpc: Fix regression of per-CPU DSCR setting
powerpc: Split __SYSFS_SPRSETUP macro
arch: powerpc/fadump: Cleaning up inconsistent NULL checks
...

+6901 -1776
+25
Documentation/ABI/stable/sysfs-devices-system-cpu
··· 1 + What: /sys/devices/system/cpu/dscr_default 2 + Date: 13-May-2014 3 + KernelVersion: v3.15.0 4 + Contact: 5 + Description: Writes are equivalent to writing to 6 + /sys/devices/system/cpu/cpuN/dscr on all CPUs. 7 + Reads return the last written value or 0. 8 + This value is not a global default: it is a way to set 9 + all per-CPU defaults at the same time. 10 + Values: 64 bit unsigned integer (bit field) 11 + 12 + What: /sys/devices/system/cpu/cpu[0-9]+/dscr 13 + Date: 13-May-2014 14 + KernelVersion: v3.15.0 15 + Contact: 16 + Description: Default value for the Data Stream Control Register (DSCR) on 17 + a CPU. 18 + This default value is used when the kernel is executing and 19 + for any process that has not set the DSCR itself. 20 + If a process ever sets the DSCR (via direct access to the 21 + SPR) that value will be persisted for that process and used 22 + on any CPU where it executes (overriding the value described 23 + here). 24 + If set by a process it will be inherited by child processes. 25 + Values: 64 bit unsigned integer (bit field)
+9 -1
Documentation/devicetree/bindings/clock/corenet-clock.txt Documentation/devicetree/bindings/clock/qoriq-clock.txt
··· 7 7 cores and peripheral IP blocks. 8 8 Please refer to the Reference Manual for details. 9 9 10 + All references to "1.0" and "2.0" refer to the QorIQ chassis version to 11 + which the chip complies. 12 + 13 + Chassis Version Example Chips 14 + --------------- ------------- 15 + 1.0 p4080, p5020, p5040 16 + 2.0 t4240, b4860, t1040 17 + 10 18 1. Clock Block Binding 11 19 12 20 Required properties: ··· 93 85 #clock-cells = <0>; 94 86 compatible = "fsl,qoriq-sysclk-1.0"; 95 87 clock-output-names = "sysclk"; 96 - } 88 + }; 97 89 98 90 pll0: pll0@800 { 99 91 #clock-cells = <1>;
+25
Documentation/devicetree/bindings/mfd/bfticu.txt
··· 1 + KEYMILE bfticu Chassis Management FPGA 2 + 3 + The bfticu is a multifunction device that manages the whole chassis. 4 + Its main functionality is to collect IRQs from the whole chassis and signals 5 + them to a single controller. 6 + 7 + Required properties: 8 + - compatible: "keymile,bfticu" 9 + - interrupt-controller: the bfticu FPGA is an interrupt controller 10 + - interrupts: the main IRQ line to signal the collected IRQs 11 + - #interrupt-cells : is 2 and their usage is compliant to the 2 cells variant 12 + of Documentation/devicetree/bindings/interrupt-controller/interrupts.txt 13 + - interrupt-parent: the parent IRQ ctrl the main IRQ is connected to 14 + - reg: access on the parent local bus (chip select, offset in chip select, size) 15 + 16 + Example: 17 + 18 + chassis-mgmt@3,0 { 19 + compatible = "keymile,bfticu"; 20 + interrupt-controller; 21 + #interrupt-cells = <2>; 22 + reg = <3 0 0x100>; 23 + interrupt-parent = <&mpic>; 24 + interrupts = <6 1 0 0>; 25 + };
+17
Documentation/devicetree/bindings/mfd/qriox.txt
··· 1 + KEYMILE qrio Board Control CPLD 2 + 3 + The qrio is a multifunction device that controls the KEYMILE boards based on 4 + the kmp204x design. 5 + It is consists of a reset controller, watchdog timer, LEDs, and 2 IRQ capable 6 + GPIO blocks. 7 + 8 + Required properties: 9 + - compatible: "keymile,qriox" 10 + - reg: access on the parent local bus (chip select, offset in chip select, size) 11 + 12 + Example: 13 + 14 + board-control@1,0 { 15 + compatible = "keymile,qriox"; 16 + reg = <1 0 0x80>; 17 + };
+54
Documentation/devicetree/bindings/powerpc/4xx/akebono.txt
··· 1 + 2 + IBM Akebono board device tree 3 + ============================= 4 + 5 + The IBM Akebono board is a development board for the PPC476GTR SoC. 6 + 7 + 0) The root node 8 + 9 + Required properties: 10 + 11 + - model : "ibm,akebono". 12 + - compatible : "ibm,akebono" , "ibm,476gtr". 13 + 14 + 1.a) The Secure Digital Host Controller Interface (SDHCI) node 15 + 16 + Represent the Secure Digital Host Controller Interfaces. 17 + 18 + Required properties: 19 + 20 + - compatible : should be "ibm,476gtr-sdhci","generic-sdhci". 21 + - reg : should contain the SDHCI registers location and length. 22 + - interrupt-parent : a phandle for the interrupt controller. 23 + - interrupts : should contain the SDHCI interrupt. 24 + 25 + 1.b) The Advanced Host Controller Interface (AHCI) SATA node 26 + 27 + Represents the advanced host controller SATA interface. 28 + 29 + Required properties: 30 + 31 + - compatible : should be "ibm,476gtr-ahci". 32 + - reg : should contain the AHCI registers location and length. 33 + - interrupt-parent : a phandle for the interrupt controller. 34 + - interrupts : should contain the AHCI interrupt. 35 + 36 + 1.c) The FPGA node 37 + 38 + The Akebono board stores some board information such as the revision 39 + number in an FPGA which is represented by this node. 40 + 41 + Required properties: 42 + 43 + - compatible : should be "ibm,akebono-fpga". 44 + - reg : should contain the FPGA registers location and length. 45 + 46 + 1.d) The AVR node 47 + 48 + The Akebono board has an Atmel AVR microprocessor attached to the I2C 49 + bus as a power controller for the board. 50 + 51 + Required properties: 52 + 53 + - compatible : should be "ibm,akebono-avr". 54 + - reg : should contain the I2C bus address for the AVR.
+19
Documentation/devicetree/bindings/powerpc/4xx/hsta.txt
··· 1 + 2 + ppc476gtr High Speed Serial Assist (HSTA) node 3 + ============================================== 4 + 5 + The 476gtr SoC contains a high speed serial assist module attached 6 + between the plb4 and plb6 system buses to provide high speed data 7 + transfer between memory and system peripherals as well as support for 8 + PCI message signalled interrupts. 9 + 10 + Currently only the MSI support is used by Linux using the following 11 + device tree entries: 12 + 13 + Require properties: 14 + - compatible : "ibm,476gtr-hsta-msi", "ibm,hsta-msi" 15 + - reg : register mapping for the HSTA MSI space 16 + - interrupt-parent : parent controller for mapping interrupts 17 + - interrupts : ordered interrupt mapping for each MSI in the register 18 + space. The first interrupt should be associated with a 19 + register offset of 0x00, the second to 0x10, etc.
+17
Documentation/devicetree/bindings/powerpc/fsl/board.txt
··· 67 67 gpio-controller; 68 68 }; 69 69 }; 70 + 71 + * Freescale on-board FPGA connected on I2C bus 72 + 73 + Some Freescale boards like BSC9132QDS have on board FPGA connected on 74 + the i2c bus. 75 + 76 + Required properties: 77 + - compatible: Should be a board-specific string followed by a string 78 + indicating the type of FPGA. Example: 79 + "fsl,<board>-fpga", "fsl,fpga-qixis-i2c" 80 + - reg: Should contain the address of the FPGA 81 + 82 + Example: 83 + fpga: fpga@66 { 84 + compatible = "fsl,bsc9132qds-fpga", "fsl,fpga-qixis-i2c"; 85 + reg = <0x66>; 86 + };
+46
Documentation/devicetree/bindings/powerpc/fsl/ccf.txt
··· 1 + Freescale CoreNet Coherency Fabric(CCF) Device Tree Binding 2 + 3 + DESCRIPTION 4 + 5 + The CoreNet coherency fabric is a fabric-oriented, connectivity infrastructure 6 + that enables the implementation of coherent, multicore systems. 7 + 8 + Required properties: 9 + 10 + - compatible: <string list> 11 + fsl,corenet1-cf - CoreNet coherency fabric version 1. 12 + Example chips: T4240, B4860 13 + 14 + fsl,corenet2-cf - CoreNet coherency fabric version 2. 15 + Example chips: P5040, P5020, P4080, P3041, P2041 16 + 17 + fsl,corenet-cf - Used to represent the common registers 18 + between CCF version 1 and CCF version 2. This compatible 19 + is retained for compatibility reasons, as it was already 20 + used for both CCF version 1 chips and CCF version 2 21 + chips. It should be specified after either 22 + "fsl,corenet1-cf" or "fsl,corenet2-cf". 23 + 24 + - reg: <prop-encoded-array> 25 + A standard property. Represents the CCF registers. 26 + 27 + - interrupts: <prop-encoded-array> 28 + Interrupt mapping for CCF error interrupt. 29 + 30 + - fsl,ccf-num-csdids: <u32> 31 + Specifies the number of Coherency Subdomain ID Port Mapping 32 + Registers that are supported by the CCF. 33 + 34 + - fsl,ccf-num-snoopids: <u32> 35 + Specifies the number of Snoop ID Port Mapping Registers that 36 + are supported by CCF. 37 + 38 + Example: 39 + 40 + corenet-cf@18000 { 41 + compatible = "fsl,corenet2-cf", "fsl,corenet-cf"; 42 + reg = <0x18000 0x1000>; 43 + interrupts = <16 2 1 31>; 44 + fsl,ccf-num-csdids = <32>; 45 + fsl,ccf-num-snoopids = <32>; 46 + };
+11
Documentation/devicetree/bindings/powerpc/fsl/cpus.txt
··· 20 20 a property named fsl,eref-[CAT], where [CAT] is the abbreviated category 21 21 name with all uppercase letters converted to lowercase, indicates that 22 22 the category is supported by the implementation. 23 + 24 + - fsl,portid-mapping 25 + Usage: optional 26 + Value type: <u32> 27 + Definition: The Coherency Subdomain ID Port Mapping Registers and 28 + Snoop ID Port Mapping registers, which are part of the CoreNet 29 + Coherency fabric (CCF), provide a CoreNet Coherency Subdomain 30 + ID/CoreNet Snoop ID to cpu mapping functions. Certain bits from 31 + these registers should be set if the coresponding CPU should be 32 + snooped. This property defines a bitmask which selects the bit 33 + that should be set if this cpu should be snooped.
+10
Documentation/devicetree/bindings/powerpc/fsl/pamu.txt
··· 34 34 for legacy drivers. 35 35 - interrupt-parent : <phandle> 36 36 Phandle to interrupt controller 37 + - fsl,portid-mapping : <u32> 38 + The Coherency Subdomain ID Port Mapping Registers and 39 + Snoop ID Port Mapping registers, which are part of the 40 + CoreNet Coherency fabric (CCF), provide a CoreNet 41 + Coherency Subdomain ID/CoreNet Snoop ID to pamu mapping 42 + functions. Certain bits from these registers should be 43 + set if PAMUs should be snooped. This property defines 44 + a bitmask which selects the bits that should be set if 45 + PAMUs should be snooped. 37 46 38 47 Child nodes: 39 48 ··· 97 88 compatible = "fsl,pamu-v1.0", "fsl,pamu"; 98 89 reg = <0x20000 0x5000>; 99 90 ranges = <0 0x20000 0x5000>; 91 + fsl,portid-mapping = <0xf80000>; 100 92 #address-cells = <1>; 101 93 #size-cells = <1>; 102 94 interrupts = <
+1
Documentation/devicetree/bindings/vendor-prefixes.txt
··· 142 142 xes Extreme Engineering Solutions (X-ES) 143 143 xlnx Xilinx 144 144 zyxel ZyXEL Communications Corp. 145 + zarlink Zarlink Semiconductor
+221
Documentation/powerpc/cpu_families.txt
··· 1 + CPU Families 2 + ============ 3 + 4 + This document tries to summarise some of the different cpu families that exist 5 + and are supported by arch/powerpc. 6 + 7 + 8 + Book3S (aka sPAPR) 9 + ------------------ 10 + 11 + - Hash MMU 12 + - Mix of 32 & 64 bit 13 + 14 + +--------------+ +----------------+ 15 + | Old POWER | --------------> | RS64 (threads) | 16 + +--------------+ +----------------+ 17 + | 18 + | 19 + v 20 + +--------------+ +----------------+ +------+ 21 + | 601 | --------------> | 603 | ---> | e300 | 22 + +--------------+ +----------------+ +------+ 23 + | | 24 + | | 25 + v v 26 + +--------------+ +----------------+ +-------+ 27 + | 604 | | 750 (G3) | ---> | 750CX | 28 + +--------------+ +----------------+ +-------+ 29 + | | | 30 + | | | 31 + v v v 32 + +--------------+ +----------------+ +-------+ 33 + | 620 (64 bit) | | 7400 | | 750CL | 34 + +--------------+ +----------------+ +-------+ 35 + | | | 36 + | | | 37 + v v v 38 + +--------------+ +----------------+ +-------+ 39 + | POWER3/630 | | 7410 | | 750FX | 40 + +--------------+ +----------------+ +-------+ 41 + | | 42 + | | 43 + v v 44 + +--------------+ +----------------+ 45 + | POWER3+ | | 7450 | 46 + +--------------+ +----------------+ 47 + | | 48 + | | 49 + v v 50 + +--------------+ +----------------+ 51 + | POWER4 | | 7455 | 52 + +--------------+ +----------------+ 53 + | | 54 + | | 55 + v v 56 + +--------------+ +-------+ +----------------+ 57 + | POWER4+ | --> | 970 | | 7447 | 58 + +--------------+ +-------+ +----------------+ 59 + | | | 60 + | | | 61 + v v v 62 + +--------------+ +-------+ +----------------+ 63 + | POWER5 | | 970FX | | 7448 | 64 + +--------------+ +-------+ +----------------+ 65 + | | | 66 + | | | 67 + v v v 68 + +--------------+ +-------+ +----------------+ 69 + | POWER5+ | | 970MP | | e600 | 70 + +--------------+ +-------+ +----------------+ 71 + | 72 + | 73 + v 74 + +--------------+ 75 + | POWER5++ | 76 + +--------------+ 77 + | 78 + | 79 + v 80 + +--------------+ +-------+ 81 + | POWER6 | <-?-> | Cell | 82 + +--------------+ +-------+ 83 + | 84 + | 85 + v 86 + +--------------+ 87 + | POWER7 | 88 + +--------------+ 89 + | 90 + | 91 + v 92 + +--------------+ 93 + | POWER7+ | 94 + +--------------+ 95 + | 96 + | 97 + v 98 + +--------------+ 99 + | POWER8 | 100 + +--------------+ 101 + 102 + 103 + +---------------+ 104 + | PA6T (64 bit) | 105 + +---------------+ 106 + 107 + 108 + IBM BookE 109 + --------- 110 + 111 + - Software loaded TLB. 112 + - All 32 bit 113 + 114 + +--------------+ 115 + | 401 | 116 + +--------------+ 117 + | 118 + | 119 + v 120 + +--------------+ 121 + | 403 | 122 + +--------------+ 123 + | 124 + | 125 + v 126 + +--------------+ 127 + | 405 | 128 + +--------------+ 129 + | 130 + | 131 + v 132 + +--------------+ 133 + | 440 | 134 + +--------------+ 135 + | 136 + | 137 + v 138 + +--------------+ +----------------+ 139 + | 450 | --> | BG/P | 140 + +--------------+ +----------------+ 141 + | 142 + | 143 + v 144 + +--------------+ 145 + | 460 | 146 + +--------------+ 147 + | 148 + | 149 + v 150 + +--------------+ 151 + | 476 | 152 + +--------------+ 153 + 154 + 155 + Motorola/Freescale 8xx 156 + ---------------------- 157 + 158 + - Software loaded with hardware assist. 159 + - All 32 bit 160 + 161 + +-------------+ 162 + | MPC8xx Core | 163 + +-------------+ 164 + 165 + 166 + Freescale BookE 167 + --------------- 168 + 169 + - Software loaded TLB. 170 + - e6500 adds HW loaded indirect TLB entries. 171 + - Mix of 32 & 64 bit 172 + 173 + +--------------+ 174 + | e200 | 175 + +--------------+ 176 + 177 + 178 + +--------------------------------+ 179 + | e500 | 180 + +--------------------------------+ 181 + | 182 + | 183 + v 184 + +--------------------------------+ 185 + | e500v2 | 186 + +--------------------------------+ 187 + | 188 + | 189 + v 190 + +--------------------------------+ 191 + | e500mc (Book3e) | 192 + +--------------------------------+ 193 + | 194 + | 195 + v 196 + +--------------------------------+ 197 + | e5500 (64 bit) | 198 + +--------------------------------+ 199 + | 200 + | 201 + v 202 + +--------------------------------+ 203 + | e6500 (HW TLB) (Multithreaded) | 204 + +--------------------------------+ 205 + 206 + 207 + IBM A2 core 208 + ----------- 209 + 210 + - Book3E, software loaded TLB + HW loaded indirect TLB entries. 211 + - 64 bit 212 + 213 + +--------------+ +----------------+ 214 + | A2 core | --> | WSP | 215 + +--------------+ +----------------+ 216 + | 217 + | 218 + v 219 + +--------------+ 220 + | BG/Q | 221 + +--------------+
+8
arch/powerpc/Kconfig
··· 453 453 default "4" 454 454 depends on NEED_MULTIPLE_NODES 455 455 456 + config USE_PERCPU_NUMA_NODE_ID 457 + def_bool y 458 + depends on NUMA 459 + 460 + config HAVE_MEMORYLESS_NODES 461 + def_bool y 462 + depends on NUMA 463 + 456 464 config ARCH_SELECT_MEMORY_MODEL 457 465 def_bool y 458 466 depends on PPC64
+13 -3
arch/powerpc/Makefile
··· 113 113 endif 114 114 endif 115 115 116 - CFLAGS-$(CONFIG_PPC64) := -mtraceback=no -mcall-aixdesc 117 - CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1) 116 + CFLAGS-$(CONFIG_PPC64) := -mtraceback=no 117 + ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y) 118 + CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2,-mcall-aixdesc) 119 + AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2) 120 + else 121 + CFLAGS-$(CONFIG_PPC64) += -mcall-aixdesc 122 + endif 118 123 CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcmodel=medium,-mminimal-toc) 119 124 CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions) 120 125 CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 $(MULTIPLEWORD) ··· 158 153 asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1) 159 154 160 155 KBUILD_CPPFLAGS += -Iarch/$(ARCH) $(asinstr) 161 - KBUILD_AFLAGS += -Iarch/$(ARCH) 156 + KBUILD_AFLAGS += -Iarch/$(ARCH) $(AFLAGS-y) 162 157 KBUILD_CFLAGS += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y) 163 158 CPP = $(CC) -E $(KBUILD_CFLAGS) 164 159 165 160 CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__ 166 161 167 162 KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o 163 + 164 + ifeq ($(CONFIG_476FPE_ERR46),y) 165 + KBUILD_LDFLAGS_MODULE += --ppc476-workaround \ 166 + -T $(srctree)/arch/powerpc/platforms/44x/ppc476_modules.lds 167 + endif 168 168 169 169 # No AltiVec or VSX instructions when building kernel 170 170 KBUILD_CFLAGS += $(call cc-option,-mno-altivec)
+21 -3
arch/powerpc/boot/Makefile
··· 22 22 BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ 23 23 -fno-strict-aliasing -Os -msoft-float -pipe \ 24 24 -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ 25 - -isystem $(shell $(CROSS32CC) -print-file-name=include) \ 26 - -mbig-endian 25 + -isystem $(shell $(CROSS32CC) -print-file-name=include) 26 + ifdef CONFIG_PPC64_BOOT_WRAPPER 27 + BOOTCFLAGS += -m64 28 + endif 29 + ifdef CONFIG_CPU_BIG_ENDIAN 30 + BOOTCFLAGS += -mbig-endian 31 + endif 32 + 27 33 BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc 28 34 29 35 ifdef CONFIG_DEBUG_INFO ··· 53 47 $(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405 54 48 $(obj)/treeboot-iss4xx.o: BOOTCFLAGS += -mcpu=405 55 49 $(obj)/treeboot-currituck.o: BOOTCFLAGS += -mcpu=405 50 + $(obj)/treeboot-akebono.o: BOOTCFLAGS += -mcpu=405 56 51 $(obj)/virtex405-head.o: BOOTAFLAGS += -mcpu=405 57 52 58 53 ··· 93 86 cuboot-taishan.c cuboot-katmai.c \ 94 87 cuboot-warp.c cuboot-yosemite.c \ 95 88 treeboot-iss4xx.c treeboot-currituck.c \ 89 + treeboot-akebono.c \ 96 90 simpleboot.c fixed-head.S virtex.c 97 91 src-plat-$(CONFIG_8xx) += cuboot-8xx.c fixed-head.S ep88xc.c redboot-8xx.c 98 92 src-plat-$(CONFIG_PPC_MPC52xx) += cuboot-52xx.c ··· 107 99 src-plat-$(CONFIG_AMIGAONE) += cuboot-amigaone.c 108 100 src-plat-$(CONFIG_PPC_PS3) += ps3-head.S ps3-hvcall.S ps3.c 109 101 src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c epapr-wrapper.c 102 + src-plat-$(CONFIG_PPC_PSERIES) += pseries-head.S 103 + src-plat-$(CONFIG_PPC_POWERNV) += pseries-head.S 104 + src-plat-$(CONFIG_PPC_IBM_CELL_BLADE) += pseries-head.S 105 + src-plat-$(CONFIG_PPC_CELLEB) += pseries-head.S 106 + src-plat-$(CONFIG_PPC_CELL_QPACE) += pseries-head.S 110 107 111 108 src-wlib := $(sort $(src-wlib-y)) 112 109 src-plat := $(sort $(src-plat-y)) ··· 150 137 $(obj)/empty.c: 151 138 @touch $@ 152 139 153 - $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds: $(obj)/%: $(srctree)/$(src)/%.S 140 + $(obj)/zImage.lds: $(obj)/%: $(srctree)/$(src)/%.S 141 + $(CROSS32CC) $(cpp_flags) -E -Wp,-MD,$(depfile) -P -Upowerpc \ 142 + -D__ASSEMBLY__ -DLINKER_SCRIPT -o $@ $< 143 + 144 + $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S 154 145 @cp $< $@ 155 146 156 147 clean-files := $(zlib) $(zlibheader) $(zliblinuxheader) \ ··· 252 235 image-$(CONFIG_ISS4xx) += treeImage.iss4xx \ 253 236 treeImage.iss4xx-mpic 254 237 image-$(CONFIG_CURRITUCK) += treeImage.currituck 238 + image-$(CONFIG_AKEBONO) += treeImage.akebono 255 239 256 240 # Board ports in arch/powerpc/platform/8xx/Kconfig 257 241 image-$(CONFIG_MPC86XADS) += cuImage.mpc866ads
+84 -42
arch/powerpc/boot/addnote.c
··· 6 6 * 7 7 * Copyright 2000 Paul Mackerras. 8 8 * 9 + * Adapted for 64 bit little endian images by Andrew Tauferner. 10 + * 9 11 * This program is free software; you can redistribute it and/or 10 12 * modify it under the terms of the GNU General Public License 11 13 * as published by the Free Software Foundation; either version ··· 57 55 58 56 #define ROUNDUP(len) (((len) + 3) & ~3) 59 57 60 - unsigned char buf[512]; 58 + unsigned char buf[1024]; 59 + #define ELFDATA2LSB 1 60 + #define ELFDATA2MSB 2 61 + static int e_data = ELFDATA2MSB; 62 + #define ELFCLASS32 1 63 + #define ELFCLASS64 2 64 + static int e_class = ELFCLASS32; 61 65 62 66 #define GET_16BE(off) ((buf[off] << 8) + (buf[(off)+1])) 63 - #define GET_32BE(off) ((GET_16BE(off) << 16) + GET_16BE((off)+2)) 67 + #define GET_32BE(off) ((GET_16BE(off) << 16U) + GET_16BE((off)+2U)) 68 + #define GET_64BE(off) ((((unsigned long long)GET_32BE(off)) << 32ULL) + \ 69 + ((unsigned long long)GET_32BE((off)+4ULL))) 70 + #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \ 71 + buf[(off) + 1] = (v) & 0xff) 72 + #define PUT_32BE(off, v)(PUT_16BE((off), (v) >> 16L), PUT_16BE((off) + 2, (v))) 73 + #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \ 74 + PUT_32BE((off) + 4, (v)))) 64 75 65 - #define PUT_16BE(off, v) (buf[off] = ((v) >> 8) & 0xff, \ 66 - buf[(off) + 1] = (v) & 0xff) 67 - #define PUT_32BE(off, v) (PUT_16BE((off), (v) >> 16), \ 68 - PUT_16BE((off) + 2, (v))) 76 + #define GET_16LE(off) ((buf[off]) + (buf[(off)+1] << 8)) 77 + #define GET_32LE(off) (GET_16LE(off) + (GET_16LE((off)+2U) << 16U)) 78 + #define GET_64LE(off) ((unsigned long long)GET_32LE(off) + \ 79 + (((unsigned long long)GET_32LE((off)+4ULL)) << 32ULL)) 80 + #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \ 81 + buf[(off) + 1] = ((v) >> 8) & 0xff) 82 + #define PUT_32LE(off, v) (PUT_16LE((off), (v)), PUT_16LE((off) + 2, (v) >> 16L)) 83 + #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L)) 84 + 85 + #define GET_16(off) (e_data == ELFDATA2MSB ? GET_16BE(off) : GET_16LE(off)) 86 + #define GET_32(off) (e_data == ELFDATA2MSB ? GET_32BE(off) : GET_32LE(off)) 87 + #define GET_64(off) (e_data == ELFDATA2MSB ? GET_64BE(off) : GET_64LE(off)) 88 + #define PUT_16(off, v) (e_data == ELFDATA2MSB ? PUT_16BE(off, v) : \ 89 + PUT_16LE(off, v)) 90 + #define PUT_32(off, v) (e_data == ELFDATA2MSB ? PUT_32BE(off, v) : \ 91 + PUT_32LE(off, v)) 92 + #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \ 93 + PUT_64LE(off, v)) 69 94 70 95 /* Structure of an ELF file */ 71 96 #define E_IDENT 0 /* ELF header */ 72 - #define E_PHOFF 28 73 - #define E_PHENTSIZE 42 74 - #define E_PHNUM 44 75 - #define E_HSIZE 52 /* size of ELF header */ 97 + #define E_PHOFF (e_class == ELFCLASS32 ? 28 : 32) 98 + #define E_PHENTSIZE (e_class == ELFCLASS32 ? 42 : 54) 99 + #define E_PHNUM (e_class == ELFCLASS32 ? 44 : 56) 100 + #define E_HSIZE (e_class == ELFCLASS32 ? 52 : 64) 76 101 77 102 #define EI_MAGIC 0 /* offsets in E_IDENT area */ 78 103 #define EI_CLASS 4 79 104 #define EI_DATA 5 80 105 81 106 #define PH_TYPE 0 /* ELF program header */ 82 - #define PH_OFFSET 4 83 - #define PH_FILESZ 16 84 - #define PH_HSIZE 32 /* size of program header */ 107 + #define PH_OFFSET (e_class == ELFCLASS32 ? 4 : 8) 108 + #define PH_FILESZ (e_class == ELFCLASS32 ? 16 : 32) 109 + #define PH_HSIZE (e_class == ELFCLASS32 ? 32 : 56) 85 110 86 111 #define PT_NOTE 4 /* Program header type = note */ 87 112 88 - #define ELFCLASS32 1 89 - #define ELFDATA2MSB 2 90 113 91 114 unsigned char elf_magic[4] = { 0x7f, 'E', 'L', 'F' }; 92 115 ··· 119 92 main(int ac, char **av) 120 93 { 121 94 int fd, n, i; 122 - int ph, ps, np; 123 - int nnote, nnote2, ns; 95 + unsigned long ph, ps, np; 96 + long nnote, nnote2, ns; 124 97 125 98 if (ac != 2) { 126 99 fprintf(stderr, "Usage: %s elf-file\n", av[0]); ··· 141 114 exit(1); 142 115 } 143 116 144 - if (n < E_HSIZE || memcmp(&buf[E_IDENT+EI_MAGIC], elf_magic, 4) != 0) 117 + if (memcmp(&buf[E_IDENT+EI_MAGIC], elf_magic, 4) != 0) 118 + goto notelf; 119 + e_class = buf[E_IDENT+EI_CLASS]; 120 + if (e_class != ELFCLASS32 && e_class != ELFCLASS64) 121 + goto notelf; 122 + e_data = buf[E_IDENT+EI_DATA]; 123 + if (e_data != ELFDATA2MSB && e_data != ELFDATA2LSB) 124 + goto notelf; 125 + if (n < E_HSIZE) 145 126 goto notelf; 146 127 147 - if (buf[E_IDENT+EI_CLASS] != ELFCLASS32 148 - || buf[E_IDENT+EI_DATA] != ELFDATA2MSB) { 149 - fprintf(stderr, "%s is not a big-endian 32-bit ELF image\n", 150 - av[1]); 151 - exit(1); 152 - } 153 - 154 - ph = GET_32BE(E_PHOFF); 155 - ps = GET_16BE(E_PHENTSIZE); 156 - np = GET_16BE(E_PHNUM); 128 + ph = (e_class == ELFCLASS32 ? GET_32(E_PHOFF) : GET_64(E_PHOFF)); 129 + ps = GET_16(E_PHENTSIZE); 130 + np = GET_16(E_PHNUM); 157 131 if (ph < E_HSIZE || ps < PH_HSIZE || np < 1) 158 132 goto notelf; 159 133 if (ph + (np + 2) * ps + nnote + nnote2 > n) 160 134 goto nospace; 161 135 162 136 for (i = 0; i < np; ++i) { 163 - if (GET_32BE(ph + PH_TYPE) == PT_NOTE) { 137 + if (GET_32(ph + PH_TYPE) == PT_NOTE) { 164 138 fprintf(stderr, "%s already has a note entry\n", 165 139 av[1]); 166 140 exit(0); ··· 176 148 177 149 /* fill in the program header entry */ 178 150 ns = ph + 2 * ps; 179 - PUT_32BE(ph + PH_TYPE, PT_NOTE); 180 - PUT_32BE(ph + PH_OFFSET, ns); 181 - PUT_32BE(ph + PH_FILESZ, nnote); 151 + PUT_32(ph + PH_TYPE, PT_NOTE); 152 + if (e_class == ELFCLASS32) 153 + PUT_32(ph + PH_OFFSET, ns); 154 + else 155 + PUT_64(ph + PH_OFFSET, ns); 156 + 157 + if (e_class == ELFCLASS32) 158 + PUT_32(ph + PH_FILESZ, nnote); 159 + else 160 + PUT_64(ph + PH_FILESZ, nnote); 182 161 183 162 /* fill in the note area we point to */ 184 163 /* XXX we should probably make this a proper section */ 185 - PUT_32BE(ns, strlen(arch) + 1); 186 - PUT_32BE(ns + 4, N_DESCR * 4); 187 - PUT_32BE(ns + 8, 0x1275); 164 + PUT_32(ns, strlen(arch) + 1); 165 + PUT_32(ns + 4, N_DESCR * 4); 166 + PUT_32(ns + 8, 0x1275); 188 167 strcpy((char *) &buf[ns + 12], arch); 189 168 ns += 12 + strlen(arch) + 1; 190 169 for (i = 0; i < N_DESCR; ++i, ns += 4) ··· 199 164 200 165 /* fill in the second program header entry and the RPA note area */ 201 166 ph += ps; 202 - PUT_32BE(ph + PH_TYPE, PT_NOTE); 203 - PUT_32BE(ph + PH_OFFSET, ns); 204 - PUT_32BE(ph + PH_FILESZ, nnote2); 167 + PUT_32(ph + PH_TYPE, PT_NOTE); 168 + if (e_class == ELFCLASS32) 169 + PUT_32(ph + PH_OFFSET, ns); 170 + else 171 + PUT_64(ph + PH_OFFSET, ns); 172 + 173 + if (e_class == ELFCLASS32) 174 + PUT_32(ph + PH_FILESZ, nnote); 175 + else 176 + PUT_64(ph + PH_FILESZ, nnote2); 205 177 206 178 /* fill in the note area we point to */ 207 - PUT_32BE(ns, strlen(rpaname) + 1); 208 - PUT_32BE(ns + 4, sizeof(rpanote)); 209 - PUT_32BE(ns + 8, 0x12759999); 179 + PUT_32(ns, strlen(rpaname) + 1); 180 + PUT_32(ns + 4, sizeof(rpanote)); 181 + PUT_32(ns + 8, 0x12759999); 210 182 strcpy((char *) &buf[ns + 12], rpaname); 211 183 ns += 12 + ROUNDUP(strlen(rpaname) + 1); 212 184 for (i = 0; i < N_RPA_DESCR; ++i, ns += 4) 213 185 PUT_32BE(ns, rpanote[i]); 214 186 215 187 /* Update the number of program headers */ 216 - PUT_16BE(E_PHNUM, np + 2); 188 + PUT_16(E_PHNUM, np + 2); 217 189 218 190 /* write back */ 219 191 lseek(fd, (long) 0, SEEK_SET);
+176 -4
arch/powerpc/boot/crt0.S
··· 1 1 /* 2 2 * Copyright (C) Paul Mackerras 1997. 3 3 * 4 + * Adapted for 64 bit LE PowerPC by Andrew Tauferner 5 + * 4 6 * This program is free software; you can redistribute it and/or 5 7 * modify it under the terms of the GNU General Public License 6 8 * as published by the Free Software Foundation; either version 7 9 * 2 of the License, or (at your option) any later version. 8 10 * 9 - * NOTE: this code runs in 32 bit mode, is position-independent, 10 - * and is packaged as ELF32. 11 11 */ 12 12 13 13 #include "ppc_asm.h" 14 + 15 + RELA = 7 16 + RELACOUNT = 0x6ffffff9 14 17 15 18 .text 16 19 /* A procedure descriptor used when booting this as a COFF file. ··· 24 21 _zimage_start_opd: 25 22 .long 0x500000, 0, 0, 0 26 23 24 + #ifdef __powerpc64__ 25 + .balign 8 26 + p_start: .llong _start 27 + p_etext: .llong _etext 28 + p_bss_start: .llong __bss_start 29 + p_end: .llong _end 30 + 31 + p_toc: .llong __toc_start + 0x8000 - p_base 32 + p_dyn: .llong __dynamic_start - p_base 33 + p_rela: .llong __rela_dyn_start - p_base 34 + p_prom: .llong 0 35 + .weak _platform_stack_top 36 + p_pstack: .llong _platform_stack_top 37 + #else 27 38 p_start: .long _start 28 39 p_etext: .long _etext 29 40 p_bss_start: .long __bss_start ··· 45 28 46 29 .weak _platform_stack_top 47 30 p_pstack: .long _platform_stack_top 31 + #endif 48 32 49 33 .weak _zimage_start 50 34 .globl _zimage_start ··· 56 38 and the address where we're running. */ 57 39 bl .+4 58 40 p_base: mflr r10 /* r10 now points to runtime addr of p_base */ 41 + #ifndef __powerpc64__ 59 42 /* grab the link address of the dynamic section in r11 */ 60 43 addis r11,r10,(_GLOBAL_OFFSET_TABLE_-p_base)@ha 61 44 lwz r11,(_GLOBAL_OFFSET_TABLE_-p_base)@l(r11) ··· 70 51 71 52 /* The dynamic section contains a series of tagged entries. 72 53 * We need the RELA and RELACOUNT entries. */ 73 - RELA = 7 74 - RELACOUNT = 0x6ffffff9 75 54 li r9,0 76 55 li r0,0 77 56 9: lwz r8,0(r12) /* get tag */ ··· 137 120 li r0,0 138 121 stwu r0,-16(r1) /* establish a stack frame */ 139 122 6: 123 + #else /* __powerpc64__ */ 124 + /* Save the prom pointer at p_prom. */ 125 + std r5,(p_prom-p_base)(r10) 140 126 127 + /* Set r2 to the TOC. */ 128 + ld r2,(p_toc-p_base)(r10) 129 + add r2,r2,r10 130 + 131 + /* Grab the link address of the dynamic section in r11. */ 132 + ld r11,-32768(r2) 133 + cmpwi r11,0 134 + beq 3f /* if not linked -pie then no dynamic section */ 135 + 136 + ld r11,(p_dyn-p_base)(r10) 137 + add r11,r11,r10 138 + ld r9,(p_rela-p_base)(r10) 139 + add r9,r9,r10 140 + 141 + li r7,0 142 + li r8,0 143 + 9: ld r6,0(r11) /* get tag */ 144 + cmpdi r6,0 145 + beq 12f /* end of list */ 146 + cmpdi r6,RELA 147 + bne 10f 148 + ld r7,8(r11) /* get RELA pointer in r7 */ 149 + b 11f 150 + 10: addis r6,r6,(-RELACOUNT)@ha 151 + cmpdi r6,RELACOUNT@l 152 + bne 11f 153 + ld r8,8(r11) /* get RELACOUNT value in r8 */ 154 + 11: addi r11,r11,16 155 + b 9b 156 + 12: 157 + cmpdi r7,0 /* check we have both RELA and RELACOUNT */ 158 + cmpdi cr1,r8,0 159 + beq 3f 160 + beq cr1,3f 161 + 162 + /* Calcuate the runtime offset. */ 163 + subf r7,r7,r9 164 + 165 + /* Run through the list of relocations and process the 166 + * R_PPC64_RELATIVE ones. */ 167 + mtctr r8 168 + 13: ld r0,8(r9) /* ELF64_R_TYPE(reloc->r_info) */ 169 + cmpdi r0,22 /* R_PPC64_RELATIVE */ 170 + bne 3f 171 + ld r6,0(r9) /* reloc->r_offset */ 172 + ld r0,16(r9) /* reloc->r_addend */ 173 + add r0,r0,r7 174 + stdx r0,r7,r6 175 + addi r9,r9,24 176 + bdnz 13b 177 + 178 + /* Do a cache flush for our text, in case the loader didn't */ 179 + 3: ld r9,p_start-p_base(r10) /* note: these are relocated now */ 180 + ld r8,p_etext-p_base(r10) 181 + 4: dcbf r0,r9 182 + icbi r0,r9 183 + addi r9,r9,0x20 184 + cmpld cr0,r9,r8 185 + blt 4b 186 + sync 187 + isync 188 + 189 + /* Clear the BSS */ 190 + ld r9,p_bss_start-p_base(r10) 191 + ld r8,p_end-p_base(r10) 192 + li r0,0 193 + 5: std r0,0(r9) 194 + addi r9,r9,8 195 + cmpld cr0,r9,r8 196 + blt 5b 197 + 198 + /* Possibly set up a custom stack */ 199 + ld r8,p_pstack-p_base(r10) 200 + cmpdi r8,0 201 + beq 6f 202 + ld r1,0(r8) 203 + li r0,0 204 + stdu r0,-16(r1) /* establish a stack frame */ 205 + 6: 206 + #endif /* __powerpc64__ */ 141 207 /* Call platform_init() */ 142 208 bl platform_init 143 209 144 210 /* Call start */ 145 211 b start 212 + 213 + #ifdef __powerpc64__ 214 + 215 + #define PROM_FRAME_SIZE 512 216 + #define SAVE_GPR(n, base) std n,8*(n)(base) 217 + #define REST_GPR(n, base) ld n,8*(n)(base) 218 + #define SAVE_2GPRS(n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base) 219 + #define SAVE_4GPRS(n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base) 220 + #define SAVE_8GPRS(n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base) 221 + #define SAVE_10GPRS(n, base) SAVE_8GPRS(n, base); SAVE_2GPRS(n+8, base) 222 + #define REST_2GPRS(n, base) REST_GPR(n, base); REST_GPR(n+1, base) 223 + #define REST_4GPRS(n, base) REST_2GPRS(n, base); REST_2GPRS(n+2, base) 224 + #define REST_8GPRS(n, base) REST_4GPRS(n, base); REST_4GPRS(n+4, base) 225 + #define REST_10GPRS(n, base) REST_8GPRS(n, base); REST_2GPRS(n+8, base) 226 + 227 + /* prom handles the jump into and return from firmware. The prom args pointer 228 + is loaded in r3. */ 229 + .globl prom 230 + prom: 231 + mflr r0 232 + std r0,16(r1) 233 + stdu r1,-PROM_FRAME_SIZE(r1) /* Save SP and create stack space */ 234 + 235 + SAVE_GPR(2, r1) 236 + SAVE_GPR(13, r1) 237 + SAVE_8GPRS(14, r1) 238 + SAVE_10GPRS(22, r1) 239 + mfcr r10 240 + std r10,8*32(r1) 241 + mfmsr r10 242 + std r10,8*33(r1) 243 + 244 + /* remove MSR_LE from msr but keep MSR_SF */ 245 + mfmsr r10 246 + rldicr r10,r10,0,62 247 + mtsrr1 r10 248 + 249 + /* Load FW address, set LR to label 1, and jump to FW */ 250 + bl 0f 251 + 0: mflr r10 252 + addi r11,r10,(1f-0b) 253 + mtlr r11 254 + 255 + ld r10,(p_prom-0b)(r10) 256 + mtsrr0 r10 257 + 258 + rfid 259 + 260 + 1: /* Return from OF */ 261 + FIXUP_ENDIAN 262 + 263 + /* Restore registers and return. */ 264 + rldicl r1,r1,0,32 265 + 266 + /* Restore the MSR (back to 64 bits) */ 267 + ld r10,8*(33)(r1) 268 + mtmsr r10 269 + isync 270 + 271 + /* Restore other registers */ 272 + REST_GPR(2, r1) 273 + REST_GPR(13, r1) 274 + REST_8GPRS(14, r1) 275 + REST_10GPRS(22, r1) 276 + ld r10,8*32(r1) 277 + mtcr r10 278 + 279 + addi r1,r1,PROM_FRAME_SIZE 280 + ld r0,16(r1) 281 + mtlr r0 282 + blr 283 + #endif
+4
arch/powerpc/boot/dcr.h
··· 15 15 asm volatile("mfdcrx %0,%1" : "=r"(rval) : "r"(rn)); \ 16 16 rval; \ 17 17 }) 18 + #define mtdcrx(rn, val) \ 19 + ({ \ 20 + asm volatile("mtdcrx %0,%1" : : "r"(rn), "r" (val)); \ 21 + }) 18 22 19 23 /* 440GP/440GX SDRAM controller DCRs */ 20 24 #define DCRN_SDRAM0_CFGADDR 0x010
+415
arch/powerpc/boot/dts/akebono.dts
··· 1 + /* 2 + * Device Tree Source for IBM Embedded PPC 476 Platform 3 + * 4 + * Copyright © 2013 Tony Breeds IBM Corporation 5 + * Copyright © 2013 Alistair Popple IBM Corporation 6 + * 7 + * This file is licensed under the terms of the GNU General Public 8 + * License version 2. This program is licensed "as is" without 9 + * any warranty of any kind, whether express or implied. 10 + */ 11 + 12 + /dts-v1/; 13 + 14 + /memreserve/ 0x01f00000 0x00100000; // spin table 15 + 16 + / { 17 + #address-cells = <2>; 18 + #size-cells = <2>; 19 + model = "ibm,akebono"; 20 + compatible = "ibm,akebono", "ibm,476gtr"; 21 + dcr-parent = <&{/cpus/cpu@0}>; 22 + 23 + aliases { 24 + serial0 = &UART0; 25 + }; 26 + 27 + cpus { 28 + #address-cells = <1>; 29 + #size-cells = <0>; 30 + 31 + cpu@0 { 32 + device_type = "cpu"; 33 + model = "PowerPC,476"; 34 + reg = <0>; 35 + clock-frequency = <1600000000>; // 1.6 GHz 36 + timebase-frequency = <100000000>; // 100Mhz 37 + i-cache-line-size = <32>; 38 + d-cache-line-size = <32>; 39 + i-cache-size = <32768>; 40 + d-cache-size = <32768>; 41 + dcr-controller; 42 + dcr-access-method = "native"; 43 + status = "ok"; 44 + }; 45 + cpu@1 { 46 + device_type = "cpu"; 47 + model = "PowerPC,476"; 48 + reg = <1>; 49 + clock-frequency = <1600000000>; // 1.6 GHz 50 + timebase-frequency = <100000000>; // 100Mhz 51 + i-cache-line-size = <32>; 52 + d-cache-line-size = <32>; 53 + i-cache-size = <32768>; 54 + d-cache-size = <32768>; 55 + dcr-controller; 56 + dcr-access-method = "native"; 57 + status = "disabled"; 58 + enable-method = "spin-table"; 59 + cpu-release-addr = <0x0 0x01f00000>; 60 + }; 61 + }; 62 + 63 + memory { 64 + device_type = "memory"; 65 + reg = <0x0 0x0 0x0 0x0>; // filled in by zImage 66 + }; 67 + 68 + MPIC: interrupt-controller { 69 + compatible = "chrp,open-pic"; 70 + interrupt-controller; 71 + dcr-reg = <0xffc00000 0x00040000>; 72 + #address-cells = <0>; 73 + #size-cells = <0>; 74 + #interrupt-cells = <2>; 75 + single-cpu-affinity; 76 + }; 77 + 78 + plb { 79 + compatible = "ibm,plb6"; 80 + #address-cells = <2>; 81 + #size-cells = <2>; 82 + ranges; 83 + clock-frequency = <200000000>; // 200Mhz 84 + 85 + HSTA0: hsta@310000e0000 { 86 + compatible = "ibm,476gtr-hsta-msi", "ibm,hsta-msi"; 87 + reg = <0x310 0x000e0000 0x0 0xf0>; 88 + interrupt-parent = <&MPIC>; 89 + interrupts = <108 0 90 + 109 0 91 + 110 0 92 + 111 0 93 + 112 0 94 + 113 0 95 + 114 0 96 + 115 0 97 + 116 0 98 + 117 0 99 + 118 0 100 + 119 0 101 + 120 0 102 + 121 0 103 + 122 0 104 + 123 0>; 105 + }; 106 + 107 + MAL0: mcmal { 108 + compatible = "ibm,mcmal-476gtr", "ibm,mcmal2"; 109 + dcr-reg = <0xc0000000 0x062>; 110 + num-tx-chans = <1>; 111 + num-rx-chans = <1>; 112 + #address-cells = <0>; 113 + #size-cells = <0>; 114 + interrupt-parent = <&MPIC>; 115 + interrupts = < /*TXEOB*/ 77 0x4 116 + /*RXEOB*/ 78 0x4 117 + /*SERR*/ 76 0x4 118 + /*TXDE*/ 79 0x4 119 + /*RXDE*/ 80 0x4>; 120 + }; 121 + 122 + SATA0: sata@30000010000 { 123 + compatible = "ibm,476gtr-ahci"; 124 + reg = <0x300 0x00010000 0x0 0x10000>; 125 + interrupt-parent = <&MPIC>; 126 + interrupts = <93 2>; 127 + }; 128 + 129 + EHCI0: ehci@30010000000 { 130 + compatible = "ibm,476gtr-ehci", "generic-ehci"; 131 + reg = <0x300 0x10000000 0x0 0x10000>; 132 + interrupt-parent = <&MPIC>; 133 + interrupts = <85 2>; 134 + }; 135 + 136 + SD0: sd@30000000000 { 137 + compatible = "ibm,476gtr-sdhci", "generic-sdhci"; 138 + reg = <0x300 0x00000000 0x0 0x10000>; 139 + interrupts = <91 2>; 140 + interrupt-parent = <&MPIC>; 141 + }; 142 + 143 + OHCI0: ohci@30010010000 { 144 + compatible = "ibm,476gtr-ohci", "generic-ohci"; 145 + reg = <0x300 0x10010000 0x0 0x10000>; 146 + interrupt-parent = <&MPIC>; 147 + interrupts = <89 1>; 148 + }; 149 + 150 + OHCI1: ohci@30010020000 { 151 + compatible = "ibm,476gtr-ohci", "generic-ohci"; 152 + reg = <0x300 0x10020000 0x0 0x10000>; 153 + interrupt-parent = <&MPIC>; 154 + interrupts = <88 1>; 155 + }; 156 + 157 + POB0: opb { 158 + compatible = "ibm,opb-4xx", "ibm,opb"; 159 + #address-cells = <1>; 160 + #size-cells = <1>; 161 + /* Wish there was a nicer way of specifying a full 162 + * 32-bit range 163 + */ 164 + ranges = <0x00000000 0x0000033f 0x00000000 0x80000000 165 + 0x80000000 0x0000033f 0x80000000 0x80000000>; 166 + clock-frequency = <100000000>; 167 + 168 + RGMII0: emac-rgmii-wol@50004 { 169 + compatible = "ibm,rgmii-wol-476gtr", "ibm,rgmii-wol"; 170 + reg = <0x50004 0x00000008>; 171 + has-mdio; 172 + }; 173 + 174 + EMAC0: ethernet@30000 { 175 + device_type = "network"; 176 + compatible = "ibm,emac-476gtr", "ibm,emac4sync"; 177 + interrupt-parent = <&EMAC0>; 178 + interrupts = <0x0 0x1>; 179 + #interrupt-cells = <1>; 180 + #address-cells = <0>; 181 + #size-cells = <0>; 182 + interrupt-map = </*Status*/ 0x0 &MPIC 81 0x4 183 + /*Wake*/ 0x1 &MPIC 82 0x4>; 184 + reg = <0x30000 0x78>; 185 + 186 + /* local-mac-address will normally be added by 187 + * the wrapper. If your device doesn't support 188 + * passing data to the wrapper (in the form 189 + * local-mac-addr=<hwaddr>) then you will need 190 + * to set it manually here. */ 191 + //local-mac-address = [000000000000]; 192 + 193 + mal-device = <&MAL0>; 194 + mal-tx-channel = <0>; 195 + mal-rx-channel = <0>; 196 + cell-index = <0>; 197 + max-frame-size = <9000>; 198 + rx-fifo-size = <4096>; 199 + tx-fifo-size = <2048>; 200 + rx-fifo-size-gige = <16384>; 201 + phy-mode = "rgmii"; 202 + phy-map = <0x00000000>; 203 + rgmii-wol-device = <&RGMII0>; 204 + has-inverted-stacr-oc; 205 + has-new-stacr-staopc; 206 + }; 207 + 208 + UART0: serial@10000 { 209 + device_type = "serial"; 210 + compatible = "ns16750", "ns16550"; 211 + reg = <0x10000 0x00000008>; 212 + virtual-reg = <0xe8010000>; 213 + clock-frequency = <1851851>; 214 + current-speed = <38400>; 215 + interrupt-parent = <&MPIC>; 216 + interrupts = <39 2>; 217 + }; 218 + 219 + IIC0: i2c@00000000 { 220 + compatible = "ibm,iic-476gtr", "ibm,iic"; 221 + reg = <0x0 0x00000020>; 222 + interrupt-parent = <&MPIC>; 223 + interrupts = <37 2>; 224 + #address-cells = <1>; 225 + #size-cells = <0>; 226 + rtc@68 { 227 + compatible = "stm,m41t80", "m41st85"; 228 + reg = <0x68>; 229 + }; 230 + }; 231 + 232 + IIC1: i2c@00000100 { 233 + compatible = "ibm,iic-476gtr", "ibm,iic"; 234 + reg = <0x100 0x00000020>; 235 + interrupt-parent = <&MPIC>; 236 + interrupts = <38 2>; 237 + #address-cells = <1>; 238 + #size-cells = <0>; 239 + avr@58 { 240 + compatible = "ibm,akebono-avr"; 241 + reg = <0x58>; 242 + }; 243 + }; 244 + 245 + FPGA0: fpga@ebc00000 { 246 + compatible = "ibm,akebono-fpga"; 247 + reg = <0xebc00000 0x8>; 248 + }; 249 + }; 250 + 251 + PCIE0: pciex@10100000000 { 252 + device_type = "pci"; 253 + #interrupt-cells = <1>; 254 + #size-cells = <2>; 255 + #address-cells = <3>; 256 + compatible = "ibm,plb-pciex-476fpe", "ibm,plb-pciex"; 257 + primary; 258 + port = <0x0>; /* port number */ 259 + reg = <0x00000101 0x00000000 0x0 0x10000000 /* Config space access */ 260 + 0x00000100 0x00000000 0x0 0x00001000>; /* UTL Registers space access */ 261 + dcr-reg = <0xc0 0x20>; 262 + 263 + // pci_space < pci_addr > < cpu_addr > < size > 264 + ranges = <0x02000000 0x00000000 0x80000000 0x00000110 0x80000000 0x0 0x80000000 265 + 0x01000000 0x0 0x0 0x00000140 0x0 0x0 0x00010000>; 266 + 267 + /* Inbound starting at 0x0 to 0x40000000000. In order to use MSI 268 + * PCI devices must be able to write to the HSTA module. 269 + */ 270 + dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x400 0x0>; 271 + 272 + /* This drives busses 0 to 0xf */ 273 + bus-range = <0x0 0xf>; 274 + 275 + /* Legacy interrupts (note the weird polarity, the bridge seems 276 + * to invert PCIe legacy interrupts). 277 + * We are de-swizzling here because the numbers are actually for 278 + * port of the root complex virtual P2P bridge. But I want 279 + * to avoid putting a node for it in the tree, so the numbers 280 + * below are basically de-swizzled numbers. 281 + * The real slot is on idsel 0, so the swizzling is 1:1 282 + */ 283 + interrupt-map-mask = <0x0 0x0 0x0 0x7>; 284 + interrupt-map = < 285 + 0x0 0x0 0x0 0x1 &MPIC 45 0x2 /* int A */ 286 + 0x0 0x0 0x0 0x2 &MPIC 46 0x2 /* int B */ 287 + 0x0 0x0 0x0 0x3 &MPIC 47 0x2 /* int C */ 288 + 0x0 0x0 0x0 0x4 &MPIC 48 0x2 /* int D */>; 289 + }; 290 + 291 + PCIE1: pciex@20100000000 { 292 + device_type = "pci"; 293 + #interrupt-cells = <1>; 294 + #size-cells = <2>; 295 + #address-cells = <3>; 296 + compatible = "ibm,plb-pciex-476fpe", "ibm,plb-pciex"; 297 + primary; 298 + port = <0x1>; /* port number */ 299 + reg = <0x00000201 0x00000000 0x0 0x10000000 /* Config space access */ 300 + 0x00000200 0x00000000 0x0 0x00001000>; /* UTL Registers space access */ 301 + dcr-reg = <0x100 0x20>; 302 + 303 + // pci_space < pci_addr > < cpu_addr > < size > 304 + ranges = <0x02000000 0x00000000 0x80000000 0x00000210 0x80000000 0x0 0x80000000 305 + 0x01000000 0x0 0x0 0x00000240 0x0 0x0 0x00010000>; 306 + 307 + /* Inbound starting at 0x0 to 0x40000000000. In order to use MSI 308 + * PCI devices must be able to write to the HSTA module. 309 + */ 310 + dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x400 0x0>; 311 + 312 + /* This drives busses 0 to 0xf */ 313 + bus-range = <0x0 0xf>; 314 + 315 + /* Legacy interrupts (note the weird polarity, the bridge seems 316 + * to invert PCIe legacy interrupts). 317 + * We are de-swizzling here because the numbers are actually for 318 + * port of the root complex virtual P2P bridge. But I want 319 + * to avoid putting a node for it in the tree, so the numbers 320 + * below are basically de-swizzled numbers. 321 + * The real slot is on idsel 0, so the swizzling is 1:1 322 + */ 323 + interrupt-map-mask = <0x0 0x0 0x0 0x7>; 324 + interrupt-map = < 325 + 0x0 0x0 0x0 0x1 &MPIC 53 0x2 /* int A */ 326 + 0x0 0x0 0x0 0x2 &MPIC 54 0x2 /* int B */ 327 + 0x0 0x0 0x0 0x3 &MPIC 55 0x2 /* int C */ 328 + 0x0 0x0 0x0 0x4 &MPIC 56 0x2 /* int D */>; 329 + }; 330 + 331 + PCIE2: pciex@18100000000 { 332 + device_type = "pci"; 333 + #interrupt-cells = <1>; 334 + #size-cells = <2>; 335 + #address-cells = <3>; 336 + compatible = "ibm,plb-pciex-476fpe", "ibm,plb-pciex"; 337 + primary; 338 + port = <0x2>; /* port number */ 339 + reg = <0x00000181 0x00000000 0x0 0x10000000 /* Config space access */ 340 + 0x00000180 0x00000000 0x0 0x00001000>; /* UTL Registers space access */ 341 + dcr-reg = <0xe0 0x20>; 342 + 343 + // pci_space < pci_addr > < cpu_addr > < size > 344 + ranges = <0x02000000 0x00000000 0x80000000 0x00000190 0x80000000 0x0 0x80000000 345 + 0x01000000 0x0 0x0 0x000001c0 0x0 0x0 0x00010000>; 346 + 347 + /* Inbound starting at 0x0 to 0x40000000000. In order to use MSI 348 + * PCI devices must be able to write to the HSTA module. 349 + */ 350 + dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x400 0x0>; 351 + 352 + /* This drives busses 0 to 0xf */ 353 + bus-range = <0x0 0xf>; 354 + 355 + /* Legacy interrupts (note the weird polarity, the bridge seems 356 + * to invert PCIe legacy interrupts). 357 + * We are de-swizzling here because the numbers are actually for 358 + * port of the root complex virtual P2P bridge. But I want 359 + * to avoid putting a node for it in the tree, so the numbers 360 + * below are basically de-swizzled numbers. 361 + * The real slot is on idsel 0, so the swizzling is 1:1 362 + */ 363 + interrupt-map-mask = <0x0 0x0 0x0 0x7>; 364 + interrupt-map = < 365 + 0x0 0x0 0x0 0x1 &MPIC 61 0x2 /* int A */ 366 + 0x0 0x0 0x0 0x2 &MPIC 62 0x2 /* int B */ 367 + 0x0 0x0 0x0 0x3 &MPIC 63 0x2 /* int C */ 368 + 0x0 0x0 0x0 0x4 &MPIC 64 0x2 /* int D */>; 369 + }; 370 + 371 + PCIE3: pciex@28100000000 { 372 + device_type = "pci"; 373 + #interrupt-cells = <1>; 374 + #size-cells = <2>; 375 + #address-cells = <3>; 376 + compatible = "ibm,plb-pciex-476fpe", "ibm,plb-pciex"; 377 + primary; 378 + port = <0x3>; /* port number */ 379 + reg = <0x00000281 0x00000000 0x0 0x10000000 /* Config space access */ 380 + 0x00000280 0x00000000 0x0 0x00001000>; /* UTL Registers space access */ 381 + dcr-reg = <0x120 0x20>; 382 + 383 + // pci_space < pci_addr > < cpu_addr > < size > 384 + ranges = <0x02000000 0x00000000 0x80000000 0x00000290 0x80000000 0x0 0x80000000 385 + 0x01000000 0x0 0x0 0x000002c0 0x0 0x0 0x00010000>; 386 + 387 + /* Inbound starting at 0x0 to 0x40000000000. In order to use MSI 388 + * PCI devices must be able to write to the HSTA module. 389 + */ 390 + dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x400 0x0>; 391 + 392 + /* This drives busses 0 to 0xf */ 393 + bus-range = <0x0 0xf>; 394 + 395 + /* Legacy interrupts (note the weird polarity, the bridge seems 396 + * to invert PCIe legacy interrupts). 397 + * We are de-swizzling here because the numbers are actually for 398 + * port of the root complex virtual P2P bridge. But I want 399 + * to avoid putting a node for it in the tree, so the numbers 400 + * below are basically de-swizzled numbers. 401 + * The real slot is on idsel 0, so the swizzling is 1:1 402 + */ 403 + interrupt-map-mask = <0x0 0x0 0x0 0x7>; 404 + interrupt-map = < 405 + 0x0 0x0 0x0 0x1 &MPIC 69 0x2 /* int A */ 406 + 0x0 0x0 0x0 0x2 &MPIC 70 0x2 /* int B */ 407 + 0x0 0x0 0x0 0x3 &MPIC 71 0x2 /* int C */ 408 + 0x0 0x0 0x0 0x4 &MPIC 72 0x2 /* int D */>; 409 + }; 410 + }; 411 + 412 + chosen { 413 + linux,stdout-path = &UART0; 414 + }; 415 + };
+6 -1
arch/powerpc/boot/dts/b4860emu.dts
··· 61 61 device_type = "cpu"; 62 62 reg = <0 1>; 63 63 next-level-cache = <&L2>; 64 + fsl,portid-mapping = <0x80000000>; 64 65 }; 65 66 cpu1: PowerPC,e6500@2 { 66 67 device_type = "cpu"; 67 68 reg = <2 3>; 68 69 next-level-cache = <&L2>; 70 + fsl,portid-mapping = <0x80000000>; 69 71 }; 70 72 cpu2: PowerPC,e6500@4 { 71 73 device_type = "cpu"; 72 74 reg = <4 5>; 73 75 next-level-cache = <&L2>; 76 + fsl,portid-mapping = <0x80000000>; 74 77 }; 75 78 cpu3: PowerPC,e6500@6 { 76 79 device_type = "cpu"; 77 80 reg = <6 7>; 78 81 next-level-cache = <&L2>; 82 + fsl,portid-mapping = <0x80000000>; 79 83 }; 80 84 }; 81 85 }; ··· 161 157 }; 162 158 163 159 corenet-cf@18000 { 164 - compatible = "fsl,b4-corenet-cf"; 160 + compatible = "fsl,corenet2-cf", "fsl,corenet-cf"; 165 161 reg = <0x18000 0x1000>; 166 162 interrupts = <16 2 1 0>; 167 163 fsl,ccf-num-csdids = <32>; ··· 171 167 iommu@20000 { 172 168 compatible = "fsl,pamu-v1.0", "fsl,pamu"; 173 169 reg = <0x20000 0x4000>; 170 + fsl,portid-mapping = <0x8000>; 174 171 #address-cells = <1>; 175 172 #size-cells = <1>; 176 173 interrupts = <
+35
arch/powerpc/boot/dts/bsc9132qds.dts
··· 1 + /* 2 + * BSC9132 QDS Device Tree Source 3 + * 4 + * Copyright 2014 Freescale Semiconductor Inc. 5 + * 6 + * This program is free software; you can redistribute it and/or modify it 7 + * under the terms of the GNU General Public License as published by the 8 + * Free Software Foundation; either version 2 of the License, or (at your 9 + * option) any later version. 10 + */ 11 + 12 + /include/ "fsl/bsc9132si-pre.dtsi" 13 + 14 + / { 15 + model = "fsl,bsc9132qds"; 16 + compatible = "fsl,bsc9132qds"; 17 + 18 + memory { 19 + device_type = "memory"; 20 + }; 21 + 22 + ifc: ifc@ff71e000 { 23 + /* NOR, NAND Flash on board */ 24 + ranges = <0x0 0x0 0x0 0x88000000 0x08000000 25 + 0x1 0x0 0x0 0xff800000 0x00010000>; 26 + reg = <0x0 0xff71e000 0x0 0x2000>; 27 + }; 28 + 29 + soc: soc@ff700000 { 30 + ranges = <0x0 0x0 0xff700000 0x100000>; 31 + }; 32 + }; 33 + 34 + /include/ "bsc9132qds.dtsi" 35 + /include/ "fsl/bsc9132si-post.dtsi"
+101
arch/powerpc/boot/dts/bsc9132qds.dtsi
··· 1 + /* 2 + * BSC9132 QDS Device Tree Source stub (no addresses or top-level ranges) 3 + * 4 + * Copyright 2014 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + &ifc { 36 + nor@0,0 { 37 + #address-cells = <1>; 38 + #size-cells = <1>; 39 + compatible = "cfi-flash"; 40 + reg = <0x0 0x0 0x8000000>; 41 + bank-width = <2>; 42 + device-width = <1>; 43 + }; 44 + 45 + nand@1,0 { 46 + #address-cells = <1>; 47 + #size-cells = <1>; 48 + compatible = "fsl,ifc-nand"; 49 + reg = <0x1 0x0 0x4000>; 50 + }; 51 + }; 52 + 53 + &soc { 54 + spi@7000 { 55 + flash@0 { 56 + #address-cells = <1>; 57 + #size-cells = <1>; 58 + compatible = "spansion,s25sl12801"; 59 + reg = <0>; 60 + spi-max-frequency = <30000000>; 61 + }; 62 + }; 63 + 64 + i2c@3000 { 65 + fpga: fpga@66 { 66 + compatible = "fsl,bsc9132qds-fpga", "fsl,fpga-qixis-i2c"; 67 + reg = <0x66>; 68 + }; 69 + }; 70 + 71 + usb@22000 { 72 + phy_type = "ulpi"; 73 + }; 74 + 75 + mdio@24000 { 76 + phy0: ethernet-phy@0 { 77 + reg = <0x0>; 78 + }; 79 + 80 + phy1: ethernet-phy@1 { 81 + reg = <0x1>; 82 + }; 83 + 84 + tbi0: tbi-phy@11 { 85 + reg = <0x1f>; 86 + device_type = "tbi-phy"; 87 + }; 88 + }; 89 + 90 + enet0: ethernet@b0000 { 91 + phy-handle = <&phy0>; 92 + tbi-handle = <&tbi0>; 93 + phy-connection-type = "sgmii"; 94 + }; 95 + 96 + enet1: ethernet@b1000 { 97 + phy-handle = <&phy1>; 98 + tbi-handle = <&tbi0>; 99 + phy-connection-type = "sgmii"; 100 + }; 101 + };
-4
arch/powerpc/boot/dts/fsl/b4420si-post.dtsi
··· 76 76 compatible = "fsl,b4420-l3-cache-controller", "cache"; 77 77 }; 78 78 79 - corenet-cf@18000 { 80 - compatible = "fsl,b4420-corenet-cf"; 81 - }; 82 - 83 79 guts: global-utilities@e0000 { 84 80 compatible = "fsl,b4420-device-config", "fsl,qoriq-device-config-2.0"; 85 81 };
+2
arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
··· 66 66 reg = <0 1>; 67 67 clocks = <&mux0>; 68 68 next-level-cache = <&L2>; 69 + fsl,portid-mapping = <0x80000000>; 69 70 }; 70 71 cpu1: PowerPC,e6500@2 { 71 72 device_type = "cpu"; 72 73 reg = <2 3>; 73 74 clocks = <&mux0>; 74 75 next-level-cache = <&L2>; 76 + fsl,portid-mapping = <0x80000000>; 75 77 }; 76 78 }; 77 79 };
-4
arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
··· 120 120 compatible = "fsl,b4860-l3-cache-controller", "cache"; 121 121 }; 122 122 123 - corenet-cf@18000 { 124 - compatible = "fsl,b4860-corenet-cf"; 125 - }; 126 - 127 123 guts: global-utilities@e0000 { 128 124 compatible = "fsl,b4860-device-config", "fsl,qoriq-device-config-2.0"; 129 125 };
+4
arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi
··· 66 66 reg = <0 1>; 67 67 clocks = <&mux0>; 68 68 next-level-cache = <&L2>; 69 + fsl,portid-mapping = <0x80000000>; 69 70 }; 70 71 cpu1: PowerPC,e6500@2 { 71 72 device_type = "cpu"; 72 73 reg = <2 3>; 73 74 clocks = <&mux0>; 74 75 next-level-cache = <&L2>; 76 + fsl,portid-mapping = <0x80000000>; 75 77 }; 76 78 cpu2: PowerPC,e6500@4 { 77 79 device_type = "cpu"; 78 80 reg = <4 5>; 79 81 clocks = <&mux0>; 80 82 next-level-cache = <&L2>; 83 + fsl,portid-mapping = <0x80000000>; 81 84 }; 82 85 cpu3: PowerPC,e6500@6 { 83 86 device_type = "cpu"; 84 87 reg = <6 7>; 85 88 clocks = <&mux0>; 86 89 next-level-cache = <&L2>; 90 + fsl,portid-mapping = <0x80000000>; 87 91 }; 88 92 }; 89 93 };
+2 -1
arch/powerpc/boot/dts/fsl/b4si-post.dtsi
··· 158 158 }; 159 159 160 160 corenet-cf@18000 { 161 - compatible = "fsl,b4-corenet-cf"; 161 + compatible = "fsl,corenet2-cf", "fsl,corenet-cf"; 162 162 reg = <0x18000 0x1000>; 163 163 interrupts = <16 2 1 0>; 164 164 fsl,ccf-num-csdids = <32>; ··· 168 168 iommu@20000 { 169 169 compatible = "fsl,pamu-v1.0", "fsl,pamu"; 170 170 reg = <0x20000 0x4000>; 171 + fsl,portid-mapping = <0x8000>; 171 172 #address-cells = <1>; 172 173 #size-cells = <1>; 173 174 interrupts = <
+185
arch/powerpc/boot/dts/fsl/bsc9132si-post.dtsi
··· 1 + /* 2 + * BSC9132 Silicon/SoC Device Tree Source (post include) 3 + * 4 + * Copyright 2014 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + &ifc { 36 + #address-cells = <2>; 37 + #size-cells = <1>; 38 + compatible = "fsl,ifc", "simple-bus"; 39 + /* FIXME: Test whether interrupts are split */ 40 + interrupts = <16 2 0 0 20 2 0 0>; 41 + }; 42 + 43 + &soc { 44 + #address-cells = <1>; 45 + #size-cells = <1>; 46 + device_type = "soc"; 47 + compatible = "fsl,bsc9132-immr", "simple-bus"; 48 + bus-frequency = <0>; // Filled out by uboot. 49 + 50 + ecm-law@0 { 51 + compatible = "fsl,ecm-law"; 52 + reg = <0x0 0x1000>; 53 + fsl,num-laws = <12>; 54 + }; 55 + 56 + ecm@1000 { 57 + compatible = "fsl,bsc9132-ecm", "fsl,ecm"; 58 + reg = <0x1000 0x1000>; 59 + interrupts = <16 2 0 0>; 60 + }; 61 + 62 + memory-controller@2000 { 63 + compatible = "fsl,bsc9132-memory-controller"; 64 + reg = <0x2000 0x1000>; 65 + interrupts = <16 2 1 8>; 66 + }; 67 + 68 + /include/ "pq3-i2c-0.dtsi" 69 + i2c@3000 { 70 + interrupts = <17 2 0 0>; 71 + }; 72 + 73 + /include/ "pq3-i2c-1.dtsi" 74 + i2c@3100 { 75 + interrupts = <17 2 0 0>; 76 + }; 77 + 78 + /include/ "pq3-duart-0.dtsi" 79 + serial0: serial@4500 { 80 + interrupts = <18 2 0 0>; 81 + }; 82 + 83 + serial1: serial@4600 { 84 + interrupts = <18 2 0 0 >; 85 + }; 86 + /include/ "pq3-espi-0.dtsi" 87 + spi0: spi@7000 { 88 + fsl,espi-num-chipselects = <1>; 89 + interrupts = <22 0x2 0 0>; 90 + }; 91 + 92 + /include/ "pq3-gpio-0.dtsi" 93 + gpio-controller@f000 { 94 + interrupts = <19 0x2 0 0>; 95 + }; 96 + 97 + L2: l2-cache-controller@20000 { 98 + compatible = "fsl,bsc9132-l2-cache-controller"; 99 + reg = <0x20000 0x1000>; 100 + cache-line-size = <32>; // 32 bytes 101 + cache-size = <0x40000>; // L2,256K 102 + interrupts = <16 2 1 0>; 103 + }; 104 + 105 + /include/ "pq3-dma-0.dtsi" 106 + 107 + dma@21300 { 108 + 109 + dma-channel@0 { 110 + interrupts = <62 2 0 0>; 111 + }; 112 + 113 + dma-channel@80 { 114 + interrupts = <63 2 0 0>; 115 + }; 116 + 117 + dma-channel@100 { 118 + interrupts = <64 2 0 0>; 119 + }; 120 + 121 + dma-channel@180 { 122 + interrupts = <65 2 0 0>; 123 + }; 124 + }; 125 + 126 + /include/ "pq3-usb2-dr-0.dtsi" 127 + usb@22000 { 128 + compatible = "fsl-usb2-dr","fsl-usb2-dr-v2.2"; 129 + interrupts = <40 0x2 0 0>; 130 + }; 131 + 132 + /include/ "pq3-esdhc-0.dtsi" 133 + sdhc@2e000 { 134 + fsl,sdhci-auto-cmd12; 135 + interrupts = <41 0x2 0 0>; 136 + }; 137 + 138 + /include/ "pq3-sec4.4-0.dtsi" 139 + crypto@30000 { 140 + interrupts = <57 2 0 0>; 141 + 142 + sec_jr0: jr@1000 { 143 + interrupts = <58 2 0 0>; 144 + }; 145 + 146 + sec_jr1: jr@2000 { 147 + interrupts = <59 2 0 0>; 148 + }; 149 + 150 + sec_jr2: jr@3000 { 151 + interrupts = <60 2 0 0>; 152 + }; 153 + 154 + sec_jr3: jr@4000 { 155 + interrupts = <61 2 0 0>; 156 + }; 157 + }; 158 + 159 + /include/ "pq3-mpic.dtsi" 160 + /include/ "pq3-mpic-timer-B.dtsi" 161 + 162 + /include/ "pq3-etsec2-0.dtsi" 163 + enet0: ethernet@b0000 { 164 + queue-group@b0000 { 165 + fsl,rx-bit-map = <0xff>; 166 + fsl,tx-bit-map = <0xff>; 167 + interrupts = <26 2 0 0 27 2 0 0 28 2 0 0>; 168 + }; 169 + }; 170 + 171 + /include/ "pq3-etsec2-1.dtsi" 172 + enet1: ethernet@b1000 { 173 + queue-group@b1000 { 174 + fsl,rx-bit-map = <0xff>; 175 + fsl,tx-bit-map = <0xff>; 176 + interrupts = <33 2 0 0 34 2 0 0 35 2 0 0>; 177 + }; 178 + }; 179 + 180 + global-utilities@e0000 { 181 + compatible = "fsl,bsc9132-guts"; 182 + reg = <0xe0000 0x1000>; 183 + fsl,has-rstcr; 184 + }; 185 + };
+66
arch/powerpc/boot/dts/fsl/bsc9132si-pre.dtsi
··· 1 + /* 2 + * BSC9132 Silicon/SoC Device Tree Source (pre include) 3 + * 4 + * Copyright 2014 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + /dts-v1/; 36 + 37 + /include/ "e500v2_power_isa.dtsi" 38 + 39 + / { 40 + #address-cells = <2>; 41 + #size-cells = <2>; 42 + interrupt-parent = <&mpic>; 43 + 44 + aliases { 45 + serial0 = &serial0; 46 + ethernet0 = &enet0; 47 + ethernet1 = &enet1; 48 + }; 49 + 50 + cpus { 51 + #address-cells = <1>; 52 + #size-cells = <0>; 53 + 54 + cpu0: PowerPC,e500v2@0 { 55 + device_type = "cpu"; 56 + reg = <0x0>; 57 + next-level-cache = <&L2>; 58 + }; 59 + 60 + cpu1: PowerPC,e500v2@1 { 61 + device_type = "cpu"; 62 + reg = <0x1>; 63 + next-level-cache = <&L2>; 64 + }; 65 + }; 66 + };
+2 -1
arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
··· 246 246 }; 247 247 248 248 corenet-cf@18000 { 249 - compatible = "fsl,corenet-cf"; 249 + compatible = "fsl,corenet1-cf", "fsl,corenet-cf"; 250 250 reg = <0x18000 0x1000>; 251 251 interrupts = <16 2 1 31>; 252 252 fsl,ccf-num-csdids = <32>; ··· 262 262 interrupts = < 263 263 24 2 0 0 264 264 16 2 1 30>; 265 + fsl,portid-mapping = <0x0f000000>; 265 266 266 267 pamu0: pamu@0 { 267 268 reg = <0 0x1000>;
+4
arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi
··· 83 83 reg = <0>; 84 84 clocks = <&mux0>; 85 85 next-level-cache = <&L2_0>; 86 + fsl,portid-mapping = <0x80000000>; 86 87 L2_0: l2-cache { 87 88 next-level-cache = <&cpc>; 88 89 }; ··· 93 92 reg = <1>; 94 93 clocks = <&mux1>; 95 94 next-level-cache = <&L2_1>; 95 + fsl,portid-mapping = <0x40000000>; 96 96 L2_1: l2-cache { 97 97 next-level-cache = <&cpc>; 98 98 }; ··· 103 101 reg = <2>; 104 102 clocks = <&mux2>; 105 103 next-level-cache = <&L2_2>; 104 + fsl,portid-mapping = <0x20000000>; 106 105 L2_2: l2-cache { 107 106 next-level-cache = <&cpc>; 108 107 }; ··· 113 110 reg = <3>; 114 111 clocks = <&mux3>; 115 112 next-level-cache = <&L2_3>; 113 + fsl,portid-mapping = <0x10000000>; 116 114 L2_3: l2-cache { 117 115 next-level-cache = <&cpc>; 118 116 };
+2 -1
arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
··· 273 273 }; 274 274 275 275 corenet-cf@18000 { 276 - compatible = "fsl,corenet-cf"; 276 + compatible = "fsl,corenet1-cf", "fsl,corenet-cf"; 277 277 reg = <0x18000 0x1000>; 278 278 interrupts = <16 2 1 31>; 279 279 fsl,ccf-num-csdids = <32>; ··· 289 289 interrupts = < 290 290 24 2 0 0 291 291 16 2 1 30>; 292 + fsl,portid-mapping = <0x0f000000>; 292 293 293 294 pamu0: pamu@0 { 294 295 reg = <0 0x1000>;
+4
arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi
··· 84 84 reg = <0>; 85 85 clocks = <&mux0>; 86 86 next-level-cache = <&L2_0>; 87 + fsl,portid-mapping = <0x80000000>; 87 88 L2_0: l2-cache { 88 89 next-level-cache = <&cpc>; 89 90 }; ··· 94 93 reg = <1>; 95 94 clocks = <&mux1>; 96 95 next-level-cache = <&L2_1>; 96 + fsl,portid-mapping = <0x40000000>; 97 97 L2_1: l2-cache { 98 98 next-level-cache = <&cpc>; 99 99 }; ··· 104 102 reg = <2>; 105 103 clocks = <&mux2>; 106 104 next-level-cache = <&L2_2>; 105 + fsl,portid-mapping = <0x20000000>; 107 106 L2_2: l2-cache { 108 107 next-level-cache = <&cpc>; 109 108 }; ··· 114 111 reg = <3>; 115 112 clocks = <&mux3>; 116 113 next-level-cache = <&L2_3>; 114 + fsl,portid-mapping = <0x10000000>; 117 115 L2_3: l2-cache { 118 116 next-level-cache = <&cpc>; 119 117 };
+2 -1
arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
··· 281 281 }; 282 282 283 283 corenet-cf@18000 { 284 - compatible = "fsl,corenet-cf"; 284 + compatible = "fsl,corenet1-cf", "fsl,corenet-cf"; 285 285 reg = <0x18000 0x1000>; 286 286 interrupts = <16 2 1 31>; 287 287 fsl,ccf-num-csdids = <32>; ··· 297 297 interrupts = < 298 298 24 2 0 0 299 299 16 2 1 30>; 300 + fsl,portid-mapping = <0x00f80000>; 300 301 301 302 pamu0: pamu@0 { 302 303 reg = <0 0x1000>;
+8
arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi
··· 83 83 reg = <0>; 84 84 clocks = <&mux0>; 85 85 next-level-cache = <&L2_0>; 86 + fsl,portid-mapping = <0x80000000>; 86 87 L2_0: l2-cache { 87 88 next-level-cache = <&cpc>; 88 89 }; ··· 93 92 reg = <1>; 94 93 clocks = <&mux1>; 95 94 next-level-cache = <&L2_1>; 95 + fsl,portid-mapping = <0x40000000>; 96 96 L2_1: l2-cache { 97 97 next-level-cache = <&cpc>; 98 98 }; ··· 103 101 reg = <2>; 104 102 clocks = <&mux2>; 105 103 next-level-cache = <&L2_2>; 104 + fsl,portid-mapping = <0x20000000>; 106 105 L2_2: l2-cache { 107 106 next-level-cache = <&cpc>; 108 107 }; ··· 113 110 reg = <3>; 114 111 clocks = <&mux3>; 115 112 next-level-cache = <&L2_3>; 113 + fsl,portid-mapping = <0x10000000>; 116 114 L2_3: l2-cache { 117 115 next-level-cache = <&cpc>; 118 116 }; ··· 123 119 reg = <4>; 124 120 clocks = <&mux4>; 125 121 next-level-cache = <&L2_4>; 122 + fsl,portid-mapping = <0x08000000>; 126 123 L2_4: l2-cache { 127 124 next-level-cache = <&cpc>; 128 125 }; ··· 133 128 reg = <5>; 134 129 clocks = <&mux5>; 135 130 next-level-cache = <&L2_5>; 131 + fsl,portid-mapping = <0x04000000>; 136 132 L2_5: l2-cache { 137 133 next-level-cache = <&cpc>; 138 134 }; ··· 143 137 reg = <6>; 144 138 clocks = <&mux6>; 145 139 next-level-cache = <&L2_6>; 140 + fsl,portid-mapping = <0x02000000>; 146 141 L2_6: l2-cache { 147 142 next-level-cache = <&cpc>; 148 143 }; ··· 153 146 reg = <7>; 154 147 clocks = <&mux7>; 155 148 next-level-cache = <&L2_7>; 149 + fsl,portid-mapping = <0x01000000>; 156 150 L2_7: l2-cache { 157 151 next-level-cache = <&cpc>; 158 152 };
+2 -1
arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
··· 278 278 }; 279 279 280 280 corenet-cf@18000 { 281 - compatible = "fsl,corenet-cf"; 281 + compatible = "fsl,corenet1-cf", "fsl,corenet-cf"; 282 282 reg = <0x18000 0x1000>; 283 283 interrupts = <16 2 1 31>; 284 284 fsl,ccf-num-csdids = <32>; ··· 294 294 interrupts = < 295 295 24 2 0 0 296 296 16 2 1 30>; 297 + fsl,portid-mapping = <0x3c000000>; 297 298 298 299 pamu0: pamu@0 { 299 300 reg = <0 0x1000>;
+2
arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi
··· 90 90 reg = <0>; 91 91 clocks = <&mux0>; 92 92 next-level-cache = <&L2_0>; 93 + fsl,portid-mapping = <0x80000000>; 93 94 L2_0: l2-cache { 94 95 next-level-cache = <&cpc>; 95 96 }; ··· 100 99 reg = <1>; 101 100 clocks = <&mux1>; 102 101 next-level-cache = <&L2_1>; 102 + fsl,portid-mapping = <0x40000000>; 103 103 L2_1: l2-cache { 104 104 next-level-cache = <&cpc>; 105 105 };
+2 -1
arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
··· 233 233 }; 234 234 235 235 corenet-cf@18000 { 236 - compatible = "fsl,corenet-cf"; 236 + compatible = "fsl,corenet1-cf", "fsl,corenet-cf"; 237 237 reg = <0x18000 0x1000>; 238 238 interrupts = <16 2 1 31>; 239 239 fsl,ccf-num-csdids = <32>; ··· 248 248 #size-cells = <1>; 249 249 interrupts = <24 2 0 0 250 250 16 2 1 30>; 251 + fsl,portid-mapping = <0x0f800000>; 251 252 252 253 pamu0: pamu@0 { 253 254 reg = <0 0x1000>;
+4
arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi
··· 83 83 reg = <0>; 84 84 clocks = <&mux0>; 85 85 next-level-cache = <&L2_0>; 86 + fsl,portid-mapping = <0x80000000>; 86 87 L2_0: l2-cache { 87 88 next-level-cache = <&cpc>; 88 89 }; ··· 93 92 reg = <1>; 94 93 clocks = <&mux1>; 95 94 next-level-cache = <&L2_1>; 95 + fsl,portid-mapping = <0x40000000>; 96 96 L2_1: l2-cache { 97 97 next-level-cache = <&cpc>; 98 98 }; ··· 103 101 reg = <2>; 104 102 clocks = <&mux2>; 105 103 next-level-cache = <&L2_2>; 104 + fsl,portid-mapping = <0x20000000>; 106 105 L2_2: l2-cache { 107 106 next-level-cache = <&cpc>; 108 107 }; ··· 113 110 reg = <3>; 114 111 clocks = <&mux3>; 115 112 next-level-cache = <&L2_3>; 113 + fsl,portid-mapping = <0x10000000>; 116 114 L2_3: l2-cache { 117 115 next-level-cache = <&cpc>; 118 116 };
+430
arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
··· 1 + /* 2 + * T1040 Silicon/SoC Device Tree Source (post include) 3 + * 4 + * Copyright 2013 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + &ifc { 36 + #address-cells = <2>; 37 + #size-cells = <1>; 38 + compatible = "fsl,ifc", "simple-bus"; 39 + interrupts = <25 2 0 0>; 40 + }; 41 + 42 + &pci0 { 43 + compatible = "fsl,t1040-pcie", "fsl,qoriq-pcie-v2.4", "fsl,qoriq-pcie"; 44 + device_type = "pci"; 45 + #size-cells = <2>; 46 + #address-cells = <3>; 47 + bus-range = <0x0 0xff>; 48 + interrupts = <20 2 0 0>; 49 + fsl,iommu-parent = <&pamu0>; 50 + pcie@0 { 51 + reg = <0 0 0 0 0>; 52 + #interrupt-cells = <1>; 53 + #size-cells = <2>; 54 + #address-cells = <3>; 55 + device_type = "pci"; 56 + interrupts = <20 2 0 0>; 57 + interrupt-map-mask = <0xf800 0 0 7>; 58 + interrupt-map = < 59 + /* IDSEL 0x0 */ 60 + 0000 0 0 1 &mpic 40 1 0 0 61 + 0000 0 0 2 &mpic 1 1 0 0 62 + 0000 0 0 3 &mpic 2 1 0 0 63 + 0000 0 0 4 &mpic 3 1 0 0 64 + >; 65 + }; 66 + }; 67 + 68 + &pci1 { 69 + compatible = "fsl,t1040-pcie", "fsl,qoriq-pcie-v2.4", "fsl,qoriq-pcie"; 70 + device_type = "pci"; 71 + #size-cells = <2>; 72 + #address-cells = <3>; 73 + bus-range = <0 0xff>; 74 + interrupts = <21 2 0 0>; 75 + fsl,iommu-parent = <&pamu0>; 76 + pcie@0 { 77 + reg = <0 0 0 0 0>; 78 + #interrupt-cells = <1>; 79 + #size-cells = <2>; 80 + #address-cells = <3>; 81 + device_type = "pci"; 82 + interrupts = <21 2 0 0>; 83 + interrupt-map-mask = <0xf800 0 0 7>; 84 + interrupt-map = < 85 + /* IDSEL 0x0 */ 86 + 0000 0 0 1 &mpic 41 1 0 0 87 + 0000 0 0 2 &mpic 5 1 0 0 88 + 0000 0 0 3 &mpic 6 1 0 0 89 + 0000 0 0 4 &mpic 7 1 0 0 90 + >; 91 + }; 92 + }; 93 + 94 + &pci2 { 95 + compatible = "fsl,t1040-pcie", "fsl,qoriq-pcie-v2.4", "fsl,qoriq-pcie"; 96 + device_type = "pci"; 97 + #size-cells = <2>; 98 + #address-cells = <3>; 99 + bus-range = <0x0 0xff>; 100 + interrupts = <22 2 0 0>; 101 + fsl,iommu-parent = <&pamu0>; 102 + pcie@0 { 103 + reg = <0 0 0 0 0>; 104 + #interrupt-cells = <1>; 105 + #size-cells = <2>; 106 + #address-cells = <3>; 107 + device_type = "pci"; 108 + interrupts = <22 2 0 0>; 109 + interrupt-map-mask = <0xf800 0 0 7>; 110 + interrupt-map = < 111 + /* IDSEL 0x0 */ 112 + 0000 0 0 1 &mpic 42 1 0 0 113 + 0000 0 0 2 &mpic 9 1 0 0 114 + 0000 0 0 3 &mpic 10 1 0 0 115 + 0000 0 0 4 &mpic 11 1 0 0 116 + >; 117 + }; 118 + }; 119 + 120 + &pci3 { 121 + compatible = "fsl,t1040-pcie", "fsl,qoriq-pcie-v2.4", "fsl,qoriq-pcie"; 122 + device_type = "pci"; 123 + #size-cells = <2>; 124 + #address-cells = <3>; 125 + bus-range = <0x0 0xff>; 126 + interrupts = <23 2 0 0>; 127 + fsl,iommu-parent = <&pamu0>; 128 + pcie@0 { 129 + reg = <0 0 0 0 0>; 130 + #interrupt-cells = <1>; 131 + #size-cells = <2>; 132 + #address-cells = <3>; 133 + device_type = "pci"; 134 + interrupts = <23 2 0 0>; 135 + interrupt-map-mask = <0xf800 0 0 7>; 136 + interrupt-map = < 137 + /* IDSEL 0x0 */ 138 + 0000 0 0 1 &mpic 43 1 0 0 139 + 0000 0 0 2 &mpic 0 1 0 0 140 + 0000 0 0 3 &mpic 4 1 0 0 141 + 0000 0 0 4 &mpic 8 1 0 0 142 + >; 143 + }; 144 + }; 145 + 146 + &dcsr { 147 + #address-cells = <1>; 148 + #size-cells = <1>; 149 + compatible = "fsl,dcsr", "simple-bus"; 150 + 151 + dcsr-epu@0 { 152 + compatible = "fsl,t1040-dcsr-epu", "fsl,dcsr-epu"; 153 + interrupts = <52 2 0 0 154 + 84 2 0 0 155 + 85 2 0 0>; 156 + reg = <0x0 0x1000>; 157 + }; 158 + dcsr-npc { 159 + compatible = "fsl,t1040-dcsr-cnpc", "fsl,dcsr-cnpc"; 160 + reg = <0x1000 0x1000 0x1002000 0x10000>; 161 + }; 162 + dcsr-nxc@2000 { 163 + compatible = "fsl,dcsr-nxc"; 164 + reg = <0x2000 0x1000>; 165 + }; 166 + dcsr-corenet { 167 + compatible = "fsl,dcsr-corenet"; 168 + reg = <0x8000 0x1000 0x1A000 0x1000>; 169 + }; 170 + dcsr-dpaa@9000 { 171 + compatible = "fsl,t1040-dcsr-dpaa", "fsl,dcsr-dpaa"; 172 + reg = <0x9000 0x1000>; 173 + }; 174 + dcsr-ocn@11000 { 175 + compatible = "fsl,t1040-dcsr-ocn", "fsl,dcsr-ocn"; 176 + reg = <0x11000 0x1000>; 177 + }; 178 + dcsr-ddr@12000 { 179 + compatible = "fsl,dcsr-ddr"; 180 + dev-handle = <&ddr1>; 181 + reg = <0x12000 0x1000>; 182 + }; 183 + dcsr-nal@18000 { 184 + compatible = "fsl,t1040-dcsr-nal", "fsl,dcsr-nal"; 185 + reg = <0x18000 0x1000>; 186 + }; 187 + dcsr-rcpm@22000 { 188 + compatible = "fsl,t1040-dcsr-rcpm", "fsl,dcsr-rcpm"; 189 + reg = <0x22000 0x1000>; 190 + }; 191 + dcsr-snpc@30000 { 192 + compatible = "fsl,t1040-dcsr-snpc", "fsl,dcsr-snpc"; 193 + reg = <0x30000 0x1000 0x1022000 0x10000>; 194 + }; 195 + dcsr-snpc@31000 { 196 + compatible = "fsl,t1040-dcsr-snpc", "fsl,dcsr-snpc"; 197 + reg = <0x31000 0x1000 0x1042000 0x10000>; 198 + }; 199 + dcsr-cpu-sb-proxy@100000 { 200 + compatible = "fsl,dcsr-e5500-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; 201 + cpu-handle = <&cpu0>; 202 + reg = <0x100000 0x1000 0x101000 0x1000>; 203 + }; 204 + dcsr-cpu-sb-proxy@108000 { 205 + compatible = "fsl,dcsr-e5500-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; 206 + cpu-handle = <&cpu1>; 207 + reg = <0x108000 0x1000 0x109000 0x1000>; 208 + }; 209 + dcsr-cpu-sb-proxy@110000 { 210 + compatible = "fsl,dcsr-e5500-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; 211 + cpu-handle = <&cpu2>; 212 + reg = <0x110000 0x1000 0x111000 0x1000>; 213 + }; 214 + dcsr-cpu-sb-proxy@118000 { 215 + compatible = "fsl,dcsr-e5500-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; 216 + cpu-handle = <&cpu3>; 217 + reg = <0x118000 0x1000 0x119000 0x1000>; 218 + }; 219 + }; 220 + 221 + &soc { 222 + #address-cells = <1>; 223 + #size-cells = <1>; 224 + device_type = "soc"; 225 + compatible = "simple-bus"; 226 + 227 + soc-sram-error { 228 + compatible = "fsl,soc-sram-error"; 229 + interrupts = <16 2 1 29>; 230 + }; 231 + 232 + corenet-law@0 { 233 + compatible = "fsl,corenet-law"; 234 + reg = <0x0 0x1000>; 235 + fsl,num-laws = <16>; 236 + }; 237 + 238 + ddr1: memory-controller@8000 { 239 + compatible = "fsl,qoriq-memory-controller-v5.0", 240 + "fsl,qoriq-memory-controller"; 241 + reg = <0x8000 0x1000>; 242 + interrupts = <16 2 1 23>; 243 + }; 244 + 245 + cpc: l3-cache-controller@10000 { 246 + compatible = "fsl,t1040-l3-cache-controller", "cache"; 247 + reg = <0x10000 0x1000>; 248 + interrupts = <16 2 1 27>; 249 + }; 250 + 251 + corenet-cf@18000 { 252 + compatible = "fsl,corenet2-cf", "fsl,corenet-cf"; 253 + reg = <0x18000 0x1000>; 254 + interrupts = <16 2 1 31>; 255 + fsl,ccf-num-csdids = <32>; 256 + fsl,ccf-num-snoopids = <32>; 257 + }; 258 + 259 + iommu@20000 { 260 + compatible = "fsl,pamu-v1.0", "fsl,pamu"; 261 + reg = <0x20000 0x1000>; 262 + ranges = <0 0x20000 0x1000>; 263 + #address-cells = <1>; 264 + #size-cells = <1>; 265 + interrupts = < 266 + 24 2 0 0 267 + 16 2 1 30>; 268 + pamu0: pamu@0 { 269 + reg = <0 0x1000>; 270 + fsl,primary-cache-geometry = <128 1>; 271 + fsl,secondary-cache-geometry = <16 2>; 272 + }; 273 + }; 274 + 275 + /include/ "qoriq-mpic.dtsi" 276 + 277 + guts: global-utilities@e0000 { 278 + compatible = "fsl,t1040-device-config", "fsl,qoriq-device-config-2.0"; 279 + reg = <0xe0000 0xe00>; 280 + fsl,has-rstcr; 281 + fsl,liodn-bits = <12>; 282 + }; 283 + 284 + clockgen: global-utilities@e1000 { 285 + compatible = "fsl,t1040-clockgen", "fsl,qoriq-clockgen-2.0"; 286 + ranges = <0x0 0xe1000 0x1000>; 287 + reg = <0xe1000 0x1000>; 288 + #address-cells = <1>; 289 + #size-cells = <1>; 290 + 291 + sysclk: sysclk { 292 + #clock-cells = <0>; 293 + compatible = "fsl,qoriq-sysclk-2.0"; 294 + clock-output-names = "sysclk", "fixed-clock"; 295 + }; 296 + 297 + 298 + pll0: pll0@800 { 299 + #clock-cells = <1>; 300 + reg = <0x800 4>; 301 + compatible = "fsl,qoriq-core-pll-2.0"; 302 + clocks = <&sysclk>; 303 + clock-output-names = "pll0", "pll0-div2", "pll0-div4"; 304 + }; 305 + 306 + pll1: pll1@820 { 307 + #clock-cells = <1>; 308 + reg = <0x820 4>; 309 + compatible = "fsl,qoriq-core-pll-2.0"; 310 + clocks = <&sysclk>; 311 + clock-output-names = "pll1", "pll1-div2", "pll1-div4"; 312 + }; 313 + 314 + mux0: mux0@0 { 315 + #clock-cells = <0>; 316 + reg = <0x0 4>; 317 + compatible = "fsl,qoriq-core-mux-2.0"; 318 + clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>, 319 + <&pll1 0>, <&pll1 1>, <&pll1 2>; 320 + clock-names = "pll0", "pll0-div2", "pll1-div4", 321 + "pll1", "pll1-div2", "pll1-div4"; 322 + clock-output-names = "cmux0"; 323 + }; 324 + 325 + mux1: mux1@20 { 326 + #clock-cells = <0>; 327 + reg = <0x20 4>; 328 + compatible = "fsl,qoriq-core-mux-2.0"; 329 + clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>, 330 + <&pll1 0>, <&pll1 1>, <&pll1 2>; 331 + clock-names = "pll0", "pll0-div2", "pll1-div4", 332 + "pll1", "pll1-div2", "pll1-div4"; 333 + clock-output-names = "cmux1"; 334 + }; 335 + 336 + mux2: mux2@40 { 337 + #clock-cells = <0>; 338 + reg = <0x40 4>; 339 + compatible = "fsl,qoriq-core-mux-2.0"; 340 + clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>, 341 + <&pll1 0>, <&pll1 1>, <&pll1 2>; 342 + clock-names = "pll0", "pll0-div2", "pll1-div4", 343 + "pll1", "pll1-div2", "pll1-div4"; 344 + clock-output-names = "cmux2"; 345 + }; 346 + 347 + mux3: mux3@60 { 348 + #clock-cells = <0>; 349 + reg = <0x60 4>; 350 + compatible = "fsl,qoriq-core-mux-2.0"; 351 + clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>, 352 + <&pll1 0>, <&pll1 1>, <&pll1 2>; 353 + clock-names = "pll0_0", "pll0_1", "pll0_2", 354 + "pll1_0", "pll1_1", "pll1_2"; 355 + clock-output-names = "cmux3"; 356 + }; 357 + }; 358 + 359 + rcpm: global-utilities@e2000 { 360 + compatible = "fsl,t1040-rcpm", "fsl,qoriq-rcpm-2.0"; 361 + reg = <0xe2000 0x1000>; 362 + }; 363 + 364 + sfp: sfp@e8000 { 365 + compatible = "fsl,t1040-sfp"; 366 + reg = <0xe8000 0x1000>; 367 + }; 368 + 369 + serdes: serdes@ea000 { 370 + compatible = "fsl,t1040-serdes"; 371 + reg = <0xea000 0x4000>; 372 + }; 373 + 374 + /include/ "elo3-dma-0.dtsi" 375 + /include/ "elo3-dma-1.dtsi" 376 + /include/ "qoriq-espi-0.dtsi" 377 + spi@110000 { 378 + fsl,espi-num-chipselects = <4>; 379 + }; 380 + 381 + /include/ "qoriq-esdhc-0.dtsi" 382 + sdhc@114000 { 383 + compatible = "fsl,t1040-esdhc", "fsl,esdhc"; 384 + fsl,iommu-parent = <&pamu0>; 385 + fsl,liodn-reg = <&guts 0x530>; /* eSDHCLIODNR */ 386 + sdhci,auto-cmd12; 387 + }; 388 + /include/ "qoriq-i2c-0.dtsi" 389 + /include/ "qoriq-i2c-1.dtsi" 390 + /include/ "qoriq-duart-0.dtsi" 391 + /include/ "qoriq-duart-1.dtsi" 392 + /include/ "qoriq-gpio-0.dtsi" 393 + /include/ "qoriq-gpio-1.dtsi" 394 + /include/ "qoriq-gpio-2.dtsi" 395 + /include/ "qoriq-gpio-3.dtsi" 396 + /include/ "qoriq-usb2-mph-0.dtsi" 397 + usb0: usb@210000 { 398 + compatible = "fsl-usb2-mph-v2.4", "fsl-usb2-mph"; 399 + fsl,iommu-parent = <&pamu0>; 400 + fsl,liodn-reg = <&guts 0x520>; /* USB1LIODNR */ 401 + phy_type = "utmi"; 402 + port0; 403 + }; 404 + /include/ "qoriq-usb2-dr-0.dtsi" 405 + usb1: usb@211000 { 406 + compatible = "fsl-usb2-dr-v2.4", "fsl-usb2-dr"; 407 + fsl,iommu-parent = <&pamu0>; 408 + fsl,liodn-reg = <&guts 0x524>; /* USB2LIODNR */ 409 + dr_mode = "host"; 410 + phy_type = "utmi"; 411 + }; 412 + 413 + display@180000 { 414 + compatible = "fsl,t1040-diu", "fsl,diu"; 415 + reg = <0x180000 1000>; 416 + interrupts = <74 2 0 0>; 417 + }; 418 + 419 + /include/ "qoriq-sata2-0.dtsi" 420 + sata@220000 { 421 + fsl,iommu-parent = <&pamu0>; 422 + fsl,liodn-reg = <&guts 0x550>; /* SATA1LIODNR */ 423 + }; 424 + /include/ "qoriq-sata2-1.dtsi" 425 + sata@221000 { 426 + fsl,iommu-parent = <&pamu0>; 427 + fsl,liodn-reg = <&guts 0x554>; /* SATA2LIODNR */ 428 + }; 429 + /include/ "qoriq-sec5.0-0.dtsi" 430 + };
+37
arch/powerpc/boot/dts/fsl/t1042si-post.dtsi
··· 1 + /* 2 + * T1042 Silicon/SoC Device Tree Source (post include) 3 + * 4 + * Copyright 2013 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + /include/ "t1040si-post.dtsi" 36 + 37 + /* Place holder for ethernet related device tree nodes */
+104
arch/powerpc/boot/dts/fsl/t104xsi-pre.dtsi
··· 1 + /* 2 + * T1040/T1042 Silicon/SoC Device Tree Source (pre include) 3 + * 4 + * Copyright 2013 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + /dts-v1/; 36 + 37 + /include/ "e5500_power_isa.dtsi" 38 + 39 + / { 40 + #address-cells = <2>; 41 + #size-cells = <2>; 42 + interrupt-parent = <&mpic>; 43 + 44 + aliases { 45 + ccsr = &soc; 46 + dcsr = &dcsr; 47 + 48 + serial0 = &serial0; 49 + serial1 = &serial1; 50 + serial2 = &serial2; 51 + serial3 = &serial3; 52 + pci0 = &pci0; 53 + pci1 = &pci1; 54 + pci2 = &pci2; 55 + pci3 = &pci3; 56 + usb0 = &usb0; 57 + usb1 = &usb1; 58 + sdhc = &sdhc; 59 + 60 + crypto = &crypto; 61 + }; 62 + 63 + cpus { 64 + #address-cells = <1>; 65 + #size-cells = <0>; 66 + 67 + cpu0: PowerPC,e5500@0 { 68 + device_type = "cpu"; 69 + reg = <0>; 70 + clocks = <&mux0>; 71 + next-level-cache = <&L2_1>; 72 + L2_1: l2-cache { 73 + next-level-cache = <&cpc>; 74 + }; 75 + }; 76 + cpu1: PowerPC,e5500@1 { 77 + device_type = "cpu"; 78 + reg = <1>; 79 + clocks = <&mux1>; 80 + next-level-cache = <&L2_2>; 81 + L2_2: l2-cache { 82 + next-level-cache = <&cpc>; 83 + }; 84 + }; 85 + cpu2: PowerPC,e5500@2 { 86 + device_type = "cpu"; 87 + reg = <2>; 88 + clocks = <&mux2>; 89 + next-level-cache = <&L2_3>; 90 + L2_3: l2-cache { 91 + next-level-cache = <&cpc>; 92 + }; 93 + }; 94 + cpu3: PowerPC,e5500@3 { 95 + device_type = "cpu"; 96 + reg = <3>; 97 + clocks = <&mux3>; 98 + next-level-cache = <&L2_4>; 99 + L2_4: l2-cache { 100 + next-level-cache = <&cpc>; 101 + }; 102 + }; 103 + }; 104 + };
+2 -1
arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
··· 343 343 }; 344 344 345 345 corenet-cf@18000 { 346 - compatible = "fsl,corenet-cf"; 346 + compatible = "fsl,corenet2-cf", "fsl,corenet-cf"; 347 347 reg = <0x18000 0x1000>; 348 348 interrupts = <16 2 1 31>; 349 349 fsl,ccf-num-csdids = <32>; ··· 353 353 iommu@20000 { 354 354 compatible = "fsl,pamu-v1.0", "fsl,pamu"; 355 355 reg = <0x20000 0x6000>; 356 + fsl,portid-mapping = <0x8000>; 356 357 interrupts = < 357 358 24 2 0 0 358 359 16 2 1 30>;
+12
arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi
··· 69 69 reg = <0 1>; 70 70 clocks = <&mux0>; 71 71 next-level-cache = <&L2_1>; 72 + fsl,portid-mapping = <0x80000000>; 72 73 }; 73 74 cpu1: PowerPC,e6500@2 { 74 75 device_type = "cpu"; 75 76 reg = <2 3>; 76 77 clocks = <&mux0>; 77 78 next-level-cache = <&L2_1>; 79 + fsl,portid-mapping = <0x80000000>; 78 80 }; 79 81 cpu2: PowerPC,e6500@4 { 80 82 device_type = "cpu"; 81 83 reg = <4 5>; 82 84 clocks = <&mux0>; 83 85 next-level-cache = <&L2_1>; 86 + fsl,portid-mapping = <0x80000000>; 84 87 }; 85 88 cpu3: PowerPC,e6500@6 { 86 89 device_type = "cpu"; 87 90 reg = <6 7>; 88 91 clocks = <&mux0>; 89 92 next-level-cache = <&L2_1>; 93 + fsl,portid-mapping = <0x80000000>; 90 94 }; 91 95 cpu4: PowerPC,e6500@8 { 92 96 device_type = "cpu"; 93 97 reg = <8 9>; 94 98 clocks = <&mux1>; 95 99 next-level-cache = <&L2_2>; 100 + fsl,portid-mapping = <0x40000000>; 96 101 }; 97 102 cpu5: PowerPC,e6500@10 { 98 103 device_type = "cpu"; 99 104 reg = <10 11>; 100 105 clocks = <&mux1>; 101 106 next-level-cache = <&L2_2>; 107 + fsl,portid-mapping = <0x40000000>; 102 108 }; 103 109 cpu6: PowerPC,e6500@12 { 104 110 device_type = "cpu"; 105 111 reg = <12 13>; 106 112 clocks = <&mux1>; 107 113 next-level-cache = <&L2_2>; 114 + fsl,portid-mapping = <0x40000000>; 108 115 }; 109 116 cpu7: PowerPC,e6500@14 { 110 117 device_type = "cpu"; 111 118 reg = <14 15>; 112 119 clocks = <&mux1>; 113 120 next-level-cache = <&L2_2>; 121 + fsl,portid-mapping = <0x40000000>; 114 122 }; 115 123 cpu8: PowerPC,e6500@16 { 116 124 device_type = "cpu"; 117 125 reg = <16 17>; 118 126 clocks = <&mux2>; 119 127 next-level-cache = <&L2_3>; 128 + fsl,portid-mapping = <0x20000000>; 120 129 }; 121 130 cpu9: PowerPC,e6500@18 { 122 131 device_type = "cpu"; 123 132 reg = <18 19>; 124 133 clocks = <&mux2>; 125 134 next-level-cache = <&L2_3>; 135 + fsl,portid-mapping = <0x20000000>; 126 136 }; 127 137 cpu10: PowerPC,e6500@20 { 128 138 device_type = "cpu"; 129 139 reg = <20 21>; 130 140 clocks = <&mux2>; 131 141 next-level-cache = <&L2_3>; 142 + fsl,portid-mapping = <0x20000000>; 132 143 }; 133 144 cpu11: PowerPC,e6500@22 { 134 145 device_type = "cpu"; 135 146 reg = <22 23>; 136 147 clocks = <&mux2>; 137 148 next-level-cache = <&L2_3>; 149 + fsl,portid-mapping = <0x20000000>; 138 150 }; 139 151 }; 140 152 };
+152
arch/powerpc/boot/dts/kmcoge4.dts
··· 1 + /* 2 + * Keymile kmcoge4 Device Tree Source, based on the P2041RDB DTS 3 + * 4 + * (C) Copyright 2014 5 + * Valentin Longchamp, Keymile AG, valentin.longchamp@keymile.com 6 + * 7 + * Copyright 2011 Freescale Semiconductor Inc. 8 + * 9 + * This program is free software; you can redistribute it and/or modify it 10 + * under the terms of the GNU General Public License as published by the 11 + * Free Software Foundation; either version 2 of the License, or (at your 12 + * option) any later version. 13 + */ 14 + 15 + /include/ "fsl/p2041si-pre.dtsi" 16 + 17 + / { 18 + model = "keymile,kmcoge4"; 19 + compatible = "keymile,kmcoge4", "keymile,kmp204x"; 20 + #address-cells = <2>; 21 + #size-cells = <2>; 22 + interrupt-parent = <&mpic>; 23 + 24 + memory { 25 + device_type = "memory"; 26 + }; 27 + 28 + dcsr: dcsr@f00000000 { 29 + ranges = <0x00000000 0xf 0x00000000 0x01008000>; 30 + }; 31 + 32 + soc: soc@ffe000000 { 33 + ranges = <0x00000000 0xf 0xfe000000 0x1000000>; 34 + reg = <0xf 0xfe000000 0 0x00001000>; 35 + spi@110000 { 36 + flash@0 { 37 + #address-cells = <1>; 38 + #size-cells = <1>; 39 + compatible = "spansion,s25fl256s1"; 40 + reg = <0>; 41 + spi-max-frequency = <20000000>; /* input clock */ 42 + }; 43 + 44 + network_clock@1 { 45 + compatible = "zarlink,zl30343"; 46 + reg = <1>; 47 + spi-max-frequency = <8000000>; 48 + }; 49 + 50 + flash@2 { 51 + #address-cells = <1>; 52 + #size-cells = <1>; 53 + compatible = "micron,m25p32"; 54 + reg = <2>; 55 + spi-max-frequency = <15000000>; 56 + }; 57 + }; 58 + 59 + i2c@119000 { 60 + status = "disabled"; 61 + }; 62 + 63 + i2c@119100 { 64 + status = "disabled"; 65 + }; 66 + 67 + usb0: usb@210000 { 68 + status = "disabled"; 69 + }; 70 + 71 + usb1: usb@211000 { 72 + status = "disabled"; 73 + }; 74 + 75 + sata@220000 { 76 + status = "disabled"; 77 + }; 78 + 79 + sata@221000 { 80 + status = "disabled"; 81 + }; 82 + }; 83 + 84 + rio: rapidio@ffe0c0000 { 85 + status = "disabled"; 86 + }; 87 + 88 + lbc: localbus@ffe124000 { 89 + reg = <0xf 0xfe124000 0 0x1000>; 90 + ranges = <0 0 0xf 0xffa00000 0x00040000 /* LB 0 */ 91 + 1 0 0xf 0xfb000000 0x00010000 /* LB 1 */ 92 + 2 0 0xf 0xd0000000 0x10000000 /* LB 2 */ 93 + 3 0 0xf 0xe0000000 0x10000000>; /* LB 3 */ 94 + 95 + nand@0,0 { 96 + #address-cells = <1>; 97 + #size-cells = <1>; 98 + compatible = "fsl,elbc-fcm-nand"; 99 + reg = <0 0 0x40000>; 100 + }; 101 + 102 + board-control@1,0 { 103 + compatible = "keymile,qriox"; 104 + reg = <1 0 0x80>; 105 + }; 106 + 107 + chassis-mgmt@3,0 { 108 + compatible = "keymile,bfticu"; 109 + interrupt-controller; 110 + #interrupt-cells = <2>; 111 + reg = <3 0 0x100>; 112 + interrupt-parent = <&mpic>; 113 + interrupts = <6 1 0 0>; 114 + }; 115 + }; 116 + 117 + pci0: pcie@ffe200000 { 118 + reg = <0xf 0xfe200000 0 0x1000>; 119 + ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 120 + 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; 121 + pcie@0 { 122 + ranges = <0x02000000 0 0xe0000000 123 + 0x02000000 0 0xe0000000 124 + 0 0x20000000 125 + 126 + 0x01000000 0 0x00000000 127 + 0x01000000 0 0x00000000 128 + 0 0x00010000>; 129 + }; 130 + }; 131 + 132 + pci1: pcie@ffe201000 { 133 + status = "disabled"; 134 + }; 135 + 136 + pci2: pcie@ffe202000 { 137 + reg = <0xf 0xfe202000 0 0x1000>; 138 + ranges = <0x02000000 0 0xe0000000 0xc 0x20000000 0 0x20000000 139 + 0x01000000 0 0x00000000 0xf 0xf8010000 0 0x00010000>; 140 + pcie@0 { 141 + ranges = <0x02000000 0 0xe0000000 142 + 0x02000000 0 0xe0000000 143 + 0 0x20000000 144 + 145 + 0x01000000 0 0x00000000 146 + 0x01000000 0 0x00000000 147 + 0 0x00010000>; 148 + }; 149 + }; 150 + }; 151 + 152 + /include/ "fsl/p2041si-post.dtsi"
+118
arch/powerpc/boot/dts/oca4080.dts
··· 1 + /* 2 + * OCA4080 Device Tree Source 3 + * 4 + * Copyright 2014 Prodrive Technologies B.V. 5 + * 6 + * Based on: 7 + * P4080DS Device Tree Source 8 + * Copyright 2009-2011 Freescale Semiconductor Inc. 9 + * 10 + * Redistribution and use in source and binary forms, with or without 11 + * modification, are permitted provided that the following conditions are met: 12 + * * Redistributions of source code must retain the above copyright 13 + * notice, this list of conditions and the following disclaimer. 14 + * * Redistributions in binary form must reproduce the above copyright 15 + * notice, this list of conditions and the following disclaimer in the 16 + * documentation and/or other materials provided with the distribution. 17 + * * Neither the name of Freescale Semiconductor nor the 18 + * names of its contributors may be used to endorse or promote products 19 + * derived from this software without specific prior written permission. 20 + * 21 + * 22 + * ALTERNATIVELY, this software may be distributed under the terms of the 23 + * GNU General Public License ("GPL") as published by the Free Software 24 + * Foundation, either version 2 of that License or (at your option) any 25 + * later version. 26 + * 27 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 28 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 31 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 + */ 38 + 39 + /include/ "fsl/p4080si-pre.dtsi" 40 + 41 + / { 42 + model = "fsl,OCA4080"; 43 + compatible = "fsl,OCA4080"; 44 + #address-cells = <2>; 45 + #size-cells = <2>; 46 + interrupt-parent = <&mpic>; 47 + 48 + memory { 49 + device_type = "memory"; 50 + }; 51 + 52 + dcsr: dcsr@f00000000 { 53 + ranges = <0x00000000 0xf 0x00000000 0x01008000>; 54 + }; 55 + 56 + soc: soc@ffe000000 { 57 + ranges = <0x00000000 0xf 0xfe000000 0x1000000>; 58 + reg = <0xf 0xfe000000 0 0x00001000>; 59 + 60 + i2c@118000 { 61 + status = "disabled"; 62 + }; 63 + 64 + i2c@118100 { 65 + status = "disabled"; 66 + }; 67 + 68 + i2c@119000 { 69 + status = "disabled"; 70 + }; 71 + 72 + i2c@119100 { 73 + status = "disabled"; 74 + }; 75 + 76 + usb0: usb@210000 { 77 + status = "disabled"; 78 + }; 79 + 80 + usb1: usb@211000 { 81 + status = "disabled"; 82 + }; 83 + }; 84 + 85 + rio: rapidio@ffe0c0000 { 86 + reg = <0xf 0xfe0c0000 0 0x11000>; 87 + 88 + port1 { 89 + ranges = <0 0 0xc 0x20000000 0 0x10000000>; 90 + }; 91 + }; 92 + 93 + lbc: localbus@ffe124000 { 94 + reg = <0xf 0xfe124000 0 0x1000>; 95 + ranges = <0 0 0xf 0xef800000 0x800000>; 96 + 97 + flash@0,0 { 98 + compatible = "cfi-flash"; 99 + reg = <0 0 0x00800000>; 100 + bank-width = <2>; 101 + device-width = <2>; 102 + }; 103 + }; 104 + 105 + pci0: pcie@ffe200000 { 106 + status = "disabled"; 107 + }; 108 + 109 + pci1: pcie@ffe201000 { 110 + status = "disabled"; 111 + }; 112 + 113 + pci2: pcie@ffe202000 { 114 + status = "disabled"; 115 + }; 116 + }; 117 + 118 + /include/ "fsl/p4080si-post.dtsi"
-219
arch/powerpc/boot/dts/p1023rds.dts
··· 1 - /* 2 - * P1023 RDS Device Tree Source 3 - * 4 - * Copyright 2010-2011 Freescale Semiconductor Inc. 5 - * 6 - * Author: Roy Zang <tie-fei.zang@freescale.com> 7 - * 8 - * Redistribution and use in source and binary forms, with or without 9 - * modification, are permitted provided that the following conditions are met: 10 - * * Redistributions of source code must retain the above copyright 11 - * notice, this list of conditions and the following disclaimer. 12 - * * Redistributions in binary form must reproduce the above copyright 13 - * notice, this list of conditions and the following disclaimer in the 14 - * documentation and/or other materials provided with the distribution. 15 - * * Neither the name of Freescale Semiconductor nor the 16 - * names of its contributors may be used to endorse or promote products 17 - * derived from this software without specific prior written permission. 18 - * 19 - * 20 - * ALTERNATIVELY, this software may be distributed under the terms of the 21 - * GNU General Public License ("GPL") as published by the Free Software 22 - * Foundation, either version 2 of that License or (at your option) any 23 - * later version. 24 - * 25 - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 26 - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 27 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 29 - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 30 - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 32 - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 34 - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 - */ 36 - 37 - /include/ "fsl/p1023si-pre.dtsi" 38 - 39 - / { 40 - model = "fsl,P1023"; 41 - compatible = "fsl,P1023RDS"; 42 - #address-cells = <2>; 43 - #size-cells = <2>; 44 - interrupt-parent = <&mpic>; 45 - 46 - memory { 47 - device_type = "memory"; 48 - }; 49 - 50 - soc: soc@ff600000 { 51 - ranges = <0x0 0x0 0xff600000 0x200000>; 52 - 53 - i2c@3000 { 54 - rtc@68 { 55 - compatible = "dallas,ds1374"; 56 - reg = <0x68>; 57 - }; 58 - }; 59 - 60 - spi@7000 { 61 - fsl_dataflash@0 { 62 - #address-cells = <1>; 63 - #size-cells = <1>; 64 - compatible = "atmel,at45db081d"; 65 - reg = <0>; 66 - spi-max-frequency = <40000000>; /* input clock */ 67 - partition@u-boot { 68 - /* 512KB for u-boot Bootloader Image */ 69 - label = "u-boot-spi"; 70 - reg = <0x00000000 0x00080000>; 71 - read-only; 72 - }; 73 - partition@dtb { 74 - /* 512KB for DTB Image */ 75 - label = "dtb-spi"; 76 - reg = <0x00080000 0x00080000>; 77 - read-only; 78 - }; 79 - }; 80 - }; 81 - 82 - usb@22000 { 83 - dr_mode = "host"; 84 - phy_type = "ulpi"; 85 - }; 86 - }; 87 - 88 - lbc: localbus@ff605000 { 89 - reg = <0 0xff605000 0 0x1000>; 90 - 91 - /* NOR Flash, BCSR */ 92 - ranges = <0x0 0x0 0x0 0xee000000 0x02000000 93 - 0x1 0x0 0x0 0xe0000000 0x00008000>; 94 - 95 - nor@0,0 { 96 - #address-cells = <1>; 97 - #size-cells = <1>; 98 - compatible = "cfi-flash"; 99 - reg = <0x0 0x0 0x02000000>; 100 - bank-width = <2>; 101 - device-width = <1>; 102 - partition@0 { 103 - label = "ramdisk"; 104 - reg = <0x00000000 0x01c00000>; 105 - }; 106 - partition@1c00000 { 107 - label = "kernel"; 108 - reg = <0x01c00000 0x002e0000>; 109 - }; 110 - partiton@1ee0000 { 111 - label = "dtb"; 112 - reg = <0x01ee0000 0x00020000>; 113 - }; 114 - partition@1f00000 { 115 - label = "firmware"; 116 - reg = <0x01f00000 0x00080000>; 117 - read-only; 118 - }; 119 - partition@1f80000 { 120 - label = "u-boot"; 121 - reg = <0x01f80000 0x00080000>; 122 - read-only; 123 - }; 124 - }; 125 - 126 - fpga@1,0 { 127 - #address-cells = <1>; 128 - #size-cells = <1>; 129 - compatible = "fsl,p1023rds-fpga"; 130 - reg = <1 0 0x8000>; 131 - ranges = <0 1 0 0x8000>; 132 - 133 - bcsr@20 { 134 - compatible = "fsl,p1023rds-bcsr"; 135 - reg = <0x20 0x20>; 136 - }; 137 - }; 138 - }; 139 - 140 - pci0: pcie@ff60a000 { 141 - reg = <0 0xff60a000 0 0x1000>; 142 - ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000 143 - 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>; 144 - pcie@0 { 145 - /* IRQ[0:3] are pulled up on board, set to active-low */ 146 - interrupt-map-mask = <0xf800 0 0 7>; 147 - interrupt-map = < 148 - /* IDSEL 0x0 */ 149 - 0000 0 0 1 &mpic 0 1 0 0 150 - 0000 0 0 2 &mpic 1 1 0 0 151 - 0000 0 0 3 &mpic 2 1 0 0 152 - 0000 0 0 4 &mpic 3 1 0 0 153 - >; 154 - ranges = <0x2000000 0x0 0xc0000000 155 - 0x2000000 0x0 0xc0000000 156 - 0x0 0x20000000 157 - 158 - 0x1000000 0x0 0x0 159 - 0x1000000 0x0 0x0 160 - 0x0 0x100000>; 161 - }; 162 - }; 163 - 164 - board_pci1: pci1: pcie@ff609000 { 165 - reg = <0 0xff609000 0 0x1000>; 166 - ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 167 - 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>; 168 - pcie@0 { 169 - /* 170 - * IRQ[4:6] only for PCIe, set to active-high, 171 - * IRQ[7] is pulled up on board, set to active-low 172 - */ 173 - interrupt-map-mask = <0xf800 0 0 7>; 174 - interrupt-map = < 175 - /* IDSEL 0x0 */ 176 - 0000 0 0 1 &mpic 4 2 0 0 177 - 0000 0 0 2 &mpic 5 2 0 0 178 - 0000 0 0 3 &mpic 6 2 0 0 179 - 0000 0 0 4 &mpic 7 1 0 0 180 - >; 181 - ranges = <0x2000000 0x0 0xa0000000 182 - 0x2000000 0x0 0xa0000000 183 - 0x0 0x20000000 184 - 185 - 0x1000000 0x0 0x0 186 - 0x1000000 0x0 0x0 187 - 0x0 0x100000>; 188 - }; 189 - }; 190 - 191 - pci2: pcie@ff60b000 { 192 - reg = <0 0xff60b000 0 0x1000>; 193 - ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000 194 - 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>; 195 - pcie@0 { 196 - /* 197 - * IRQ[8:10] are pulled up on board, set to active-low 198 - * IRQ[11] only for PCIe, set to active-high, 199 - */ 200 - interrupt-map-mask = <0xf800 0 0 7>; 201 - interrupt-map = < 202 - /* IDSEL 0x0 */ 203 - 0000 0 0 1 &mpic 8 1 0 0 204 - 0000 0 0 2 &mpic 9 1 0 0 205 - 0000 0 0 3 &mpic 10 1 0 0 206 - 0000 0 0 4 &mpic 11 2 0 0 207 - >; 208 - ranges = <0x2000000 0x0 0x80000000 209 - 0x2000000 0x0 0x80000000 210 - 0x0 0x20000000 211 - 212 - 0x1000000 0x0 0x0 213 - 0x1000000 0x0 0x0 214 - 0x0 0x100000>; 215 - }; 216 - }; 217 - }; 218 - 219 - /include/ "fsl/p1023si-post.dtsi"
+46
arch/powerpc/boot/dts/t1040qds.dts
··· 1 + /* 2 + * T1040QDS Device Tree Source 3 + * 4 + * Copyright 2013 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor "AS IS" AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + /include/ "fsl/t104xsi-pre.dtsi" 36 + /include/ "t104xqds.dtsi" 37 + 38 + / { 39 + model = "fsl,T1040QDS"; 40 + compatible = "fsl,T1040QDS"; 41 + #address-cells = <2>; 42 + #size-cells = <2>; 43 + interrupt-parent = <&mpic>; 44 + }; 45 + 46 + /include/ "fsl/t1040si-post.dtsi"
+46
arch/powerpc/boot/dts/t1042qds.dts
··· 1 + /* 2 + * T1042QDS Device Tree Source 3 + * 4 + * Copyright 2013 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor "AS IS" AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + /include/ "fsl/t104xsi-pre.dtsi" 36 + /include/ "t104xqds.dtsi" 37 + 38 + / { 39 + model = "fsl,T1042QDS"; 40 + compatible = "fsl,T1042QDS"; 41 + #address-cells = <2>; 42 + #size-cells = <2>; 43 + interrupt-parent = <&mpic>; 44 + }; 45 + 46 + /include/ "fsl/t1042si-post.dtsi"
+166
arch/powerpc/boot/dts/t104xqds.dtsi
··· 1 + /* 2 + * T104xQDS Device Tree Source 3 + * 4 + * Copyright 2013 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor "AS IS" AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + / { 36 + model = "fsl,T1040QDS"; 37 + #address-cells = <2>; 38 + #size-cells = <2>; 39 + interrupt-parent = <&mpic>; 40 + 41 + ifc: localbus@ffe124000 { 42 + reg = <0xf 0xfe124000 0 0x2000>; 43 + ranges = <0 0 0xf 0xe8000000 0x08000000 44 + 2 0 0xf 0xff800000 0x00010000 45 + 3 0 0xf 0xffdf0000 0x00008000>; 46 + 47 + nor@0,0 { 48 + #address-cells = <1>; 49 + #size-cells = <1>; 50 + compatible = "cfi-flash"; 51 + reg = <0x0 0x0 0x8000000>; 52 + 53 + bank-width = <2>; 54 + device-width = <1>; 55 + }; 56 + 57 + nand@2,0 { 58 + #address-cells = <1>; 59 + #size-cells = <1>; 60 + compatible = "fsl,ifc-nand"; 61 + reg = <0x2 0x0 0x10000>; 62 + }; 63 + 64 + board-control@3,0 { 65 + #address-cells = <1>; 66 + #size-cells = <1>; 67 + compatible = "fsl,fpga-qixis"; 68 + reg = <3 0 0x300>; 69 + }; 70 + }; 71 + 72 + memory { 73 + device_type = "memory"; 74 + }; 75 + 76 + dcsr: dcsr@f00000000 { 77 + ranges = <0x00000000 0xf 0x00000000 0x01072000>; 78 + }; 79 + 80 + soc: soc@ffe000000 { 81 + ranges = <0x00000000 0xf 0xfe000000 0x1000000>; 82 + reg = <0xf 0xfe000000 0 0x00001000>; 83 + 84 + spi@110000 { 85 + flash@0 { 86 + #address-cells = <1>; 87 + #size-cells = <1>; 88 + compatible = "micron,n25q128a11"; 89 + reg = <0>; 90 + spi-max-frequency = <10000000>; /* input clock */ 91 + }; 92 + }; 93 + 94 + i2c@118000 { 95 + pca9547@77 { 96 + compatible = "philips,pca9547"; 97 + reg = <0x77>; 98 + }; 99 + rtc@68 { 100 + compatible = "dallas,ds3232"; 101 + reg = <0x68>; 102 + interrupts = <0x1 0x1 0 0>; 103 + }; 104 + }; 105 + }; 106 + 107 + pci0: pcie@ffe240000 { 108 + reg = <0xf 0xfe240000 0 0x10000>; 109 + ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x10000000 110 + 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; 111 + pcie@0 { 112 + ranges = <0x02000000 0 0xe0000000 113 + 0x02000000 0 0xe0000000 114 + 0 0x10000000 115 + 116 + 0x01000000 0 0x00000000 117 + 0x01000000 0 0x00000000 118 + 0 0x00010000>; 119 + }; 120 + }; 121 + 122 + pci1: pcie@ffe250000 { 123 + reg = <0xf 0xfe250000 0 0x10000>; 124 + ranges = <0x02000000 0x0 0xe0000000 0xc 0x10000000 0x0 0x10000000 125 + 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; 126 + pcie@0 { 127 + ranges = <0x02000000 0 0xe0000000 128 + 0x02000000 0 0xe0000000 129 + 0 0x10000000 130 + 131 + 0x01000000 0 0x00000000 132 + 0x01000000 0 0x00000000 133 + 0 0x00010000>; 134 + }; 135 + }; 136 + 137 + pci2: pcie@ffe260000 { 138 + reg = <0xf 0xfe260000 0 0x10000>; 139 + ranges = <0x02000000 0 0xe0000000 0xc 0x20000000 0 0x10000000 140 + 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>; 141 + pcie@0 { 142 + ranges = <0x02000000 0 0xe0000000 143 + 0x02000000 0 0xe0000000 144 + 0 0x10000000 145 + 146 + 0x01000000 0 0x00000000 147 + 0x01000000 0 0x00000000 148 + 0 0x00010000>; 149 + }; 150 + }; 151 + 152 + pci3: pcie@ffe270000 { 153 + reg = <0xf 0xfe270000 0 0x10000>; 154 + ranges = <0x02000000 0 0xe0000000 0xc 0x30000000 0 0x10000000 155 + 0x01000000 0 0x00000000 0xf 0xf8030000 0 0x00010000>; 156 + pcie@0 { 157 + ranges = <0x02000000 0 0xe0000000 158 + 0x02000000 0 0xe0000000 159 + 0 0x10000000 160 + 161 + 0x01000000 0 0x00000000 162 + 0x01000000 0 0x00000000 163 + 0 0x00010000>; 164 + }; 165 + }; 166 + };
+14 -1
arch/powerpc/boot/dts/t4240emu.dts
··· 60 60 device_type = "cpu"; 61 61 reg = <0 1>; 62 62 next-level-cache = <&L2_1>; 63 + fsl,portid-mapping = <0x80000000>; 63 64 }; 64 65 cpu1: PowerPC,e6500@2 { 65 66 device_type = "cpu"; 66 67 reg = <2 3>; 67 68 next-level-cache = <&L2_1>; 69 + fsl,portid-mapping = <0x80000000>; 68 70 }; 69 71 cpu2: PowerPC,e6500@4 { 70 72 device_type = "cpu"; 71 73 reg = <4 5>; 72 74 next-level-cache = <&L2_1>; 75 + fsl,portid-mapping = <0x80000000>; 73 76 }; 74 77 cpu3: PowerPC,e6500@6 { 75 78 device_type = "cpu"; 76 79 reg = <6 7>; 77 80 next-level-cache = <&L2_1>; 81 + fsl,portid-mapping = <0x80000000>; 78 82 }; 79 83 80 84 cpu4: PowerPC,e6500@8 { 81 85 device_type = "cpu"; 82 86 reg = <8 9>; 83 87 next-level-cache = <&L2_2>; 88 + fsl,portid-mapping = <0x40000000>; 84 89 }; 85 90 cpu5: PowerPC,e6500@10 { 86 91 device_type = "cpu"; 87 92 reg = <10 11>; 88 93 next-level-cache = <&L2_2>; 94 + fsl,portid-mapping = <0x40000000>; 89 95 }; 90 96 cpu6: PowerPC,e6500@12 { 91 97 device_type = "cpu"; 92 98 reg = <12 13>; 93 99 next-level-cache = <&L2_2>; 100 + fsl,portid-mapping = <0x40000000>; 94 101 }; 95 102 cpu7: PowerPC,e6500@14 { 96 103 device_type = "cpu"; 97 104 reg = <14 15>; 98 105 next-level-cache = <&L2_2>; 106 + fsl,portid-mapping = <0x40000000>; 99 107 }; 100 108 101 109 cpu8: PowerPC,e6500@16 { 102 110 device_type = "cpu"; 103 111 reg = <16 17>; 104 112 next-level-cache = <&L2_3>; 113 + fsl,portid-mapping = <0x20000000>; 105 114 }; 106 115 cpu9: PowerPC,e6500@18 { 107 116 device_type = "cpu"; 108 117 reg = <18 19>; 109 118 next-level-cache = <&L2_3>; 119 + fsl,portid-mapping = <0x20000000>; 110 120 }; 111 121 cpu10: PowerPC,e6500@20 { 112 122 device_type = "cpu"; 113 123 reg = <20 21>; 114 124 next-level-cache = <&L2_3>; 125 + fsl,portid-mapping = <0x20000000>; 115 126 }; 116 127 cpu11: PowerPC,e6500@22 { 117 128 device_type = "cpu"; 118 129 reg = <22 23>; 119 130 next-level-cache = <&L2_3>; 131 + fsl,portid-mapping = <0x20000000>; 120 132 }; 121 133 }; 122 134 }; ··· 225 213 }; 226 214 227 215 corenet-cf@18000 { 228 - compatible = "fsl,corenet-cf"; 216 + compatible = "fsl,corenet2-cf", "fsl,corenet-cf"; 229 217 reg = <0x18000 0x1000>; 230 218 interrupts = <16 2 1 31>; 231 219 fsl,ccf-num-csdids = <32>; ··· 235 223 iommu@20000 { 236 224 compatible = "fsl,pamu-v1.0", "fsl,pamu"; 237 225 reg = <0x20000 0x6000>; 226 + fsl,portid-mapping = <0x8000>; 238 227 interrupts = < 239 228 24 2 0 0 240 229 16 2 1 30>;
+4
arch/powerpc/boot/elf_util.c
··· 26 26 elf64->e_ident[EI_MAG2] == ELFMAG2 && 27 27 elf64->e_ident[EI_MAG3] == ELFMAG3 && 28 28 elf64->e_ident[EI_CLASS] == ELFCLASS64 && 29 + #ifdef __LITTLE_ENDIAN__ 30 + elf64->e_ident[EI_DATA] == ELFDATA2LSB && 31 + #else 29 32 elf64->e_ident[EI_DATA] == ELFDATA2MSB && 33 + #endif 30 34 (elf64->e_type == ET_EXEC || 31 35 elf64->e_type == ET_DYN) && 32 36 elf64->e_machine == EM_PPC64))
+2 -2
arch/powerpc/boot/of.c
··· 40 40 #ifdef DEBUG 41 41 printf(" trying: 0x%08lx\n\r", claim_base); 42 42 #endif 43 - addr = (unsigned long)of_claim(claim_base, size, 0); 44 - if ((void *)addr != (void *)-1) 43 + addr = (unsigned long) of_claim(claim_base, size, 0); 44 + if (addr != PROM_ERROR) 45 45 break; 46 46 } 47 47 if (addr == 0)
+17 -2
arch/powerpc/boot/of.h
··· 1 1 #ifndef _PPC_BOOT_OF_H_ 2 2 #define _PPC_BOOT_OF_H_ 3 3 4 + #include "swab.h" 5 + 4 6 typedef void *phandle; 5 - typedef void *ihandle; 7 + typedef u32 ihandle; 6 8 7 9 void of_init(void *promptr); 8 10 int of_call_prom(const char *service, int nargs, int nret, ...); 9 - void *of_claim(unsigned long virt, unsigned long size, unsigned long align); 11 + unsigned int of_claim(unsigned long virt, unsigned long size, 12 + unsigned long align); 10 13 void *of_vmlinux_alloc(unsigned long size); 11 14 void of_exit(void); 12 15 void *of_finddevice(const char *name); ··· 20 17 21 18 /* Console functions */ 22 19 void of_console_init(void); 20 + 21 + typedef u32 __be32; 22 + 23 + #ifdef __LITTLE_ENDIAN__ 24 + #define cpu_to_be32(x) swab32(x) 25 + #define be32_to_cpu(x) swab32(x) 26 + #else 27 + #define cpu_to_be32(x) (x) 28 + #define be32_to_cpu(x) (x) 29 + #endif 30 + 31 + #define PROM_ERROR (-1u) 23 32 24 33 #endif /* _PPC_BOOT_OF_H_ */
+4 -2
arch/powerpc/boot/ofconsole.c
··· 18 18 19 19 #include "of.h" 20 20 21 - static void *of_stdout_handle; 21 + static unsigned int of_stdout_handle; 22 22 23 23 static int of_console_open(void) 24 24 { ··· 27 27 if (((devp = of_finddevice("/chosen")) != NULL) 28 28 && (of_getprop(devp, "stdout", &of_stdout_handle, 29 29 sizeof(of_stdout_handle)) 30 - == sizeof(of_stdout_handle))) 30 + == sizeof(of_stdout_handle))) { 31 + of_stdout_handle = be32_to_cpu(of_stdout_handle); 31 32 return 0; 33 + } 32 34 33 35 return -1; 34 36 }
+51 -41
arch/powerpc/boot/oflib.c
··· 16 16 17 17 #include "of.h" 18 18 19 + typedef u32 prom_arg_t; 20 + 21 + /* The following structure is used to communicate with open firmware. 22 + * All arguments in and out are in big endian format. */ 23 + struct prom_args { 24 + __be32 service; /* Address of service name string. */ 25 + __be32 nargs; /* Number of input arguments. */ 26 + __be32 nret; /* Number of output arguments. */ 27 + __be32 args[10]; /* Input/output arguments. */ 28 + }; 29 + 30 + #ifdef __powerpc64__ 31 + extern int prom(void *); 32 + #else 19 33 static int (*prom) (void *); 34 + #endif 20 35 21 36 void of_init(void *promptr) 22 37 { 38 + #ifndef __powerpc64__ 23 39 prom = (int (*)(void *))promptr; 40 + #endif 24 41 } 42 + 43 + #define ADDR(x) (u32)(unsigned long)(x) 25 44 26 45 int of_call_prom(const char *service, int nargs, int nret, ...) 27 46 { 28 47 int i; 29 - struct prom_args { 30 - const char *service; 31 - int nargs; 32 - int nret; 33 - unsigned int args[12]; 34 - } args; 48 + struct prom_args args; 35 49 va_list list; 36 50 37 - args.service = service; 38 - args.nargs = nargs; 39 - args.nret = nret; 51 + args.service = cpu_to_be32(ADDR(service)); 52 + args.nargs = cpu_to_be32(nargs); 53 + args.nret = cpu_to_be32(nret); 40 54 41 55 va_start(list, nret); 42 56 for (i = 0; i < nargs; i++) 43 - args.args[i] = va_arg(list, unsigned int); 57 + args.args[i] = cpu_to_be32(va_arg(list, prom_arg_t)); 44 58 va_end(list); 45 59 46 60 for (i = 0; i < nret; i++) 47 61 args.args[nargs+i] = 0; 48 62 49 63 if (prom(&args) < 0) 50 - return -1; 64 + return PROM_ERROR; 51 65 52 - return (nret > 0)? args.args[nargs]: 0; 66 + return (nret > 0) ? be32_to_cpu(args.args[nargs]) : 0; 53 67 } 54 68 55 69 static int of_call_prom_ret(const char *service, int nargs, int nret, 56 - unsigned int *rets, ...) 70 + prom_arg_t *rets, ...) 57 71 { 58 72 int i; 59 - struct prom_args { 60 - const char *service; 61 - int nargs; 62 - int nret; 63 - unsigned int args[12]; 64 - } args; 73 + struct prom_args args; 65 74 va_list list; 66 75 67 - args.service = service; 68 - args.nargs = nargs; 69 - args.nret = nret; 76 + args.service = cpu_to_be32(ADDR(service)); 77 + args.nargs = cpu_to_be32(nargs); 78 + args.nret = cpu_to_be32(nret); 70 79 71 80 va_start(list, rets); 72 81 for (i = 0; i < nargs; i++) 73 - args.args[i] = va_arg(list, unsigned int); 82 + args.args[i] = cpu_to_be32(va_arg(list, prom_arg_t)); 74 83 va_end(list); 75 84 76 85 for (i = 0; i < nret; i++) 77 86 args.args[nargs+i] = 0; 78 87 79 88 if (prom(&args) < 0) 80 - return -1; 89 + return PROM_ERROR; 81 90 82 - if (rets != (void *) 0) 91 + if (rets != NULL) 83 92 for (i = 1; i < nret; ++i) 84 - rets[i-1] = args.args[nargs+i]; 93 + rets[i-1] = be32_to_cpu(args.args[nargs+i]); 85 94 86 - return (nret > 0)? args.args[nargs]: 0; 95 + return (nret > 0) ? be32_to_cpu(args.args[nargs]) : 0; 87 96 } 88 97 89 98 /* returns true if s2 is a prefix of s1 */ ··· 112 103 */ 113 104 static int need_map = -1; 114 105 static ihandle chosen_mmu; 115 - static phandle memory; 106 + static ihandle memory; 116 107 117 108 static int check_of_version(void) 118 109 { ··· 141 132 printf("no mmu\n"); 142 133 return 0; 143 134 } 144 - memory = (ihandle) of_call_prom("open", 1, 1, "/memory"); 145 - if (memory == (ihandle) -1) { 146 - memory = (ihandle) of_call_prom("open", 1, 1, "/memory@0"); 147 - if (memory == (ihandle) -1) { 135 + memory = of_call_prom("open", 1, 1, "/memory"); 136 + if (memory == PROM_ERROR) { 137 + memory = of_call_prom("open", 1, 1, "/memory@0"); 138 + if (memory == PROM_ERROR) { 148 139 printf("no memory node\n"); 149 140 return 0; 150 141 } ··· 153 144 return 1; 154 145 } 155 146 156 - void *of_claim(unsigned long virt, unsigned long size, unsigned long align) 147 + unsigned int of_claim(unsigned long virt, unsigned long size, 148 + unsigned long align) 157 149 { 158 150 int ret; 159 - unsigned int result; 151 + prom_arg_t result; 160 152 161 153 if (need_map < 0) 162 154 need_map = check_of_version(); 163 155 if (align || !need_map) 164 - return (void *) of_call_prom("claim", 3, 1, virt, size, align); 156 + return of_call_prom("claim", 3, 1, virt, size, align); 165 157 166 158 ret = of_call_prom_ret("call-method", 5, 2, &result, "claim", memory, 167 159 align, size, virt); 168 160 if (ret != 0 || result == -1) 169 - return (void *) -1; 161 + return -1; 170 162 ret = of_call_prom_ret("call-method", 5, 2, &result, "claim", chosen_mmu, 171 163 align, size, virt); 172 164 /* 0x12 == coherent + read/write */ 173 165 ret = of_call_prom("call-method", 6, 1, "map", chosen_mmu, 174 166 0x12, size, virt, virt); 175 - return (void *) virt; 167 + return virt; 176 168 } 177 169 178 170 void *of_vmlinux_alloc(unsigned long size) 179 171 { 180 172 unsigned long start = (unsigned long)_start, end = (unsigned long)_end; 181 - void *addr; 173 + unsigned long addr; 182 174 void *p; 183 175 184 176 /* With some older POWER4 firmware we need to claim the area the kernel 185 177 * will reside in. Newer firmwares don't need this so we just ignore 186 178 * the return value. 187 179 */ 188 - addr = of_claim(start, end - start, 0); 189 - printf("Trying to claim from 0x%lx to 0x%lx (0x%lx) got %p\r\n", 180 + addr = (unsigned long) of_claim(start, end - start, 0); 181 + printf("Trying to claim from 0x%lx to 0x%lx (0x%lx) got %lx\r\n", 190 182 start, end, end - start, addr); 191 183 192 184 p = malloc(size); ··· 207 197 */ 208 198 void *of_finddevice(const char *name) 209 199 { 210 - return (phandle) of_call_prom("finddevice", 1, 1, name); 200 + return (void *) (unsigned long) of_call_prom("finddevice", 1, 1, name); 211 201 } 212 202 213 203 int of_getprop(const void *phandle, const char *name, void *buf,
+12
arch/powerpc/boot/ppc_asm.h
··· 62 62 #define SPRN_TBRL 268 63 63 #define SPRN_TBRU 269 64 64 65 + #define FIXUP_ENDIAN \ 66 + tdi 0, 0, 0x48; /* Reverse endian of b . + 8 */ \ 67 + b $+36; /* Skip trampoline if endian is good */ \ 68 + .long 0x05009f42; /* bcl 20,31,$+4 */ \ 69 + .long 0xa602487d; /* mflr r10 */ \ 70 + .long 0x1c004a39; /* addi r10,r10,28 */ \ 71 + .long 0xa600607d; /* mfmsr r11 */ \ 72 + .long 0x01006b69; /* xori r11,r11,1 */ \ 73 + .long 0xa6035a7d; /* mtsrr0 r10 */ \ 74 + .long 0xa6037b7d; /* mtsrr1 r11 */ \ 75 + .long 0x2400004c /* rfid */ 76 + 65 77 #endif /* _PPC64_PPC_ASM_H */
+8
arch/powerpc/boot/pseries-head.S
··· 1 + #include "ppc_asm.h" 2 + 3 + .text 4 + 5 + .globl _zimage_start 6 + _zimage_start: 7 + FIXUP_ENDIAN 8 + b _zimage_start_lib
+14
arch/powerpc/boot/stdio.c
··· 21 21 return sc - s; 22 22 } 23 23 24 + #ifdef __powerpc64__ 25 + 26 + # define do_div(n, base) ({ \ 27 + unsigned int __base = (base); \ 28 + unsigned int __rem; \ 29 + __rem = ((unsigned long long)(n)) % __base; \ 30 + (n) = ((unsigned long long)(n)) / __base; \ 31 + __rem; \ 32 + }) 33 + 34 + #else 35 + 24 36 extern unsigned int __div64_32(unsigned long long *dividend, 25 37 unsigned int divisor); 26 38 ··· 50 38 __rem = __div64_32(&(n), __base); \ 51 39 __rem; \ 52 40 }) 41 + 42 + #endif /* __powerpc64__ */ 53 43 54 44 static int skip_atoi(const char **s) 55 45 {
+29
arch/powerpc/boot/swab.h
··· 1 + #ifndef _PPC_BOOT_SWAB_H_ 2 + #define _PPC_BOOT_SWAB_H_ 3 + 4 + static inline u16 swab16(u16 x) 5 + { 6 + return ((x & (u16)0x00ffU) << 8) | 7 + ((x & (u16)0xff00U) >> 8); 8 + } 9 + 10 + static inline u32 swab32(u32 x) 11 + { 12 + return ((x & (u32)0x000000ffUL) << 24) | 13 + ((x & (u32)0x0000ff00UL) << 8) | 14 + ((x & (u32)0x00ff0000UL) >> 8) | 15 + ((x & (u32)0xff000000UL) >> 24); 16 + } 17 + 18 + static inline u64 swab64(u64 x) 19 + { 20 + return (u64)((x & (u64)0x00000000000000ffULL) << 56) | 21 + (u64)((x & (u64)0x000000000000ff00ULL) << 40) | 22 + (u64)((x & (u64)0x0000000000ff0000ULL) << 24) | 23 + (u64)((x & (u64)0x00000000ff000000ULL) << 8) | 24 + (u64)((x & (u64)0x000000ff00000000ULL) >> 8) | 25 + (u64)((x & (u64)0x0000ff0000000000ULL) >> 24) | 26 + (u64)((x & (u64)0x00ff000000000000ULL) >> 40) | 27 + (u64)((x & (u64)0xff00000000000000ULL) >> 56); 28 + } 29 + #endif /* _PPC_BOOT_SWAB_H_ */
+163
arch/powerpc/boot/treeboot-akebono.c
··· 1 + /* 2 + * Copyright © 2013 Tony Breeds IBM Corporation 3 + * Copyright © 2013 Alistair Popple IBM Corporation 4 + * 5 + * Based on earlier code: 6 + * Copyright (C) Paul Mackerras 1997. 7 + * 8 + * Matt Porter <mporter@kernel.crashing.org> 9 + * Copyright 2002-2005 MontaVista Software Inc. 10 + * 11 + * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> 12 + * Copyright (c) 2003, 2004 Zultys Technologies 13 + * 14 + * Copyright 2007 David Gibson, IBM Corporation. 15 + * Copyright 2010 Ben. Herrenschmidt, IBM Corporation. 16 + * Copyright © 2011 David Kleikamp IBM Corporation 17 + * 18 + * This program is free software; you can redistribute it and/or 19 + * modify it under the terms of the GNU General Public License 20 + * as published by the Free Software Foundation; either version 21 + * 2 of the License, or (at your option) any later version. 22 + */ 23 + #include <stdarg.h> 24 + #include <stddef.h> 25 + #include "types.h" 26 + #include "elf.h" 27 + #include "string.h" 28 + #include "stdlib.h" 29 + #include "stdio.h" 30 + #include "page.h" 31 + #include "ops.h" 32 + #include "reg.h" 33 + #include "io.h" 34 + #include "dcr.h" 35 + #include "4xx.h" 36 + #include "44x.h" 37 + #include "libfdt.h" 38 + 39 + BSS_STACK(4096); 40 + 41 + #define SPRN_PIR 0x11E /* Processor Indentification Register */ 42 + #define USERDATA_LEN 256 /* Length of userdata passed in by PIBS */ 43 + #define MAX_RANKS 0x4 44 + #define DDR3_MR0CF 0x80010011U 45 + #define CCTL0_MCO2 0x8000080FU 46 + #define CCTL0_MCO3 0x80000810U 47 + #define CCTL0_MCO4 0x80000811U 48 + #define CCTL0_MCO5 0x80000812U 49 + #define CCTL0_MCO6 0x80000813U 50 + 51 + static unsigned long long ibm_akebono_memsize; 52 + static long long unsigned mac_addr; 53 + 54 + static unsigned long long ibm_akebono_detect_memsize(void) 55 + { 56 + u32 reg; 57 + unsigned i; 58 + unsigned long long memsize = 0; 59 + 60 + for (i = 0; i < MAX_RANKS; i++) { 61 + reg = mfdcrx(DDR3_MR0CF + i); 62 + 63 + if (!(reg & 1)) 64 + continue; 65 + 66 + reg &= 0x0000f000; 67 + reg >>= 12; 68 + memsize += (0x800000ULL << reg); 69 + } 70 + 71 + return memsize; 72 + } 73 + 74 + static void ibm_akebono_fixups(void) 75 + { 76 + void *emac; 77 + u32 reg; 78 + 79 + dt_fixup_memory(0x0ULL, ibm_akebono_memsize); 80 + 81 + /* Fixup the SD timeout frequency */ 82 + mtdcrx(CCTL0_MCO4, 0x1); 83 + 84 + /* Disable SD high-speed mode (which seems to be broken) */ 85 + reg = mfdcrx(CCTL0_MCO2) & ~0x2; 86 + mtdcrx(CCTL0_MCO2, reg); 87 + 88 + /* Set the MAC address */ 89 + emac = finddevice("/plb/opb/ethernet"); 90 + if (emac > 0) { 91 + if (mac_addr) 92 + setprop(emac, "local-mac-address", 93 + ((u8 *) &mac_addr) + 2 , 6); 94 + } 95 + } 96 + 97 + void platform_init(char *userdata) 98 + { 99 + unsigned long end_of_ram, avail_ram; 100 + u32 pir_reg; 101 + int node, size; 102 + const u32 *timebase; 103 + int len, i, userdata_len; 104 + char *end; 105 + 106 + userdata[USERDATA_LEN - 1] = '\0'; 107 + userdata_len = strlen(userdata); 108 + for (i = 0; i < userdata_len - 15; i++) { 109 + if (strncmp(&userdata[i], "local-mac-addr=", 15) == 0) { 110 + if (i > 0 && userdata[i - 1] != ' ') { 111 + /* We've only found a substring ending 112 + * with local-mac-addr so this isn't 113 + * our mac address. */ 114 + continue; 115 + } 116 + 117 + mac_addr = strtoull(&userdata[i + 15], &end, 16); 118 + 119 + /* Remove the "local-mac-addr=<...>" from the kernel 120 + * command line, including the tailing space if 121 + * present. */ 122 + if (*end == ' ') 123 + end++; 124 + 125 + len = ((int) end) - ((int) &userdata[i]); 126 + memmove(&userdata[i], end, 127 + userdata_len - (len + i) + 1); 128 + break; 129 + } 130 + } 131 + 132 + loader_info.cmdline = userdata; 133 + loader_info.cmdline_len = 256; 134 + 135 + ibm_akebono_memsize = ibm_akebono_detect_memsize(); 136 + if (ibm_akebono_memsize >> 32) 137 + end_of_ram = ~0UL; 138 + else 139 + end_of_ram = ibm_akebono_memsize; 140 + avail_ram = end_of_ram - (unsigned long)_end; 141 + 142 + simple_alloc_init(_end, avail_ram, 128, 64); 143 + platform_ops.fixups = ibm_akebono_fixups; 144 + platform_ops.exit = ibm44x_dbcr_reset; 145 + pir_reg = mfspr(SPRN_PIR); 146 + 147 + /* Make sure FDT blob is sane */ 148 + if (fdt_check_header(_dtb_start) != 0) 149 + fatal("Invalid device tree blob\n"); 150 + 151 + node = fdt_node_offset_by_prop_value(_dtb_start, -1, "device_type", 152 + "cpu", sizeof("cpu")); 153 + if (!node) 154 + fatal("Cannot find cpu node\n"); 155 + timebase = fdt_getprop(_dtb_start, node, "timebase-frequency", &size); 156 + if (timebase && (size == 4)) 157 + timebase_period_ns = 1000000000 / *timebase; 158 + 159 + fdt_set_boot_cpuid_phys(_dtb_start, pir_reg); 160 + fdt_init(_dtb_start); 161 + 162 + serial_console_init(); 163 + }
+2 -2
arch/powerpc/boot/util.S
··· 45 45 mfspr r4,SPRN_PVR 46 46 srwi r4,r4,16 47 47 cmpwi 0,r4,1 /* 601 ? */ 48 - bne .udelay_not_601 48 + bne .Ludelay_not_601 49 49 00: li r0,86 /* Instructions / microsecond? */ 50 50 mtctr r0 51 51 10: addi r0,r0,0 /* NOP */ ··· 54 54 bne 00b 55 55 blr 56 56 57 - .udelay_not_601: 57 + .Ludelay_not_601: 58 58 mulli r4,r3,1000 /* nanoseconds */ 59 59 /* Change r4 to be the number of ticks using: 60 60 * (nanoseconds + (timebase_period_ns - 1 )) / timebase_period_ns
+18 -2
arch/powerpc/boot/wrapper
··· 40 40 binary= 41 41 gzip=.gz 42 42 pie= 43 + format= 43 44 44 45 # cross-compilation prefix 45 46 CROSS= ··· 137 136 kernel=vmlinux 138 137 fi 139 138 139 + elfformat="`${CROSS}objdump -p "$kernel" | grep 'file format' | awk '{print $4}'`" 140 + case "$elfformat" in 141 + elf64-powerpcle) format=elf64lppc ;; 142 + elf64-powerpc) format=elf32ppc ;; 143 + elf32-powerpc) format=elf32ppc ;; 144 + esac 145 + 146 + 140 147 platformo=$object/"$platform".o 141 148 lds=$object/zImage.lds 142 149 ext=strip ··· 161 152 make_space=n 162 153 ;; 163 154 pseries) 164 - platformo="$object/of.o $object/epapr.o" 155 + platformo="$object/pseries-head.o $object/of.o $object/epapr.o" 165 156 link_address='0x4000000' 157 + if [ "$format" != "elf32ppc" ]; then 158 + link_address= 159 + pie=-pie 160 + fi 166 161 make_space=n 167 162 ;; 168 163 maple) ··· 268 255 platformo="$object/$platform-head.o $object/$platform.o" 269 256 ;; 270 257 treeboot-currituck) 258 + link_address='0x1000000' 259 + ;; 260 + treeboot-akebono) 271 261 link_address='0x1000000' 272 262 ;; 273 263 treeboot-iss4xx-mpic) ··· 395 379 if [ -n "$link_address" ] ; then 396 380 text_start="-Ttext $link_address" 397 381 fi 398 - ${CROSS}ld -m elf32ppc -T $lds $text_start $pie -o "$ofile" \ 382 + ${CROSS}ld -m $format -T $lds $text_start $pie -o "$ofile" \ 399 383 $platformo $tmp $object/wrapper.a 400 384 rm $tmp 401 385 fi
+24 -1
arch/powerpc/boot/zImage.lds.S
··· 1 + #include <asm-generic/vmlinux.lds.h> 2 + 3 + #ifdef CONFIG_PPC64_BOOT_WRAPPER 4 + OUTPUT_ARCH(powerpc:common64) 5 + #else 1 6 OUTPUT_ARCH(powerpc:common) 7 + #endif 2 8 ENTRY(_zimage_start) 3 9 EXTERN(_zimage_start) 4 10 SECTIONS ··· 22 16 *(.rodata*) 23 17 *(.data*) 24 18 *(.sdata*) 19 + #ifndef CONFIG_PPC64_BOOT_WRAPPER 25 20 *(.got2) 21 + #endif 26 22 } 27 23 .dynsym : { *(.dynsym) } 28 24 .dynstr : { *(.dynstr) } ··· 35 27 } 36 28 .hash : { *(.hash) } 37 29 .interp : { *(.interp) } 38 - .rela.dyn : { *(.rela*) } 30 + .rela.dyn : 31 + { 32 + #ifdef CONFIG_PPC64_BOOT_WRAPPER 33 + __rela_dyn_start = .; 34 + #endif 35 + *(.rela*) 36 + } 39 37 40 38 . = ALIGN(8); 41 39 .kernel:dtb : ··· 66 52 *(.kernel:initrd) 67 53 _initrd_end = .; 68 54 } 55 + 56 + #ifdef CONFIG_PPC64_BOOT_WRAPPER 57 + .got : 58 + { 59 + __toc_start = .; 60 + *(.got) 61 + *(.toc) 62 + } 63 + #endif 69 64 70 65 . = ALIGN(4096); 71 66 .bss :
+148
arch/powerpc/configs/44x/akebono_defconfig
··· 1 + CONFIG_44x=y 2 + CONFIG_SMP=y 3 + CONFIG_SYSVIPC=y 4 + CONFIG_POSIX_MQUEUE=y 5 + CONFIG_LOG_BUF_SHIFT=14 6 + CONFIG_BLK_DEV_INITRD=y 7 + CONFIG_RD_BZIP2=y 8 + CONFIG_RD_LZMA=y 9 + CONFIG_RD_XZ=y 10 + CONFIG_EXPERT=y 11 + CONFIG_KALLSYMS_ALL=y 12 + # CONFIG_SLUB_CPU_PARTIAL is not set 13 + CONFIG_PROFILING=y 14 + CONFIG_OPROFILE=y 15 + CONFIG_MODULES=y 16 + CONFIG_MODULE_UNLOAD=y 17 + # CONFIG_BLK_DEV_BSG is not set 18 + # CONFIG_POWERNV_MSI is not set 19 + CONFIG_PPC_47x=y 20 + # CONFIG_EBONY is not set 21 + CONFIG_AKEBONO=y 22 + CONFIG_HIGHMEM=y 23 + CONFIG_HZ_100=y 24 + CONFIG_IRQ_ALL_CPUS=y 25 + # CONFIG_COMPACTION is not set 26 + CONFIG_CMDLINE_BOOL=y 27 + CONFIG_CMDLINE="" 28 + # CONFIG_SUSPEND is not set 29 + CONFIG_PCI_MSI=y 30 + CONFIG_NET=y 31 + CONFIG_PACKET=y 32 + CONFIG_UNIX=y 33 + CONFIG_INET=y 34 + CONFIG_IP_PNP=y 35 + CONFIG_IP_PNP_DHCP=y 36 + CONFIG_IP_PNP_BOOTP=y 37 + # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 38 + # CONFIG_INET_XFRM_MODE_TUNNEL is not set 39 + # CONFIG_INET_XFRM_MODE_BEET is not set 40 + # CONFIG_INET_LRO is not set 41 + # CONFIG_IPV6 is not set 42 + CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 43 + CONFIG_DEVTMPFS=y 44 + CONFIG_DEVTMPFS_MOUNT=y 45 + CONFIG_CONNECTOR=y 46 + CONFIG_MTD=y 47 + CONFIG_MTD_BLOCK=y 48 + CONFIG_MTD_JEDECPROBE=y 49 + CONFIG_MTD_CFI_AMDSTD=y 50 + CONFIG_MTD_PHYSMAP_OF=y 51 + CONFIG_PROC_DEVICETREE=y 52 + CONFIG_BLK_DEV_RAM=y 53 + CONFIG_BLK_DEV_RAM_SIZE=35000 54 + # CONFIG_SCSI_PROC_FS is not set 55 + CONFIG_BLK_DEV_SD=y 56 + # CONFIG_SCSI_LOWLEVEL is not set 57 + # CONFIG_SATA_PMP is not set 58 + # CONFIG_ATA_SFF is not set 59 + # CONFIG_NET_VENDOR_3COM is not set 60 + # CONFIG_NET_VENDOR_ADAPTEC is not set 61 + # CONFIG_NET_VENDOR_ALTEON is not set 62 + # CONFIG_NET_VENDOR_AMD is not set 63 + # CONFIG_NET_VENDOR_ARC is not set 64 + # CONFIG_NET_VENDOR_ATHEROS is not set 65 + # CONFIG_NET_CADENCE is not set 66 + # CONFIG_NET_VENDOR_BROADCOM is not set 67 + # CONFIG_NET_VENDOR_BROCADE is not set 68 + # CONFIG_NET_VENDOR_CHELSIO is not set 69 + # CONFIG_NET_VENDOR_CISCO is not set 70 + # CONFIG_NET_VENDOR_DEC is not set 71 + # CONFIG_NET_VENDOR_DLINK is not set 72 + # CONFIG_NET_VENDOR_EMULEX is not set 73 + # CONFIG_NET_VENDOR_EXAR is not set 74 + # CONFIG_NET_VENDOR_HP is not set 75 + CONFIG_IBM_EMAC=y 76 + # CONFIG_NET_VENDOR_MARVELL is not set 77 + # CONFIG_NET_VENDOR_MELLANOX is not set 78 + # CONFIG_NET_VENDOR_MICREL is not set 79 + # CONFIG_NET_VENDOR_MYRI is not set 80 + # CONFIG_NET_VENDOR_NATSEMI is not set 81 + # CONFIG_NET_VENDOR_NVIDIA is not set 82 + # CONFIG_NET_VENDOR_OKI is not set 83 + # CONFIG_NET_VENDOR_QLOGIC is not set 84 + # CONFIG_NET_VENDOR_REALTEK is not set 85 + # CONFIG_NET_VENDOR_RDC is not set 86 + # CONFIG_NET_VENDOR_SEEQ is not set 87 + # CONFIG_NET_VENDOR_SILAN is not set 88 + # CONFIG_NET_VENDOR_SIS is not set 89 + # CONFIG_NET_VENDOR_SMSC is not set 90 + # CONFIG_NET_VENDOR_STMICRO is not set 91 + # CONFIG_NET_VENDOR_SUN is not set 92 + # CONFIG_NET_VENDOR_TEHUTI is not set 93 + # CONFIG_NET_VENDOR_TI is not set 94 + # CONFIG_NET_VENDOR_VIA is not set 95 + # CONFIG_NET_VENDOR_WIZNET is not set 96 + # CONFIG_NET_VENDOR_XILINX is not set 97 + # CONFIG_KEYBOARD_ATKBD is not set 98 + # CONFIG_MOUSE_PS2 is not set 99 + # CONFIG_SERIO is not set 100 + # CONFIG_VT is not set 101 + CONFIG_SERIAL_8250=y 102 + # CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set 103 + CONFIG_SERIAL_8250_CONSOLE=y 104 + CONFIG_SERIAL_8250_EXTENDED=y 105 + CONFIG_SERIAL_8250_SHARE_IRQ=y 106 + CONFIG_SERIAL_OF_PLATFORM=y 107 + # CONFIG_HW_RANDOM is not set 108 + CONFIG_I2C_CHARDEV=y 109 + # CONFIG_HWMON is not set 110 + CONFIG_THERMAL=y 111 + # CONFIG_USB_DEFAULT_PERSIST is not set 112 + CONFIG_USB_EHCI_HCD=y 113 + CONFIG_USB_OHCI_HCD=y 114 + # CONFIG_USB_OHCI_HCD_PCI is not set 115 + CONFIG_USB_STORAGE=y 116 + CONFIG_MMC=y 117 + CONFIG_RTC_CLASS=y 118 + CONFIG_RTC_DRV_M41T80=y 119 + CONFIG_EXT2_FS=y 120 + CONFIG_EXT3_FS=y 121 + # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 122 + CONFIG_EXT3_FS_POSIX_ACL=y 123 + CONFIG_EXT3_FS_SECURITY=y 124 + # CONFIG_DNOTIFY is not set 125 + # CONFIG_INOTIFY_USER is not set 126 + CONFIG_VFAT_FS=y 127 + CONFIG_PROC_KCORE=y 128 + CONFIG_TMPFS=y 129 + CONFIG_CRAMFS=y 130 + # CONFIG_NETWORK_FILESYSTEMS is not set 131 + CONFIG_NLS_DEFAULT="n" 132 + CONFIG_NLS_CODEPAGE_437=y 133 + CONFIG_NLS_ISO8859_1=y 134 + CONFIG_DEBUG_INFO=y 135 + CONFIG_DEBUG_FS=y 136 + CONFIG_MAGIC_SYSRQ=y 137 + CONFIG_DETECT_HUNG_TASK=y 138 + CONFIG_XMON=y 139 + CONFIG_XMON_DEFAULT=y 140 + CONFIG_PPC_EARLY_DEBUG=y 141 + CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0x00010000 142 + CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x33f 143 + CONFIG_CRYPTO_PCBC=y 144 + CONFIG_CRYPTO_MD5=y 145 + CONFIG_CRYPTO_SHA1_PPC=y 146 + CONFIG_CRYPTO_DES=y 147 + # CONFIG_CRYPTO_ANSI_CPRNG is not set 148 + # CONFIG_CRYPTO_HW is not set
+225
arch/powerpc/configs/85xx/kmp204x_defconfig
··· 1 + CONFIG_PPC_85xx=y 2 + CONFIG_SMP=y 3 + CONFIG_NR_CPUS=8 4 + CONFIG_SYSVIPC=y 5 + CONFIG_POSIX_MQUEUE=y 6 + CONFIG_AUDIT=y 7 + CONFIG_NO_HZ=y 8 + CONFIG_HIGH_RES_TIMERS=y 9 + CONFIG_BSD_PROCESS_ACCT=y 10 + CONFIG_IKCONFIG=y 11 + CONFIG_IKCONFIG_PROC=y 12 + CONFIG_LOG_BUF_SHIFT=14 13 + CONFIG_CGROUPS=y 14 + CONFIG_CGROUP_SCHED=y 15 + CONFIG_RELAY=y 16 + CONFIG_BLK_DEV_INITRD=y 17 + CONFIG_KALLSYMS_ALL=y 18 + CONFIG_EMBEDDED=y 19 + CONFIG_PERF_EVENTS=y 20 + CONFIG_SLAB=y 21 + CONFIG_MODULES=y 22 + CONFIG_MODULE_UNLOAD=y 23 + CONFIG_MODULE_FORCE_UNLOAD=y 24 + CONFIG_MODVERSIONS=y 25 + # CONFIG_BLK_DEV_BSG is not set 26 + CONFIG_PARTITION_ADVANCED=y 27 + CONFIG_MAC_PARTITION=y 28 + CONFIG_CORENET_GENERIC=y 29 + CONFIG_MPIC_MSGR=y 30 + CONFIG_HIGHMEM=y 31 + # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 32 + CONFIG_BINFMT_MISC=m 33 + CONFIG_KEXEC=y 34 + CONFIG_FORCE_MAX_ZONEORDER=13 35 + CONFIG_PCI=y 36 + CONFIG_PCIEPORTBUS=y 37 + # CONFIG_PCIEASPM is not set 38 + CONFIG_PCI_MSI=y 39 + CONFIG_ADVANCED_OPTIONS=y 40 + CONFIG_LOWMEM_SIZE_BOOL=y 41 + CONFIG_LOWMEM_SIZE=0x20000000 42 + CONFIG_NET=y 43 + CONFIG_PACKET=y 44 + CONFIG_UNIX=y 45 + CONFIG_XFRM_USER=y 46 + CONFIG_XFRM_SUB_POLICY=y 47 + CONFIG_XFRM_STATISTICS=y 48 + CONFIG_NET_KEY=y 49 + CONFIG_NET_KEY_MIGRATE=y 50 + CONFIG_INET=y 51 + CONFIG_IP_MULTICAST=y 52 + CONFIG_IP_ADVANCED_ROUTER=y 53 + CONFIG_IP_MULTIPLE_TABLES=y 54 + CONFIG_IP_ROUTE_MULTIPATH=y 55 + CONFIG_IP_ROUTE_VERBOSE=y 56 + CONFIG_IP_PNP=y 57 + CONFIG_IP_PNP_DHCP=y 58 + CONFIG_IP_PNP_BOOTP=y 59 + CONFIG_IP_PNP_RARP=y 60 + CONFIG_NET_IPIP=y 61 + CONFIG_IP_MROUTE=y 62 + CONFIG_IP_PIMSM_V1=y 63 + CONFIG_IP_PIMSM_V2=y 64 + CONFIG_INET_AH=y 65 + CONFIG_INET_ESP=y 66 + CONFIG_INET_IPCOMP=y 67 + # CONFIG_INET_LRO is not set 68 + CONFIG_IPV6=y 69 + CONFIG_IP_SCTP=m 70 + CONFIG_TIPC=y 71 + CONFIG_NET_SCHED=y 72 + CONFIG_NET_SCH_CBQ=y 73 + CONFIG_NET_SCH_HTB=y 74 + CONFIG_NET_SCH_HFSC=y 75 + CONFIG_NET_SCH_PRIO=y 76 + CONFIG_NET_SCH_MULTIQ=y 77 + CONFIG_NET_SCH_RED=y 78 + CONFIG_NET_SCH_SFQ=y 79 + CONFIG_NET_SCH_TEQL=y 80 + CONFIG_NET_SCH_TBF=y 81 + CONFIG_NET_SCH_GRED=y 82 + CONFIG_NET_CLS_BASIC=y 83 + CONFIG_NET_CLS_TCINDEX=y 84 + CONFIG_NET_CLS_U32=y 85 + CONFIG_CLS_U32_PERF=y 86 + CONFIG_CLS_U32_MARK=y 87 + CONFIG_NET_CLS_FLOW=y 88 + CONFIG_NET_CLS_CGROUP=y 89 + CONFIG_UEVENT_HELPER_PATH="/sbin/mdev" 90 + CONFIG_DEVTMPFS=y 91 + CONFIG_MTD=y 92 + CONFIG_MTD_CMDLINE_PARTS=y 93 + CONFIG_MTD_BLOCK=y 94 + CONFIG_MTD_CFI=y 95 + CONFIG_MTD_CFI_AMDSTD=y 96 + CONFIG_MTD_PHYSMAP_OF=y 97 + CONFIG_MTD_M25P80=y 98 + CONFIG_MTD_PHRAM=y 99 + CONFIG_MTD_NAND=y 100 + CONFIG_MTD_NAND_ECC_BCH=y 101 + CONFIG_MTD_NAND_FSL_ELBC=y 102 + CONFIG_MTD_UBI=y 103 + CONFIG_MTD_UBI_GLUEBI=y 104 + CONFIG_BLK_DEV_LOOP=y 105 + CONFIG_BLK_DEV_RAM=y 106 + CONFIG_BLK_DEV_RAM_COUNT=2 107 + CONFIG_BLK_DEV_RAM_SIZE=2048 108 + CONFIG_EEPROM_AT24=y 109 + CONFIG_SCSI=y 110 + CONFIG_BLK_DEV_SD=y 111 + CONFIG_CHR_DEV_ST=y 112 + CONFIG_BLK_DEV_SR=y 113 + CONFIG_CHR_DEV_SG=y 114 + CONFIG_SCSI_MULTI_LUN=y 115 + CONFIG_SCSI_LOGGING=y 116 + CONFIG_SCSI_SYM53C8XX_2=y 117 + CONFIG_NETDEVICES=y 118 + # CONFIG_NET_VENDOR_3COM is not set 119 + # CONFIG_NET_VENDOR_ADAPTEC is not set 120 + # CONFIG_NET_VENDOR_ALTEON is not set 121 + # CONFIG_NET_VENDOR_AMD is not set 122 + # CONFIG_NET_VENDOR_ATHEROS is not set 123 + # CONFIG_NET_CADENCE is not set 124 + # CONFIG_NET_VENDOR_BROADCOM is not set 125 + # CONFIG_NET_VENDOR_BROCADE is not set 126 + # CONFIG_NET_VENDOR_CHELSIO is not set 127 + # CONFIG_NET_VENDOR_CISCO is not set 128 + # CONFIG_NET_VENDOR_DEC is not set 129 + # CONFIG_NET_VENDOR_DLINK is not set 130 + # CONFIG_NET_VENDOR_EMULEX is not set 131 + # CONFIG_NET_VENDOR_EXAR is not set 132 + CONFIG_FSL_PQ_MDIO=y 133 + CONFIG_FSL_XGMAC_MDIO=y 134 + # CONFIG_NET_VENDOR_HP is not set 135 + # CONFIG_NET_VENDOR_INTEL is not set 136 + # CONFIG_NET_VENDOR_MARVELL is not set 137 + # CONFIG_NET_VENDOR_MELLANOX is not set 138 + # CONFIG_NET_VENDOR_MICREL is not set 139 + # CONFIG_NET_VENDOR_MICROCHIP is not set 140 + # CONFIG_NET_VENDOR_MYRI is not set 141 + # CONFIG_NET_VENDOR_NATSEMI is not set 142 + # CONFIG_NET_VENDOR_NVIDIA is not set 143 + # CONFIG_NET_VENDOR_OKI is not set 144 + # CONFIG_NET_PACKET_ENGINE is not set 145 + # CONFIG_NET_VENDOR_QLOGIC is not set 146 + # CONFIG_NET_VENDOR_REALTEK is not set 147 + # CONFIG_NET_VENDOR_RDC is not set 148 + # CONFIG_NET_VENDOR_SEEQ is not set 149 + # CONFIG_NET_VENDOR_SILAN is not set 150 + # CONFIG_NET_VENDOR_SIS is not set 151 + # CONFIG_NET_VENDOR_SMSC is not set 152 + # CONFIG_NET_VENDOR_STMICRO is not set 153 + # CONFIG_NET_VENDOR_SUN is not set 154 + # CONFIG_NET_VENDOR_TEHUTI is not set 155 + # CONFIG_NET_VENDOR_TI is not set 156 + # CONFIG_NET_VENDOR_VIA is not set 157 + # CONFIG_NET_VENDOR_WIZNET is not set 158 + # CONFIG_NET_VENDOR_XILINX is not set 159 + CONFIG_MARVELL_PHY=y 160 + CONFIG_VITESSE_PHY=y 161 + CONFIG_FIXED_PHY=y 162 + # CONFIG_WLAN is not set 163 + # CONFIG_INPUT_MOUSEDEV is not set 164 + # CONFIG_INPUT_KEYBOARD is not set 165 + # CONFIG_INPUT_MOUSE is not set 166 + CONFIG_SERIO_LIBPS2=y 167 + # CONFIG_LEGACY_PTYS is not set 168 + CONFIG_PPC_EPAPR_HV_BYTECHAN=y 169 + CONFIG_SERIAL_8250=y 170 + CONFIG_SERIAL_8250_CONSOLE=y 171 + CONFIG_SERIAL_8250_MANY_PORTS=y 172 + CONFIG_SERIAL_8250_DETECT_IRQ=y 173 + CONFIG_SERIAL_8250_RSA=y 174 + CONFIG_NVRAM=y 175 + CONFIG_I2C=y 176 + CONFIG_I2C_CHARDEV=y 177 + CONFIG_I2C_MUX=y 178 + CONFIG_I2C_MUX_PCA954x=y 179 + CONFIG_I2C_MPC=y 180 + CONFIG_SPI=y 181 + CONFIG_SPI_FSL_SPI=y 182 + CONFIG_SPI_FSL_ESPI=y 183 + CONFIG_SPI_SPIDEV=m 184 + CONFIG_PTP_1588_CLOCK=y 185 + # CONFIG_HWMON is not set 186 + # CONFIG_USB_SUPPORT is not set 187 + CONFIG_EDAC=y 188 + CONFIG_EDAC_MM_EDAC=y 189 + CONFIG_EDAC_MPC85XX=y 190 + CONFIG_RTC_CLASS=y 191 + CONFIG_RTC_DRV_DS3232=y 192 + CONFIG_RTC_DRV_CMOS=y 193 + CONFIG_UIO=y 194 + CONFIG_STAGING=y 195 + # CONFIG_NET_VENDOR_SILICOM is not set 196 + CONFIG_CLK_PPC_CORENET=y 197 + CONFIG_EXT2_FS=y 198 + CONFIG_NTFS_FS=y 199 + CONFIG_PROC_KCORE=y 200 + CONFIG_TMPFS=y 201 + CONFIG_JFFS2_FS=y 202 + CONFIG_UBIFS_FS=y 203 + CONFIG_CRAMFS=y 204 + CONFIG_SQUASHFS=y 205 + CONFIG_SQUASHFS_XZ=y 206 + CONFIG_NFS_FS=y 207 + CONFIG_NFS_V4=y 208 + CONFIG_ROOT_NFS=y 209 + CONFIG_NLS_ISO8859_1=y 210 + CONFIG_NLS_UTF8=m 211 + CONFIG_CRC_ITU_T=m 212 + CONFIG_DEBUG_INFO=y 213 + CONFIG_MAGIC_SYSRQ=y 214 + CONFIG_DEBUG_SHIRQ=y 215 + CONFIG_DETECT_HUNG_TASK=y 216 + CONFIG_SCHEDSTATS=y 217 + CONFIG_RCU_TRACE=y 218 + CONFIG_UPROBE_EVENT=y 219 + CONFIG_CRYPTO_NULL=y 220 + CONFIG_CRYPTO_PCBC=m 221 + CONFIG_CRYPTO_MD4=y 222 + CONFIG_CRYPTO_SHA256=y 223 + CONFIG_CRYPTO_SHA512=y 224 + # CONFIG_CRYPTO_ANSI_CPRNG is not set 225 + CONFIG_CRYPTO_DEV_FSL_CAAM=y
+1
arch/powerpc/configs/corenet32_smp_defconfig
··· 72 72 CONFIG_MTD_CHAR=y 73 73 CONFIG_MTD_BLOCK=y 74 74 CONFIG_MTD_CFI=y 75 + CONFIG_MTD_CFI_INTELEXT=y 75 76 CONFIG_MTD_CFI_AMDSTD=y 76 77 CONFIG_MTD_PHYSMAP_OF=y 77 78 CONFIG_MTD_M25P80=y
-1
arch/powerpc/configs/mpc85xx_defconfig
··· 32 32 CONFIG_P1022_DS=y 33 33 CONFIG_P1022_RDK=y 34 34 CONFIG_P1023_RDB=y 35 - CONFIG_P1023_RDS=y 36 35 CONFIG_SOCRATES=y 37 36 CONFIG_KSI8560=y 38 37 CONFIG_XES_MPC85xx=y
-1
arch/powerpc/configs/mpc85xx_smp_defconfig
··· 35 35 CONFIG_P1022_DS=y 36 36 CONFIG_P1022_RDK=y 37 37 CONFIG_P1023_RDB=y 38 - CONFIG_P1023_RDS=y 39 38 CONFIG_SOCRATES=y 40 39 CONFIG_KSI8560=y 41 40 CONFIG_XES_MPC85xx=y
+36 -4
arch/powerpc/include/asm/code-patching.h
··· 42 42 } while (0) 43 43 #endif 44 44 45 + #define OP_RT_RA_MASK 0xffff0000UL 46 + #define LIS_R2 0x3c020000UL 47 + #define ADDIS_R2_R12 0x3c4c0000UL 48 + #define ADDI_R2_R2 0x38420000UL 49 + 45 50 static inline unsigned long ppc_function_entry(void *func) 46 51 { 47 - #ifdef CONFIG_PPC64 52 + #if defined(CONFIG_PPC64) 53 + #if defined(_CALL_ELF) && _CALL_ELF == 2 54 + u32 *insn = func; 55 + 48 56 /* 49 - * On PPC64 the function pointer actually points to the function's 50 - * descriptor. The first entry in the descriptor is the address 51 - * of the function text. 57 + * A PPC64 ABIv2 function may have a local and a global entry 58 + * point. We need to use the local entry point when patching 59 + * functions, so identify and step over the global entry point 60 + * sequence. 61 + * 62 + * The global entry point sequence is always of the form: 63 + * 64 + * addis r2,r12,XXXX 65 + * addi r2,r2,XXXX 66 + * 67 + * A linker optimisation may convert the addis to lis: 68 + * 69 + * lis r2,XXXX 70 + * addi r2,r2,XXXX 71 + */ 72 + if ((((*insn & OP_RT_RA_MASK) == ADDIS_R2_R12) || 73 + ((*insn & OP_RT_RA_MASK) == LIS_R2)) && 74 + ((*(insn+1) & OP_RT_RA_MASK) == ADDI_R2_R2)) 75 + return (unsigned long)(insn + 2); 76 + else 77 + return (unsigned long)func; 78 + #else 79 + /* 80 + * On PPC64 ABIv1 the function pointer actually points to the 81 + * function's descriptor. The first entry in the descriptor is the 82 + * address of the function text. 52 83 */ 53 84 return ((func_descr_t *)func)->entry; 85 + #endif 54 86 #else 55 87 return (unsigned long)func; 56 88 #endif
+2 -2
arch/powerpc/include/asm/context_tracking.h
··· 2 2 #define _ASM_POWERPC_CONTEXT_TRACKING_H 3 3 4 4 #ifdef CONFIG_CONTEXT_TRACKING 5 - #define SCHEDULE_USER bl .schedule_user 5 + #define SCHEDULE_USER bl schedule_user 6 6 #else 7 - #define SCHEDULE_USER bl .schedule 7 + #define SCHEDULE_USER bl schedule 8 8 #endif 9 9 10 10 #endif
+7
arch/powerpc/include/asm/cputhreads.h
··· 18 18 19 19 #ifdef CONFIG_SMP 20 20 extern int threads_per_core; 21 + extern int threads_per_subcore; 21 22 extern int threads_shift; 22 23 extern cpumask_t threads_core_mask; 23 24 #else 24 25 #define threads_per_core 1 26 + #define threads_per_subcore 1 25 27 #define threads_shift 0 26 28 #define threads_core_mask (CPU_MASK_CPU0) 27 29 #endif ··· 74 72 static inline int cpu_thread_in_core(int cpu) 75 73 { 76 74 return cpu & (threads_per_core - 1); 75 + } 76 + 77 + static inline int cpu_thread_in_subcore(int cpu) 78 + { 79 + return cpu & (threads_per_subcore - 1); 77 80 } 78 81 79 82 static inline int cpu_first_thread_sibling(int cpu)
+2 -1
arch/powerpc/include/asm/debug.h
··· 46 46 static inline int debugger_fault_handler(struct pt_regs *regs) { return 0; } 47 47 #endif 48 48 49 - int set_breakpoint(struct arch_hw_breakpoint *brk); 49 + void set_breakpoint(struct arch_hw_breakpoint *brk); 50 + void __set_breakpoint(struct arch_hw_breakpoint *brk); 50 51 #ifdef CONFIG_PPC_ADV_DEBUG_REGS 51 52 extern void do_send_trap(struct pt_regs *regs, unsigned long address, 52 53 unsigned long error_code, int signal_code, int brkpt);
+34 -12
arch/powerpc/include/asm/eeh.h
··· 32 32 33 33 #ifdef CONFIG_EEH 34 34 35 + /* EEH subsystem flags */ 36 + #define EEH_ENABLED 0x1 /* EEH enabled */ 37 + #define EEH_FORCE_DISABLED 0x2 /* EEH disabled */ 38 + #define EEH_PROBE_MODE_DEV 0x4 /* From PCI device */ 39 + #define EEH_PROBE_MODE_DEVTREE 0x8 /* From device tree */ 40 + 41 + /* 42 + * Delay for PE reset, all in ms 43 + * 44 + * PCI specification has reset hold time of 100 milliseconds. 45 + * We have 250 milliseconds here. The PCI bus settlement time 46 + * is specified as 1.5 seconds and we have 1.8 seconds. 47 + */ 48 + #define EEH_PE_RST_HOLD_TIME 250 49 + #define EEH_PE_RST_SETTLE_TIME 1800 50 + 35 51 /* 36 52 * The struct is used to trace PE related EEH functionality. 37 53 * In theory, there will have one instance of the struct to ··· 69 53 70 54 #define EEH_PE_ISOLATED (1 << 0) /* Isolated PE */ 71 55 #define EEH_PE_RECOVERING (1 << 1) /* Recovering PE */ 72 - #define EEH_PE_PHB_DEAD (1 << 2) /* Dead PHB */ 56 + #define EEH_PE_RESET (1 << 2) /* PE reset in progress */ 73 57 74 58 #define EEH_PE_KEEP (1 << 8) /* Keep PE on hotplug */ 75 59 ··· 108 92 109 93 #define EEH_DEV_NO_HANDLER (1 << 8) /* No error handler */ 110 94 #define EEH_DEV_SYSFS (1 << 9) /* Sysfs created */ 95 + #define EEH_DEV_REMOVED (1 << 10) /* Removed permanently */ 111 96 112 97 struct eeh_dev { 113 98 int mode; /* EEH mode */ ··· 116 99 int config_addr; /* Config address */ 117 100 int pe_config_addr; /* PE config address */ 118 101 u32 config_space[16]; /* Saved PCI config space */ 119 - u8 pcie_cap; /* Saved PCIe capability */ 102 + int pcix_cap; /* Saved PCIx capability */ 103 + int pcie_cap; /* Saved PCIe capability */ 104 + int aer_cap; /* Saved AER capability */ 120 105 struct eeh_pe *pe; /* Associated PE */ 121 106 struct list_head list; /* Form link list in the PE */ 122 107 struct pci_controller *phb; /* Associated PHB */ ··· 190 171 int (*restore_config)(struct device_node *dn); 191 172 }; 192 173 174 + extern int eeh_subsystem_flags; 193 175 extern struct eeh_ops *eeh_ops; 194 - extern bool eeh_subsystem_enabled; 195 176 extern raw_spinlock_t confirm_error_lock; 196 - extern int eeh_probe_mode; 197 177 198 178 static inline bool eeh_enabled(void) 199 179 { 200 - return eeh_subsystem_enabled; 180 + if ((eeh_subsystem_flags & EEH_FORCE_DISABLED) || 181 + !(eeh_subsystem_flags & EEH_ENABLED)) 182 + return false; 183 + 184 + return true; 201 185 } 202 186 203 187 static inline void eeh_set_enable(bool mode) 204 188 { 205 - eeh_subsystem_enabled = mode; 189 + if (mode) 190 + eeh_subsystem_flags |= EEH_ENABLED; 191 + else 192 + eeh_subsystem_flags &= ~EEH_ENABLED; 206 193 } 207 - 208 - #define EEH_PROBE_MODE_DEV (1<<0) /* From PCI device */ 209 - #define EEH_PROBE_MODE_DEVTREE (1<<1) /* From device tree */ 210 194 211 195 static inline void eeh_probe_mode_set(int flag) 212 196 { 213 - eeh_probe_mode = flag; 197 + eeh_subsystem_flags |= flag; 214 198 } 215 199 216 200 static inline int eeh_probe_mode_devtree(void) 217 201 { 218 - return (eeh_probe_mode == EEH_PROBE_MODE_DEVTREE); 202 + return (eeh_subsystem_flags & EEH_PROBE_MODE_DEVTREE); 219 203 } 220 204 221 205 static inline int eeh_probe_mode_dev(void) 222 206 { 223 - return (eeh_probe_mode == EEH_PROBE_MODE_DEV); 207 + return (eeh_subsystem_flags & EEH_PROBE_MODE_DEV); 224 208 } 225 209 226 210 static inline void eeh_serialize_lock(unsigned long *flags)
+2
arch/powerpc/include/asm/elf.h
··· 90 90 do { \ 91 91 if (((ex).e_flags & 0x3) == 2) \ 92 92 set_thread_flag(TIF_ELF2ABI); \ 93 + else \ 94 + clear_thread_flag(TIF_ELF2ABI); \ 93 95 if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \ 94 96 set_thread_flag(TIF_32BIT); \ 95 97 else \
+3 -3
arch/powerpc/include/asm/exception-64e.h
··· 174 174 mtlr r16; 175 175 #define TLB_MISS_STATS_D(name) \ 176 176 addi r9,r13,MMSTAT_DSTATS+name; \ 177 - bl .tlb_stat_inc; 177 + bl tlb_stat_inc; 178 178 #define TLB_MISS_STATS_I(name) \ 179 179 addi r9,r13,MMSTAT_ISTATS+name; \ 180 - bl .tlb_stat_inc; 180 + bl tlb_stat_inc; 181 181 #define TLB_MISS_STATS_X(name) \ 182 182 ld r8,PACA_EXTLB+EX_TLB_ESR(r13); \ 183 183 cmpdi cr2,r8,-1; \ ··· 185 185 addi r9,r13,MMSTAT_DSTATS+name; \ 186 186 b 62f; \ 187 187 61: addi r9,r13,MMSTAT_ISTATS+name; \ 188 - 62: bl .tlb_stat_inc; 188 + 62: bl tlb_stat_inc; 189 189 #define TLB_MISS_STATS_SAVE_INFO \ 190 190 std r14,EX_TLB_ESR(r12); /* save ESR */ 191 191 #define TLB_MISS_STATS_SAVE_INFO_BOLTED \
+1 -1
arch/powerpc/include/asm/exception-64s.h
··· 517 517 #define DISABLE_INTS RECONCILE_IRQ_STATE(r10,r11) 518 518 519 519 #define ADD_NVGPRS \ 520 - bl .save_nvgprs 520 + bl save_nvgprs 521 521 522 522 #define RUNLATCH_ON \ 523 523 BEGIN_FTR_SECTION \
+2
arch/powerpc/include/asm/ftrace.h
··· 61 61 #endif 62 62 63 63 #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_PPC64) && !defined(__ASSEMBLY__) 64 + #if !defined(_CALL_ELF) || _CALL_ELF != 2 64 65 #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME 65 66 static inline bool arch_syscall_match_sym_name(const char *sym, const char *name) 66 67 { ··· 73 72 */ 74 73 return !strcmp(sym + 4, name + 3); 75 74 } 75 + #endif 76 76 #endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_PPC64 && !__ASSEMBLY__ */ 77 77 78 78 #endif /* _ASM_POWERPC_FTRACE */
+1 -1
arch/powerpc/include/asm/hw_breakpoint.h
··· 79 79 brk.address = 0; 80 80 brk.type = 0; 81 81 brk.len = 0; 82 - set_breakpoint(&brk); 82 + __set_breakpoint(&brk); 83 83 } 84 84 extern void thread_change_pc(struct task_struct *tsk, struct pt_regs *regs); 85 85
+4 -4
arch/powerpc/include/asm/irqflags.h
··· 20 20 */ 21 21 #define TRACE_WITH_FRAME_BUFFER(func) \ 22 22 mflr r0; \ 23 - stdu r1, -32(r1); \ 23 + stdu r1, -STACK_FRAME_OVERHEAD(r1); \ 24 24 std r0, 16(r1); \ 25 - stdu r1, -32(r1); \ 25 + stdu r1, -STACK_FRAME_OVERHEAD(r1); \ 26 26 bl func; \ 27 27 ld r1, 0(r1); \ 28 28 ld r1, 0(r1); ··· 36 36 * have to call a C function so call a wrapper that saves all the 37 37 * C-clobbered registers. 38 38 */ 39 - #define TRACE_ENABLE_INTS TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_on) 40 - #define TRACE_DISABLE_INTS TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_off) 39 + #define TRACE_ENABLE_INTS TRACE_WITH_FRAME_BUFFER(trace_hardirqs_on) 40 + #define TRACE_DISABLE_INTS TRACE_WITH_FRAME_BUFFER(trace_hardirqs_off) 41 41 42 42 /* 43 43 * This is used by assembly code to soft-disable interrupts first and
+3 -2
arch/powerpc/include/asm/kprobes.h
··· 30 30 #include <linux/ptrace.h> 31 31 #include <linux/percpu.h> 32 32 #include <asm/probes.h> 33 + #include <asm/code-patching.h> 33 34 34 35 #define __ARCH_WANT_KPROBES_INSN_SLOT 35 36 ··· 57 56 if ((colon = strchr(name, ':')) != NULL) { \ 58 57 colon++; \ 59 58 if (*colon != '\0' && *colon != '.') \ 60 - addr = *(kprobe_opcode_t **)addr; \ 59 + addr = (kprobe_opcode_t *)ppc_function_entry(addr); \ 61 60 } else if (name[0] != '.') \ 62 - addr = *(kprobe_opcode_t **)addr; \ 61 + addr = (kprobe_opcode_t *)ppc_function_entry(addr); \ 63 62 } else { \ 64 63 char dot_name[KSYM_NAME_LEN]; \ 65 64 dot_name[0] = '.'; \
+7
arch/powerpc/include/asm/kvm_ppc.h
··· 337 337 vcpu->kvm->arch.kvm_ops->fast_vcpu_kick(vcpu); 338 338 } 339 339 340 + extern void kvm_hv_vm_activated(void); 341 + extern void kvm_hv_vm_deactivated(void); 342 + extern bool kvm_hv_mode_active(void); 343 + 340 344 #else 341 345 static inline void __init kvm_cma_reserve(void) 342 346 {} ··· 360 356 { 361 357 kvm_vcpu_kick(vcpu); 362 358 } 359 + 360 + static inline bool kvm_hv_mode_active(void) { return false; } 361 + 363 362 #endif 364 363 365 364 #ifdef CONFIG_KVM_XICS
+2
arch/powerpc/include/asm/linkage.h
··· 2 2 #define _ASM_POWERPC_LINKAGE_H 3 3 4 4 #ifdef CONFIG_PPC64 5 + #if !defined(_CALL_ELF) || _CALL_ELF != 2 5 6 #define cond_syscall(x) \ 6 7 asm ("\t.weak " #x "\n\t.set " #x ", sys_ni_syscall\n" \ 7 8 "\t.weak ." #x "\n\t.set ." #x ", .sys_ni_syscall\n") 8 9 #define SYSCALL_ALIAS(alias, name) \ 9 10 asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \ 10 11 "\t.globl ." #alias "\n\t.set ." #alias ", ." #name) 12 + #endif 11 13 #endif 12 14 13 15 #endif /* _ASM_POWERPC_LINKAGE_H */
+8
arch/powerpc/include/asm/machdep.h
··· 98 98 void (*iommu_save)(void); 99 99 void (*iommu_restore)(void); 100 100 #endif 101 + #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE 102 + unsigned long (*memory_block_size)(void); 103 + #endif 101 104 #endif /* CONFIG_PPC64 */ 102 105 103 106 void (*pci_dma_dev_setup)(struct pci_dev *dev); ··· 116 113 /* Optional, may be NULL. */ 117 114 void (*show_cpuinfo)(struct seq_file *m); 118 115 void (*show_percpuinfo)(struct seq_file *m, int i); 116 + /* Returns the current operating frequency of "cpu" in Hz */ 117 + unsigned long (*get_proc_freq)(unsigned int cpu); 119 118 120 119 void (*init_IRQ)(void); 121 120 ··· 245 240 246 241 /* Called during PCI resource reassignment */ 247 242 resource_size_t (*pcibios_window_alignment)(struct pci_bus *, unsigned long type); 243 + 244 + /* Reset the secondary bus of bridge */ 245 + void (*pcibios_reset_secondary_bus)(struct pci_dev *dev); 248 246 249 247 /* Called to shutdown machine specific hardware not already controlled 250 248 * by other drivers.
+4
arch/powerpc/include/asm/module.h
··· 35 35 #ifdef __powerpc64__ 36 36 unsigned int stubs_section; /* Index of stubs section in module */ 37 37 unsigned int toc_section; /* What section is the TOC? */ 38 + bool toc_fixed; /* Have we fixed up .TOC.? */ 38 39 #ifdef CONFIG_DYNAMIC_FTRACE 39 40 unsigned long toc; 40 41 unsigned long tramp; ··· 78 77 # endif /* MODULE */ 79 78 #endif 80 79 80 + bool is_module_trampoline(u32 *insns); 81 + int module_trampoline_target(struct module *mod, u32 *trampoline, 82 + unsigned long *target); 81 83 82 84 struct exception_table_entry; 83 85 void sort_ex_table(struct exception_table_entry *start,
+13 -5
arch/powerpc/include/asm/opal.h
··· 154 154 #define OPAL_LPC_READ 67 155 155 #define OPAL_LPC_WRITE 68 156 156 #define OPAL_RETURN_CPU 69 157 + #define OPAL_REINIT_CPUS 70 157 158 #define OPAL_ELOG_READ 71 158 159 #define OPAL_ELOG_WRITE 72 159 160 #define OPAL_ELOG_ACK 73 ··· 510 509 struct OpalMemoryErrorData { 511 510 enum OpalMemErr_Version version:8; /* 0x00 */ 512 511 enum OpalMemErrType type:8; /* 0x01 */ 513 - uint16_t flags; /* 0x02 */ 512 + __be16 flags; /* 0x02 */ 514 513 uint8_t reserved_1[4]; /* 0x04 */ 515 514 516 515 union { ··· 518 517 struct { 519 518 enum OpalMemErr_ResilErrType resil_err_type:8; 520 519 uint8_t reserved_1[7]; 521 - uint64_t physical_address_start; 522 - uint64_t physical_address_end; 520 + __be64 physical_address_start; 521 + __be64 physical_address_end; 523 522 } resilience; 524 523 /* Dynamic memory deallocation error info */ 525 524 struct { 526 525 enum OpalMemErr_DynErrType dyn_err_type:8; 527 526 uint8_t reserved_1[7]; 528 - uint64_t physical_address_start; 529 - uint64_t physical_address_end; 527 + __be64 physical_address_start; 528 + __be64 physical_address_end; 530 529 } dyn_dealloc; 531 530 } u; 532 531 }; ··· 726 725 uint64_t pestB[OPAL_PHB3_NUM_PEST_REGS]; 727 726 }; 728 727 728 + enum { 729 + OPAL_REINIT_CPUS_HILE_BE = (1 << 0), 730 + OPAL_REINIT_CPUS_HILE_LE = (1 << 1), 731 + }; 732 + 729 733 typedef struct oppanel_line { 730 734 const char * line; 731 735 uint64_t line_len; ··· 855 849 uint16_t *pci_error_type, uint16_t *severity); 856 850 int64_t opal_pci_poll(uint64_t phb_id); 857 851 int64_t opal_return_cpu(void); 852 + int64_t opal_reinit_cpus(uint64_t flags); 858 853 859 854 int64_t opal_xscom_read(uint32_t gcid, uint64_t pcb_addr, __be64 *val); 860 855 int64_t opal_xscom_write(uint32_t gcid, uint64_t pcb_addr, uint64_t val); ··· 923 916 extern unsigned long opal_get_boot_time(void); 924 917 extern void opal_nvram_init(void); 925 918 extern void opal_flash_init(void); 919 + extern void opal_flash_term_callback(void); 926 920 extern int opal_elog_init(void); 927 921 extern void opal_platform_dump_init(void); 928 922 extern void opal_sys_param_init(void);
+3
arch/powerpc/include/asm/paca.h
··· 92 92 struct slb_shadow *slb_shadow_ptr; 93 93 struct dtl_entry *dispatch_log; 94 94 struct dtl_entry *dispatch_log_end; 95 + #endif /* CONFIG_PPC_STD_MMU_64 */ 96 + u64 dscr_default; /* per-CPU default DSCR */ 95 97 98 + #ifdef CONFIG_PPC_STD_MMU_64 96 99 /* 97 100 * Now, starting in cacheline 2, the exception save areas 98 101 */
+1
arch/powerpc/include/asm/ppc-pci.h
··· 58 58 int rtas_read_config(struct pci_dn *, int where, int size, u32 *val); 59 59 void eeh_pe_state_mark(struct eeh_pe *pe, int state); 60 60 void eeh_pe_state_clear(struct eeh_pe *pe, int state); 61 + void eeh_pe_dev_mode_mark(struct eeh_pe *pe, int mode); 61 62 62 63 void eeh_sysfs_add_device(struct pci_dev *pdev); 63 64 void eeh_sysfs_remove_device(struct pci_dev *pdev);
+40 -36
arch/powerpc/include/asm/ppc_asm.h
··· 57 57 LDX_BE r10,0,r10; /* get log write index */ \ 58 58 cmpd cr1,r11,r10; \ 59 59 beq+ cr1,33f; \ 60 - bl .accumulate_stolen_time; \ 60 + bl accumulate_stolen_time; \ 61 61 ld r12,_MSR(r1); \ 62 62 andi. r10,r12,MSR_PR; /* Restore cr0 (coming from user) */ \ 63 63 33: \ ··· 189 189 #define __STK_REG(i) (112 + ((i)-14)*8) 190 190 #define STK_REG(i) __STK_REG(__REG_##i) 191 191 192 + #if defined(_CALL_ELF) && _CALL_ELF == 2 193 + #define STK_GOT 24 194 + #define __STK_PARAM(i) (32 + ((i)-3)*8) 195 + #else 196 + #define STK_GOT 40 192 197 #define __STK_PARAM(i) (48 + ((i)-3)*8) 198 + #endif 193 199 #define STK_PARAM(i) __STK_PARAM(__REG_##i) 200 + 201 + #if defined(_CALL_ELF) && _CALL_ELF == 2 202 + 203 + #define _GLOBAL(name) \ 204 + .section ".text"; \ 205 + .align 2 ; \ 206 + .type name,@function; \ 207 + .globl name; \ 208 + name: 209 + 210 + #define _GLOBAL_TOC(name) \ 211 + .section ".text"; \ 212 + .align 2 ; \ 213 + .type name,@function; \ 214 + .globl name; \ 215 + name: \ 216 + 0: addis r2,r12,(.TOC.-0b)@ha; \ 217 + addi r2,r2,(.TOC.-0b)@l; \ 218 + .localentry name,.-name 219 + 220 + #define _KPROBE(name) \ 221 + .section ".kprobes.text","a"; \ 222 + .align 2 ; \ 223 + .type name,@function; \ 224 + .globl name; \ 225 + name: 226 + 227 + #define DOTSYM(a) a 228 + 229 + #else 194 230 195 231 #define XGLUE(a,b) a##b 196 232 #define GLUE(a,b) XGLUE(a,b) ··· 245 209 .type GLUE(.,name),@function; \ 246 210 GLUE(.,name): 247 211 248 - #define _INIT_GLOBAL(name) \ 249 - __REF; \ 250 - .align 2 ; \ 251 - .globl name; \ 252 - .globl GLUE(.,name); \ 253 - .section ".opd","aw"; \ 254 - name: \ 255 - .quad GLUE(.,name); \ 256 - .quad .TOC.@tocbase; \ 257 - .quad 0; \ 258 - .previous; \ 259 - .type GLUE(.,name),@function; \ 260 - GLUE(.,name): 212 + #define _GLOBAL_TOC(name) _GLOBAL(name) 261 213 262 214 #define _KPROBE(name) \ 263 215 .section ".kprobes.text","a"; \ ··· 261 237 .type GLUE(.,name),@function; \ 262 238 GLUE(.,name): 263 239 264 - #define _STATIC(name) \ 265 - .section ".text"; \ 266 - .align 2 ; \ 267 - .section ".opd","aw"; \ 268 - name: \ 269 - .quad GLUE(.,name); \ 270 - .quad .TOC.@tocbase; \ 271 - .quad 0; \ 272 - .previous; \ 273 - .type GLUE(.,name),@function; \ 274 - GLUE(.,name): 240 + #define DOTSYM(a) GLUE(.,a) 275 241 276 - #define _INIT_STATIC(name) \ 277 - __REF; \ 278 - .align 2 ; \ 279 - .section ".opd","aw"; \ 280 - name: \ 281 - .quad GLUE(.,name); \ 282 - .quad .TOC.@tocbase; \ 283 - .quad 0; \ 284 - .previous; \ 285 - .type GLUE(.,name),@function; \ 286 - GLUE(.,name): 242 + #endif 287 243 288 244 #else /* 32-bit */ 289 245
+1 -1
arch/powerpc/include/asm/processor.h
··· 449 449 enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF}; 450 450 451 451 extern int powersave_nap; /* set if nap mode can be used in idle loop */ 452 - extern void power7_nap(void); 452 + extern void power7_nap(int check_irq); 453 453 extern void power7_sleep(void); 454 454 extern void flush_instruction_cache(void); 455 455 extern void hard_reset_now(void);
+10
arch/powerpc/include/asm/reg.h
··· 215 215 #define SPRN_TEXASR 0x82 /* Transaction EXception & Summary */ 216 216 #define TEXASR_FS __MASK(63-36) /* Transaction Failure Summary */ 217 217 #define SPRN_TEXASRU 0x83 /* '' '' '' Upper 32 */ 218 + #define TEXASR_FS __MASK(63-36) /* TEXASR Failure Summary */ 218 219 #define SPRN_TFHAR 0x80 /* Transaction Failure Handler Addr */ 219 220 #define SPRN_CTRLF 0x088 220 221 #define SPRN_CTRLT 0x098 ··· 225 224 #define CTRL_TE 0x00c00000 /* thread enable */ 226 225 #define CTRL_RUNLATCH 0x1 227 226 #define SPRN_DAWR 0xB4 227 + #define SPRN_RPR 0xBA /* Relative Priority Register */ 228 228 #define SPRN_CIABR 0xBB 229 229 #define CIABR_PRIV 0x3 230 230 #define CIABR_PRIV_USER 1 ··· 274 272 #define SPRN_HSRR1 0x13B /* Hypervisor Save/Restore 1 */ 275 273 #define SPRN_IC 0x350 /* Virtual Instruction Count */ 276 274 #define SPRN_VTB 0x351 /* Virtual Time Base */ 275 + #define SPRN_LDBAR 0x352 /* LD Base Address Register */ 277 276 #define SPRN_PMICR 0x354 /* Power Management Idle Control Reg */ 278 277 #define SPRN_PMSR 0x355 /* Power Management Status Reg */ 278 + #define SPRN_PMMAR 0x356 /* Power Management Memory Activity Register */ 279 279 #define SPRN_PMCR 0x374 /* Power Management Control Register */ 280 280 281 281 /* HFSCR and FSCR bit numbers are the same */ ··· 437 433 #define HID0_BTCD (1<<1) /* Branch target cache disable */ 438 434 #define HID0_NOPDST (1<<1) /* No-op dst, dstt, etc. instr. */ 439 435 #define HID0_NOPTI (1<<0) /* No-op dcbt and dcbst instr. */ 436 + /* POWER8 HID0 bits */ 437 + #define HID0_POWER8_4LPARMODE __MASK(61) 438 + #define HID0_POWER8_2LPARMODE __MASK(57) 439 + #define HID0_POWER8_1TO2LPAR __MASK(52) 440 + #define HID0_POWER8_1TO4LPAR __MASK(51) 441 + #define HID0_POWER8_DYNLPARDIS __MASK(48) 440 442 441 443 #define SPRN_HID1 0x3F1 /* Hardware Implementation Register 1 */ 442 444 #ifdef CONFIG_6xx
+2
arch/powerpc/include/asm/sections.h
··· 50 50 #endif 51 51 } 52 52 53 + #if !defined(_CALL_ELF) || _CALL_ELF != 2 53 54 #undef dereference_function_descriptor 54 55 static inline void *dereference_function_descriptor(void *ptr) 55 56 { ··· 61 60 ptr = p; 62 61 return ptr; 63 62 } 63 + #endif 64 64 65 65 #endif 66 66
-8
arch/powerpc/include/asm/smp.h
··· 68 68 void generic_set_cpu_dead(unsigned int cpu); 69 69 void generic_set_cpu_up(unsigned int cpu); 70 70 int generic_check_cpu_restart(unsigned int cpu); 71 - 72 - extern void inhibit_secondary_onlining(void); 73 - extern void uninhibit_secondary_onlining(void); 74 - 75 - #else /* HOTPLUG_CPU */ 76 - static inline void inhibit_secondary_onlining(void) {} 77 - static inline void uninhibit_secondary_onlining(void) {} 78 - 79 71 #endif 80 72 81 73 #ifdef CONFIG_PPC64
-4
arch/powerpc/include/asm/string.h
··· 10 10 #define __HAVE_ARCH_STRNCMP 11 11 #define __HAVE_ARCH_STRCAT 12 12 #define __HAVE_ARCH_MEMSET 13 - #ifdef __BIG_ENDIAN__ 14 13 #define __HAVE_ARCH_MEMCPY 15 - #endif 16 14 #define __HAVE_ARCH_MEMMOVE 17 15 #define __HAVE_ARCH_MEMCMP 18 16 #define __HAVE_ARCH_MEMCHR ··· 22 24 extern int strncmp(const char *, const char *, __kernel_size_t); 23 25 extern char * strcat(char *, const char *); 24 26 extern void * memset(void *,int,__kernel_size_t); 25 - #ifdef __BIG_ENDIAN__ 26 27 extern void * memcpy(void *,const void *,__kernel_size_t); 27 - #endif 28 28 extern void * memmove(void *,const void *,__kernel_size_t); 29 29 extern int memcmp(const void *,const void *,__kernel_size_t); 30 30 extern void * memchr(const void *,int,__kernel_size_t);
+4 -4
arch/powerpc/include/asm/systbl.h
··· 62 62 SYSCALL(ni_syscall) 63 63 SYSCALL_SPU(setpgid) 64 64 SYSCALL(ni_syscall) 65 - SYSX(sys_ni_syscall,sys_olduname, sys_olduname) 65 + SYSX(sys_ni_syscall,sys_olduname,sys_olduname) 66 66 SYSCALL_SPU(umask) 67 67 SYSCALL_SPU(chroot) 68 68 COMPAT_SYS(ustat) ··· 190 190 SYSCALL_SPU(capget) 191 191 SYSCALL_SPU(capset) 192 192 COMPAT_SYS(sigaltstack) 193 - COMPAT_SYS_SPU(sendfile) 193 + SYSX_SPU(sys_sendfile64,compat_sys_sendfile,sys_sendfile) 194 194 SYSCALL(ni_syscall) 195 195 SYSCALL(ni_syscall) 196 196 PPC_SYS(vfork) ··· 258 258 COMPAT_SYS_SPU(utimes) 259 259 COMPAT_SYS_SPU(statfs64) 260 260 COMPAT_SYS_SPU(fstatfs64) 261 - SYSX(sys_ni_syscall, ppc_fadvise64_64, ppc_fadvise64_64) 261 + SYSX(sys_ni_syscall,ppc_fadvise64_64,ppc_fadvise64_64) 262 262 PPC_SYS_SPU(rtas) 263 263 OLDSYS(debug_setcontext) 264 264 SYSCALL(ni_syscall) ··· 295 295 SYSCALL_SPU(mknodat) 296 296 SYSCALL_SPU(fchownat) 297 297 COMPAT_SYS_SPU(futimesat) 298 - SYSX_SPU(sys_newfstatat, sys_fstatat64, sys_fstatat64) 298 + SYSX_SPU(sys_newfstatat,sys_fstatat64,sys_fstatat64) 299 299 SYSCALL_SPU(unlinkat) 300 300 SYSCALL_SPU(renameat) 301 301 SYSCALL_SPU(linkat)
-13
arch/powerpc/include/asm/topology.h
··· 16 16 17 17 #include <asm/mmzone.h> 18 18 19 - static inline int cpu_to_node(int cpu) 20 - { 21 - int nid; 22 - 23 - nid = numa_cpu_lookup_table[cpu]; 24 - 25 - /* 26 - * During early boot, the numa-cpu lookup table might not have been 27 - * setup for all CPUs yet. In such cases, default to node 0. 28 - */ 29 - return (nid < 0) ? 0 : nid; 30 - } 31 - 32 19 #define parent_node(node) (node) 33 20 34 21 #define cpumask_of_node(node) ((node) == -1 ? \
-1
arch/powerpc/include/uapi/asm/Kbuild
··· 15 15 header-y += ipcbuf.h 16 16 header-y += kvm.h 17 17 header-y += kvm_para.h 18 - header-y += linkage.h 19 18 header-y += mman.h 20 19 header-y += msgbuf.h 21 20 header-y += nvram.h
+9 -1
arch/powerpc/include/uapi/asm/elf.h
··· 291 291 #define R_PPC64_DTPREL16_HIGHERA 104 /* half16 (sym+add)@dtprel@highera */ 292 292 #define R_PPC64_DTPREL16_HIGHEST 105 /* half16 (sym+add)@dtprel@highest */ 293 293 #define R_PPC64_DTPREL16_HIGHESTA 106 /* half16 (sym+add)@dtprel@highesta */ 294 + #define R_PPC64_TLSGD 107 295 + #define R_PPC64_TLSLD 108 296 + #define R_PPC64_TOCSAVE 109 297 + 298 + #define R_PPC64_REL16 249 299 + #define R_PPC64_REL16_LO 250 300 + #define R_PPC64_REL16_HI 251 301 + #define R_PPC64_REL16_HA 252 294 302 295 303 /* Keep this the last entry. */ 296 - #define R_PPC64_NUM 107 304 + #define R_PPC64_NUM 253 297 305 298 306 /* There's actually a third entry here, but it's unused */ 299 307 struct ppc64_opd_entry
+1
arch/powerpc/kernel/asm-offsets.c
··· 248 248 #endif 249 249 DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id)); 250 250 DEFINE(PACAKEXECSTATE, offsetof(struct paca_struct, kexec_state)); 251 + DEFINE(PACA_DSCR, offsetof(struct paca_struct, dscr_default)); 251 252 DEFINE(PACA_STARTTIME, offsetof(struct paca_struct, starttime)); 252 253 DEFINE(PACA_STARTTIME_USER, offsetof(struct paca_struct, starttime_user)); 253 254 DEFINE(PACA_USER_TIME, offsetof(struct paca_struct, user_time));
+14 -14
arch/powerpc/kernel/cpu_setup_fsl_booke.S
··· 94 94 _GLOBAL(__setup_cpu_e6500) 95 95 mflr r6 96 96 #ifdef CONFIG_PPC64 97 - bl .setup_altivec_ivors 97 + bl setup_altivec_ivors 98 98 /* Touch IVOR42 only if the CPU supports E.HV category */ 99 99 mfspr r10,SPRN_MMUCFG 100 100 rlwinm. r10,r10,0,MMUCFG_LPIDSIZE 101 101 beq 1f 102 - bl .setup_lrat_ivor 102 + bl setup_lrat_ivor 103 103 1: 104 104 #endif 105 105 bl setup_pw20_idle ··· 164 164 #ifdef CONFIG_PPC_BOOK3E_64 165 165 _GLOBAL(__restore_cpu_e6500) 166 166 mflr r5 167 - bl .setup_altivec_ivors 167 + bl setup_altivec_ivors 168 168 /* Touch IVOR42 only if the CPU supports E.HV category */ 169 169 mfspr r10,SPRN_MMUCFG 170 170 rlwinm. r10,r10,0,MMUCFG_LPIDSIZE 171 171 beq 1f 172 - bl .setup_lrat_ivor 172 + bl setup_lrat_ivor 173 173 1: 174 - bl .setup_pw20_idle 175 - bl .setup_altivec_idle 174 + bl setup_pw20_idle 175 + bl setup_altivec_idle 176 176 bl __restore_cpu_e5500 177 177 mtlr r5 178 178 blr ··· 181 181 mflr r4 182 182 bl __e500_icache_setup 183 183 bl __e500_dcache_setup 184 - bl .__setup_base_ivors 185 - bl .setup_perfmon_ivor 186 - bl .setup_doorbell_ivors 184 + bl __setup_base_ivors 185 + bl setup_perfmon_ivor 186 + bl setup_doorbell_ivors 187 187 /* 188 188 * We only want to touch IVOR38-41 if we're running on hardware 189 189 * that supports category E.HV. The architectural way to determine ··· 192 192 mfspr r10,SPRN_MMUCFG 193 193 rlwinm. r10,r10,0,MMUCFG_LPIDSIZE 194 194 beq 1f 195 - bl .setup_ehv_ivors 195 + bl setup_ehv_ivors 196 196 1: 197 197 mtlr r4 198 198 blr ··· 201 201 mflr r5 202 202 bl __e500_icache_setup 203 203 bl __e500_dcache_setup 204 - bl .__setup_base_ivors 205 - bl .setup_perfmon_ivor 206 - bl .setup_doorbell_ivors 204 + bl __setup_base_ivors 205 + bl setup_perfmon_ivor 206 + bl setup_doorbell_ivors 207 207 /* 208 208 * We only want to touch IVOR38-41 if we're running on hardware 209 209 * that supports category E.HV. The architectural way to determine ··· 212 212 mfspr r10,SPRN_MMUCFG 213 213 rlwinm. r10,r10,0,MMUCFG_LPIDSIZE 214 214 beq 1f 215 - bl .setup_ehv_ivors 215 + bl setup_ehv_ivors 216 216 b 2f 217 217 1: 218 218 ld r10,CPU_SPEC_FEATURES(r4)
+129 -81
arch/powerpc/kernel/eeh.c
··· 22 22 */ 23 23 24 24 #include <linux/delay.h> 25 + #include <linux/debugfs.h> 25 26 #include <linux/sched.h> 26 27 #include <linux/init.h> 27 28 #include <linux/list.h> ··· 36 35 #include <linux/of.h> 37 36 38 37 #include <linux/atomic.h> 38 + #include <asm/debug.h> 39 39 #include <asm/eeh.h> 40 40 #include <asm/eeh_event.h> 41 41 #include <asm/io.h> ··· 89 87 /* Time to wait for a PCI slot to report status, in milliseconds */ 90 88 #define PCI_BUS_RESET_WAIT_MSEC (5*60*1000) 91 89 90 + /* 91 + * EEH probe mode support, which is part of the flags, 92 + * is to support multiple platforms for EEH. Some platforms 93 + * like pSeries do PCI emunation based on device tree. 94 + * However, other platforms like powernv probe PCI devices 95 + * from hardware. The flag is used to distinguish that. 96 + * In addition, struct eeh_ops::probe would be invoked for 97 + * particular OF node or PCI device so that the corresponding 98 + * PE would be created there. 99 + */ 100 + int eeh_subsystem_flags; 101 + EXPORT_SYMBOL(eeh_subsystem_flags); 102 + 92 103 /* Platform dependent EEH operations */ 93 104 struct eeh_ops *eeh_ops = NULL; 94 - 95 - bool eeh_subsystem_enabled = false; 96 - EXPORT_SYMBOL(eeh_subsystem_enabled); 97 - 98 - /* 99 - * EEH probe mode support. The intention is to support multiple 100 - * platforms for EEH. Some platforms like pSeries do PCI emunation 101 - * based on device tree. However, other platforms like powernv probe 102 - * PCI devices from hardware. The flag is used to distinguish that. 103 - * In addition, struct eeh_ops::probe would be invoked for particular 104 - * OF node or PCI device so that the corresponding PE would be created 105 - * there. 106 - */ 107 - int eeh_probe_mode; 108 105 109 106 /* Lock to avoid races due to multiple reports of an error */ 110 107 DEFINE_RAW_SPINLOCK(confirm_error_lock); ··· 134 133 135 134 #define IS_BRIDGE(class_code) (((class_code)<<16) == PCI_BASE_CLASS_BRIDGE) 136 135 136 + static int __init eeh_setup(char *str) 137 + { 138 + if (!strcmp(str, "off")) 139 + eeh_subsystem_flags |= EEH_FORCE_DISABLED; 140 + 141 + return 1; 142 + } 143 + __setup("eeh=", eeh_setup); 144 + 137 145 /** 138 146 * eeh_gather_pci_data - Copy assorted PCI config space registers to buff 139 147 * @edev: device to report data for ··· 155 145 static size_t eeh_gather_pci_data(struct eeh_dev *edev, char * buf, size_t len) 156 146 { 157 147 struct device_node *dn = eeh_dev_to_of_node(edev); 158 - struct pci_dev *dev = eeh_dev_to_pci_dev(edev); 159 148 u32 cfg; 160 149 int cap, i; 161 150 int n = 0; 162 151 163 152 n += scnprintf(buf+n, len-n, "%s\n", dn->full_name); 164 - printk(KERN_WARNING "EEH: of node=%s\n", dn->full_name); 153 + pr_warn("EEH: of node=%s\n", dn->full_name); 165 154 166 155 eeh_ops->read_config(dn, PCI_VENDOR_ID, 4, &cfg); 167 156 n += scnprintf(buf+n, len-n, "dev/vend:%08x\n", cfg); 168 - printk(KERN_WARNING "EEH: PCI device/vendor: %08x\n", cfg); 157 + pr_warn("EEH: PCI device/vendor: %08x\n", cfg); 169 158 170 159 eeh_ops->read_config(dn, PCI_COMMAND, 4, &cfg); 171 160 n += scnprintf(buf+n, len-n, "cmd/stat:%x\n", cfg); 172 - printk(KERN_WARNING "EEH: PCI cmd/status register: %08x\n", cfg); 173 - 174 - if (!dev) { 175 - printk(KERN_WARNING "EEH: no PCI device for this of node\n"); 176 - return n; 177 - } 161 + pr_warn("EEH: PCI cmd/status register: %08x\n", cfg); 178 162 179 163 /* Gather bridge-specific registers */ 180 - if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) { 164 + if (edev->mode & EEH_DEV_BRIDGE) { 181 165 eeh_ops->read_config(dn, PCI_SEC_STATUS, 2, &cfg); 182 166 n += scnprintf(buf+n, len-n, "sec stat:%x\n", cfg); 183 - printk(KERN_WARNING "EEH: Bridge secondary status: %04x\n", cfg); 167 + pr_warn("EEH: Bridge secondary status: %04x\n", cfg); 184 168 185 169 eeh_ops->read_config(dn, PCI_BRIDGE_CONTROL, 2, &cfg); 186 170 n += scnprintf(buf+n, len-n, "brdg ctl:%x\n", cfg); 187 - printk(KERN_WARNING "EEH: Bridge control: %04x\n", cfg); 171 + pr_warn("EEH: Bridge control: %04x\n", cfg); 188 172 } 189 173 190 174 /* Dump out the PCI-X command and status regs */ 191 - cap = pci_find_capability(dev, PCI_CAP_ID_PCIX); 175 + cap = edev->pcix_cap; 192 176 if (cap) { 193 177 eeh_ops->read_config(dn, cap, 4, &cfg); 194 178 n += scnprintf(buf+n, len-n, "pcix-cmd:%x\n", cfg); 195 - printk(KERN_WARNING "EEH: PCI-X cmd: %08x\n", cfg); 179 + pr_warn("EEH: PCI-X cmd: %08x\n", cfg); 196 180 197 181 eeh_ops->read_config(dn, cap+4, 4, &cfg); 198 182 n += scnprintf(buf+n, len-n, "pcix-stat:%x\n", cfg); 199 - printk(KERN_WARNING "EEH: PCI-X status: %08x\n", cfg); 183 + pr_warn("EEH: PCI-X status: %08x\n", cfg); 200 184 } 201 185 202 - /* If PCI-E capable, dump PCI-E cap 10, and the AER */ 203 - if (pci_is_pcie(dev)) { 186 + /* If PCI-E capable, dump PCI-E cap 10 */ 187 + cap = edev->pcie_cap; 188 + if (cap) { 204 189 n += scnprintf(buf+n, len-n, "pci-e cap10:\n"); 205 - printk(KERN_WARNING 206 - "EEH: PCI-E capabilities and status follow:\n"); 190 + pr_warn("EEH: PCI-E capabilities and status follow:\n"); 207 191 208 192 for (i=0; i<=8; i++) { 209 - eeh_ops->read_config(dn, dev->pcie_cap+4*i, 4, &cfg); 193 + eeh_ops->read_config(dn, cap+4*i, 4, &cfg); 210 194 n += scnprintf(buf+n, len-n, "%02x:%x\n", 4*i, cfg); 211 - printk(KERN_WARNING "EEH: PCI-E %02x: %08x\n", i, cfg); 195 + pr_warn("EEH: PCI-E %02x: %08x\n", i, cfg); 212 196 } 197 + } 213 198 214 - cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); 215 - if (cap) { 216 - n += scnprintf(buf+n, len-n, "pci-e AER:\n"); 217 - printk(KERN_WARNING 218 - "EEH: PCI-E AER capability register set follows:\n"); 199 + /* If AER capable, dump it */ 200 + cap = edev->aer_cap; 201 + if (cap) { 202 + n += scnprintf(buf+n, len-n, "pci-e AER:\n"); 203 + pr_warn("EEH: PCI-E AER capability register set follows:\n"); 219 204 220 - for (i=0; i<14; i++) { 221 - eeh_ops->read_config(dn, cap+4*i, 4, &cfg); 222 - n += scnprintf(buf+n, len-n, "%02x:%x\n", 4*i, cfg); 223 - printk(KERN_WARNING "EEH: PCI-E AER %02x: %08x\n", i, cfg); 224 - } 205 + for (i=0; i<14; i++) { 206 + eeh_ops->read_config(dn, cap+4*i, 4, &cfg); 207 + n += scnprintf(buf+n, len-n, "%02x:%x\n", 4*i, cfg); 208 + pr_warn("EEH: PCI-E AER %02x: %08x\n", i, cfg); 225 209 } 226 210 } 227 211 ··· 236 232 { 237 233 size_t loglen = 0; 238 234 struct eeh_dev *edev, *tmp; 239 - bool valid_cfg_log = true; 240 235 241 236 /* 242 237 * When the PHB is fenced or dead, it's pointless to collect 243 238 * the data from PCI config space because it should return 244 239 * 0xFF's. For ER, we still retrieve the data from the PCI 245 240 * config space. 241 + * 242 + * For pHyp, we have to enable IO for log retrieval. Otherwise, 243 + * 0xFF's is always returned from PCI config space. 246 244 */ 247 - if (eeh_probe_mode_dev() && 248 - (pe->type & EEH_PE_PHB) && 249 - (pe->state & (EEH_PE_ISOLATED | EEH_PE_PHB_DEAD))) 250 - valid_cfg_log = false; 251 - 252 - if (valid_cfg_log) { 253 - eeh_pci_enable(pe, EEH_OPT_THAW_MMIO); 245 + if (!(pe->type & EEH_PE_PHB)) { 246 + if (eeh_probe_mode_devtree()) 247 + eeh_pci_enable(pe, EEH_OPT_THAW_MMIO); 254 248 eeh_ops->configure_bridge(pe); 255 249 eeh_pe_restore_bars(pe); 256 250 ··· 311 309 312 310 /* If the PHB has been in problematic state */ 313 311 eeh_serialize_lock(&flags); 314 - if (phb_pe->state & (EEH_PE_ISOLATED | EEH_PE_PHB_DEAD)) { 312 + if (phb_pe->state & EEH_PE_ISOLATED) { 315 313 ret = 0; 316 314 goto out; 317 315 } ··· 517 515 */ 518 516 int eeh_pci_enable(struct eeh_pe *pe, int function) 519 517 { 520 - int rc; 518 + int rc, flags = (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE); 519 + 520 + /* 521 + * pHyp doesn't allow to enable IO or DMA on unfrozen PE. 522 + * Also, it's pointless to enable them on unfrozen PE. So 523 + * we have the check here. 524 + */ 525 + if (function == EEH_OPT_THAW_MMIO || 526 + function == EEH_OPT_THAW_DMA) { 527 + rc = eeh_ops->get_state(pe, NULL); 528 + if (rc < 0) 529 + return rc; 530 + 531 + /* Needn't to enable or already enabled */ 532 + if ((rc == EEH_STATE_NOT_SUPPORT) || 533 + ((rc & flags) == flags)) 534 + return 0; 535 + } 521 536 522 537 rc = eeh_ops->set_option(pe, function); 523 538 if (rc) 524 - pr_warning("%s: Unexpected state change %d on PHB#%d-PE#%x, err=%d\n", 525 - __func__, function, pe->phb->global_number, pe->addr, rc); 539 + pr_warn("%s: Unexpected state change %d on " 540 + "PHB#%d-PE#%x, err=%d\n", 541 + __func__, function, pe->phb->global_number, 542 + pe->addr, rc); 526 543 527 544 rc = eeh_ops->wait_state(pe, PCI_BUS_RESET_WAIT_MSEC); 528 - if (rc > 0 && (rc & EEH_STATE_MMIO_ENABLED) && 529 - (function == EEH_OPT_THAW_MMIO)) 545 + if (rc <= 0) 546 + return rc; 547 + 548 + if ((function == EEH_OPT_THAW_MMIO) && 549 + (rc & EEH_STATE_MMIO_ENABLED)) 550 + return 0; 551 + 552 + if ((function == EEH_OPT_THAW_DMA) && 553 + (rc & EEH_STATE_DMA_ENABLED)) 530 554 return 0; 531 555 532 556 return rc; ··· 640 612 else 641 613 eeh_ops->reset(pe, EEH_RESET_HOT); 642 614 643 - /* The PCI bus requires that the reset be held high for at least 644 - * a 100 milliseconds. We wait a bit longer 'just in case'. 645 - */ 646 - #define PCI_BUS_RST_HOLD_TIME_MSEC 250 647 - msleep(PCI_BUS_RST_HOLD_TIME_MSEC); 648 - 649 - /* We might get hit with another EEH freeze as soon as the 650 - * pci slot reset line is dropped. Make sure we don't miss 651 - * these, and clear the flag now. 652 - */ 653 - eeh_pe_state_clear(pe, EEH_PE_ISOLATED); 654 - 655 615 eeh_ops->reset(pe, EEH_RESET_DEACTIVATE); 656 - 657 - /* After a PCI slot has been reset, the PCI Express spec requires 658 - * a 1.5 second idle time for the bus to stabilize, before starting 659 - * up traffic. 660 - */ 661 - #define PCI_BUS_SETTLE_TIME_MSEC 1800 662 - msleep(PCI_BUS_SETTLE_TIME_MSEC); 663 616 } 664 617 665 618 /** ··· 660 651 for (i=0; i<3; i++) { 661 652 eeh_reset_pe_once(pe); 662 653 654 + /* 655 + * EEH_PE_ISOLATED is expected to be removed after 656 + * BAR restore. 657 + */ 663 658 rc = eeh_ops->wait_state(pe, PCI_BUS_RESET_WAIT_MSEC); 664 659 if ((rc & flags) == flags) 665 660 return 0; ··· 839 826 &hose_list, list_node) 840 827 pci_walk_bus(hose->bus, eeh_ops->dev_probe, NULL); 841 828 } else { 842 - pr_warning("%s: Invalid probe mode %d\n", 843 - __func__, eeh_probe_mode); 829 + pr_warn("%s: Invalid probe mode %x", 830 + __func__, eeh_subsystem_flags); 844 831 return -EINVAL; 845 832 } 846 833 ··· 1115 1102 .release = single_release, 1116 1103 }; 1117 1104 1105 + #ifdef CONFIG_DEBUG_FS 1106 + static int eeh_enable_dbgfs_set(void *data, u64 val) 1107 + { 1108 + if (val) 1109 + eeh_subsystem_flags &= ~EEH_FORCE_DISABLED; 1110 + else 1111 + eeh_subsystem_flags |= EEH_FORCE_DISABLED; 1112 + 1113 + /* Notify the backend */ 1114 + if (eeh_ops->post_init) 1115 + eeh_ops->post_init(); 1116 + 1117 + return 0; 1118 + } 1119 + 1120 + static int eeh_enable_dbgfs_get(void *data, u64 *val) 1121 + { 1122 + if (eeh_enabled()) 1123 + *val = 0x1ul; 1124 + else 1125 + *val = 0x0ul; 1126 + return 0; 1127 + } 1128 + 1129 + DEFINE_SIMPLE_ATTRIBUTE(eeh_enable_dbgfs_ops, eeh_enable_dbgfs_get, 1130 + eeh_enable_dbgfs_set, "0x%llx\n"); 1131 + #endif 1132 + 1118 1133 static int __init eeh_init_proc(void) 1119 1134 { 1120 - if (machine_is(pseries) || machine_is(powernv)) 1135 + if (machine_is(pseries) || machine_is(powernv)) { 1121 1136 proc_create("powerpc/eeh", 0, NULL, &proc_eeh_operations); 1137 + #ifdef CONFIG_DEBUG_FS 1138 + debugfs_create_file("eeh_enable", 0600, 1139 + powerpc_debugfs_root, NULL, 1140 + &eeh_enable_dbgfs_ops); 1141 + #endif 1142 + } 1143 + 1122 1144 return 0; 1123 1145 } 1124 1146 __initcall(eeh_init_proc);
+100 -18
arch/powerpc/kernel/eeh_driver.c
··· 171 171 } 172 172 } 173 173 174 + static bool eeh_dev_removed(struct eeh_dev *edev) 175 + { 176 + /* EEH device removed ? */ 177 + if (!edev || (edev->mode & EEH_DEV_REMOVED)) 178 + return true; 179 + 180 + return false; 181 + } 182 + 174 183 /** 175 184 * eeh_report_error - Report pci error to each device driver 176 185 * @data: eeh device ··· 196 187 enum pci_ers_result rc, *res = userdata; 197 188 struct pci_driver *driver; 198 189 199 - /* We might not have the associated PCI device, 200 - * then we should continue for next one. 201 - */ 202 - if (!dev) return NULL; 190 + if (!dev || eeh_dev_removed(edev)) 191 + return NULL; 203 192 dev->error_state = pci_channel_io_frozen; 204 193 205 194 driver = eeh_pcid_get(dev); ··· 237 230 enum pci_ers_result rc, *res = userdata; 238 231 struct pci_driver *driver; 239 232 233 + if (!dev || eeh_dev_removed(edev)) 234 + return NULL; 235 + 240 236 driver = eeh_pcid_get(dev); 241 237 if (!driver) return NULL; 242 238 ··· 277 267 enum pci_ers_result rc, *res = userdata; 278 268 struct pci_driver *driver; 279 269 280 - if (!dev) return NULL; 270 + if (!dev || eeh_dev_removed(edev)) 271 + return NULL; 281 272 dev->error_state = pci_channel_io_normal; 282 273 283 274 driver = eeh_pcid_get(dev); ··· 318 307 struct pci_dev *dev = eeh_dev_to_pci_dev(edev); 319 308 struct pci_driver *driver; 320 309 321 - if (!dev) return NULL; 310 + if (!dev || eeh_dev_removed(edev)) 311 + return NULL; 322 312 dev->error_state = pci_channel_io_normal; 323 313 324 314 driver = eeh_pcid_get(dev); ··· 355 343 struct pci_dev *dev = eeh_dev_to_pci_dev(edev); 356 344 struct pci_driver *driver; 357 345 358 - if (!dev) return NULL; 346 + if (!dev || eeh_dev_removed(edev)) 347 + return NULL; 359 348 dev->error_state = pci_channel_io_perm_failure; 360 349 361 350 driver = eeh_pcid_get(dev); ··· 391 378 * simplicity here. 392 379 */ 393 380 if (!dev || (dev->hdr_type & PCI_HEADER_TYPE_BRIDGE)) 381 + return NULL; 382 + 383 + /* 384 + * We rely on count-based pcibios_release_device() to 385 + * detach permanently offlined PEs. Unfortunately, that's 386 + * not reliable enough. We might have the permanently 387 + * offlined PEs attached, but we needn't take care of 388 + * them and their child devices. 389 + */ 390 + if (eeh_dev_removed(edev)) 394 391 return NULL; 395 392 396 393 driver = eeh_pcid_get(dev); ··· 440 417 return NULL; 441 418 } 442 419 420 + /* 421 + * Explicitly clear PE's frozen state for PowerNV where 422 + * we have frozen PE until BAR restore is completed. It's 423 + * harmless to clear it for pSeries. To be consistent with 424 + * PE reset (for 3 times), we try to clear the frozen state 425 + * for 3 times as well. 426 + */ 427 + static int eeh_clear_pe_frozen_state(struct eeh_pe *pe) 428 + { 429 + int i, rc; 430 + 431 + for (i = 0; i < 3; i++) { 432 + rc = eeh_pci_enable(pe, EEH_OPT_THAW_MMIO); 433 + if (rc) 434 + continue; 435 + rc = eeh_pci_enable(pe, EEH_OPT_THAW_DMA); 436 + if (!rc) 437 + break; 438 + } 439 + 440 + /* The PE has been isolated, clear it */ 441 + if (rc) 442 + pr_warn("%s: Can't clear frozen PHB#%x-PE#%x (%d)\n", 443 + __func__, pe->phb->global_number, pe->addr, rc); 444 + else 445 + eeh_pe_state_clear(pe, EEH_PE_ISOLATED); 446 + 447 + return rc; 448 + } 449 + 443 450 /** 444 451 * eeh_reset_device - Perform actual reset of a pci slot 445 452 * @pe: EEH PE ··· 504 451 eeh_pe_dev_traverse(pe, eeh_rmv_device, &removed); 505 452 } 506 453 507 - /* Reset the pci controller. (Asserts RST#; resets config space). 454 + /* 455 + * Reset the pci controller. (Asserts RST#; resets config space). 508 456 * Reconfigure bridges and devices. Don't try to bring the system 509 457 * up if the reset failed for some reason. 458 + * 459 + * During the reset, it's very dangerous to have uncontrolled PCI 460 + * config accesses. So we prefer to block them. However, controlled 461 + * PCI config accesses initiated from EEH itself are allowed. 510 462 */ 463 + eeh_pe_state_mark(pe, EEH_PE_RESET); 511 464 rc = eeh_reset_pe(pe); 512 - if (rc) 465 + if (rc) { 466 + eeh_pe_state_clear(pe, EEH_PE_RESET); 513 467 return rc; 468 + } 514 469 515 470 pci_lock_rescan_remove(); 516 471 517 472 /* Restore PE */ 518 473 eeh_ops->configure_bridge(pe); 519 474 eeh_pe_restore_bars(pe); 475 + eeh_pe_state_clear(pe, EEH_PE_RESET); 476 + 477 + /* Clear frozen state */ 478 + rc = eeh_clear_pe_frozen_state(pe); 479 + if (rc) 480 + return rc; 520 481 521 482 /* Give the system 5 seconds to finish running the user-space 522 483 * hotplug shutdown scripts, e.g. ifdown for ethernet. Yes, ··· 640 573 result = PCI_ERS_RESULT_NEED_RESET; 641 574 } else { 642 575 pr_info("EEH: Notify device drivers to resume I/O\n"); 643 - result = PCI_ERS_RESULT_NONE; 644 576 eeh_pe_dev_traverse(pe, eeh_report_mmio_enabled, &result); 645 577 } 646 578 } ··· 651 585 652 586 if (rc < 0) 653 587 goto hard_fail; 654 - if (rc) 588 + if (rc) { 655 589 result = PCI_ERS_RESULT_NEED_RESET; 656 - else 590 + } else { 591 + /* 592 + * We didn't do PE reset for the case. The PE 593 + * is still in frozen state. Clear it before 594 + * resuming the PE. 595 + */ 596 + eeh_pe_state_clear(pe, EEH_PE_ISOLATED); 657 597 result = PCI_ERS_RESULT_RECOVERED; 598 + } 658 599 } 659 600 660 601 /* If any device has a hard failure, then shut off everything. */ ··· 723 650 /* Notify all devices that they're about to go down. */ 724 651 eeh_pe_dev_traverse(pe, eeh_report_failure, NULL); 725 652 726 - /* Shut down the device drivers for good. */ 653 + /* Mark the PE to be removed permanently */ 654 + pe->freeze_count = EEH_MAX_ALLOWED_FREEZES + 1; 655 + 656 + /* 657 + * Shut down the device drivers for good. We mark 658 + * all removed devices correctly to avoid access 659 + * the their PCI config any more. 660 + */ 727 661 if (frozen_bus) { 662 + eeh_pe_dev_mode_mark(pe, EEH_DEV_REMOVED); 663 + 728 664 pci_lock_rescan_remove(); 729 665 pcibios_remove_pci_devices(frozen_bus); 730 666 pci_unlock_rescan_remove(); ··· 764 682 phb_pe = eeh_phb_pe_get(hose); 765 683 if (!phb_pe) continue; 766 684 767 - eeh_pe_state_mark(phb_pe, 768 - EEH_PE_ISOLATED | EEH_PE_PHB_DEAD); 685 + eeh_pe_state_mark(phb_pe, EEH_PE_ISOLATED); 769 686 } 770 687 771 688 eeh_serialize_unlock(flags); ··· 780 699 eeh_remove_event(pe); 781 700 782 701 if (rc == EEH_NEXT_ERR_DEAD_PHB) 783 - eeh_pe_state_mark(pe, 784 - EEH_PE_ISOLATED | EEH_PE_PHB_DEAD); 702 + eeh_pe_state_mark(pe, EEH_PE_ISOLATED); 785 703 else 786 704 eeh_pe_state_mark(pe, 787 705 EEH_PE_ISOLATED | EEH_PE_RECOVERING); ··· 804 724 if (rc == EEH_NEXT_ERR_FROZEN_PE || 805 725 rc == EEH_NEXT_ERR_FENCED_PHB) { 806 726 eeh_handle_normal_event(pe); 727 + eeh_pe_state_clear(pe, EEH_PE_RECOVERING); 807 728 } else { 808 729 pci_lock_rescan_remove(); 809 730 list_for_each_entry(hose, &hose_list, list_node) { 810 731 phb_pe = eeh_phb_pe_get(hose); 811 732 if (!phb_pe || 812 - !(phb_pe->state & EEH_PE_PHB_DEAD)) 733 + !(phb_pe->state & EEH_PE_ISOLATED) || 734 + (phb_pe->state & EEH_PE_RECOVERING)) 813 735 continue; 814 736 815 737 /* Notify all devices to be down */
+40 -7
arch/powerpc/kernel/eeh_pe.c
··· 503 503 struct eeh_dev *edev, *tmp; 504 504 struct pci_dev *pdev; 505 505 506 - /* 507 - * Mark the PE with the indicated state. Also, 508 - * the associated PCI device will be put into 509 - * I/O frozen state to avoid I/O accesses from 510 - * the PCI device driver. 511 - */ 506 + /* Keep the state of permanently removed PE intact */ 507 + if ((pe->freeze_count > EEH_MAX_ALLOWED_FREEZES) && 508 + (state & (EEH_PE_ISOLATED | EEH_PE_RECOVERING))) 509 + return NULL; 510 + 512 511 pe->state |= state; 512 + 513 + /* Offline PCI devices if applicable */ 514 + if (state != EEH_PE_ISOLATED) 515 + return NULL; 516 + 513 517 eeh_pe_for_each_dev(pe, edev, tmp) { 514 518 pdev = eeh_dev_to_pci_dev(edev); 515 519 if (pdev) ··· 536 532 eeh_pe_traverse(pe, __eeh_pe_state_mark, &state); 537 533 } 538 534 535 + static void *__eeh_pe_dev_mode_mark(void *data, void *flag) 536 + { 537 + struct eeh_dev *edev = data; 538 + int mode = *((int *)flag); 539 + 540 + edev->mode |= mode; 541 + 542 + return NULL; 543 + } 544 + 545 + /** 546 + * eeh_pe_dev_state_mark - Mark state for all device under the PE 547 + * @pe: EEH PE 548 + * 549 + * Mark specific state for all child devices of the PE. 550 + */ 551 + void eeh_pe_dev_mode_mark(struct eeh_pe *pe, int mode) 552 + { 553 + eeh_pe_dev_traverse(pe, __eeh_pe_dev_mode_mark, &mode); 554 + } 555 + 539 556 /** 540 557 * __eeh_pe_state_clear - Clear state for the PE 541 558 * @data: EEH PE ··· 571 546 struct eeh_pe *pe = (struct eeh_pe *)data; 572 547 int state = *((int *)flag); 573 548 549 + /* Keep the state of permanently removed PE intact */ 550 + if ((pe->freeze_count > EEH_MAX_ALLOWED_FREEZES) && 551 + (state & EEH_PE_ISOLATED)) 552 + return NULL; 553 + 574 554 pe->state &= ~state; 575 - pe->check_count = 0; 555 + 556 + /* Clear check count since last isolation */ 557 + if (state & EEH_PE_ISOLATED) 558 + pe->check_count = 0; 576 559 577 560 return NULL; 578 561 }
+3
arch/powerpc/kernel/eeh_sysfs.c
··· 59 59 struct eeh_dev *edev = pci_dev_to_eeh_dev(pdev); 60 60 int rc=0; 61 61 62 + if (!eeh_enabled()) 63 + return; 64 + 62 65 if (edev && (edev->mode & EEH_DEV_SYSFS)) 63 66 return; 64 67
+59 -67
arch/powerpc/kernel/entry_64.S
··· 39 39 * System calls. 40 40 */ 41 41 .section ".toc","aw" 42 - .SYS_CALL_TABLE: 43 - .tc .sys_call_table[TC],.sys_call_table 42 + SYS_CALL_TABLE: 43 + .tc sys_call_table[TC],sys_call_table 44 44 45 45 /* This value is used to mark exception frames on the stack. */ 46 46 exception_marker: ··· 106 106 LDX_BE r10,0,r10 /* get log write index */ 107 107 cmpd cr1,r11,r10 108 108 beq+ cr1,33f 109 - bl .accumulate_stolen_time 109 + bl accumulate_stolen_time 110 110 REST_GPR(0,r1) 111 111 REST_4GPRS(3,r1) 112 112 REST_2GPRS(7,r1) ··· 143 143 std r10,SOFTE(r1) 144 144 145 145 #ifdef SHOW_SYSCALLS 146 - bl .do_show_syscall 146 + bl do_show_syscall 147 147 REST_GPR(0,r1) 148 148 REST_4GPRS(3,r1) 149 149 REST_2GPRS(7,r1) ··· 162 162 * Need to vector to 32 Bit or default sys_call_table here, 163 163 * based on caller's run-mode / personality. 164 164 */ 165 - ld r11,.SYS_CALL_TABLE@toc(2) 165 + ld r11,SYS_CALL_TABLE@toc(2) 166 166 andi. r10,r10,_TIF_32BIT 167 167 beq 15f 168 168 addi r11,r11,8 /* use 32-bit syscall entries */ ··· 174 174 clrldi r8,r8,32 175 175 15: 176 176 slwi r0,r0,4 177 - ldx r10,r11,r0 /* Fetch system call handler [ptr] */ 178 - mtctr r10 177 + ldx r12,r11,r0 /* Fetch system call handler [ptr] */ 178 + mtctr r12 179 179 bctrl /* Call handler */ 180 180 181 181 syscall_exit: 182 182 std r3,RESULT(r1) 183 183 #ifdef SHOW_SYSCALLS 184 - bl .do_show_syscall_exit 184 + bl do_show_syscall_exit 185 185 ld r3,RESULT(r1) 186 186 #endif 187 187 CURRENT_THREAD_INFO(r12, r1) ··· 248 248 249 249 /* Traced system call support */ 250 250 syscall_dotrace: 251 - bl .save_nvgprs 251 + bl save_nvgprs 252 252 addi r3,r1,STACK_FRAME_OVERHEAD 253 - bl .do_syscall_trace_enter 253 + bl do_syscall_trace_enter 254 254 /* 255 255 * Restore argument registers possibly just changed. 256 256 * We use the return value of do_syscall_trace_enter ··· 308 308 4: /* Anything else left to do? */ 309 309 SET_DEFAULT_THREAD_PPR(r3, r10) /* Set thread.ppr = 3 */ 310 310 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP) 311 - beq .ret_from_except_lite 311 + beq ret_from_except_lite 312 312 313 313 /* Re-enable interrupts */ 314 314 #ifdef CONFIG_PPC_BOOK3E ··· 319 319 mtmsrd r10,1 320 320 #endif /* CONFIG_PPC_BOOK3E */ 321 321 322 - bl .save_nvgprs 322 + bl save_nvgprs 323 323 addi r3,r1,STACK_FRAME_OVERHEAD 324 - bl .do_syscall_trace_leave 325 - b .ret_from_except 324 + bl do_syscall_trace_leave 325 + b ret_from_except 326 326 327 327 /* Save non-volatile GPRs, if not already saved. */ 328 328 _GLOBAL(save_nvgprs) ··· 345 345 */ 346 346 347 347 _GLOBAL(ppc_fork) 348 - bl .save_nvgprs 349 - bl .sys_fork 348 + bl save_nvgprs 349 + bl sys_fork 350 350 b syscall_exit 351 351 352 352 _GLOBAL(ppc_vfork) 353 - bl .save_nvgprs 354 - bl .sys_vfork 353 + bl save_nvgprs 354 + bl sys_vfork 355 355 b syscall_exit 356 356 357 357 _GLOBAL(ppc_clone) 358 - bl .save_nvgprs 359 - bl .sys_clone 358 + bl save_nvgprs 359 + bl sys_clone 360 360 b syscall_exit 361 361 362 362 _GLOBAL(ppc32_swapcontext) 363 - bl .save_nvgprs 364 - bl .compat_sys_swapcontext 363 + bl save_nvgprs 364 + bl compat_sys_swapcontext 365 365 b syscall_exit 366 366 367 367 _GLOBAL(ppc64_swapcontext) 368 - bl .save_nvgprs 369 - bl .sys_swapcontext 368 + bl save_nvgprs 369 + bl sys_swapcontext 370 370 b syscall_exit 371 371 372 372 _GLOBAL(ret_from_fork) 373 - bl .schedule_tail 373 + bl schedule_tail 374 374 REST_NVGPRS(r1) 375 375 li r3,0 376 376 b syscall_exit 377 377 378 378 _GLOBAL(ret_from_kernel_thread) 379 - bl .schedule_tail 379 + bl schedule_tail 380 380 REST_NVGPRS(r1) 381 - ld r14, 0(r14) 382 381 mtlr r14 383 382 mr r3,r15 383 + #if defined(_CALL_ELF) && _CALL_ELF == 2 384 + mr r12,r14 385 + #endif 384 386 blrl 385 387 li r3,0 386 388 b syscall_exit 387 - 388 - .section ".toc","aw" 389 - DSCR_DEFAULT: 390 - .tc dscr_default[TC],dscr_default 391 - 392 - .section ".text" 393 389 394 390 /* 395 391 * This routine switches between two different tasks. The process ··· 571 575 #ifdef CONFIG_PPC64 572 576 BEGIN_FTR_SECTION 573 577 lwz r6,THREAD_DSCR_INHERIT(r4) 574 - ld r7,DSCR_DEFAULT@toc(2) 575 578 ld r0,THREAD_DSCR(r4) 576 579 cmpwi r6,0 577 580 bne 1f 578 - ld r0,0(r7) 581 + ld r0,PACA_DSCR(r13) 579 582 1: 580 583 BEGIN_FTR_SECTION_NESTED(70) 581 584 mfspr r8, SPRN_FSCR ··· 606 611 _GLOBAL(ret_from_except) 607 612 ld r11,_TRAP(r1) 608 613 andi. r0,r11,1 609 - bne .ret_from_except_lite 614 + bne ret_from_except_lite 610 615 REST_NVGPRS(r1) 611 616 612 617 _GLOBAL(ret_from_except_lite) ··· 656 661 #endif 657 662 1: andi. r0,r4,_TIF_NEED_RESCHED 658 663 beq 2f 659 - bl .restore_interrupts 664 + bl restore_interrupts 660 665 SCHEDULE_USER 661 - b .ret_from_except_lite 666 + b ret_from_except_lite 662 667 2: 663 668 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM 664 669 andi. r0,r4,_TIF_USER_WORK_MASK & ~_TIF_RESTORE_TM 665 670 bne 3f /* only restore TM if nothing else to do */ 666 671 addi r3,r1,STACK_FRAME_OVERHEAD 667 - bl .restore_tm_state 672 + bl restore_tm_state 668 673 b restore 669 674 3: 670 675 #endif 671 - bl .save_nvgprs 672 - bl .restore_interrupts 676 + bl save_nvgprs 677 + bl restore_interrupts 673 678 addi r3,r1,STACK_FRAME_OVERHEAD 674 - bl .do_notify_resume 675 - b .ret_from_except 679 + bl do_notify_resume 680 + b ret_from_except 676 681 677 682 resume_kernel: 678 683 /* check current_thread_info, _TIF_EMULATE_STACK_STORE */ ··· 725 730 * sure we are soft-disabled first and reconcile irq state. 726 731 */ 727 732 RECONCILE_IRQ_STATE(r3,r4) 728 - 1: bl .preempt_schedule_irq 733 + 1: bl preempt_schedule_irq 729 734 730 735 /* Re-test flags and eventually loop */ 731 736 CURRENT_THREAD_INFO(r9, r1) ··· 787 792 */ 788 793 do_restore: 789 794 #ifdef CONFIG_PPC_BOOK3E 790 - b .exception_return_book3e 795 + b exception_return_book3e 791 796 #else 792 797 /* 793 798 * Clear the reservation. If we know the CPU tracks the address of ··· 902 907 * 903 908 * Still, this might be useful for things like hash_page 904 909 */ 905 - bl .__check_irq_replay 910 + bl __check_irq_replay 906 911 cmpwi cr0,r3,0 907 912 beq restore_no_replay 908 913 ··· 923 928 cmpwi cr0,r3,0x500 924 929 bne 1f 925 930 addi r3,r1,STACK_FRAME_OVERHEAD; 926 - bl .do_IRQ 927 - b .ret_from_except 931 + bl do_IRQ 932 + b ret_from_except 928 933 1: cmpwi cr0,r3,0x900 929 934 bne 1f 930 935 addi r3,r1,STACK_FRAME_OVERHEAD; 931 - bl .timer_interrupt 932 - b .ret_from_except 936 + bl timer_interrupt 937 + b ret_from_except 933 938 #ifdef CONFIG_PPC_DOORBELL 934 939 1: 935 940 #ifdef CONFIG_PPC_BOOK3E ··· 943 948 #endif /* CONFIG_PPC_BOOK3E */ 944 949 bne 1f 945 950 addi r3,r1,STACK_FRAME_OVERHEAD; 946 - bl .doorbell_exception 947 - b .ret_from_except 951 + bl doorbell_exception 952 + b ret_from_except 948 953 #endif /* CONFIG_PPC_DOORBELL */ 949 - 1: b .ret_from_except /* What else to do here ? */ 954 + 1: b ret_from_except /* What else to do here ? */ 950 955 951 956 unrecov_restore: 952 957 addi r3,r1,STACK_FRAME_OVERHEAD 953 - bl .unrecoverable_exception 958 + bl unrecoverable_exception 954 959 b unrecov_restore 955 960 956 961 #ifdef CONFIG_PPC_RTAS ··· 1016 1021 std r6,PACASAVEDMSR(r13) 1017 1022 1018 1023 /* Setup our real return addr */ 1019 - LOAD_REG_ADDR(r4,.rtas_return_loc) 1024 + LOAD_REG_ADDR(r4,rtas_return_loc) 1020 1025 clrldi r4,r4,2 /* convert to realmode address */ 1021 1026 mtlr r4 1022 1027 ··· 1040 1045 rfid 1041 1046 b . /* prevent speculative execution */ 1042 1047 1043 - _STATIC(rtas_return_loc) 1048 + rtas_return_loc: 1044 1049 FIXUP_ENDIAN 1045 1050 1046 1051 /* relocation is off at this point */ ··· 1049 1054 1050 1055 bcl 20,31,$+4 1051 1056 0: mflr r3 1052 - ld r3,(1f-0b)(r3) /* get &.rtas_restore_regs */ 1057 + ld r3,(1f-0b)(r3) /* get &rtas_restore_regs */ 1053 1058 1054 1059 mfmsr r6 1055 1060 li r0,MSR_RI ··· 1066 1071 b . /* prevent speculative execution */ 1067 1072 1068 1073 .align 3 1069 - 1: .llong .rtas_restore_regs 1074 + 1: .llong rtas_restore_regs 1070 1075 1071 - _STATIC(rtas_restore_regs) 1076 + rtas_restore_regs: 1072 1077 /* relocation is on at this point */ 1073 1078 REST_GPR(2, r1) /* Restore the TOC */ 1074 1079 REST_GPR(13, r1) /* Restore paca */ ··· 1168 1173 _GLOBAL(_mcount) 1169 1174 blr 1170 1175 1171 - _GLOBAL(ftrace_caller) 1176 + _GLOBAL_TOC(ftrace_caller) 1172 1177 /* Taken from output of objdump from lib64/glibc */ 1173 1178 mflr r3 1174 1179 ld r11, 0(r1) ··· 1192 1197 _GLOBAL(ftrace_stub) 1193 1198 blr 1194 1199 #else 1195 - _GLOBAL(mcount) 1196 - blr 1197 - 1198 - _GLOBAL(_mcount) 1200 + _GLOBAL_TOC(_mcount) 1199 1201 /* Taken from output of objdump from lib64/glibc */ 1200 1202 mflr r3 1201 1203 ld r11, 0(r1) ··· 1230 1238 ld r11, 112(r1) 1231 1239 addi r3, r11, 16 1232 1240 1233 - bl .prepare_ftrace_return 1241 + bl prepare_ftrace_return 1234 1242 nop 1235 1243 1236 1244 ld r0, 128(r1) ··· 1246 1254 mr r31, r1 1247 1255 stdu r1, -112(r1) 1248 1256 1249 - bl .ftrace_return_to_handler 1257 + bl ftrace_return_to_handler 1250 1258 nop 1251 1259 1252 1260 /* return value has real return address */ ··· 1276 1284 */ 1277 1285 ld r2, PACATOC(r13) 1278 1286 1279 - bl .ftrace_return_to_handler 1287 + bl ftrace_return_to_handler 1280 1288 nop 1281 1289 1282 1290 /* return value has real return address */
+13 -1
arch/powerpc/kernel/epapr_paravirt.c
··· 30 30 #endif 31 31 32 32 bool epapr_paravirt_enabled; 33 + static bool __maybe_unused epapr_has_idle; 33 34 34 35 static int __init early_init_dt_scan_epapr(unsigned long node, 35 36 const char *uname, ··· 57 56 58 57 #if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64) 59 58 if (of_get_flat_dt_prop(node, "has-idle", NULL)) 60 - ppc_md.power_save = epapr_ev_idle; 59 + epapr_has_idle = true; 61 60 #endif 62 61 63 62 epapr_paravirt_enabled = true; ··· 72 71 return 0; 73 72 } 74 73 74 + static int __init epapr_idle_init(void) 75 + { 76 + #if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64) 77 + if (epapr_has_idle) 78 + ppc_md.power_save = epapr_ev_idle; 79 + #endif 80 + 81 + return 0; 82 + } 83 + 84 + postcore_initcall(epapr_idle_init);
+70 -70
arch/powerpc/kernel/exceptions-64e.S
··· 499 499 CHECK_NAPPING(); \ 500 500 addi r3,r1,STACK_FRAME_OVERHEAD; \ 501 501 bl hdlr; \ 502 - b .ret_from_except_lite; 502 + b ret_from_except_lite; 503 503 504 504 /* This value is used to mark exception frames on the stack. */ 505 505 .section ".toc","aw" ··· 550 550 CRIT_EXCEPTION_PROLOG(0x100, BOOKE_INTERRUPT_CRITICAL, 551 551 PROLOG_ADDITION_NONE) 552 552 EXCEPTION_COMMON_CRIT(0x100) 553 - bl .save_nvgprs 553 + bl save_nvgprs 554 554 bl special_reg_save 555 555 CHECK_NAPPING(); 556 556 addi r3,r1,STACK_FRAME_OVERHEAD 557 - bl .unknown_exception 557 + bl unknown_exception 558 558 b ret_from_crit_except 559 559 560 560 /* Machine Check Interrupt */ ··· 562 562 MC_EXCEPTION_PROLOG(0x000, BOOKE_INTERRUPT_MACHINE_CHECK, 563 563 PROLOG_ADDITION_NONE) 564 564 EXCEPTION_COMMON_MC(0x000) 565 - bl .save_nvgprs 565 + bl save_nvgprs 566 566 bl special_reg_save 567 567 CHECK_NAPPING(); 568 568 addi r3,r1,STACK_FRAME_OVERHEAD 569 - bl .machine_check_exception 569 + bl machine_check_exception 570 570 b ret_from_mc_except 571 571 572 572 /* Data Storage Interrupt */ ··· 591 591 592 592 /* External Input Interrupt */ 593 593 MASKABLE_EXCEPTION(0x500, BOOKE_INTERRUPT_EXTERNAL, 594 - external_input, .do_IRQ, ACK_NONE) 594 + external_input, do_IRQ, ACK_NONE) 595 595 596 596 /* Alignment */ 597 597 START_EXCEPTION(alignment); ··· 612 612 std r14,_DSISR(r1) 613 613 addi r3,r1,STACK_FRAME_OVERHEAD 614 614 ld r14,PACA_EXGEN+EX_R14(r13) 615 - bl .save_nvgprs 616 - bl .program_check_exception 617 - b .ret_from_except 615 + bl save_nvgprs 616 + bl program_check_exception 617 + b ret_from_except 618 618 619 619 /* Floating Point Unavailable Interrupt */ 620 620 START_EXCEPTION(fp_unavailable); ··· 625 625 ld r12,_MSR(r1) 626 626 andi. r0,r12,MSR_PR; 627 627 beq- 1f 628 - bl .load_up_fpu 628 + bl load_up_fpu 629 629 b fast_exception_return 630 630 1: INTS_DISABLE 631 - bl .save_nvgprs 631 + bl save_nvgprs 632 632 addi r3,r1,STACK_FRAME_OVERHEAD 633 - bl .kernel_fp_unavailable_exception 634 - b .ret_from_except 633 + bl kernel_fp_unavailable_exception 634 + b ret_from_except 635 635 636 636 /* Altivec Unavailable Interrupt */ 637 637 START_EXCEPTION(altivec_unavailable); ··· 644 644 ld r12,_MSR(r1) 645 645 andi. r0,r12,MSR_PR; 646 646 beq- 1f 647 - bl .load_up_altivec 647 + bl load_up_altivec 648 648 b fast_exception_return 649 649 1: 650 650 END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) 651 651 #endif 652 652 INTS_DISABLE 653 - bl .save_nvgprs 653 + bl save_nvgprs 654 654 addi r3,r1,STACK_FRAME_OVERHEAD 655 - bl .altivec_unavailable_exception 656 - b .ret_from_except 655 + bl altivec_unavailable_exception 656 + b ret_from_except 657 657 658 658 /* AltiVec Assist */ 659 659 START_EXCEPTION(altivec_assist); ··· 662 662 PROLOG_ADDITION_NONE) 663 663 EXCEPTION_COMMON(0x220) 664 664 INTS_DISABLE 665 - bl .save_nvgprs 665 + bl save_nvgprs 666 666 addi r3,r1,STACK_FRAME_OVERHEAD 667 667 #ifdef CONFIG_ALTIVEC 668 668 BEGIN_FTR_SECTION 669 - bl .altivec_assist_exception 669 + bl altivec_assist_exception 670 670 END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) 671 671 #else 672 - bl .unknown_exception 672 + bl unknown_exception 673 673 #endif 674 - b .ret_from_except 674 + b ret_from_except 675 675 676 676 677 677 /* Decrementer Interrupt */ 678 678 MASKABLE_EXCEPTION(0x900, BOOKE_INTERRUPT_DECREMENTER, 679 - decrementer, .timer_interrupt, ACK_DEC) 679 + decrementer, timer_interrupt, ACK_DEC) 680 680 681 681 /* Fixed Interval Timer Interrupt */ 682 682 MASKABLE_EXCEPTION(0x980, BOOKE_INTERRUPT_FIT, 683 - fixed_interval, .unknown_exception, ACK_FIT) 683 + fixed_interval, unknown_exception, ACK_FIT) 684 684 685 685 /* Watchdog Timer Interrupt */ 686 686 START_EXCEPTION(watchdog); 687 687 CRIT_EXCEPTION_PROLOG(0x9f0, BOOKE_INTERRUPT_WATCHDOG, 688 688 PROLOG_ADDITION_NONE) 689 689 EXCEPTION_COMMON_CRIT(0x9f0) 690 - bl .save_nvgprs 690 + bl save_nvgprs 691 691 bl special_reg_save 692 692 CHECK_NAPPING(); 693 693 addi r3,r1,STACK_FRAME_OVERHEAD 694 694 #ifdef CONFIG_BOOKE_WDT 695 - bl .WatchdogException 695 + bl WatchdogException 696 696 #else 697 - bl .unknown_exception 697 + bl unknown_exception 698 698 #endif 699 699 b ret_from_crit_except 700 700 ··· 712 712 PROLOG_ADDITION_NONE) 713 713 EXCEPTION_COMMON(0xf20) 714 714 INTS_DISABLE 715 - bl .save_nvgprs 715 + bl save_nvgprs 716 716 addi r3,r1,STACK_FRAME_OVERHEAD 717 - bl .unknown_exception 718 - b .ret_from_except 717 + bl unknown_exception 718 + b ret_from_except 719 719 720 720 /* Debug exception as a critical interrupt*/ 721 721 START_EXCEPTION(debug_crit); ··· 774 774 mr r4,r14 775 775 ld r14,PACA_EXCRIT+EX_R14(r13) 776 776 ld r15,PACA_EXCRIT+EX_R15(r13) 777 - bl .save_nvgprs 778 - bl .DebugException 779 - b .ret_from_except 777 + bl save_nvgprs 778 + bl DebugException 779 + b ret_from_except 780 780 781 781 kernel_dbg_exc: 782 782 b . /* NYI */ ··· 839 839 mr r4,r14 840 840 ld r14,PACA_EXDBG+EX_R14(r13) 841 841 ld r15,PACA_EXDBG+EX_R15(r13) 842 - bl .save_nvgprs 843 - bl .DebugException 844 - b .ret_from_except 842 + bl save_nvgprs 843 + bl DebugException 844 + b ret_from_except 845 845 846 846 START_EXCEPTION(perfmon); 847 847 NORMAL_EXCEPTION_PROLOG(0x260, BOOKE_INTERRUPT_PERFORMANCE_MONITOR, ··· 850 850 INTS_DISABLE 851 851 CHECK_NAPPING() 852 852 addi r3,r1,STACK_FRAME_OVERHEAD 853 - bl .performance_monitor_exception 854 - b .ret_from_except_lite 853 + bl performance_monitor_exception 854 + b ret_from_except_lite 855 855 856 856 /* Doorbell interrupt */ 857 857 MASKABLE_EXCEPTION(0x280, BOOKE_INTERRUPT_DOORBELL, 858 - doorbell, .doorbell_exception, ACK_NONE) 858 + doorbell, doorbell_exception, ACK_NONE) 859 859 860 860 /* Doorbell critical Interrupt */ 861 861 START_EXCEPTION(doorbell_crit); 862 862 CRIT_EXCEPTION_PROLOG(0x2a0, BOOKE_INTERRUPT_DOORBELL_CRITICAL, 863 863 PROLOG_ADDITION_NONE) 864 864 EXCEPTION_COMMON_CRIT(0x2a0) 865 - bl .save_nvgprs 865 + bl save_nvgprs 866 866 bl special_reg_save 867 867 CHECK_NAPPING(); 868 868 addi r3,r1,STACK_FRAME_OVERHEAD 869 - bl .unknown_exception 869 + bl unknown_exception 870 870 b ret_from_crit_except 871 871 872 872 /* ··· 878 878 PROLOG_ADDITION_NONE) 879 879 EXCEPTION_COMMON(0x2c0) 880 880 addi r3,r1,STACK_FRAME_OVERHEAD 881 - bl .save_nvgprs 881 + bl save_nvgprs 882 882 INTS_RESTORE_HARD 883 - bl .unknown_exception 884 - b .ret_from_except 883 + bl unknown_exception 884 + b ret_from_except 885 885 886 886 /* Guest Doorbell critical Interrupt */ 887 887 START_EXCEPTION(guest_doorbell_crit); 888 888 CRIT_EXCEPTION_PROLOG(0x2e0, BOOKE_INTERRUPT_GUEST_DBELL_CRIT, 889 889 PROLOG_ADDITION_NONE) 890 890 EXCEPTION_COMMON_CRIT(0x2e0) 891 - bl .save_nvgprs 891 + bl save_nvgprs 892 892 bl special_reg_save 893 893 CHECK_NAPPING(); 894 894 addi r3,r1,STACK_FRAME_OVERHEAD 895 - bl .unknown_exception 895 + bl unknown_exception 896 896 b ret_from_crit_except 897 897 898 898 /* Hypervisor call */ ··· 901 901 PROLOG_ADDITION_NONE) 902 902 EXCEPTION_COMMON(0x310) 903 903 addi r3,r1,STACK_FRAME_OVERHEAD 904 - bl .save_nvgprs 904 + bl save_nvgprs 905 905 INTS_RESTORE_HARD 906 - bl .unknown_exception 907 - b .ret_from_except 906 + bl unknown_exception 907 + b ret_from_except 908 908 909 909 /* Embedded Hypervisor priviledged */ 910 910 START_EXCEPTION(ehpriv); ··· 912 912 PROLOG_ADDITION_NONE) 913 913 EXCEPTION_COMMON(0x320) 914 914 addi r3,r1,STACK_FRAME_OVERHEAD 915 - bl .save_nvgprs 915 + bl save_nvgprs 916 916 INTS_RESTORE_HARD 917 - bl .unknown_exception 918 - b .ret_from_except 917 + bl unknown_exception 918 + b ret_from_except 919 919 920 920 /* LRAT Error interrupt */ 921 921 START_EXCEPTION(lrat_error); ··· 1014 1014 mr r5,r15 1015 1015 ld r14,PACA_EXGEN+EX_R14(r13) 1016 1016 ld r15,PACA_EXGEN+EX_R15(r13) 1017 - bl .do_page_fault 1017 + bl do_page_fault 1018 1018 cmpdi r3,0 1019 1019 bne- 1f 1020 - b .ret_from_except_lite 1021 - 1: bl .save_nvgprs 1020 + b ret_from_except_lite 1021 + 1: bl save_nvgprs 1022 1022 mr r5,r3 1023 1023 addi r3,r1,STACK_FRAME_OVERHEAD 1024 1024 ld r4,_DAR(r1) 1025 - bl .bad_page_fault 1026 - b .ret_from_except 1025 + bl bad_page_fault 1026 + b ret_from_except 1027 1027 1028 1028 /* 1029 1029 * Alignment exception doesn't fit entirely in the 0x100 bytes so it ··· 1035 1035 addi r3,r1,STACK_FRAME_OVERHEAD 1036 1036 ld r14,PACA_EXGEN+EX_R14(r13) 1037 1037 ld r15,PACA_EXGEN+EX_R15(r13) 1038 - bl .save_nvgprs 1038 + bl save_nvgprs 1039 1039 INTS_RESTORE_HARD 1040 - bl .alignment_exception 1041 - b .ret_from_except 1040 + bl alignment_exception 1041 + b ret_from_except 1042 1042 1043 1043 /* 1044 1044 * We branch here from entry_64.S for the last stage of the exception ··· 1172 1172 std r12,0(r11) 1173 1173 ld r2,PACATOC(r13) 1174 1174 1: addi r3,r1,STACK_FRAME_OVERHEAD 1175 - bl .kernel_bad_stack 1175 + bl kernel_bad_stack 1176 1176 b 1b 1177 1177 1178 1178 /* ··· 1521 1521 * and always use AS 0, so we just set it up to match our link 1522 1522 * address and never use 0 based addresses. 1523 1523 */ 1524 - bl .initial_tlb_book3e 1524 + bl initial_tlb_book3e 1525 1525 1526 1526 /* Init global core bits */ 1527 - bl .init_core_book3e 1527 + bl init_core_book3e 1528 1528 1529 1529 /* Init per-thread bits */ 1530 - bl .init_thread_book3e 1530 + bl init_thread_book3e 1531 1531 1532 1532 /* Return to common init code */ 1533 1533 tovirt(r28,r28) ··· 1548 1548 */ 1549 1549 _GLOBAL(book3e_secondary_core_init_tlb_set) 1550 1550 li r4,1 1551 - b .generic_secondary_smp_init 1551 + b generic_secondary_smp_init 1552 1552 1553 1553 _GLOBAL(book3e_secondary_core_init) 1554 1554 mflr r28 ··· 1558 1558 bne 2f 1559 1559 1560 1560 /* Setup TLB for this core */ 1561 - bl .initial_tlb_book3e 1561 + bl initial_tlb_book3e 1562 1562 1563 1563 /* We can return from the above running at a different 1564 1564 * address, so recalculate r2 (TOC) 1565 1565 */ 1566 - bl .relative_toc 1566 + bl relative_toc 1567 1567 1568 1568 /* Init global core bits */ 1569 - 2: bl .init_core_book3e 1569 + 2: bl init_core_book3e 1570 1570 1571 1571 /* Init per-thread bits */ 1572 - 3: bl .init_thread_book3e 1572 + 3: bl init_thread_book3e 1573 1573 1574 1574 /* Return to common init code at proper virtual address. 1575 1575 * ··· 1596 1596 mflr r28 1597 1597 b 3b 1598 1598 1599 - _STATIC(init_core_book3e) 1599 + init_core_book3e: 1600 1600 /* Establish the interrupt vector base */ 1601 1601 LOAD_REG_IMMEDIATE(r3, interrupt_base_book3e) 1602 1602 mtspr SPRN_IVPR,r3 1603 1603 sync 1604 1604 blr 1605 1605 1606 - _STATIC(init_thread_book3e) 1606 + init_thread_book3e: 1607 1607 lis r3,(SPRN_EPCR_ICM | SPRN_EPCR_GICM)@h 1608 1608 mtspr SPRN_EPCR,r3 1609 1609
+103 -103
arch/powerpc/kernel/exceptions-64s.S
··· 132 132 #endif 133 133 134 134 beq cr1,2f 135 - b .power7_wakeup_noloss 136 - 2: b .power7_wakeup_loss 135 + b power7_wakeup_noloss 136 + 2: b power7_wakeup_loss 137 137 138 138 /* Fast Sleep wakeup on PowerNV */ 139 139 8: GET_PACA(r13) 140 - b .power7_wakeup_tb_loss 140 + b power7_wakeup_tb_loss 141 141 142 142 9: 143 143 END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206) ··· 211 211 #endif /* __DISABLED__ */ 212 212 mfspr r12,SPRN_SRR1 213 213 #ifndef CONFIG_RELOCATABLE 214 - b .slb_miss_realmode 214 + b slb_miss_realmode 215 215 #else 216 216 /* 217 - * We can't just use a direct branch to .slb_miss_realmode 217 + * We can't just use a direct branch to slb_miss_realmode 218 218 * because the distance from here to there depends on where 219 219 * the kernel ends up being put. 220 220 */ 221 221 mfctr r11 222 222 ld r10,PACAKBASE(r13) 223 - LOAD_HANDLER(r10, .slb_miss_realmode) 223 + LOAD_HANDLER(r10, slb_miss_realmode) 224 224 mtctr r10 225 225 bctr 226 226 #endif ··· 243 243 #endif /* __DISABLED__ */ 244 244 mfspr r12,SPRN_SRR1 245 245 #ifndef CONFIG_RELOCATABLE 246 - b .slb_miss_realmode 246 + b slb_miss_realmode 247 247 #else 248 248 mfctr r11 249 249 ld r10,PACAKBASE(r13) 250 - LOAD_HANDLER(r10, .slb_miss_realmode) 250 + LOAD_HANDLER(r10, slb_miss_realmode) 251 251 mtctr r10 252 252 bctr 253 253 #endif ··· 524 524 std r12,PACA_EXSLB+EX_R12(r13) 525 525 GET_SCRATCH0(r10) 526 526 std r10,PACA_EXSLB+EX_R13(r13) 527 - EXCEPTION_PROLOG_PSERIES_1(.do_stab_bolted, EXC_STD) 527 + EXCEPTION_PROLOG_PSERIES_1(do_stab_bolted, EXC_STD) 528 528 529 529 KVM_HANDLER_SKIP(PACA_EXGEN, EXC_STD, 0x300) 530 530 KVM_HANDLER_SKIP(PACA_EXSLB, EXC_STD, 0x380) ··· 769 769 770 770 /*** Common interrupt handlers ***/ 771 771 772 - STD_EXCEPTION_COMMON(0x100, system_reset, .system_reset_exception) 772 + STD_EXCEPTION_COMMON(0x100, system_reset, system_reset_exception) 773 773 774 774 STD_EXCEPTION_COMMON_ASYNC(0x500, hardware_interrupt, do_IRQ) 775 - STD_EXCEPTION_COMMON_ASYNC(0x900, decrementer, .timer_interrupt) 776 - STD_EXCEPTION_COMMON(0x980, hdecrementer, .hdec_interrupt) 775 + STD_EXCEPTION_COMMON_ASYNC(0x900, decrementer, timer_interrupt) 776 + STD_EXCEPTION_COMMON(0x980, hdecrementer, hdec_interrupt) 777 777 #ifdef CONFIG_PPC_DOORBELL 778 - STD_EXCEPTION_COMMON_ASYNC(0xa00, doorbell_super, .doorbell_exception) 778 + STD_EXCEPTION_COMMON_ASYNC(0xa00, doorbell_super, doorbell_exception) 779 779 #else 780 - STD_EXCEPTION_COMMON_ASYNC(0xa00, doorbell_super, .unknown_exception) 780 + STD_EXCEPTION_COMMON_ASYNC(0xa00, doorbell_super, unknown_exception) 781 781 #endif 782 - STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception) 783 - STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception) 784 - STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception) 785 - STD_EXCEPTION_COMMON(0xe40, emulation_assist, .emulation_assist_interrupt) 786 - STD_EXCEPTION_COMMON(0xe60, hmi_exception, .unknown_exception) 782 + STD_EXCEPTION_COMMON(0xb00, trap_0b, unknown_exception) 783 + STD_EXCEPTION_COMMON(0xd00, single_step, single_step_exception) 784 + STD_EXCEPTION_COMMON(0xe00, trap_0e, unknown_exception) 785 + STD_EXCEPTION_COMMON(0xe40, emulation_assist, emulation_assist_interrupt) 786 + STD_EXCEPTION_COMMON(0xe60, hmi_exception, unknown_exception) 787 787 #ifdef CONFIG_PPC_DOORBELL 788 - STD_EXCEPTION_COMMON_ASYNC(0xe80, h_doorbell, .doorbell_exception) 788 + STD_EXCEPTION_COMMON_ASYNC(0xe80, h_doorbell, doorbell_exception) 789 789 #else 790 - STD_EXCEPTION_COMMON_ASYNC(0xe80, h_doorbell, .unknown_exception) 790 + STD_EXCEPTION_COMMON_ASYNC(0xe80, h_doorbell, unknown_exception) 791 791 #endif 792 - STD_EXCEPTION_COMMON_ASYNC(0xf00, performance_monitor, .performance_monitor_exception) 793 - STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception) 794 - STD_EXCEPTION_COMMON(0x1502, denorm, .unknown_exception) 792 + STD_EXCEPTION_COMMON_ASYNC(0xf00, performance_monitor, performance_monitor_exception) 793 + STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, instruction_breakpoint_exception) 794 + STD_EXCEPTION_COMMON(0x1502, denorm, unknown_exception) 795 795 #ifdef CONFIG_ALTIVEC 796 - STD_EXCEPTION_COMMON(0x1700, altivec_assist, .altivec_assist_exception) 796 + STD_EXCEPTION_COMMON(0x1700, altivec_assist, altivec_assist_exception) 797 797 #else 798 - STD_EXCEPTION_COMMON(0x1700, altivec_assist, .unknown_exception) 798 + STD_EXCEPTION_COMMON(0x1700, altivec_assist, unknown_exception) 799 799 #endif 800 800 #ifdef CONFIG_CBE_RAS 801 - STD_EXCEPTION_COMMON(0x1200, cbe_system_error, .cbe_system_error_exception) 802 - STD_EXCEPTION_COMMON(0x1600, cbe_maintenance, .cbe_maintenance_exception) 803 - STD_EXCEPTION_COMMON(0x1800, cbe_thermal, .cbe_thermal_exception) 801 + STD_EXCEPTION_COMMON(0x1200, cbe_system_error, cbe_system_error_exception) 802 + STD_EXCEPTION_COMMON(0x1600, cbe_maintenance, cbe_maintenance_exception) 803 + STD_EXCEPTION_COMMON(0x1800, cbe_thermal, cbe_thermal_exception) 804 804 #endif /* CONFIG_CBE_RAS */ 805 805 806 806 /* ··· 829 829 mfspr r3,SPRN_DAR 830 830 mfspr r12,SPRN_SRR1 831 831 #ifndef CONFIG_RELOCATABLE 832 - b .slb_miss_realmode 832 + b slb_miss_realmode 833 833 #else 834 834 /* 835 - * We can't just use a direct branch to .slb_miss_realmode 835 + * We can't just use a direct branch to slb_miss_realmode 836 836 * because the distance from here to there depends on where 837 837 * the kernel ends up being put. 838 838 */ 839 839 mfctr r11 840 840 ld r10,PACAKBASE(r13) 841 - LOAD_HANDLER(r10, .slb_miss_realmode) 841 + LOAD_HANDLER(r10, slb_miss_realmode) 842 842 mtctr r10 843 843 bctr 844 844 #endif ··· 854 854 mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ 855 855 mfspr r12,SPRN_SRR1 856 856 #ifndef CONFIG_RELOCATABLE 857 - b .slb_miss_realmode 857 + b slb_miss_realmode 858 858 #else 859 859 mfctr r11 860 860 ld r10,PACAKBASE(r13) 861 - LOAD_HANDLER(r10, .slb_miss_realmode) 861 + LOAD_HANDLER(r10, slb_miss_realmode) 862 862 mtctr r10 863 863 bctr 864 864 #endif ··· 966 966 b system_call_common 967 967 968 968 ppc64_runlatch_on_trampoline: 969 - b .__ppc64_runlatch_on 969 + b __ppc64_runlatch_on 970 970 971 971 /* 972 972 * Here we have detected that the kernel stack pointer is bad. ··· 1025 1025 std r12,RESULT(r1) 1026 1026 std r11,STACK_FRAME_OVERHEAD-16(r1) 1027 1027 1: addi r3,r1,STACK_FRAME_OVERHEAD 1028 - bl .kernel_bad_stack 1028 + bl kernel_bad_stack 1029 1029 b 1b 1030 1030 1031 1031 /* ··· 1046 1046 ld r3,PACA_EXGEN+EX_DAR(r13) 1047 1047 lwz r4,PACA_EXGEN+EX_DSISR(r13) 1048 1048 li r5,0x300 1049 - b .do_hash_page /* Try to handle as hpte fault */ 1049 + b do_hash_page /* Try to handle as hpte fault */ 1050 1050 1051 1051 .align 7 1052 1052 .globl h_data_storage_common ··· 1056 1056 mfspr r10,SPRN_HDSISR 1057 1057 stw r10,PACA_EXGEN+EX_DSISR(r13) 1058 1058 EXCEPTION_PROLOG_COMMON(0xe00, PACA_EXGEN) 1059 - bl .save_nvgprs 1059 + bl save_nvgprs 1060 1060 DISABLE_INTS 1061 1061 addi r3,r1,STACK_FRAME_OVERHEAD 1062 - bl .unknown_exception 1063 - b .ret_from_except 1062 + bl unknown_exception 1063 + b ret_from_except 1064 1064 1065 1065 .align 7 1066 1066 .globl instruction_access_common ··· 1071 1071 ld r3,_NIP(r1) 1072 1072 andis. r4,r12,0x5820 1073 1073 li r5,0x400 1074 - b .do_hash_page /* Try to handle as hpte fault */ 1074 + b do_hash_page /* Try to handle as hpte fault */ 1075 1075 1076 - STD_EXCEPTION_COMMON(0xe20, h_instr_storage, .unknown_exception) 1076 + STD_EXCEPTION_COMMON(0xe20, h_instr_storage, unknown_exception) 1077 1077 1078 1078 /* 1079 1079 * Here is the common SLB miss user that is used when going to virtual ··· 1088 1088 stw r9,PACA_EXGEN+EX_CCR(r13) 1089 1089 std r10,PACA_EXGEN+EX_LR(r13) 1090 1090 std r11,PACA_EXGEN+EX_SRR0(r13) 1091 - bl .slb_allocate_user 1091 + bl slb_allocate_user 1092 1092 1093 1093 ld r10,PACA_EXGEN+EX_LR(r13) 1094 1094 ld r3,PACA_EXGEN+EX_R3(r13) ··· 1131 1131 unrecov_user_slb: 1132 1132 EXCEPTION_PROLOG_COMMON(0x4200, PACA_EXGEN) 1133 1133 DISABLE_INTS 1134 - bl .save_nvgprs 1134 + bl save_nvgprs 1135 1135 1: addi r3,r1,STACK_FRAME_OVERHEAD 1136 - bl .unrecoverable_exception 1136 + bl unrecoverable_exception 1137 1137 b 1b 1138 1138 1139 1139 #endif /* __DISABLED__ */ ··· 1158 1158 lwz r4,PACA_EXGEN+EX_DSISR(r13) 1159 1159 std r3,_DAR(r1) 1160 1160 std r4,_DSISR(r1) 1161 - bl .save_nvgprs 1161 + bl save_nvgprs 1162 1162 addi r3,r1,STACK_FRAME_OVERHEAD 1163 - bl .machine_check_exception 1164 - b .ret_from_except 1163 + bl machine_check_exception 1164 + b ret_from_except 1165 1165 1166 1166 .align 7 1167 1167 .globl alignment_common ··· 1175 1175 lwz r4,PACA_EXGEN+EX_DSISR(r13) 1176 1176 std r3,_DAR(r1) 1177 1177 std r4,_DSISR(r1) 1178 - bl .save_nvgprs 1178 + bl save_nvgprs 1179 1179 DISABLE_INTS 1180 1180 addi r3,r1,STACK_FRAME_OVERHEAD 1181 - bl .alignment_exception 1182 - b .ret_from_except 1181 + bl alignment_exception 1182 + b ret_from_except 1183 1183 1184 1184 .align 7 1185 1185 .globl program_check_common 1186 1186 program_check_common: 1187 1187 EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN) 1188 - bl .save_nvgprs 1188 + bl save_nvgprs 1189 1189 DISABLE_INTS 1190 1190 addi r3,r1,STACK_FRAME_OVERHEAD 1191 - bl .program_check_exception 1192 - b .ret_from_except 1191 + bl program_check_exception 1192 + b ret_from_except 1193 1193 1194 1194 .align 7 1195 1195 .globl fp_unavailable_common 1196 1196 fp_unavailable_common: 1197 1197 EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN) 1198 1198 bne 1f /* if from user, just load it up */ 1199 - bl .save_nvgprs 1199 + bl save_nvgprs 1200 1200 DISABLE_INTS 1201 1201 addi r3,r1,STACK_FRAME_OVERHEAD 1202 - bl .kernel_fp_unavailable_exception 1202 + bl kernel_fp_unavailable_exception 1203 1203 BUG_OPCODE 1204 1204 1: 1205 1205 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM ··· 1211 1211 bne- 2f 1212 1212 END_FTR_SECTION_IFSET(CPU_FTR_TM) 1213 1213 #endif 1214 - bl .load_up_fpu 1214 + bl load_up_fpu 1215 1215 b fast_exception_return 1216 1216 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM 1217 1217 2: /* User process was in a transaction */ 1218 - bl .save_nvgprs 1218 + bl save_nvgprs 1219 1219 DISABLE_INTS 1220 1220 addi r3,r1,STACK_FRAME_OVERHEAD 1221 - bl .fp_unavailable_tm 1222 - b .ret_from_except 1221 + bl fp_unavailable_tm 1222 + b ret_from_except 1223 1223 #endif 1224 1224 .align 7 1225 1225 .globl altivec_unavailable_common ··· 1237 1237 bne- 2f 1238 1238 END_FTR_SECTION_NESTED(CPU_FTR_TM, CPU_FTR_TM, 69) 1239 1239 #endif 1240 - bl .load_up_altivec 1240 + bl load_up_altivec 1241 1241 b fast_exception_return 1242 1242 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM 1243 1243 2: /* User process was in a transaction */ 1244 - bl .save_nvgprs 1244 + bl save_nvgprs 1245 1245 DISABLE_INTS 1246 1246 addi r3,r1,STACK_FRAME_OVERHEAD 1247 - bl .altivec_unavailable_tm 1248 - b .ret_from_except 1247 + bl altivec_unavailable_tm 1248 + b ret_from_except 1249 1249 #endif 1250 1250 1: 1251 1251 END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) 1252 1252 #endif 1253 - bl .save_nvgprs 1253 + bl save_nvgprs 1254 1254 DISABLE_INTS 1255 1255 addi r3,r1,STACK_FRAME_OVERHEAD 1256 - bl .altivec_unavailable_exception 1257 - b .ret_from_except 1256 + bl altivec_unavailable_exception 1257 + b ret_from_except 1258 1258 1259 1259 .align 7 1260 1260 .globl vsx_unavailable_common ··· 1272 1272 bne- 2f 1273 1273 END_FTR_SECTION_NESTED(CPU_FTR_TM, CPU_FTR_TM, 69) 1274 1274 #endif 1275 - b .load_up_vsx 1275 + b load_up_vsx 1276 1276 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM 1277 1277 2: /* User process was in a transaction */ 1278 - bl .save_nvgprs 1278 + bl save_nvgprs 1279 1279 DISABLE_INTS 1280 1280 addi r3,r1,STACK_FRAME_OVERHEAD 1281 - bl .vsx_unavailable_tm 1282 - b .ret_from_except 1281 + bl vsx_unavailable_tm 1282 + b ret_from_except 1283 1283 #endif 1284 1284 1: 1285 1285 END_FTR_SECTION_IFSET(CPU_FTR_VSX) 1286 1286 #endif 1287 - bl .save_nvgprs 1287 + bl save_nvgprs 1288 1288 DISABLE_INTS 1289 1289 addi r3,r1,STACK_FRAME_OVERHEAD 1290 - bl .vsx_unavailable_exception 1291 - b .ret_from_except 1290 + bl vsx_unavailable_exception 1291 + b ret_from_except 1292 1292 1293 - STD_EXCEPTION_COMMON(0xf60, facility_unavailable, .facility_unavailable_exception) 1294 - STD_EXCEPTION_COMMON(0xf80, hv_facility_unavailable, .facility_unavailable_exception) 1293 + STD_EXCEPTION_COMMON(0xf60, facility_unavailable, facility_unavailable_exception) 1294 + STD_EXCEPTION_COMMON(0xf80, hv_facility_unavailable, facility_unavailable_exception) 1295 1295 1296 1296 .align 7 1297 1297 .globl __end_handlers ··· 1386 1386 machine_check_handle_early: 1387 1387 std r0,GPR0(r1) /* Save r0 */ 1388 1388 EXCEPTION_PROLOG_COMMON_3(0x200) 1389 - bl .save_nvgprs 1389 + bl save_nvgprs 1390 1390 addi r3,r1,STACK_FRAME_OVERHEAD 1391 - bl .machine_check_early 1391 + bl machine_check_early 1392 1392 ld r12,_MSR(r1) 1393 1393 #ifdef CONFIG_PPC_P7_NAP 1394 1394 /* ··· 1408 1408 /* Supervisor state loss */ 1409 1409 li r0,1 1410 1410 stb r0,PACA_NAPSTATELOST(r13) 1411 - 3: bl .machine_check_queue_event 1411 + 3: bl machine_check_queue_event 1412 1412 MACHINE_CHECK_HANDLER_WINDUP 1413 1413 GET_PACA(r13) 1414 1414 ld r1,PACAR1(r13) 1415 - b .power7_enter_nap_mode 1415 + b power7_enter_nap_mode 1416 1416 4: 1417 1417 #endif 1418 1418 /* ··· 1444 1444 andi. r11,r12,MSR_RI 1445 1445 bne 2f 1446 1446 1: addi r3,r1,STACK_FRAME_OVERHEAD 1447 - bl .unrecoverable_exception 1447 + bl unrecoverable_exception 1448 1448 b 1b 1449 1449 2: 1450 1450 /* ··· 1452 1452 * Queue up the MCE event so that we can log it later, while 1453 1453 * returning from kernel or opal call. 1454 1454 */ 1455 - bl .machine_check_queue_event 1455 + bl machine_check_queue_event 1456 1456 MACHINE_CHECK_HANDLER_WINDUP 1457 1457 rfid 1458 1458 9: ··· 1468 1468 * r3 is saved in paca->slb_r3 1469 1469 * We assume we aren't going to take any exceptions during this procedure. 1470 1470 */ 1471 - _GLOBAL(slb_miss_realmode) 1471 + slb_miss_realmode: 1472 1472 mflr r10 1473 1473 #ifdef CONFIG_RELOCATABLE 1474 1474 mtctr r11 ··· 1477 1477 stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */ 1478 1478 std r10,PACA_EXSLB+EX_LR(r13) /* save LR */ 1479 1479 1480 - bl .slb_allocate_realmode 1480 + bl slb_allocate_realmode 1481 1481 1482 1482 /* All done -- return from exception. */ 1483 1483 ··· 1517 1517 unrecov_slb: 1518 1518 EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB) 1519 1519 DISABLE_INTS 1520 - bl .save_nvgprs 1520 + bl save_nvgprs 1521 1521 1: addi r3,r1,STACK_FRAME_OVERHEAD 1522 - bl .unrecoverable_exception 1522 + bl unrecoverable_exception 1523 1523 b 1b 1524 1524 1525 1525 ··· 1536 1536 * Hash table stuff 1537 1537 */ 1538 1538 .align 7 1539 - _STATIC(do_hash_page) 1539 + do_hash_page: 1540 1540 std r3,_DAR(r1) 1541 1541 std r4,_DSISR(r1) 1542 1542 ··· 1573 1573 * 1574 1574 * at return r3 = 0 for success, 1 for page fault, negative for error 1575 1575 */ 1576 - bl .hash_page /* build HPTE if possible */ 1576 + bl hash_page /* build HPTE if possible */ 1577 1577 cmpdi r3,0 /* see if hash_page succeeded */ 1578 1578 1579 1579 /* Success */ ··· 1587 1587 11: ld r4,_DAR(r1) 1588 1588 ld r5,_DSISR(r1) 1589 1589 addi r3,r1,STACK_FRAME_OVERHEAD 1590 - bl .do_page_fault 1590 + bl do_page_fault 1591 1591 cmpdi r3,0 1592 1592 beq+ 12f 1593 - bl .save_nvgprs 1593 + bl save_nvgprs 1594 1594 mr r5,r3 1595 1595 addi r3,r1,STACK_FRAME_OVERHEAD 1596 1596 lwz r4,_DAR(r1) 1597 - bl .bad_page_fault 1598 - b .ret_from_except 1597 + bl bad_page_fault 1598 + b ret_from_except 1599 1599 1600 1600 /* We have a data breakpoint exception - handle it */ 1601 1601 handle_dabr_fault: 1602 - bl .save_nvgprs 1602 + bl save_nvgprs 1603 1603 ld r4,_DAR(r1) 1604 1604 ld r5,_DSISR(r1) 1605 1605 addi r3,r1,STACK_FRAME_OVERHEAD 1606 - bl .do_break 1607 - 12: b .ret_from_except_lite 1606 + bl do_break 1607 + 12: b ret_from_except_lite 1608 1608 1609 1609 1610 1610 /* We have a page fault that hash_page could handle but HV refused 1611 1611 * the PTE insertion 1612 1612 */ 1613 - 13: bl .save_nvgprs 1613 + 13: bl save_nvgprs 1614 1614 mr r5,r3 1615 1615 addi r3,r1,STACK_FRAME_OVERHEAD 1616 1616 ld r4,_DAR(r1) 1617 - bl .low_hash_fault 1618 - b .ret_from_except 1617 + bl low_hash_fault 1618 + b ret_from_except 1619 1619 1620 1620 /* 1621 1621 * We come here as a result of a DSI at a point where we don't want ··· 1624 1624 * were soft-disabled. We want to invoke the exception handler for 1625 1625 * the access, or panic if there isn't a handler. 1626 1626 */ 1627 - 77: bl .save_nvgprs 1627 + 77: bl save_nvgprs 1628 1628 mr r4,r3 1629 1629 addi r3,r1,STACK_FRAME_OVERHEAD 1630 1630 li r5,SIGSEGV 1631 - bl .bad_page_fault 1632 - b .ret_from_except 1631 + bl bad_page_fault 1632 + b ret_from_except 1633 1633 1634 1634 /* here we have a segment miss */ 1635 1635 do_ste_alloc: 1636 - bl .ste_allocate /* try to insert stab entry */ 1636 + bl ste_allocate /* try to insert stab entry */ 1637 1637 cmpdi r3,0 1638 1638 bne- handle_page_fault 1639 1639 b fast_exception_return ··· 1646 1646 * We assume (DAR >> 60) == 0xc. 1647 1647 */ 1648 1648 .align 7 1649 - _GLOBAL(do_stab_bolted) 1649 + do_stab_bolted: 1650 1650 stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */ 1651 1651 std r11,PACA_EXSLB+EX_SRR0(r13) /* save SRR0 in exc. frame */ 1652 1652 mfspr r11,SPRN_DAR /* ea */
+8 -5
arch/powerpc/kernel/fadump.c
··· 69 69 */ 70 70 token = of_get_flat_dt_prop(node, "ibm,configure-kernel-dump", NULL); 71 71 if (!token) 72 - return 0; 72 + return 1; 73 73 74 74 fw_dump.fadump_supported = 1; 75 75 fw_dump.ibm_configure_kernel_dump = *token; ··· 92 92 &size); 93 93 94 94 if (!sections) 95 - return 0; 95 + return 1; 96 96 97 97 num_sections = size / (3 * sizeof(u32)); 98 98 ··· 110 110 break; 111 111 } 112 112 } 113 + 113 114 return 1; 114 115 } 115 116 ··· 646 645 } 647 646 /* Lower 4 bytes of reg_value contains logical cpu id */ 648 647 cpu = reg_entry->reg_value & FADUMP_CPU_ID_MASK; 649 - if (!cpumask_test_cpu(cpu, &fdh->cpu_online_mask)) { 648 + if (fdh && !cpumask_test_cpu(cpu, &fdh->cpu_online_mask)) { 650 649 SKIP_TO_NEXT_CPU(reg_entry); 651 650 continue; 652 651 } ··· 663 662 } 664 663 fadump_final_note(note_buf); 665 664 666 - pr_debug("Updating elfcore header (%llx) with cpu notes\n", 665 + if (fdh) { 666 + pr_debug("Updating elfcore header (%llx) with cpu notes\n", 667 667 fdh->elfcorehdr_addr); 668 - fadump_update_elfcore_header((char *)__va(fdh->elfcorehdr_addr)); 668 + fadump_update_elfcore_header((char *)__va(fdh->elfcorehdr_addr)); 669 + } 669 670 return 0; 670 671 671 672 error_out:
+39 -98
arch/powerpc/kernel/ftrace.c
··· 105 105 struct dyn_ftrace *rec, unsigned long addr) 106 106 { 107 107 unsigned int op; 108 - unsigned int jmp[5]; 109 108 unsigned long ptr; 110 109 unsigned long ip = rec->ip; 111 - unsigned long tramp; 112 - int offset; 110 + void *tramp; 113 111 114 112 /* read where this goes */ 115 113 if (probe_kernel_read(&op, (void *)ip, sizeof(int))) ··· 120 122 } 121 123 122 124 /* lets find where the pointer goes */ 123 - tramp = find_bl_target(ip, op); 125 + tramp = (void *)find_bl_target(ip, op); 124 126 125 - /* 126 - * On PPC64 the trampoline looks like: 127 - * 0x3d, 0x82, 0x00, 0x00, addis r12,r2, <high> 128 - * 0x39, 0x8c, 0x00, 0x00, addi r12,r12, <low> 129 - * Where the bytes 2,3,6 and 7 make up the 32bit offset 130 - * to the TOC that holds the pointer. 131 - * to jump to. 132 - * 0xf8, 0x41, 0x00, 0x28, std r2,40(r1) 133 - * 0xe9, 0x6c, 0x00, 0x20, ld r11,32(r12) 134 - * The actually address is 32 bytes from the offset 135 - * into the TOC. 136 - * 0xe8, 0x4c, 0x00, 0x28, ld r2,40(r12) 137 - */ 127 + pr_devel("ip:%lx jumps to %p", ip, tramp); 138 128 139 - pr_devel("ip:%lx jumps to %lx r2: %lx", ip, tramp, mod->arch.toc); 140 - 141 - /* Find where the trampoline jumps to */ 142 - if (probe_kernel_read(jmp, (void *)tramp, sizeof(jmp))) { 143 - printk(KERN_ERR "Failed to read %lx\n", tramp); 144 - return -EFAULT; 145 - } 146 - 147 - pr_devel(" %08x %08x", jmp[0], jmp[1]); 148 - 149 - /* verify that this is what we expect it to be */ 150 - if (((jmp[0] & 0xffff0000) != 0x3d820000) || 151 - ((jmp[1] & 0xffff0000) != 0x398c0000) || 152 - (jmp[2] != 0xf8410028) || 153 - (jmp[3] != 0xe96c0020) || 154 - (jmp[4] != 0xe84c0028)) { 129 + if (!is_module_trampoline(tramp)) { 155 130 printk(KERN_ERR "Not a trampoline\n"); 156 131 return -EINVAL; 157 132 } 158 133 159 - /* The bottom half is signed extended */ 160 - offset = ((unsigned)((unsigned short)jmp[0]) << 16) + 161 - (int)((short)jmp[1]); 162 - 163 - pr_devel(" %x ", offset); 164 - 165 - /* get the address this jumps too */ 166 - tramp = mod->arch.toc + offset + 32; 167 - pr_devel("toc: %lx", tramp); 168 - 169 - if (probe_kernel_read(jmp, (void *)tramp, 8)) { 170 - printk(KERN_ERR "Failed to read %lx\n", tramp); 134 + if (module_trampoline_target(mod, tramp, &ptr)) { 135 + printk(KERN_ERR "Failed to get trampoline target\n"); 171 136 return -EFAULT; 172 137 } 173 138 174 - pr_devel(" %08x %08x\n", jmp[0], jmp[1]); 175 - 176 - #ifdef __LITTLE_ENDIAN__ 177 - ptr = ((unsigned long)jmp[1] << 32) + jmp[0]; 178 - #else 179 - ptr = ((unsigned long)jmp[0] << 32) + jmp[1]; 180 - #endif 139 + pr_devel("trampoline target %lx", ptr); 181 140 182 141 /* This should match what was called */ 183 142 if (ptr != ppc_function_entry((void *)addr)) { 184 - printk(KERN_ERR "addr does not match %lx\n", ptr); 143 + printk(KERN_ERR "addr %lx does not match expected %lx\n", 144 + ptr, ppc_function_entry((void *)addr)); 185 145 return -EINVAL; 186 146 } 187 147 188 148 /* 189 - * We want to nop the line, but the next line is 190 - * 0xe8, 0x41, 0x00, 0x28 ld r2,40(r1) 191 - * This needs to be turned to a nop too. 192 - */ 193 - if (probe_kernel_read(&op, (void *)(ip+4), MCOUNT_INSN_SIZE)) 194 - return -EFAULT; 195 - 196 - if (op != 0xe8410028) { 197 - printk(KERN_ERR "Next line is not ld! (%08x)\n", op); 198 - return -EINVAL; 199 - } 200 - 201 - /* 202 - * Milton Miller pointed out that we can not blindly do nops. 203 - * If a task was preempted when calling a trace function, 204 - * the nops will remove the way to restore the TOC in r2 205 - * and the r2 TOC will get corrupted. 206 - */ 207 - 208 - /* 209 - * Replace: 210 - * bl <tramp> <==== will be replaced with "b 1f" 211 - * ld r2,40(r1) 212 - * 1: 149 + * Our original call site looks like: 150 + * 151 + * bl <tramp> 152 + * ld r2,XX(r1) 153 + * 154 + * Milton Miller pointed out that we can not simply nop the branch. 155 + * If a task was preempted when calling a trace function, the nops 156 + * will remove the way to restore the TOC in r2 and the r2 TOC will 157 + * get corrupted. 158 + * 159 + * Use a b +8 to jump over the load. 213 160 */ 214 161 op = 0x48000008; /* b +8 */ 215 162 ··· 292 349 __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) 293 350 { 294 351 unsigned int op[2]; 295 - unsigned long ip = rec->ip; 352 + void *ip = (void *)rec->ip; 296 353 297 354 /* read where this goes */ 298 - if (probe_kernel_read(op, (void *)ip, MCOUNT_INSN_SIZE * 2)) 355 + if (probe_kernel_read(op, ip, sizeof(op))) 299 356 return -EFAULT; 300 357 301 358 /* 302 - * It should be pointing to two nops or 303 - * b +8; ld r2,40(r1) 359 + * We expect to see: 360 + * 361 + * b +8 362 + * ld r2,XX(r1) 363 + * 364 + * The load offset is different depending on the ABI. For simplicity 365 + * just mask it out when doing the compare. 304 366 */ 305 - if (((op[0] != 0x48000008) || (op[1] != 0xe8410028)) && 306 - ((op[0] != PPC_INST_NOP) || (op[1] != PPC_INST_NOP))) { 307 - printk(KERN_ERR "Expected NOPs but have %x %x\n", op[0], op[1]); 367 + if ((op[0] != 0x48000008) || ((op[1] & 0xffff00000) != 0xe8410000)) { 368 + printk(KERN_ERR "Unexpected call sequence: %x %x\n", 369 + op[0], op[1]); 308 370 return -EINVAL; 309 371 } 310 372 ··· 319 371 return -EINVAL; 320 372 } 321 373 322 - /* create the branch to the trampoline */ 323 - op[0] = create_branch((unsigned int *)ip, 324 - rec->arch.mod->arch.tramp, BRANCH_SET_LINK); 325 - if (!op[0]) { 326 - printk(KERN_ERR "REL24 out of range!\n"); 374 + /* Ensure branch is within 24 bits */ 375 + if (create_branch(ip, rec->arch.mod->arch.tramp, BRANCH_SET_LINK)) { 376 + printk(KERN_ERR "Branch out of range"); 327 377 return -EINVAL; 328 378 } 329 379 330 - /* ld r2,40(r1) */ 331 - op[1] = 0xe8410028; 332 - 333 - pr_devel("write to %lx\n", rec->ip); 334 - 335 - if (probe_kernel_write((void *)ip, op, MCOUNT_INSN_SIZE * 2)) 336 - return -EPERM; 337 - 338 - flush_icache_range(ip, ip + 8); 380 + if (patch_branch(ip, rec->arch.mod->arch.tramp, BRANCH_SET_LINK)) { 381 + printk(KERN_ERR "REL24 out of range!\n"); 382 + return -EINVAL; 383 + } 339 384 340 385 return 0; 341 386 }
+59 -58
arch/powerpc/kernel/head_64.S
··· 70 70 /* NOP this out unconditionally */ 71 71 BEGIN_FTR_SECTION 72 72 FIXUP_ENDIAN 73 - b .__start_initialization_multiplatform 73 + b __start_initialization_multiplatform 74 74 END_FTR_SECTION(0, 1) 75 75 76 76 /* Catch branch to 0 in real mode */ 77 77 trap 78 78 79 - /* Secondary processors spin on this value until it becomes nonzero. 80 - * When it does it contains the real address of the descriptor 81 - * of the function that the cpu should jump to to continue 82 - * initialization. 79 + /* Secondary processors spin on this value until it becomes non-zero. 80 + * When non-zero, it contains the real address of the function the cpu 81 + * should jump to. 83 82 */ 84 83 .balign 8 85 84 .globl __secondary_hold_spinloop ··· 139 140 tovirt(r26,r26) 140 141 #endif 141 142 /* All secondary cpus wait here until told to start. */ 142 - 100: ld r4,__secondary_hold_spinloop-_stext(r26) 143 - cmpdi 0,r4,0 143 + 100: ld r12,__secondary_hold_spinloop-_stext(r26) 144 + cmpdi 0,r12,0 144 145 beq 100b 145 146 146 147 #if defined(CONFIG_SMP) || defined(CONFIG_KEXEC) 147 148 #ifdef CONFIG_PPC_BOOK3E 148 - tovirt(r4,r4) 149 + tovirt(r12,r12) 149 150 #endif 150 - ld r4,0(r4) /* deref function descriptor */ 151 - mtctr r4 151 + mtctr r12 152 152 mr r3,r24 153 153 /* 154 154 * it may be the case that other platforms have r4 right to ··· 184 186 mr r24,r3 185 187 186 188 /* turn on 64-bit mode */ 187 - bl .enable_64b_mode 189 + bl enable_64b_mode 188 190 189 191 /* get a valid TOC pointer, wherever we're mapped at */ 190 - bl .relative_toc 192 + bl relative_toc 191 193 tovirt(r2,r2) 192 194 193 195 #ifdef CONFIG_PPC_BOOK3E 194 196 /* Book3E initialization */ 195 197 mr r3,r24 196 - bl .book3e_secondary_thread_init 198 + bl book3e_secondary_thread_init 197 199 #endif 198 200 b generic_secondary_common_init 199 201 ··· 212 214 mr r25,r4 213 215 214 216 /* turn on 64-bit mode */ 215 - bl .enable_64b_mode 217 + bl enable_64b_mode 216 218 217 219 /* get a valid TOC pointer, wherever we're mapped at */ 218 - bl .relative_toc 220 + bl relative_toc 219 221 tovirt(r2,r2) 220 222 221 223 #ifdef CONFIG_PPC_BOOK3E 222 224 /* Book3E initialization */ 223 225 mr r3,r24 224 226 mr r4,r25 225 - bl .book3e_secondary_core_init 227 + bl book3e_secondary_core_init 226 228 #endif 227 229 228 230 generic_secondary_common_init: ··· 234 236 ld r13,0(r13) /* Get base vaddr of paca array */ 235 237 #ifndef CONFIG_SMP 236 238 addi r13,r13,PACA_SIZE /* know r13 if used accidentally */ 237 - b .kexec_wait /* wait for next kernel if !SMP */ 239 + b kexec_wait /* wait for next kernel if !SMP */ 238 240 #else 239 241 LOAD_REG_ADDR(r7, nr_cpu_ids) /* Load nr_cpu_ids address */ 240 242 lwz r7,0(r7) /* also the max paca allocated */ ··· 248 250 blt 1b 249 251 250 252 mr r3,r24 /* not found, copy phys to r3 */ 251 - b .kexec_wait /* next kernel might do better */ 253 + b kexec_wait /* next kernel might do better */ 252 254 253 255 2: SET_PACA(r13) 254 256 #ifdef CONFIG_PPC_BOOK3E ··· 262 264 /* See if we need to call a cpu state restore handler */ 263 265 LOAD_REG_ADDR(r23, cur_cpu_spec) 264 266 ld r23,0(r23) 265 - ld r23,CPU_SPEC_RESTORE(r23) 266 - cmpdi 0,r23,0 267 + ld r12,CPU_SPEC_RESTORE(r23) 268 + cmpdi 0,r12,0 267 269 beq 3f 268 - ld r23,0(r23) 269 - mtctr r23 270 + #if !defined(_CALL_ELF) || _CALL_ELF != 2 271 + ld r12,0(r12) 272 + #endif 273 + mtctr r12 270 274 bctrl 271 275 272 276 3: LOAD_REG_ADDR(r3, spinning_secondaries) /* Decrement spinning_secondaries */ ··· 299 299 * Assumes we're mapped EA == RA if the MMU is on. 300 300 */ 301 301 #ifdef CONFIG_PPC_BOOK3S 302 - _STATIC(__mmu_off) 302 + __mmu_off: 303 303 mfmsr r3 304 304 andi. r0,r3,MSR_IR|MSR_DR 305 305 beqlr ··· 324 324 * DT block, r4 is a physical pointer to the kernel itself 325 325 * 326 326 */ 327 - _GLOBAL(__start_initialization_multiplatform) 327 + __start_initialization_multiplatform: 328 328 /* Make sure we are running in 64 bits mode */ 329 - bl .enable_64b_mode 329 + bl enable_64b_mode 330 330 331 331 /* Get TOC pointer (current runtime address) */ 332 - bl .relative_toc 332 + bl relative_toc 333 333 334 334 /* find out where we are now */ 335 335 bcl 20,31,$+4 ··· 342 342 */ 343 343 cmpldi cr0,r5,0 344 344 beq 1f 345 - b .__boot_from_prom /* yes -> prom */ 345 + b __boot_from_prom /* yes -> prom */ 346 346 1: 347 347 /* Save parameters */ 348 348 mr r31,r3 ··· 354 354 #endif 355 355 356 356 #ifdef CONFIG_PPC_BOOK3E 357 - bl .start_initialization_book3e 358 - b .__after_prom_start 357 + bl start_initialization_book3e 358 + b __after_prom_start 359 359 #else 360 360 /* Setup some critical 970 SPRs before switching MMU off */ 361 361 mfspr r0,SPRN_PVR ··· 368 368 beq 1f 369 369 cmpwi r0,0x45 /* 970GX */ 370 370 bne 2f 371 - 1: bl .__cpu_preinit_ppc970 371 + 1: bl __cpu_preinit_ppc970 372 372 2: 373 373 374 374 /* Switch off MMU if not already off */ 375 - bl .__mmu_off 376 - b .__after_prom_start 375 + bl __mmu_off 376 + b __after_prom_start 377 377 #endif /* CONFIG_PPC_BOOK3E */ 378 378 379 - _INIT_STATIC(__boot_from_prom) 379 + __boot_from_prom: 380 380 #ifdef CONFIG_PPC_OF_BOOT_TRAMPOLINE 381 381 /* Save parameters */ 382 382 mr r31,r3 ··· 395 395 #ifdef CONFIG_RELOCATABLE 396 396 /* Relocate code for where we are now */ 397 397 mr r3,r26 398 - bl .relocate 398 + bl relocate 399 399 #endif 400 400 401 401 /* Restore parameters */ ··· 407 407 408 408 /* Do all of the interaction with OF client interface */ 409 409 mr r8,r26 410 - bl .prom_init 410 + bl prom_init 411 411 #endif /* #CONFIG_PPC_OF_BOOT_TRAMPOLINE */ 412 412 413 413 /* We never return. We also hit that trap if trying to boot 414 414 * from OF while CONFIG_PPC_OF_BOOT_TRAMPOLINE isn't selected */ 415 415 trap 416 416 417 - _STATIC(__after_prom_start) 417 + __after_prom_start: 418 418 #ifdef CONFIG_RELOCATABLE 419 419 /* process relocations for the final address of the kernel */ 420 420 lis r25,PAGE_OFFSET@highest /* compute virtual base of kernel */ ··· 424 424 bne 1f 425 425 add r25,r25,r26 426 426 1: mr r3,r25 427 - bl .relocate 427 + bl relocate 428 428 #endif 429 429 430 430 /* ··· 464 464 lis r5,(copy_to_here - _stext)@ha 465 465 addi r5,r5,(copy_to_here - _stext)@l /* # bytes of memory to copy */ 466 466 467 - bl .copy_and_flush /* copy the first n bytes */ 467 + bl copy_and_flush /* copy the first n bytes */ 468 468 /* this includes the code being */ 469 469 /* executed here. */ 470 470 addis r8,r3,(4f - _stext)@ha /* Jump to the copy of this code */ 471 - addi r8,r8,(4f - _stext)@l /* that we just made */ 472 - mtctr r8 471 + addi r12,r8,(4f - _stext)@l /* that we just made */ 472 + mtctr r12 473 473 bctr 474 474 475 475 .balign 8 ··· 478 478 4: /* Now copy the rest of the kernel up to _end */ 479 479 addis r5,r26,(p_end - _stext)@ha 480 480 ld r5,(p_end - _stext)@l(r5) /* get _end */ 481 - 5: bl .copy_and_flush /* copy the rest */ 481 + 5: bl copy_and_flush /* copy the rest */ 482 482 483 - 9: b .start_here_multiplatform 483 + 9: b start_here_multiplatform 484 484 485 485 /* 486 486 * Copy routine used to copy the kernel to start at physical address 0 ··· 544 544 545 545 _GLOBAL(pmac_secondary_start) 546 546 /* turn on 64-bit mode */ 547 - bl .enable_64b_mode 547 + bl enable_64b_mode 548 548 549 549 li r0,0 550 550 mfspr r3,SPRN_HID4 ··· 556 556 slbia 557 557 558 558 /* get TOC pointer (real address) */ 559 - bl .relative_toc 559 + bl relative_toc 560 560 tovirt(r2,r2) 561 561 562 562 /* Copy some CPU settings from CPU 0 */ 563 - bl .__restore_cpu_ppc970 563 + bl __restore_cpu_ppc970 564 564 565 565 /* pSeries do that early though I don't think we really need it */ 566 566 mfmsr r3 ··· 619 619 std r14,PACAKSAVE(r13) 620 620 621 621 /* Do early setup for that CPU (stab, slb, hash table pointer) */ 622 - bl .early_setup_secondary 622 + bl early_setup_secondary 623 623 624 624 /* 625 625 * setup the new stack pointer, but *don't* use this until ··· 639 639 stb r0,PACAIRQHAPPENED(r13) 640 640 641 641 /* enable MMU and jump to start_secondary */ 642 - LOAD_REG_ADDR(r3, .start_secondary_prolog) 642 + LOAD_REG_ADDR(r3, start_secondary_prolog) 643 643 LOAD_REG_IMMEDIATE(r4, MSR_KERNEL) 644 644 645 645 mtspr SPRN_SRR0,r3 ··· 652 652 * zero the stack back-chain pointer and get the TOC virtual address 653 653 * before going into C code. 654 654 */ 655 - _GLOBAL(start_secondary_prolog) 655 + start_secondary_prolog: 656 656 ld r2,PACATOC(r13) 657 657 li r3,0 658 658 std r3,0(r1) /* Zero the stack frame pointer */ 659 - bl .start_secondary 659 + bl start_secondary 660 660 b . 661 661 /* 662 662 * Reset stack pointer and call start_secondary ··· 667 667 ld r1,PACAKSAVE(r13) /* Reload kernel stack pointer */ 668 668 li r3,0 669 669 std r3,0(r1) /* Zero the stack frame pointer */ 670 - bl .start_secondary 670 + bl start_secondary 671 671 b . 672 672 #endif 673 673 674 674 /* 675 675 * This subroutine clobbers r11 and r12 676 676 */ 677 - _GLOBAL(enable_64b_mode) 677 + enable_64b_mode: 678 678 mfmsr r11 /* grab the current MSR */ 679 679 #ifdef CONFIG_PPC_BOOK3E 680 680 oris r11,r11,0x8000 /* CM bit set, we'll set ICM later */ ··· 715 715 /* 716 716 * This is where the main kernel code starts. 717 717 */ 718 - _INIT_STATIC(start_here_multiplatform) 718 + start_here_multiplatform: 719 719 /* set up the TOC */ 720 - bl .relative_toc 720 + bl relative_toc 721 721 tovirt(r2,r2) 722 722 723 723 /* Clear out the BSS. It may have been done in prom_init, ··· 776 776 777 777 /* Restore parameters passed from prom_init/kexec */ 778 778 mr r3,r31 779 - bl .early_setup /* also sets r13 and SPRG_PACA */ 779 + bl early_setup /* also sets r13 and SPRG_PACA */ 780 780 781 - LOAD_REG_ADDR(r3, .start_here_common) 781 + LOAD_REG_ADDR(r3, start_here_common) 782 782 ld r4,PACAKMSR(r13) 783 783 mtspr SPRN_SRR0,r3 784 784 mtspr SPRN_SRR1,r4 ··· 786 786 b . /* prevent speculative execution */ 787 787 788 788 /* This is where all platforms converge execution */ 789 - _INIT_GLOBAL(start_here_common) 789 + 790 + start_here_common: 790 791 /* relocation is on at this point */ 791 792 std r1,PACAKSAVE(r13) 792 793 ··· 795 794 ld r2,PACATOC(r13) 796 795 797 796 /* Do more system initializations in virtual mode */ 798 - bl .setup_system 797 + bl setup_system 799 798 800 799 /* Mark interrupts soft and hard disabled (they might be enabled 801 800 * in the PACA when doing hotplug) ··· 806 805 stb r0,PACAIRQHAPPENED(r13) 807 806 808 807 /* Generic kernel entry */ 809 - bl .start_kernel 808 + bl start_kernel 810 809 811 810 /* Not reached */ 812 811 BUG_OPCODE
+4 -4
arch/powerpc/kernel/hw_breakpoint.c
··· 72 72 * If so, DABR will be populated in single_step_dabr_instruction(). 73 73 */ 74 74 if (current->thread.last_hit_ubp != bp) 75 - set_breakpoint(info); 75 + __set_breakpoint(info); 76 76 77 77 return 0; 78 78 } ··· 198 198 199 199 info = counter_arch_bp(tsk->thread.last_hit_ubp); 200 200 regs->msr &= ~MSR_SE; 201 - set_breakpoint(info); 201 + __set_breakpoint(info); 202 202 tsk->thread.last_hit_ubp = NULL; 203 203 } 204 204 ··· 284 284 if (!(info->type & HW_BRK_TYPE_EXTRANEOUS_IRQ)) 285 285 perf_bp_event(bp, regs); 286 286 287 - set_breakpoint(info); 287 + __set_breakpoint(info); 288 288 out: 289 289 rcu_read_unlock(); 290 290 return rc; ··· 316 316 if (!(info->type & HW_BRK_TYPE_EXTRANEOUS_IRQ)) 317 317 perf_bp_event(bp, regs); 318 318 319 - set_breakpoint(info); 319 + __set_breakpoint(info); 320 320 current->thread.last_hit_ubp = NULL; 321 321 322 322 /*
+1 -1
arch/powerpc/kernel/idle_book3e.S
··· 43 43 */ 44 44 #ifdef CONFIG_TRACE_IRQFLAGS 45 45 stdu r1,-128(r1) 46 - bl .trace_hardirqs_on 46 + bl trace_hardirqs_on 47 47 addi r1,r1,128 48 48 #endif 49 49 li r0,1
+1 -1
arch/powerpc/kernel/idle_power4.S
··· 46 46 mflr r0 47 47 std r0,16(r1) 48 48 stdu r1,-128(r1) 49 - bl .trace_hardirqs_on 49 + bl trace_hardirqs_on 50 50 addi r1,r1,128 51 51 ld r0,16(r1) 52 52 mtlr r0
+11 -2
arch/powerpc/kernel/idle_power7.S
··· 39 39 * Pass requested state in r3: 40 40 * 0 - nap 41 41 * 1 - sleep 42 + * 43 + * To check IRQ_HAPPENED in r4 44 + * 0 - don't check 45 + * 1 - check 42 46 */ 43 47 _GLOBAL(power7_powersave_common) 44 48 /* Use r3 to pass state nap/sleep/winkle */ ··· 62 58 /* Make sure FPU, VSX etc... are flushed as we may lose 63 59 * state when going to nap mode 64 60 */ 65 - bl .discard_lazy_cpu_state 61 + bl discard_lazy_cpu_state 66 62 #endif /* CONFIG_SMP */ 67 63 68 64 /* Hard disable interrupts */ ··· 74 70 /* Check if something happened while soft-disabled */ 75 71 lbz r0,PACAIRQHAPPENED(r13) 76 72 cmpwi cr0,r0,0 73 + beq 1f 74 + cmpwi cr0,r4,0 77 75 beq 1f 78 76 addi r1,r1,INT_FRAME_SIZE 79 77 ld r0,16(r1) ··· 120 114 lwz r4,ADDROFF(powersave_nap)(r3) 121 115 cmpwi 0,r4,0 122 116 beqlr 117 + li r3, 1 123 118 /* fall through */ 124 119 125 120 _GLOBAL(power7_nap) 121 + mr r4,r3 126 122 li r3,0 127 123 b power7_powersave_common 128 124 /* No return */ 129 125 130 126 _GLOBAL(power7_sleep) 131 127 li r3,1 128 + li r4,0 132 129 b power7_powersave_common 133 130 /* No return */ 134 131 ··· 177 168 _GLOBAL(power7_wakeup_noloss) 178 169 lbz r0,PACA_NAPSTATELOST(r13) 179 170 cmpwi r0,0 180 - bne .power7_wakeup_loss 171 + bne power7_wakeup_loss 181 172 ld r1,PACAR1(r13) 182 173 ld r4,_MSR(r1) 183 174 ld r5,_NIP(r1)
+24 -12
arch/powerpc/kernel/legacy_serial.c
··· 48 48 static unsigned int legacy_serial_count; 49 49 static int legacy_serial_console = -1; 50 50 51 + static const upf_t legacy_port_flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 52 + UPF_SHARE_IRQ | UPF_FIXED_PORT; 53 + 51 54 static unsigned int tsi_serial_in(struct uart_port *p, int offset) 52 55 { 53 56 unsigned int tmp; ··· 74 71 phys_addr_t taddr, unsigned long irq, 75 72 upf_t flags, int irq_check_parent) 76 73 { 77 - const __be32 *clk, *spd; 74 + const __be32 *clk, *spd, *rs; 78 75 u32 clock = BASE_BAUD * 16; 76 + u32 shift = 0; 79 77 int index; 80 78 81 79 /* get clock freq. if present */ ··· 86 82 87 83 /* get default speed if present */ 88 84 spd = of_get_property(np, "current-speed", NULL); 85 + 86 + /* get register shift if present */ 87 + rs = of_get_property(np, "reg-shift", NULL); 88 + if (rs && *rs) 89 + shift = be32_to_cpup(rs); 89 90 90 91 /* If we have a location index, then try to use it */ 91 92 if (want_index >= 0 && want_index < MAX_LEGACY_SERIAL_PORTS) ··· 135 126 legacy_serial_ports[index].uartclk = clock; 136 127 legacy_serial_ports[index].irq = irq; 137 128 legacy_serial_ports[index].flags = flags; 129 + legacy_serial_ports[index].regshift = shift; 138 130 legacy_serial_infos[index].taddr = taddr; 139 131 legacy_serial_infos[index].np = of_node_get(np); 140 132 legacy_serial_infos[index].clock = clock; ··· 163 153 { 164 154 u64 addr; 165 155 const __be32 *addrp; 166 - upf_t flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ 167 - | UPF_FIXED_PORT; 168 156 struct device_node *tsi = of_get_parent(np); 169 157 170 158 /* We only support ports that have a clock frequency properly ··· 171 163 if (of_get_property(np, "clock-frequency", NULL) == NULL) 172 164 return -1; 173 165 174 - /* if reg-shift or offset, don't try to use it */ 175 - if ((of_get_property(np, "reg-shift", NULL) != NULL) || 176 - (of_get_property(np, "reg-offset", NULL) != NULL)) 166 + /* if reg-offset don't try to use it */ 167 + if ((of_get_property(np, "reg-offset", NULL) != NULL)) 177 168 return -1; 178 169 179 170 /* if rtas uses this device, don't try to use it as well */ ··· 192 185 * IO port value. It will be fixed up later along with the irq 193 186 */ 194 187 if (tsi && !strcmp(tsi->type, "tsi-bridge")) 195 - return add_legacy_port(np, -1, UPIO_TSI, addr, addr, NO_IRQ, flags, 0); 188 + return add_legacy_port(np, -1, UPIO_TSI, addr, addr, 189 + NO_IRQ, legacy_port_flags, 0); 196 190 else 197 - return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ, flags, 0); 191 + return add_legacy_port(np, -1, UPIO_MEM, addr, addr, 192 + NO_IRQ, legacy_port_flags, 0); 198 193 } 199 194 200 195 static int __init add_legacy_isa_port(struct device_node *np, ··· 242 233 243 234 /* Add port, irq will be dealt with later */ 244 235 return add_legacy_port(np, index, UPIO_PORT, be32_to_cpu(reg[1]), 245 - taddr, NO_IRQ, UPF_BOOT_AUTOCONF, 0); 236 + taddr, NO_IRQ, legacy_port_flags, 0); 246 237 247 238 } 248 239 ··· 315 306 * IO port value. It will be fixed up later along with the irq 316 307 */ 317 308 return add_legacy_port(np, index, iotype, base, addr, NO_IRQ, 318 - UPF_BOOT_AUTOCONF, np != pci_dev); 309 + legacy_port_flags, np != pci_dev); 319 310 } 320 311 #endif 321 312 ··· 324 315 struct legacy_serial_info *info = &legacy_serial_infos[console]; 325 316 struct plat_serial8250_port *port = &legacy_serial_ports[console]; 326 317 void __iomem *addr; 318 + unsigned int stride; 319 + 320 + stride = 1 << port->regshift; 327 321 328 322 /* Check if a translated MMIO address has been found */ 329 323 if (info->taddr) { 330 324 addr = ioremap(info->taddr, 0x1000); 331 325 if (addr == NULL) 332 326 return; 333 - udbg_uart_init_mmio(addr, 1); 327 + udbg_uart_init_mmio(addr, stride); 334 328 } else { 335 329 /* Check if it's PIO and we support untranslated PIO */ 336 330 if (port->iotype == UPIO_PORT && isa_io_special) 337 - udbg_uart_init_pio(port->iobase, 1); 331 + udbg_uart_init_pio(port->iobase, stride); 338 332 else 339 333 return; 340 334 }
+39 -7
arch/powerpc/kernel/misc_64.S
··· 34 34 std r0,16(r1) 35 35 stdu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r3) 36 36 mr r1,r3 37 - bl .__do_softirq 37 + bl __do_softirq 38 38 ld r1,0(r1) 39 39 ld r0,16(r1) 40 40 mtlr r0 ··· 45 45 std r0,16(r1) 46 46 stdu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r4) 47 47 mr r1,r4 48 - bl .__do_irq 48 + bl __do_irq 49 49 ld r1,0(r1) 50 50 ld r0,16(r1) 51 51 mtlr r0 ··· 506 506 stb r4,PACAKEXECSTATE(r13) 507 507 SYNC 508 508 509 - b .kexec_wait 509 + b kexec_wait 510 510 511 511 /* 512 512 * switch to real mode (turn mmu off) ··· 576 576 577 577 /* copy dest pages, flush whole dest image */ 578 578 mr r3,r29 579 - bl .kexec_copy_flush /* (image) */ 579 + bl kexec_copy_flush /* (image) */ 580 580 581 581 /* turn off mmu */ 582 582 bl real_mode ··· 586 586 mr r4,r30 /* start, aka phys mem offset */ 587 587 li r5,0x100 588 588 li r6,0 589 - bl .copy_and_flush /* (dest, src, copy limit, start offset) */ 589 + bl copy_and_flush /* (dest, src, copy limit, start offset) */ 590 590 1: /* assume normal blr return */ 591 591 592 592 /* release other cpus to the new kernel secondary start at 0x60 */ ··· 595 595 stw r6,kexec_flag-1b(5) 596 596 597 597 /* clear out hardware hash page table and tlb */ 598 - ld r5,0(r27) /* deref function descriptor */ 599 - mtctr r5 598 + #if !defined(_CALL_ELF) || _CALL_ELF != 2 599 + ld r12,0(r27) /* deref function descriptor */ 600 + #else 601 + mr r12,r27 602 + #endif 603 + mtctr r12 600 604 bctrl /* ppc_md.hpte_clear_all(void); */ 601 605 602 606 /* ··· 634 630 li r5,0 635 631 blr /* image->start(physid, image->start, 0); */ 636 632 #endif /* CONFIG_KEXEC */ 633 + 634 + #ifdef CONFIG_MODULES 635 + #if defined(_CALL_ELF) && _CALL_ELF == 2 636 + 637 + #ifdef CONFIG_MODVERSIONS 638 + .weak __crc_TOC. 639 + .section "___kcrctab+TOC.","a" 640 + .globl __kcrctab_TOC. 641 + __kcrctab_TOC.: 642 + .llong __crc_TOC. 643 + #endif 644 + 645 + /* 646 + * Export a fake .TOC. since both modpost and depmod will complain otherwise. 647 + * Both modpost and depmod strip the leading . so we do the same here. 648 + */ 649 + .section "__ksymtab_strings","a" 650 + __kstrtab_TOC.: 651 + .asciz "TOC." 652 + 653 + .section "___ksymtab+TOC.","a" 654 + /* This symbol name is important: it's used by modpost to find exported syms */ 655 + .globl __ksymtab_TOC. 656 + __ksymtab_TOC.: 657 + .llong 0 /* .value */ 658 + .llong __kstrtab_TOC. 659 + #endif /* ELFv2 */ 660 + #endif /* MODULES */
+225 -54
arch/powerpc/kernel/module_64.c
··· 22 22 #include <linux/vmalloc.h> 23 23 #include <linux/ftrace.h> 24 24 #include <linux/bug.h> 25 + #include <linux/uaccess.h> 25 26 #include <asm/module.h> 26 27 #include <asm/firmware.h> 27 28 #include <asm/code-patching.h> ··· 42 41 #define DEBUGP(fmt , ...) 43 42 #endif 44 43 44 + #if defined(_CALL_ELF) && _CALL_ELF == 2 45 + #define R2_STACK_OFFSET 24 46 + 47 + /* An address is simply the address of the function. */ 48 + typedef unsigned long func_desc_t; 49 + 50 + static func_desc_t func_desc(unsigned long addr) 51 + { 52 + return addr; 53 + } 54 + static unsigned long func_addr(unsigned long addr) 55 + { 56 + return addr; 57 + } 58 + static unsigned long stub_func_addr(func_desc_t func) 59 + { 60 + return func; 61 + } 62 + 63 + /* PowerPC64 specific values for the Elf64_Sym st_other field. */ 64 + #define STO_PPC64_LOCAL_BIT 5 65 + #define STO_PPC64_LOCAL_MASK (7 << STO_PPC64_LOCAL_BIT) 66 + #define PPC64_LOCAL_ENTRY_OFFSET(other) \ 67 + (((1 << (((other) & STO_PPC64_LOCAL_MASK) >> STO_PPC64_LOCAL_BIT)) >> 2) << 2) 68 + 69 + static unsigned int local_entry_offset(const Elf64_Sym *sym) 70 + { 71 + /* sym->st_other indicates offset to local entry point 72 + * (otherwise it will assume r12 is the address of the start 73 + * of function and try to derive r2 from it). */ 74 + return PPC64_LOCAL_ENTRY_OFFSET(sym->st_other); 75 + } 76 + #else 77 + #define R2_STACK_OFFSET 40 78 + 79 + /* An address is address of the OPD entry, which contains address of fn. */ 80 + typedef struct ppc64_opd_entry func_desc_t; 81 + 82 + static func_desc_t func_desc(unsigned long addr) 83 + { 84 + return *(struct ppc64_opd_entry *)addr; 85 + } 86 + static unsigned long func_addr(unsigned long addr) 87 + { 88 + return func_desc(addr).funcaddr; 89 + } 90 + static unsigned long stub_func_addr(func_desc_t func) 91 + { 92 + return func.funcaddr; 93 + } 94 + static unsigned int local_entry_offset(const Elf64_Sym *sym) 95 + { 96 + return 0; 97 + } 98 + #endif 99 + 45 100 /* Like PPC32, we need little trampolines to do > 24-bit jumps (into 46 101 the kernel itself). But on PPC64, these need to be used for every 47 102 jump, actually, to reset r2 (TOC+0x8000). */ 48 103 struct ppc64_stub_entry 49 104 { 50 - /* 28 byte jump instruction sequence (7 instructions) */ 51 - unsigned char jump[28]; 52 - unsigned char unused[4]; 105 + /* 28 byte jump instruction sequence (7 instructions). We only 106 + * need 6 instructions on ABIv2 but we always allocate 7 so 107 + * so we don't have to modify the trampoline load instruction. */ 108 + u32 jump[7]; 109 + u32 unused; 53 110 /* Data for the above code */ 54 - struct ppc64_opd_entry opd; 111 + func_desc_t funcdata; 55 112 }; 56 113 57 - /* We use a stub to fix up r2 (TOC ptr) and to jump to the (external) 58 - function which may be more than 24-bits away. We could simply 59 - patch the new r2 value and function pointer into the stub, but it's 60 - significantly shorter to put these values at the end of the stub 61 - code, and patch the stub address (32-bits relative to the TOC ptr, 62 - r2) into the stub. */ 63 - static struct ppc64_stub_entry ppc64_stub = 64 - { .jump = { 65 - #ifdef __LITTLE_ENDIAN__ 66 - 0x00, 0x00, 0x82, 0x3d, /* addis r12,r2, <high> */ 67 - 0x00, 0x00, 0x8c, 0x39, /* addi r12,r12, <low> */ 114 + /* 115 + * PPC64 uses 24 bit jumps, but we need to jump into other modules or 116 + * the kernel which may be further. So we jump to a stub. 117 + * 118 + * For ELFv1 we need to use this to set up the new r2 value (aka TOC 119 + * pointer). For ELFv2 it's the callee's responsibility to set up the 120 + * new r2, but for both we need to save the old r2. 121 + * 122 + * We could simply patch the new r2 value and function pointer into 123 + * the stub, but it's significantly shorter to put these values at the 124 + * end of the stub code, and patch the stub address (32-bits relative 125 + * to the TOC ptr, r2) into the stub. 126 + */ 127 + 128 + static u32 ppc64_stub_insns[] = { 129 + 0x3d620000, /* addis r11,r2, <high> */ 130 + 0x396b0000, /* addi r11,r11, <low> */ 68 131 /* Save current r2 value in magic place on the stack. */ 69 - 0x28, 0x00, 0x41, 0xf8, /* std r2,40(r1) */ 70 - 0x20, 0x00, 0x6c, 0xe9, /* ld r11,32(r12) */ 71 - 0x28, 0x00, 0x4c, 0xe8, /* ld r2,40(r12) */ 72 - 0xa6, 0x03, 0x69, 0x7d, /* mtctr r11 */ 73 - 0x20, 0x04, 0x80, 0x4e /* bctr */ 74 - #else 75 - 0x3d, 0x82, 0x00, 0x00, /* addis r12,r2, <high> */ 76 - 0x39, 0x8c, 0x00, 0x00, /* addi r12,r12, <low> */ 77 - /* Save current r2 value in magic place on the stack. */ 78 - 0xf8, 0x41, 0x00, 0x28, /* std r2,40(r1) */ 79 - 0xe9, 0x6c, 0x00, 0x20, /* ld r11,32(r12) */ 80 - 0xe8, 0x4c, 0x00, 0x28, /* ld r2,40(r12) */ 81 - 0x7d, 0x69, 0x03, 0xa6, /* mtctr r11 */ 82 - 0x4e, 0x80, 0x04, 0x20 /* bctr */ 132 + 0xf8410000|R2_STACK_OFFSET, /* std r2,R2_STACK_OFFSET(r1) */ 133 + 0xe98b0020, /* ld r12,32(r11) */ 134 + #if !defined(_CALL_ELF) || _CALL_ELF != 2 135 + /* Set up new r2 from function descriptor */ 136 + 0xe84b0028, /* ld r2,40(r11) */ 83 137 #endif 84 - } }; 138 + 0x7d8903a6, /* mtctr r12 */ 139 + 0x4e800420 /* bctr */ 140 + }; 141 + 142 + #ifdef CONFIG_DYNAMIC_FTRACE 143 + 144 + static u32 ppc64_stub_mask[] = { 145 + 0xffff0000, 146 + 0xffff0000, 147 + 0xffffffff, 148 + 0xffffffff, 149 + #if !defined(_CALL_ELF) || _CALL_ELF != 2 150 + 0xffffffff, 151 + #endif 152 + 0xffffffff, 153 + 0xffffffff 154 + }; 155 + 156 + bool is_module_trampoline(u32 *p) 157 + { 158 + unsigned int i; 159 + u32 insns[ARRAY_SIZE(ppc64_stub_insns)]; 160 + 161 + BUILD_BUG_ON(sizeof(ppc64_stub_insns) != sizeof(ppc64_stub_mask)); 162 + 163 + if (probe_kernel_read(insns, p, sizeof(insns))) 164 + return -EFAULT; 165 + 166 + for (i = 0; i < ARRAY_SIZE(ppc64_stub_insns); i++) { 167 + u32 insna = insns[i]; 168 + u32 insnb = ppc64_stub_insns[i]; 169 + u32 mask = ppc64_stub_mask[i]; 170 + 171 + if ((insna & mask) != (insnb & mask)) 172 + return false; 173 + } 174 + 175 + return true; 176 + } 177 + 178 + int module_trampoline_target(struct module *mod, u32 *trampoline, 179 + unsigned long *target) 180 + { 181 + u32 buf[2]; 182 + u16 upper, lower; 183 + long offset; 184 + void *toc_entry; 185 + 186 + if (probe_kernel_read(buf, trampoline, sizeof(buf))) 187 + return -EFAULT; 188 + 189 + upper = buf[0] & 0xffff; 190 + lower = buf[1] & 0xffff; 191 + 192 + /* perform the addis/addi, both signed */ 193 + offset = ((short)upper << 16) + (short)lower; 194 + 195 + /* 196 + * Now get the address this trampoline jumps to. This 197 + * is always 32 bytes into our trampoline stub. 198 + */ 199 + toc_entry = (void *)mod->arch.toc + offset + 32; 200 + 201 + if (probe_kernel_read(target, toc_entry, sizeof(*target))) 202 + return -EFAULT; 203 + 204 + return 0; 205 + } 206 + 207 + #endif 85 208 86 209 /* Count how many different 24-bit relocations (different symbol, 87 210 different addend) */ ··· 308 183 return relocs * sizeof(struct ppc64_stub_entry); 309 184 } 310 185 186 + /* Still needed for ELFv2, for .TOC. */ 311 187 static void dedotify_versions(struct modversion_info *vers, 312 188 unsigned long size) 313 189 { ··· 319 193 memmove(vers->name, vers->name+1, strlen(vers->name)); 320 194 } 321 195 322 - /* Undefined symbols which refer to .funcname, hack to funcname */ 196 + /* Undefined symbols which refer to .funcname, hack to funcname (or .TOC.) */ 323 197 static void dedotify(Elf64_Sym *syms, unsigned int numsyms, char *strtab) 324 198 { 325 199 unsigned int i; ··· 331 205 memmove(name, name+1, strlen(name)); 332 206 } 333 207 } 208 + } 209 + 210 + static Elf64_Sym *find_dot_toc(Elf64_Shdr *sechdrs, 211 + const char *strtab, 212 + unsigned int symindex) 213 + { 214 + unsigned int i, numsyms; 215 + Elf64_Sym *syms; 216 + 217 + syms = (Elf64_Sym *)sechdrs[symindex].sh_addr; 218 + numsyms = sechdrs[symindex].sh_size / sizeof(Elf64_Sym); 219 + 220 + for (i = 1; i < numsyms; i++) { 221 + if (syms[i].st_shndx == SHN_UNDEF 222 + && strcmp(strtab + syms[i].st_name, "TOC.") == 0) 223 + return &syms[i]; 224 + } 225 + return NULL; 334 226 } 335 227 336 228 int module_frob_arch_sections(Elf64_Ehdr *hdr, ··· 415 271 /* Patch stub to reference function and correct r2 value. */ 416 272 static inline int create_stub(Elf64_Shdr *sechdrs, 417 273 struct ppc64_stub_entry *entry, 418 - struct ppc64_opd_entry *opd, 274 + unsigned long addr, 419 275 struct module *me) 420 276 { 421 - Elf64_Half *loc1, *loc2; 422 277 long reladdr; 423 278 424 - *entry = ppc64_stub; 425 - 426 - #ifdef __LITTLE_ENDIAN__ 427 - loc1 = (Elf64_Half *)&entry->jump[0]; 428 - loc2 = (Elf64_Half *)&entry->jump[4]; 429 - #else 430 - loc1 = (Elf64_Half *)&entry->jump[2]; 431 - loc2 = (Elf64_Half *)&entry->jump[6]; 432 - #endif 279 + memcpy(entry->jump, ppc64_stub_insns, sizeof(ppc64_stub_insns)); 433 280 434 281 /* Stub uses address relative to r2. */ 435 282 reladdr = (unsigned long)entry - my_r2(sechdrs, me); ··· 431 296 } 432 297 DEBUGP("Stub %p get data from reladdr %li\n", entry, reladdr); 433 298 434 - *loc1 = PPC_HA(reladdr); 435 - *loc2 = PPC_LO(reladdr); 436 - entry->opd.funcaddr = opd->funcaddr; 437 - entry->opd.r2 = opd->r2; 299 + entry->jump[0] |= PPC_HA(reladdr); 300 + entry->jump[1] |= PPC_LO(reladdr); 301 + entry->funcdata = func_desc(addr); 438 302 return 1; 439 303 } 440 304 441 - /* Create stub to jump to function described in this OPD: we need the 305 + /* Create stub to jump to function described in this OPD/ptr: we need the 442 306 stub to set up the TOC ptr (r2) for the function. */ 443 307 static unsigned long stub_for_addr(Elf64_Shdr *sechdrs, 444 - unsigned long opdaddr, 308 + unsigned long addr, 445 309 struct module *me) 446 310 { 447 311 struct ppc64_stub_entry *stubs; 448 - struct ppc64_opd_entry *opd = (void *)opdaddr; 449 312 unsigned int i, num_stubs; 450 313 451 314 num_stubs = sechdrs[me->arch.stubs_section].sh_size / sizeof(*stubs); 452 315 453 316 /* Find this stub, or if that fails, the next avail. entry */ 454 317 stubs = (void *)sechdrs[me->arch.stubs_section].sh_addr; 455 - for (i = 0; stubs[i].opd.funcaddr; i++) { 318 + for (i = 0; stub_func_addr(stubs[i].funcdata); i++) { 456 319 BUG_ON(i >= num_stubs); 457 320 458 - if (stubs[i].opd.funcaddr == opd->funcaddr) 321 + if (stub_func_addr(stubs[i].funcdata) == func_addr(addr)) 459 322 return (unsigned long)&stubs[i]; 460 323 } 461 324 462 - if (!create_stub(sechdrs, &stubs[i], opd, me)) 325 + if (!create_stub(sechdrs, &stubs[i], addr, me)) 463 326 return 0; 464 327 465 328 return (unsigned long)&stubs[i]; ··· 472 339 me->name, *instruction); 473 340 return 0; 474 341 } 475 - *instruction = 0xe8410028; /* ld r2,40(r1) */ 342 + /* ld r2,R2_STACK_OFFSET(r1) */ 343 + *instruction = 0xe8410000 | R2_STACK_OFFSET; 476 344 return 1; 477 345 } 478 346 ··· 491 357 492 358 DEBUGP("Applying ADD relocate section %u to %u\n", relsec, 493 359 sechdrs[relsec].sh_info); 360 + 361 + /* First time we're called, we can fix up .TOC. */ 362 + if (!me->arch.toc_fixed) { 363 + sym = find_dot_toc(sechdrs, strtab, symindex); 364 + /* It's theoretically possible that a module doesn't want a 365 + * .TOC. so don't fail it just for that. */ 366 + if (sym) 367 + sym->st_value = my_r2(sechdrs, me); 368 + me->arch.toc_fixed = true; 369 + } 370 + 494 371 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rela); i++) { 495 372 /* This is where to make the change */ 496 373 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr ··· 598 453 return -ENOENT; 599 454 if (!restore_r2((u32 *)location + 1, me)) 600 455 return -ENOEXEC; 601 - } 456 + } else 457 + value += local_entry_offset(sym); 602 458 603 459 /* Convert value to relative */ 604 460 value -= (unsigned long)location; ··· 618 472 case R_PPC64_REL64: 619 473 /* 64 bits relative (used by features fixups) */ 620 474 *location = value - (unsigned long)location; 475 + break; 476 + 477 + case R_PPC64_TOCSAVE: 478 + /* 479 + * Marker reloc indicates we don't have to save r2. 480 + * That would only save us one instruction, so ignore 481 + * it. 482 + */ 483 + break; 484 + 485 + case R_PPC64_REL16_HA: 486 + /* Subtract location pointer */ 487 + value -= (unsigned long)location; 488 + value = ((value + 0x8000) >> 16); 489 + *((uint16_t *) location) 490 + = (*((uint16_t *) location) & ~0xffff) 491 + | (value & 0xffff); 492 + break; 493 + 494 + case R_PPC64_REL16_LO: 495 + /* Subtract location pointer */ 496 + value -= (unsigned long)location; 497 + *((uint16_t *) location) 498 + = (*((uint16_t *) location) & ~0xffff) 499 + | (value & 0xffff); 621 500 break; 622 501 623 502 default:
+49 -59
arch/powerpc/kernel/pci-common.c
··· 21 21 #include <linux/string.h> 22 22 #include <linux/init.h> 23 23 #include <linux/bootmem.h> 24 + #include <linux/delay.h> 24 25 #include <linux/export.h> 25 26 #include <linux/of_address.h> 26 27 #include <linux/of_pci.h> ··· 119 118 * memory window. 120 119 */ 121 120 return 1; 121 + } 122 + 123 + void pcibios_reset_secondary_bus(struct pci_dev *dev) 124 + { 125 + u16 ctrl; 126 + 127 + if (ppc_md.pcibios_reset_secondary_bus) { 128 + ppc_md.pcibios_reset_secondary_bus(dev); 129 + return; 130 + } 131 + 132 + pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &ctrl); 133 + ctrl |= PCI_BRIDGE_CTL_BUS_RESET; 134 + pci_write_config_word(dev, PCI_BRIDGE_CONTROL, ctrl); 135 + msleep(2); 136 + 137 + ctrl &= ~PCI_BRIDGE_CTL_BUS_RESET; 138 + pci_write_config_word(dev, PCI_BRIDGE_CONTROL, ctrl); 139 + ssleep(1); 122 140 } 123 141 124 142 static resource_size_t pcibios_io_size(const struct pci_controller *hose) ··· 666 646 void pci_process_bridge_OF_ranges(struct pci_controller *hose, 667 647 struct device_node *dev, int primary) 668 648 { 669 - const __be32 *ranges; 670 - int rlen; 671 - int pna = of_n_addr_cells(dev); 672 - int np = pna + 5; 673 649 int memno = 0; 674 - u32 pci_space; 675 - unsigned long long pci_addr, cpu_addr, pci_next, cpu_next, size; 676 650 struct resource *res; 651 + struct of_pci_range range; 652 + struct of_pci_range_parser parser; 677 653 678 654 printk(KERN_INFO "PCI host bridge %s %s ranges:\n", 679 655 dev->full_name, primary ? "(primary)" : ""); 680 656 681 - /* Get ranges property */ 682 - ranges = of_get_property(dev, "ranges", &rlen); 683 - if (ranges == NULL) 657 + /* Check for ranges property */ 658 + if (of_pci_range_parser_init(&parser, dev)) 684 659 return; 685 660 686 661 /* Parse it */ 687 - while ((rlen -= np * 4) >= 0) { 688 - /* Read next ranges element */ 689 - pci_space = of_read_number(ranges, 1); 690 - pci_addr = of_read_number(ranges + 1, 2); 691 - cpu_addr = of_translate_address(dev, ranges + 3); 692 - size = of_read_number(ranges + pna + 3, 2); 693 - ranges += np; 694 - 662 + for_each_of_pci_range(&parser, &range) { 695 663 /* If we failed translation or got a zero-sized region 696 664 * (some FW try to feed us with non sensical zero sized regions 697 665 * such as power3 which look like some kind of attempt at exposing 698 666 * the VGA memory hole) 699 667 */ 700 - if (cpu_addr == OF_BAD_ADDR || size == 0) 668 + if (range.cpu_addr == OF_BAD_ADDR || range.size == 0) 701 669 continue; 702 - 703 - /* Now consume following elements while they are contiguous */ 704 - for (; rlen >= np * sizeof(u32); 705 - ranges += np, rlen -= np * 4) { 706 - if (of_read_number(ranges, 1) != pci_space) 707 - break; 708 - pci_next = of_read_number(ranges + 1, 2); 709 - cpu_next = of_translate_address(dev, ranges + 3); 710 - if (pci_next != pci_addr + size || 711 - cpu_next != cpu_addr + size) 712 - break; 713 - size += of_read_number(ranges + pna + 3, 2); 714 - } 715 670 716 671 /* Act based on address space type */ 717 672 res = NULL; 718 - switch ((pci_space >> 24) & 0x3) { 719 - case 1: /* PCI IO space */ 673 + switch (range.flags & IORESOURCE_TYPE_BITS) { 674 + case IORESOURCE_IO: 720 675 printk(KERN_INFO 721 676 " IO 0x%016llx..0x%016llx -> 0x%016llx\n", 722 - cpu_addr, cpu_addr + size - 1, pci_addr); 677 + range.cpu_addr, range.cpu_addr + range.size - 1, 678 + range.pci_addr); 723 679 724 680 /* We support only one IO range */ 725 681 if (hose->pci_io_size) { ··· 705 709 } 706 710 #ifdef CONFIG_PPC32 707 711 /* On 32 bits, limit I/O space to 16MB */ 708 - if (size > 0x01000000) 709 - size = 0x01000000; 712 + if (range.size > 0x01000000) 713 + range.size = 0x01000000; 710 714 711 715 /* 32 bits needs to map IOs here */ 712 - hose->io_base_virt = ioremap(cpu_addr, size); 716 + hose->io_base_virt = ioremap(range.cpu_addr, 717 + range.size); 713 718 714 719 /* Expect trouble if pci_addr is not 0 */ 715 720 if (primary) ··· 720 723 /* pci_io_size and io_base_phys always represent IO 721 724 * space starting at 0 so we factor in pci_addr 722 725 */ 723 - hose->pci_io_size = pci_addr + size; 724 - hose->io_base_phys = cpu_addr - pci_addr; 726 + hose->pci_io_size = range.pci_addr + range.size; 727 + hose->io_base_phys = range.cpu_addr - range.pci_addr; 725 728 726 729 /* Build resource */ 727 730 res = &hose->io_resource; 728 - res->flags = IORESOURCE_IO; 729 - res->start = pci_addr; 731 + range.cpu_addr = range.pci_addr; 730 732 break; 731 - case 2: /* PCI Memory space */ 732 - case 3: /* PCI 64 bits Memory space */ 733 + case IORESOURCE_MEM: 733 734 printk(KERN_INFO 734 735 " MEM 0x%016llx..0x%016llx -> 0x%016llx %s\n", 735 - cpu_addr, cpu_addr + size - 1, pci_addr, 736 - (pci_space & 0x40000000) ? "Prefetch" : ""); 736 + range.cpu_addr, range.cpu_addr + range.size - 1, 737 + range.pci_addr, 738 + (range.pci_space & 0x40000000) ? 739 + "Prefetch" : ""); 737 740 738 741 /* We support only 3 memory ranges */ 739 742 if (memno >= 3) { ··· 742 745 continue; 743 746 } 744 747 /* Handles ISA memory hole space here */ 745 - if (pci_addr == 0) { 748 + if (range.pci_addr == 0) { 746 749 if (primary || isa_mem_base == 0) 747 - isa_mem_base = cpu_addr; 748 - hose->isa_mem_phys = cpu_addr; 749 - hose->isa_mem_size = size; 750 + isa_mem_base = range.cpu_addr; 751 + hose->isa_mem_phys = range.cpu_addr; 752 + hose->isa_mem_size = range.size; 750 753 } 751 754 752 755 /* Build resource */ 753 - hose->mem_offset[memno] = cpu_addr - pci_addr; 756 + hose->mem_offset[memno] = range.cpu_addr - 757 + range.pci_addr; 754 758 res = &hose->mem_resources[memno++]; 755 - res->flags = IORESOURCE_MEM; 756 - if (pci_space & 0x40000000) 757 - res->flags |= IORESOURCE_PREFETCH; 758 - res->start = cpu_addr; 759 759 break; 760 760 } 761 761 if (res != NULL) { 762 - res->name = dev->full_name; 763 - res->end = res->start + size - 1; 764 - res->parent = NULL; 765 - res->sibling = NULL; 766 - res->child = NULL; 762 + of_pci_range_to_resource(&range, dev, res); 767 763 } 768 764 } 769 765 }
+9
arch/powerpc/kernel/pci_of_scan.c
··· 304 304 struct pci_dev *dev = NULL; 305 305 const __be32 *reg; 306 306 int reglen, devfn; 307 + #ifdef CONFIG_EEH 308 + struct eeh_dev *edev = of_node_to_eeh_dev(dn); 309 + #endif 307 310 308 311 pr_debug(" * %s\n", dn->full_name); 309 312 if (!of_device_is_available(dn)) ··· 323 320 pci_dev_put(dev); 324 321 return dev; 325 322 } 323 + 324 + /* Device removed permanently ? */ 325 + #ifdef CONFIG_EEH 326 + if (edev && (edev->mode & EEH_DEV_REMOVED)) 327 + return NULL; 328 + #endif 326 329 327 330 /* create a new pci_dev for this device */ 328 331 dev = of_create_pci_dev(dn, bus, devfn);
-2
arch/powerpc/kernel/ppc_ksyms.c
··· 155 155 #endif 156 156 long long __bswapdi2(long long); 157 157 EXPORT_SYMBOL(__bswapdi2); 158 - #ifdef __BIG_ENDIAN__ 159 158 EXPORT_SYMBOL(memcpy); 160 - #endif 161 159 EXPORT_SYMBOL(memset); 162 160 EXPORT_SYMBOL(memmove); 163 161 EXPORT_SYMBOL(memcmp);
+16 -16
arch/powerpc/kernel/process.c
··· 54 54 #ifdef CONFIG_PPC64 55 55 #include <asm/firmware.h> 56 56 #endif 57 + #include <asm/code-patching.h> 57 58 #include <linux/kprobes.h> 58 59 #include <linux/kdebug.h> 59 60 ··· 496 495 return 0; 497 496 } 498 497 499 - int set_breakpoint(struct arch_hw_breakpoint *brk) 498 + void __set_breakpoint(struct arch_hw_breakpoint *brk) 500 499 { 501 500 __get_cpu_var(current_brk) = *brk; 502 501 503 502 if (cpu_has_feature(CPU_FTR_DAWR)) 504 - return set_dawr(brk); 503 + set_dawr(brk); 504 + else 505 + set_dabr(brk); 506 + } 505 507 506 - return set_dabr(brk); 508 + void set_breakpoint(struct arch_hw_breakpoint *brk) 509 + { 510 + preempt_disable(); 511 + __set_breakpoint(brk); 512 + preempt_enable(); 507 513 } 508 514 509 515 #ifdef CONFIG_PPC64 ··· 842 834 */ 843 835 #ifndef CONFIG_HAVE_HW_BREAKPOINT 844 836 if (unlikely(!hw_brk_match(&__get_cpu_var(current_brk), &new->thread.hw_brk))) 845 - set_breakpoint(&new->thread.hw_brk); 837 + __set_breakpoint(&new->thread.hw_brk); 846 838 #endif /* CONFIG_HAVE_HW_BREAKPOINT */ 847 839 #endif 848 840 ··· 1116 1108 struct thread_info *ti = (void *)task_stack_page(p); 1117 1109 memset(childregs, 0, sizeof(struct pt_regs)); 1118 1110 childregs->gpr[1] = sp + sizeof(struct pt_regs); 1119 - childregs->gpr[14] = usp; /* function */ 1111 + /* function */ 1112 + if (usp) 1113 + childregs->gpr[14] = ppc_function_entry((void *)usp); 1120 1114 #ifdef CONFIG_PPC64 1121 1115 clear_tsk_thread_flag(p, TIF_32BIT); 1122 1116 childregs->softe = 1; ··· 1197 1187 if (cpu_has_feature(CPU_FTR_HAS_PPR)) 1198 1188 p->thread.ppr = INIT_PPR; 1199 1189 #endif 1200 - /* 1201 - * The PPC64 ABI makes use of a TOC to contain function 1202 - * pointers. The function (ret_from_except) is actually a pointer 1203 - * to the TOC entry. The first entry is a pointer to the actual 1204 - * function. 1205 - */ 1206 - #ifdef CONFIG_PPC64 1207 - kregs->nip = *((unsigned long *)f); 1208 - #else 1209 - kregs->nip = (unsigned long)f; 1210 - #endif 1190 + kregs->nip = ppc_function_entry(f); 1211 1191 return 0; 1212 1192 } 1213 1193
+1 -1
arch/powerpc/kernel/prom_init_check.sh
··· 23 23 reloc_got2 kernstart_addr memstart_addr linux_banner _stext 24 24 opal_query_takeover opal_do_takeover opal_enter_rtas opal_secondary_entry 25 25 boot_command_line __prom_init_toc_start __prom_init_toc_end 26 - btext_setup_display" 26 + btext_setup_display TOC." 27 27 28 28 NM="$1" 29 29 OBJ="$2"
+50 -16
arch/powerpc/kernel/rtas_pci.c
··· 80 80 if (ret) 81 81 return PCIBIOS_DEVICE_NOT_FOUND; 82 82 83 - if (returnval == EEH_IO_ERROR_VALUE(size) && 84 - eeh_dev_check_failure(of_node_to_eeh_dev(pdn->node))) 85 - return PCIBIOS_DEVICE_NOT_FOUND; 86 - 87 83 return PCIBIOS_SUCCESSFUL; 88 84 } 89 85 ··· 88 92 int where, int size, u32 *val) 89 93 { 90 94 struct device_node *busdn, *dn; 91 - 92 - busdn = pci_bus_to_OF_node(bus); 95 + struct pci_dn *pdn; 96 + bool found = false; 97 + #ifdef CONFIG_EEH 98 + struct eeh_dev *edev; 99 + #endif 100 + int ret; 93 101 94 102 /* Search only direct children of the bus */ 103 + *val = 0xFFFFFFFF; 104 + busdn = pci_bus_to_OF_node(bus); 95 105 for (dn = busdn->child; dn; dn = dn->sibling) { 96 - struct pci_dn *pdn = PCI_DN(dn); 106 + pdn = PCI_DN(dn); 97 107 if (pdn && pdn->devfn == devfn 98 - && of_device_is_available(dn)) 99 - return rtas_read_config(pdn, where, size, val); 108 + && of_device_is_available(dn)) { 109 + found = true; 110 + break; 111 + } 100 112 } 101 113 102 - return PCIBIOS_DEVICE_NOT_FOUND; 114 + if (!found) 115 + return PCIBIOS_DEVICE_NOT_FOUND; 116 + #ifdef CONFIG_EEH 117 + edev = of_node_to_eeh_dev(dn); 118 + if (edev && edev->pe && edev->pe->state & EEH_PE_RESET) 119 + return PCIBIOS_DEVICE_NOT_FOUND; 120 + #endif 121 + 122 + ret = rtas_read_config(pdn, where, size, val); 123 + if (*val == EEH_IO_ERROR_VALUE(size) && 124 + eeh_dev_check_failure(of_node_to_eeh_dev(dn))) 125 + return PCIBIOS_DEVICE_NOT_FOUND; 126 + 127 + return ret; 103 128 } 104 129 105 130 int rtas_write_config(struct pci_dn *pdn, int where, int size, u32 val) ··· 153 136 int where, int size, u32 val) 154 137 { 155 138 struct device_node *busdn, *dn; 156 - 157 - busdn = pci_bus_to_OF_node(bus); 139 + struct pci_dn *pdn; 140 + bool found = false; 141 + #ifdef CONFIG_EEH 142 + struct eeh_dev *edev; 143 + #endif 144 + int ret; 158 145 159 146 /* Search only direct children of the bus */ 147 + busdn = pci_bus_to_OF_node(bus); 160 148 for (dn = busdn->child; dn; dn = dn->sibling) { 161 - struct pci_dn *pdn = PCI_DN(dn); 149 + pdn = PCI_DN(dn); 162 150 if (pdn && pdn->devfn == devfn 163 - && of_device_is_available(dn)) 164 - return rtas_write_config(pdn, where, size, val); 151 + && of_device_is_available(dn)) { 152 + found = true; 153 + break; 154 + } 165 155 } 166 - return PCIBIOS_DEVICE_NOT_FOUND; 156 + 157 + if (!found) 158 + return PCIBIOS_DEVICE_NOT_FOUND; 159 + #ifdef CONFIG_EEH 160 + edev = of_node_to_eeh_dev(dn); 161 + if (edev && edev->pe && (edev->pe->state & EEH_PE_RESET)) 162 + return PCIBIOS_DEVICE_NOT_FOUND; 163 + #endif 164 + ret = rtas_write_config(pdn, where, size, val); 165 + 166 + return ret; 167 167 } 168 168 169 169 static struct pci_ops rtas_pci_ops = {
+15 -5
arch/powerpc/kernel/setup-common.c
··· 212 212 { 213 213 unsigned long cpu_id = (unsigned long)v - 1; 214 214 unsigned int pvr; 215 + unsigned long proc_freq; 215 216 unsigned short maj; 216 217 unsigned short min; 217 218 ··· 264 263 #endif /* CONFIG_TAU */ 265 264 266 265 /* 267 - * Assume here that all clock rates are the same in a 268 - * smp system. -- Cort 266 + * Platforms that have variable clock rates, should implement 267 + * the method ppc_md.get_proc_freq() that reports the clock 268 + * rate of a given cpu. The rest can use ppc_proc_freq to 269 + * report the clock rate that is same across all cpus. 269 270 */ 270 - if (ppc_proc_freq) 271 + if (ppc_md.get_proc_freq) 272 + proc_freq = ppc_md.get_proc_freq(cpu_id); 273 + else 274 + proc_freq = ppc_proc_freq; 275 + 276 + if (proc_freq) 271 277 seq_printf(m, "clock\t\t: %lu.%06luMHz\n", 272 - ppc_proc_freq / 1000000, ppc_proc_freq % 1000000); 278 + proc_freq / 1000000, proc_freq % 1000000); 273 279 274 280 if (ppc_md.show_percpuinfo != NULL) 275 281 ppc_md.show_percpuinfo(m, cpu_id); ··· 390 382 391 383 #ifdef CONFIG_SMP 392 384 393 - int threads_per_core, threads_shift; 385 + int threads_per_core, threads_per_subcore, threads_shift; 394 386 cpumask_t threads_core_mask; 395 387 EXPORT_SYMBOL_GPL(threads_per_core); 388 + EXPORT_SYMBOL_GPL(threads_per_subcore); 396 389 EXPORT_SYMBOL_GPL(threads_shift); 397 390 EXPORT_SYMBOL_GPL(threads_core_mask); 398 391 ··· 402 393 int i; 403 394 404 395 threads_per_core = tpc; 396 + threads_per_subcore = tpc; 405 397 cpumask_clear(&threads_core_mask); 406 398 407 399 /* This implementation only supports power of 2 number of threads
+11 -1
arch/powerpc/kernel/setup_64.c
··· 36 36 #include <linux/lockdep.h> 37 37 #include <linux/memblock.h> 38 38 #include <linux/hugetlb.h> 39 + #include <linux/memory.h> 39 40 40 41 #include <asm/io.h> 41 42 #include <asm/kdump.h> ··· 342 341 343 342 ptr = (unsigned long *)((unsigned long)&__secondary_hold_spinloop 344 343 - PHYSICAL_START); 345 - *ptr = __pa(generic_secondary_smp_init); 344 + *ptr = ppc_function_entry(generic_secondary_smp_init); 346 345 347 346 /* And wait a bit for them to catch up */ 348 347 for (i = 0; i < 100000; i++) { ··· 781 780 } 782 781 #endif 783 782 783 + #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE 784 + unsigned long memory_block_size_bytes(void) 785 + { 786 + if (ppc_md.memory_block_size) 787 + return ppc_md.memory_block_size(); 788 + 789 + return MIN_MEMORY_BLOCK_SIZE; 790 + } 791 + #endif 784 792 785 793 #if defined(CONFIG_PPC_INDIRECT_PIO) || defined(CONFIG_PPC_INDIRECT_MMIO) 786 794 struct ppc_pci_io ppc_pci_io;
+1 -1
arch/powerpc/kernel/signal.c
··· 134 134 */ 135 135 if (current->thread.hw_brk.address && 136 136 current->thread.hw_brk.type) 137 - set_breakpoint(&current->thread.hw_brk); 137 + __set_breakpoint(&current->thread.hw_brk); 138 138 #endif 139 139 /* Re-enable the breakpoints for the signal stack */ 140 140 thread_change_pc(current, regs);
+11 -32
arch/powerpc/kernel/smp.c
··· 36 36 #include <linux/atomic.h> 37 37 #include <asm/irq.h> 38 38 #include <asm/hw_irq.h> 39 + #include <asm/kvm_ppc.h> 39 40 #include <asm/page.h> 40 41 #include <asm/pgtable.h> 41 42 #include <asm/prom.h> ··· 391 390 #ifdef CONFIG_PPC64 392 391 paca[boot_cpuid].__current = current; 393 392 #endif 393 + set_numa_node(numa_cpu_lookup_table[boot_cpuid]); 394 394 current_set[boot_cpuid] = task_thread_info(current); 395 395 } 396 396 ··· 459 457 return per_cpu(cpu_state, cpu) == CPU_UP_PREPARE; 460 458 } 461 459 462 - static atomic_t secondary_inhibit_count; 463 - 464 - /* 465 - * Don't allow secondary CPU threads to come online 466 - */ 467 - void inhibit_secondary_onlining(void) 460 + static bool secondaries_inhibited(void) 468 461 { 469 - /* 470 - * This makes secondary_inhibit_count stable during cpu 471 - * online/offline operations. 472 - */ 473 - get_online_cpus(); 474 - 475 - atomic_inc(&secondary_inhibit_count); 476 - put_online_cpus(); 477 - } 478 - EXPORT_SYMBOL_GPL(inhibit_secondary_onlining); 479 - 480 - /* 481 - * Allow secondary CPU threads to come online again 482 - */ 483 - void uninhibit_secondary_onlining(void) 484 - { 485 - get_online_cpus(); 486 - atomic_dec(&secondary_inhibit_count); 487 - put_online_cpus(); 488 - } 489 - EXPORT_SYMBOL_GPL(uninhibit_secondary_onlining); 490 - 491 - static int secondaries_inhibited(void) 492 - { 493 - return atomic_read(&secondary_inhibit_count); 462 + return kvm_hv_mode_active(); 494 463 } 495 464 496 465 #else /* HOTPLUG_CPU */ ··· 490 517 * Don't allow secondary threads to come online if inhibited 491 518 */ 492 519 if (threads_per_core > 1 && secondaries_inhibited() && 493 - cpu % threads_per_core != 0) 520 + cpu_thread_in_subcore(cpu)) 494 521 return -EBUSY; 495 522 496 523 if (smp_ops == NULL || ··· 722 749 cpumask_set_cpu(base + i, cpu_core_mask(cpu)); 723 750 } 724 751 traverse_core_siblings(cpu, true); 752 + 753 + /* 754 + * numa_node_id() works after this. 755 + */ 756 + set_numa_node(numa_cpu_lookup_table[cpu]); 757 + set_numa_mem(local_memory_node(numa_cpu_lookup_table[cpu])); 725 758 726 759 smp_wmb(); 727 760 notify_cpu_starting(cpu);
+32 -19
arch/powerpc/kernel/sysfs.c
··· 404 404 } 405 405 EXPORT_SYMBOL(ppc_enable_pmcs); 406 406 407 - #define __SYSFS_SPRSETUP(NAME, ADDRESS, EXTRA) \ 407 + #define __SYSFS_SPRSETUP_READ_WRITE(NAME, ADDRESS, EXTRA) \ 408 408 static void read_##NAME(void *val) \ 409 409 { \ 410 410 *(unsigned long *)val = mfspr(ADDRESS); \ ··· 413 413 { \ 414 414 EXTRA; \ 415 415 mtspr(ADDRESS, *(unsigned long *)val); \ 416 - } \ 416 + } 417 + 418 + #define __SYSFS_SPRSETUP_SHOW_STORE(NAME) \ 417 419 static ssize_t show_##NAME(struct device *dev, \ 418 420 struct device_attribute *attr, \ 419 421 char *buf) \ ··· 438 436 return count; \ 439 437 } 440 438 441 - #define SYSFS_PMCSETUP(NAME, ADDRESS) \ 442 - __SYSFS_SPRSETUP(NAME, ADDRESS, ppc_enable_pmcs()) 443 - #define SYSFS_SPRSETUP(NAME, ADDRESS) \ 444 - __SYSFS_SPRSETUP(NAME, ADDRESS, ) 439 + #define SYSFS_PMCSETUP(NAME, ADDRESS) \ 440 + __SYSFS_SPRSETUP_READ_WRITE(NAME, ADDRESS, ppc_enable_pmcs()) \ 441 + __SYSFS_SPRSETUP_SHOW_STORE(NAME) 442 + #define SYSFS_SPRSETUP(NAME, ADDRESS) \ 443 + __SYSFS_SPRSETUP_READ_WRITE(NAME, ADDRESS, ) \ 444 + __SYSFS_SPRSETUP_SHOW_STORE(NAME) 445 + 446 + #define SYSFS_SPRSETUP_SHOW_STORE(NAME) \ 447 + __SYSFS_SPRSETUP_SHOW_STORE(NAME) 445 448 446 449 /* Let's define all possible registers, we'll only hook up the ones 447 450 * that are implemented on the current processor ··· 484 477 SYSFS_PMCSETUP(mmcra, SPRN_MMCRA); 485 478 SYSFS_SPRSETUP(purr, SPRN_PURR); 486 479 SYSFS_SPRSETUP(spurr, SPRN_SPURR); 487 - SYSFS_SPRSETUP(dscr, SPRN_DSCR); 488 480 SYSFS_SPRSETUP(pir, SPRN_PIR); 489 481 490 482 /* ··· 493 487 */ 494 488 static DEVICE_ATTR(mmcra, 0600, show_mmcra, store_mmcra); 495 489 static DEVICE_ATTR(spurr, 0400, show_spurr, NULL); 496 - static DEVICE_ATTR(dscr, 0600, show_dscr, store_dscr); 497 490 static DEVICE_ATTR(purr, 0400, show_purr, store_purr); 498 491 static DEVICE_ATTR(pir, 0400, show_pir, NULL); 499 492 500 - unsigned long dscr_default = 0; 501 - EXPORT_SYMBOL(dscr_default); 493 + static unsigned long dscr_default; 494 + 495 + static void read_dscr(void *val) 496 + { 497 + *(unsigned long *)val = get_paca()->dscr_default; 498 + } 499 + 500 + static void write_dscr(void *val) 501 + { 502 + get_paca()->dscr_default = *(unsigned long *)val; 503 + if (!current->thread.dscr_inherit) { 504 + current->thread.dscr = *(unsigned long *)val; 505 + mtspr(SPRN_DSCR, *(unsigned long *)val); 506 + } 507 + } 508 + 509 + SYSFS_SPRSETUP_SHOW_STORE(dscr); 510 + static DEVICE_ATTR(dscr, 0600, show_dscr, store_dscr); 502 511 503 512 static void add_write_permission_dev_attr(struct device_attribute *attr) 504 513 { ··· 524 503 struct device_attribute *attr, char *buf) 525 504 { 526 505 return sprintf(buf, "%lx\n", dscr_default); 527 - } 528 - 529 - static void update_dscr(void *dummy) 530 - { 531 - if (!current->thread.dscr_inherit) { 532 - current->thread.dscr = dscr_default; 533 - mtspr(SPRN_DSCR, dscr_default); 534 - } 535 506 } 536 507 537 508 static ssize_t __used store_dscr_default(struct device *dev, ··· 538 525 return -EINVAL; 539 526 dscr_default = val; 540 527 541 - on_each_cpu(update_dscr, NULL, 1); 528 + on_each_cpu(write_dscr, &val, 1); 542 529 543 530 return count; 544 531 }
+11 -7
arch/powerpc/kernel/systbl.S
··· 17 17 #include <asm/ppc_asm.h> 18 18 19 19 #ifdef CONFIG_PPC64 20 - #define SYSCALL(func) .llong .sys_##func,.sys_##func 21 - #define COMPAT_SYS(func) .llong .sys_##func,.compat_sys_##func 22 - #define PPC_SYS(func) .llong .ppc_##func,.ppc_##func 23 - #define OLDSYS(func) .llong .sys_ni_syscall,.sys_ni_syscall 24 - #define SYS32ONLY(func) .llong .sys_ni_syscall,.compat_sys_##func 25 - #define SYSX(f, f3264, f32) .llong .f,.f3264 20 + #define SYSCALL(func) .llong DOTSYM(sys_##func),DOTSYM(sys_##func) 21 + #define COMPAT_SYS(func) .llong DOTSYM(sys_##func),DOTSYM(compat_sys_##func) 22 + #define PPC_SYS(func) .llong DOTSYM(ppc_##func),DOTSYM(ppc_##func) 23 + #define OLDSYS(func) .llong DOTSYM(sys_ni_syscall),DOTSYM(sys_ni_syscall) 24 + #define SYS32ONLY(func) .llong DOTSYM(sys_ni_syscall),DOTSYM(compat_sys_##func) 25 + #define SYSX(f, f3264, f32) .llong DOTSYM(f),DOTSYM(f3264) 26 26 #else 27 27 #define SYSCALL(func) .long sys_##func 28 28 #define COMPAT_SYS(func) .long sys_##func ··· 36 36 #define PPC_SYS_SPU(func) PPC_SYS(func) 37 37 #define SYSX_SPU(f, f3264, f32) SYSX(f, f3264, f32) 38 38 39 + .section .rodata,"a" 40 + 39 41 #ifdef CONFIG_PPC64 40 42 #define sys_sigpending sys_ni_syscall 41 43 #define sys_old_getrlimit sys_ni_syscall ··· 45 43 .p2align 3 46 44 #endif 47 45 48 - _GLOBAL(sys_call_table) 46 + .globl sys_call_table 47 + sys_call_table: 48 + 49 49 #include <asm/systbl.h>
+45 -24
arch/powerpc/kernel/tm.S
··· 10 10 #include <asm/ppc-opcode.h> 11 11 #include <asm/ptrace.h> 12 12 #include <asm/reg.h> 13 + #include <asm/bug.h> 13 14 14 15 #ifdef CONFIG_VSX 15 16 /* See fpu.S, this is borrowed from there */ ··· 42 41 /* Stack frame offsets for local variables. */ 43 42 #define TM_FRAME_L0 TM_FRAME_SIZE-16 44 43 #define TM_FRAME_L1 TM_FRAME_SIZE-8 45 - #define STACK_PARAM(x) (48+((x)*8)) 46 44 47 45 48 46 /* In order to access the TM SPRs, TM must be enabled. So, do so: */ ··· 78 78 TABORT(R3) 79 79 blr 80 80 81 - .section ".toc","aw" 82 - DSCR_DEFAULT: 83 - .tc dscr_default[TC],dscr_default 84 - 85 - .section ".text" 86 - 87 81 /* void tm_reclaim(struct thread_struct *thread, 88 82 * unsigned long orig_msr, 89 83 * uint8_t cause) ··· 102 108 mflr r0 103 109 stw r6, 8(r1) 104 110 std r0, 16(r1) 105 - std r2, 40(r1) 111 + std r2, STK_GOT(r1) 106 112 stdu r1, -TM_FRAME_SIZE(r1) 107 113 108 114 /* We've a struct pt_regs at [r1+STACK_FRAME_OVERHEAD]. */ 109 115 110 - std r3, STACK_PARAM(0)(r1) 116 + std r3, STK_PARAM(R3)(r1) 111 117 SAVE_NVGPRS(r1) 112 118 113 119 /* We need to setup MSR for VSX register save instructions. Here we ··· 169 175 stfd fr0,FPSTATE_FPSCR(r7) 170 176 171 177 dont_backup_fp: 178 + /* Do sanity check on MSR to make sure we are suspended */ 179 + li r7, (MSR_TS_S)@higher 180 + srdi r6, r14, 32 181 + and r6, r6, r7 182 + 1: tdeqi r6, 0 183 + EMIT_BUG_ENTRY 1b,__FILE__,__LINE__,0 184 + 172 185 /* The moment we treclaim, ALL of our GPRs will switch 173 186 * to user register state. (FPRs, CCR etc. also!) 174 187 * Use an sprg and a tm_scratch in the PACA to shuffle. ··· 203 202 /* Now get some more GPRS free */ 204 203 std r7, GPR7(r1) /* Temporary stash */ 205 204 std r12, GPR12(r1) /* '' '' '' */ 206 - ld r12, STACK_PARAM(0)(r1) /* Param 0, thread_struct * */ 205 + ld r12, STK_PARAM(R3)(r1) /* Param 0, thread_struct * */ 207 206 208 207 std r11, THREAD_TM_PPR(r12) /* Store PPR and free r11 */ 209 208 ··· 290 289 ld r0, 16(r1) 291 290 mtcr r4 292 291 mtlr r0 293 - ld r2, 40(r1) 292 + ld r2, STK_GOT(r1) 294 293 295 - /* Load system default DSCR */ 296 - ld r4, DSCR_DEFAULT@toc(r2) 297 - ld r0, 0(r4) 294 + /* Load CPU's default DSCR */ 295 + ld r0, PACA_DSCR(r13) 298 296 mtspr SPRN_DSCR, r0 299 297 300 298 blr ··· 312 312 mflr r0 313 313 stw r5, 8(r1) 314 314 std r0, 16(r1) 315 - std r2, 40(r1) 315 + std r2, STK_GOT(r1) 316 316 stdu r1, -TM_FRAME_SIZE(r1) 317 317 318 318 /* We've a struct pt_regs at [r1+STACK_FRAME_OVERHEAD]. 319 319 * This is used for backing up the NVGPRs: 320 320 */ 321 321 SAVE_NVGPRS(r1) 322 - 323 - std r1, PACAR1(r13) 324 322 325 323 /* Load complete register state from ts_ckpt* registers */ 326 324 ··· 383 385 /* ******************** CR,LR,CCR,MSR ********** */ 384 386 ld r4, _CTR(r7) 385 387 ld r5, _LINK(r7) 386 - ld r6, _CCR(r7) 387 388 ld r8, _XER(r7) 388 389 389 390 mtctr r4 390 391 mtlr r5 391 - mtcr r6 392 392 mtxer r8 393 393 394 394 /* ******************** TAR ******************** */ ··· 402 406 li r4, 0 403 407 mtmsrd r4, 1 404 408 405 - REST_4GPRS(0, r7) /* GPR0-3 */ 409 + REST_GPR(0, r7) /* GPR0 */ 410 + REST_2GPRS(2, r7) /* GPR2-3 */ 406 411 REST_GPR(4, r7) /* GPR4 */ 407 412 REST_4GPRS(8, r7) /* GPR8-11 */ 408 413 REST_2GPRS(12, r7) /* GPR12-13 */ ··· 415 418 mtspr SPRN_DSCR, r5 416 419 mtspr SPRN_PPR, r6 417 420 421 + /* Do final sanity check on TEXASR to make sure FS is set. Do this 422 + * here before we load up the userspace r1 so any bugs we hit will get 423 + * a call chain */ 424 + mfspr r5, SPRN_TEXASR 425 + srdi r5, r5, 16 426 + li r6, (TEXASR_FS)@h 427 + and r6, r6, r5 428 + 1: tdeqi r6, 0 429 + EMIT_BUG_ENTRY 1b,__FILE__,__LINE__,0 430 + 431 + /* Do final sanity check on MSR to make sure we are not transactional 432 + * or suspended 433 + */ 434 + mfmsr r6 435 + li r5, (MSR_TS_MASK)@higher 436 + srdi r6, r6, 32 437 + and r6, r6, r5 438 + 1: tdnei r6, 0 439 + EMIT_BUG_ENTRY 1b,__FILE__,__LINE__,0 440 + 441 + /* Restore CR */ 442 + ld r6, _CCR(r7) 443 + mtcr r6 444 + 445 + REST_GPR(1, r7) /* GPR1 */ 418 446 REST_GPR(5, r7) /* GPR5-7 */ 419 447 REST_GPR(6, r7) 420 448 ld r7, GPR7(r7) ··· 470 448 ld r0, 16(r1) 471 449 mtcr r4 472 450 mtlr r0 473 - ld r2, 40(r1) 451 + ld r2, STK_GOT(r1) 474 452 475 - /* Load system default DSCR */ 476 - ld r4, DSCR_DEFAULT@toc(r2) 477 - ld r0, 0(r4) 453 + /* Load CPU's default DSCR */ 454 + ld r0, PACA_DSCR(r13) 478 455 mtspr SPRN_DSCR, r0 479 456 480 457 blr
+20 -14
arch/powerpc/kvm/book3s_hv.c
··· 1236 1236 int core; 1237 1237 struct kvmppc_vcore *vcore; 1238 1238 1239 - core = id / threads_per_core; 1239 + core = id / threads_per_subcore; 1240 1240 if (core >= KVM_MAX_VCORES) 1241 1241 goto out; 1242 1242 ··· 1286 1286 init_waitqueue_head(&vcore->wq); 1287 1287 vcore->preempt_tb = TB_NIL; 1288 1288 vcore->lpcr = kvm->arch.lpcr; 1289 - vcore->first_vcpuid = core * threads_per_core; 1289 + vcore->first_vcpuid = core * threads_per_subcore; 1290 1290 vcore->kvm = kvm; 1291 1291 } 1292 1292 kvm->arch.vcores[core] = vcore; ··· 1476 1476 static int on_primary_thread(void) 1477 1477 { 1478 1478 int cpu = smp_processor_id(); 1479 - int thr = cpu_thread_in_core(cpu); 1479 + int thr; 1480 1480 1481 - if (thr) 1481 + /* Are we on a primary subcore? */ 1482 + if (cpu_thread_in_subcore(cpu)) 1482 1483 return 0; 1483 - while (++thr < threads_per_core) 1484 + 1485 + thr = 0; 1486 + while (++thr < threads_per_subcore) 1484 1487 if (cpu_online(cpu + thr)) 1485 1488 return 0; 1486 1489 1487 1490 /* Grab all hw threads so they can't go into the kernel */ 1488 - for (thr = 1; thr < threads_per_core; ++thr) { 1491 + for (thr = 1; thr < threads_per_subcore; ++thr) { 1489 1492 if (kvmppc_grab_hwthread(cpu + thr)) { 1490 1493 /* Couldn't grab one; let the others go */ 1491 1494 do { ··· 1547 1544 } 1548 1545 1549 1546 /* 1550 - * Make sure we are running on thread 0, and that 1551 - * secondary threads are offline. 1547 + * Make sure we are running on primary threads, and that secondary 1548 + * threads are offline. Also check if the number of threads in this 1549 + * guest are greater than the current system threads per guest. 1552 1550 */ 1553 - if (threads_per_core > 1 && !on_primary_thread()) { 1551 + if ((threads_per_core > 1) && 1552 + ((vc->num_threads > threads_per_subcore) || !on_primary_thread())) { 1554 1553 list_for_each_entry(vcpu, &vc->runnable_threads, arch.run_list) 1555 1554 vcpu->arch.ret = -EBUSY; 1556 1555 goto out; 1557 1556 } 1557 + 1558 1558 1559 1559 vc->pcpu = smp_processor_id(); 1560 1560 list_for_each_entry(vcpu, &vc->runnable_threads, arch.run_list) { ··· 1586 1580 /* wait for secondary threads to finish writing their state to memory */ 1587 1581 if (vc->nap_count < vc->n_woken) 1588 1582 kvmppc_wait_for_nap(vc); 1589 - for (i = 0; i < threads_per_core; ++i) 1583 + for (i = 0; i < threads_per_subcore; ++i) 1590 1584 kvmppc_release_hwthread(vc->pcpu + i); 1591 1585 /* prevent other vcpu threads from doing kvmppc_start_thread() now */ 1592 1586 vc->vcore_state = VCORE_EXITING; ··· 2311 2305 spin_lock_init(&kvm->arch.slot_phys_lock); 2312 2306 2313 2307 /* 2314 - * Don't allow secondary CPU threads to come online 2315 - * while any KVM VMs exist. 2308 + * Track that we now have a HV mode VM active. This blocks secondary 2309 + * CPU threads from coming online. 2316 2310 */ 2317 - inhibit_secondary_onlining(); 2311 + kvm_hv_vm_activated(); 2318 2312 2319 2313 return 0; 2320 2314 } ··· 2330 2324 2331 2325 static void kvmppc_core_destroy_vm_hv(struct kvm *kvm) 2332 2326 { 2333 - uninhibit_secondary_onlining(); 2327 + kvm_hv_vm_deactivated(); 2334 2328 2335 2329 kvmppc_free_vcores(kvm); 2336 2330 if (kvm->arch.rma) {
+31
arch/powerpc/kvm/book3s_hv_builtin.c
··· 6 6 * published by the Free Software Foundation. 7 7 */ 8 8 9 + #include <linux/cpu.h> 9 10 #include <linux/kvm_host.h> 10 11 #include <linux/preempt.h> 11 12 #include <linux/export.h> ··· 181 180 align_size = max(kvm_rma_pages << PAGE_SHIFT, align_size); 182 181 kvm_cma_declare_contiguous(selected_size, align_size); 183 182 } 183 + } 184 + 185 + /* 186 + * When running HV mode KVM we need to block certain operations while KVM VMs 187 + * exist in the system. We use a counter of VMs to track this. 188 + * 189 + * One of the operations we need to block is onlining of secondaries, so we 190 + * protect hv_vm_count with get/put_online_cpus(). 191 + */ 192 + static atomic_t hv_vm_count; 193 + 194 + void kvm_hv_vm_activated(void) 195 + { 196 + get_online_cpus(); 197 + atomic_inc(&hv_vm_count); 198 + put_online_cpus(); 199 + } 200 + EXPORT_SYMBOL_GPL(kvm_hv_vm_activated); 201 + 202 + void kvm_hv_vm_deactivated(void) 203 + { 204 + get_online_cpus(); 205 + atomic_dec(&hv_vm_count); 206 + put_online_cpus(); 207 + } 208 + EXPORT_SYMBOL_GPL(kvm_hv_vm_deactivated); 209 + 210 + bool kvm_hv_mode_active(void) 211 + { 212 + return atomic_read(&hv_vm_count) != 0; 184 213 }
+1 -1
arch/powerpc/kvm/book3s_hv_interrupts.S
··· 171 171 #endif /* CONFIG_SMP */ 172 172 173 173 /* Jump to partition switch code */ 174 - bl .kvmppc_hv_entry_trampoline 174 + bl kvmppc_hv_entry_trampoline 175 175 nop 176 176 177 177 /*
+18 -19
arch/powerpc/kvm/book3s_hv_rmhandlers.S
··· 292 292 beq kvm_no_guest 293 293 294 294 /* Set HSTATE_DSCR(r13) to something sensible */ 295 - LOAD_REG_ADDR(r6, dscr_default) 296 - ld r6, 0(r6) 295 + ld r6, PACA_DSCR(r13) 297 296 std r6, HSTATE_DSCR(r13) 298 297 299 298 bl kvmppc_hv_entry ··· 1798 1799 /* Search the hash table. */ 1799 1800 mr r3, r9 /* vcpu pointer */ 1800 1801 li r7, 1 /* data fault */ 1801 - bl .kvmppc_hpte_hv_fault 1802 + bl kvmppc_hpte_hv_fault 1802 1803 ld r9, HSTATE_KVM_VCPU(r13) 1803 1804 ld r10, VCPU_PC(r9) 1804 1805 ld r11, VCPU_MSR(r9) ··· 1872 1873 mr r4, r10 1873 1874 mr r6, r11 1874 1875 li r7, 0 /* instruction fault */ 1875 - bl .kvmppc_hpte_hv_fault 1876 + bl kvmppc_hpte_hv_fault 1876 1877 ld r9, HSTATE_KVM_VCPU(r13) 1877 1878 ld r10, VCPU_PC(r9) 1878 1879 ld r11, VCPU_MSR(r9) ··· 1946 1947 .globl hcall_real_table 1947 1948 hcall_real_table: 1948 1949 .long 0 /* 0 - unused */ 1949 - .long .kvmppc_h_remove - hcall_real_table 1950 - .long .kvmppc_h_enter - hcall_real_table 1951 - .long .kvmppc_h_read - hcall_real_table 1950 + .long DOTSYM(kvmppc_h_remove) - hcall_real_table 1951 + .long DOTSYM(kvmppc_h_enter) - hcall_real_table 1952 + .long DOTSYM(kvmppc_h_read) - hcall_real_table 1952 1953 .long 0 /* 0x10 - H_CLEAR_MOD */ 1953 1954 .long 0 /* 0x14 - H_CLEAR_REF */ 1954 - .long .kvmppc_h_protect - hcall_real_table 1955 - .long .kvmppc_h_get_tce - hcall_real_table 1956 - .long .kvmppc_h_put_tce - hcall_real_table 1955 + .long DOTSYM(kvmppc_h_protect) - hcall_real_table 1956 + .long DOTSYM(kvmppc_h_get_tce) - hcall_real_table 1957 + .long DOTSYM(kvmppc_h_put_tce) - hcall_real_table 1957 1958 .long 0 /* 0x24 - H_SET_SPRG0 */ 1958 - .long .kvmppc_h_set_dabr - hcall_real_table 1959 + .long DOTSYM(kvmppc_h_set_dabr) - hcall_real_table 1959 1960 .long 0 /* 0x2c */ 1960 1961 .long 0 /* 0x30 */ 1961 1962 .long 0 /* 0x34 */ ··· 1971 1972 .long 0 /* 0x5c */ 1972 1973 .long 0 /* 0x60 */ 1973 1974 #ifdef CONFIG_KVM_XICS 1974 - .long .kvmppc_rm_h_eoi - hcall_real_table 1975 - .long .kvmppc_rm_h_cppr - hcall_real_table 1976 - .long .kvmppc_rm_h_ipi - hcall_real_table 1975 + .long DOTSYM(kvmppc_rm_h_eoi) - hcall_real_table 1976 + .long DOTSYM(kvmppc_rm_h_cppr) - hcall_real_table 1977 + .long DOTSYM(kvmppc_rm_h_ipi) - hcall_real_table 1977 1978 .long 0 /* 0x70 - H_IPOLL */ 1978 - .long .kvmppc_rm_h_xirr - hcall_real_table 1979 + .long DOTSYM(kvmppc_rm_h_xirr) - hcall_real_table 1979 1980 #else 1980 1981 .long 0 /* 0x64 - H_EOI */ 1981 1982 .long 0 /* 0x68 - H_CPPR */ ··· 2009 2010 .long 0 /* 0xd4 */ 2010 2011 .long 0 /* 0xd8 */ 2011 2012 .long 0 /* 0xdc */ 2012 - .long .kvmppc_h_cede - hcall_real_table 2013 + .long DOTSYM(kvmppc_h_cede) - hcall_real_table 2013 2014 .long 0 /* 0xe4 */ 2014 2015 .long 0 /* 0xe8 */ 2015 2016 .long 0 /* 0xec */ ··· 2026 2027 .long 0 /* 0x118 */ 2027 2028 .long 0 /* 0x11c */ 2028 2029 .long 0 /* 0x120 */ 2029 - .long .kvmppc_h_bulk_remove - hcall_real_table 2030 + .long DOTSYM(kvmppc_h_bulk_remove) - hcall_real_table 2030 2031 .long 0 /* 0x128 */ 2031 2032 .long 0 /* 0x12c */ 2032 2033 .long 0 /* 0x130 */ 2033 - .long .kvmppc_h_set_xdabr - hcall_real_table 2034 + .long DOTSYM(kvmppc_h_set_xdabr) - hcall_real_table 2034 2035 hcall_real_table_end: 2035 2036 2036 2037 ignore_hdec: ··· 2255 2256 /* Try to handle a machine check in real mode */ 2256 2257 machine_check_realmode: 2257 2258 mr r3, r9 /* get vcpu pointer */ 2258 - bl .kvmppc_realmode_machine_check 2259 + bl kvmppc_realmode_machine_check 2259 2260 nop 2260 2261 cmpdi r3, 0 /* continue exiting from guest? */ 2261 2262 ld r9, HSTATE_KVM_VCPU(r13)
+1 -1
arch/powerpc/kvm/powerpc.c
··· 426 426 #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE 427 427 case KVM_CAP_PPC_SMT: 428 428 if (hv_enabled) 429 - r = threads_per_core; 429 + r = threads_per_subcore; 430 430 else 431 431 r = 0; 432 432 break;
-2
arch/powerpc/lib/Makefile
··· 23 23 obj-$(CONFIG_PPC64) += checksum_wrappers_64.o 24 24 endif 25 25 26 - ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),) 27 26 obj-$(CONFIG_PPC64) += memcpy_power7.o memcpy_64.o 28 - endif 29 27 30 28 obj-$(CONFIG_PPC_EMULATE_SSTEP) += sstep.o ldstfp.o 31 29
+2 -2
arch/powerpc/lib/copypage_64.S
··· 16 16 .tc ppc64_caches[TC],ppc64_caches 17 17 .section ".text" 18 18 19 - _GLOBAL(copy_page) 19 + _GLOBAL_TOC(copy_page) 20 20 BEGIN_FTR_SECTION 21 21 lis r5,PAGE_SIZE@h 22 22 FTR_SECTION_ELSE 23 - b .copypage_power7 23 + b copypage_power7 24 24 ALT_FTR_SECTION_END_IFCLR(CPU_FTR_VMX_COPY) 25 25 ori r5,r5,PAGE_SIZE@l 26 26 BEGIN_FTR_SECTION
+6 -6
arch/powerpc/lib/copypage_power7.S
··· 56 56 57 57 #ifdef CONFIG_ALTIVEC 58 58 mflr r0 59 - std r3,48(r1) 60 - std r4,56(r1) 59 + std r3,-STACKFRAMESIZE+STK_REG(R31)(r1) 60 + std r4,-STACKFRAMESIZE+STK_REG(R30)(r1) 61 61 std r0,16(r1) 62 62 stdu r1,-STACKFRAMESIZE(r1) 63 - bl .enter_vmx_copy 63 + bl enter_vmx_copy 64 64 cmpwi r3,0 65 65 ld r0,STACKFRAMESIZE+16(r1) 66 - ld r3,STACKFRAMESIZE+48(r1) 67 - ld r4,STACKFRAMESIZE+56(r1) 66 + ld r3,STK_REG(R31)(r1) 67 + ld r4,STK_REG(R30)(r1) 68 68 mtlr r0 69 69 70 70 li r0,(PAGE_SIZE/128) ··· 103 103 addi r3,r3,128 104 104 bdnz 1b 105 105 106 - b .exit_vmx_copy /* tail call optimise */ 106 + b exit_vmx_copy /* tail call optimise */ 107 107 108 108 #else 109 109 li r0,(PAGE_SIZE/128)
+1 -1
arch/powerpc/lib/copyuser_64.S
··· 18 18 #endif 19 19 20 20 .align 7 21 - _GLOBAL(__copy_tofrom_user) 21 + _GLOBAL_TOC(__copy_tofrom_user) 22 22 BEGIN_FTR_SECTION 23 23 nop 24 24 FTR_SECTION_ELSE
+16 -16
arch/powerpc/lib/copyuser_power7.S
··· 66 66 ld r15,STK_REG(R15)(r1) 67 67 ld r14,STK_REG(R14)(r1) 68 68 .Ldo_err3: 69 - bl .exit_vmx_usercopy 69 + bl exit_vmx_usercopy 70 70 ld r0,STACKFRAMESIZE+16(r1) 71 71 mtlr r0 72 72 b .Lexit ··· 85 85 .Lexit: 86 86 addi r1,r1,STACKFRAMESIZE 87 87 .Ldo_err1: 88 - ld r3,48(r1) 89 - ld r4,56(r1) 90 - ld r5,64(r1) 88 + ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) 89 + ld r4,-STACKFRAMESIZE+STK_REG(R30)(r1) 90 + ld r5,-STACKFRAMESIZE+STK_REG(R29)(r1) 91 91 b __copy_tofrom_user_base 92 92 93 93 ··· 96 96 cmpldi r5,16 97 97 cmpldi cr1,r5,4096 98 98 99 - std r3,48(r1) 100 - std r4,56(r1) 101 - std r5,64(r1) 99 + std r3,-STACKFRAMESIZE+STK_REG(R31)(r1) 100 + std r4,-STACKFRAMESIZE+STK_REG(R30)(r1) 101 + std r5,-STACKFRAMESIZE+STK_REG(R29)(r1) 102 102 103 103 blt .Lshort_copy 104 104 bgt cr1,.Lvmx_copy 105 105 #else 106 106 cmpldi r5,16 107 107 108 - std r3,48(r1) 109 - std r4,56(r1) 110 - std r5,64(r1) 108 + std r3,-STACKFRAMESIZE+STK_REG(R31)(r1) 109 + std r4,-STACKFRAMESIZE+STK_REG(R30)(r1) 110 + std r5,-STACKFRAMESIZE+STK_REG(R29)(r1) 111 111 112 112 blt .Lshort_copy 113 113 #endif ··· 295 295 mflr r0 296 296 std r0,16(r1) 297 297 stdu r1,-STACKFRAMESIZE(r1) 298 - bl .enter_vmx_usercopy 298 + bl enter_vmx_usercopy 299 299 cmpwi cr1,r3,0 300 300 ld r0,STACKFRAMESIZE+16(r1) 301 - ld r3,STACKFRAMESIZE+48(r1) 302 - ld r4,STACKFRAMESIZE+56(r1) 303 - ld r5,STACKFRAMESIZE+64(r1) 301 + ld r3,STK_REG(R31)(r1) 302 + ld r4,STK_REG(R30)(r1) 303 + ld r5,STK_REG(R29)(r1) 304 304 mtlr r0 305 305 306 306 /* ··· 514 514 err3; stb r0,0(r3) 515 515 516 516 15: addi r1,r1,STACKFRAMESIZE 517 - b .exit_vmx_usercopy /* tail call optimise */ 517 + b exit_vmx_usercopy /* tail call optimise */ 518 518 519 519 .Lvmx_unaligned_copy: 520 520 /* Get the destination 16B aligned */ ··· 717 717 err3; stb r0,0(r3) 718 718 719 719 15: addi r1,r1,STACKFRAMESIZE 720 - b .exit_vmx_usercopy /* tail call optimise */ 720 + b exit_vmx_usercopy /* tail call optimise */ 721 721 #endif /* CONFiG_ALTIVEC */
+4 -4
arch/powerpc/lib/hweight_64.S
··· 24 24 25 25 _GLOBAL(__arch_hweight8) 26 26 BEGIN_FTR_SECTION 27 - b .__sw_hweight8 27 + b __sw_hweight8 28 28 nop 29 29 nop 30 30 FTR_SECTION_ELSE ··· 35 35 36 36 _GLOBAL(__arch_hweight16) 37 37 BEGIN_FTR_SECTION 38 - b .__sw_hweight16 38 + b __sw_hweight16 39 39 nop 40 40 nop 41 41 nop ··· 57 57 58 58 _GLOBAL(__arch_hweight32) 59 59 BEGIN_FTR_SECTION 60 - b .__sw_hweight32 60 + b __sw_hweight32 61 61 nop 62 62 nop 63 63 nop ··· 82 82 83 83 _GLOBAL(__arch_hweight64) 84 84 BEGIN_FTR_SECTION 85 - b .__sw_hweight64 85 + b __sw_hweight64 86 86 nop 87 87 nop 88 88 nop
+2 -2
arch/powerpc/lib/mem_64.S
··· 79 79 80 80 _GLOBAL(memmove) 81 81 cmplw 0,r3,r4 82 - bgt .backwards_memcpy 83 - b .memcpy 82 + bgt backwards_memcpy 83 + b memcpy 84 84 85 85 _GLOBAL(backwards_memcpy) 86 86 rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */
+21 -5
arch/powerpc/lib/memcpy_64.S
··· 10 10 #include <asm/ppc_asm.h> 11 11 12 12 .align 7 13 - _GLOBAL(memcpy) 13 + _GLOBAL_TOC(memcpy) 14 14 BEGIN_FTR_SECTION 15 - std r3,48(r1) /* save destination pointer for return value */ 15 + #ifdef __LITTLE_ENDIAN__ 16 + cmpdi cr7,r5,0 17 + #else 18 + std r3,-STACKFRAMESIZE+STK_REG(R31)(r1) /* save destination pointer for return value */ 19 + #endif 16 20 FTR_SECTION_ELSE 17 21 #ifndef SELFTEST 18 22 b memcpy_power7 19 23 #endif 20 24 ALT_FTR_SECTION_END_IFCLR(CPU_FTR_VMX_COPY) 25 + #ifdef __LITTLE_ENDIAN__ 26 + /* dumb little-endian memcpy that will get replaced at runtime */ 27 + addi r9,r3,-1 28 + addi r4,r4,-1 29 + beqlr cr7 30 + mtctr r5 31 + 1: lbzu r10,1(r4) 32 + stbu r10,1(r9) 33 + bdnz 1b 34 + blr 35 + #else 21 36 PPC_MTOCRF(0x01,r5) 22 37 cmpldi cr1,r5,16 23 38 neg r6,r3 # LS 3 bits = # bytes to 8-byte dest bdry ··· 88 73 2: bf cr7*4+3,3f 89 74 lbz r9,8(r4) 90 75 stb r9,0(r3) 91 - 3: ld r3,48(r1) /* return dest pointer */ 76 + 3: ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) /* return dest pointer */ 92 77 blr 93 78 94 79 .Lsrc_unaligned: ··· 171 156 2: bf cr7*4+3,3f 172 157 rotldi r9,r9,8 173 158 stb r9,0(r3) 174 - 3: ld r3,48(r1) /* return dest pointer */ 159 + 3: ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) /* return dest pointer */ 175 160 blr 176 161 177 162 .Ldst_unaligned: ··· 216 201 3: bf cr7*4+3,4f 217 202 lbz r0,0(r4) 218 203 stb r0,0(r3) 219 - 4: ld r3,48(r1) /* return dest pointer */ 204 + 4: ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) /* return dest pointer */ 220 205 blr 206 + #endif
+13 -13
arch/powerpc/lib/memcpy_power7.S
··· 33 33 cmpldi r5,16 34 34 cmpldi cr1,r5,4096 35 35 36 - std r3,48(r1) 36 + std r3,-STACKFRAMESIZE+STK_REG(R31)(r1) 37 37 38 38 blt .Lshort_copy 39 39 bgt cr1,.Lvmx_copy 40 40 #else 41 41 cmpldi r5,16 42 42 43 - std r3,48(r1) 43 + std r3,-STACKFRAMESIZE+STK_REG(R31)(r1) 44 44 45 45 blt .Lshort_copy 46 46 #endif ··· 216 216 lbz r0,0(r4) 217 217 stb r0,0(r3) 218 218 219 - 15: ld r3,48(r1) 219 + 15: ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) 220 220 blr 221 221 222 222 .Lunwind_stack_nonvmx_copy: ··· 226 226 #ifdef CONFIG_ALTIVEC 227 227 .Lvmx_copy: 228 228 mflr r0 229 - std r4,56(r1) 230 - std r5,64(r1) 229 + std r4,-STACKFRAMESIZE+STK_REG(R30)(r1) 230 + std r5,-STACKFRAMESIZE+STK_REG(R29)(r1) 231 231 std r0,16(r1) 232 232 stdu r1,-STACKFRAMESIZE(r1) 233 - bl .enter_vmx_copy 233 + bl enter_vmx_copy 234 234 cmpwi cr1,r3,0 235 235 ld r0,STACKFRAMESIZE+16(r1) 236 - ld r3,STACKFRAMESIZE+48(r1) 237 - ld r4,STACKFRAMESIZE+56(r1) 238 - ld r5,STACKFRAMESIZE+64(r1) 236 + ld r3,STK_REG(R31)(r1) 237 + ld r4,STK_REG(R30)(r1) 238 + ld r5,STK_REG(R29)(r1) 239 239 mtlr r0 240 240 241 241 /* ··· 447 447 stb r0,0(r3) 448 448 449 449 15: addi r1,r1,STACKFRAMESIZE 450 - ld r3,48(r1) 451 - b .exit_vmx_copy /* tail call optimise */ 450 + ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) 451 + b exit_vmx_copy /* tail call optimise */ 452 452 453 453 .Lvmx_unaligned_copy: 454 454 /* Get the destination 16B aligned */ ··· 651 651 stb r0,0(r3) 652 652 653 653 15: addi r1,r1,STACKFRAMESIZE 654 - ld r3,48(r1) 655 - b .exit_vmx_copy /* tail call optimise */ 654 + ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) 655 + b exit_vmx_copy /* tail call optimise */ 656 656 #endif /* CONFiG_ALTIVEC */
+1 -1
arch/powerpc/lib/string_64.S
··· 77 77 mr r3,r4 78 78 blr 79 79 80 - _GLOBAL(__clear_user) 80 + _GLOBAL_TOC(__clear_user) 81 81 cmpdi r4,32 82 82 neg r6,r3 83 83 li r0,0
+28 -16
arch/powerpc/mm/hash_low_64.S
··· 159 159 BEGIN_FTR_SECTION 160 160 mr r4,r30 161 161 mr r5,r7 162 - bl .hash_page_do_lazy_icache 162 + bl hash_page_do_lazy_icache 163 163 END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE) 164 164 165 165 /* At this point, r3 contains new PP bits, save them in ··· 201 201 li r8,MMU_PAGE_4K /* page size */ 202 202 li r9,MMU_PAGE_4K /* actual page size */ 203 203 ld r10,STK_PARAM(R9)(r1) /* segment size */ 204 - _GLOBAL(htab_call_hpte_insert1) 204 + .globl htab_call_hpte_insert1 205 + htab_call_hpte_insert1: 205 206 bl . /* Patched by htab_finish_init() */ 206 207 cmpdi 0,r3,0 207 208 bge htab_pte_insert_ok /* Insertion successful */ ··· 226 225 li r8,MMU_PAGE_4K /* page size */ 227 226 li r9,MMU_PAGE_4K /* actual page size */ 228 227 ld r10,STK_PARAM(R9)(r1) /* segment size */ 229 - _GLOBAL(htab_call_hpte_insert2) 228 + .globl htab_call_hpte_insert2 229 + htab_call_hpte_insert2: 230 230 bl . /* Patched by htab_finish_init() */ 231 231 cmpdi 0,r3,0 232 232 bge+ htab_pte_insert_ok /* Insertion successful */ ··· 244 242 2: and r0,r5,r27 245 243 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */ 246 244 /* Call ppc_md.hpte_remove */ 247 - _GLOBAL(htab_call_hpte_remove) 245 + .globl htab_call_hpte_remove 246 + htab_call_hpte_remove: 248 247 bl . /* Patched by htab_finish_init() */ 249 248 250 249 /* Try all again */ ··· 299 296 li r7,MMU_PAGE_4K /* actual page size */ 300 297 ld r8,STK_PARAM(R9)(r1) /* segment size */ 301 298 ld r9,STK_PARAM(R8)(r1) /* get "local" param */ 302 - _GLOBAL(htab_call_hpte_updatepp) 299 + .globl htab_call_hpte_updatepp 300 + htab_call_hpte_updatepp: 303 301 bl . /* Patched by htab_finish_init() */ 304 302 305 303 /* if we failed because typically the HPTE wasn't really here ··· 475 471 BEGIN_FTR_SECTION 476 472 mr r4,r30 477 473 mr r5,r7 478 - bl .hash_page_do_lazy_icache 474 + bl hash_page_do_lazy_icache 479 475 END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE) 480 476 481 477 /* At this point, r3 contains new PP bits, save them in ··· 530 526 li r8,MMU_PAGE_4K /* page size */ 531 527 li r9,MMU_PAGE_4K /* actual page size */ 532 528 ld r10,STK_PARAM(R9)(r1) /* segment size */ 533 - _GLOBAL(htab_call_hpte_insert1) 529 + .globl htab_call_hpte_insert1 530 + htab_call_hpte_insert1: 534 531 bl . /* patched by htab_finish_init() */ 535 532 cmpdi 0,r3,0 536 533 bge htab_pte_insert_ok /* Insertion successful */ ··· 559 554 li r8,MMU_PAGE_4K /* page size */ 560 555 li r9,MMU_PAGE_4K /* actual page size */ 561 556 ld r10,STK_PARAM(R9)(r1) /* segment size */ 562 - _GLOBAL(htab_call_hpte_insert2) 557 + .globl htab_call_hpte_insert2 558 + htab_call_hpte_insert2: 563 559 bl . /* patched by htab_finish_init() */ 564 560 cmpdi 0,r3,0 565 561 bge+ htab_pte_insert_ok /* Insertion successful */ ··· 577 571 2: and r0,r5,r27 578 572 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */ 579 573 /* Call ppc_md.hpte_remove */ 580 - _GLOBAL(htab_call_hpte_remove) 574 + .globl htab_call_hpte_remove 575 + htab_call_hpte_remove: 581 576 bl . /* patched by htab_finish_init() */ 582 577 583 578 /* Try all again */ ··· 595 588 li r6,MMU_PAGE_64K /* psize */ 596 589 ld r7,STK_PARAM(R9)(r1) /* ssize */ 597 590 ld r8,STK_PARAM(R8)(r1) /* local */ 598 - bl .flush_hash_page 591 + bl flush_hash_page 599 592 /* Clear out _PAGE_HPTE_SUB bits in the new linux PTE */ 600 593 lis r0,_PAGE_HPTE_SUB@h 601 594 ori r0,r0,_PAGE_HPTE_SUB@l ··· 667 660 li r7,MMU_PAGE_4K /* actual page size */ 668 661 ld r8,STK_PARAM(R9)(r1) /* segment size */ 669 662 ld r9,STK_PARAM(R8)(r1) /* get "local" param */ 670 - _GLOBAL(htab_call_hpte_updatepp) 663 + .globl htab_call_hpte_updatepp 664 + htab_call_hpte_updatepp: 671 665 bl . /* patched by htab_finish_init() */ 672 666 673 667 /* if we failed because typically the HPTE wasn't really here ··· 820 812 BEGIN_FTR_SECTION 821 813 mr r4,r30 822 814 mr r5,r7 823 - bl .hash_page_do_lazy_icache 815 + bl hash_page_do_lazy_icache 824 816 END_FTR_SECTION(CPU_FTR_NOEXECUTE|CPU_FTR_COHERENT_ICACHE, CPU_FTR_NOEXECUTE) 825 817 826 818 /* At this point, r3 contains new PP bits, save them in ··· 865 857 li r8,MMU_PAGE_64K 866 858 li r9,MMU_PAGE_64K /* actual page size */ 867 859 ld r10,STK_PARAM(R9)(r1) /* segment size */ 868 - _GLOBAL(ht64_call_hpte_insert1) 860 + .globl ht64_call_hpte_insert1 861 + ht64_call_hpte_insert1: 869 862 bl . /* patched by htab_finish_init() */ 870 863 cmpdi 0,r3,0 871 864 bge ht64_pte_insert_ok /* Insertion successful */ ··· 890 881 li r8,MMU_PAGE_64K 891 882 li r9,MMU_PAGE_64K /* actual page size */ 892 883 ld r10,STK_PARAM(R9)(r1) /* segment size */ 893 - _GLOBAL(ht64_call_hpte_insert2) 884 + .globl ht64_call_hpte_insert2 885 + ht64_call_hpte_insert2: 894 886 bl . /* patched by htab_finish_init() */ 895 887 cmpdi 0,r3,0 896 888 bge+ ht64_pte_insert_ok /* Insertion successful */ ··· 908 898 2: and r0,r5,r27 909 899 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */ 910 900 /* Call ppc_md.hpte_remove */ 911 - _GLOBAL(ht64_call_hpte_remove) 901 + .globl ht64_call_hpte_remove 902 + ht64_call_hpte_remove: 912 903 bl . /* patched by htab_finish_init() */ 913 904 914 905 /* Try all again */ ··· 963 952 li r7,MMU_PAGE_64K /* actual page size */ 964 953 ld r8,STK_PARAM(R9)(r1) /* segment size */ 965 954 ld r9,STK_PARAM(R8)(r1) /* get "local" param */ 966 - _GLOBAL(ht64_call_hpte_updatepp) 955 + .globl ht64_call_hpte_updatepp 956 + ht64_call_hpte_updatepp: 967 957 bl . /* patched by htab_finish_init() */ 968 958 969 959 /* if we failed because typically the HPTE wasn't really here
+58 -34
arch/powerpc/mm/hash_utils_64.c
··· 449 449 mmu_psize_defs[bpsize].penc[apsize] = -1; 450 450 } 451 451 452 + #ifdef CONFIG_PPC_64K_PAGES 453 + 454 + static bool might_have_hea(void) 455 + { 456 + /* 457 + * The HEA ethernet adapter requires awareness of the 458 + * GX bus. Without that awareness we can easily assume 459 + * we will never see an HEA ethernet device. 460 + */ 461 + #ifdef CONFIG_IBMEBUS 462 + return !cpu_has_feature(CPU_FTR_ARCH_207S); 463 + #else 464 + return false; 465 + #endif 466 + } 467 + 468 + #endif /* #ifdef CONFIG_PPC_64K_PAGES */ 469 + 452 470 static void __init htab_init_page_sizes(void) 453 471 { 454 472 int rc; ··· 521 503 mmu_linear_psize = MMU_PAGE_64K; 522 504 if (mmu_has_feature(MMU_FTR_CI_LARGE_PAGE)) { 523 505 /* 524 - * Don't use 64k pages for ioremap on pSeries, since 525 - * that would stop us accessing the HEA ethernet. 506 + * When running on pSeries using 64k pages for ioremap 507 + * would stop us accessing the HEA ethernet. So if we 508 + * have the chance of ever seeing one, stay at 4k. 526 509 */ 527 - if (!machine_is(pseries)) 510 + if (!might_have_hea() || !machine_is(pseries)) 528 511 mmu_io_psize = MMU_PAGE_64K; 529 512 } else 530 513 mmu_ci_restrictions = 1; ··· 626 607 } 627 608 #endif /* CONFIG_MEMORY_HOTPLUG */ 628 609 629 - #define FUNCTION_TEXT(A) ((*(unsigned long *)(A))) 610 + extern u32 htab_call_hpte_insert1[]; 611 + extern u32 htab_call_hpte_insert2[]; 612 + extern u32 htab_call_hpte_remove[]; 613 + extern u32 htab_call_hpte_updatepp[]; 614 + extern u32 ht64_call_hpte_insert1[]; 615 + extern u32 ht64_call_hpte_insert2[]; 616 + extern u32 ht64_call_hpte_remove[]; 617 + extern u32 ht64_call_hpte_updatepp[]; 630 618 631 619 static void __init htab_finish_init(void) 632 620 { 633 - extern unsigned int *htab_call_hpte_insert1; 634 - extern unsigned int *htab_call_hpte_insert2; 635 - extern unsigned int *htab_call_hpte_remove; 636 - extern unsigned int *htab_call_hpte_updatepp; 637 - 638 621 #ifdef CONFIG_PPC_HAS_HASH_64K 639 - extern unsigned int *ht64_call_hpte_insert1; 640 - extern unsigned int *ht64_call_hpte_insert2; 641 - extern unsigned int *ht64_call_hpte_remove; 642 - extern unsigned int *ht64_call_hpte_updatepp; 643 - 644 622 patch_branch(ht64_call_hpte_insert1, 645 - FUNCTION_TEXT(ppc_md.hpte_insert), 623 + ppc_function_entry(ppc_md.hpte_insert), 646 624 BRANCH_SET_LINK); 647 625 patch_branch(ht64_call_hpte_insert2, 648 - FUNCTION_TEXT(ppc_md.hpte_insert), 626 + ppc_function_entry(ppc_md.hpte_insert), 649 627 BRANCH_SET_LINK); 650 628 patch_branch(ht64_call_hpte_remove, 651 - FUNCTION_TEXT(ppc_md.hpte_remove), 629 + ppc_function_entry(ppc_md.hpte_remove), 652 630 BRANCH_SET_LINK); 653 631 patch_branch(ht64_call_hpte_updatepp, 654 - FUNCTION_TEXT(ppc_md.hpte_updatepp), 632 + ppc_function_entry(ppc_md.hpte_updatepp), 655 633 BRANCH_SET_LINK); 656 - 657 634 #endif /* CONFIG_PPC_HAS_HASH_64K */ 658 635 659 636 patch_branch(htab_call_hpte_insert1, 660 - FUNCTION_TEXT(ppc_md.hpte_insert), 637 + ppc_function_entry(ppc_md.hpte_insert), 661 638 BRANCH_SET_LINK); 662 639 patch_branch(htab_call_hpte_insert2, 663 - FUNCTION_TEXT(ppc_md.hpte_insert), 640 + ppc_function_entry(ppc_md.hpte_insert), 664 641 BRANCH_SET_LINK); 665 642 patch_branch(htab_call_hpte_remove, 666 - FUNCTION_TEXT(ppc_md.hpte_remove), 643 + ppc_function_entry(ppc_md.hpte_remove), 667 644 BRANCH_SET_LINK); 668 645 patch_branch(htab_call_hpte_updatepp, 669 - FUNCTION_TEXT(ppc_md.hpte_updatepp), 646 + ppc_function_entry(ppc_md.hpte_updatepp), 670 647 BRANCH_SET_LINK); 671 648 } 672 649 ··· 979 964 trap, vsid, ssize, psize, lpsize, pte); 980 965 } 981 966 967 + static void check_paca_psize(unsigned long ea, struct mm_struct *mm, 968 + int psize, bool user_region) 969 + { 970 + if (user_region) { 971 + if (psize != get_paca_psize(ea)) { 972 + get_paca()->context = mm->context; 973 + slb_flush_and_rebolt(); 974 + } 975 + } else if (get_paca()->vmalloc_sllp != 976 + mmu_psize_defs[mmu_vmalloc_psize].sllp) { 977 + get_paca()->vmalloc_sllp = 978 + mmu_psize_defs[mmu_vmalloc_psize].sllp; 979 + slb_vmalloc_update(); 980 + } 981 + } 982 + 982 983 /* Result code is: 983 984 * 0 - handled 984 985 * 1 - normal page fault ··· 1116 1085 WARN_ON(1); 1117 1086 } 1118 1087 #endif 1088 + check_paca_psize(ea, mm, psize, user_region); 1089 + 1119 1090 goto bail; 1120 1091 } 1121 1092 ··· 1158 1125 #endif 1159 1126 } 1160 1127 } 1161 - if (user_region) { 1162 - if (psize != get_paca_psize(ea)) { 1163 - get_paca()->context = mm->context; 1164 - slb_flush_and_rebolt(); 1165 - } 1166 - } else if (get_paca()->vmalloc_sllp != 1167 - mmu_psize_defs[mmu_vmalloc_psize].sllp) { 1168 - get_paca()->vmalloc_sllp = 1169 - mmu_psize_defs[mmu_vmalloc_psize].sllp; 1170 - slb_vmalloc_update(); 1171 - } 1128 + 1129 + check_paca_psize(ea, mm, psize, user_region); 1172 1130 #endif /* CONFIG_PPC_64K_PAGES */ 1173 1131 1174 1132 #ifdef CONFIG_PPC_HAS_HASH_64K
+6 -6
arch/powerpc/mm/slb.c
··· 256 256 patch_instruction(insn_addr, insn); 257 257 } 258 258 259 + extern u32 slb_compare_rr_to_size[]; 260 + extern u32 slb_miss_kernel_load_linear[]; 261 + extern u32 slb_miss_kernel_load_io[]; 262 + extern u32 slb_compare_rr_to_size[]; 263 + extern u32 slb_miss_kernel_load_vmemmap[]; 264 + 259 265 void slb_set_size(u16 size) 260 266 { 261 - extern unsigned int *slb_compare_rr_to_size; 262 - 263 267 if (mmu_slb_size == size) 264 268 return; 265 269 ··· 276 272 unsigned long linear_llp, vmalloc_llp, io_llp; 277 273 unsigned long lflags, vflags; 278 274 static int slb_encoding_inited; 279 - extern unsigned int *slb_miss_kernel_load_linear; 280 - extern unsigned int *slb_miss_kernel_load_io; 281 - extern unsigned int *slb_compare_rr_to_size; 282 275 #ifdef CONFIG_SPARSEMEM_VMEMMAP 283 - extern unsigned int *slb_miss_kernel_load_vmemmap; 284 276 unsigned long vmemmap_llp; 285 277 #endif 286 278
+9 -5
arch/powerpc/mm/slb_low.S
··· 35 35 * check for bad kernel/user address 36 36 * (ea & ~REGION_MASK) >= PGTABLE_RANGE 37 37 */ 38 - rldicr. r9,r3,4,(63 - 46 - 4) 38 + rldicr. r9,r3,4,(63 - PGTABLE_EADDR_SIZE - 4) 39 39 bne- 8f 40 40 41 41 srdi r9,r3,60 /* get region */ ··· 59 59 /* Linear mapping encoding bits, the "li" instruction below will 60 60 * be patched by the kernel at boot 61 61 */ 62 - _GLOBAL(slb_miss_kernel_load_linear) 62 + .globl slb_miss_kernel_load_linear 63 + slb_miss_kernel_load_linear: 63 64 li r11,0 64 65 /* 65 66 * context = (MAX_USER_CONTEXT) + ((ea >> 60) - 0xc) + 1 ··· 80 79 /* Check virtual memmap region. To be patches at kernel boot */ 81 80 cmpldi cr0,r9,0xf 82 81 bne 1f 83 - _GLOBAL(slb_miss_kernel_load_vmemmap) 82 + .globl slb_miss_kernel_load_vmemmap 83 + slb_miss_kernel_load_vmemmap: 84 84 li r11,0 85 85 b 6f 86 86 1: ··· 97 95 b 6f 98 96 5: 99 97 /* IO mapping */ 100 - _GLOBAL(slb_miss_kernel_load_io) 98 + .globl slb_miss_kernel_load_io 99 + slb_miss_kernel_load_io: 101 100 li r11,0 102 101 6: 103 102 /* ··· 253 250 7: ld r10,PACASTABRR(r13) 254 251 addi r10,r10,1 255 252 /* This gets soft patched on boot. */ 256 - _GLOBAL(slb_compare_rr_to_size) 253 + .globl slb_compare_rr_to_size 254 + slb_compare_rr_to_size: 257 255 cmpldi r10,0 258 256 259 257 blt+ 4f
+6 -1
arch/powerpc/mm/tlb_nohash.c
··· 596 596 /* XXX This should be decided at runtime based on supported 597 597 * page sizes in the TLB, but for now let's assume 16M is 598 598 * always there and a good fit (which it probably is) 599 + * 600 + * Freescale booke only supports 4K pages in TLB0, so use that. 599 601 */ 600 - mmu_vmemmap_psize = MMU_PAGE_16M; 602 + if (mmu_has_feature(MMU_FTR_TYPE_FSL_E)) 603 + mmu_vmemmap_psize = MMU_PAGE_4K; 604 + else 605 + mmu_vmemmap_psize = MMU_PAGE_16M; 601 606 602 607 /* XXX This code only checks for TLB 0 capabilities and doesn't 603 608 * check what page size combos are supported by the HW. It
+42
arch/powerpc/platforms/44x/Kconfig
··· 199 199 help 200 200 This option enables support for the IBM Currituck (476fpe) evaluation board 201 201 202 + config AKEBONO 203 + bool "IBM Akebono (476gtr) Support" 204 + depends on PPC_47x 205 + default n 206 + select SWIOTLB 207 + select 476FPE 208 + select PPC4xx_PCI_EXPRESS 209 + select PCI_MSI 210 + select PPC4xx_HSTA_MSI 211 + select I2C 212 + select I2C_IBM_IIC 213 + select NETDEVICES 214 + select ETHERNET 215 + select NET_VENDOR_IBM 216 + select IBM_EMAC_EMAC4 217 + select IBM_EMAC_RGMII_WOL 218 + select USB 219 + select USB_OHCI_HCD_PLATFORM 220 + select USB_EHCI_HCD_PLATFORM 221 + select MMC_SDHCI 222 + select MMC_SDHCI_PLTFM 223 + select MMC_SDHCI_OF_476GTR 224 + select ATA 225 + select SATA_AHCI_PLATFORM 226 + help 227 + This option enables support for the IBM Akebono (476gtr) evaluation board 228 + 229 + 202 230 config ICON 203 231 bool "Icon" 204 232 depends on 44x ··· 350 322 select PPC_FPU 351 323 select IBM_EMAC_EMAC4 352 324 select IBM_EMAC_TAH 325 + 326 + config 476FPE_ERR46 327 + depends on 476FPE 328 + bool "Enable linker work around for PPC476FPE errata #46" 329 + help 330 + This option enables a work around for an icache bug on 476 331 + that can cause execution of stale instructions when falling 332 + through pages (IBM errata #46). It requires a recent version 333 + of binutils which supports the --ppc476-workaround option. 334 + 335 + The work around enables the appropriate linker options and 336 + ensures that all module output sections are aligned to 4K 337 + page boundaries. The work around is only required when 338 + building modules. 353 339 354 340 # 44x errata/workaround config symbols, selected by the CPU models above 355 341 config IBM440EP_ERR42
+2 -1
arch/powerpc/platforms/44x/Makefile
··· 10 10 obj-$(CONFIG_XILINX_ML510) += virtex_ml510.o 11 11 obj-$(CONFIG_ISS4xx) += iss4xx.o 12 12 obj-$(CONFIG_CANYONLANDS)+= canyonlands.o 13 - obj-$(CONFIG_CURRITUCK) += currituck.o 13 + obj-$(CONFIG_CURRITUCK) += ppc476.o 14 + obj-$(CONFIG_AKEBONO) += ppc476.o
+93 -27
arch/powerpc/platforms/44x/currituck.c arch/powerpc/platforms/44x/ppc476.c
··· 1 1 /* 2 - * Currituck board specific routines 2 + * PowerPC 476FPE board specific routines 3 3 * 4 - * Copyright © 2011 Tony Breeds IBM Corporation 4 + * Copyright © 2013 Tony Breeds IBM Corporation 5 + * Copyright © 2013 Alistair Popple IBM Corporation 5 6 * 6 7 * Based on earlier code: 7 8 * Matt Porter <mporter@kernel.crashing.org> ··· 36 35 #include <asm/mmu.h> 37 36 38 37 #include <linux/pci.h> 38 + #include <linux/i2c.h> 39 39 40 - static __initdata struct of_device_id ppc47x_of_bus[] = { 40 + static struct of_device_id ppc47x_of_bus[] __initdata = { 41 41 { .compatible = "ibm,plb4", }, 42 42 { .compatible = "ibm,plb6", }, 43 43 { .compatible = "ibm,opb", }, ··· 57 55 } 58 56 DECLARE_PCI_FIXUP_HEADER(0x1033, 0x0035, quirk_ppc_currituck_usb_fixup); 59 57 58 + /* Akebono has an AVR microcontroller attached to the I2C bus 59 + * which is used to power off/reset the system. */ 60 + 61 + /* AVR I2C Commands */ 62 + #define AVR_PWRCTL_CMD (0x26) 63 + 64 + /* Flags for the power control I2C commands */ 65 + #define AVR_PWRCTL_PWROFF (0x01) 66 + #define AVR_PWRCTL_RESET (0x02) 67 + 68 + static struct i2c_client *avr_i2c_client; 69 + static void avr_halt_system(int pwrctl_flags) 70 + { 71 + /* Request the AVR to reset the system */ 72 + i2c_smbus_write_byte_data(avr_i2c_client, 73 + AVR_PWRCTL_CMD, pwrctl_flags); 74 + 75 + /* Wait for system to be reset */ 76 + while (1) 77 + ; 78 + } 79 + 80 + static void avr_power_off_system(void) 81 + { 82 + avr_halt_system(AVR_PWRCTL_PWROFF); 83 + } 84 + 85 + static void avr_reset_system(char *cmd) 86 + { 87 + avr_halt_system(AVR_PWRCTL_RESET); 88 + } 89 + 90 + static int avr_probe(struct i2c_client *client, 91 + const struct i2c_device_id *id) 92 + { 93 + avr_i2c_client = client; 94 + ppc_md.restart = avr_reset_system; 95 + ppc_md.power_off = avr_power_off_system; 96 + return 0; 97 + } 98 + 99 + static const struct i2c_device_id avr_id[] = { 100 + { "akebono-avr", 0 }, 101 + { } 102 + }; 103 + 104 + static struct i2c_driver avr_driver = { 105 + .driver = { 106 + .name = "akebono-avr", 107 + }, 108 + .probe = avr_probe, 109 + .id_table = avr_id, 110 + }; 111 + 60 112 static int __init ppc47x_device_probe(void) 61 113 { 114 + i2c_add_driver(&avr_driver); 62 115 of_platform_bus_probe(NULL, ppc47x_of_bus, NULL); 63 116 64 117 return 0; 65 118 } 66 119 machine_device_initcall(ppc47x, ppc47x_device_probe); 67 120 68 - /* We can have either UICs or MPICs */ 69 121 static void __init ppc47x_init_irq(void) 70 122 { 71 123 struct device_node *np; ··· 213 157 { 214 158 215 159 /* No need to check the DMA config as we /know/ our windows are all of 216 - * RAM. Lets hope that doesn't change */ 160 + * RAM. Lets hope that doesn't change */ 217 161 swiotlb_detect_4g(); 218 162 219 163 ppc47x_smp_init(); 220 164 } 221 165 222 - /* 223 - * Called very early, MMU is off, device-tree isn't unflattened 224 - */ 225 - static int __init ppc47x_probe(void) 226 - { 227 - unsigned long root = of_get_flat_dt_root(); 228 - 229 - if (!of_flat_dt_is_compatible(root, "ibm,currituck")) 230 - return 0; 231 - 232 - return 1; 233 - } 234 - 235 166 static int board_rev = -1; 236 167 static int __init ppc47x_get_board_rev(void) 237 168 { 238 - u8 fpga_reg0; 239 - void *fpga; 240 - struct device_node *np; 169 + int reg; 170 + u8 *fpga; 171 + struct device_node *np = NULL; 241 172 242 - np = of_find_compatible_node(NULL, NULL, "ibm,currituck-fpga"); 173 + if (of_machine_is_compatible("ibm,currituck")) { 174 + np = of_find_compatible_node(NULL, NULL, "ibm,currituck-fpga"); 175 + reg = 0; 176 + } else if (of_machine_is_compatible("ibm,akebono")) { 177 + np = of_find_compatible_node(NULL, NULL, "ibm,akebono-fpga"); 178 + reg = 2; 179 + } 180 + 243 181 if (!np) 244 182 goto fail; 245 183 246 - fpga = of_iomap(np, 0); 184 + fpga = (u8 *) of_iomap(np, 0); 247 185 of_node_put(np); 248 186 if (!fpga) 249 187 goto fail; 250 188 251 - fpga_reg0 = ioread8(fpga); 252 - board_rev = fpga_reg0 & 0x03; 189 + board_rev = ioread8(fpga + reg) & 0x03; 253 190 pr_info("%s: Found board revision %d\n", __func__, board_rev); 254 191 iounmap(fpga); 255 192 return 0; ··· 257 208 static void ppc47x_pci_irq_fixup(struct pci_dev *dev) 258 209 { 259 210 if (dev->vendor == 0x1033 && (dev->device == 0x0035 || 260 - dev->device == 0x00e0)) { 211 + dev->device == 0x00e0)) { 261 212 if (board_rev == 0) { 262 213 dev->irq = irq_create_mapping(NULL, 47); 263 214 pr_info("%s: Mapping irq %d\n", __func__, dev->irq); ··· 270 221 } 271 222 } 272 223 224 + /* 225 + * Called very early, MMU is off, device-tree isn't unflattened 226 + */ 227 + static int __init ppc47x_probe(void) 228 + { 229 + unsigned long root = of_get_flat_dt_root(); 230 + 231 + if (of_flat_dt_is_compatible(root, "ibm,akebono")) 232 + return 1; 233 + 234 + if (of_flat_dt_is_compatible(root, "ibm,currituck")) { 235 + ppc_md.pci_irq_fixup = ppc47x_pci_irq_fixup; 236 + return 1; 237 + } 238 + 239 + return 0; 240 + } 241 + 273 242 define_machine(ppc47x) { 274 243 .name = "PowerPC 47x", 275 244 .probe = ppc47x_probe, 276 245 .progress = udbg_progress, 277 246 .init_IRQ = ppc47x_init_irq, 278 247 .setup_arch = ppc47x_setup_arch, 279 - .pci_irq_fixup = ppc47x_pci_irq_fixup, 280 248 .restart = ppc4xx_reset_system, 281 249 .calibrate_decr = generic_calibrate_decr, 282 250 };
+15
arch/powerpc/platforms/44x/ppc476_modules.lds
··· 1 + SECTIONS 2 + { 3 + .text : ALIGN(4096) 4 + { 5 + *(.text .text.* .fixup) 6 + } 7 + .init.text : ALIGN(4096) 8 + { 9 + *(.init.text .init.text.*) 10 + } 11 + .exit.text : ALIGN(4096) 12 + { 13 + *(.exit.text .exit.text.*) 14 + } 15 + }
+14 -5
arch/powerpc/platforms/85xx/Kconfig
··· 38 38 help 39 39 This option enables support for the C293PCIE board 40 40 41 + config BSC9132_QDS 42 + bool "Freescale BSC9132QDS" 43 + select DEFAULT_UIMAGE 44 + help 45 + This option enables support for the Freescale BSC9132 QDS board. 46 + BSC9132 is a heterogeneous SoC containing dual e500v2 powerpc cores 47 + and dual StarCore SC3850 DSP cores. 48 + Manufacturer : Freescale Semiconductor, Inc 49 + 41 50 config MPC8540_ADS 42 51 bool "Freescale MPC8540 ADS" 43 52 select DEFAULT_UIMAGE ··· 126 117 This option enables support for the Freescale / iVeia P1022RDK 127 118 reference board. 128 119 129 - config P1023_RDS 130 - bool "Freescale P1023 RDS/RDB" 120 + config P1023_RDB 121 + bool "Freescale P1023 RDB" 131 122 select DEFAULT_UIMAGE 132 123 help 133 - This option enables support for the P1023 RDS and RDB boards 124 + This option enables support for the P1023 RDB board. 134 125 135 126 config TWR_P102x 136 127 bool "Freescale TWR-P102x" ··· 272 263 help 273 264 This option enables support for the FSL CoreNet based boards. 274 265 For 32bit kernel, the following boards are supported: 275 - P2041 RDB, P3041 DS and P4080 DS 266 + P2041 RDB, P3041 DS, P4080 DS, kmcoge4, and OCA4080 276 267 For 64bit kernel, the following boards are supported: 277 268 T4240 QDS and B4 QDS 278 269 The following boards are supported for both 32bit and 64bit kernel: 279 - P5020 DS and P5040 DS 270 + P5020 DS, P5040 DS and T104xQDS 280 271 281 272 endif # FSL_SOC_BOOKE 282 273
+2 -1
arch/powerpc/platforms/85xx/Makefile
··· 6 6 obj-y += common.o 7 7 8 8 obj-$(CONFIG_BSC9131_RDB) += bsc913x_rdb.o 9 + obj-$(CONFIG_BSC9132_QDS) += bsc913x_qds.o 9 10 obj-$(CONFIG_C293_PCIE) += c293pcie.o 10 11 obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o 11 12 obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o ··· 18 17 obj-$(CONFIG_P1010_RDB) += p1010rdb.o 19 18 obj-$(CONFIG_P1022_DS) += p1022_ds.o 20 19 obj-$(CONFIG_P1022_RDK) += p1022_rdk.o 21 - obj-$(CONFIG_P1023_RDS) += p1023_rds.o 20 + obj-$(CONFIG_P1023_RDB) += p1023_rdb.o 22 21 obj-$(CONFIG_TWR_P102x) += twr_p102x.o 23 22 obj-$(CONFIG_CORENET_GENERIC) += corenet_generic.o 24 23 obj-$(CONFIG_STX_GP3) += stx_gp3.o
+74
arch/powerpc/platforms/85xx/bsc913x_qds.c
··· 1 + /* 2 + * BSC913xQDS Board Setup 3 + * 4 + * Author: 5 + * Harninder Rai <harninder.rai@freescale.com> 6 + * Priyanka Jain <Priyanka.Jain@freescale.com> 7 + * 8 + * Copyright 2014 Freescale Semiconductor Inc. 9 + * 10 + * This program is free software; you can redistribute it and/or modify it 11 + * under the terms of the GNU General Public License as published by the 12 + * Free Software Foundation; either version 2 of the License, or (at your 13 + * option) any later version. 14 + */ 15 + 16 + #include <linux/of_platform.h> 17 + #include <linux/pci.h> 18 + #include <asm/mpic.h> 19 + #include <sysdev/fsl_soc.h> 20 + #include <asm/udbg.h> 21 + 22 + #include "mpc85xx.h" 23 + #include "smp.h" 24 + 25 + void __init bsc913x_qds_pic_init(void) 26 + { 27 + struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN | 28 + MPIC_SINGLE_DEST_CPU, 29 + 0, 256, " OpenPIC "); 30 + 31 + if (!mpic) 32 + pr_err("bsc913x: Failed to allocate MPIC structure\n"); 33 + else 34 + mpic_init(mpic); 35 + } 36 + 37 + /* 38 + * Setup the architecture 39 + */ 40 + static void __init bsc913x_qds_setup_arch(void) 41 + { 42 + if (ppc_md.progress) 43 + ppc_md.progress("bsc913x_qds_setup_arch()", 0); 44 + 45 + #if defined(CONFIG_SMP) 46 + mpc85xx_smp_init(); 47 + #endif 48 + 49 + pr_info("bsc913x board from Freescale Semiconductor\n"); 50 + } 51 + 52 + machine_device_initcall(bsc9132_qds, mpc85xx_common_publish_devices); 53 + 54 + /* 55 + * Called very early, device-tree isn't unflattened 56 + */ 57 + 58 + static int __init bsc9132_qds_probe(void) 59 + { 60 + unsigned long root = of_get_flat_dt_root(); 61 + 62 + return of_flat_dt_is_compatible(root, "fsl,bsc9132qds"); 63 + } 64 + 65 + define_machine(bsc9132_qds) { 66 + .name = "BSC9132 QDS", 67 + .probe = bsc9132_qds_probe, 68 + .setup_arch = bsc913x_qds_setup_arch, 69 + .init_IRQ = bsc913x_qds_pic_init, 70 + .get_irq = mpic_get_irq, 71 + .restart = fsl_rstcr_restart, 72 + .calibrate_decr = generic_calibrate_decr, 73 + .progress = udbg_progress, 74 + };
+8 -1
arch/powerpc/platforms/85xx/corenet_generic.c
··· 67 67 68 68 swiotlb_detect_4g(); 69 69 70 - pr_info("%s board from Freescale Semiconductor\n", ppc_md.name); 70 + pr_info("%s board\n", ppc_md.name); 71 71 72 72 mpc85xx_qe_init(); 73 73 } ··· 115 115 static const char * const boards[] __initconst = { 116 116 "fsl,P2041RDB", 117 117 "fsl,P3041DS", 118 + "fsl,OCA4080", 118 119 "fsl,P4080DS", 119 120 "fsl,P5020DS", 120 121 "fsl,P5040DS", ··· 123 122 "fsl,B4860QDS", 124 123 "fsl,B4420QDS", 125 124 "fsl,B4220QDS", 125 + "fsl,T1040QDS", 126 + "fsl,T1042QDS", 127 + "keymile,kmcoge4", 126 128 NULL 127 129 }; 128 130 129 131 static const char * const hv_boards[] __initconst = { 130 132 "fsl,P2041RDB-hv", 131 133 "fsl,P3041DS-hv", 134 + "fsl,OCA4080-hv", 132 135 "fsl,P4080DS-hv", 133 136 "fsl,P5020DS-hv", 134 137 "fsl,P5040DS-hv", ··· 140 135 "fsl,B4860QDS-hv", 141 136 "fsl,B4420QDS-hv", 142 137 "fsl,B4220QDS-hv", 138 + "fsl,T1040QDS-hv", 139 + "fsl,T1042QDS-hv", 143 140 NULL 144 141 }; 145 142
+6 -30
arch/powerpc/platforms/85xx/p1023_rds.c arch/powerpc/platforms/85xx/p1023_rdb.c
··· 4 4 * Author: Roy Zang <tie-fei.zang@freescale.com> 5 5 * 6 6 * Description: 7 - * P1023 RDS Board Setup 7 + * P1023 RDB Board Setup 8 8 * 9 9 * This program is free software; you can redistribute it and/or modify it 10 10 * under the terms of the GNU General Public License as published by the ··· 41 41 * Setup the architecture 42 42 * 43 43 */ 44 - static void __init mpc85xx_rds_setup_arch(void) 44 + static void __init mpc85xx_rdb_setup_arch(void) 45 45 { 46 46 struct device_node *np; 47 47 48 48 if (ppc_md.progress) 49 - ppc_md.progress("p1023_rds_setup_arch()", 0); 49 + ppc_md.progress("p1023_rdb_setup_arch()", 0); 50 50 51 51 /* Map BCSR area */ 52 52 np = of_find_node_by_name(NULL, "bcsr"); ··· 85 85 fsl_pci_assign_primary(); 86 86 } 87 87 88 - machine_arch_initcall(p1023_rds, mpc85xx_common_publish_devices); 89 88 machine_arch_initcall(p1023_rdb, mpc85xx_common_publish_devices); 90 89 91 - static void __init mpc85xx_rds_pic_init(void) 90 + static void __init mpc85xx_rdb_pic_init(void) 92 91 { 93 92 struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN | 94 93 MPIC_SINGLE_DEST_CPU, ··· 98 99 mpic_init(mpic); 99 100 } 100 101 101 - static int __init p1023_rds_probe(void) 102 - { 103 - unsigned long root = of_get_flat_dt_root(); 104 - 105 - return of_flat_dt_is_compatible(root, "fsl,P1023RDS"); 106 - 107 - } 108 - 109 102 static int __init p1023_rdb_probe(void) 110 103 { 111 104 unsigned long root = of_get_flat_dt_root(); ··· 106 115 107 116 } 108 117 109 - define_machine(p1023_rds) { 110 - .name = "P1023 RDS", 111 - .probe = p1023_rds_probe, 112 - .setup_arch = mpc85xx_rds_setup_arch, 113 - .init_IRQ = mpc85xx_rds_pic_init, 114 - .get_irq = mpic_get_irq, 115 - .restart = fsl_rstcr_restart, 116 - .calibrate_decr = generic_calibrate_decr, 117 - .progress = udbg_progress, 118 - #ifdef CONFIG_PCI 119 - .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 120 - .pcibios_fixup_phb = fsl_pcibios_fixup_phb, 121 - #endif 122 - }; 123 - 124 118 define_machine(p1023_rdb) { 125 119 .name = "P1023 RDB", 126 120 .probe = p1023_rdb_probe, 127 - .setup_arch = mpc85xx_rds_setup_arch, 128 - .init_IRQ = mpc85xx_rds_pic_init, 121 + .setup_arch = mpc85xx_rdb_setup_arch, 122 + .init_IRQ = mpc85xx_rdb_pic_init, 129 123 .get_irq = mpic_get_irq, 130 124 .restart = fsl_rstcr_restart, 131 125 .calibrate_decr = generic_calibrate_decr,
+2 -1
arch/powerpc/platforms/85xx/smp.c
··· 27 27 #include <asm/cacheflush.h> 28 28 #include <asm/dbell.h> 29 29 #include <asm/fsl_guts.h> 30 + #include <asm/code-patching.h> 30 31 31 32 #include <sysdev/fsl_soc.h> 32 33 #include <sysdev/mpic.h> ··· 268 267 flush_spin_table(spin_table); 269 268 out_be32(&spin_table->pir, hw_cpu); 270 269 out_be64((u64 *)(&spin_table->addr_h), 271 - __pa((u64)*((unsigned long long *)generic_secondary_smp_init))); 270 + __pa(ppc_function_entry(generic_secondary_smp_init))); 272 271 flush_spin_table(spin_table); 273 272 #endif 274 273
+5
arch/powerpc/platforms/Kconfig.cputype
··· 422 422 423 423 config CPU_LITTLE_ENDIAN 424 424 bool "Build little endian kernel" 425 + select PPC64_BOOT_WRAPPER 425 426 help 426 427 Build a little endian kernel. 427 428 ··· 431 430 little endian powerpc. 432 431 433 432 endchoice 433 + 434 + config PPC64_BOOT_WRAPPER 435 + def_bool n 436 + depends on CPU_LITTLE_ENDIAN
+3 -2
arch/powerpc/platforms/cell/smp.c
··· 40 40 #include <asm/firmware.h> 41 41 #include <asm/rtas.h> 42 42 #include <asm/cputhreads.h> 43 + #include <asm/code-patching.h> 43 44 44 45 #include "interrupt.h" 45 46 #include <asm/udbg.h> ··· 71 70 static inline int smp_startup_cpu(unsigned int lcpu) 72 71 { 73 72 int status; 74 - unsigned long start_here = __pa((u32)*((unsigned long *) 75 - generic_secondary_smp_init)); 73 + unsigned long start_here = 74 + __pa(ppc_function_entry(generic_secondary_smp_init)); 76 75 unsigned int pcpu; 77 76 int start_cpu; 78 77
+1
arch/powerpc/platforms/embedded6xx/Kconfig
··· 65 65 select PPC_INDIRECT_PCI 66 66 select PPC_I8259 67 67 select PPC_NATIVE 68 + select PPC_UDBG_16550 68 69 help 69 70 This option enables support for the Motorola (now Emerson) MVME5100 70 71 board.
+1 -1
arch/powerpc/platforms/pasemi/powersave.S
··· 66 66 std r3, 48(r1) 67 67 68 68 /* Only do power savings when in astate 0 */ 69 - bl .check_astate 69 + bl check_astate 70 70 cmpwi r3,0 71 71 bne 1f 72 72
+1 -1
arch/powerpc/platforms/powernv/Makefile
··· 1 1 obj-y += setup.o opal-takeover.o opal-wrappers.o opal.o opal-async.o 2 2 obj-y += opal-rtc.o opal-nvram.o opal-lpc.o opal-flash.o 3 3 obj-y += rng.o opal-elog.o opal-dump.o opal-sysparam.o opal-sensor.o 4 - obj-y += opal-msglog.o 4 + obj-y += opal-msglog.o subcore.o subcore-asm.o 5 5 6 6 obj-$(CONFIG_SMP) += smp.o 7 7 obj-$(CONFIG_PCI) += pci.o pci-p5ioc2.o pci-ioda.o
+138 -128
arch/powerpc/platforms/powernv/eeh-ioda.c
··· 42 42 { 43 43 uint64_t changed_evts = (uint64_t)change; 44 44 45 - /* We simply send special EEH event */ 46 - if ((changed_evts & OPAL_EVENT_PCI_ERROR) && 47 - (events & OPAL_EVENT_PCI_ERROR) && 48 - eeh_enabled()) 45 + /* 46 + * We simply send special EEH event if EEH has 47 + * been enabled, or clear pending events in 48 + * case that we enable EEH soon 49 + */ 50 + if (!(changed_evts & OPAL_EVENT_PCI_ERROR) || 51 + !(events & OPAL_EVENT_PCI_ERROR)) 52 + return 0; 53 + 54 + if (eeh_enabled()) 49 55 eeh_send_failure_event(NULL); 56 + else 57 + opal_notifier_update_evt(OPAL_EVENT_PCI_ERROR, 0x0ul); 50 58 51 59 return 0; 52 60 } ··· 149 141 } 150 142 151 143 #ifdef CONFIG_DEBUG_FS 152 - if (phb->dbgfs) { 144 + if (!phb->has_dbgfs && phb->dbgfs) { 145 + phb->has_dbgfs = 1; 146 + 153 147 debugfs_create_file("err_injct_outbound", 0600, 154 148 phb->dbgfs, hose, 155 149 &ioda_eeh_outb_dbgfs_ops); ··· 164 154 } 165 155 #endif 166 156 167 - phb->eeh_state |= PNV_EEH_STATE_ENABLED; 157 + /* If EEH is enabled, we're going to rely on that. 158 + * Otherwise, we restore to conventional mechanism 159 + * to clear frozen PE during PCI config access. 160 + */ 161 + if (eeh_enabled()) 162 + phb->flags |= PNV_PHB_FLAG_EEH; 163 + else 164 + phb->flags &= ~PNV_PHB_FLAG_EEH; 168 165 169 166 return 0; 170 167 } ··· 285 268 return EEH_STATE_NOT_SUPPORT; 286 269 } 287 270 271 + /* 272 + * If we're in middle of PE reset, return normal 273 + * state to keep EEH core going. For PHB reset, we 274 + * still expect to have fenced PHB cleared with 275 + * PHB reset. 276 + */ 277 + if (!(pe->type & EEH_PE_PHB) && 278 + (pe->state & EEH_PE_RESET)) { 279 + result = (EEH_STATE_MMIO_ACTIVE | 280 + EEH_STATE_DMA_ACTIVE | 281 + EEH_STATE_MMIO_ENABLED | 282 + EEH_STATE_DMA_ENABLED); 283 + return result; 284 + } 285 + 288 286 /* Retrieve PE status through OPAL */ 289 287 pe_no = pe->addr; 290 288 ret = opal_pci_eeh_freeze_status(phb->opal_id, pe_no, ··· 379 347 return result; 380 348 } 381 349 382 - static int ioda_eeh_pe_clear(struct eeh_pe *pe) 383 - { 384 - struct pci_controller *hose; 385 - struct pnv_phb *phb; 386 - u32 pe_no; 387 - u8 fstate; 388 - u16 pcierr; 389 - s64 ret; 390 - 391 - pe_no = pe->addr; 392 - hose = pe->phb; 393 - phb = pe->phb->private_data; 394 - 395 - /* Clear the EEH error on the PE */ 396 - ret = opal_pci_eeh_freeze_clear(phb->opal_id, 397 - pe_no, OPAL_EEH_ACTION_CLEAR_FREEZE_ALL); 398 - if (ret) { 399 - pr_err("%s: Failed to clear EEH error for " 400 - "PHB#%x-PE#%x, err=%lld\n", 401 - __func__, hose->global_number, pe_no, ret); 402 - return -EIO; 403 - } 404 - 405 - /* 406 - * Read the PE state back and verify that the frozen 407 - * state has been removed. 408 - */ 409 - ret = opal_pci_eeh_freeze_status(phb->opal_id, pe_no, 410 - &fstate, &pcierr, NULL); 411 - if (ret) { 412 - pr_err("%s: Failed to get EEH status on " 413 - "PHB#%x-PE#%x\n, err=%lld\n", 414 - __func__, hose->global_number, pe_no, ret); 415 - return -EIO; 416 - } 417 - 418 - if (fstate != OPAL_EEH_STOPPED_NOT_FROZEN) { 419 - pr_err("%s: Frozen state not cleared on " 420 - "PHB#%x-PE#%x, sts=%x\n", 421 - __func__, hose->global_number, pe_no, fstate); 422 - return -EIO; 423 - } 424 - 425 - return 0; 426 - } 427 - 428 350 static s64 ioda_eeh_phb_poll(struct pnv_phb *phb) 429 351 { 430 352 s64 rc = OPAL_HARDWARE; ··· 388 402 if (rc <= 0) 389 403 break; 390 404 391 - msleep(rc); 405 + if (system_state < SYSTEM_RUNNING) 406 + udelay(1000 * rc); 407 + else 408 + msleep(rc); 392 409 } 393 410 394 411 return rc; 395 412 } 396 413 397 - static int ioda_eeh_phb_reset(struct pci_controller *hose, int option) 414 + int ioda_eeh_phb_reset(struct pci_controller *hose, int option) 398 415 { 399 416 struct pnv_phb *phb = hose->private_data; 400 417 s64 rc = OPAL_HARDWARE; ··· 420 431 421 432 /* 422 433 * Poll state of the PHB until the request is done 423 - * successfully. 434 + * successfully. The PHB reset is usually PHB complete 435 + * reset followed by hot reset on root bus. So we also 436 + * need the PCI bus settlement delay. 424 437 */ 425 438 rc = ioda_eeh_phb_poll(phb); 439 + if (option == EEH_RESET_DEACTIVATE) { 440 + if (system_state < SYSTEM_RUNNING) 441 + udelay(1000 * EEH_PE_RST_SETTLE_TIME); 442 + else 443 + msleep(EEH_PE_RST_SETTLE_TIME); 444 + } 426 445 out: 427 446 if (rc != OPAL_SUCCESS) 428 447 return -EIO; ··· 468 471 469 472 /* Poll state of the PHB until the request is done */ 470 473 rc = ioda_eeh_phb_poll(phb); 474 + if (option == EEH_RESET_DEACTIVATE) 475 + msleep(EEH_PE_RST_SETTLE_TIME); 471 476 out: 472 477 if (rc != OPAL_SUCCESS) 473 478 return -EIO; ··· 477 478 return 0; 478 479 } 479 480 480 - static int ioda_eeh_bridge_reset(struct pci_controller *hose, 481 - struct pci_dev *dev, int option) 482 - { 483 - u16 ctrl; 481 + static int ioda_eeh_bridge_reset(struct pci_dev *dev, int option) 484 482 485 - pr_debug("%s: Reset device %04x:%02x:%02x.%01x with option %d\n", 486 - __func__, hose->global_number, dev->bus->number, 487 - PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn), option); 483 + { 484 + struct device_node *dn = pci_device_to_OF_node(dev); 485 + struct eeh_dev *edev = of_node_to_eeh_dev(dn); 486 + int aer = edev ? edev->aer_cap : 0; 487 + u32 ctrl; 488 + 489 + pr_debug("%s: Reset PCI bus %04x:%02x with option %d\n", 490 + __func__, pci_domain_nr(dev->bus), 491 + dev->bus->number, option); 488 492 489 493 switch (option) { 490 494 case EEH_RESET_FUNDAMENTAL: 491 495 case EEH_RESET_HOT: 492 - pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &ctrl); 496 + /* Don't report linkDown event */ 497 + if (aer) { 498 + eeh_ops->read_config(dn, aer + PCI_ERR_UNCOR_MASK, 499 + 4, &ctrl); 500 + ctrl |= PCI_ERR_UNC_SURPDN; 501 + eeh_ops->write_config(dn, aer + PCI_ERR_UNCOR_MASK, 502 + 4, ctrl); 503 + } 504 + 505 + eeh_ops->read_config(dn, PCI_BRIDGE_CONTROL, 2, &ctrl); 493 506 ctrl |= PCI_BRIDGE_CTL_BUS_RESET; 494 - pci_write_config_word(dev, PCI_BRIDGE_CONTROL, ctrl); 507 + eeh_ops->write_config(dn, PCI_BRIDGE_CONTROL, 2, ctrl); 508 + msleep(EEH_PE_RST_HOLD_TIME); 509 + 495 510 break; 496 511 case EEH_RESET_DEACTIVATE: 497 - pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &ctrl); 512 + eeh_ops->read_config(dn, PCI_BRIDGE_CONTROL, 2, &ctrl); 498 513 ctrl &= ~PCI_BRIDGE_CTL_BUS_RESET; 499 - pci_write_config_word(dev, PCI_BRIDGE_CONTROL, ctrl); 514 + eeh_ops->write_config(dn, PCI_BRIDGE_CONTROL, 2, ctrl); 515 + msleep(EEH_PE_RST_SETTLE_TIME); 516 + 517 + /* Continue reporting linkDown event */ 518 + if (aer) { 519 + eeh_ops->read_config(dn, aer + PCI_ERR_UNCOR_MASK, 520 + 4, &ctrl); 521 + ctrl &= ~PCI_ERR_UNC_SURPDN; 522 + eeh_ops->write_config(dn, aer + PCI_ERR_UNCOR_MASK, 523 + 4, ctrl); 524 + } 525 + 500 526 break; 501 527 } 502 528 503 529 return 0; 530 + } 531 + 532 + void pnv_pci_reset_secondary_bus(struct pci_dev *dev) 533 + { 534 + struct pci_controller *hose; 535 + 536 + if (pci_is_root_bus(dev->bus)) { 537 + hose = pci_bus_to_host(dev->bus); 538 + ioda_eeh_root_reset(hose, EEH_RESET_HOT); 539 + ioda_eeh_root_reset(hose, EEH_RESET_DEACTIVATE); 540 + } else { 541 + ioda_eeh_bridge_reset(dev, EEH_RESET_HOT); 542 + ioda_eeh_bridge_reset(dev, EEH_RESET_DEACTIVATE); 543 + } 504 544 } 505 545 506 546 /** ··· 561 523 int ret; 562 524 563 525 /* 564 - * Anyway, we have to clear the problematic state for the 565 - * corresponding PE. However, we needn't do it if the PE 566 - * is PHB associated. That means the PHB is having fatal 567 - * errors and it needs reset. Further more, the AIB interface 568 - * isn't reliable any more. 569 - */ 570 - if (!(pe->type & EEH_PE_PHB) && 571 - (option == EEH_RESET_HOT || 572 - option == EEH_RESET_FUNDAMENTAL)) { 573 - ret = ioda_eeh_pe_clear(pe); 574 - if (ret) 575 - return -EIO; 576 - } 577 - 578 - /* 579 - * The rules applied to reset, either fundamental or hot reset: 526 + * For PHB reset, we always have complete reset. For those PEs whose 527 + * primary bus derived from root complex (root bus) or root port 528 + * (usually bus#1), we apply hot or fundamental reset on the root port. 529 + * For other PEs, we always have hot reset on the PE primary bus. 580 530 * 581 - * We always reset the direct upstream bridge of the PE. If the 582 - * direct upstream bridge isn't root bridge, we always take hot 583 - * reset no matter what option (fundamental or hot) is. Otherwise, 584 - * we should do the reset according to the required option. 531 + * Here, we have different design to pHyp, which always clear the 532 + * frozen state during PE reset. However, the good idea here from 533 + * benh is to keep frozen state before we get PE reset done completely 534 + * (until BAR restore). With the frozen state, HW drops illegal IO 535 + * or MMIO access, which can incur recrusive frozen PE during PE 536 + * reset. The side effect is that EEH core has to clear the frozen 537 + * state explicitly after BAR restore. 585 538 */ 586 539 if (pe->type & EEH_PE_PHB) { 587 540 ret = ioda_eeh_phb_reset(hose, option); ··· 582 553 pci_is_root_bus(bus->parent)) 583 554 ret = ioda_eeh_root_reset(hose, option); 584 555 else 585 - ret = ioda_eeh_bridge_reset(hose, bus->self, option); 556 + ret = ioda_eeh_bridge_reset(bus->self, option); 586 557 } 587 558 588 559 return ret; ··· 669 640 } 670 641 } 671 642 672 - static int ioda_eeh_get_phb_pe(struct pci_controller *hose, 673 - struct eeh_pe **pe) 674 - { 675 - struct eeh_pe *phb_pe; 676 - 677 - phb_pe = eeh_phb_pe_get(hose); 678 - if (!phb_pe) { 679 - pr_warning("%s Can't find PE for PHB#%d\n", 680 - __func__, hose->global_number); 681 - return -EEXIST; 682 - } 683 - 684 - *pe = phb_pe; 685 - return 0; 686 - } 687 - 688 643 static int ioda_eeh_get_pe(struct pci_controller *hose, 689 644 u16 pe_no, struct eeh_pe **pe) 690 645 { ··· 676 663 struct eeh_dev dev; 677 664 678 665 /* Find the PHB PE */ 679 - if (ioda_eeh_get_phb_pe(hose, &phb_pe)) 666 + phb_pe = eeh_phb_pe_get(hose); 667 + if (!phb_pe) 680 668 return -EEXIST; 681 669 682 670 /* Find the PE according to PE# */ ··· 705 691 { 706 692 struct pci_controller *hose; 707 693 struct pnv_phb *phb; 694 + struct eeh_pe *phb_pe; 708 695 u64 frozen_pe_no; 709 696 u16 err_type, severity; 710 697 long rc; ··· 722 707 list_for_each_entry(hose, &hose_list, list_node) { 723 708 /* 724 709 * If the subordinate PCI buses of the PHB has been 725 - * removed, we needn't take care of it any more. 710 + * removed or is exactly under error recovery, we 711 + * needn't take care of it any more. 726 712 */ 727 713 phb = hose->private_data; 728 - if (phb->eeh_state & PNV_EEH_STATE_REMOVED) 714 + phb_pe = eeh_phb_pe_get(hose); 715 + if (!phb_pe || (phb_pe->state & EEH_PE_ISOLATED)) 729 716 continue; 730 717 731 718 rc = opal_pci_next_error(phb->opal_id, ··· 760 743 switch (err_type) { 761 744 case OPAL_EEH_IOC_ERROR: 762 745 if (severity == OPAL_EEH_SEV_IOC_DEAD) { 763 - list_for_each_entry(hose, &hose_list, 764 - list_node) { 765 - phb = hose->private_data; 766 - phb->eeh_state |= PNV_EEH_STATE_REMOVED; 767 - } 768 - 769 746 pr_err("EEH: dead IOC detected\n"); 770 747 ret = EEH_NEXT_ERR_DEAD_IOC; 771 748 } else if (severity == OPAL_EEH_SEV_INF) { ··· 772 761 break; 773 762 case OPAL_EEH_PHB_ERROR: 774 763 if (severity == OPAL_EEH_SEV_PHB_DEAD) { 775 - if (ioda_eeh_get_phb_pe(hose, pe)) 776 - break; 777 - 764 + *pe = phb_pe; 778 765 pr_err("EEH: dead PHB#%x detected\n", 779 766 hose->global_number); 780 - phb->eeh_state |= PNV_EEH_STATE_REMOVED; 781 767 ret = EEH_NEXT_ERR_DEAD_PHB; 782 768 } else if (severity == OPAL_EEH_SEV_PHB_FENCED) { 783 - if (ioda_eeh_get_phb_pe(hose, pe)) 784 - break; 785 - 769 + *pe = phb_pe; 786 770 pr_err("EEH: fenced PHB#%x detected\n", 787 771 hose->global_number); 788 772 ret = EEH_NEXT_ERR_FENCED_PHB; ··· 795 789 * If we can't find the corresponding PE, the 796 790 * PEEV / PEST would be messy. So we force an 797 791 * fenced PHB so that it can be recovered. 792 + * 793 + * If the PE has been marked as isolated, that 794 + * should have been removed permanently or in 795 + * progress with recovery. We needn't report 796 + * it again. 798 797 */ 799 798 if (ioda_eeh_get_pe(hose, frozen_pe_no, pe)) { 800 - if (!ioda_eeh_get_phb_pe(hose, pe)) { 801 - pr_err("EEH: Escalated fenced PHB#%x " 802 - "detected for PE#%llx\n", 803 - hose->global_number, 804 - frozen_pe_no); 805 - ret = EEH_NEXT_ERR_FENCED_PHB; 806 - } else { 807 - ret = EEH_NEXT_ERR_NONE; 808 - } 799 + *pe = phb_pe; 800 + pr_err("EEH: Escalated fenced PHB#%x " 801 + "detected for PE#%llx\n", 802 + hose->global_number, 803 + frozen_pe_no); 804 + ret = EEH_NEXT_ERR_FENCED_PHB; 805 + } else if ((*pe)->state & EEH_PE_ISOLATED) { 806 + ret = EEH_NEXT_ERR_NONE; 809 807 } else { 810 808 pr_err("EEH: Frozen PE#%x on PHB#%x detected\n", 811 809 (*pe)->addr, (*pe)->phb->global_number);
+4
arch/powerpc/platforms/powernv/eeh-powernv.c
··· 126 126 edev->mode &= 0xFFFFFF00; 127 127 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) 128 128 edev->mode |= EEH_DEV_BRIDGE; 129 + edev->pcix_cap = pci_find_capability(dev, PCI_CAP_ID_PCIX); 129 130 if (pci_is_pcie(dev)) { 130 131 edev->pcie_cap = pci_pcie_cap(dev); 131 132 ··· 134 133 edev->mode |= EEH_DEV_ROOT_PORT; 135 134 else if (pci_pcie_type(dev) == PCI_EXP_TYPE_DOWNSTREAM) 136 135 edev->mode |= EEH_DEV_DS_PORT; 136 + 137 + edev->aer_cap = pci_find_ext_capability(dev, 138 + PCI_EXT_CAP_ID_ERR); 137 139 } 138 140 139 141 edev->config_addr = ((dev->bus->number << 8) | dev->devfn);
+44 -6
arch/powerpc/platforms/powernv/opal-flash.c
··· 20 20 #include <linux/mm.h> 21 21 #include <linux/vmalloc.h> 22 22 #include <linux/pagemap.h> 23 + #include <linux/delay.h> 23 24 24 25 #include <asm/opal.h> 25 26 ··· 131 130 { 132 131 long ret; 133 132 void *buf = validate_flash_data.buf; 134 - __be32 size, result; 133 + __be32 size = cpu_to_be32(validate_flash_data.buf_size); 134 + __be32 result; 135 135 136 136 ret = opal_validate_flash(__pa(buf), &size, &result); 137 137 ··· 292 290 /* First entry address */ 293 291 addr = __pa(list); 294 292 295 - pr_alert("FLASH: Image is %u bytes\n", image_data.size); 296 - pr_alert("FLASH: Image update requested\n"); 297 - pr_alert("FLASH: Image will be updated during system reboot\n"); 298 - pr_alert("FLASH: This will take several minutes. Do not power off!\n"); 299 - 300 293 flash: 301 294 rc = opal_update_flash(addr); 302 295 303 296 invalid_img: 304 297 return rc; 298 + } 299 + 300 + /* Return CPUs to OPAL before starting FW update */ 301 + static void flash_return_cpu(void *info) 302 + { 303 + int cpu = smp_processor_id(); 304 + 305 + if (!cpu_online(cpu)) 306 + return; 307 + 308 + /* Disable IRQ */ 309 + hard_irq_disable(); 310 + 311 + /* Return the CPU to OPAL */ 312 + opal_return_cpu(); 313 + } 314 + 315 + /* This gets called just before system reboots */ 316 + void opal_flash_term_callback(void) 317 + { 318 + struct cpumask mask; 319 + 320 + if (update_flash_data.status != FLASH_IMG_READY) 321 + return; 322 + 323 + pr_alert("FLASH: Flashing new firmware\n"); 324 + pr_alert("FLASH: Image is %u bytes\n", image_data.size); 325 + pr_alert("FLASH: Performing flash and reboot/shutdown\n"); 326 + pr_alert("FLASH: This will take several minutes. Do not power off!\n"); 327 + 328 + /* Small delay to help getting the above message out */ 329 + msleep(500); 330 + 331 + /* Return secondary CPUs to firmware */ 332 + cpumask_copy(&mask, cpu_online_mask); 333 + cpumask_clear_cpu(smp_processor_id(), &mask); 334 + if (!cpumask_empty(&mask)) 335 + smp_call_function_many(&mask, 336 + flash_return_cpu, NULL, false); 337 + /* Hard disable interrupts */ 338 + hard_irq_disable(); 305 339 } 306 340 307 341 /*
+151
arch/powerpc/platforms/powernv/opal-lpc.c
··· 12 12 #include <linux/kernel.h> 13 13 #include <linux/of.h> 14 14 #include <linux/bug.h> 15 + #include <linux/debugfs.h> 16 + #include <linux/io.h> 17 + #include <linux/slab.h> 15 18 16 19 #include <asm/machdep.h> 17 20 #include <asm/firmware.h> 18 21 #include <asm/xics.h> 19 22 #include <asm/opal.h> 20 23 #include <asm/prom.h> 24 + #include <asm/uaccess.h> 25 + #include <asm/debug.h> 21 26 22 27 static int opal_lpc_chip_id = -1; 23 28 ··· 180 175 .outsw = opal_lpc_outsw, 181 176 .outsl = opal_lpc_outsl, 182 177 }; 178 + 179 + #ifdef CONFIG_DEBUG_FS 180 + struct lpc_debugfs_entry { 181 + enum OpalLPCAddressType lpc_type; 182 + }; 183 + 184 + static ssize_t lpc_debug_read(struct file *filp, char __user *ubuf, 185 + size_t count, loff_t *ppos) 186 + { 187 + struct lpc_debugfs_entry *lpc = filp->private_data; 188 + u32 data, pos, len, todo; 189 + int rc; 190 + 191 + if (!access_ok(VERIFY_WRITE, ubuf, count)) 192 + return -EFAULT; 193 + 194 + todo = count; 195 + while (todo) { 196 + pos = *ppos; 197 + 198 + /* 199 + * Select access size based on count and alignment and 200 + * access type. IO and MEM only support byte acceses, 201 + * FW supports all 3. 202 + */ 203 + len = 1; 204 + if (lpc->lpc_type == OPAL_LPC_FW) { 205 + if (todo > 3 && (pos & 3) == 0) 206 + len = 4; 207 + else if (todo > 1 && (pos & 1) == 0) 208 + len = 2; 209 + } 210 + rc = opal_lpc_read(opal_lpc_chip_id, lpc->lpc_type, pos, 211 + &data, len); 212 + if (rc) 213 + return -ENXIO; 214 + switch(len) { 215 + case 4: 216 + rc = __put_user((u32)data, (u32 __user *)ubuf); 217 + break; 218 + case 2: 219 + rc = __put_user((u16)data, (u16 __user *)ubuf); 220 + break; 221 + default: 222 + rc = __put_user((u8)data, (u8 __user *)ubuf); 223 + break; 224 + } 225 + if (rc) 226 + return -EFAULT; 227 + *ppos += len; 228 + ubuf += len; 229 + todo -= len; 230 + } 231 + 232 + return count; 233 + } 234 + 235 + static ssize_t lpc_debug_write(struct file *filp, const char __user *ubuf, 236 + size_t count, loff_t *ppos) 237 + { 238 + struct lpc_debugfs_entry *lpc = filp->private_data; 239 + u32 data, pos, len, todo; 240 + int rc; 241 + 242 + if (!access_ok(VERIFY_READ, ubuf, count)) 243 + return -EFAULT; 244 + 245 + todo = count; 246 + while (todo) { 247 + pos = *ppos; 248 + 249 + /* 250 + * Select access size based on count and alignment and 251 + * access type. IO and MEM only support byte acceses, 252 + * FW supports all 3. 253 + */ 254 + len = 1; 255 + if (lpc->lpc_type == OPAL_LPC_FW) { 256 + if (todo > 3 && (pos & 3) == 0) 257 + len = 4; 258 + else if (todo > 1 && (pos & 1) == 0) 259 + len = 2; 260 + } 261 + switch(len) { 262 + case 4: 263 + rc = __get_user(data, (u32 __user *)ubuf); 264 + break; 265 + case 2: 266 + rc = __get_user(data, (u16 __user *)ubuf); 267 + break; 268 + default: 269 + rc = __get_user(data, (u8 __user *)ubuf); 270 + break; 271 + } 272 + if (rc) 273 + return -EFAULT; 274 + 275 + rc = opal_lpc_write(opal_lpc_chip_id, lpc->lpc_type, pos, 276 + data, len); 277 + if (rc) 278 + return -ENXIO; 279 + *ppos += len; 280 + ubuf += len; 281 + todo -= len; 282 + } 283 + 284 + return count; 285 + } 286 + 287 + static const struct file_operations lpc_fops = { 288 + .read = lpc_debug_read, 289 + .write = lpc_debug_write, 290 + .open = simple_open, 291 + .llseek = default_llseek, 292 + }; 293 + 294 + static int opal_lpc_debugfs_create_type(struct dentry *folder, 295 + const char *fname, 296 + enum OpalLPCAddressType type) 297 + { 298 + struct lpc_debugfs_entry *entry; 299 + entry = kzalloc(sizeof(*entry), GFP_KERNEL); 300 + if (!entry) 301 + return -ENOMEM; 302 + entry->lpc_type = type; 303 + debugfs_create_file(fname, 0600, folder, entry, &lpc_fops); 304 + return 0; 305 + } 306 + 307 + static int opal_lpc_init_debugfs(void) 308 + { 309 + struct dentry *root; 310 + int rc = 0; 311 + 312 + if (opal_lpc_chip_id < 0) 313 + return -ENODEV; 314 + 315 + root = debugfs_create_dir("lpc", powerpc_debugfs_root); 316 + 317 + rc |= opal_lpc_debugfs_create_type(root, "io", OPAL_LPC_IO); 318 + rc |= opal_lpc_debugfs_create_type(root, "mem", OPAL_LPC_MEM); 319 + rc |= opal_lpc_debugfs_create_type(root, "fw", OPAL_LPC_FW); 320 + return rc; 321 + } 322 + device_initcall(opal_lpc_init_debugfs); 323 + #endif /* CONFIG_DEBUG_FS */ 183 324 184 325 void opal_lpc_init(void) 185 326 {
+4 -4
arch/powerpc/platforms/powernv/opal-memory-errors.c
··· 47 47 __func__, merr_evt->type); 48 48 switch (merr_evt->type) { 49 49 case OPAL_MEM_ERR_TYPE_RESILIENCE: 50 - paddr_start = merr_evt->u.resilience.physical_address_start; 51 - paddr_end = merr_evt->u.resilience.physical_address_end; 50 + paddr_start = be64_to_cpu(merr_evt->u.resilience.physical_address_start); 51 + paddr_end = be64_to_cpu(merr_evt->u.resilience.physical_address_end); 52 52 break; 53 53 case OPAL_MEM_ERR_TYPE_DYN_DALLOC: 54 - paddr_start = merr_evt->u.dyn_dealloc.physical_address_start; 55 - paddr_end = merr_evt->u.dyn_dealloc.physical_address_end; 54 + paddr_start = be64_to_cpu(merr_evt->u.dyn_dealloc.physical_address_start); 55 + paddr_end = be64_to_cpu(merr_evt->u.dyn_dealloc.physical_address_end); 56 56 break; 57 57 default: 58 58 return;
+2
arch/powerpc/platforms/powernv/opal-takeover.S
··· 21 21 _GLOBAL(opal_query_takeover) 22 22 mfcr r0 23 23 stw r0,8(r1) 24 + stdu r1,-STACKFRAMESIZE(r1) 24 25 std r3,STK_PARAM(R3)(r1) 25 26 std r4,STK_PARAM(R4)(r1) 26 27 li r3,H_HAL_TAKEOVER 27 28 li r4,H_HAL_TAKEOVER_QUERY_MAGIC 28 29 HVSC 30 + addi r1,r1,STACKFRAMESIZE 29 31 ld r10,STK_PARAM(R3)(r1) 30 32 std r4,0(r10) 31 33 ld r10,STK_PARAM(R4)(r1)
+3 -2
arch/powerpc/platforms/powernv/opal-wrappers.S
··· 32 32 std r12,PACASAVEDMSR(r13); \ 33 33 andc r12,r12,r0; \ 34 34 mtmsrd r12,1; \ 35 - LOAD_REG_ADDR(r0,.opal_return); \ 35 + LOAD_REG_ADDR(r0,opal_return); \ 36 36 mtlr r0; \ 37 37 li r0,MSR_DR|MSR_IR|MSR_LE;\ 38 38 andc r12,r12,r0; \ ··· 44 44 mtspr SPRN_HSRR0,r12; \ 45 45 hrfid 46 46 47 - _STATIC(opal_return) 47 + opal_return: 48 48 /* 49 49 * Fixup endian on OPAL return... we should be able to simplify 50 50 * this by instead converting the below trampoline to a set of ··· 124 124 OPAL_CALL(opal_lpc_read, OPAL_LPC_READ); 125 125 OPAL_CALL(opal_lpc_write, OPAL_LPC_WRITE); 126 126 OPAL_CALL(opal_return_cpu, OPAL_RETURN_CPU); 127 + OPAL_CALL(opal_reinit_cpus, OPAL_REINIT_CPUS); 127 128 OPAL_CALL(opal_read_elog, OPAL_ELOG_READ); 128 129 OPAL_CALL(opal_send_ack_elog, OPAL_ELOG_ACK); 129 130 OPAL_CALL(opal_get_elog_size, OPAL_ELOG_SIZE);
+22
arch/powerpc/platforms/powernv/opal.c
··· 57 57 static uint64_t last_notified_mask = 0x0ul; 58 58 static atomic_t opal_notifier_hold = ATOMIC_INIT(0); 59 59 60 + static void opal_reinit_cores(void) 61 + { 62 + /* Do the actual re-init, This will clobber all FPRs, VRs, etc... 63 + * 64 + * It will preserve non volatile GPRs and HSPRG0/1. It will 65 + * also restore HIDs and other SPRs to their original value 66 + * but it might clobber a bunch. 67 + */ 68 + #ifdef __BIG_ENDIAN__ 69 + opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_BE); 70 + #else 71 + opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_LE); 72 + #endif 73 + } 74 + 60 75 int __init early_init_dt_scan_opal(unsigned long node, 61 76 const char *uname, int depth, void *data) 62 77 { ··· 110 95 } else { 111 96 printk("OPAL V1 detected !\n"); 112 97 } 98 + 99 + /* Reinit all cores with the right endian */ 100 + opal_reinit_cores(); 101 + 102 + /* Restore some bits */ 103 + if (cur_cpu_spec->cpu_restore) 104 + cur_cpu_spec->cpu_restore(); 113 105 114 106 return 1; 115 107 }
+19 -7
arch/powerpc/platforms/powernv/pci-ioda.c
··· 13 13 14 14 #include <linux/kernel.h> 15 15 #include <linux/pci.h> 16 + #include <linux/crash_dump.h> 16 17 #include <linux/debugfs.h> 17 18 #include <linux/delay.h> 18 19 #include <linux/string.h> ··· 664 663 * errors, and on the first pass the data will be a relative 665 664 * bus number, print that out instead. 666 665 */ 667 - tbl->it_busno = 0; 668 666 pe->tce_inval_reg_phys = be64_to_cpup(swinvp); 669 667 tbl->it_index = (unsigned long)ioremap(pe->tce_inval_reg_phys, 670 668 8); 671 - tbl->it_type = TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE | 672 - TCE_PCI_SWINV_PAIR; 669 + tbl->it_type |= (TCE_PCI_SWINV_CREATE | 670 + TCE_PCI_SWINV_FREE | 671 + TCE_PCI_SWINV_PAIR); 673 672 } 674 673 iommu_init_table(tbl, phb->hose->node); 675 - iommu_register_group(tbl, pci_domain_nr(pe->pbus), pe->pe_number); 674 + iommu_register_group(tbl, phb->hose->global_number, pe->pe_number); 676 675 677 676 if (pe->pdev) 678 677 set_iommu_table_base_and_group(&pe->pdev->dev, tbl); ··· 794 793 * errors, and on the first pass the data will be a relative 795 794 * bus number, print that out instead. 796 795 */ 797 - tbl->it_busno = 0; 798 796 pe->tce_inval_reg_phys = be64_to_cpup(swinvp); 799 797 tbl->it_index = (unsigned long)ioremap(pe->tce_inval_reg_phys, 800 798 8); 801 - tbl->it_type = TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE; 799 + tbl->it_type |= (TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE); 802 800 } 803 801 iommu_init_table(tbl, phb->hose->node); 804 - iommu_register_group(tbl, pci_domain_nr(pe->pbus), pe->pe_number); 802 + iommu_register_group(tbl, phb->hose->global_number, pe->pe_number); 805 803 806 804 if (pe->pdev) 807 805 set_iommu_table_base_and_group(&pe->pdev->dev, tbl); ··· 1386 1386 ppc_md.pcibios_fixup = pnv_pci_ioda_fixup; 1387 1387 ppc_md.pcibios_enable_device_hook = pnv_pci_enable_device_hook; 1388 1388 ppc_md.pcibios_window_alignment = pnv_pci_window_alignment; 1389 + ppc_md.pcibios_reset_secondary_bus = pnv_pci_reset_secondary_bus; 1389 1390 pci_add_flags(PCI_REASSIGN_ALL_RSRC); 1390 1391 1391 1392 /* Reset IODA tables to a clean state */ 1392 1393 rc = opal_pci_reset(phb_id, OPAL_PCI_IODA_TABLE_RESET, OPAL_ASSERT_RESET); 1393 1394 if (rc) 1394 1395 pr_warning(" OPAL Error %ld performing IODA table reset !\n", rc); 1396 + 1397 + /* If we're running in kdump kerenl, the previous kerenl never 1398 + * shutdown PCI devices correctly. We already got IODA table 1399 + * cleaned out. So we have to issue PHB reset to stop all PCI 1400 + * transactions from previous kerenl. 1401 + */ 1402 + if (is_kdump_kernel()) { 1403 + pr_info(" Issue PHB reset ...\n"); 1404 + ioda_eeh_phb_reset(hose, EEH_RESET_FUNDAMENTAL); 1405 + ioda_eeh_phb_reset(hose, OPAL_DEASSERT_RESET); 1406 + } 1395 1407 } 1396 1408 1397 1409 void __init pnv_pci_init_ioda2_phb(struct device_node *np)
+113 -95
arch/powerpc/platforms/powernv/pci.c
··· 131 131 int i; 132 132 133 133 data = (struct OpalIoP7IOCPhbErrorData *)common; 134 - pr_info("P7IOC PHB#%d Diag-data (Version: %d)\n\n", 134 + pr_info("P7IOC PHB#%d Diag-data (Version: %d)\n", 135 135 hose->global_number, common->version); 136 136 137 137 if (data->brdgCtl) 138 - pr_info(" brdgCtl: %08x\n", 138 + pr_info("brdgCtl: %08x\n", 139 139 data->brdgCtl); 140 140 if (data->portStatusReg || data->rootCmplxStatus || 141 141 data->busAgentStatus) 142 - pr_info(" UtlSts: %08x %08x %08x\n", 142 + pr_info("UtlSts: %08x %08x %08x\n", 143 143 data->portStatusReg, data->rootCmplxStatus, 144 144 data->busAgentStatus); 145 145 if (data->deviceStatus || data->slotStatus || 146 146 data->linkStatus || data->devCmdStatus || 147 147 data->devSecStatus) 148 - pr_info(" RootSts: %08x %08x %08x %08x %08x\n", 148 + pr_info("RootSts: %08x %08x %08x %08x %08x\n", 149 149 data->deviceStatus, data->slotStatus, 150 150 data->linkStatus, data->devCmdStatus, 151 151 data->devSecStatus); 152 152 if (data->rootErrorStatus || data->uncorrErrorStatus || 153 153 data->corrErrorStatus) 154 - pr_info(" RootErrSts: %08x %08x %08x\n", 154 + pr_info("RootErrSts: %08x %08x %08x\n", 155 155 data->rootErrorStatus, data->uncorrErrorStatus, 156 156 data->corrErrorStatus); 157 157 if (data->tlpHdr1 || data->tlpHdr2 || 158 158 data->tlpHdr3 || data->tlpHdr4) 159 - pr_info(" RootErrLog: %08x %08x %08x %08x\n", 159 + pr_info("RootErrLog: %08x %08x %08x %08x\n", 160 160 data->tlpHdr1, data->tlpHdr2, 161 161 data->tlpHdr3, data->tlpHdr4); 162 162 if (data->sourceId || data->errorClass || 163 163 data->correlator) 164 - pr_info(" RootErrLog1: %08x %016llx %016llx\n", 164 + pr_info("RootErrLog1: %08x %016llx %016llx\n", 165 165 data->sourceId, data->errorClass, 166 166 data->correlator); 167 167 if (data->p7iocPlssr || data->p7iocCsr) 168 - pr_info(" PhbSts: %016llx %016llx\n", 168 + pr_info("PhbSts: %016llx %016llx\n", 169 169 data->p7iocPlssr, data->p7iocCsr); 170 - if (data->lemFir || data->lemErrorMask || 171 - data->lemWOF) 172 - pr_info(" Lem: %016llx %016llx %016llx\n", 170 + if (data->lemFir) 171 + pr_info("Lem: %016llx %016llx %016llx\n", 173 172 data->lemFir, data->lemErrorMask, 174 173 data->lemWOF); 175 - if (data->phbErrorStatus || data->phbFirstErrorStatus || 176 - data->phbErrorLog0 || data->phbErrorLog1) 177 - pr_info(" PhbErr: %016llx %016llx %016llx %016llx\n", 174 + if (data->phbErrorStatus) 175 + pr_info("PhbErr: %016llx %016llx %016llx %016llx\n", 178 176 data->phbErrorStatus, data->phbFirstErrorStatus, 179 177 data->phbErrorLog0, data->phbErrorLog1); 180 - if (data->mmioErrorStatus || data->mmioFirstErrorStatus || 181 - data->mmioErrorLog0 || data->mmioErrorLog1) 182 - pr_info(" OutErr: %016llx %016llx %016llx %016llx\n", 178 + if (data->mmioErrorStatus) 179 + pr_info("OutErr: %016llx %016llx %016llx %016llx\n", 183 180 data->mmioErrorStatus, data->mmioFirstErrorStatus, 184 181 data->mmioErrorLog0, data->mmioErrorLog1); 185 - if (data->dma0ErrorStatus || data->dma0FirstErrorStatus || 186 - data->dma0ErrorLog0 || data->dma0ErrorLog1) 187 - pr_info(" InAErr: %016llx %016llx %016llx %016llx\n", 182 + if (data->dma0ErrorStatus) 183 + pr_info("InAErr: %016llx %016llx %016llx %016llx\n", 188 184 data->dma0ErrorStatus, data->dma0FirstErrorStatus, 189 185 data->dma0ErrorLog0, data->dma0ErrorLog1); 190 - if (data->dma1ErrorStatus || data->dma1FirstErrorStatus || 191 - data->dma1ErrorLog0 || data->dma1ErrorLog1) 192 - pr_info(" InBErr: %016llx %016llx %016llx %016llx\n", 186 + if (data->dma1ErrorStatus) 187 + pr_info("InBErr: %016llx %016llx %016llx %016llx\n", 193 188 data->dma1ErrorStatus, data->dma1FirstErrorStatus, 194 189 data->dma1ErrorLog0, data->dma1ErrorLog1); 195 190 ··· 193 198 (data->pestB[i] >> 63) == 0) 194 199 continue; 195 200 196 - pr_info(" PE[%3d] A/B: %016llx %016llx\n", 201 + pr_info("PE[%3d] A/B: %016llx %016llx\n", 197 202 i, data->pestA[i], data->pestB[i]); 198 203 } 199 204 } ··· 205 210 int i; 206 211 207 212 data = (struct OpalIoPhb3ErrorData*)common; 208 - pr_info("PHB3 PHB#%d Diag-data (Version: %d)\n\n", 213 + pr_info("PHB3 PHB#%d Diag-data (Version: %d)\n", 209 214 hose->global_number, common->version); 210 215 if (data->brdgCtl) 211 - pr_info(" brdgCtl: %08x\n", 216 + pr_info("brdgCtl: %08x\n", 212 217 data->brdgCtl); 213 218 if (data->portStatusReg || data->rootCmplxStatus || 214 219 data->busAgentStatus) 215 - pr_info(" UtlSts: %08x %08x %08x\n", 220 + pr_info("UtlSts: %08x %08x %08x\n", 216 221 data->portStatusReg, data->rootCmplxStatus, 217 222 data->busAgentStatus); 218 223 if (data->deviceStatus || data->slotStatus || 219 224 data->linkStatus || data->devCmdStatus || 220 225 data->devSecStatus) 221 - pr_info(" RootSts: %08x %08x %08x %08x %08x\n", 226 + pr_info("RootSts: %08x %08x %08x %08x %08x\n", 222 227 data->deviceStatus, data->slotStatus, 223 228 data->linkStatus, data->devCmdStatus, 224 229 data->devSecStatus); 225 230 if (data->rootErrorStatus || data->uncorrErrorStatus || 226 231 data->corrErrorStatus) 227 - pr_info(" RootErrSts: %08x %08x %08x\n", 232 + pr_info("RootErrSts: %08x %08x %08x\n", 228 233 data->rootErrorStatus, data->uncorrErrorStatus, 229 234 data->corrErrorStatus); 230 235 if (data->tlpHdr1 || data->tlpHdr2 || 231 236 data->tlpHdr3 || data->tlpHdr4) 232 - pr_info(" RootErrLog: %08x %08x %08x %08x\n", 237 + pr_info("RootErrLog: %08x %08x %08x %08x\n", 233 238 data->tlpHdr1, data->tlpHdr2, 234 239 data->tlpHdr3, data->tlpHdr4); 235 240 if (data->sourceId || data->errorClass || 236 241 data->correlator) 237 - pr_info(" RootErrLog1: %08x %016llx %016llx\n", 242 + pr_info("RootErrLog1: %08x %016llx %016llx\n", 238 243 data->sourceId, data->errorClass, 239 244 data->correlator); 240 - if (data->nFir || data->nFirMask || 241 - data->nFirWOF) 242 - pr_info(" nFir: %016llx %016llx %016llx\n", 245 + if (data->nFir) 246 + pr_info("nFir: %016llx %016llx %016llx\n", 243 247 data->nFir, data->nFirMask, 244 248 data->nFirWOF); 245 249 if (data->phbPlssr || data->phbCsr) 246 - pr_info(" PhbSts: %016llx %016llx\n", 250 + pr_info("PhbSts: %016llx %016llx\n", 247 251 data->phbPlssr, data->phbCsr); 248 - if (data->lemFir || data->lemErrorMask || 249 - data->lemWOF) 250 - pr_info(" Lem: %016llx %016llx %016llx\n", 252 + if (data->lemFir) 253 + pr_info("Lem: %016llx %016llx %016llx\n", 251 254 data->lemFir, data->lemErrorMask, 252 255 data->lemWOF); 253 - if (data->phbErrorStatus || data->phbFirstErrorStatus || 254 - data->phbErrorLog0 || data->phbErrorLog1) 255 - pr_info(" PhbErr: %016llx %016llx %016llx %016llx\n", 256 + if (data->phbErrorStatus) 257 + pr_info("PhbErr: %016llx %016llx %016llx %016llx\n", 256 258 data->phbErrorStatus, data->phbFirstErrorStatus, 257 259 data->phbErrorLog0, data->phbErrorLog1); 258 - if (data->mmioErrorStatus || data->mmioFirstErrorStatus || 259 - data->mmioErrorLog0 || data->mmioErrorLog1) 260 - pr_info(" OutErr: %016llx %016llx %016llx %016llx\n", 260 + if (data->mmioErrorStatus) 261 + pr_info("OutErr: %016llx %016llx %016llx %016llx\n", 261 262 data->mmioErrorStatus, data->mmioFirstErrorStatus, 262 263 data->mmioErrorLog0, data->mmioErrorLog1); 263 - if (data->dma0ErrorStatus || data->dma0FirstErrorStatus || 264 - data->dma0ErrorLog0 || data->dma0ErrorLog1) 265 - pr_info(" InAErr: %016llx %016llx %016llx %016llx\n", 264 + if (data->dma0ErrorStatus) 265 + pr_info("InAErr: %016llx %016llx %016llx %016llx\n", 266 266 data->dma0ErrorStatus, data->dma0FirstErrorStatus, 267 267 data->dma0ErrorLog0, data->dma0ErrorLog1); 268 - if (data->dma1ErrorStatus || data->dma1FirstErrorStatus || 269 - data->dma1ErrorLog0 || data->dma1ErrorLog1) 270 - pr_info(" InBErr: %016llx %016llx %016llx %016llx\n", 268 + if (data->dma1ErrorStatus) 269 + pr_info("InBErr: %016llx %016llx %016llx %016llx\n", 271 270 data->dma1ErrorStatus, data->dma1FirstErrorStatus, 272 271 data->dma1ErrorLog0, data->dma1ErrorLog1); 273 272 ··· 270 281 (data->pestB[i] >> 63) == 0) 271 282 continue; 272 283 273 - pr_info(" PE[%3d] A/B: %016llx %016llx\n", 284 + pr_info("PE[%3d] A/B: %016llx %016llx\n", 274 285 i, data->pestA[i], data->pestB[i]); 275 286 } 276 287 } ··· 373 384 struct pci_dn *pdn = PCI_DN(dn); 374 385 struct pnv_phb *phb = pdn->phb->private_data; 375 386 u32 bdfn = (pdn->busno << 8) | pdn->devfn; 376 - #ifdef CONFIG_EEH 377 - struct eeh_pe *phb_pe = NULL; 378 - #endif 379 387 s64 rc; 380 388 381 389 switch (size) { ··· 398 412 default: 399 413 return PCIBIOS_FUNC_NOT_SUPPORTED; 400 414 } 415 + 401 416 cfg_dbg("%s: bus: %x devfn: %x +%x/%x -> %08x\n", 402 417 __func__, pdn->busno, pdn->devfn, where, size, *val); 403 - 404 - /* 405 - * Check if the specified PE has been put into frozen 406 - * state. On the other hand, we needn't do that while 407 - * the PHB has been put into frozen state because of 408 - * PHB-fatal errors. 409 - */ 410 - #ifdef CONFIG_EEH 411 - phb_pe = eeh_phb_pe_get(pdn->phb); 412 - if (phb_pe && (phb_pe->state & EEH_PE_ISOLATED)) 413 - return PCIBIOS_SUCCESSFUL; 414 - 415 - if (phb->eeh_state & PNV_EEH_STATE_ENABLED) { 416 - if (*val == EEH_IO_ERROR_VALUE(size) && 417 - eeh_dev_check_failure(of_node_to_eeh_dev(dn))) 418 - return PCIBIOS_DEVICE_NOT_FOUND; 419 - } else { 420 - pnv_pci_config_check_eeh(phb, dn); 421 - } 422 - #else 423 - pnv_pci_config_check_eeh(phb, dn); 424 - #endif 425 - 426 418 return PCIBIOS_SUCCESSFUL; 427 419 } 428 420 ··· 427 463 return PCIBIOS_FUNC_NOT_SUPPORTED; 428 464 } 429 465 430 - /* Check if the PHB got frozen due to an error (no response) */ 431 - #ifdef CONFIG_EEH 432 - if (!(phb->eeh_state & PNV_EEH_STATE_ENABLED)) 433 - pnv_pci_config_check_eeh(phb, dn); 434 - #else 435 - pnv_pci_config_check_eeh(phb, dn); 436 - #endif 437 - 438 466 return PCIBIOS_SUCCESSFUL; 439 467 } 468 + 469 + #if CONFIG_EEH 470 + static bool pnv_pci_cfg_check(struct pci_controller *hose, 471 + struct device_node *dn) 472 + { 473 + struct eeh_dev *edev = NULL; 474 + struct pnv_phb *phb = hose->private_data; 475 + 476 + /* EEH not enabled ? */ 477 + if (!(phb->flags & PNV_PHB_FLAG_EEH)) 478 + return true; 479 + 480 + /* PE reset or device removed ? */ 481 + edev = of_node_to_eeh_dev(dn); 482 + if (edev) { 483 + if (edev->pe && 484 + (edev->pe->state & EEH_PE_RESET)) 485 + return false; 486 + 487 + if (edev->mode & EEH_DEV_REMOVED) 488 + return false; 489 + } 490 + 491 + return true; 492 + } 493 + #else 494 + static inline pnv_pci_cfg_check(struct pci_controller *hose, 495 + struct device_node *dn) 496 + { 497 + return true; 498 + } 499 + #endif /* CONFIG_EEH */ 440 500 441 501 static int pnv_pci_read_config(struct pci_bus *bus, 442 502 unsigned int devfn, ··· 468 480 { 469 481 struct device_node *dn, *busdn = pci_bus_to_OF_node(bus); 470 482 struct pci_dn *pdn; 471 - 472 - for (dn = busdn->child; dn; dn = dn->sibling) { 473 - pdn = PCI_DN(dn); 474 - if (pdn && pdn->devfn == devfn) 475 - return pnv_pci_cfg_read(dn, where, size, val); 476 - } 483 + struct pnv_phb *phb; 484 + bool found = false; 485 + int ret; 477 486 478 487 *val = 0xFFFFFFFF; 479 - return PCIBIOS_DEVICE_NOT_FOUND; 488 + for (dn = busdn->child; dn; dn = dn->sibling) { 489 + pdn = PCI_DN(dn); 490 + if (pdn && pdn->devfn == devfn) { 491 + phb = pdn->phb->private_data; 492 + found = true; 493 + break; 494 + } 495 + } 480 496 497 + if (!found || !pnv_pci_cfg_check(pdn->phb, dn)) 498 + return PCIBIOS_DEVICE_NOT_FOUND; 499 + 500 + ret = pnv_pci_cfg_read(dn, where, size, val); 501 + if (phb->flags & PNV_PHB_FLAG_EEH) { 502 + if (*val == EEH_IO_ERROR_VALUE(size) && 503 + eeh_dev_check_failure(of_node_to_eeh_dev(dn))) 504 + return PCIBIOS_DEVICE_NOT_FOUND; 505 + } else { 506 + pnv_pci_config_check_eeh(phb, dn); 507 + } 508 + 509 + return ret; 481 510 } 482 511 483 512 static int pnv_pci_write_config(struct pci_bus *bus, ··· 503 498 { 504 499 struct device_node *dn, *busdn = pci_bus_to_OF_node(bus); 505 500 struct pci_dn *pdn; 501 + struct pnv_phb *phb; 502 + bool found = false; 503 + int ret; 506 504 507 505 for (dn = busdn->child; dn; dn = dn->sibling) { 508 506 pdn = PCI_DN(dn); 509 - if (pdn && pdn->devfn == devfn) 510 - return pnv_pci_cfg_write(dn, where, size, val); 507 + if (pdn && pdn->devfn == devfn) { 508 + phb = pdn->phb->private_data; 509 + found = true; 510 + break; 511 + } 511 512 } 512 513 513 - return PCIBIOS_DEVICE_NOT_FOUND; 514 + if (!found || !pnv_pci_cfg_check(pdn->phb, dn)) 515 + return PCIBIOS_DEVICE_NOT_FOUND; 516 + 517 + ret = pnv_pci_cfg_write(dn, where, size, val); 518 + if (!(phb->flags & PNV_PHB_FLAG_EEH)) 519 + pnv_pci_config_check_eeh(phb, dn); 520 + 521 + return ret; 514 522 } 515 523 516 524 struct pci_ops pnv_pci_ops = {
+6 -5
arch/powerpc/platforms/powernv/pci.h
··· 81 81 int (*configure_bridge)(struct eeh_pe *pe); 82 82 int (*next_error)(struct eeh_pe **pe); 83 83 }; 84 - 85 - #define PNV_EEH_STATE_ENABLED (1 << 0) /* EEH enabled */ 86 - #define PNV_EEH_STATE_REMOVED (1 << 1) /* PHB removed */ 87 - 88 84 #endif /* CONFIG_EEH */ 85 + 86 + #define PNV_PHB_FLAG_EEH (1 << 0) 89 87 90 88 struct pnv_phb { 91 89 struct pci_controller *hose; ··· 91 93 enum pnv_phb_model model; 92 94 u64 hub_id; 93 95 u64 opal_id; 96 + int flags; 94 97 void __iomem *regs; 95 98 int initialized; 96 99 spinlock_t lock; 97 100 98 101 #ifdef CONFIG_EEH 99 102 struct pnv_eeh_ops *eeh_ops; 100 - int eeh_state; 101 103 #endif 102 104 103 105 #ifdef CONFIG_DEBUG_FS 106 + int has_dbgfs; 104 107 struct dentry *dbgfs; 105 108 #endif 106 109 ··· 204 205 extern void pnv_pci_init_ioda2_phb(struct device_node *np); 205 206 extern void pnv_pci_ioda_tce_invalidate(struct iommu_table *tbl, 206 207 __be64 *startp, __be64 *endp, bool rm); 208 + extern void pnv_pci_reset_secondary_bus(struct pci_dev *dev); 209 + extern int ioda_eeh_phb_reset(struct pci_controller *hose, int option); 207 210 208 211 #endif /* __POWERNV_PCI_H */
+2
arch/powerpc/platforms/powernv/powernv.h
··· 25 25 26 26 extern void pnv_lpc_init(void); 27 27 28 + bool cpu_core_split_required(void); 29 + 28 30 #endif /* _POWERNV_H */
+54 -2
arch/powerpc/platforms/powernv/setup.c
··· 27 27 #include <linux/interrupt.h> 28 28 #include <linux/bug.h> 29 29 #include <linux/pci.h> 30 + #include <linux/cpufreq.h> 30 31 31 32 #include <asm/machdep.h> 32 33 #include <asm/firmware.h> ··· 99 98 of_node_put(root); 100 99 } 101 100 101 + static void pnv_prepare_going_down(void) 102 + { 103 + /* 104 + * Disable all notifiers from OPAL, we can't 105 + * service interrupts anymore anyway 106 + */ 107 + opal_notifier_disable(); 108 + 109 + /* Soft disable interrupts */ 110 + local_irq_disable(); 111 + 112 + /* 113 + * Return secondary CPUs to firwmare if a flash update 114 + * is pending otherwise we will get all sort of error 115 + * messages about CPU being stuck etc.. This will also 116 + * have the side effect of hard disabling interrupts so 117 + * past this point, the kernel is effectively dead. 118 + */ 119 + opal_flash_term_callback(); 120 + } 121 + 102 122 static void __noreturn pnv_restart(char *cmd) 103 123 { 104 124 long rc = OPAL_BUSY; 105 125 106 - opal_notifier_disable(); 126 + pnv_prepare_going_down(); 107 127 108 128 while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) { 109 129 rc = opal_cec_reboot(); ··· 141 119 { 142 120 long rc = OPAL_BUSY; 143 121 144 - opal_notifier_disable(); 122 + pnv_prepare_going_down(); 145 123 146 124 while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) { 147 125 rc = opal_cec_power_down(0); ··· 244 222 } 245 223 #endif /* CONFIG_KEXEC */ 246 224 225 + #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE 226 + static unsigned long pnv_memory_block_size(void) 227 + { 228 + return 256UL * 1024 * 1024; 229 + } 230 + #endif 231 + 247 232 static void __init pnv_setup_machdep_opal(void) 248 233 { 249 234 ppc_md.get_boot_time = opal_get_boot_time; ··· 298 269 return 1; 299 270 } 300 271 272 + /* 273 + * Returns the cpu frequency for 'cpu' in Hz. This is used by 274 + * /proc/cpuinfo 275 + */ 276 + unsigned long pnv_get_proc_freq(unsigned int cpu) 277 + { 278 + unsigned long ret_freq; 279 + 280 + ret_freq = cpufreq_quick_get(cpu) * 1000ul; 281 + 282 + /* 283 + * If the backend cpufreq driver does not exist, 284 + * then fallback to old way of reporting the clockrate. 285 + */ 286 + if (!ret_freq) 287 + ret_freq = ppc_proc_freq; 288 + return ret_freq; 289 + } 290 + 301 291 define_machine(powernv) { 302 292 .name = "PowerNV", 303 293 .probe = pnv_probe, ··· 324 276 .setup_arch = pnv_setup_arch, 325 277 .init_IRQ = pnv_init_IRQ, 326 278 .show_cpuinfo = pnv_show_cpuinfo, 279 + .get_proc_freq = pnv_get_proc_freq, 327 280 .progress = pnv_progress, 328 281 .machine_shutdown = pnv_shutdown, 329 282 .power_save = power7_idle, ··· 332 283 .dma_set_mask = pnv_dma_set_mask, 333 284 #ifdef CONFIG_KEXEC 334 285 .kexec_cpu_down = pnv_kexec_cpu_down, 286 + #endif 287 + #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE 288 + .memory_block_size = pnv_memory_block_size, 335 289 #endif 336 290 };
+14 -11
arch/powerpc/platforms/powernv/smp.c
··· 31 31 #include <asm/xics.h> 32 32 #include <asm/opal.h> 33 33 #include <asm/runlatch.h> 34 + #include <asm/code-patching.h> 34 35 35 36 #include "powernv.h" 36 37 ··· 51 50 int pnv_smp_kick_cpu(int nr) 52 51 { 53 52 unsigned int pcpu = get_hard_smp_processor_id(nr); 54 - unsigned long start_here = __pa(*((unsigned long *) 55 - generic_secondary_smp_init)); 53 + unsigned long start_here = 54 + __pa(ppc_function_entry(generic_secondary_smp_init)); 56 55 long rc; 57 56 58 57 BUG_ON(nr < 0 || nr >= NR_CPUS); ··· 159 158 mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1); 160 159 while (!generic_check_cpu_restart(cpu)) { 161 160 ppc64_runlatch_off(); 162 - power7_nap(); 161 + power7_nap(1); 163 162 ppc64_runlatch_on(); 164 - if (!generic_check_cpu_restart(cpu)) { 163 + 164 + /* Reenable IRQs briefly to clear the IPI that woke us */ 165 + local_irq_enable(); 166 + local_irq_disable(); 167 + mb(); 168 + 169 + if (cpu_core_split_required()) 170 + continue; 171 + 172 + if (!generic_check_cpu_restart(cpu)) 165 173 DBG("CPU%d Unexpected exit while offline !\n", cpu); 166 - /* We may be getting an IPI, so we re-enable 167 - * interrupts to process it, it will be ignored 168 - * since we aren't online (hopefully) 169 - */ 170 - local_irq_enable(); 171 - local_irq_disable(); 172 - } 173 174 } 174 175 mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) | LPCR_PECE1); 175 176 DBG("CPU%d coming online...\n", cpu);
+95
arch/powerpc/platforms/powernv/subcore-asm.S
··· 1 + /* 2 + * Copyright 2013, Michael (Ellerman|Neuling), IBM Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or 5 + * modify it under the terms of the GNU General Public License 6 + * as published by the Free Software Foundation; either version 7 + * 2 of the License, or (at your option) any later version. 8 + */ 9 + 10 + #include <asm/asm-offsets.h> 11 + #include <asm/ppc_asm.h> 12 + #include <asm/reg.h> 13 + 14 + #include "subcore.h" 15 + 16 + 17 + _GLOBAL(split_core_secondary_loop) 18 + /* 19 + * r3 = u8 *state, used throughout the routine 20 + * r4 = temp 21 + * r5 = temp 22 + * .. 23 + * r12 = MSR 24 + */ 25 + mfmsr r12 26 + 27 + /* Disable interrupts so SRR0/1 don't get trashed */ 28 + li r4,0 29 + ori r4,r4,MSR_EE|MSR_SE|MSR_BE|MSR_RI 30 + andc r4,r12,r4 31 + sync 32 + mtmsrd r4 33 + 34 + /* Switch to real mode and leave interrupts off */ 35 + li r5, MSR_IR|MSR_DR 36 + andc r5, r4, r5 37 + 38 + LOAD_REG_ADDR(r4, real_mode) 39 + 40 + mtspr SPRN_SRR0,r4 41 + mtspr SPRN_SRR1,r5 42 + rfid 43 + b . /* prevent speculative execution */ 44 + 45 + real_mode: 46 + /* Grab values from unsplit SPRs */ 47 + mfspr r6, SPRN_LDBAR 48 + mfspr r7, SPRN_PMMAR 49 + mfspr r8, SPRN_PMCR 50 + mfspr r9, SPRN_RPR 51 + mfspr r10, SPRN_SDR1 52 + 53 + /* Order reading the SPRs vs telling the primary we are ready to split */ 54 + sync 55 + 56 + /* Tell thread 0 we are in real mode */ 57 + li r4, SYNC_STEP_REAL_MODE 58 + stb r4, 0(r3) 59 + 60 + li r5, (HID0_POWER8_4LPARMODE | HID0_POWER8_2LPARMODE)@highest 61 + sldi r5, r5, 48 62 + 63 + /* Loop until we see the split happen in HID0 */ 64 + 1: mfspr r4, SPRN_HID0 65 + and. r4, r4, r5 66 + beq 1b 67 + 68 + /* 69 + * We only need to initialise the below regs once for each subcore, 70 + * but it's simpler and harmless to do it on each thread. 71 + */ 72 + 73 + /* Make sure various SPRS have sane values */ 74 + li r4, 0 75 + mtspr SPRN_LPID, r4 76 + mtspr SPRN_PCR, r4 77 + mtspr SPRN_HDEC, r4 78 + 79 + /* Restore SPR values now we are split */ 80 + mtspr SPRN_LDBAR, r6 81 + mtspr SPRN_PMMAR, r7 82 + mtspr SPRN_PMCR, r8 83 + mtspr SPRN_RPR, r9 84 + mtspr SPRN_SDR1, r10 85 + 86 + LOAD_REG_ADDR(r5, virtual_mode) 87 + 88 + /* Get out of real mode */ 89 + mtspr SPRN_SRR0,r5 90 + mtspr SPRN_SRR1,r12 91 + rfid 92 + b . /* prevent speculative execution */ 93 + 94 + virtual_mode: 95 + blr
+392
arch/powerpc/platforms/powernv/subcore.c
··· 1 + /* 2 + * Copyright 2013, Michael (Ellerman|Neuling), IBM Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or 5 + * modify it under the terms of the GNU General Public License 6 + * as published by the Free Software Foundation; either version 7 + * 2 of the License, or (at your option) any later version. 8 + */ 9 + 10 + #define pr_fmt(fmt) "powernv: " fmt 11 + 12 + #include <linux/kernel.h> 13 + #include <linux/cpu.h> 14 + #include <linux/cpumask.h> 15 + #include <linux/device.h> 16 + #include <linux/gfp.h> 17 + #include <linux/smp.h> 18 + #include <linux/stop_machine.h> 19 + 20 + #include <asm/cputhreads.h> 21 + #include <asm/kvm_ppc.h> 22 + #include <asm/machdep.h> 23 + #include <asm/opal.h> 24 + #include <asm/smp.h> 25 + 26 + #include "subcore.h" 27 + 28 + 29 + /* 30 + * Split/unsplit procedure: 31 + * 32 + * A core can be in one of three states, unsplit, 2-way split, and 4-way split. 33 + * 34 + * The mapping to subcores_per_core is simple: 35 + * 36 + * State | subcores_per_core 37 + * ------------|------------------ 38 + * Unsplit | 1 39 + * 2-way split | 2 40 + * 4-way split | 4 41 + * 42 + * The core is split along thread boundaries, the mapping between subcores and 43 + * threads is as follows: 44 + * 45 + * Unsplit: 46 + * ---------------------------- 47 + * Subcore | 0 | 48 + * ---------------------------- 49 + * Thread | 0 1 2 3 4 5 6 7 | 50 + * ---------------------------- 51 + * 52 + * 2-way split: 53 + * ------------------------------------- 54 + * Subcore | 0 | 1 | 55 + * ------------------------------------- 56 + * Thread | 0 1 2 3 | 4 5 6 7 | 57 + * ------------------------------------- 58 + * 59 + * 4-way split: 60 + * ----------------------------------------- 61 + * Subcore | 0 | 1 | 2 | 3 | 62 + * ----------------------------------------- 63 + * Thread | 0 1 | 2 3 | 4 5 | 6 7 | 64 + * ----------------------------------------- 65 + * 66 + * 67 + * Transitions 68 + * ----------- 69 + * 70 + * It is not possible to transition between either of the split states, the 71 + * core must first be unsplit. The legal transitions are: 72 + * 73 + * ----------- --------------- 74 + * | | <----> | 2-way split | 75 + * | | --------------- 76 + * | Unsplit | 77 + * | | --------------- 78 + * | | <----> | 4-way split | 79 + * ----------- --------------- 80 + * 81 + * Unsplitting 82 + * ----------- 83 + * 84 + * Unsplitting is the simpler procedure. It requires thread 0 to request the 85 + * unsplit while all other threads NAP. 86 + * 87 + * Thread 0 clears HID0_POWER8_DYNLPARDIS (Dynamic LPAR Disable). This tells 88 + * the hardware that if all threads except 0 are napping, the hardware should 89 + * unsplit the core. 90 + * 91 + * Non-zero threads are sent to a NAP loop, they don't exit the loop until they 92 + * see the core unsplit. 93 + * 94 + * Core 0 spins waiting for the hardware to see all the other threads napping 95 + * and perform the unsplit. 96 + * 97 + * Once thread 0 sees the unsplit, it IPIs the secondary threads to wake them 98 + * out of NAP. They will then see the core unsplit and exit the NAP loop. 99 + * 100 + * Splitting 101 + * --------- 102 + * 103 + * The basic splitting procedure is fairly straight forward. However it is 104 + * complicated by the fact that after the split occurs, the newly created 105 + * subcores are not in a fully initialised state. 106 + * 107 + * Most notably the subcores do not have the correct value for SDR1, which 108 + * means they must not be running in virtual mode when the split occurs. The 109 + * subcores have separate timebases SPRs but these are pre-synchronised by 110 + * opal. 111 + * 112 + * To begin with secondary threads are sent to an assembly routine. There they 113 + * switch to real mode, so they are immune to the uninitialised SDR1 value. 114 + * Once in real mode they indicate that they are in real mode, and spin waiting 115 + * to see the core split. 116 + * 117 + * Thread 0 waits to see that all secondaries are in real mode, and then begins 118 + * the splitting procedure. It firstly sets HID0_POWER8_DYNLPARDIS, which 119 + * prevents the hardware from unsplitting. Then it sets the appropriate HID bit 120 + * to request the split, and spins waiting to see that the split has happened. 121 + * 122 + * Concurrently the secondaries will notice the split. When they do they set up 123 + * their SPRs, notably SDR1, and then they can return to virtual mode and exit 124 + * the procedure. 125 + */ 126 + 127 + /* Initialised at boot by subcore_init() */ 128 + static int subcores_per_core; 129 + 130 + /* 131 + * Used to communicate to offline cpus that we want them to pop out of the 132 + * offline loop and do a split or unsplit. 133 + * 134 + * 0 - no split happening 135 + * 1 - unsplit in progress 136 + * 2 - split to 2 in progress 137 + * 4 - split to 4 in progress 138 + */ 139 + static int new_split_mode; 140 + 141 + static cpumask_var_t cpu_offline_mask; 142 + 143 + struct split_state { 144 + u8 step; 145 + u8 master; 146 + }; 147 + 148 + static DEFINE_PER_CPU(struct split_state, split_state); 149 + 150 + static void wait_for_sync_step(int step) 151 + { 152 + int i, cpu = smp_processor_id(); 153 + 154 + for (i = cpu + 1; i < cpu + threads_per_core; i++) 155 + while(per_cpu(split_state, i).step < step) 156 + barrier(); 157 + 158 + /* Order the wait loop vs any subsequent loads/stores. */ 159 + mb(); 160 + } 161 + 162 + static void unsplit_core(void) 163 + { 164 + u64 hid0, mask; 165 + int i, cpu; 166 + 167 + mask = HID0_POWER8_2LPARMODE | HID0_POWER8_4LPARMODE; 168 + 169 + cpu = smp_processor_id(); 170 + if (cpu_thread_in_core(cpu) != 0) { 171 + while (mfspr(SPRN_HID0) & mask) 172 + power7_nap(0); 173 + 174 + per_cpu(split_state, cpu).step = SYNC_STEP_UNSPLIT; 175 + return; 176 + } 177 + 178 + hid0 = mfspr(SPRN_HID0); 179 + hid0 &= ~HID0_POWER8_DYNLPARDIS; 180 + mtspr(SPRN_HID0, hid0); 181 + 182 + while (mfspr(SPRN_HID0) & mask) 183 + cpu_relax(); 184 + 185 + /* Wake secondaries out of NAP */ 186 + for (i = cpu + 1; i < cpu + threads_per_core; i++) 187 + smp_send_reschedule(i); 188 + 189 + wait_for_sync_step(SYNC_STEP_UNSPLIT); 190 + } 191 + 192 + static void split_core(int new_mode) 193 + { 194 + struct { u64 value; u64 mask; } split_parms[2] = { 195 + { HID0_POWER8_1TO2LPAR, HID0_POWER8_2LPARMODE }, 196 + { HID0_POWER8_1TO4LPAR, HID0_POWER8_4LPARMODE } 197 + }; 198 + int i, cpu; 199 + u64 hid0; 200 + 201 + /* Convert new_mode (2 or 4) into an index into our parms array */ 202 + i = (new_mode >> 1) - 1; 203 + BUG_ON(i < 0 || i > 1); 204 + 205 + cpu = smp_processor_id(); 206 + if (cpu_thread_in_core(cpu) != 0) { 207 + split_core_secondary_loop(&per_cpu(split_state, cpu).step); 208 + return; 209 + } 210 + 211 + wait_for_sync_step(SYNC_STEP_REAL_MODE); 212 + 213 + /* Write new mode */ 214 + hid0 = mfspr(SPRN_HID0); 215 + hid0 |= HID0_POWER8_DYNLPARDIS | split_parms[i].value; 216 + mtspr(SPRN_HID0, hid0); 217 + 218 + /* Wait for it to happen */ 219 + while (!(mfspr(SPRN_HID0) & split_parms[i].mask)) 220 + cpu_relax(); 221 + } 222 + 223 + static void cpu_do_split(int new_mode) 224 + { 225 + /* 226 + * At boot subcores_per_core will be 0, so we will always unsplit at 227 + * boot. In the usual case where the core is already unsplit it's a 228 + * nop, and this just ensures the kernel's notion of the mode is 229 + * consistent with the hardware. 230 + */ 231 + if (subcores_per_core != 1) 232 + unsplit_core(); 233 + 234 + if (new_mode != 1) 235 + split_core(new_mode); 236 + 237 + mb(); 238 + per_cpu(split_state, smp_processor_id()).step = SYNC_STEP_FINISHED; 239 + } 240 + 241 + bool cpu_core_split_required(void) 242 + { 243 + smp_rmb(); 244 + 245 + if (!new_split_mode) 246 + return false; 247 + 248 + cpu_do_split(new_split_mode); 249 + 250 + return true; 251 + } 252 + 253 + static int cpu_update_split_mode(void *data) 254 + { 255 + int cpu, new_mode = *(int *)data; 256 + 257 + if (this_cpu_ptr(&split_state)->master) { 258 + new_split_mode = new_mode; 259 + smp_wmb(); 260 + 261 + cpumask_andnot(cpu_offline_mask, cpu_present_mask, 262 + cpu_online_mask); 263 + 264 + /* This should work even though the cpu is offline */ 265 + for_each_cpu(cpu, cpu_offline_mask) 266 + smp_send_reschedule(cpu); 267 + } 268 + 269 + cpu_do_split(new_mode); 270 + 271 + if (this_cpu_ptr(&split_state)->master) { 272 + /* Wait for all cpus to finish before we touch subcores_per_core */ 273 + for_each_present_cpu(cpu) { 274 + if (cpu >= setup_max_cpus) 275 + break; 276 + 277 + while(per_cpu(split_state, cpu).step < SYNC_STEP_FINISHED) 278 + barrier(); 279 + } 280 + 281 + new_split_mode = 0; 282 + 283 + /* Make the new mode public */ 284 + subcores_per_core = new_mode; 285 + threads_per_subcore = threads_per_core / subcores_per_core; 286 + 287 + /* Make sure the new mode is written before we exit */ 288 + mb(); 289 + } 290 + 291 + return 0; 292 + } 293 + 294 + static int set_subcores_per_core(int new_mode) 295 + { 296 + struct split_state *state; 297 + int cpu; 298 + 299 + if (kvm_hv_mode_active()) { 300 + pr_err("Unable to change split core mode while KVM active.\n"); 301 + return -EBUSY; 302 + } 303 + 304 + /* 305 + * We are only called at boot, or from the sysfs write. If that ever 306 + * changes we'll need a lock here. 307 + */ 308 + BUG_ON(new_mode < 1 || new_mode > 4 || new_mode == 3); 309 + 310 + for_each_present_cpu(cpu) { 311 + state = &per_cpu(split_state, cpu); 312 + state->step = SYNC_STEP_INITIAL; 313 + state->master = 0; 314 + } 315 + 316 + get_online_cpus(); 317 + 318 + /* This cpu will update the globals before exiting stop machine */ 319 + this_cpu_ptr(&split_state)->master = 1; 320 + 321 + /* Ensure state is consistent before we call the other cpus */ 322 + mb(); 323 + 324 + stop_machine(cpu_update_split_mode, &new_mode, cpu_online_mask); 325 + 326 + put_online_cpus(); 327 + 328 + return 0; 329 + } 330 + 331 + static ssize_t __used store_subcores_per_core(struct device *dev, 332 + struct device_attribute *attr, const char *buf, 333 + size_t count) 334 + { 335 + unsigned long val; 336 + int rc; 337 + 338 + /* We are serialised by the attribute lock */ 339 + 340 + rc = sscanf(buf, "%lx", &val); 341 + if (rc != 1) 342 + return -EINVAL; 343 + 344 + switch (val) { 345 + case 1: 346 + case 2: 347 + case 4: 348 + if (subcores_per_core == val) 349 + /* Nothing to do */ 350 + goto out; 351 + break; 352 + default: 353 + return -EINVAL; 354 + } 355 + 356 + rc = set_subcores_per_core(val); 357 + if (rc) 358 + return rc; 359 + 360 + out: 361 + return count; 362 + } 363 + 364 + static ssize_t show_subcores_per_core(struct device *dev, 365 + struct device_attribute *attr, char *buf) 366 + { 367 + return sprintf(buf, "%x\n", subcores_per_core); 368 + } 369 + 370 + static DEVICE_ATTR(subcores_per_core, 0644, 371 + show_subcores_per_core, store_subcores_per_core); 372 + 373 + static int subcore_init(void) 374 + { 375 + if (!cpu_has_feature(CPU_FTR_ARCH_207S)) 376 + return 0; 377 + 378 + /* 379 + * We need all threads in a core to be present to split/unsplit so 380 + * continue only if max_cpus are aligned to threads_per_core. 381 + */ 382 + if (setup_max_cpus % threads_per_core) 383 + return 0; 384 + 385 + BUG_ON(!alloc_cpumask_var(&cpu_offline_mask, GFP_KERNEL)); 386 + 387 + set_subcores_per_core(1); 388 + 389 + return device_create_file(cpu_subsys.dev_root, 390 + &dev_attr_subcores_per_core); 391 + } 392 + machine_device_initcall(powernv, subcore_init);
+18
arch/powerpc/platforms/powernv/subcore.h
··· 1 + /* 2 + * Copyright 2013, Michael Ellerman, IBM Corporation. 3 + * 4 + * This program is free software; you can redistribute it and/or 5 + * modify it under the terms of the GNU General Public License 6 + * as published by the Free Software Foundation; either version 7 + * 2 of the License, or (at your option) any later version. 8 + */ 9 + 10 + /* These are ordered and tested with <= */ 11 + #define SYNC_STEP_INITIAL 0 12 + #define SYNC_STEP_UNSPLIT 1 /* Set by secondary when it sees unsplit */ 13 + #define SYNC_STEP_REAL_MODE 2 /* Set by secondary when in real mode */ 14 + #define SYNC_STEP_FINISHED 3 /* Set by secondary when split/unsplit is done */ 15 + 16 + #ifndef __ASSEMBLY__ 17 + void split_core_secondary_loop(u8 *state); 18 + #endif
+42 -1
arch/powerpc/platforms/pseries/eeh_pseries.c
··· 175 175 return 0; 176 176 } 177 177 178 + static int pseries_eeh_find_ecap(struct device_node *dn, int cap) 179 + { 180 + struct pci_dn *pdn = PCI_DN(dn); 181 + struct eeh_dev *edev = of_node_to_eeh_dev(dn); 182 + u32 header; 183 + int pos = 256; 184 + int ttl = (4096 - 256) / 8; 185 + 186 + if (!edev || !edev->pcie_cap) 187 + return 0; 188 + if (rtas_read_config(pdn, pos, 4, &header) != PCIBIOS_SUCCESSFUL) 189 + return 0; 190 + else if (!header) 191 + return 0; 192 + 193 + while (ttl-- > 0) { 194 + if (PCI_EXT_CAP_ID(header) == cap && pos) 195 + return pos; 196 + 197 + pos = PCI_EXT_CAP_NEXT(header); 198 + if (pos < 256) 199 + break; 200 + 201 + if (rtas_read_config(pdn, pos, 4, &header) != PCIBIOS_SUCCESSFUL) 202 + break; 203 + } 204 + 205 + return 0; 206 + } 207 + 178 208 /** 179 209 * pseries_eeh_of_probe - EEH probe on the given device 180 210 * @dn: OF node ··· 250 220 * or PCIe switch downstream port. 251 221 */ 252 222 edev->class_code = class_code; 223 + edev->pcix_cap = pseries_eeh_find_cap(dn, PCI_CAP_ID_PCIX); 253 224 edev->pcie_cap = pseries_eeh_find_cap(dn, PCI_CAP_ID_EXP); 225 + edev->aer_cap = pseries_eeh_find_ecap(dn, PCI_EXT_CAP_ID_ERR); 254 226 edev->mode &= 0xFFFFFF00; 255 227 if ((edev->class_code >> 8) == PCI_CLASS_BRIDGE_PCI) { 256 228 edev->mode |= EEH_DEV_BRIDGE; ··· 496 464 } else { 497 465 result = EEH_STATE_NOT_SUPPORT; 498 466 } 467 + break; 499 468 default: 500 469 result = EEH_STATE_NOT_SUPPORT; 501 470 } ··· 532 499 /* If fundamental-reset not supported, try hot-reset */ 533 500 if (option == EEH_RESET_FUNDAMENTAL && 534 501 ret == -8) { 502 + option = EEH_RESET_HOT; 535 503 ret = rtas_call(ibm_set_slot_reset, 4, 1, NULL, 536 504 config_addr, BUID_HI(pe->phb->buid), 537 - BUID_LO(pe->phb->buid), EEH_RESET_HOT); 505 + BUID_LO(pe->phb->buid), option); 538 506 } 507 + 508 + /* We need reset hold or settlement delay */ 509 + if (option == EEH_RESET_FUNDAMENTAL || 510 + option == EEH_RESET_HOT) 511 + msleep(EEH_PE_RST_HOLD_TIME); 512 + else 513 + msleep(EEH_PE_RST_SETTLE_TIME); 539 514 540 515 return ret; 541 516 }
+3 -14
arch/powerpc/platforms/pseries/hotplug-memory.c
··· 21 21 #include <asm/prom.h> 22 22 #include <asm/sparsemem.h> 23 23 24 - static unsigned long get_memblock_size(void) 24 + unsigned long pseries_memory_block_size(void) 25 25 { 26 26 struct device_node *np; 27 27 unsigned int memblock_size = MIN_MEMORY_BLOCK_SIZE; ··· 64 64 return memblock_size; 65 65 } 66 66 67 - /* WARNING: This is going to override the generic definition whenever 68 - * pseries is built-in regardless of what platform is active at boot 69 - * time. This is fine for now as this is the only "option" and it 70 - * should work everywhere. If not, we'll have to turn this into a 71 - * ppc_md. callback 72 - */ 73 - unsigned long memory_block_size_bytes(void) 74 - { 75 - return get_memblock_size(); 76 - } 77 - 78 67 #ifdef CONFIG_MEMORY_HOTREMOVE 79 68 static int pseries_remove_memory(u64 start, u64 size) 80 69 { ··· 94 105 if (!pfn_valid(start_pfn)) 95 106 goto out; 96 107 97 - block_sz = memory_block_size_bytes(); 108 + block_sz = pseries_memory_block_size(); 98 109 sections_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE; 99 110 nid = memory_add_physaddr_to_nid(base); 100 111 ··· 190 201 u32 *p; 191 202 int i, rc = -EINVAL; 192 203 193 - memblock_size = get_memblock_size(); 204 + memblock_size = pseries_memory_block_size(); 194 205 if (!memblock_size) 195 206 return -EINVAL; 196 207
+5 -5
arch/powerpc/platforms/pseries/hvCall.S
··· 49 49 std r0,16(r1); \ 50 50 addi r4,r1,STK_PARAM(FIRST_REG); \ 51 51 stdu r1,-STACK_FRAME_OVERHEAD(r1); \ 52 - bl .__trace_hcall_entry; \ 52 + bl __trace_hcall_entry; \ 53 53 addi r1,r1,STACK_FRAME_OVERHEAD; \ 54 54 ld r0,16(r1); \ 55 55 ld r3,STK_PARAM(R3)(r1); \ ··· 83 83 mr r3,r6; \ 84 84 std r0,16(r1); \ 85 85 stdu r1,-STACK_FRAME_OVERHEAD(r1); \ 86 - bl .__trace_hcall_exit; \ 86 + bl __trace_hcall_exit; \ 87 87 addi r1,r1,STACK_FRAME_OVERHEAD; \ 88 88 ld r0,16(r1); \ 89 89 ld r3,STK_PARAM(R3)(r1); \ ··· 106 106 107 107 .text 108 108 109 - _GLOBAL(plpar_hcall_norets) 109 + _GLOBAL_TOC(plpar_hcall_norets) 110 110 HMT_MEDIUM 111 111 112 112 mfcr r0 ··· 122 122 mtcrf 0xff,r0 123 123 blr /* return r3 = status */ 124 124 125 - _GLOBAL(plpar_hcall) 125 + _GLOBAL_TOC(plpar_hcall) 126 126 HMT_MEDIUM 127 127 128 128 mfcr r0 ··· 188 188 189 189 blr /* return r3 = status */ 190 190 191 - _GLOBAL(plpar_hcall9) 191 + _GLOBAL_TOC(plpar_hcall9) 192 192 HMT_MEDIUM 193 193 194 194 mfcr r0
+2
arch/powerpc/platforms/pseries/pseries.h
··· 64 64 struct pci_host_bridge; 65 65 int pseries_root_bridge_prepare(struct pci_host_bridge *bridge); 66 66 67 + unsigned long pseries_memory_block_size(void); 68 + 67 69 #endif /* _PSERIES_PSERIES_H */
+7
arch/powerpc/platforms/pseries/setup.c
··· 510 510 static int __init pSeries_init_panel(void) 511 511 { 512 512 /* Manually leave the kernel version on the panel. */ 513 + #ifdef __BIG_ENDIAN__ 513 514 ppc_md.progress("Linux ppc64\n", 0); 515 + #else 516 + ppc_md.progress("Linux ppc64le\n", 0); 517 + #endif 514 518 ppc_md.progress(init_utsname()->version, 0); 515 519 516 520 return 0; ··· 809 805 .machine_check_exception = pSeries_machine_check_exception, 810 806 #ifdef CONFIG_KEXEC 811 807 .machine_kexec = pSeries_machine_kexec, 808 + #endif 809 + #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE 810 + .memory_block_size = pseries_memory_block_size, 812 811 #endif 813 812 };
+3 -2
arch/powerpc/platforms/pseries/smp.c
··· 44 44 #include <asm/xics.h> 45 45 #include <asm/dbell.h> 46 46 #include <asm/plpar_wrappers.h> 47 + #include <asm/code-patching.h> 47 48 48 49 #include "pseries.h" 49 50 #include "offline_states.h" ··· 97 96 static inline int smp_startup_cpu(unsigned int lcpu) 98 97 { 99 98 int status; 100 - unsigned long start_here = __pa((u32)*((unsigned long *) 101 - generic_secondary_smp_init)); 99 + unsigned long start_here = 100 + __pa(ppc_function_entry(generic_secondary_smp_init)); 102 101 unsigned int pcpu; 103 102 int start_cpu; 104 103
+2 -1
arch/powerpc/platforms/wsp/scom_smp.c
··· 20 20 #include <asm/reg_a2.h> 21 21 #include <asm/scom.h> 22 22 #include <asm/udbg.h> 23 + #include <asm/code-patching.h> 23 24 24 25 #include "wsp.h" 25 26 ··· 406 405 goto fail; 407 406 } 408 407 409 - start_here = *(unsigned long *)(core_setup ? generic_secondary_smp_init 408 + start_here = ppc_function_entry(core_setup ? generic_secondary_smp_init 410 409 : generic_secondary_thread_init); 411 410 pr_devel("CPU%d entry point at 0x%lx...\n", lcpu, start_here); 412 411
+6
arch/powerpc/sysdev/Kconfig
··· 7 7 depends on PCI && 4xx 8 8 default n 9 9 10 + config PPC4xx_HSTA_MSI 11 + bool 12 + depends on PCI_MSI 13 + depends on PCI && 4xx 14 + default n 15 + 10 16 config PPC4xx_MSI 11 17 bool 12 18 depends on PCI_MSI
+1
arch/powerpc/sysdev/Makefile
··· 45 45 ifeq ($(CONFIG_PCI),y) 46 46 obj-$(CONFIG_4xx) += ppc4xx_pci.o 47 47 endif 48 + obj-$(CONFIG_PPC4xx_HSTA_MSI) += ppc4xx_hsta_msi.o 48 49 obj-$(CONFIG_PPC4xx_MSI) += ppc4xx_msi.o 49 50 obj-$(CONFIG_PPC4xx_CPM) += ppc4xx_cpm.o 50 51 obj-$(CONFIG_PPC4xx_GPIO) += ppc4xx_gpio.o
+1 -2
arch/powerpc/sysdev/fsl_pci.c
··· 1150 1150 pci = hose->private_data; 1151 1151 1152 1152 /* Enable PTOD, ENL23D & EXL23D */ 1153 - out_be32(&pci->pex_pme_mes_disr, 0); 1154 - setbits32(&pci->pex_pme_mes_disr, 1153 + clrbits32(&pci->pex_pme_mes_disr, 1155 1154 PME_DISR_EN_PTOD | PME_DISR_EN_ENL23D | PME_DISR_EN_EXL23D); 1156 1155 1157 1156 out_be32(&pci->pex_pme_mes_ier, 0);
+9 -1
arch/powerpc/sysdev/fsl_rio.c
··· 391 391 ops->get_inb_message = fsl_get_inb_message; 392 392 393 393 rmu_node = of_parse_phandle(dev->dev.of_node, "fsl,srio-rmu-handle", 0); 394 - if (!rmu_node) 394 + if (!rmu_node) { 395 + dev_err(&dev->dev, "No valid fsl,srio-rmu-handle property\n"); 395 396 goto err_rmu; 397 + } 396 398 rc = of_address_to_resource(rmu_node, 0, &rmu_regs); 397 399 if (rc) { 398 400 dev_err(&dev->dev, "Can't get %s property 'reg'\n", ··· 415 413 /*set up doobell node*/ 416 414 np = of_find_compatible_node(NULL, NULL, "fsl,srio-dbell-unit"); 417 415 if (!np) { 416 + dev_err(&dev->dev, "No fsl,srio-dbell-unit node\n"); 418 417 rc = -ENODEV; 419 418 goto err_dbell; 420 419 } ··· 444 441 /*set up port write node*/ 445 442 np = of_find_compatible_node(NULL, NULL, "fsl,srio-port-write-unit"); 446 443 if (!np) { 444 + dev_err(&dev->dev, "No fsl,srio-port-write-unit node\n"); 447 445 rc = -ENODEV; 448 446 goto err_pw; 449 447 } ··· 637 633 return 0; 638 634 err: 639 635 kfree(pw); 636 + pw = NULL; 640 637 err_pw: 641 638 kfree(dbell); 639 + dbell = NULL; 642 640 err_dbell: 643 641 iounmap(rmu_regs_win); 642 + rmu_regs_win = NULL; 644 643 err_rmu: 645 644 kfree(ops); 646 645 err_ops: 647 646 iounmap(rio_regs_win); 647 + rio_regs_win = NULL; 648 648 err_rio_regs: 649 649 return rc; 650 650 }
+3 -3
arch/powerpc/sysdev/fsl_rmu.c
··· 881 881 rc = request_irq(IRQ_RIO_RX(mport), fsl_rio_rx_handler, 0, 882 882 "msg_rx", (void *)mport); 883 883 if (rc < 0) { 884 - dma_free_coherent(priv->dev, RIO_MSG_BUFFER_SIZE, 885 - rmu->msg_tx_ring.virt_buffer[i], 886 - rmu->msg_tx_ring.phys_buffer[i]); 884 + dma_free_coherent(priv->dev, 885 + rmu->msg_rx_ring.size * RIO_MAX_MSG_SIZE, 886 + rmu->msg_rx_ring.virt, rmu->msg_rx_ring.phys); 887 887 goto out; 888 888 } 889 889
+4 -4
arch/powerpc/sysdev/mpic.c
··· 1588 1588 num_timers = 8; 1589 1589 } 1590 1590 1591 - /* FSL mpic error interrupt intialization */ 1592 - if (mpic->flags & MPIC_FSL_HAS_EIMR) 1593 - mpic_err_int_init(mpic, MPIC_FSL_ERR_INT); 1594 - 1595 1591 /* Initialize timers to our reserved vectors and mask them for now */ 1596 1592 for (i = 0; i < num_timers; i++) { 1597 1593 unsigned int offset = mpic_tm_offset(mpic, i); ··· 1671 1675 irq_set_chained_handler(virq, &mpic_cascade); 1672 1676 } 1673 1677 } 1678 + 1679 + /* FSL mpic error interrupt intialization */ 1680 + if (mpic->flags & MPIC_FSL_HAS_EIMR) 1681 + mpic_err_int_init(mpic, MPIC_FSL_ERR_INT); 1674 1682 } 1675 1683 1676 1684 void __init mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio)
+215
arch/powerpc/sysdev/ppc4xx_hsta_msi.c
··· 1 + /* 2 + * MSI support for PPC4xx SoCs using High Speed Transfer Assist (HSTA) for 3 + * generation of the interrupt. 4 + * 5 + * Copyright © 2013 Alistair Popple <alistair@popple.id.au> IBM Corporation 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/kernel.h> 14 + #include <linux/interrupt.h> 15 + #include <linux/msi.h> 16 + #include <linux/of.h> 17 + #include <linux/of_platform.h> 18 + #include <linux/pci.h> 19 + #include <linux/semaphore.h> 20 + #include <asm/msi_bitmap.h> 21 + 22 + struct ppc4xx_hsta_msi { 23 + struct device *dev; 24 + 25 + /* The ioremapped HSTA MSI IO space */ 26 + u32 __iomem *data; 27 + 28 + /* Physical address of HSTA MSI IO space */ 29 + u64 address; 30 + struct msi_bitmap bmp; 31 + 32 + /* An array mapping offsets to hardware IRQs */ 33 + int *irq_map; 34 + 35 + /* Number of hwirqs supported */ 36 + int irq_count; 37 + }; 38 + static struct ppc4xx_hsta_msi ppc4xx_hsta_msi; 39 + 40 + static int hsta_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) 41 + { 42 + struct msi_msg msg; 43 + struct msi_desc *entry; 44 + int irq, hwirq; 45 + u64 addr; 46 + 47 + list_for_each_entry(entry, &dev->msi_list, list) { 48 + irq = msi_bitmap_alloc_hwirqs(&ppc4xx_hsta_msi.bmp, 1); 49 + if (irq < 0) { 50 + pr_debug("%s: Failed to allocate msi interrupt\n", 51 + __func__); 52 + return irq; 53 + } 54 + 55 + hwirq = ppc4xx_hsta_msi.irq_map[irq]; 56 + if (hwirq == NO_IRQ) { 57 + pr_err("%s: Failed mapping irq %d\n", __func__, irq); 58 + return -EINVAL; 59 + } 60 + 61 + /* 62 + * HSTA generates interrupts on writes to 128-bit aligned 63 + * addresses. 64 + */ 65 + addr = ppc4xx_hsta_msi.address + irq*0x10; 66 + msg.address_hi = upper_32_bits(addr); 67 + msg.address_lo = lower_32_bits(addr); 68 + 69 + /* Data is not used by the HSTA. */ 70 + msg.data = 0; 71 + 72 + pr_debug("%s: Setup irq %d (0x%0llx)\n", __func__, hwirq, 73 + (((u64) msg.address_hi) << 32) | msg.address_lo); 74 + 75 + if (irq_set_msi_desc(hwirq, entry)) { 76 + pr_err( 77 + "%s: Invalid hwirq %d specified in device tree\n", 78 + __func__, hwirq); 79 + msi_bitmap_free_hwirqs(&ppc4xx_hsta_msi.bmp, irq, 1); 80 + return -EINVAL; 81 + } 82 + write_msi_msg(hwirq, &msg); 83 + } 84 + 85 + return 0; 86 + } 87 + 88 + static int hsta_find_hwirq_offset(int hwirq) 89 + { 90 + int irq; 91 + 92 + /* Find the offset given the hwirq */ 93 + for (irq = 0; irq < ppc4xx_hsta_msi.irq_count; irq++) 94 + if (ppc4xx_hsta_msi.irq_map[irq] == hwirq) 95 + return irq; 96 + 97 + return -EINVAL; 98 + } 99 + 100 + static void hsta_teardown_msi_irqs(struct pci_dev *dev) 101 + { 102 + struct msi_desc *entry; 103 + int irq; 104 + 105 + list_for_each_entry(entry, &dev->msi_list, list) { 106 + if (entry->irq == NO_IRQ) 107 + continue; 108 + 109 + irq = hsta_find_hwirq_offset(entry->irq); 110 + 111 + /* entry->irq should always be in irq_map */ 112 + BUG_ON(irq < 0); 113 + irq_set_msi_desc(entry->irq, NULL); 114 + msi_bitmap_free_hwirqs(&ppc4xx_hsta_msi.bmp, irq, 1); 115 + pr_debug("%s: Teardown IRQ %u (index %u)\n", __func__, 116 + entry->irq, irq); 117 + } 118 + } 119 + 120 + static int hsta_msi_check_device(struct pci_dev *pdev, int nvec, int type) 121 + { 122 + /* We don't support MSI-X */ 123 + if (type == PCI_CAP_ID_MSIX) { 124 + pr_debug("%s: MSI-X not supported.\n", __func__); 125 + return -EINVAL; 126 + } 127 + 128 + return 0; 129 + } 130 + 131 + static int hsta_msi_probe(struct platform_device *pdev) 132 + { 133 + struct device *dev = &pdev->dev; 134 + struct resource *mem; 135 + int irq, ret, irq_count; 136 + 137 + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 138 + if (IS_ERR(mem)) { 139 + dev_err(dev, "Unable to get mmio space\n"); 140 + return -EINVAL; 141 + } 142 + 143 + irq_count = of_irq_count(dev->of_node); 144 + if (!irq_count) { 145 + dev_err(dev, "Unable to find IRQ range\n"); 146 + return -EINVAL; 147 + } 148 + 149 + ppc4xx_hsta_msi.dev = dev; 150 + ppc4xx_hsta_msi.address = mem->start; 151 + ppc4xx_hsta_msi.data = ioremap(mem->start, resource_size(mem)); 152 + ppc4xx_hsta_msi.irq_count = irq_count; 153 + if (IS_ERR(ppc4xx_hsta_msi.data)) { 154 + dev_err(dev, "Unable to map memory\n"); 155 + return -ENOMEM; 156 + } 157 + 158 + ret = msi_bitmap_alloc(&ppc4xx_hsta_msi.bmp, irq_count, dev->of_node); 159 + if (ret) 160 + goto out; 161 + 162 + ppc4xx_hsta_msi.irq_map = kmalloc(sizeof(int) * irq_count, GFP_KERNEL); 163 + if (IS_ERR(ppc4xx_hsta_msi.irq_map)) { 164 + ret = -ENOMEM; 165 + goto out1; 166 + } 167 + 168 + /* Setup a mapping from irq offsets to hardware irq numbers */ 169 + for (irq = 0; irq < irq_count; irq++) { 170 + ppc4xx_hsta_msi.irq_map[irq] = 171 + irq_of_parse_and_map(dev->of_node, irq); 172 + if (ppc4xx_hsta_msi.irq_map[irq] == NO_IRQ) { 173 + dev_err(dev, "Unable to map IRQ\n"); 174 + ret = -EINVAL; 175 + goto out2; 176 + } 177 + } 178 + 179 + ppc_md.setup_msi_irqs = hsta_setup_msi_irqs; 180 + ppc_md.teardown_msi_irqs = hsta_teardown_msi_irqs; 181 + ppc_md.msi_check_device = hsta_msi_check_device; 182 + return 0; 183 + 184 + out2: 185 + kfree(ppc4xx_hsta_msi.irq_map); 186 + 187 + out1: 188 + msi_bitmap_free(&ppc4xx_hsta_msi.bmp); 189 + 190 + out: 191 + iounmap(ppc4xx_hsta_msi.data); 192 + return ret; 193 + } 194 + 195 + static const struct of_device_id hsta_msi_ids[] = { 196 + { 197 + .compatible = "ibm,hsta-msi", 198 + }, 199 + {} 200 + }; 201 + 202 + static struct platform_driver hsta_msi_driver = { 203 + .probe = hsta_msi_probe, 204 + .driver = { 205 + .name = "hsta-msi", 206 + .owner = THIS_MODULE, 207 + .of_match_table = hsta_msi_ids, 208 + }, 209 + }; 210 + 211 + static int hsta_msi_init(void) 212 + { 213 + return platform_driver_register(&hsta_msi_driver); 214 + } 215 + subsys_initcall(hsta_msi_init);
+16 -5
arch/powerpc/sysdev/ppc4xx_pci.c
··· 176 176 return -ENXIO; 177 177 } 178 178 179 - /* Check that we are fully contained within 32 bits space */ 180 - if (res->end > 0xffffffff) { 179 + /* Check that we are fully contained within 32 bits space if we are not 180 + * running on a 460sx or 476fpe which have 64 bit bus addresses. 181 + */ 182 + if (res->end > 0xffffffff && 183 + !(of_device_is_compatible(hose->dn, "ibm,plb-pciex-460sx") 184 + || of_device_is_compatible(hose->dn, "ibm,plb-pciex-476fpe"))) { 181 185 printk(KERN_ERR "%s: dma-ranges outside of 32 bits space\n", 182 186 hose->dn->full_name); 183 187 return -ENXIO; ··· 1444 1440 ppc4xx_pciex_hwops = &ppc405ex_pcie_hwops; 1445 1441 #endif 1446 1442 #ifdef CONFIG_476FPE 1447 - if (of_device_is_compatible(np, "ibm,plb-pciex-476fpe")) 1443 + if (of_device_is_compatible(np, "ibm,plb-pciex-476fpe") 1444 + || of_device_is_compatible(np, "ibm,plb-pciex-476gtr")) 1448 1445 ppc4xx_pciex_hwops = &ppc_476fpe_pcie_hwops; 1449 1446 #endif 1450 1447 if (ppc4xx_pciex_hwops == NULL) { ··· 1756 1751 dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL, 1757 1752 sa | DCRO_PEGPL_460SX_OMR1MSKL_UOT 1758 1753 | DCRO_PEGPL_OMRxMSKL_VAL); 1759 - else if (of_device_is_compatible(port->node, "ibm,plb-pciex-476fpe")) 1754 + else if (of_device_is_compatible( 1755 + port->node, "ibm,plb-pciex-476fpe") || 1756 + of_device_is_compatible( 1757 + port->node, "ibm,plb-pciex-476gtr")) 1760 1758 dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL, 1761 1759 sa | DCRO_PEGPL_476FPE_OMR1MSKL_UOT 1762 1760 | DCRO_PEGPL_OMRxMSKL_VAL); ··· 1889 1881 sa |= PCI_BASE_ADDRESS_MEM_PREFETCH; 1890 1882 1891 1883 if (of_device_is_compatible(port->node, "ibm,plb-pciex-460sx") || 1892 - of_device_is_compatible(port->node, "ibm,plb-pciex-476fpe")) 1884 + of_device_is_compatible( 1885 + port->node, "ibm,plb-pciex-476fpe") || 1886 + of_device_is_compatible( 1887 + port->node, "ibm,plb-pciex-476gtr")) 1893 1888 sa |= PCI_BASE_ADDRESS_MEM_TYPE_64; 1894 1889 1895 1890 out_le32(mbase + PECFG_BAR0HMPA, RES_TO_U32_HIGH(sa));
+14 -14
arch/powerpc/xmon/xmon.c
··· 419 419 get_output_lock(); 420 420 excprint(regs); 421 421 if (bp) { 422 - printf("cpu 0x%x stopped at breakpoint 0x%x (", 422 + printf("cpu 0x%x stopped at breakpoint 0x%lx (", 423 423 cpu, BP_NUM(bp)); 424 424 xmon_print_symbol(regs->nip, " ", ")\n"); 425 425 } ··· 513 513 excprint(regs); 514 514 bp = at_breakpoint(regs->nip); 515 515 if (bp) { 516 - printf("Stopped at breakpoint %x (", BP_NUM(bp)); 516 + printf("Stopped at breakpoint %lx (", BP_NUM(bp)); 517 517 xmon_print_symbol(regs->nip, " ", ")\n"); 518 518 } 519 519 if (unrecoverable_excp(regs)) ··· 759 759 brk.address = dabr.address; 760 760 brk.type = (dabr.enabled & HW_BRK_TYPE_DABR) | HW_BRK_TYPE_PRIV_ALL; 761 761 brk.len = 8; 762 - set_breakpoint(&brk); 762 + __set_breakpoint(&brk); 763 763 } 764 764 if (iabr && cpu_has_feature(CPU_FTR_IABR)) 765 765 mtspr(SPRN_IABR, iabr->address ··· 997 997 last_cpu = cpu; 998 998 } else { 999 999 if (last_cpu != first_cpu) 1000 - printf("-%lx", last_cpu); 1000 + printf("-0x%lx", last_cpu); 1001 1001 last_cpu = first_cpu = cpu; 1002 - printf(" %lx", cpu); 1002 + printf(" 0x%lx", cpu); 1003 1003 } 1004 1004 } 1005 1005 } 1006 1006 if (last_cpu != first_cpu) 1007 - printf("-%lx", last_cpu); 1007 + printf("-0x%lx", last_cpu); 1008 1008 printf("\n"); 1009 1009 return 0; 1010 1010 } ··· 1024 1024 /* take control back */ 1025 1025 mb(); 1026 1026 xmon_owner = smp_processor_id(); 1027 - printf("cpu %u didn't take control\n", cpu); 1027 + printf("cpu 0x%x didn't take control\n", cpu); 1028 1028 return 0; 1029 1029 } 1030 1030 barrier(); ··· 1086 1086 fcs = 0xffff; 1087 1087 for (i = 0; i < ncsum; ++i) { 1088 1088 if (mread(adrs+i, &v, 1) == 0) { 1089 - printf("csum stopped at %x\n", adrs+i); 1089 + printf("csum stopped at "REG"\n", adrs+i); 1090 1090 break; 1091 1091 } 1092 1092 fcs = FCS(fcs, v); ··· 1202 1202 /* assume a breakpoint address */ 1203 1203 bp = at_breakpoint(a); 1204 1204 if (bp == NULL) { 1205 - printf("No breakpoint at %x\n", a); 1205 + printf("No breakpoint at %lx\n", a); 1206 1206 break; 1207 1207 } 1208 1208 } 1209 1209 1210 - printf("Cleared breakpoint %x (", BP_NUM(bp)); 1210 + printf("Cleared breakpoint %lx (", BP_NUM(bp)); 1211 1211 xmon_print_symbol(bp->address, " ", ")\n"); 1212 1212 bp->enabled = 0; 1213 1213 break; ··· 1746 1746 __delay(200); 1747 1747 n = size; 1748 1748 } else { 1749 - printf("*** Error writing address %x\n", adrs + n); 1749 + printf("*** Error writing address "REG"\n", adrs + n); 1750 1750 } 1751 1751 catch_memory_errors = 0; 1752 1752 return n; ··· 2435 2435 ret = func(args[0], args[1], args[2], args[3], 2436 2436 args[4], args[5], args[6], args[7]); 2437 2437 sync(); 2438 - printf("return value is %x\n", ret); 2438 + printf("return value is 0x%lx\n", ret); 2439 2439 } else { 2440 2440 printf("*** %x exception occurred\n", fault_except); 2441 2441 } ··· 2700 2700 unsigned long esid,vsid,valid; 2701 2701 unsigned long llp; 2702 2702 2703 - printf("SLB contents of cpu %x\n", smp_processor_id()); 2703 + printf("SLB contents of cpu 0x%x\n", smp_processor_id()); 2704 2704 2705 2705 for (i = 0; i < mmu_slb_size; i++) { 2706 2706 asm volatile("slbmfee %0,%1" : "=r" (esid) : "r" (i)); ··· 2732 2732 int i; 2733 2733 unsigned long *tmp = (unsigned long *)local_paca->stab_addr; 2734 2734 2735 - printf("Segment table contents of cpu %x\n", smp_processor_id()); 2735 + printf("Segment table contents of cpu 0x%x\n", smp_processor_id()); 2736 2736 2737 2737 for (i = 0; i < PAGE_SIZE/16; i++) { 2738 2738 unsigned long a, b;
+13 -3
drivers/macintosh/windfarm_pm121.c
··· 555 555 pid_param.interval = PM121_SYS_INTERVAL; 556 556 pid_param.history_len = PM121_SYS_HISTORY_SIZE; 557 557 pid_param.itarget = param->itarget; 558 - pid_param.min = control->ops->get_min(control); 559 - pid_param.max = control->ops->get_max(control); 558 + if(control) 559 + { 560 + pid_param.min = control->ops->get_min(control); 561 + pid_param.max = control->ops->get_max(control); 562 + } else { 563 + /* 564 + * This is probably not the right!? 565 + * Perhaps goto fail if control == NULL above? 566 + */ 567 + pid_param.min = 0; 568 + pid_param.max = 0; 569 + } 560 570 561 571 wf_pid_init(&pm121_sys_state[loop_id]->pid, &pid_param); 562 572 ··· 581 571 control the same control */ 582 572 printk(KERN_WARNING "pm121: failed to set up %s loop " 583 573 "setting \"%s\" to max speed.\n", 584 - loop_names[loop_id], control->name); 574 + loop_names[loop_id], control ? control->name : "uninitialized value"); 585 575 586 576 if (control) 587 577 wf_control_set_max(control);
+13 -8
drivers/pci/pci.c
··· 3179 3179 return 0; 3180 3180 } 3181 3181 3182 - /** 3183 - * pci_reset_bridge_secondary_bus - Reset the secondary bus on a PCI bridge. 3184 - * @dev: Bridge device 3185 - * 3186 - * Use the bridge control register to assert reset on the secondary bus. 3187 - * Devices on the secondary bus are left in power-on state. 3188 - */ 3189 - void pci_reset_bridge_secondary_bus(struct pci_dev *dev) 3182 + void __weak pcibios_reset_secondary_bus(struct pci_dev *dev) 3190 3183 { 3191 3184 u16 ctrl; 3192 3185 ··· 3203 3210 * but we don't make use of them yet. 3204 3211 */ 3205 3212 ssleep(1); 3213 + } 3214 + 3215 + /** 3216 + * pci_reset_bridge_secondary_bus - Reset the secondary bus on a PCI bridge. 3217 + * @dev: Bridge device 3218 + * 3219 + * Use the bridge control register to assert reset on the secondary bus. 3220 + * Devices on the secondary bus are left in power-on state. 3221 + */ 3222 + void pci_reset_bridge_secondary_bus(struct pci_dev *dev) 3223 + { 3224 + pcibios_reset_secondary_bus(dev); 3206 3225 } 3207 3226 EXPORT_SYMBOL_GPL(pci_reset_bridge_secondary_bus); 3208 3227
+1 -1
tools/testing/selftests/powerpc/Makefile
··· 13 13 14 14 export CC CFLAGS 15 15 16 - TARGETS = pmu copyloops 16 + TARGETS = pmu copyloops mm 17 17 18 18 endif 19 19
+4 -1
tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h
··· 46 46 #define R20 r20 47 47 #define R21 r21 48 48 #define R22 r22 49 + #define R29 r29 50 + #define R30 r30 51 + #define R31 r31 49 52 50 53 #define STACKFRAMESIZE 256 51 - #define STK_PARAM(i) (48 + ((i)-3)*8) 52 54 #define STK_REG(i) (112 + ((i)-14)*8) 53 55 54 56 #define _GLOBAL(A) FUNC_START(test_ ## A) 57 + #define _GLOBAL_TOC(A) _GLOBAL(A) 55 58 56 59 #define PPC_MTOCRF(A, B) mtocrf A, B 57 60
+18
tools/testing/selftests/powerpc/mm/Makefile
··· 1 + noarg: 2 + $(MAKE) -C ../ 3 + 4 + PROGS := hugetlb_vs_thp_test 5 + 6 + all: $(PROGS) 7 + 8 + $(PROGS): ../harness.c 9 + 10 + run_tests: all 11 + @-for PROG in $(PROGS); do \ 12 + ./$$PROG; \ 13 + done; 14 + 15 + clean: 16 + rm -f $(PROGS) 17 + 18 + .PHONY: all run_tests clean
+72
tools/testing/selftests/powerpc/mm/hugetlb_vs_thp_test.c
··· 1 + #include <stdio.h> 2 + #include <sys/mman.h> 3 + #include <unistd.h> 4 + 5 + #include "utils.h" 6 + 7 + /* This must match the huge page & THP size */ 8 + #define SIZE (16 * 1024 * 1024) 9 + 10 + static int test_body(void) 11 + { 12 + void *addr; 13 + char *p; 14 + 15 + addr = (void *)0xa0000000; 16 + 17 + p = mmap(addr, SIZE, PROT_READ | PROT_WRITE, 18 + MAP_HUGETLB | MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); 19 + if (p != MAP_FAILED) { 20 + /* 21 + * Typically the mmap will fail because no huge pages are 22 + * allocated on the system. But if there are huge pages 23 + * allocated the mmap will succeed. That's fine too, we just 24 + * munmap here before continuing. 25 + */ 26 + munmap(addr, SIZE); 27 + } 28 + 29 + p = mmap(addr, SIZE, PROT_READ | PROT_WRITE, 30 + MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); 31 + if (p == MAP_FAILED) { 32 + printf("Mapping failed @ %p\n", addr); 33 + perror("mmap"); 34 + return 1; 35 + } 36 + 37 + /* 38 + * Either a user or kernel access is sufficient to trigger the bug. 39 + * A kernel access is easier to spot & debug, as it will trigger the 40 + * softlockup or RCU stall detectors, and when the system is kicked 41 + * into xmon we get a backtrace in the kernel. 42 + * 43 + * A good option is: 44 + * getcwd(p, SIZE); 45 + * 46 + * For the purposes of this testcase it's preferable to spin in 47 + * userspace, so the harness can kill us if we get stuck. That way we 48 + * see a test failure rather than a dead system. 49 + */ 50 + *p = 0xf; 51 + 52 + munmap(addr, SIZE); 53 + 54 + return 0; 55 + } 56 + 57 + static int test_main(void) 58 + { 59 + int i; 60 + 61 + /* 10,000 because it's a "bunch", and completes reasonably quickly */ 62 + for (i = 0; i < 10000; i++) 63 + if (test_body()) 64 + return 1; 65 + 66 + return 0; 67 + } 68 + 69 + int main(void) 70 + { 71 + return test_harness(test_main, "hugetlb_vs_thp"); 72 + }