aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-11-12skiboot v6.0.12 release notesv6.0.12Stewart Smith1-0/+24
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-09hiomap: quieten warning on failing to move a windowStewart Smith1-1/+1
[ Upstream commit 606a5a3d44e3271e5177bb925d043c8ce48cdaa3 ] This isn't *necessarily* an error that we should complain loudly about. If, for example, the BMC enforces the Read Only flag on a FFS partition, opening a write window *should* fail, and we do indeed test this in op-test. Thus we deal with the error in a well known path: returning an error code and then it's eventually a userspace problem. Signed-off-by: Stewart Smith <stewart@linux.ibm.com> Reviewed-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-09libflash/ipmi-hiomap: Respect daemon presence and flash controlAndrew Jeffery2-1/+326
[ Upstream commit d49bfeea7bf274efe2b8a3b0840181ec35ba60ca ] Fix the fix of ORing in the BMC state - we only want to retain state covered by the ack mask as this is something we still need to handle. Critically, we must not retain state not covered by the ack mask as this may lead to host firmware attempting to communicate with a dead daemon or attempting to access the PNOR whilst the daemon is not in control of the flash. Further, add unit tests to capture the desired (and now implemented) behaviour. Fixes: 34cffed2ccf3 ("libflash/ipmi-hiomap: Improve event handling") Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-09libflash/ipmi-hiomap: Add support for unit testsAndrew Jeffery6-31/+374
[ Upstream commit 1151a987ae4579a8c51bba7ebc61c79c176830bd ] Lay the ground work for unit testing the ipmi-hiomap implementation. The design hooks a subset of the IPMI interface to move through a data-driven "scenario" of IPMI message exchanges. Two basic tests are added exercising the initialsation path of the protocol implementation. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-09libflash/ipmi-hiomap: Fix argument type warning on x86-64Andrew Jeffery1-1/+1
[ Upstream commit 97f839beffb512faebc456dff67a4d83353348ed ] libflash/ipmi-hiomap.c: In function ‘hiomap_window_move’: libflash/ipmi-hiomap.c:17:21: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Werror=format=] #define pr_fmt(fmt) "HIOMAP: " fmt ^~~~~~~~~~ include/skiboot.h:93:41: note: in expansion of macro ‘pr_fmt’ #define prlog(l, f, ...) do { _prlog(l, pr_fmt(f), ##__VA_ARGS__); } while(0) ^~~~~~ include/skiboot.h:94:30: note: in expansion of macro ‘prlog’ #define prerror(fmt...) do { prlog(PR_ERR, fmt); } while(0) ^~~~~ libflash/ipmi-hiomap.c:291:3: note: in expansion of macro ‘prerror’ prerror("Invalid window properties: len: %llu, size: %llu\n", ^~~~~~~ libflash/ipmi-hiomap.c:291:47: note: format string is defined here prerror("Invalid window properties: len: %llu, size: %llu\n", ~~~^ %lu Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-09libflash/test: Rewrite Makefile.check to improve scalabilityAndrew Jeffery1-26/+137
[ Upstream commit f58be461091fee87e0d175b1a99f697b339fb9eb ] The current implementation makes it hard to expand the list of tests if we want to build anything that doesn't link to mbox-server. This is a consequence of embedding the $(LIBFLASH_TEST_EXTRA) variable inside the recipes for building test executables, which makes the makefile a bit of a maze to navigate. To address this we could go the route of duplicating the $(LIBFLASH_TEST), $(LIBFLASH_TEST_EXTRA) and the corresponding make directives (targets/prerequisites/recipes) each time we want to link a binary against a new set of objects, but that seems ham-fisted. Further, $(LIBFLASH_TEST_EXTRA) is defined in terms of the relevant object (.o) files, but the recipes it is used in otherwise use source (.c) paths for compilation. These other paths are typically to non-test code that needs to be compiled into the test executable, but we can't use object files at the usual path because we will typically have a conflict of architectures (PPC64 for the skiboot object, x86_64 for the test object). This in turn means that we will compile source files multiple times (once for each test binary it is required in) rather than re-using an existing object file. Further, the current structure of the Makefile requires we #include the .c file under test directly into the test source if we want it in a specific test case due to the relationship of the prerequisites to the build (only the first source prerequisite is included in the build). The include-the-c-file approach can have some annoying side-effects with respect to macros, typically errors regarding redefinition. While it is useful for testing static functions in the source under test, it would be nice if this approach was optional rather than required. This change attempts to address all of these issues. The outcome is we have precise control of which objects get linked into each test binary, we avoid the architecture clash problem, we re-use existing compiled objects (avoiding recompilation), and we make the include-the-c-file approach optional. The general approach is to generate a new directory hierarchy of object files under a `$(HOSTCC) -dumpmachine` directory in the repository root and use these for linking the test cases. Objects that land in this segregated tree are described by a _SOURCES variable for each test, similar in structure and behaviour to automake's _SOURCES variables. Again similar to automake, a check_PROGRAMS variable is used that describes the path of each test binary to be built. The test binary paths are mapped to the corresponding _SOURCES variable by some secondary-evaluation wizardry that no-one has to pay any attention to once it is written. Whilst the implementation is perhaps slightly tricky, it allows us to avoid the recipe headache of unconditionally linking in objects defined in variables that don't directly participate in the target's prerequisites, and so prevents the explosion of variables as we implement tests that require disjoint sets of dependencies. This is initially intended as an isolated experiment with the libflash test makefile, but it's feasible that the scope of the concept could be expanded to other test Makefiles. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-09libflash: fix gcov buildStewart Smith1-1/+1
[ Upstream commit a5a32e86f3e2be67da9a89333e1bb18b34145ac1 ] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-02skiboot 6.0.11 release notesv6.0.11Stewart Smith1-0/+57
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-02phb4/capp: Only reset FIR bits that cause capp machine checkVaibhav Jain2-0/+18
[ Upstream commit 999246716d2da347aad46a28ed9899b832bffe6c ] During CAPP recovery do_capp_recovery_scoms() will reset the CAPP Fir register just after CAPP recovery is completed. This has an unintentional side effect of preventing PRD from analyzing and reporting this error. If PRD tries to read the CAPP FIR after opal has already reset it, then it logs a critical error complaining "No active error bits found". To prevent this from happening we update do_capp_recovery_scoms() to only reset fir bits that cause CAPP machine check (local xstop). This is done by reading the CAPP Fir Action0/1 & Mask registers and generating a mask which is then written on CAPP_FIR_CLEAR register. Cc: stable Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-02phb4: Check for RX errors after link trainingOliver O'Halloran3-3/+30
[ Upstream commit 9597a12ef4b3644e4b8644f659bec04ca139b7f9 ] Some PHB4 PHYs can get stuck in a bad state where they are constantly retraining the link. This happens transparently to skiboot and Linux but will causes PCIe to be slow. Resetting the PHB4 clears the problem. We can detect this case by looking at the RX errors count where we check for link stability. This patch does this by modifying the link optimal code to check for RX errors. If errors are occurring we retrain the link irrespective of the chip rev or card. Normally when this problem occurs, the RX error count is maxed out at 255. When there is no problem, the count is 0. We chose 8 as the max rx errors value to give us some margin for a few errors. There is also a knob that can be used to set the error threshold for when we should retrain the link. ie nvram -p ibm,skiboot --update-config phb-rx-err-max=8 Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-02core/flash: Log return code when ffs_init() failsAndrew Jeffery1-1/+1
[ Upstream commit cee7ec9eae090e3e9ca6b8f07f40a9ae8164ecab ] Knowing the return code is at least better than not knowing the return code. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-02libflash/ipmi-hiomap: Use error codes rather than abort()Andrew Jeffery1-6/+10
[ Upstream commit dbdfb0e2ea3c503397c3c51409842d53c044dd3e ] Admittedly the situations are pretty dire, and usually indicate a programming failure on the BMC's part, but abort() seems a bit over the top. The technique was useful for development but shouldn't have made it into production. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-02libflash/ipmi-hiomap: Restore window state on window/protocol resetAndrew Jeffery1-3/+39
[ Upstream commit f47fbc97d421231cecff806a3d0bfcd1a27f4a66 ] The initial implementation of ipmi-hiomap left a bit to be desired when it came to event handling: it didn't completely restore the state of the system to what it was before events like a hiomap protocol or window reset take place. The result is the host cannot recover from e.g. the BMC being rebooted underneath it. Take the only step required in the event of window reset, or the final step after performing the handshake in the event of a protocol reset, and re-open the previously active window if there was one. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-02libflash/ipmi-hiomap: Improve event handlingAndrew Jeffery1-4/+3
[ Upstream commit 34cffed2ccf3971b73b27245d2d11c135f67bcd8 ] The host firmware side of the hiomap protocol has two input sources: 1. Requests to adjust the flash mappings from itself or the kernel 2. State change events received from the BMC The handling of BMC state change events (2.) is asynchronous in two ways: a. The BMC pushes the state change event to the host, which is recorded but not acted on b. When handling requests to adjust the flash mapping, skiboot first addresses any new BMC state changes before servicing the mapping request Further, the hiomap protocol sends a mix of ackable and stateful events, where ackable events are only relevant until skiboot's hiomap event handler (b. above) cleans them up, whereas stateful events persist until the BMC provides a subsequent state change event. As we handle the ackable events asynchronous to receiving notification (b. vs a. above), OR in the received event state rather than directly assign to ensure we don't lose events that we must not miss. As an example, without the OR we may lose ackable events if the daemon restarts and pushes a new state change event during initialisation, which will necessarily bear no relation to the previous state change event value. Similarly, don't close active windows in a. based on the event content, as we need the window type information to handle state restoration in b. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-02p9dsu: Describe platform BMC register configurationAndrew Jeffery1-1/+9
[ Upstream commit a6131d3a215de6f6daa48d0f5141fd8964d8586e ] Provide the p9dsu-specific BMC configuration values required for the host kernel to drive the VGA display correctly. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-02p9dsu: Add HIOMAP-over-IPMI supportAndrew Jeffery1-0/+1
[ Upstream commit a07f8bb329f744141e5b2257cc3cff8391f03cf7 ] Boston uses the same netfn / command values as OpenBMC. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-11-02libflash/ipmi-hiomap: Cleanup allocation on init failureAndrew Jeffery1-4/+12
[ Upstream commit f271f0263475776f78f403493d7ab6ccfbe5bfc2 ] Previously we were leaking the memory pointed by ctx if an IPMI error occurred during protocol initialisation. Make sure we free the memory if an error occurs. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31opal-ci: qemu: Use the powernv-3.0 branchv6.0.10Joel Stanley1-1/+1
[ Upstream commit 5235791bbc66f1d14919f588ae24fbbbda2a0a2e ] This is based off the current development version of Qemu, and importantly it contains the patch that allows skiboot and Linux to clear the PCR that we require to boot. Signed-off-by: Joel Stanley <joel@jms.id.au> [stewart: use the open-power/qemu.git tree for prosterity] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31skiboot v6.0.10 release notesStewart Smith1-0/+81
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31Run pollers in time_wait() when not bootingStewart Smith1-2/+1
[ Upstream commit d10862e40cd8ef36fe49b298f3c615ac73dd3c4e ] This only bit us hard with hiomap in one scenario. Our OPAL API has been OPAL_POLL_EVENTS may be needed to make forward progress on ongoing operations, and the internal to skiboot API has been that time_wait() of a suitable time will run pollers (on at least one CPU) to help ensure forward progress can be made. In a perfect world, interrupts are used but they may a) be disabled, or b) the thing we're doing can't use interrupts because computers are generally terrible. Back in 3db397ea5892a (circa 2015), we changed skiboot so that we'd run pollers only on the boot CPU, and not if we held any locks. This was to reduce the chance of programming code that could deadlock, as well as to ensure that we didn't just thrash all the cachelines for running pollers all over a large system during boot, or hard spin on the same locks on all secondary CPUs. The problem arises if the OS we're booting makes an OPAL call early on, with interrupts disabled, that requires a poller to run to make forward progress. An example of this would be OPAL_WRITE_NVRAM early in Linux boot (where Linux sets up the partitions it wants) - something that occurs iff we've had to reformat NVRAM this boot (i.e. first boot or corrupted NVRAM). The hiomap implementation should arguably *not* rely on synchronous IPMI messages, but this is a future improvement (as was for mbox before it). The mbox-flash code solved this problem by spinning on check_timers(). More generically though, the approach of running the pollers when no longer booting means we behave more in line with what the API is meant to be, rather than have this odd case of "time_wait() for a condition that could also be tripped by an interrupt works fine unless the OS is up and running but hasn't set interrupts up yet". Fixes: 529bdca0bc546a7ae3ecbd2c3134b7260072d8b0 Fixes: 3db397ea5892a8b348cf412739996731884561b3 Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31hiomap: fix missing newline at end of 'Flushing writes' prlog()Stewart Smith1-1/+1
[ Upstream commit 8d58ee17ea20d43db5bb47b1533bc5faf396b46a ] Fixes: 529bdca0bc546a7ae3ecbd2c3134b7260072d8b0 Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31hiomap: free ipmi message in callbackStewart Smith1-0/+3
[ Upstream commit b6de35b6896a7d21a72be79e720eeae2dc620fa2 ] Otherwise we'd slowly leak memory on each hiomap operation. Fixes: 529bdca0bc546a7ae3ecbd2c3134b7260072d8b0 Tested-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31Recognise signed VERSION partitionSamuel Mendoza-Jonas4-10/+17
[ Upstream commit 3cd749c99791d43ee929b9401fb14fc6739ce360 ] A few things need to change to support a signed VERSION partition: - A signed VERSION partition will be 4K + SECURE_BOOT_HEADERS_SIZE (4K). - The VERSION partition needs to be loaded after secure/trusted boot is set up, and therefore after nvram_init(). - Added to the trustedboot resources array. This also moves the ipmi_dt_add_bmc_info() call to after flash_dt_add_fw_version() since it adds info to ibm,firmware-versions. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31hdata/i2c: Skip unknown device typeVasant Hegde1-5/+7
commit c94b5a9e9c32724cba92e78073f6e3c334a0ad43 upstream. Do not add unknown I2C devices to device tree. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31hdata/i2c: Make SPD workaround more workaroundyOliver O'Halloran1-3/+8
commit f88e3724846346efd66cc423ea7a96972592cd28 upstream. We have a hack in the I2C device parser to fix up entries generated by hostboot for the DIMM SPD devices. For some reason they get reported as 128Kbit EEPROMs which is bad since those have a different I2C interface to an actual SPD device. Oddly enough, the FSP also gets this wrong in a slightly different way. In the FSP case they are reported as a at24c04 (4Kbit) EEPROM, which also has a different I2C interface. To fix both these problems for any eeprom we find on that bus to have the compatible string of "spd". Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31hdata/i2c: Add whitelisting for Host I2C devicesOliver O'Halloran1-31/+37
commit dfaf471eb1a7fdb77b6beaa83ae00955e96cd2dd upstream. Many of the devices that we get information about through HDAT are for use by firmware rather than the host operating system. This patch adds a boolean flag to hdat_i2c_info structure that indicates whether devices with a given purpose should be reserved for use inside of OPAL (or some other firmware component, such as the OCC). Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31Actually add /ibm,opal/fast-reboot propertyStewart Smith1-0/+11
[ Upstream commit aeb366970e0c48871dd2d880665c0d64961a524f ] I missed a hunk when merging :( Reported-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Fixes: 7c8e1c6f89f3aac77661cfcee75ab515bd053d75 Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31Add fast-reboot property to /ibm,opal DT nodeStewart Smith3-0/+13
[ Upstream commit 7c8e1c6f89f3aac77661cfcee75ab515bd053d75 ] this means that if it's permanently disabled on boot, the test suite can pick that up and not try a fast reboot test. Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31Quieten 'warnings' now that SIO is disabledStewart Smith2-3/+11
[ Upstream commit 3057d8d69a298d668692107fe55b13afea03112c ] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31lpc: Clear sync no-response field prior to device probeAndrew Jeffery1-1/+6
[ Upstream commit 7194e92cc700bfcc6f12f5fc12da06ef936bd2b8 ] Artem Senichev reported[1] his P8 platform was failing to boot from a43e9a66aae9 ("astbmc: Fail SFC init if SIO is unavailable") with the following error: [ 110.097168975,3] PLAT: Failed to open PNOR flash controller I reproduced this behaviour on a Palmetto; we need to ensure the state of the no-response error bit is clear before proceding with the presence test. The fix appears to resolve the failure to open the PNOR flash controller on Palmetto and doesn't change the expected behaviour on Witherspoon. [1] https://github.com/open-power/skiboot/issues/197 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Tested-by: Artem Senichev <a.senichev@yadro.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31astbmc: Fail SFC init if SIO is unavailableAndrew Jeffery1-0/+3
[ Upstream commit a43e9a66aae9812f8790c4a9290989bb0774d2a6 ] If SuperIO is unavailable then the driver cannot perform accesses on which it currently depends. Test for SuperIO availability during initialsation and bail out immediately if it is absent. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31platform: Restructure bmc_platform typeAndrew Jeffery19-49/+135
[ Upstream commit 9a830ee06c66058b1421c017b25a65a22921e9f6 ] Segregate the BMC platform configuration into hardware and software components. This allows population of platform default values for hardware configuration that may no-longer be accessible by the host. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> [stewart: fixup pci-quirk unit test] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31astbmc: Use LPC probe calls to determine SIO presenceAndrew Jeffery1-20/+10
[ Upstream commit dd554bacd13c6dea481ea4e1ec9f3c32087295d9 ] Avoid the probabilistic approach and use a deterministic one instead. The probe calls use a slow, synchronous method to capture the the state of the target device, so it is used sparingly (only on first access). Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31lpc: Introduce generic probe capabilityAndrew Jeffery2-58/+156
[ Upstream commit 5684204c2d0b470de72eff563c9e0172bbdbcb18 ] Introduce generic read and write probe functions that allow detection of valid addresses by way of synchronous testing for the SYNC no-response state. If the no-response state is detected the probe functions will return an error to the caller, who can do with it what they wish. In the process, rip out the naive mechanism for muting the equivalent asynchronous error logging (regretfully introduced recently by yours truly). Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31astbmc: Remove coordinated isolation supportAndrew Jeffery3-93/+6
[ Upstream commit 1a1ff0ab2c78f9257bb77301191df38242d11f0d ] Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31astbmc: Prefer ipmi-hiomap for PNOR accessAndrew Jeffery6-19/+57
[ Upstream commit b5edb1692b7f6af1a60758f4f63f52f795b5dba0 ] If the IPMI command is not available, fall back to the mailbox interface. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> [stewart: fix up mbox test] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31libflash: Add ipmi-hiomapAndrew Jeffery7-18/+972
[ Upstream commit 35c955970af6c90429a558470c779d158ce54ea9 ] ipmi-hiomap implements the PNOR access control protocol formerly known as "the mbox protocol" but uses IPMI instead of the AST LPC mailbox as a transport. As there is no-longer any mailbox involved in this alternate implementation the old protocol name is quite misleading, and so it has been renamed to "the hiomap protoocol" (Host I/O Mapping protocol). The same commands and events are used though this client-side implementation assumes v2 of the protocol is supported by the BMC. The code is a heavily-reworked copy of the mbox-flash source and is introduced this way to allow for the mbox implementation's eventual removal. mbox-flash should in theory be renamed to mbox-hiomap for consistency, but as it is on life-support effective immediately we may as well just remove it entirely when the time is right. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> [stewart: prlog debug over prerror for mbox fallback, fix indent] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31core/flash: Unlock around blocklevel calls in NVRAM accessorsAndrew Jeffery1-0/+11
[ Upstream commit c0b84547521da5be92eea9e4bef60a1971cca283 ] This ensures progress when we don't have interrupts available for IPMI. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31core/flash: Only lock around flashes update in flash_register()Andrew Jeffery1-6/+2
[ Upstream commit 3aa5394f4da1ae9c95ab2d061d28b4db8298de20 ] Previously in flash_register() held flash_lock across ffs_init(), which calls through the blocklevel layer to read the flash. This is unhelpful with the IPMI HIOMAP protocol transport as LPC interrupts have not yet been enabled and we are relying on polling to progress. The held lock stalls the boot as we take the nopoll path in time_wait() while completing ipmi_queue_msg_sync() in libflash/ipmi-flash.c Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31core/lock: Use try_lock_caller() in lock_caller() to capture ownerAndrew Jeffery1-1/+1
[ Upstream commit 88579eba5fdebb2b2c65f3bc9fb1a3a7abbaf12f ] Otherwise we can get reports of core/lock.c owning the lock, which is not helpful when tracking down ownership issues. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31ipmi: Introduce registration for SEL command handlersAndrew Jeffery2-29/+94
[ Upstream commit d4048420962097ce5b46167b2715b458142d394f ] Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31lpc: Silence LPC SYNC no-response error when necessaryAndrew Jeffery5-28/+72
[ Upstream commit 1d8793c64b596cfdcc3cf6035a3b4cbe3c341ae9 ] Add the ability to silence particular errors from the LPC bus when they can be expected, particularly: LPC[000]: Got SYNC no-response error. Error address reg: 0xd001002f This is necessary on platform exit on some astbmc machines to avoid unnecessary noise in the msglog. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31ast-io: Rework setup/tear-down of communication with the BMCAndrew Jeffery6-28/+172
[ Upstream commit ebc8524a3a457f73083d984296bfd797940a711c ] It's possible for the platform to configure the BMC with SuperIO access disabled. Rework the interfaces to report failures if SuperIO is not enabled, and clean up once we're finished. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31ast-bmc: Rename LPC FW cycle helpersAndrew Jeffery3-6/+6
[ Upstream commit 8972e44f97883e5aabf4b9c6737dcf3b22fd24b8 ] Introduce some consistency for readability and make the names better reflect the nature of the tests. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31core/pci-quirk: Clean up commented code in quirk_astbmc_vga()Andrew Jeffery1-13/+0
[ Upstream commit 7a5af6da49b9da76c90cc76f020175dbf6fcfe6e ] Also remove the comment associated with the commented code. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31core/pci-quirk: Remove broken comment in quirk_astbmc_vga()Andrew Jeffery1-15/+0
[ Upstream commit 467b00fdfd67add51bc54a62c7c70d14a9925717 ] The comment talks about one mechanism to handle the quirk whilst the code uses another. Avoid confusion by removing the comment. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-31Fixup pflash build for ast refactorStewart Smith2-2/+13
[ Upstream commit f651e8eb56e2c17aeac58fd50c20f874d874169c ] Fixes: 5b1bc2ffe791ae94361d86b2ae063ee543bf2df5 Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-24ast-bmc: Move copy routines to ast-sf-ctrlAndrew Jeffery3-100/+94
[ Upstream commit 5b1bc2ffe791ae94361d86b2ae063ee543bf2df5 ] The only user was hw/ast-bmc/ast-sf-ctrl.c, and for accessing flash the copy routines require knowledge of the PNOR LPC offset. For systems using MBOX the ast-sf-ctrl implementation is unused, so move the offset initialisation out of the common code-path and the copy routines to the place where they are necessary. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-24astbmc: Enable mbox depending on scratch regJoel Stanley3-2/+18
[ Upstream commit b09e48ffcdbffca97f7f6ebc2135a9e82dc5d9e9 ] P8 boxes can opt in for mbox pnor support if they set the scratch register bit to indicate it is supported. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-10-24hdata/spira.c: fix iplparams feature name string handlingStewart Smith1-1/+3
[ Upstream commit 44d0f8638bc1d35baccd59a154298fef0fb51775 ] Fixes this gcc8 warning: hdata/test/../spira.c: In function ‘add_iplparams_features’: hdata/test/../spira.c:1209:38: error: argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess] strncpy(name, feature->name, sizeof(feature->name)); ^ Signed-off-by: Stewart Smith <stewart@linux.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>