summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* occ: Send self-interrupt to chip with active PSIJoel Stanley2015-05-134-3/+30
| | | | | | | | | | | | | | | | | We were previously asking the OCC of the current chip to generate the self interrupt. If Hostboot does not configure all the PSI Host Bridges, so if the current chip happens to have an unconfigured PSI HB, the chip will never see the interrupt. Instead grab a chip id from the list of configured PSIs, and ask the OCC on that chip to generate the self-interrupt. This adds a pointer to the chip's PSI in struct proc_chip so we can use the current chip's PSI if it is active without having to look through all of them. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add test for pr_fmtStewart Smith2015-05-121-0/+72
| | | | | | (missed this from pr_fmt commit, whoops) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* ipmi/wdt: Stop calling synchronous message functions from timersAlistair Popple2015-05-121-9/+24
| | | | | | | | | | | The current watchdog code calls ipmi_queue_msg_sync from a timer which leads to calling a opal_poll_events() recursively and consequently an abort(). This patch ensures we don't send synchronous messages from a timer. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fix race in flash resource preloadingStewart Smith2015-05-121-4/+5
| | | | | | | | | | | | | | | | | | | | | | (13:31:46) benh: stewart: flash_load_resources() (13:31:53) benh: stewart: you hit the unlock at the bottom of the loop (13:31:59) benh: stewart: at that point the list may be empty (13:32:09) benh: stewart: and so another concurrent load can restart the thread (13:32:15) benh: stewart: you end up with duplicate threads (13:32:26) benh: stewart: in which case you can hit the assert <patch goes here> (13:34:27) benh: ie, never drop the lock with the queue empty (13:34:29) benh: unless you know you will exit the job (13:34:32) benh: otherwise you can have a duplicate job (13:34:41) benh: -> kaboom (13:36:29) benh: yeah the decision to exit the loop must be atomic with the popping of the last element in the list (13:36:43) benh: to match the decision to start the thread which is atomic with the queuing of the first element Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fix infinite loop in wait_for_resource if CAPP ucode load failsStewart Smith2015-05-121-11/+8
| | | | | | | | | | | | | On failing to load CAPP microcode, we would call wait_for_resource_loaded for the next PHB but without issuing a new request, thus making wait_for_resource spin forever waiting for something that will never complete. Fix is to just track result of load. Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Acked-by: Alistair Popple <alistair@popple.id.au>
* Add pr_fmt to do printf/prlog prefixing automagicallyStewart Smith2015-05-1215-190/+177
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hw/bt: Add netfn to BT_ERR messageJeremy Kerr2015-05-111-2/+3
| | | | | | | | | It's not too useful to print the command without the netfn, so add this into the BT_ERR macro. Reported by: Nick Bofferding <bofferdn@us.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/lock: Simplify the check in lock_recursive()Gavin Shan2015-05-111-3/+1
| | | | | | | | | In lock_recursive(), the condition, used to check if the lock has been held by current CPU, can be replaced with lock_held_by_me() to simplify the code. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fix synchronous running of CPU jobs for NRCPUs=1Stewart Smith2015-05-071-8/+9
| | | | | | i.e. currently only mambo Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fixup hdata test for fsp LID preloadingStewart Smith2015-05-072-1/+4
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add prlog_once for logging a message only onceJoel Stanley2015-05-071-0/+8
| | | | | Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Preload VPD LID and set up fsp_lid_load() for async queued loadingStewart Smith2015-05-0711-39/+114
| | | | | | | | This means VPD LID is already loaded before we start preloading kernel and initramfs LIDs, thus ensuring VPD doesn't have to wait for them to finish being read from FSP. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Don't double preload hservices LIDsStewart Smith2015-05-071-4/+0
| | | | | | | | | | On Firenze, we called hservices_lid_preload in firenze_init() but hservices_lid_preload() is called from ibm_fsp_init(), so we ended up doing the load twice. This added approximately 0.2 seconds to boot time. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add global CPU job queueStewart Smith2015-05-075-42/+73
| | | | | | | | | | | | | | | | | | | | | | | When we have multiple systems trying to start concurrent jobs on different CPUs, they typically pick the first available (operating) CPU to schedule the job on. This works fine when there's only one set of jobs or when we want to bind jobs to specific CPUs. When we have jobs such as asynchronously loading LIDs and scanning PHBs, we don't care which CPUs they run on, we care more that they are not scheduled on CPUs that have existing tasks. This patch adds a global queue of jobs which secondary CPUs will look at for work (if idle). This leads to simplified callers, which just need to queue jobs to NULL (no specific CPU) and then call a magic function that will run the CPU job queue if we don't have secondary CPUs. Additionally, we add a const char *name to cpu_job just to aid with debugging. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Asynchronously preload CAPP microcodeStewart Smith2015-05-073-60/+80
| | | | | | | | | | | | Instead of synchronously waiting for CAPP microcode during PCI probe, start preload of CAPP microcode early in boot so that it's present when we need it during PCI probing. On some platforms (astbmc), flash access is serialized, and prior to this patch, the async preload of BOOTKERNEL would have to finish before loading CAPP ucode would start, needlessly slowing boot. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Track how long we spend spinning waiting for resource to be loadedStewart Smith2015-05-071-0/+4
| | | | | | | | This should help us capture (in skiboot log) how long we spend waiting for resources to load from flash/FSP. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Reviewed-by: Joel Stanley <joel@jms.id.au>
* astbmc: asynchronous preloading of resourcesStewart Smith2015-05-075-7/+126
| | | | | | | | | | | | | | Implement start_preload_resource and resource_loaded platform functions for astbmc machines (palmetto, habanero, firestone). This means we start loading kernel and initramfs from flash much earlier in boot, doing things like PCI init concurrently so that by the time we go to boot the payload, it's already loaded. Implementation is a simple queue with a job running on another CPU doing the libflash calls. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP LID loading: always remove from lid_loaded listStewart Smith2015-05-071-4/+2
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Start preload of kernel and initramfs early in bootStewart Smith2015-05-071-30/+50
| | | | | | | | This means we will load kernel and initramfs LIDs from FSP/flash as we init PCI, hopefully reducing boot time. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Reviewed-by: Joel Stanley <joel@jms.id.au>
* Fix FSP resource/LID loading for preloading LIDs.Stewart Smith2015-05-071-5/+9
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core: add a read sensors op to the Apollo platformCédric Le Goater2015-05-071-0/+1
| | | | | | | | commit 132e593400f9 ("core: add a platform op to read sensors") missed out this platform. Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Add compatible propertyVasant Hegde2015-05-071-0/+1
| | | | | | | That way user space tools can identify the change in VPD layout etc. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Improve error loggingVasant Hegde2015-05-071-3/+16
| | | | | | | | | | | | Populate CCIN description and model-name property as "Unknown" if its not available (say new system model, etc). That way device tree will be consistent. Also improve error logging. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* eeh: Fix eeh event handlingAlistair Popple2015-05-075-5/+32
| | | | | | | | | | | | | | | | | | The opal eeh interrupt handlers raise an opal event (OPAL_EVENT_PCI_ERROR) whenever there is some processing required from the OS. The OS then needs to call opal_pci_next_error(...) in a loop passing each phb in turn to clear the event. However opal_pci_next_error(...) clears the event unconditionally meaning it would be possible for eeh events to be cleared without processing them leading to missed events. This patch fixes the problem by keeping track of eeh events on a per-phb basis and only clearing the opal event once all phb eeh events have been cleared. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/ELOG: Remove TCE mapping for host bufferVasant Hegde2015-05-072-4/+1
| | | | | | | | elog_write_to_host_buffer is used to pass error log to host. Hence we don't need TCE mapping for this buffer. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/ELOG: Reduce elog write buffer sizeVasant Hegde2015-05-071-3/+3
| | | | | | | | | | | | | | | | Present we are allocating 64K for emergency and host buffer. But we just need 16K (which is the max elog size). Hence reduce the variable size to 16K. Similarly we are allocating 256K for normal fsp write error log path. (elog_write_to_fsp_buffer). But in reality we just need 16K. Hence reduce this size as well. Note that we have top level elog pool with 64 entries of 16K to hold multiple errors. So we are fine here. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/ELOG: Free error log buffer in error pathVasant Hegde2015-05-071-1/+5
| | | | | | | Also pass MBOX return state instead of sending "true" always. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/ELOG: Do not reject elog in acknowledgement pathVasant Hegde2015-05-071-2/+0
| | | | | | | | Remove useless elog_reject_head call in acknowledgement path. We can ACK elog in any order. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/ELOG: Use elog REJECT state properlyVasant Hegde2015-05-071-2/+7
| | | | | | | | Presently we continue to read error log even though elog state is "REJECTED". This patch fixes this by rearraning code. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/ELOG: Reduce elog read buffer sizeVasant Hegde2015-05-071-1/+1
| | | | | | | | | | | Presently we are allocating 256K for elog read buffer. But we just read one log at a time. Also maximum size of ELOG is 16KB. Effectively we are not using remaining 240K. This patch reduces the size of the buffer to 16K. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/LED: Handle SA indicator update notificationVasant Hegde2015-05-072-0/+33
| | | | | | | | FSP sends SA indicator update notification via sys param update. Use that info to update cached indicator state. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/SYSPARAM: Introduce update notify system parameter notifierVasant Hegde2015-05-072-0/+61
| | | | | | | | | | | | | FSP sends update system parameter notification asynchronously. Presently no one is using this notification. We just ACK this notification. This patch adds notifier chain so that if someone (like LED) is interested in this notification, they can register and get notification. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/LED: Add system attention indicator supportVasant Hegde2015-05-074-2/+209
| | | | | | | | | | | | | | | | SAI is controlled by FSP. This patch adds support to get/set this indicator. Also update OPAL interface so that playload can read/set this indicator. During init, we read this indicator state using MBOX command. OPAL uses MBOX interface to update this SAI. FSP sends update notification whenever there is change in SAI state (except for OPAL initiates updates). We use the notification to update cached SAI state. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/LED: Get SAI location code from device treeVasant Hegde2015-05-072-11/+65
| | | | | | | | SAI information is available in device tree. This patch parses device tree to get SAI location code information. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/hdata: Populate System Attention Indicator location codeVasant Hegde2015-05-074-0/+84
| | | | | | | | | | | | | | | | | On FSP based machine, FSP controls System Attention Indicator. This indicator detail (location code) is passed to OPAL via HDAT. OPAL can get/set this indicator via normal MBOX command. This patch takes care of parsing SLCA entry and populating device tree with SAI location code. Device Tree: We create '/ibm,opal/led' node which contains all location code LED information. 'led-types' property under each node tells LED type. For SAI indicator 'led-types' property will be 'attention'. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/LED: Use LED mode informationVasant Hegde2015-05-071-2/+15
| | | | | | | | | | Lets use the LED mode information populated by previous patch. We don't support fault indicator in 'Guiding Light' mode. So don't expose fault indicator to playload in Guiding Light mode. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Detect LED mode and populate device treeVasant Hegde2015-05-073-0/+16
| | | | | | | | | | | | | | | | FSP based machine supports two different LED modes: - Light Path : Both identify and fault LEDs are supported - Guiding Light: Only identify LEDs are supported And this information is passed to OPAL via HDAT. Lets parse this and populate the device tree. Later LED driver uses this information to populate indivisual LED node. Device Tree property: /ibm,opal/led/led-mode : lightpath/guidinglight Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Create LED nodeVasant Hegde2015-05-071-0/+20
| | | | | | | | | | | | Unfortunately we do not have single place to get all LED related information (Some of the information is passed via HDAT and rest via MBOX command). Lets create led node before parsing HDAT and use this node to populate all LED related information. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/LED: Validate before creating led nodeVasant Hegde2015-05-071-3/+4
| | | | | | | | | | | We get SAI indicator via HDAT. So we have to create led node while parsing HDAT itself. Lets get led node from device tree. Note that LED DT creation fails until next commit...which creates LED device tree node. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* OPAL: Validate before creating opal device tree nodeVasant Hegde2015-05-071-1/+5
| | | | | | | | | | | | | | On FSP based machine, attention LED location code is passed to OPAL via HDAT. We want to populate this information in device tree under led node, so that LED driver can use this information. Presently we are creating '/ibm,opal' node after parsing hdata information. This patch validates '/ibm,opal' node before creating. So on FSP based machine we can create this node in hdata itself without breaking. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/LED: Define macro instead of hardcoding led typeVasant Hegde2015-05-072-5/+28
| | | | | | | | Define macors for LED related device tree property and its values. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/LED: Move led header file to include directoryVasant Hegde2015-05-072-2/+1
| | | | | | | | | | We want to refer leds header file in hdata. Hence move header file to include directory. No functionality changes. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/CUPD: Code Update OPAL API documentationVasant Hegde2015-05-071-0/+78
| | | | | | | Add documentation for FSP based machine code update API. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* update version/m[il]-version docs indicating properties may not be presentStewart Smith2015-05-071-3/+4
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP/CUPD: Device tree documentation for firmware informationVasant Hegde2015-05-071-0/+27
| | | | | | | Lets document the firmware version related device tree properties. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Merge branch 'stable', skiboot-5.0.1Stewart Smith2015-05-016-20/+47
|\
| * Add xscom_ok() and lpc_ok() to check XSCOM and LPC usabilityBenjamin Herrenschmidt2015-05-016-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | his primarily checks whether the caller already holds the corresponding locks to avoid re-entrancy in some of the deep error path such as when XSCOM itself triggers an error log. It will be extended in the case of LPC to also handle known HW error states. We use them to avoid queuing/polling in the BT driver and to discard characters in the UART driver. Note: This will not normally involve a loss of log to the UART as the UART driver is also protected by the console suspend mechanism. So this is a safety mechanism only. This fixes issues where the generation of error logs inside the LPC or XSCOM drivers could cause a re-entrancy (via the BT interface) causing deadlocks. Now, the error logs IPMI messages will be queued up and delivered later on the next poll handler. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
| * xscom: Remove recursive lockingBenjamin Herrenschmidt2015-05-011-18/+6
| | | | | | | | | | | | | | Nothing should be using it nowadays and it's dangerous. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
| * init: Display message before loading kernelJoel Stanley2015-05-011-0/+2
| | | | | | | | | | | | | | | | Reassure the user that boot is still working when the payload load is slow. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
| * prd: Only alter host presentation bits of IPOLL maskJeremy Kerr2015-05-011-4/+6
| | | | | | | | | | | | | | | | | | | | | | We'll need to leave the FSI presentation bits clear, to allow OCCs to handle the checkstop interrupt. This modifies the PRD code to only touch the host presentation bits, both on init, and in response to incoming PRD actions. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
OpenPOWER on IntegriCloud