summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* powerpc/kexec: Reset HILE before kexec_sequencev3.17.2-openpower1Samuel Mendoza-Jonas2015-08-171-0/+7
| | | | | | | | | | | | | On powernv secondary cpus are returned to OPAL, and will then enter the target kernel in big-endian. However if it is set the HILE bit will persist, causing the first exception in the target kernel to be delivered in litte-endian regardless of the current endianess. If running on top of OPAL make sure the HILE bit is reset once we've finished waiting for all of the secondaries to be returned to OPAL. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Joel Stanley <joel@jms.id.au>
* powerpc/kexec: Reset secondary cpu endianess before kexecSamuel Mendoza-Jonas2015-08-171-2/+11
| | | | | | | | | | | | | If the target kernel does not inlcude the FIXUP_ENDIAN check, coming from a different-endian kernel will cause the target kernel to panic. All ppc64 kernels can handle starting in big-endian mode, so return to big-endian before branching into the target kernel. This mainly affects pseries as secondaries on powernv are returned to OPAL. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Joel Stanley <joel@jms.id.au>
* kernel/reboot: Fix orderly_rebootJoel Stanley2015-08-142-8/+6
| | | | | | | | | | | The patch applied to this tree was an early version of orderly_reboot support. Amongst other things, it had a typo that meant the reboot command was run in the power off path. This brings reboot.c in line with the upstream commit 7a54f46b301cfab8a0d7365aa186545f8b98f22e. Signed-off-by: Joel Stanley <joel@jms.id.au>
* powerpc/powernv: Silence SYSPARAM warning on bootJoel Stanley2015-04-301-16/+15
| | | | | | | | | | | | OpenPower BMC machines do not place any sysparams in the device tree, so at every boot we get a warning: [ 0.437176] SYSPARAM: Opal sysparam node not found Remove the warning, and reorder the init so we don't peform allocations when there is no sysparam node in the device tree. Signed-off-by: Joel Stanley <joel@jms.id.au>
* powerpc/powernv: only call OPAL_RESEND_DUMP if firmware supports itStewart Smith2015-04-301-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 <stewart@linux.vnet.ibm.com> Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Joel Stanley <joel@jms.id.au>
* powerpc/powernv: only call OPAL_ELOG_RESEND if firmware supports itStewart Smith2015-04-301-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 <stewart@linux.vnet.ibm.com> Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Joel Stanley <joel@jms.id.au>
* powerpc/powernv: only register log if OPAL supports doing soStewart Smith2015-04-301-1/+5
| | | | | | | | | | | Correct use of REGISTER/UNREGISTER is to check if the token exists before calling. If we don't we get a "OPAL: Called with bad token 101 !" error, which is harmless but may be alarming to some. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Joel Stanley <joel@jms.id.au>
* powerpc/powernv: Add OPAL check token callMichael Neuling2015-04-302-0/+3
| | | | | | | | | | | | Currently there is no way to generically check if an OPAL call exists or not from the host kernel. This adds an OPAL call opal_check_token() which tells you if the given token is present in OPAL or not. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Joel Stanley <joel@jms.id.au>
* of/address: Don't throw errors on absent ranges propertiesBenjamin Herrenschmidt2015-04-301-1/+1
| | | | | | | | | | | | | The core always tries to translate any "reg" property to construct the platform device names. This results in a pile of "OF: no ranges; cannot translate" errors in dmesg whenever we expose things like i2c devices that cannot directly translate to the MMIO space. Turn this into a pr_debug instead Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Joel Stanley <joel@jms.id.au>
* powerpc: Add PVR for POWER8NVL processorBenjamin Herrenschmidt2015-04-301-0/+20
| | | | | | | | | There's a new variant of POWER8 coming called "POWER8 with NVLink". The core is identical to POWER8 but unfortunately they strapped it with a different PVR, so we need to add an explicit entry for it. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
* powerpc/powernv: Reboot when requested by firmwareJoel Stanley2015-03-301-2/+3
| | | | | | | | | Use orderly_reboot so userspace will to shut itself down via the reboot path. This is required for graceful reboot initiated by the BMC, such as when a user uses ipmitool to issue a 'chassis power cycle' command. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* kernel/reboot.c: Add orderly_reboot for graceful rebootJoel Stanley2015-03-302-3/+49
| | | | | | | | | | | | | The kernel has orderly_poweroff which allows the kernel to initiate a graceful shutdown of userspace, by running /sbin/poweroff. This adds orderly_reboot that will cause userspace to shut itself down by calling /sbin/reboot. This will be used for shutdown initiated by a system controller on platforms that do not use ACPI. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* drivers/mtd: set the powernv flash dev.parentCyril Bur2015-03-241-0/+1
| | | | | | | | | | So that userland can correlate MTD devices and those refered to by device tree nodes the dev.parent of_node must be set. Do this during the init of the device. Signed-off-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* selftests/powerpc: Add a test of the switch_endian() syscallMichael Ellerman2015-03-175-1/+223
| | | | | | | | | | | | | | | | | This adds a test of the switch_endian() syscall we added in the previous commit. We test it by calling the endian switch syscall, and then executing some code in the other endian to check everything went as expected. That code checks registers we expect to be maintained are, and then writes to stdout. If the endian switch failed to happen that code sequence will be illegal and cause the test to abort. We then switch back to the original endian, do the same checks and finally write a success message and exit(0). Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* powerpc: Add a proper syscall for switching endiannessMichael Ellerman2015-03-178-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | We currently have a "special" syscall for switching endianness. This is syscall number 0x1ebe, which is handled explicitly in the 64-bit syscall exception entry. That has a few problems, firstly the syscall number is outside of the usual range, which confuses various tools. For example strace doesn't recognise the syscall at all. Secondly it's handled explicitly as a special case in the syscall exception entry, which is complicated enough without it. As a first step toward removing the special syscall, we need to add a regular syscall that implements the same functionality. The logic is simple, it simply toggles the MSR_LE bit in the userspace MSR. This is the same as the special syscall, with the caveat that the special syscall clobbers fewer registers. This version clobbers r9-r12, XER, CTR, and CR0-1,5-7. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* powerpc/powernv: Fix leaks in PRD cleanup pathNeelesh Gupta2015-03-171-0/+3
| | | | | | | | Free the list node after use and unregister the message notifier in the module clean up. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* opal: Add message notifier unregister functionNeelesh Gupta2015-03-172-0/+9
| | | | | | | | | Provide an unregister interface for the opal message notifiers to be called when not needed like during driver unload/remove. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
* drivers/mtd: add powernv flash MTD abstraction driverCyril Bur2015-02-253-0/+296
| | | | | | | | | | | | Powerpc powernv platforms allow access to certain system flash devices through a firmwarwe interface. This change adds an mtd driver for these flash devices. Minor updates from Jeremy Kerr and Joel Stanley. Signed-off-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* powerpc/powernv: Add interfaces for flash device accessCyril Bur2015-02-254-3/+30
| | | | | | | | | | | | | | | | | | This change adds the OPAL interface definitions to allow Linux to read, write and erase from system flash devices. We register platform devices for the flash devices exported by firmware. We clash with the existing opal_flash_init function, which is really for the FSP flash update functionality, so we rename that initcall to opal_flash_update_init(). A future change will add an mtd driver that uses this interface. Changes from Joel Stanley and Jeremy Kerr. Signed-off-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Joel Stanley <joel@jms.id.au>
* powerpc/powernv: Add opal-prd channelJeremy Kerr2015-02-255-1/+528
| | | | | | | | | This change adds a chardevice to access the "PRD" (processor runtime diagnostics) channel to OPAL firmware. Includes contributions from Vaidyanathan Srinivasan & Vishal Kulkarni. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* powerpc/powernv: Sync OpalMessageType with OPALVaidyanathan Srinivasan2015-02-251-0/+1
| | | | | | | | | Add OPAL_MSG_DPO to get the right message type in sync with OPAL firmware code. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* powerpc/powernv: Add EXPORT_SYMBOL for opal async interfaceJeremy Kerr2015-02-251-0/+3
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* powerpc/powernv: Add OPAL soft-poweroff routineJoel Stanley2015-02-253-2/+67
| | | | | | | | | | | Register a notifier for a OPAL message indicating that the machine should prepare itself for a graceful power off. OPAL will tell us if the power off is a reboot or shutdown, but for now we perform the same orderly_poweroff action. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
* powerpc/boot: don't clobber r6 and r7 in epapr bootJeremy Kerr2015-02-251-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 <jk@ozlabs.org>
* powerpc/boot: Fix stack corruption in epapr entry pointJeremy Kerr2015-02-251-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 <jk@ozlabs.org>
* powerpc/boot/wrapper: use the pseries wrapper for zImage.epaprJeremy Kerr2015-02-251-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 <jk@ozlabs.org>
* powerpc/boot/fdt: Add little-endian support to libfdt wrappersJeremy Kerr2015-02-252-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 <jk@ozlabs.org> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* powerpc/boot/fdt: Use unsigned long for pointer castsJeremy Kerr2015-02-251-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 <jk@ozlabs.org>
* powerpc: Add openpower_defconfigJeremy Kerr2014-12-121-0/+222
| | | | | | | Simplifies building an openpower kernel a little. This is just a clone of the skiroot defconfig for now, but with a more usable name. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* powerpc/configs/skiroot_defconfig: Enable AT24 EEPROM driverJeremy Kerr2014-11-141-0/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* powerpc/configs/skiroot_defconfig: Fix invalid config changesJeremy Kerr2014-11-141-6/+13
| | | | | | | | | Commit 473db7a5 introduced a set of invalid config changes - all we wanted was to enable I2C_CHARDEV. This change reverts the other changes in that commit. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* i2c/opal: Adapt for firmware DT updatesBenjamin Herrenschmidt2014-11-142-3/+3
| | | | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* of/base: Fix PowerPC address parsing hackBenjamin Herrenschmidt2014-11-141-3/+12
| | | | | | | | | | | | | | | | | | | | | | What about this one instead ? I want to cache it because that function can be called quite a while and doing two additional property lookup and string compares every time might hurt some platforms. ---- We have a historical hack that treats missing ranges properties as the equivalent of an empty one. This is needed for ancient PowerMac "bad" device-trees, and shouldn't be enabled for any other PowerPC platform, otherwise we get some nasty layout of devices in sysfs or even duplication when a set of otherwise identically named devices is created multiple times under a different parent node with no ranges property. This fix is needed for the PowerNV i2c busses to be exposed properly and will fix a number of other embedded cases. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> CC: <stable@vger.kernel.org>
* drivers/core/of: Add symlink to device-tree from devices with an OF nodeBenjamin Herrenschmidt2014-11-141-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | So I've been annoyed lately with having a bunch of devices such as i2c eeproms (for use by VPDs, server world !) and other bits and pieces that I want to be able to identify from userspace, and possibly provide additional data about from FW. Basically, it boils down to correlating the sysfs device with the OF tree device node, so that user space can use device-tree info such as additional "location" or "label" (or whatever else we can come up with) propreties to identify a given device, or get some attributes of use about it, etc... Now, so far, we've done that in some subsystem in a fairly ad-hoc basis using "devspec" properties. For example, PCI creates them if it can correlate the probed device with a DT node. Some powerpc specific busses do that too. However, i2c doesn't and it would be nice to have something more generic since technically any device can have a corresponding device tree node. This patch adds an "of_node" symlink to devices that have a non-NULL dev->of_node pointer, the patch is pretty trivial and seems to work just fine for me. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* powerpc/powernv: Support OPAL requested heartbeatBenjamin Herrenschmidt2014-11-141-0/+30
| | | | | | | | If OPAL requests it, call it back via opal_poll_events() at a regular interval. Some versions of OPAL on some machines require this to operate some internal timeouts properly. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* powerpc/configs: Add I2C_CHARDEV to skiroot_defconfigJeremy Kerr2014-11-111-13/+7
| | | | | | Now that we have a i2c bus driver for powernv, enable the chardev. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* i2c: Driver to expose PowerNV platform i2c bussesNeelesh Gupta2014-11-116-9/+348
| | | | | | | | | | | | The patch exposes the available i2c busses on the PowerNV platform to the kernel and implements the bus driver to support i2c and smbus commands. The driver uses the platform device infrastructure to probe the busses on the platform and registers them with the i2c driver framework. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* powerpc/skiroot_defconfig: Enable IPMI driverJeremy Kerr2014-11-061-0/+3
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* drivers/char/ipmi: Add powernv IPMI driverJeremy Kerr2014-11-063-0/+305
| | | | | | | | | This change adds an initial IPMI driver for powerpc OPAL firmware. The interface is exposed entirely through firmware: we have two functions to send and receive IPMI messages, and an interrupt notification from the firmware to signify that a message is available. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* powerpc/powernv: Add OPAL IPMI interfaceJeremy Kerr2014-11-063-0/+33
| | | | | | | | | | | | Recent OPAL firmare adds a couple of functions to send and receive IPMI messages: https://github.com/open-power/skiboot/commit/b2a374da This change updates the token list and wrappers to suit, and adds the platform devices for any IPMI interfaces. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* drm/ast: Default to 8bpp on big endianBenjamin Herrenschmidt2014-11-061-0/+13
| | | | | | | | | | This chip is LE only (some versions support HW swappers but not the latest and the driver doesn't anyway). I tried using the "foreign endian" fb flag but it appears to be busted, so instead, default to endian-neutral 8bpp for BE. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* drm/ast: Fix HW cursor imageBenjamin Herrenschmidt2014-11-061-2/+2
| | | | | | | | | | The translation from the X driver to the KMS one typo'ed a couple of array indices, causing the HW cursor to look weird (blocky with leaking edge colors). This fixes it. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/ast: Cleanup analog init code pathBenjamin Herrenschmidt2014-11-061-18/+31
| | | | | | | | Move the MMIO mangling to a separate routine and actually disable the DVO output when using pure analog. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/ast: Don't assume DVO enabled means SIL164 on uninitialized chipsBenjamin Herrenschmidt2014-11-061-4/+10
| | | | | | | | | | | | It looks like the AST2400 comes up with the DVO enable bit set, which causes us to incorrectly assume we have a SIL164 regardless of the value of the scratch registers setup by the BMC firmware. So let's limit that test to the case where the chip has already been setup by a BIOS. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/ast: Properly initialize P2A base before using it in ast_init_3rdtx()Benjamin Herrenschmidt2014-11-061-0/+11
| | | | | | | | | | | | | If the P2A has been used to target other SOC registers before that call, we're going to hit the wrong place so make sure we set the base address up properly before using it. (P2A stands for PCIe to AHB bridge and is the bride that allows accessing the AST's internal AHB bus using a relocatable 64k window in the second half of the PCIe MMIO BAR) Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/ast: POST chip at probe time if VGA not enabledBenjamin Herrenschmidt2014-11-063-11/+62
| | | | | | | | | | | | We need to do it on machines without a BIOS such as POWER8. Also for detection to work without triggering PCIe errors, we need to enable VGA early on, inside ast_detect_chip(). While touching those files, replace a few hard coded register numbers with the corresponding symbolic constant. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/ast: Try to use MMIO registers when PIO isn't supportedBenjamin Herrenschmidt2014-11-062-4/+21
| | | | | | | | | | | If the PIO resources haven't been assigned, then we have no choice but try to use the MMIO version. This is the case for example on POWER8 which doesn't support PIO at all. Chips rev 0x20 or later have MMIO decoding enabled by default. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/ast: Add reduced blanking modes for wide screen modeY.C. Chen2014-11-062-24/+56
| | | | | | | | | | | | | Signed-off-by: Egbert Eich <eich@suse.com> Tested-by: Steven You2 Liang <liangyou2@lenovo.com> Signed-off-by: Y.C. Chen <yc_chen@aspeedtech.com> v3: based on [PATCH 1/2] drm/ast: Add missing entry to dclk_table[]. Add reduced blanking modes, improve mode matching to identify these modes by thier sync polarities. [airlied: argh whitespace damage] Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/ast: switch to using CACHED by default for sysramDave Airlie2014-11-061-2/+2
| | | | | | | | | This fixes problems on ppc64 platforms, where we could end up using a WC mapping for migrating BOs with memcpy, when really we want to use cached memory. Tested-by: Ben Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/ttm: move fpfn and lpfn into each placement v2Christian König2014-11-0626-253/+346
| | | | | | | | | This allows us to more fine grained specify where to place the buffer object. v2: rebased on drm-next, add bochs changes as well Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
OpenPOWER on IntegriCloud