summaryrefslogtreecommitdiffstats
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
...
* | flash: fix return value of flash_find_subpartition()Cédric Le Goater2015-03-051-1/+1
| | | | | | | | | | | | | | | | | | sparse spotted the problem : core/flash.c:379:22: warning: odd constant _Bool cast (fffffffffffffff6 becomes 1) Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | core/test: Test compatible, chip id and phandle related DT functionsDaniel Axtens2015-03-051-0/+56
| | | | | | | | | | Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | core/test: Test more get/set functions in device.cDaniel Axtens2015-03-051-0/+70
| | | | | | | | | | Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | core/test: Use "" as the name of the device tree root node.Daniel Axtens2015-03-051-11/+11
| | | | | | | | | | | | | | | | | | | | | | The device tree tests use "root" as the name of the root node. That leads to weird discrepancies between the reported path and the dt_find_by_path path. The empty string is already used as the root name in dt_expand. Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | core/test: Test that device paths/names function as expected.Daniel Axtens2015-03-051-4/+61
|/ | | | | | | Test dt_get_path/dt_find_by_name/dt_find_by_path all respond as expected. Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/flash: Rename KERNEL to BOOTKERNELJoel Stanley2015-03-041-1/+1
| | | | | | | | | BOOTKERNEL is now the name for the PNOR petition that will contain the separate kernel, so that users do not confuse the bootloader kernel with the final OS kernel. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/flash: Don't clobber rc in error pathJoel Stanley2015-03-041-1/+1
| | | | | | | | | When checking paramters for errors we set rc, but then simply return OPAL_HARDWARE in the error path. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/flash: Remove alignment and size restrictionsJoel Stanley2015-03-041-8/+5
| | | | | | | | | libflash is able to perform reads and writes across page boundaries, so this restriction is not required. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/flash: add /chosen/ibm, system-flash property to indicate system PNORJeremy Kerr2015-03-041-8/+33
| | | | | | | | | | | | | This change adds a property in /chosen: /chosen/ibm,system-flash Containing the path to the system flash device. We move the system-flash-specific setup to a new function to contain it in the one place. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core: Move hservices_init to platform codeJeremy Kerr2015-03-041-4/+0
| | | | | | | | | | We don't want to call hservices_init on machines that use the PRD, as they expect to relocate the hbrt code later. This change moves the hservices_init call out of the common path, and into the firenze platform init. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* sparse: fix Using plain integer as NULL pointer warningCédric Le Goater2015-02-262-2/+2
| | | | | Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* sparse: hmi_lock can be staticCédric Le Goater2015-02-261-1/+1
| | | | | Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* sparse: hbrt_memcons can be staticCédric Le Goater2015-02-261-1/+1
| | | | | Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* sparse: declare platform as externCédric Le Goater2015-02-261-0/+2
| | | | | Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* sparse: fix fonction declarationsCédric Le Goater2015-02-262-4/+4
| | | | | Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* libflash: move ffs_flash_read into libflashJeremy Kerr2015-02-261-3/+3
| | | | | | | | | | | We have ffs_flash_read to do optionally-ecc-ed reads of flash data. However, this isn't really related to the ffs partitioning. This change moves ffs_flash_read into libflash.c, named flash_read_corrected. The function itself isn't changed. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* capi: Add CAPI microcode read to load_resource()Michael Neuling2015-02-231-0/+1
| | | | | | | | | | | | | Add ability to read CAPI microcode to load_resource() implementations. We use the cfam chipid as the subid. FSP load_resource() contains a map of cfam chipid to lid numbers. PNOR load_resource() doesn't change, but requires a properly formatted partition with EC values in the TOC matching the appropriate cfam chipid. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* flash: Add ECC to load_resource()Michael Neuling2015-02-231-15/+52
| | | | | | | | | Add decoding, checking and correction of ECC enabled partitions in pnor_load_resource(). Signed-off-by: Michael Neuling <mikey@neuling.org> Reviewed-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* libffs: Add ecc parameter on ffs_part_info()Michael Neuling2015-02-231-3/+3
| | | | | | | | Add ecc parmenter to ffs_part_info() to indicate if the partition is ECC protected or not. Fix all call sites. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* flash: Fix bugs for sub-partitions in flash_load_resource()Michael Neuling2015-02-231-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | In the recent change: commit 73b262e768529f152ec64b4418b0c31691bc15c3 Author: Jeremy Kerr <jk@ozlabs.org> core/flash: port pnor_load_resource to flash code Some code was moved around, but it was modified introducing a number of bugs. Firstly the size check was moved to before the sub-partition determination. This is incorrect as the size check is against the sub-partition not the full partition. Secondly, it introduced a return in the error path for sub-partitions. This should be a goto to ensure the correct cleanup code is run. Thirdly, subid is now set in the name lookup loop where it shouldn't be. Fourthly, a check on the subid was removed unnecessarily. Signed-off-by: Michael Neuling <mikey@neuling.org> Brown-paper-bag-acked-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* flash: Add newlines on printsMichael Neuling2015-02-231-6/+6
| | | | | | | These were added in a8513d3f3e but I forgot the \n. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hostservices/fsp: Move lid caching to platformAnanth N Mavinakayanahalli2015-02-231-3/+0
| | | | | | | | Move lid caching from skiboot init to platform initialization code, just after the OPL sequence. Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* OCC/hostservices: Queue pre-preload HBRT lid load requestsAnanth N Mavinakayanahalli2015-02-231-0/+10
| | | | | | | | | There is no guarantee that a hostservices lid load request will arrive after we have cached the required lids. For such cases, queue the request and service them after caching. Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hostservices: Fix lid loadAnanth N Mavinakayanahalli2015-02-231-2/+3
| | | | | | | Fix the loop iterator to not miss a lid Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* ipmi: Fix locking for synchronous message sendingAlistair Popple2015-02-191-5/+3
| | | | | | | | | | | | Skiboot now doesn't run the running pollers while holding a lock to avoid dead-locks. The current implementation of ipmi_queue_msg_sync() does exactly that while it waits for the pollers to be called. This patch fixes the problem by releasing the lock prior to calling the pollers. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/flash: Move flash NVRAM handling to new flash moduleJeremy Kerr2015-02-193-80/+105
| | | | | | | | | | | | | | | | | | Since we want to prevent conflicts between PNOR and NVRAM, this change moves the flash-nvram handling out of flash-nvram.c and into the generic flash module. This way, the OPAL_FLASH_{READ,WRITE,ERASE} API won't conflict with the OPAL_*_NVRAM api. To do this, we use the flash_register function to look for an "NVRAM" partition. If one is found, it is automatically registered as the system NVRAM backend. We also change the rhesus and astmbc platforms to use the common flash code. 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>
* core/flash: port pnor_load_resource to flash codeJeremy Kerr2015-02-191-0/+186
| | | | | | | | | Since we have a flash device registered as the system flash, use this as a generic load_resource backend. 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>
* core/flash: Add flash APIJeremy Kerr2015-02-192-1/+226
| | | | | | | | | | | | | | | | | | | We'd like to enable access to the system PNOR, on platforms where its present. This change introduces an API for global flash operations: opal_flash_read opal_flash_erase opal_flash_write - plus device-tree bindings to expose the flash details. Since there are other components of the system that use the PNOR (NVRAM and pnor_load_resource), upcoming changes will port this these over to use the new interface. 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>
* Limit number of warnings of pollers run with lock heldStewart Smith2015-02-181-1/+6
| | | | | | | | Otherwise we pretty much spin in printing backtraces on some machines. A limit of 64 per boot is likely to give us enough bugs to fix. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* pci: Remove pci_lockBenjamin Herrenschmidt2015-02-181-12/+2
| | | | | | | | It only protects actions that are done at boot time in a non-concurrent way anyway. The only useful locking is in the PHB code itself Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* pci: Don't hang if we have only one CPUBenjamin Herrenschmidt2015-02-181-0/+9
| | | | | | | | The job dispatch code would spin forever trying to find a target CPU on a machine with only one available Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Replace is_mambo_chip with a better chip quirk mechanismBenjamin Herrenschmidt2015-02-182-5/+13
| | | | | | | And add some basic qemu quirks Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* cpu: Don't hold lock while waitingBenjamin Herrenschmidt2015-02-181-3/+7
| | | | | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Don't run pollers in time_wait() when a lock is heldBenjamin Herrenschmidt2015-02-181-1/+9
| | | | | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Warn when pollers are called with a lock heldBenjamin Herrenschmidt2015-02-181-0/+5
| | | | | | | So we can start fixing those cases Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* lock: Add lock depth recording per CPUBenjamin Herrenschmidt2015-02-181-0/+5
| | | | | | | | | We want to move to pollers being run inly when no lock is held so let's start recording lock depth. It will also be a useful debugging tool. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Always create opal-interrupts propertyBenjamin Herrenschmidt2015-02-181-3/+5
| | | | | | | | | | Even if empty. The existing Linux code doesn't properly NULL check the result of of_get_property() and will allocate an array of an undefined size if the property is missing, while an empty property is harmless. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hostservices: Cache lids prior to first load requestAnanth N Mavinakayanahalli2015-02-182-32/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... to prevent any potential poller recursions during lid load. With this change: ... [10810950484,5] CUPD: P side ML Keyword = FW830.00 [10832756491,6] HBRT: 1 lids to load [10832762732,7] FSP: Fetch data id: 05 sid: 81e00430 to 0x306cf500(0x100000 bytes) [10832766825,7] FSP: 0x00100000 bytes balign=306cf000 boff=500 bsize=101000 [10857829395,5] CUPD: Marker LID id : size : status = 0x80a08001 : 0x5d0 : 0x0 [10966464432,7] FSP: -> rc=0x00 off: 00000000 twritten: 0007fb80 [10966468418,7] HBRT: LID 0x81e00430 successfully loaded, len=0x31b83db8 ... [19485180658,7] HBRT: stopOCCs() rc = 0 [19582727570,6] OCC: Got OCC Load message, scope=0x2 dbob=0x0 seq=0x10 [19582732660,7] HBRT: OCC Load requested [19582734678,7] HBRT: Calling loadOCC() homer 0000000401400000, occ_common_area 0000000400800000, chip 0000 [19582803643,6] HBRT: Lid load request for 0x81e00430 [19582806532,7] HBRT: Serviced from cache, len=0x7fb80 [19582996931,7] HBRT: -> rc = 0 [19582999113,7] HBRT: Calling loadOCC() homer 0000000401c00000, occ_common_area 0000000400800000, chip 0001 [19583097594,6] HBRT: Lid load request for 0x81e00430 [19583100343,7] HBRT: Serviced from cache, len=0x7fb80 [19583274638,7] HBRT: -> rc = 0 [19583277114,6] HBRT: OCC Start requested V2: Address Vasant's comments (bz reference and OPAL_NO_MEM) Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hostservices: Don't run pollers from hostservices callbacksAnanth N Mavinakayanahalli2015-02-171-1/+1
| | | | | | | | | Use the _nopoll variant of nanosleep from hostservices, to avoid potential poller recursion. Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* timebase: Add nanosleep_nopollAnanth N Mavinakayanahalli2015-02-171-0/+11
| | | | | | | | For use by hservices mainly... Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core: Add subid to load_resource()Michael Neuling2015-02-172-4/+5
| | | | | | | | | | | | | | | This adds a subid to load_resource() so that sub-partitions can be accessed inside a PNOR partition. These sub-partitions follow the format used by the hostboot SBE image. The subid will match on the EC field of the SBE table of contents. If it's found, only that sub-partition is returned to the caller. Current partitions (kernel and ramfs) don't support sub-partitions. If caller tries to access a sub-partition within these, we fail the call. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core: Add load_resource()Michael Neuling2015-02-172-13/+18
| | | | | | | | Add new function call load_resource(). This helps cleanup the callers of platform.load_resource(). Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* s/OpalMessageType/opal_msg_type/ removing CamelCase and being consistent!Stewart Smith2015-02-161-1/+1
| | | | | | We now consistently use msg as abbreviation for message in OPAL API. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* opal: Do not overwrite same HMI event for multiple HMI errors.Mahesh Salgaonkar2015-02-121-31/+45
| | | | | | | | | The current implementation overwrites the same HMI event if there are multiple HMI errors reported through a single HMI interrupt. This patch fixes that issue by sending separate HMI event per error. Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/device: Function to return child node using nameNeelesh Gupta2015-02-111-0/+16
| | | | | | | | Add a function dt_find_by_name() that returns the child node if matches the given name, otherwise NULL. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Make abort() update sp attn area (like assert does)Stewart Smith2015-02-111-2/+2
| | | | | | Gives better diagnostics in error logs/dumps Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* ipmi/wdt: Add ipmi watchdog timer supportAlistair Popple2015-02-092-2/+9
| | | | | | | | | | | | | | Add support for an ipmi watchdog timer. During skiboot initialisation this patch will cause the system to be reset if opal_run_pollers() isn't called for more than 60 seconds. Once the payload is started the watchdog timer will be reset and a pre-timeout interrupt set. The payload should then receive the interrupt and call into skiboot which will disable the watchdog timer. Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* ipmi: Implement Read Event and SEL parsingJoel Stanley2015-02-091-1/+2
| | | | | | | | | | | | | | | | | | The read event mechanism is used when the BMC has an asynchronous message for the host. It sets a flag that we read with Get Message Flags, and then we read the message using Read Event. This event message contains a SEL message. There are two OEM SEL messages we expect from the AMI BMC: - graceful power operations. This is when the BMC wants the host to power down or reboot. - PNOR Locking. When the BMC wants to access the PNOR, it requests that the host not touch it. This patch implements the parsing. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Merge remote branch 'ka1/master'Stewart Smith2015-02-091-0/+40
|\
| * ipmi: handle SMS_ATN eventsJeremy Kerr2015-02-091-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the bt interface sets the SMS_ATN flag, we perform a Get Message Flags to determine what messages are available. The only message type currently processed is the Event Message Buffer, which provides SEL messages for indicating OEM specific events such as graceful system shutdown and PNOR access requested. These events will be handled by the IPMI layer in skiboot. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
OpenPOWER on IntegriCloud