aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-01-27Merge skiboot-5.1.13 release notesStewart Smith1-0/+43
2016-01-27Add skiboot-5.1.13 release notesskiboot-5.1.13Stewart Smith1-0/+43
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-27Merge branch 'stable' - null merge of cherry-pickStewart Smith0-0/+0
2016-01-27hmi: Identify the phb upon CAPI malfunction alertPhilippe Bergheaud1-1/+3
commit 2e4cc4dca8c0d31138adc52076b38d80c5a6bef0 upstream Find the phb index with capp_phb3_attached_mask. Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21Merge branch 'stable'Stewart Smith6-642/+958
Merge device tree sorting
2016-01-21DT sorting testOliver O'Halloran5-46/+148
Moved the dt_dump() into test/dt_common.c so that it can be shared between hdata/test/hdata_to_dt.c and core/test/run-device.c run-device.c contains two tests, one basic sorting test and a generate-and-sort test. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> [stewart@linux.vnet.ibm.com: remove trailing whitespace] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21hdata/test: Updated the hdata_to_dt test data for the new sorting behaviourOliver O'Halloran1-8906/+8725
Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21core/device.c: Sort nodes with name@unit names by unitOliver O'Halloran1-4/+52
When unflattening (or building from hdat) a device tree child nodes are added in the order in which they are encountered. For nodes that have a <basename>@<unit> style name with a common basename it is useful to have them in the tree sorted by the unit in ascending order. Currently this requires the source data to present them in sorted order, but this isn't always the case. This patch modifies the node insertion process to insert new nodes in the correct location so the list of child nodes is sorted. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> [stewart@linux.vnet.ibm.com: remove trailing whitespace] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21hdata/hdata_to_dt.c: Also print node names.Oliver O'Halloran2-8648/+8995
Currently the hdata_to_dt script will only dump the node properties. This change adds a "node: <name>" line to the default output and adds the -t flag to only print the node names, without properties. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21Null merge cherry-picked dependencies for device tree sorting for stableStewart Smith0-0/+0
2016-01-21sparse: fix incorrect type warnings in hdata/fsp.cStewart Smith1-3/+3
commit 5c3e642911ed217bc476478694281a89fe8ef73c upstream No changes in resulting code as skiboot is BE, but does silence the sparse warnings. hdata/fsp.c:67:9: warning: incorrect type in initializer (different base types) hdata/fsp.c:67:9: expected unsigned int hdata/fsp.c:67:9: got restricted beint16_t const [usertype] hw_version hdata/fsp.c:68:9: warning: incorrect type in initializer (different base types) hdata/fsp.c:68:9: expected unsigned int hdata/fsp.c:68:9: got restricted beint16_t const [usertype] sw_version hdata/fsp.c:103:46: warning: incorrect type in argument 1 (different base types) hdata/fsp.c:103:46: expected unsigned int [unsigned] [usertype] proc_chip_id hdata/fsp.c:103:46: got restricted beint32_t const [usertype] proc_chip_id Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21sparse: fix missing beXX_to_cpu() conversions in hdata/fsp.cStewart Smith1-5/+5
commit 7c2f38eff810fd2a84707ae15994e3188cfac834 upstream hdata/fsp.c:55:20: warning: restricted beint16_t degrades to integer hdata/fsp.c:62:27: warning: restricted beint16_t degrades to integer hdata/fsp.c:85:27: warning: restricted beint16_t degrades to integer hdata/fsp.c:85:27: warning: restricted beint16_t degrades to integer hdata/fsp.c:100:9: warning: cast from restricted beint64_t hdata/fsp.c:144:27: warning: restricted beint16_t degrades to integer doesn't do anything currently as skiboot is BE Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21sparse: fix endian conversions in hdata/iohub.cStewart Smith1-7/+7
commit d6e3293cb1d794bf118aab334bb250ed12236956 upstream Since skiboot is all BE and hdat is BE, this changes nothing except for silencing the sparse warnings hdata/iohub.c:35:9: warning: incorrect type in initializer (different base types) hdata/iohub.c:35:9: expected unsigned int hdata/iohub.c:35:9: got restricted beint32_t const [usertype] buid_ext hdata/iohub.c:36:9: warning: incorrect type in argument 1 (different base types) hdata/iohub.c:36:9: expected unsigned int [unsigned] [usertype] proc_chip_id hdata/iohub.c:36:9: got restricted beint32_t const [usertype] proc_chip_id hdata/iohub.c:36:9: warning: incorrect type in argument 1 (different base types) hdata/iohub.c:36:9: expected unsigned int [unsigned] [usertype] proc_chip_id hdata/iohub.c:36:9: got restricted beint32_t const [usertype] proc_chip_id hdata/iohub.c:38:9: warning: incorrect type in initializer (different base types) hdata/iohub.c:38:9: expected unsigned int hdata/iohub.c:38:9: got restricted beint32_t const [usertype] gx_index hdata/iohub.c:39:9: warning: incorrect type in initializer (different base types) hdata/iohub.c:39:9: expected unsigned int hdata/iohub.c:39:9: got restricted beint32_t const [usertype] ec_level hdata/iohub.c:114:63: warning: incorrect type in argument 1 (different base types) hdata/iohub.c:114:63: expected unsigned short [unsigned] [usertype] slca_index hdata/iohub.c:114:63: got restricted beint16_t const [usertype] slca_index hdata/iohub.c:634:17: warning: incorrect type in argument 1 (different base types) hdata/iohub.c:634:17: expected restricted beint32_t [usertype] be_val hdata/iohub.c:634:17: got restricted beint16_t const [usertype] hub_num hdata/iohub.c:708:22: warning: incorrect type in assignment (different base types) hdata/iohub.c:708:22: expected unsigned int [unsigned] type hdata/iohub.c:708:22: got restricted beint32_t const [usertype] card_type Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21sparse: fix conversion of hdat slca_indexStewart Smith1-1/+1
commit 020a741ae22dd70a027918dbb738cb16fed3bb57 upstream No code changes as skiboot is BE. hdata/vpd.c:559:38: warning: incorrect type in argument 1 (different base types) hdata/vpd.c:559:38: expected unsigned short [unsigned] [usertype] slca_index hdata/vpd.c:559:38: got restricted beint16_t const [usertype] slca_index Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21sparse: fix beint32_t degrades to int in hdata/pcia.cStewart Smith1-1/+1
commit 54104305325788ec01695d4f58fb7379d8956a5d upstream hdata/pcia.c:32:37: warning: restricted beint32_t degrades to integer No resulting code change for skiboot as BE Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21Fix endian flip in printf for FSP in hdata/fsp.cStewart Smith2-3/+4
commit dfab2fb87c2d83e240a002e8829b525d10342df3 upstream Harmless for skiboot as we're BE. When building and running unit tests on LE though, we got an incorrect hw/software version for FSP hardware/software for hdata_to_dt test. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21Revive hdata_to_dt and make it work againStewart Smith2-18/+3
commit 27b49826e5f1d9c0008c0a5bf0953dd673a9b9e1 upstream Some functions were stubbed out which meant we hit assert rather than dumping out the device tree Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21Use VALGRIND callout rather than tricky malloc/memcpyStewart Smith1-3/+3
commit d04030556db4bb73151172ded3f279882e706dbd upstream The tricky memcpy trips up various static analysers and looks rather odd. The more correct thing to do is to ask valgrind to mark it as undefined. There's a call for that, and we depend on valgrind to run the test suite anyway, so we're not introducing a new dependency. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21Enable -Werror for -WformatStewart Smith6-16/+64
commit 56bc1890b229072513788992d1d29b6f173c13de upstream We create our own inttypes.h to get the correct printf formatting for 64bit numbers. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21Add hdata_to_dt testStewart Smith7-11/+8767
commit 6dc84bb65a3f51b97d2728a8fcdadacf8114293f upstream This adds ~1000 lines of code to the coverage-report. We manipulate the log levels of a few messages that contain pointers so that a basic diff of the hdata_to_dt output is possible. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21nvlink: Add primitive EEH support for NPU devicesRussell Currey1-3/+42
Implements Extended Error Handling callbacks for NVLink devices. At present, this supports fence mode emulation, and some easily detectable freezes. There is a lot of work still to be done here, but this enables EEH to work as expected in some specific scenarios. Signed-off-by: Russell Currey <ruscur@russell.cc> Acked-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21nvlink: Add freeze and fence error injectionRussell Currey2-1/+45
Enable NPU freeze and fence injection through debugfs. For example, if a NPU is PCI bus 8, a freeze on PE 1 can be injected with: echo 1:0:0:0:0 >> /sys/kernel/debug/powerpc/PCI0008/err_injct or a fence on PE 2 on PCI bus 9 with: echo 2:1:0:0:0 >> /sys/kernel/debug/powerpc/PCI0009/err_injct These will cause the appropriate EEH event to occur upon a DMA to the NVLink. PE number was added to the npu_dev struct to enable this. Signed-off-by: Russell Currey <ruscur@russell.cc> Acked-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21nvlink: Add fence mode emulation for NPUsRussell Currey2-2/+14
As NPUs are emulated PCI devices, they do not get physically fenced as real PCI devices do. As such, when the device is in a state that it should be fenced, we need to emulate this behaviour by returning all 1s in config space reads. This will be utilised by error injection in subsequent patches. Signed-off-by: Russell Currey <ruscur@russell.cc> Acked-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-21nvlink: Clear error registers at the end of the reset procedureRussell Currey1-0/+6
Once the NPU has been reset, it should no longer have any fixable errors. Clear any relevant error registers at the end of the reset procedure. There may be other error registers that should be cleared, if found they will be added later. Signed-off-by: Russell Currey <ruscur@russell.cc> Acked-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-15external: Add Makefile targets to install libflashSamuel Mendoza-Jonas2-0/+76
This adds a Makefile under external/shared to build libflash as a shared library and install it. This allows programs outside of the skiboot tree to link against libflash in order to access MTD devices (eg. Petitboot). Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-15Drop LDFLAGS from common/rules.mkCyril Bur1-1/+1
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-15external/opal-prd: Use libflash/blocklevel for MTD/file accessesCyril Bur5-198/+60
pnor.c existed before blocklevel, it is time that this code got updated to use the available libraries. Changes include using the blocklevel accessors for MTD reads and writes rather than read() and write() on a file descriptor. This patch also makes use of the arch_flash_init() auto detection of the /dev/mtd device which corresponds to the MTD device exposed by skiboot for access to platform flash. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-15travis: Add external/opal-prd build and testsCyril Bur1-0/+5
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-15external/opal-prd: Fix test_pnorCyril Bur2-1/+11
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-15libflash/blocklevel: Add keep_alive parameterCyril Bur11-37/+162
Currently the file backend will keep a file descriptor open until the structure is destroyed. This is undesirable for daemons and long running processes that only have a very occasional need to access the file. Keeping the file open requires users of blocklevel to close and reinit their structures every time, doing is isn't disastrous but can easily be managed at the interface level. This has been done at the blocklevel_device interface so as to provide minimal changes to arch_flash_init(). At the moment there isn't a need for the actually flash driver to be able to do this, this remains unimplmented there. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-15nvlink: Use SCOMs instead of MMIO in reset procedureRussell Currey1-9/+7
EEH in the kernel shuts down MMIO BARs as part of freeze recovery. This can cause the reset procedure, which you probably want to work during a freeze, to fail because it can't do operations with MMIO. Refactor the MMIO operations to use SCOM instead. Signed-off-by: Russell Currey <ruscur@russell.cc> Acked-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-15hmi: Identify the phb upon CAPI malfunction alertPhilippe Bergheaud1-1/+3
Find the phb index with capp_phb3_attached_mask. Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-15add a skiboot rpm spec fileCédric Le Goater1-0/+115
This spec file is based on : https://hegdevasant.fedorapeople.org/opal-prd/v4/opal-prd.spec in which a new 'opal-firmware' package was added. It contains a skiboot.lid and is generated as a noarch package. Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-15external/mambo: Load skiboot already offsetMichael Neuling1-2/+2
Load skiboot already offset at 768MB so that it doesn't need to relocate itself. This shaves about 1M instructions off boot time. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-15external/mambo: Fix indentation in mambo_tuils.tclMichael Neuling1-75/+75
No code change. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-15Merge branch 'stable'Stewart Smith0-0/+0
Merge stable version of 91cebdcd557dfc2dfc8050a34edb11a43facaf74
2016-01-15external/gard: Fix displaying 'cleared' gard recordsCyril Bur1-3/+33
When a garded component is replaced hostboot detects this and updates the gard partition. What hostboot does is set the record_id field to 0xFFFFFFFF but leaves the rest of the flash untouched, this has caused issues with the gard tool the thinking was that an entire record of all 0xFF bytes would signal not a valid record. This patch add rectifies this issue and `gard list` will no longer show any record with an id of 0xFFFFFFFF. Equivalent to 91cebdcd557dfc2dfc8050a34edb11a43facaf74 in master Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-15external/gard: Fix displaying 'cleared' gard recordsCyril Bur1-3/+33
When a garded component is replaced hostboot detects this and updates the gard partition. What hostboot does is set the record_id field to 0xFFFFFFFF but leaves the rest of the flash untouched, this has caused issues with the gard tool the thinking was that an entire record of all 0xFF bytes would signal not a valid record. This patch add rectifies this issue and `gard list` will no longer show any record with an id of 0xFFFFFFFF. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Sam Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-14Merge branch 'stable'Stewart Smith0-0/+0
Cherry pick of 28e66d034d73c7223e9261dc4dce6f33a6515553
2016-01-14firestone: fix spacing in slot nameJeremy Kerr1-1/+1
The other SlotN names have no space. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> [stewart@linux.vnet.ibm.com: Cherry-picked to stable] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-12libflash/libffs: Check for NULL and set return pointer in ffs_next_side()Cyril Bur1-0/+6
Currently there are two error cases that ffs_next_side() may hit and will leave the return pointer untouched. This isn't a huge problem as the caller should be checking the return value anyway but as we know, callers don't always do that. It doesn't hurt for ffs_next_side() to make it as clear as possible that it encountered a problem. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Sam Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-12libflash/libffs: Rename ffs_cmp() to ffs_equal()Cyril Bur2-2/+2
Some confusion has arisen from the first consumer of ffs_cmp() in that they expected a strcmp style less than one, zero or greater than one return value. This has been addressed in this patch in two ways, by changing the return type to a boolean in order to (attempt) to alert the programmer that this is not the case and by renaming it to equal to avoid the implied comparison and imply very much a boolean outcome. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Sam Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-12nvlink: Set a bit in config space to indicate a real PCI device was boundRussell Currey2-10/+36
The version was already set (somewhat obscurely), that has been refactored and the version incremented as per the following patch (which supercedes the previous): Signed-off-by: Russell Currey <ruscur@russell.cc> Acked-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-12Merge OPAL_CONSOLE_FLUSH from stableStewart Smith6-23/+59
2016-01-12Add OPAL_CONSOLE_FLUSH to the OPAL APIRussell Currey6-23/+59
uart consoles only flush output when polled. The Linux kernel calls these pollers frequently, except when in a panic state. As such, panic messages are not fully printed unless the system is configured to reboot after panic. This patch adds a new call to the OPAL API to flush the buffer. If the system has a uart console (i.e. BMC machines), it will incrementally flush the buffer, returning if there is more to be flushed or not. If the system has a different console, the function will have no effect. This will allow the Linux kernel to ensure that panic message have been fully printed out. The existing synchronous flushing mechanism used in OPAL's shutdown and reboot routines has been refactored into a helper that repeatedly calls the new partial flush function. Signed-off-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-08hw/bt: fix IPMI_GET_BT_CAPS definitionCédric Le Goater1-1/+1
Specified in IPMI docs: http://www.intel.com.au/content/dam/www/public/us/en/documents/product-briefs/ipmi-second-gen-interface-spec-v2-rev1-1.pdf page 587 under BMC Device and Messaging Command Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-08libffs: Add helper get ffs_handle to the "OTHER_SIDE"Cyril Bur2-3/+56
Some FFS structures will have a partition called "OTHER_SIDE", this is a pointer to another ffs TOC on which another ffs_handle can be instantiated. Currently users of libffs would have to query for the presence of this partition and then initialise a new ffs_handle themselves. As accessing the "other" side appears to be becoming a common operation this convenience function should prove useful. Furthermore, it is possible for these multiTOC flash chips to be circular, that is the "OTHER_SIDE" partition of 'secondary' TOC points back to the initial TOC. The solution is to add a comparison function capable of detecting when repeated calls to ffs_next_side() go full circle. It should be noted here that this is all the comparator function is designed to detect, it will not be able to detect two identical TOCs opened with different blocklevel_devices as this would require the ability to compare blocklevel_devices. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-08libffs: Remove unused function ffs_open_image()Cyril Bur2-88/+0
The utility of this function has been superceeded by blocklevel code and is no longer called from anywhere, it can be removed. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-08external/opal-prd: Drop final use of ffs_open_image()Cyril Bur1-1/+9
ffs_open_image() is only called from one place and its function has been superseded by the blocklevel_device interface to access files/mtd/flash. Ultimately it looks like opal-prd should be converted to use the full set of features provided by blocklevel but for now this patch allows code to be ripped out of libffs. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-01-08libffs: Remove struct flash_chip from struct ffs_handleCyril Bur1-4/+0
Simply isn't used anymore since libffs knows how to use the blocklevel interface. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>