aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-03-18powerpc/vphn: move VPHN parsing logic to a separate fileGreg Kurz4-58/+70
The goal behind this patch is to be able to write userland tests for the VPHN parsing code. Suggested-by: Michael Ellerman <[email protected]> Signed-off-by: Greg Kurz <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-18powerpc/vphn: move endianness fixing to vphn_unpack_associativity()Greg Kurz1-4/+6
The first argument to vphn_unpack_associativity() is a const long *, but the parsing code expects __be64 values actually. Let's move the endian fixing down for consistency. Signed-off-by: Greg Kurz <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-18powerpc/vphn: clarify the H_HOME_NODE_ASSOCIATIVITY APIGreg Kurz1-2/+6
The number of values returned by the H_HOME_NODE_ASSOCIATIVITY h_call deserves to be explicitly defined, for a better understanding of the code. Signed-off-by: Greg Kurz <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-17powerpc: kill PPC_OFKevin Hao3-6/+3
We have set CONFIG_PPC_OF to always 'y' in commit 0a498d96a332 ("powerpc: set CONFIG_PPC_OF=y always for ARCH=powerpc") nine years ago. And the arch/ppc also has gone away for many years. The OF functionality was also moved to a common place and be used by many archs. So it does make no sense to keep such a option in the current kernel. Just kill it. Signed-off-by: Kevin Hao <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-17fbdev: kconfig: replace PPC_OF with PPCKevin Hao1-1/+1
The PPC_OF is a ppc specific option which is used to mean that the firmware device tree access functions are available. Since all the ppc platforms have a device tree, it is aways set to 'y' for ppc. So it makes no sense to keep a such option in the current kernel. Replace it with PPC. Signed-off-by: Kevin Hao <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Acked-by: Tomi Valkeinen <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-17fbdev: remove the unnecessary includes of ppc specific header filesKevin Hao1-4/+0
In the current kernel, we don't need to include these arch specific header files for ppc. Signed-off-by: Kevin Hao <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Acked-by: Tomi Valkeinen <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-17fbdev: riva: remove the dependency on PPC_OFKevin Hao1-10/+7
The OF functionality has moved to a common place and be used by many archs. So we don't need to include the ppc arch specific header files and depend on PPC_OF option any more. This is a preparation for killing PPC_OF. Signed-off-by: Kevin Hao <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Acked-by: Tomi Valkeinen <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-17fbdev: nvidia: remove the dependency on PPC_OFKevin Hao4-17/+1
The OF functionality has moved to a common place and be used by many archs. So we don't need to include the ppc arch specific header files and depend on PPC_OF option any more. This is a preparation for killing PPC_OF. Signed-off-by: Kevin Hao <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Acked-by: Tomi Valkeinen <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-17fbdev: imsttfb: remove the dependency on PPC_OFKevin Hao1-5/+1
The OF functionality has moved to a common place and be used by many archs. So we don't need to depend on PPC_OF option any more. This is a preparation for killing PPC_OF. Signed-off-by: Kevin Hao <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Acked-by: Tomi Valkeinen <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-17fbdev: radeon: replace PPC_OF with PPCKevin Hao5-33/+33
The PPC_OF is a ppc specific option which is used to mean that the firmware device tree access functions are available. Since all the ppc platforms have a device tree, it is aways set to 'y' for ppc. So it makes no sense to keep a such option in the current kernel. Replace it with PPC. Signed-off-by: Kevin Hao <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Acked-by: Tomi Valkeinen <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-17fbdev: aty128fb: replace PPC_OF with PPCKevin Hao1-2/+2
The PPC_OF is a ppc specific option which is used to mean that the firmware device tree access functions are available. Since all the ppc platforms have a device tree, it is aways set to 'y' for ppc. So it makes no sense to keep a such option in the current kernel. Replace it with PPC. Signed-off-by: Kevin Hao <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Acked-by: Tomi Valkeinen <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-17sata_svw: remove the dependency on PPC_OFKevin Hao1-10/+1
The OF functionality has moved to a common place and be used by many archs. So we don't need to include the ppc arch specific header files and depend on PPC_OF option any more. This is a preparation for killing PPC_OF. Signed-off-by: Kevin Hao <[email protected]> Acked-by: Tejun Heo <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-17powerpc/powermac: Cleaning up missing null-terminate in conjunction with strncpyRickard Strandqvist1-1/+1
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. And removed unnecessary magic numbers. Signed-off-by: Rickard Strandqvist <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17selftests/powerpc: Build the copyloops with -maltivecMichael Ellerman1-0/+1
The recent change to remove the vrX defines exposed the fact that we are building the copyloops tests without altivec enabled. It depends on the toolchain as to whether altivec is on by default or not, so it only breaks on some toolchains. But we should always enable it. Fixes: c2ce6f9f3dc0 ("powerpc: Change vrX register defines to vX to match gcc and glibc") Signed-off-by: Michael Ellerman <[email protected]>
2015-03-17powerpc/via-pmu: fix OF node leak in Keylargo initPhil Carmody1-0/+1
If we of_find_node_by_name() then we must of_node_put() too. Signed-off-by: Phil Carmody <[email protected]> Signed-off-by: Aaro Koskinen <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/via-pmu: fix error path in find_via_pmu()Phil Carmody1-9/+11
Cleanup was not in the reverse order from the set-up, so not all the gotos made sense, and also it was being avoided completely upon failure of init_pmu(). Signed-off-by: Phil Carmody <[email protected]> Signed-off-by: Aaro Koskinen <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc: Remove duplicate cacheable_memcpy/memzero functionsKyle Moffett5-145/+3
These functions are only used from one place each. If the cacheable_* versions really are more efficient, then those changes should be migrated into the common code instead. NOTE: The old routines are just flat buggy on kernels that support hardware with different cacheline sizes. Signed-off-by: Kyle Moffett <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/pseries: Implement memory hotplug remove in the kernelNathan Fontenot1-1/+191
This patch adds the ability to do memory hotplug remove in the kernel. Currently the operation to hotplug remove memory is handled by the drmgr command which performs the operation by performing some work in user-space and making requests to the kernel to handle other pieces. By moving all of the work to the kernel we can do the remove faster, and provide a common code path to do memory hotplug for both the PowerVM and PowerKVM environments. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/pseries: Implement memory hotplug add in the kernelNathan Fontenot1-1/+265
This patch adds the ability to do memory hotplug add in the kernel. Currently the operation to hotplug add memory is handled by the drmgr command which performs the operation by performing some work in user-space and making requests to the kernel to handle other pieces. By moving all of the work to the kernel we can do the add faster, and provide a common code path to do memory hotplug for both the PowerVM and PowerKVM environments. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/pseries: Create new device hotplug entry pointNathan Fontenot3-2/+145
The current hotplug (or dlpar) of devices (the process is generally the same for memory, cpu, and pci) on PowerVM systems is initiated from the HMC, which communicates the request to the partitions through the RSCT framework. The RSCT framework then invokes the drmgr command. The drmgr command performs the hotplug operation by doing some pieces, such as most of the rtas calls and device tree parsing, in userspace and make requests to the kernel to online/offline the device, update the device tree and add/remove the device. For PowerKVM the approach for device hotplug is to follow what is currently being done for pci hotplug. A hotplug request is initiated from the host. QEMU then generates an EPOW interrupt to the guest which causes the guest to make the rtas,check-exception call. In QEMU, the rtas,check-exception call returns a rtas hotplug event to the guest. Please note that the current pci hotplug path for PowerKVM involves the kernel receiving the rtas hotplug event, passing it to rtas_errd in userspace, and having rtas_errd invoke drmgr. The drmgr command then handles the request as described above for PowerVM systems. There is no need for this circuitous route, we should just handle the entire hotplug of devices in the kernel. What I am planning is to enable this by moving the code to handle hotplug from drmgr into the kernel to provide a single path for handling device hotplug for both PowerVM and PowerKVM systems. This patch provides the common iframework and entry point. For PowerKVM a future update to the kernel rtas code will recognize rtas hotplug events returned from rtas,check-exception calls and use the common entry point to handle hotplug of the device. For PowerVM systems, This patch creates /sys/kernel/dlpar that can be used by the drmgr command to initiate hotplug requests. In order to do this a string of the format "<resource> <action> <id_type> <id>" is written to this file. The string consists of a resource (cpu, memory, pci, phb), an action (add or remove), an id_type (count, drc index, drc name), and the corresponding id. The kernel will parse the string and create a rtas hotplug section that can be passed to the common entry point for handling hotplug requests. It should be noted that there is no chance of updating how we receive hotplug (dlpar) requests from the HMC on PowerVM systems. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/pseries: Declare the acquire/release drc index routinesNathan Fontenot1-0/+2
Add declarations for dlpar_{acquire,release}_drc(...) They are already marked non-static but were missing a prototype/ [BenH: Added extern to be consistent with the rest of the file] Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/pseries: Define rtas hotplug event sectionsNathan Fontenot1-0/+26
In order to handle device hotplug in the kernel on pseries the hotplug request will be communicated in the kernel in the form of a rtas hotplug event. This patch adds the definition of rtas hotplug event sections. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/powernv: Remove unused fileGavin Shan4-55/+1
The patch removes unused file eeh-ioda.c and updates makefile accordingly. Besides, the definition of "struct pnv_eeh_ops" and the instances are all removed. Until now, the chip layer of EEH implementation for PowerNV platform is removed completely. Signed-off-by: Gavin Shan <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/powernv: Drop PHB operation reset()Gavin Shan4-244/+223
The patch drops PHB EEH operation reset() and merges its logic to eeh_ops::reset(). Signed-off-by: Gavin Shan <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/powernv: Drop PHB operation next_error()Gavin Shan3-359/+327
The patch drops PHB EEH operation next_error() and merges its logic to eeh_ops::next_error(). Signed-off-by: Gavin Shan <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/powernv: Drop PHB operation get_state()Gavin Shan3-186/+170
The patch drops PHB EEH operation get_state() and merges its logic to eeh_ops::get_state(). Signed-off-by: Gavin Shan <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/powernv: Drop PHB operation set_option()Gavin Shan3-92/+54
The patch drops PHB EEH operation set_option() and merges its logic to eeh_ops::set_option(). Signed-off-by: Gavin Shan <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/powernv: Drop PHB operation configure_bridge()Gavin Shan3-24/+1
The patch drops PHB EEH operation configure_bridge() and merges its logic to eeh_ops::configure_bridge(). Signed-off-by: Gavin Shan <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/powernv: Drop PHB operation get_log()Gavin Shan3-29/+3
The patch drops PHB operation get_log() and merges its logic to eeh_ops::get_log(). Signed-off-by: Gavin Shan <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/powernv: Drop PHB operation post_init()Gavin Shan3-199/+179
The patch drops PHB EEH operation post_init() and merge its logic to eeh_ops::post_init(). Signed-off-by: Gavin Shan <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/powernv: Drop PHB operation err_inject()Gavin Shan3-53/+36
The patch drops PHB EEH operation err_inject() and merge its logic to eeh_ops::err_inject(). Signed-off-by: Gavin Shan <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/powernv: Shorten EEH function namesGavin Shan1-52/+52
The patch shortens names of EEH functions in powernv-eeh.c and no logic change introduced by this patch. Signed-off-by: Gavin Shan <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/pci: Fix comments about ppc_md.pcibios_fixupGavin Shan1-1/+1
The patch fixes the comments about ppc_md.pcibios_fixup(), which should be called after allocating resources. Signed-off-by: Gavin Shan <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/eeh: Enhance pcibios_set_pcie_reset_state()Gavin Shan1-0/+55
Function pcibios_set_pcie_reset_state() is possibly called by pci_reset_function(), on which VFIO infrastructure depends to issue reset. pcibios_set_pcie_reset_state() is issuing reset on the parent PE of the indicated PCI device. The reset causes state lost on all PCI devices except the indicated one as the argument to pcibios_set_pcie_reset_state(). Also, sideband MMIO access from guest when issuing reset would cause unexpected EEH error. For above two issues, the patch applies following enhancements to pcibios_set_pcie_reset_state(): * For all PCI devices except the indicated one, save their state prior to reset and restore state after that. * Explicitly freeze PE prior to reset and unfreeze it after that, in order to avoid unexpected EEH error. Tested-by: Priya M. A <[email protected]> Signed-off-by: Gavin Shan <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2015-03-17powerpc/book3s: Fix flush_tlb cpu_spec hook to take a generic argument.Mahesh Salgaonkar6-15/+65
The flush_tlb hook in cpu_spec was introduced as a generic function hook to invalidate TLBs. But the current implementation of flush_tlb hook takes IS (invalidation selector) as an argument which is architecture dependent. Hence, It is not right to have a generic routine where caller has to pass non-generic argument. This patch fixes this and makes flush_tlb hook as high level API. Reported-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Mahesh Salgaonkar <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-16powerpc/boot: don't clobber r6 and r7 in epapr bootJeremy Kerr1-12/+12
We use r6 and r7 for epapr boot, but the current pre-C init will clobber both of these. This change does a simple replacement, of r6 -> r12 and r7 -> r13, so that we hit platform init with these registers intact. Signed-off-by: Jeremy Kerr <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-16powerpc/boot: Fix stack corruption in epapr entry pointJeremy Kerr1-1/+1
Currently, a 64-bit little-endian zImage.epapr won't boot in epapr mode, as we never return from platform_init. Before entering C, we initialise our stack by setting r1 16 bytes below the end of the _bss_stack: stwu r0,-16(r1) /* establish a stack frame */ However, the called function will save the caller's lr in the caller's frame's lr save area, at -16(r1) to -32(r1). This means that writes to the fdt variable will corrupt the saved link register: 0000000020c06018 l O .bss 0000000000001000 _bss_stack 0000000020c07018 l O .bss 0000000000000008 fdt We'll need at least 32 bytes in the initial stack frame, to handle the LR save area. We bump this to 112 bytes, as that'll be the max required by ABIv1. Thanks to Alistair Popple for debugging help. Signed-off-by: Jeremy Kerr <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-16powerpc/boot/wrapper: use the pseries wrapper for zImage.epaprJeremy Kerr1-1/+1
We'll likely be entering the zImage.epapr as BE, so include the pseries implementation of _zimage_start, which adds the endian fixup magic. Although the endian fixup won't work on Book III-E machines starting LE, the current entry point doesn't support LE anyway, so we shouldn't be breaking anything. Signed-off-by: Jeremy Kerr <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-16powerpc/boot/fdt: Add little-endian support to libfdt wrappersJeremy Kerr2-6/+16
For epapr-style boot, we may be little-endian. This change implements the proper conversion for fdt*_to_cpu and cpu_to_fdt*. We also need the full cpu_to_* and *_to_cpu macros for this. Signed-off-by: Jeremy Kerr <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-16powerpc/boot/fdt: Use unsigned long for pointer castsJeremy Kerr1-3/+3
Now that the wrapper supports 64-bit builds, we see warnings when attempting to cast pointers to int. Use unsigned long instead. Signed-off-by: Jeremy Kerr <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-16powerpc/mpic: remove unused functionsArseny Solokha2-55/+0
Drop unused fsl_mpic_primary_get_version(), mpic_set_clk_ratio(), mpic_set_serial_int(). + fsl_mpic_primary_get_version() is just a safe wrapper around fsl_mpic_get_version() for SMP configurations. While the latter is called explicitly for handling PIC initialization and setting up error interrupt vector depending on PIC hardware version, the former isn't used for anything. + As for mpic_set_clk_ratio() and mpic_set_serial_int(), they both are almost nine years old[1] but still have no chance to be called even from out-of-tree modules because they both are __init and of course aren't exported. [1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2006-June/023867.html Signed-off-by: Arseny Solokha <[email protected]> Cc: [email protected] Signed-off-by: Michael Ellerman <[email protected]>
2015-03-16powerpc/qe: drop unused ucc_slow_poll_transmitter_nowArseny Solokha2-18/+0
Drop ucc_slow_poll_transmitter_now() which has no users since its inception in 2007 in commit 986585385131 ("[POWERPC] Add QUICC Engine (QE) infrastructure"). Signed-off-by: Arseny Solokha <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-16powerpc/boot: drop planetcore_set_serial_speedArseny Solokha2-36/+0
Drop planetcore_set_serial_speed() which had no users since its inception in commit fec6047047fd ("[POWERPC] bootwrapper: Add PlanetCore firmware support") in 2007. Signed-off-by: Arseny Solokha <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-16powerpc/powernv: Remove unused definitions in opal-api.hMichael Ellerman1-47/+0
This removes definitions in opal-api.h that are completely unused in Linux. For each of these I see three possibilities, 1) we *should* be using them in Linux and patches will arrive to do that, 2) they are not used but should stay in the header to document the API for some important reason, 3) they are not used and needn't be part of the API. Signed-off-by: Michael Ellerman <[email protected]> Reviewed-by: Stewart Smith <[email protected]>
2015-03-16powerpc/powernv: Move opal-api.h closer to the Skiboot versionMichael Ellerman4-74/+90
This commit gets opal-api.h to mostly match the version in Skiboot as of commit ea7d806ab0ba. The exceptions are things which are not (currently) used in Linux. Most of this is just whitespace and a few things moving around. I think the diff is readable. Also OpalMessageType became opal_msg_type, requiring a change in the Linux code. Finally Skiboot and Linux disagree on CAPI vs CXL, because CAPI means something else in Linux. To handle that we just point the Linux wrapper, which is named "cxl" to the OPAL token OPAL_PCI_SET_PHB_CAPI_MODE. Signed-off-by: Michael Ellerman <[email protected]> Reviewed-by: Stewart Smith <[email protected]>
2015-03-16powerpc/powernv: Move OPAL API definitions to opal-api.hMichael Ellerman2-751/+769
We'd like to get to the stage where the OPAL API is defined in a header that is identical between Linux and Skiboot. As step one, split the bits that actually define the API into opal-api.h. The Linux specific parts stay in opal.h. Signed-off-by: Michael Ellerman <[email protected]> Acked-by: Stewart Smith <[email protected]>
2015-03-16powerpc/boot: Makefile cleanupMichal Marek1-1/+1
The $(image-n) variable will never exist, because unset Kconfig options are '' and not 'n'. Signed-off-by: Michal Marek <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-16powerpc: Delete unnecessary checks before kfree()Markus Elfring2-4/+3
The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-16powerpc/powernv: only call OPAL_RESEND_DUMP if firmware supports itStewart Smith1-1/+2
Not all OPAL platforms support resending system dumps, so check that current firmware supports it first. Otherwise we get firmware complaining: "OPAL: Called with bad token 91 !" Signed-off-by: Stewart Smith <[email protected]> Acked-by: Vasant Hegde <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
2015-03-16powerpc/powernv: only call OPAL_ELOG_RESEND if firmware supports itStewart Smith1-1/+2
Otherwise firmware complains: "OPAL: Called with bad token 74 !" as not all OPAL systems have the ability to resend error logs. Signed-off-by: Stewart Smith <[email protected]> Acked-by: Vasant Hegde <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>