summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* fsp-leds: add () around macrosStewart Smith2016-07-111-2/+2
| | | | | | | | | | found by Smatch static analysis (http://smatch.sourceforge.net/): hw/fsp/fsp-leds.c:576 fsp_msg_set_led_state() warn: the 'FSP_LED_EXCL_FAULT' ma\ cro might need parens hw/fsp/fsp-leds.c:583 fsp_msg_set_led_state() warn: the 'FSP_LED_EXCL_IDENTIFY'\ macro might need parens Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* phb3: fix inconsistent indentingStewart Smith2016-07-111-2/+2
| | | | | | | | Found by smatch static analysis (http://smatch.sourceforge.net/): hw/phb3.c:2331 capp_load_ucode() warn: inconsistent indenting hw/phb3.c:3444 phb3_set_capi_mode() warn: inconsistent indenting Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* slw: fix not indented if conditionStewart Smith2016-07-111-1/+1
| | | | | | | found by Smatch static analysis (http://smatch.sourceforge.net/): hw/slw.c:687 add_cpu_idle_state_properties() warn: if statement not indented Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* nvram-format: fix inconsistent indentingStewart Smith2016-07-111-3/+3
| | | | | | | | Found by smatch static analysis (http://smatch.sourceforge.net/): core/nvram-format.c:146 nvram_check() warn: inconsistent indenting core/nvram-format.c:151 nvram_check() warn: inconsistent indenting Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* mem_region: fix inconsistent indentingStewart Smith2016-07-111-3/+3
| | | | | | | | Found by smatch static analysis (http://smatch.sourceforge.net/): core/mem_region.c:561 mem_check() warn: inconsistent indenting core/mem_region.c:569 mem_check() warn: inconsistent indenting Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP: Validate fsp_msg response memory allocationVasant Hegde2016-07-111-1/+7
| | | | | | | | | fsp_allocmsg() returns true even if msg->resp memory allocation fails. Validate msg->resp memory allocation as well. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Mukesh Ojha <mukesh02@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* mambo: Add NULL checks and error messagesCyril Bur2016-07-111-0/+6
| | | | | | | | | | | While it extremely unlikely that these paths will ever by triggered the error message could be useful to help diagnose a broken system. This patch also fixes coverity issue 127700 Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* doc/device-tree/examples/power9-phb4.dts: Enable a couple of extra PHBsStewart Smith2016-07-081-2/+2
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* lpc: Example DT update for P9 LPC busBenjamin Herrenschmidt2016-07-081-0/+36
| | | | | | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* lpc: Add basic P9 LPC read/write opsBenjamin Herrenschmidt2016-07-082-25/+108
| | | | | | | | | | We still need to review interrupts handling etc... Also update the example device-tree for SIMICS Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* power9: Add example device tree for phb4Benjamin Herrenschmidt2016-07-081-0/+156
| | | | | | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add documentation for OPAL_PCI_TCE_KILLStewart Smith2016-07-081-0/+55
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hw/phb4: Add initial supportBenjamin Herrenschmidt2016-07-089-4/+4188
| | | | | | | | | | This adds the base support for the PHB4. It currently only support the M32 window, EEH or in general error recovery aren't supported yet. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: update (C) year, fix indenting] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* pci: When restoring bus numbers after a reset, also restore device cacheBenjamin Herrenschmidt2016-07-081-1/+7
| | | | | | | | | PCIe devices cache the bus number on the first config write, make sure we restore them when at the same time Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* pci: get_reserved_pe_number() needs to take the PHB as argumentBenjamin Herrenschmidt2016-07-084-4/+4
| | | | | | | | The value might be different for different PHB instances Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* XIVE: Base XIVE support for OPAL XICS emulation callsBenjamin Herrenschmidt2016-07-087-6/+2402
| | | | | | | | | | | | | This provides basic initialization of the XIVE along with some OPAL calls to emulate an old-style XICS which will initially be used by Linux for backward compatibility. The current implementation is limited to one priority and doesn't expose much to Linux for future exploitation mode yet. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: add (C) header, fix whitespace, missing breaks] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* interrupts: Add eoi() callback in preparation for XIVE supportBenjamin Herrenschmidt2016-07-082-4/+60
| | | | | | | | This will be used by the XICS emulation in order to EOI the sources themselves. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Cleanup xscom_read_cfam_chipid to make p8/p9 difference clearerBenjamin Herrenschmidt2016-07-061-1/+2
| | | | | | | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> [stewart@linux.vnet.ibm.com: split from timebase quirk patch] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Timebase quirk for slow simulators like AWAN and SIMICSBenjamin Herrenschmidt2016-07-067-3/+27
| | | | | | | | | | | This will internally pretend the timebase is running 1000 times slower, which reduces some otherwise really terrible delays in some simulators. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> [stewart@linux.vnet.ibm.com: move cfam_chipid cleanup into own patch] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* devicetree: Add dt_node_is_enabled()Benjamin Herrenschmidt2016-07-062-0/+12
| | | | | | | | | | This accessor tests the "status" property allowing us to represent disabled devices in the device-tree. It will be used by PHB4 initially but its usage could be made more widespread. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* uart: Cleanup initialization and remove simulator hackBenjamin Herrenschmidt2016-07-068-106/+85
| | | | | | | | | | Add more generic support for MMIO based UARTs, simplify code, use common initialization, and clean up the device-tree representation as well. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* xscom: A few P9 updatesBenjamin Herrenschmidt2016-07-061-10/+23
| | | | | | | | | | More to go, especially we need to review recovery, but at least this enables indirect and errors out on not-yet-supported EX targeting. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add "ffs" inline functionBenjamin Herrenschmidt2016-07-061-0/+5
| | | | | | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* bitutils: Add PPC_BITMASK8Benjamin Herrenschmidt2016-07-061-0/+1
| | | | | | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* chip: Add more P9 accessors for converting to/from PIRBenjamin Herrenschmidt2016-07-061-1/+9
| | | | | | | | | To access a local CPU number within a chip essentially, will be used by XIVE Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* POWER9: Add XSCOM related definitionsBenjamin Herrenschmidt2016-07-062-2/+43
| | | | | | | | Macros for EP/EX/EC accesses and some register definitions Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* POWER9: Fix P9 chip name in XSCOMBenjamin Herrenschmidt2016-07-061-1/+1
| | | | | | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* POWER9: Make xscom_addr() work for p8 and p9Michael Neuling2016-07-061-3/+5
| | | | | | Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* doc/OPAL_INT_EOI: document positive return valueStewart Smith2016-07-061-0/+5
| | | | | | | From benh suggestion in id:1467792521.13965.118.camel@kernel.crashing.org Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Reserve OPAL API numbers for XICS emulation for XIVEStewart Smith2016-07-065-1/+66
| | | | | | | | | Additionally, we put in some skeleton docs for what's coming, key points being that this is for P9 and above, relies on a device being present in the device tree and is modelled on the PAPR calls. Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Revert "flash: Use blocklevel to do ECC reads"Stewart Smith2016-07-061-2/+2
| | | | | | | | | Was causing boot failures on Garrison and Firestone (likely other OpenPower platforms) This reverts commit 74ba83462c64d6a987ed4785aee55309daf9ffb6. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* chip: Add simics specific quirksMichael Neuling2016-07-051-1/+2
| | | | | | | | | | Use that instead of mambo. Simics supports the F000F, so remove that quirk. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* mambo: Run at fastest speed.Michael Neuling2016-07-051-2/+2
| | | | | | Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* mambo: Flash driver using bogus diskMichael Neuling2016-07-051-0/+159
| | | | | | | | | | | | | Implement a flash driver using mambo bogus disk. Works as a system flash (ie palmetto.pnor) or with disk images (via Linux mtdblock). Linux MTD needs this patch to perform at a resonable speed: https://lists.ozlabs.org/pipermail/linuxppc-dev/2016-July/145202.html Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* flash: Use blocklevel to do ECC readsAlistair Popple2016-07-051-2/+2
| | | | | | | | | | | flash_read_corrected() assumes the passed blocklevel device is an actual flash device. However the blocklevel flash abstraction supports automatically reading ECC protected data so use that instead. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Michael Neuling <mikey@neuling.org> Reviewed-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* flash: Increase the maximum number of flash devicesMichael Neuling2016-07-051-1/+1
| | | | | | | | | Increase the max number of flash devices from 1 to 8. With mambo bogusdisk, we can have many flash devices. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* PHB3: Disable UTL outbound discard error interruptGavin Shan2016-07-051-1/+1
| | | | | | | | | | | | | | | | The UTL outbound discard error (bit#12) in UTL_PCIE_PORT_IRQ_EN (offset: 0x558) isn't set in initial setup. It's set wrongly after a reset on root port. With this bit set, frozen (all) error was observed on the PHB to which a LPFC adapter is connected directly. This removes the bit in reset handler to avoid the unexpected frozen (all) error. BZ: 142877 Reported-by: Pridhiviraj Paidipeddi <ppaidipe@in.ibm.com> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* libflash: Add sanity checks to ffs init code.Cyril Bur2016-07-051-0/+22
| | | | | | | | | | Quite a lot of code relies on values read from flash. These values shouldn't be totally trusted without at least basic sanity checks. Fixes coverity bug: 119719 Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hw/lpc: LPC driver use prlog rather than printfVipin K Parashar2016-07-051-22/+25
| | | | | | | | Use pr_fmt macro for LPC driver log messages, changed printfs to use prlog. Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: just take pr_fmt part] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Merge branch 'skiboot-5.2.x'Stewart Smith2016-07-050-0/+0
|\
| * hw/xscom: Reset XSCOM engine after finite number of retries when busyVipin K Parashar2016-07-053-17/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OPAL retries XSCOM read/write operations forever till it succeeds. This can cause XSCOM ops to hang forever when XSCOM engine remains busy for some reason. Changed it to retry XSCOM operations only XSCOM_BUSY_MAX_RETRIES number of times instead of retrying forever. Also added logic to reset XSCOM engine after XSCOM_BUSY_RESET_THRESHOLD number of retries to unblock it when it remains busy. Cc: stable # 9c2d82394fd2 ("xscom: Return OPAL_WRONG_STATE on XSCOM ops..") Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com> Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> (cherry picked from commit e761222593a1ae932cddbc81239b6a7cd98ddb70)
* | Update gitignoreStewart Smith2016-07-051-0/+6
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | hw/xscom: Reset XSCOM engine after finite number of retries when busyVipin K Parashar2016-07-053-17/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | OPAL retries XSCOM read/write operations forever till it succeeds. This can cause XSCOM ops to hang forever when XSCOM engine remains busy for some reason. Changed it to retry XSCOM operations only XSCOM_BUSY_MAX_RETRIES number of times instead of retrying forever. Also added logic to reset XSCOM engine after XSCOM_BUSY_RESET_THRESHOLD number of retries to unblock it when it remains busy. Cc: stable # 9c2d82394fd2 ("xscom: Return OPAL_WRONG_STATE on XSCOM ops..") Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com> Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Produce XZ compressed skiboot.lid as part of buildStewart Smith2016-07-041-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With a recent HostBoot change, we can have an XZ compressed PAYLOAD that's automagically detected (looking at magic numbers). This gives us three great benefits: 1) it's transparent, uncompressed skiboot.lid works everywhere 2) it lets us grow greater than 1MB binary, as long as we compress down to <1MB 3) It speeds up boot. We currently compress down to 230kb rather than 922kb, which is much quicker to read off flash. This patch produces skiboot.lid.xz alongside standard skiboot.lid. We currently use crc32 as this is supported by hostboot. Future HB may support crc64, but this seems to be disabled currently. Having CRC32 in the PAYLOAD partition also gives the advantage of error detection in PAYLOAD, which we previously did not have as it was not an ECC protected partition. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | cpu: supply ibm,dec-bits via devicetreeOliver O'Halloran2016-07-012-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | ISAv3 adds a mode to increase the size of the decrementer from 32 bits. The enlarged decrementer can be between 32 and 64 bits wide with the exact value being implementation dependent. This patch adds support for detecting the size of the large decrementer and populating each CPU node with the "ibm,dec-bits" property. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: rename enable_ld() to enable_large_dec()] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Toplevel README -> README.mdMichael Neuling2016-07-011-34/+36
| | | | | | | | | | | | | | Make it pretty as well. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | mambo: Add README.md for skiboot.tclMichael Neuling2016-07-011-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | Stewart has a great blog post on getting started with mambo and skiboot. It would be better to have this content here so we can keep it in sync with the code. Original blog post here: https://www.flamingspork.com/blog/2014/12/03/running-skiboot-opal-on-the-power8-simulator/ Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | mambo: Add support for POWER9Michael Neuling2016-07-011-2/+31
| | | | | | | | | | | | | | | | Ensures the simulator is configured correctly and we advertise the right features via the device tree. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | fsp/op-panel: Fix out of bounds array access and #define display dimensionsSuraj Jitindar Singh2016-06-302-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the function __opal_write_oppanel() coverity complains about an out of bounds array access. While the pointer is never actually dereferenced, this isn't immediately obvious from the code. Additionally the number and length of the lines on the operator panel display are hard coded into the function. While we are here we might as well move these into a #define statement. Rework the code in __opal_write_oppanel() where the message is copied into the buffer so that coverity won't complain about an out of bounds array access and so that it is line number and length agnostic (now relying on the #defined values). Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | occ: FWTS annotation updates based on suggestions from VaidyStewart Smith2016-06-301-5/+8
| | | | | | | | | | | | | | Be a bit clearer in the impact of some of these errors. Suggested-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
OpenPOWER on IntegriCloud