summaryrefslogtreecommitdiffstats
path: root/platforms
Commit message (Collapse)AuthorAgeFilesLines
* uart: Cleanup initialization and remove simulator hackBenjamin Herrenschmidt2016-07-063-14/+6
| | | | | | | | | | 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>
* 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>
* astbmc/common: add FWTS annotationStewart Smith2016-06-241-0/+5
| | | | | | | | Just one annotation here, pretty rare situation I think... but best to bail on this one, as this certainly isn't something we want in production. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* ibm-fsp/lxvpd: convert to straight prlog() calls with pr_fmtStewart Smith2016-06-241-19/+14
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platforms/ibm-fsp: Fix condition for valid slotGavin Shan2016-06-211-4/+5
| | | | | | | | | | | | In firenze_pci_slot_init(), i2c_alloc_req() can return NULL though it's very rare. We don't cover the case. If NULL I2C request returned from the function, the I2C dependent power management won't be used. This checks if i2c_alloc_req() returns valid I2C request or not. Suggested-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platforms/astbmc: Fix the PCI slot location codeGavin Shan2016-06-211-4/+9
| | | | | | | | | | | | | | | | After commit aa928bfbd891 ("platforms/astbmc: Support PCI slot") is merged, we have the assumption that PHB's base location code is always valid. It's not true on openPower platforms, including Garrison. It causes the PCI slot location code isn't exposed via device-tree. This fixes the above issue. The PCI slot location code contains the label only if PHB's base location code is invalid. Reported-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Tested-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* ibm-fsp/firenze: Fix unused overwritten valueStewart Smith2016-06-211-1/+1
| | | | | | | | | | | | Found with static analysis: 939 id = ((uint64_t)p[1] << 32) | p[2]; value_overwrite: Overwriting previous write to id with value 0ULL. 940 id = 0; Fixes: 6884fe63 Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FWTS: Add annotations for firenze-pciStewart Smith2016-06-201-74/+118
| | | | | | | We also convert from custom prlog() macros over to straight prlog with the magic pr_fmt define. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platforms/astbmc: Support PCI slotGavin Shan2016-06-141-15/+43
| | | | | | | | | | | | | This reworks PCI stuff for astbmc platform to support PCI slot: * The PCI slot is created in slot_table_get_slot_info(). * There are no platform dependent operations provided to PCI slots at current stage. * The slot location code is populated accordingly. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Reviewed-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platforms/ibm-fsp: Support PCI slotGavin Shan2016-06-148-523/+1321
| | | | | | | | | | | | | | | | | | | | The patch reworks PCI stuff for IBM's Apollo and Firenze platforms to support PCI slot: * Platform shared PCI slot is represented by "struct lxvpd_pci_slot" for Apollo and Firenze. The information of that is fetched from VPD. * Apollo platform uses "struct lxvpd_pci_slot" as its platform slot, while Firenze platform uses "struct firenze_pci_slot" as its platform slot in order to support external I2C-based PCI slot power maangement as well as PERST supported by the downstream ports of particular PLX PCIe switches. * On Firenze platform, the properties and methods to manage PHB slot might be overrided to utilize the capability of external power management. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/pci: Support PCI slotGavin Shan2016-06-141-0/+1
| | | | | | | | | | | | | | | | | | | Every PCIE bridge port or PHB is expected to be bound with PCI slot , to which various PCI slot's functionalities are attached (e.g. power, link, reset). This supports PCI slot: * PCI slot is reprsented by "struct pci_slot". * "struct pci_slot_ops" represents the functions supported on the PCI slot. It's initialized by PCI slot core at the beginning and allowed to be overrided by platform partially or completely. * On PCI hot plugging event, the PCI devices behind the slot are enumarated. Device sub-tree is populated and sent to OS by OPAL message. * On PCI hot unplugging event, the PCI devices behind the slot are destroyed. Device sub-tree is removed and the slot is powered off. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* garrison.c: Update GPU location codes to match workbookAlistair Popple2016-06-071-12/+12
| | | | | | | | The Garrison workbook numbers GPUs starting from GPU1 instead of GPU0. Update the skiboot location codes to match. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platforms/astbmc/garrison.c: Add slot location namesAlistair Popple2016-04-271-0/+206
| | | | | | | | Add the slot location names for the PCI and NPU slots. Signed-off-by: Alistair Popple <alistair@popple.id.au> Claimed-to-be-Tested-By: Abhijit Saikia <Abhijit.Saikia@in.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hw/npu.c: Add ibm, npu-index property to npu device treeAlistair Popple2016-04-271-0/+4
| | | | | | | | | | | | | | The PHB slot location code ueses the ibm,phb-index property to find slot location names. As the NPU is implemented as a different PHB type it means the phb-index property overlaps with the other PHBs in the system. This patch changes the existing usage of phb-index to npu-index which allows the phb-index property to be assigned a unique value which can then be matched by the PHB slot location code. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* ipmi-sel: Fix esel event logger to handle early boot PANIC eventsVasant Hegde2016-03-111-1/+2
| | | | | | | | | | | | | | We pre-allocate IPMI message for PANIC event and use that memory to send PANIC event to BMC. Presently we return NULL if we have not initiated PANIC event message. So we won't be able to log early failure events. This patch tries to initialize ipmi message instead of returning NULL. Also intialize elog before ipmi_sel_init. Otherwise we will not be able to create elog message. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platforms/firenze: Fix I2C clock source frequencyGavin Shan2016-03-081-1/+10
| | | | | | | | | | | | | | | | The I2C master clock source frequency is hardcoded to wrong value. The correct frequency should be the nest clock frequency divided by 16 as Ben said. This fixes I2C master source frequency with the help of additional properties "nest-frequency" and "bus-frequency" to root and xscom device node separately. Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: fixup hdata test for added property] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* mambo: Add terminate callbackMichael Neuling2016-03-071-0/+9
| | | | | | | Add terminate callback to mambo platform so that the simulator exits. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add Barreleye platformJohnny2016-03-042-1/+175
| | | | | Signed-off-by: Johnny <johnny.cl.chang@foxconn.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Merge branch 'stable'Stewart Smith2015-12-031-0/+1
|\
| * FSP: Give up PSI link on shutdownAnanth N Mavinakayanahalli2015-12-011-0/+1
| | | | | | | | | | | | | | | | | | Since we are anyway on the way to standby and apparently the other hypervisor also does this. Tested-by: Vipin K Parashar <vipin@linux.vnet.ibm.com> Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Garrison: Add Nvlink device tree bindingsAlistair Popple2015-10-261-0/+61
| | | | | | | | | | | | | | | | | | Garrison is the first system to support Nvlink. Eventually Hostboot should provide these device tree bindings. In the meantime this patch will add the required fixups to enable the Nvlinks on Garrison. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | firestone: fix spacing in slot nameJeremy Kerr2015-10-261-1/+1
|/ | | | | | | The other SlotN names have no space. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platforms/astbmc: Move prd_init calls to astbmc_early_init()Jeremy Kerr2015-09-154-5/+2
| | | | | | | | | | | | Currently, most astbmc platforms do their own call to prd_init(), but garrison is out-of-sync. This change moves the prd_init call to astbmc_early_init, so we don't need to enable it on every platform. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Reviewed-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* firestone: Add slot tablesBenjamin Herrenschmidt2015-09-111-0/+110
| | | | | | | Slot names courtesy of Sertac Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* assert dt allocation succeeded for rhesus rtcStewart Smith2015-09-091-0/+1
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* IPMI: Introduce attention callVasant Hegde2015-09-094-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Presently abort() function is not working on BMC based machine. System hangs after abort/assert call. We have to reboot machine from BMC (IPMI command or BMC console). This patch introduces attention functionality for BMC based machine. It logs eSEL event that contains OPAL version, file info and backtrace. And calls cec_reboot... which takes care of rebooting host. Note: - This patch uses ipmi_queue_msg() instead of ipmi_queue_msg_sync() as we are having some issues with sync path. This will resolved once we sort out [1]. - This patch calls cec_reboot to reboot machine after logging eSEL event. It queues IPMI message and bt_poll() should be working until we pass reboot IPMI message to BMC. Hence we have while loop with time_wait_ms(). Alternatively we can use xscom_trigger_xstop().. but it will stop immediately and eSEL logging fails. [1] https://lists.ozlabs.org/pipermail/skiboot/2015-August/001824.html Sample eSEL output after assert call: ------------------------------------ [hegdevasant@hegdevasant bin]$ strings fir01bmc.150820.120511.eSel.binary BB821410 AT8335-GTA000000000000 AT8335-GTA000000000000UD ATDESC OPAL version : skiboot-5.1.1-44-geae3999-hegdevasant-dirty-bb31bfd File info : core/init.c:463:0 CPU 0060 Backtrace: S: 0000000031d83bc0 R: 000000003006086c .ipmi_terminate+0x110 S: 0000000031d83c60 R: 0000000030017f90 ._abort+0x80 S: 0000000031d83ce0 R: 0000000030017fd8 .assert_fail+0x34 S: 0000000031d83d60 R: 0000000030013dcc .load_and_boot_kernel+0x784 S: 0000000031d83e30 R: 000000003001437c .main_cpu_entry+0x57c S: 0000000031d83f00 R: 0000000030002544 boot_entry+0x194 Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platform: Add platform hook for terminate callVasant Hegde2015-09-092-0/+2
| | | | | | | | | Current abort() call works fine on FSP based system. We need different mechanism on BMC based machine. Hence introduce platform hook for terminate call. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* IPMI: Pre-allocate memory for PANIC eventVasant Hegde2015-09-091-0/+1
| | | | | | | | | | | | Currently we allocate ipmi_msg for every eSEL event.. But in PANIC its not advised to allocate memory. Hence pre-allocate ipmi_msg for PANIC event. Note that we continue to allocate memory for normal event. Also with current implementation we can log only one eSEL event in PANIC path. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add slot tables for HabaneroBenjamin Herrenschmidt2015-09-011-1/+98
| | | | | | | Names provided by Ben Mashak Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* plat/bmc: Add infrastructure for slot tablesBenjamin Herrenschmidt2015-09-013-1/+119
| | | | | | | | | This adds some basic infrastructure for simple slot tables allowing us to name slots and built-in devices on OPP machines. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: add IBM (C) in new file, trim trailing whitespace] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* pci/fsp: Cleanup slot_infoBenjamin Herrenschmidt2015-09-011-41/+48
| | | | | | | | | | | | This moves some fields that are specific to the LXVPD mechanism out of the generic pci_slot_info into a private wrapper. Additionally, most fields in pci_slot_info are made signed integers in order to allow them to be set to "-1" which indicates that the field doesn't have a meaningful value, and inhibits creation of the corresponding device-tree property. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* libflash: Return a pointer to internal structure.Cyril Bur2015-08-282-2/+2
| | | | | | | | | | | | | | | | There are some functions (notably: erase_chip and set_4b_mode) which cannot be abstracted away by the blocklevel interface, this means that if they are really needed (by pflash for example) then at the moment a program like pflash would need to pass a blocklevel_device struct to libflash. This forces libflash to trust that it was given a blocklevel that it did init. If it didn't init it the container_of call will return junk and libflash has no way to protect its self. This method (while very useful) has destroyed type safety. As such, this commit reintroduces some typesafety back into this stack. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fix spelling mistakesStewart Smith2015-08-263-4/+4
| | | | | | See https://github.com/lucasdemarchi/codespel Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* fsp/ipmi: Add the in-band IPMI support for FSP systemsNeelesh Gupta2015-07-101-0/+5
| | | | | | | | | | | FSP implements the IPMI commands support that can be accessed over the mailbox interface from the host. The host needs to provide and receive the message/data bytes of the IPMI command in the TCE space in the KCS (Keyboard Controller Style) format. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Acked-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* opal: Enable backup topology.Mahesh Salgaonkar2015-07-091-0/+3
| | | | | | | | | | | | | | | | | | | | | Whenever FSP makes any changes to backup topology as part of either routine hardware maintenance or fixing failed backup topology configuration, it sends out mailbox command xE6, s/c 0x06, mod 0, to enable/disable the backup topology. OPAL layer should keep itself up-to-date with accurate details of current topology configurations. This will help OPAL layer to successfully handle any TOD failover in future. The FSP can only request that the currently inactive (backup) topology be disabled or enabled. If the requested topology is currently the active topology, then fail this request with a 0xB8 (TOD topology in use) status as return code. For disable request, set the backup topology status as disabled. For enable request, scan all the available chips and find the new backup master chip by looking at TOD status register of each chip. Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* pnor_init() - Fix Uninitialized pointer readKamalesh Babulal2015-07-071-1/+1
| | | | | | | | | | | In pnor_init(), there are chances of pointer bl being read before assignment. Fix it by initializing it to NULL. Fixes Coverity defect#97868. Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Cc: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* plat/qemu: Add LPC based RTC supportBenjamin Herrenschmidt2015-07-031-0/+5
| | | | | | | | This adds a driver for standard CMOS RTC chips and use it from the QEMU platform. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* plat/qemu: Add simple qemu platformBenjamin Herrenschmidt2015-07-033-1/+151
| | | | | | | | | | | | | This adds support for running under qemu "powernv" platform, which is currently available via the qemu repository at: https://github.com/ozbenh/qemu branch "powernv" qemu can't yet create DT entries for ISA devices so we hard wire the UART and RTC devices in the device-tree like we do with other platforms. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Merge branch 'update-2.1.1.1' into mergebackBenjamin Herrenschmidt2015-07-011-5/+144
|\ | | | | | | | | | | Complex merge fixups Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
| * firenze: Add PCIe power workaround for K80Benjamin Herrenschmidt2015-06-132-6/+301
| | | | | | | | | | | | Based on instructions from the HW folks Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | Support for Naples LPC serial interruptsBenjamin Herrenschmidt2015-06-196-27/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the HW SerIRQ deserializer of the P8 LPC bridge which is properly wired up on Naples. It also adds support for detecting and reporting LPC error interrupts on all P8s. On most platforms (Rhesus is the exception here due to the way it lets Linux handle the UART interrupts directly), we modify the device-tree to properly represent the LPC controller as a cascaded interrupt-controller and the "interrupts" property of LPC devices to contain the actual LPC interrupt number for the device. We add a mechanism for drivers to register specific LPC interrupts, and a "workaround" for pre-Naples P8 which platforms can use to call all of them for when the external FPGA based deserializer is used. There's also a callback on LPC resets which isn't used yet, we need a bit more work on the general LPC error handling, but it can be done a separate patches. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Fix branch on uninitialized value in rhesus platform codeStewart Smith2015-06-111-1/+1
| | | | | | | | | | | | Found by llvm scan-build. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | prd: Enable prd_init() for firestone platformVaidyanathan Srinivasan2015-06-111-0/+1
| | | | | | | | | | | | | | | | | | Call prd_init() on astbmc/firestone platform in order to enable PRD in host kernel. Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Acked-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | libflash: start using the blocklevel interface.Cyril Bur2015-06-092-10/+13
| | | | | | | | | | | | | | | | | | | | Converted all the libflash calls to use the blocklevel interface, modified all callers to libflash to use the blocklevel interface. This patch should introduce next to no functional change. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Add fake nvram for Mambo platformStewart Smith2015-05-271-0/+17
| | | | | | | | | | | | | | | | | | Increases boot-code-coverage (for Mambo): Lines: 2043 to 2168 (8.3% to 8.8%) Functions: 283 to 298 (14.7% to 15.4%) Branches: 792 to 816 (6.4% to 6.5%) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Add Mambo platformStewart Smith2015-05-273-1/+89
| | | | | | | | | | | | | | | | By adding an explicit mambo platform we can do tricks like a fake NVRAM, actually get RTC from mambo and generally be a bit better in a simulator Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Merge PRD rework from stableStewart Smith2015-05-211-0/+4
|\ \
| * \ Merge branch 'update-2.1.1.1' into stableStewart Smith2015-05-211-0/+4
| |\ \ | | |/
| | * Fix race in firenze_get_slot_info() leading to assert() with many PCI cardsStewart Smith2015-05-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With many PCI cards, we'd hit a race where calls to firenze_add_pcidev_to_fsp_inventory would step on each other leading to memory corruption and finally an assert() in the allocator being hit during boot. Observed with 33+ devices. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | | fix copy&paste error in Garrison definitionDan Horák2015-05-181-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Dan Horák <dan@danny.cz> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
OpenPOWER on IntegriCloud