aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-06-21travis: fixes for Coverity, don't run normal build for coverity buildStewart Smith1-8/+10
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20travis/coverity: Add workaround for coverity certificatesStewart Smith1-0/+1
https://github.com/travis-ci/travis-ci/issues/6142 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20ccore/fflash.c: Ffix ttypo iin fflash eerror mmessageJeremy Kerr1-1/+1
wwhich -> which. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20FWTS: Add annotations for firenze-pciStewart Smith1-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>
2016-06-20fwts: Add FWTS annotations for NPU errorsStewart Smith3-8/+33
We also remove the NPUERR macros so that the FWTS parsing magic can construct find the prlog statements. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20fwts: add annotations for core flash/nvram functionalityStewart Smith1-0/+12
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20Add fwts annotations for critical errorsStewart Smith3-0/+20
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20Merge branch 'skiboot-5.2.x'Stewart Smith0-0/+0
2016-06-20gard: disable cross compile for travisStewart Smith2-3/+3
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> (cherry picked from commit 98b80af1001027cc59dce040831c1f54d41e4f88)
2016-06-20Merge branch 'skiboot-5.2.x'Stewart Smith0-0/+0
2016-06-20gard: remove err.h includeStewart Smith1-1/+0
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> (cherry picked from commit 0c94f97edaee2d0b1c00066db24fd4555650dbe4)
2016-06-20Merge branch 'skiboot-5.2.x'Stewart Smith0-0/+0
2016-06-20Disable cross compile of opal-prdStewart Smith1-4/+0
Current travis-ci seems to no longer do this terribly cleanly. Just disable it for now.. it was never a great test anyway. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> (cherry picked from commit 3df1760b4851d65ce04a748dc915284e1b377ddb)
2016-06-20Merge branch 'skiboot-5.2.x'Stewart Smith0-0/+0
2016-06-20core: Fix backtrace for gcc 6Joel Stanley1-2/+2
GCC 6 warns when we look at any stack frame other than our own, ie any argument to __builtin_frame_address other than zero. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> (cherry picked from commit 793f6f5b32c96f2774bd955b6062c74a672317ca)
2016-06-20Merge branch 'skiboot-5.2.x'Stewart Smith0-0/+0
2016-06-20Merge branch 'skiboot-5.1.x' into skiboot-5.2.xStewart Smith8-12/+12
2016-06-20Fix typosStewart Smith8-12/+12
Backport of user visible typo fixes partial cherry picked from 4c95b5e04e3c4f72e4005574f67cd6e365d3276f Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20Fix for typosFrederic Bonnard34-61/+61
While reviewing the Debian packaging, codespell found those. Most proposed fixes are based on codespell's default dictionnary. Signed-off-by: Frederic Bonnard <frediz@linux.vnet.ibm.com> Reviewed-by: Mukesh Ojha <mukesh02@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20slw: use strncpy instead of strcpyShreyas B. Prabhu1-1/+2
Use strncpy instead of strcpy while appending to name_buf. Suggested-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20slw: Allow adding idle states to power-mgt node in mamboShreyas B. Prabhu3-10/+2
This patch removes the check which prevents adding any idle state to "power-mgt" node in mambo. Power8 exposes 3 idle states- nap, fast-sleep and deep-winkle. While fast-sleep depends on SCOMs and deep-winkle depends on SCOMs/SLW, nap has no such dependencies and it can be enabled in mambo. Current code checks for "fast-sleep" in hostboot provided "ibm,enabled-idle-states" dt node for adding fast-sleep and checks for presence of SLW for adding winkle to "power-mgt". Hence with this change only nap will be added to "power-mgt" node in mambo on Power8. On Power9, this patch enables all idle states which don't need SLW. Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20slw: Move macros associated with power-mgt nodes to opal-api.hShreyas B. Prabhu2-78/+75
Move macros associated with cpuidle fields of power-mgt device tree nodes to opal-api.h This patch does not change any functionality. Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20doc/device-tree: Add documentation for ibm, cpu-idle-state-* propertiesShreyas B. Prabhu1-5/+27
Add documentation for following nodes- ibm,cpu-idle-state-pmicr ibm,cpu-idle-state-pmicr-mask ibm,cpu-idle-state-psscr ibm,cpu-idle-state-psscr-mask ibm,cpu-idle-state-flags Also removing ibm,cpu-idle-state-names from FIXME since its already documented. Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20slw: Add Power9 idle states to power-mgt dt nodeShreyas B. Prabhu2-37/+159
POWER ISA v3 defines a new idle processor core mechanism. In summary, a) new instruction named stop is added. This instruction replaces instructions like nap, sleep, rvwinkle. b) new per thread SPR named PSSCR is added which controls the behavior of stop instruction. This SPR subsumes PMICR. This patch adds the supported idle states to power-mgt dt node. It also introduces ibm,cpu-idle-state-psscr and ibm,cpu-idle-state-psscr-mask entries which exposes the value to be written to PSSCR to enter a given stop state. These entries replaces POWER8's counterparts ibm,cpu-idle-state-pmicr and ibm,cpu-idle-state-pmicr-mask. Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20slw: Remove unnecessary type casting castShreyas B. Prabhu1-6/+6
Suggested-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20slw: Change variable name can_winkle to has_slwShreyas B. Prabhu1-4/+5
Change variable name "can_winkle" to a more generic name "has_slw". This makes it easier to add new deep-idle states which rely on SLW. Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20slw: Simplify if-condition while adding idle states to device treeShreyas B. Prabhu1-30/+43
if-condition in add_cpu_idle_state_properties which checks if a given idle state is supported is bloated with multiple '&' and '||' operations. Simplify by adding a mask variable and setting the relevant bits. This patch does not change any functionality. Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20ATTN: Set attn bit instead of hile bit in enable/disable attn functionVasant Hegde1-2/+2
Commit 3ff35034 (Abstract HILE and attn enable bit definitions for HID0) enabled HILE bit instead of ATTN bit in enable/disable_attn fuction. Hence OPAL assert is failing. Fixes: 3ff35034 (Abstract HILE and attn enable bit definitions for HID0) CC: Michael Neuling <mikey@neuling.org> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-14doc: PCI slotGavin Shan2-17/+119
This renames document pci-slot-properties.txt to pci-slot.txt and more description added regarding the new introduced functionalities to PCI slot by the series of patches. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-14core/opal: Support PCI slot and new APIsGavin Shan6-100/+293
The various reset requests are completed by PHB's callbacks. All of them (except reset on IODA table or error injection) are covered by PCI slot. opal_pci_poll() faces similar situation. This reimplements opal_pci_reset() and opal_pci_poll() based on the callbacks provided by PCI slot instead of PHB. Also, couple of new APIs are introduced based on the callbacks in PCI slot as below: * opal_pci_get_presence_state(): Check if there is adapter presented behind the specified PHB or PCI slot. * opal_pci_get_power_state(): Returns power supply state (on or off) on the specified PHB or PCI slot. * opal_pci_set_power_state(): Sets power supply state (on or off) on the specified PHB or PCI slot. Besides, the state can be (offline or online) without changing the PCI slot's power state. Eventually, the definition of unused PHB's callbacks are removed. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Reviewed-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-14core/pci: Power off empty hotpluggable slotGavin Shan1-1/+55
This powers off the empty hotpluggable slot during PCI enumeration for two purpose: power saving and initialize the slot to starting (power-off) state. 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>
2016-06-14core/pci: Use PCI slot in enumerationGavin Shan2-158/+38
During PCI enumeration, the root complex's link and fundamental reset are carried out by PHB's callbacks which are replaced by the corresponding PCI slot's callbacks. Also, the hotplug related device node properties are populated based on the PCI slot info that is included in PCI slot now. This uses PCI slot in enumeration: * Use PCI slot's callbacks for fundamental reset and link status retrieval in PCI enumeration. * Simplify the code by removing traditional PCI/PCI-x related logic as we don't have PCI/PCI-X root complex. * Replace pci_add_slot_properties() with pci_slot_add_properties() to populate PCI slot properties in device-tree. * PHB is always not hotpluggable. No hotpluggable properties in its device node are needed. * Remove "struct pci_slot_info" definition as its info is included in "struct pci_slot". 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>
2016-06-14platforms/astbmc: Support PCI slotGavin Shan1-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>
2016-06-14platforms/ibm-fsp: Support PCI slotGavin Shan8-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>
2016-06-14hw/npu: Support PHB slotGavin Shan1-15/+42
This creates PCI slot before the PHB is registered. Nothing has been done in the PCI slot operations except to keep the PCI probe code going. 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>
2016-06-14hw/phb3: Support PHB slotGavin Shan2-423/+306
The patch refactors functions used for PHB slot management for PHB3. Also, PHB slots are created before platform's PHB setup hook (platform.pci_setup_phb()). That means the platforms can override the properties or methods of the PHB slot if necessary. 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>
2016-06-14hw/phb3: Remove useless commentsGavin Shan2-16/+0
This removes the useless comments as the I2C based power managment is covered by this series of patches and the left items in the FIXUP aren't needed any more. 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>
2016-06-14hw/p7ioc: Support PHB slotGavin Shan2-712/+470
This refactors functions used for PHB slot management for P7IOC. Also, PHB slots are created before platform's PHB setup hook (platform.pci_setup_phb()). That means the platforms can override the properties or methods of the PHB slot if necessary. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-14core/pci: Support PCI slotGavin Shan9-80/+992
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>
2016-06-14core/pci: Return value for struct phb_ops::device_initGavin Shan4-6/+23
This adds @data argument and "int" return value for struct phb_ops:: device_init() so that it can be called in pci_walk_dev() directly to reinitialize the PCI devices behind the specified slot in subsequent patches. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-14core/pci: Extend pci_restore_bridge_buses() for PCI slotGavin Shan4-5/+5
Currently, pci_restore_bridge_buses() restores the assigned bus ranges for all PCI bridges behind the specified PHB. This extends the function and allows doing same thing for the PCI bridges behind the specified slot. The extended functionality is going to be used by PCI hotplug logic in the subsequent patches. 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>
2016-06-14core/pci: Extend pci_walk_dev() for PCI slotGavin Shan3-6/+11
Currently, pci_walk_dev() iterates all PCI devices behind the specified PHB. This extends the function to allow iteration on PCI devices behind the specified PCI slot so that it can be used by PCI hotplug logic in the subsequent patches. 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>
2016-06-14core/pci: Fix wrong reserved PE# in enumerationGavin Shan5-3/+26
When scanning to non-existing PCI device, EEH (frozen) error is usually happening. We clear the unexpected frozen PE state after it. The reserved PE number is assumed to be 0 wrongly. So the frozen state on the reserved PE number isn't cleared properly. This introduces struct phb_ops::get_reserved_pe_number() to retrieve the reserved PE number from platforms. Then the EEH frozen state checking and clearing are applied to the reserved PE number. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-14core/cpu: Introduce DEBUG_SERIALIZE_CPU_JOBSGavin Shan1-0/+5
Currently, the PHB reset and PCI enumeration are done concurrently on multiple CPU cores. The output messages are interleaved and not readable enough. This adds a option to do the jobs in serialized fashion for debugging purpose only. The serialized mode should be always disabled in field. 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>
2016-06-14core/fdt: Introduce opal_get_device_tree()Gavin Shan3-1/+66
This introduces OPAL API opal_get_device_tree() to get the device sub-tree. It's going to be used in PCI hot add path. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-14core/fdt: Allow to exclude root nodeGavin Shan3-13/+20
The root node is excluded in the device sub-tree created during PCI hot add time. This adds one extra argument @exclusive to flatten_dt_node(), __create_dtb() and create_dtb() to indicate the root node should be excluded or not. The changes are going to be used by PCI hot add path and it's not affecting anything at present. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-14core/fdt: Introduce __create_dtb()Gavin Shan1-20/+24
There is shared logic to flatten the whole device tree (used when loading kernel) or device sub-tree (used by PCI hot add). This introduces helper function __create_dtb() for the shared logic. No functional changes introduced. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-14core/fdt: Allow to specify FDT blobGavin Shan1-20/+20
There is a static variable @fdt pointing the FDT blob. The memory block is allocated by skiboot. After the device tree is flattened, it's passed to kernel when it's loaded. It works fine. The FDT blob for device sub-tree because of PCI hot add is allocated by kernel, using a static @fdt to dereferencing the FDT blob isn't correct any more. This adds @fdt argument to various functions to specify the target FDT blob memory block. As a result, the file scoped static variable @fdt is removed. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-14core/fdt: Introduce flatten_dt_properties()Gavin Shan1-14/+13
We need unflatten the child nodes of the specified one during PCI hot add time. After it, the FDT blob is transferred to kernel and unflattened there. A device sub-tree is represented by the FDT blob and it excludes the specified (root) node. This introduces helper function flatten_dt_properties() to flatten the properties of the specified node. In the path to create the device sub-tree, the root's properties is skipped in subsequent patch. In the mean time, the node tag is created in flatten_dt_node() so that the function is self-contained. No functional changes introduced. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-14core/fdt: Improve debugging functionalityGavin Shan1-19/+20
This improves the debugging functionality in fdt.c. No functional changes introduced: * Replace printf() with prlog(). * Introduce FDT_DBG() which is enabled on DEBUG_FDT. * Move #ifdef before dump_fdt() for better extendability. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>