aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-06-06opal-prd: Sync hostboot interfaces with HBRTJeremy Kerr2-4/+203
This change adds new callbacks defined for p9, and the base thunks for the added calls. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> CC: Daniel M Crowell <dcrowell@us.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-06opal-prd: interpret log level prefixes from HBRTJeremy Kerr1-1/+19
Interpret the (optional) *_MRK log prefixes on HBRT messages, and set the syslog log priority to suit. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-06opal-prd: Add occ reset to usage textJeremy Kerr1-1/+1
Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-06opal-prd: allow different chips for occ control actionsJeremy Kerr1-27/+68
The `occ reset` and `occ error` actions can both take a chip id argument, but we're currently just using zero. This change changes the control message format to pass the chip ID from the control process to the opal-prd daemon. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-06opal-prd: split type-specific fields of control messagesJeremy Kerr1-5/+10
We'd like to add other type-specific fields, so introduce a union to populate with these. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-06opal-prd: Simplify optind handlingJeremy Kerr1-9/+9
Increment once, rather than having to use 'optind + 1' on every subsequent usage. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-06hdata/test: Add memory reservations to hdata_to_dtOliver O'Halloran3-17/+35
Currently memory reservations are parsed, but since they are not processed until mem_region_init() they don't appear in the output device tree blob. Several bugs have been found with memory reservations so we want them to be part of the test output. Add them and clean up several usages of printf() since we want only the dtb to appear in standard out. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-06hdata: Make out-of-range idata print at PR_DEBUGOliver O'Halloran1-2/+2
Some fields just aren't populated on some systems. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-31core/pci: Rename pci_slot_op poll to run_smMichael Neuling6-10/+10
This renames the "poll" op to "run_sm" (short for run state machine). I think this is a better name since the function does a bunch of things like reseting the slot. Also it avoids confusion with the "poll_link" op which does something different (and can even be called from run_sm). No functional change. Signed-off-by: Michael Neuling <mikey@neuling.org> Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-31mambo: Allow loading multiple CPIOsMichael Ellerman1-4/+10
Currently we have support for loading a single CPIO and telling Linux to use it as the initrd. But the Linux code actually supports having multiple CPIOs contiguously in memory, between initrd-start and end, and will unpack them all in order. That is a really nice feature as it means you can have a base CPIO with your root filesystem, and then tack on others as you need for various tests etc. So expand the logic to handle SKIBOOT_INITRD, and treat it as a comma separated list of CPIOs to load. I chose comma as it's fairly rare in filenames, but we could make it space, colon, whatever. Or we could add a new environment variable entirely. The code also supports trimming whitespace from the values, so you can have "cpio1, cpio2". Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-31occ: Skip setting cores to nominal frequency in P9Shilpasri G Bhat1-5/+8
In P9, once OCC is up, it is supposed to setup the cores to nominal frequency. So skip this step in OPAL. Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-31occ: Fix Pstate ordering for P9Shilpasri G Bhat3-178/+552
In P9 the pstate values are positive. They are continuous set of unsigned integers [0 to +N] where Pmax is 0 and Pmin is N. The linear ordering of pstates for P9 has changed compared to P8. P8 has neagtive pstate values advertised as [0 to -N] where Pmax is 0 and Pmin is -N. This patch adds helper routines to abstract pstate comparison with pmax and adds sanity pstate limit checks. This patch also fixes pstate arithmetic by using labs(). Suggested-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-31libc: Add labs() to stdlibShilpasri G Bhat4-1/+34
Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Acked-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-26hdata: Ignore unnamed memory reservations.Oliver O'Halloran1-4/+6
Hostboot should name any and all memory reservations that it provides. Currently some hostboots export a broken reservation covering the first 256MB of memory and this causes the system to crash at boot due to an invalid free because this overlaps with the static "ibm,os-reserve" region (which covers the first 768MB of memory). According to the hostboot team unnamed reservations are invalid and can be ignored. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-26libflash: Initialise entries list earlierOliver O'Halloran1-1/+1
In the bail-out path we call ffs_close() to tear down the partially initialised ffs_handle. ffs_close() expects the entries list to be initialised so we need to do that earlier to prevent a null pointer dereference. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-26hdata: Check the Host I2C devices array versionOliver O'Halloran1-0/+33
Currently this is not populated on FSP machines which causes some obnoxious errors to appear in the boot log. We also only want to parse version 1 of this structure since future versions will completely change the array item format. Cc: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> [stewart@linux.vnet.ibm.com: return -1 on error rather than 1] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-26libflash/mbox-flash: Implement MARK_WRITE_ERASED mbox callSuraj Jitindar Singh1-4/+59
Version two of the mbox-flash protocol defines a new command: MARK_WRITE_ERASED. This command provides a simple way to mark a region of flash as all 0xff without the need to go and write all 0xff. This is an optimisation as there is no need for an erase before a write, it is the responsibility of the BMC to deal with the flash correctly, however in v1 it was ambiguous what a client should do if the flash should be erased but not actually written to. This allows of a optimal path to resolve this problem. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Acked-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-26libflash/mbox-flash: Update to V2 of the protocolCyril Bur4-143/+600
Updated version 2 of the protocol can be found at: https://github.com/openbmc/mboxbridge/blob/master/Documentation/mbox_protocol.md This commit changes mbox-flash such that it will preferentially talk version 2 to any capable daemon but still remain capable of talking to v1 daemons. Version two changes some of the command definitions for increased consistency and usability. Version two includes more attention bits - these are now dealt with at a simple level. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Acked-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-26hw/lpc-mbox: Use message registers for interruptsCyril Bur2-16/+49
Currently the BMC raises the interrupt using the BMC control register. It does so on all accesses to the 16 'data' registers meaning that when the BMC only wants to set the ATTN (on which we have interrupts enabled) bit we will also get a control register based interrupt. The solution here is to mask that interrupt permanantly and enable interrupts on the protocol defined 'response' data byte. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Reviewed-by: Andrew Jeffery <andrew@aj.id.au> Acked-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-26libflash/mbox-flash: Minor fixups before V2Cyril Bur1-1/+7
- Warn if flushing with closed write window. - Call msg_free_memory() in mbox_flash_init() before a successful return. No leak is present as the current allocation theme is from static memory. However as this is likely to change in the future, best to ensure that msg_free_memory() is called after every allocation. - Fix bug where len argument may be incorrect in mark dirty command. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Reviewed-by: Andrew Jeffery <andrew@aj.id.au> Acked-by: Cyril Bur <cyri.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-26hdata: Reserve Trace AreasOliver O'Halloran3-0/+53
When hostboot is configured to setup in memory tracing it will reserve some memory for use by the hardware tracing facility. We need to mark these areas as off limits to the operating system and firmware. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-26mem_region: Add HW-only memory resevationsOliver O'Halloran3-2/+23
Add a new type of memory reservation that indicates a memory region is only used by hardware and should not be touched by software. This is needed for the in-memory tracing buffers. These reservations have the "no-map" property which indicates that the host kernel should not setup any virtual address mappings that cover this range, unless of course a device driver does so explicitly. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-26mem_region: rename HW_RESERVE to FW_RESERVEOliver O'Halloran8-17/+16
Currently all existing reservations are made by hostboot itself or on behalf of some other part of system firmware (e.g. the OCCs). We want to add a "true" hardware reservation type that should not be touched by the host OS. To prepare for that this patch renames the existing reservation type to refect it's actual usage. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-26fsp/tpo: Provide support for disabling TPO alarmVaibhav Jain2-2/+9
This patch adds support for disabling a preconfigured Timed-Power-On(TPO) alarm on FSP based systems. Presently once a TPO alarm is configured from the kernel it will be triggered even if its subsequently disabled. With this patch a TPO alarm can be disabled by passing y_m_d==hr_min==0 to fsp_opal_tpo_write(). A branch is added to the function to handle this case by sending FSP_CMD_TPO_DISABLE message to the FSP instead of usual FSP_CMD_TPO_WRITE message. The kernel is expected to call opal_tpo_write() with y_m_d==hr_min==0 to request opal to disable TPO alarm. Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-24skiboot-5.6.0 release notesskiboot-5.6.0Stewart Smith1-0/+30
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-19skiboot 5.6.0-rc2 release notesskiboot-5.6.0-rc2Stewart Smith1-0/+72
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-19mambo: Add skiboot/linux symbol lookupOliver O'Halloran2-0/+50
Adds the skisym and linsym commands which can be used to find the address of a Linux or Skiboot symbol. To function this requires the user to provide the SKIBOOT_MAP and VMLINUX_MAP environmental variables which indicate which skiboot.map and System.map files should be used. Examples: Look up a symbol address: systemsim % skisym .load_and_boot_kernel 0x0000000030013a08 Set a breakpoint there: systemsim % b [skisym .load_and_boot_kernel] breakpoint set at [0:0]: 0x0000000030013a08 (0x0000000030013A08) Enc:0x7D800026 : mfcr r12 Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-19hw/i2c: Fix early lock dropOliver O'Halloran1-2/+0
When interacting with an I2C master the p8-i2c driver (common to p9) aquires a per-master lock which it holds for the duration of it's interaction with the master. Unfortunately, when p8_i2c_check_initial_status() detects that the master is busy with another transaction it drops the lock and returns OPAL_BUSY. This is contrary to the driver's locking strategy which requires that the caller aquire and drop the lock. This leads to a crash due to the double unlock(), which skiboot treats as fatal. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-18libstb: Fix build in OpenSSL 1.1Russell Currey1-4/+11
OpenSSL has some API changes which causes a build break in libstb. Specifically, directly accessing some members of a signature now requires using a helper. This fixes things in OpenSSL 1.1 and has no effect on OpenSSL 1.0. The build failure was as follows: [ HOSTCC ] libstb/create-container.c In file included from /usr/include/openssl/asn1.h:24:0, from /usr/include/openssl/ec.h:30, from libstb/create-container.c:36: libstb/create-container.c: In function ‘getSigRaw’: libstb/create-container.c:104:31: error: dereferencing pointer to incomplete type ‘ECDSA_SIG {aka struct ECDSA_SIG_st}’ rlen = BN_num_bytes(signature->r); ^ Signed-off-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-17skiboot-5.6.0-rc1 release notesskiboot-5.6.0-rc1Stewart Smith1-0/+502
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-16hdata_to_dt: Output up to PR_DEBUGOliver O'Halloran1-4/+4
A lot of stuff that is useful for debugging and general sanity checking of the HDAT parser is only printed at PR_DEBUG. Bump up the log level for hdata_to_dt so that more of this is output by default. The actual test cases only look at the DTS output so there's no harm in being verbose. Clean up the space indentation while we're here. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-16hdata: Add no-op stub functionsOliver O'Halloran1-2/+8
These are useful for side-stepping various HW specific functions. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-16hdata: Don't use printfOliver O'Halloran2-3/+4
Using printf() here results in the output going into the stdout stream when running the hdata_to_dt test. This results in an invalid dtb output so lets not do that. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-16hdata: Respect OCC and HOMER resevationsOliver O'Halloran1-6/+0
In the past we've ignored these since Hostboot insisted in exporting broken reservations and the OCC was not being used yet. This situation seems to have resolved itself so we should respect the reservations that hostboot provides. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Acked-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Tested-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Tested-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-16core/mem_region: Print a useful error on overlapOliver O'Halloran1-1/+28
New memory regions need to be either fully contained by an existing region or completely disjoint. Right now we just fail silently or crash with an assert which is less than helpful. Printing some basic information, such as the names of the overlapping regions is helpful. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-16core/test: Test pre-init memory reservationsOliver O'Halloran1-6/+9
Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-16mem_region: Add reserved regions after memory initOliver O'Halloran1-7/+30
When a new memory region is added (e.g for memory reserved by firmware) the list of existing memory regions is iterated through and a cut-out is made in any existing region that overlaps with the new one. Prior to the HDAT reservations being made the region init process was always: 1) Create regions from the memory@<addr> DT nodes. (mostly large) 2) Create reserved regions from the device-tree. (mostly small) When adding new regions we have assume that the new region will only every intersect with at most one existing region, which it will split. Adding reservations inside the HDAT parser breaks this because when adding the memory@<addr> node regions we can potentially overlap with multiple reserved regions. This patch fixes this by maintaining a seperate list of memory reservations and delaying merging them until after the normal memory init has finished, similar to how DT reservations are handled. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-16phys map: Add tests for holes in MMIO region and orderMichael Neuling1-1/+27
This adds a couple of tests to ensure that there are no holes in the map for MMIO mappings and the map is sorted by start address. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-16phys map: Remove hole in NPU sectionMichael Neuling1-10/+10
When we first added the map, we accidentally left a hole after the NPU PHY regs region. Fix this hole. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-16phys map: Add missing NPU user regs regionMichael Neuling2-0/+2
We don't use this region currrently but we should add for completeness. Signed-off-by: Michael Neuling <mikey@neuling.org> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-12Remove multiple logging for un-handled fsp sub commands.ppaidipe@linux.vnet.ibm.com1-1/+0
If any new or unknown command need to be handled, just log un-hnadled message from only fsp, not required from fsp-dpo. cat /sys/firmware/opal/msglog | grep -i ,3 [ 110.232114723,3] FSP: fsp_trigger_reset() entry [ 188.431793837,3] FSP #0: Link down, starting R&R [ 464.109239162,3] FSP #0: Got XUP with no pending message ! [ 466.340598554,3] FSP-DPO: Unknown command 0xce0900 [ 466.340600126,3] FSP: Unhandled message ce0900 Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-12GCC7: fixes for -Wimplicit-fallthrough expected regexesStewart Smith3-3/+5
It turns out GCC7 adds a useful warning and does fancy things like parsing your comments to work out that you intended to do the fallthrough. There's a few places where we don't match the regex. Fix them, as it's harmless to do so. Found by building on Fedora Rawhide in Travis. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-12travis: stop allowing fedora24 and fedora25 to failStewart Smith1-2/+0
They've been really reliable for a while now, so let's switch to not ignoring any failures there (when introduced, there were some problems with the fedora mirrors that could cause spurious failures) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-12phb4: Add an option for disabling EEH MMIO in nvramRussell Currey1-3/+8
Having the option to disable EEH for MMIO without rebuilding skiboot could be useful for testing, so check for pci-eeh-mmio=disabled in nvram. Signed-off-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-12hdata/i2c: avoid possible int32_t overflowStewart Smith1-1/+1
We're safe up until engine number 524288. Found by static analysis Fixes: ae4e50eb35695 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-12tpm_i2c_nuvoton: fix use-after-free in tpm_register_chip failure pathStewart Smith1-1/+3
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-10test/hdata_to_dt: fix build breakage caused by phys_map_getStewart Smith1-0/+3
Fixes: 5f67c1e253788691d376e4e639d4a6e7785efa55 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-10phb4: Cleanup BAR inits and loggingMichael Neuling1-57/+20
We always assign BARs in phb4, so this removes the unnecessary force assign logic. This patch also cleanup the logging to make it less verbose. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-10phb4: Increase 64bit MMIO BAR size from 128GB to 256GBMichael Neuling1-7/+7
Primarily for GPUs which may have large MMIO space for frame buffers. This shuffles the memory map around a bit and starts using the 2TB region. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-10lpc: Migrate BAR assignment to phys_map_get()Michael Neuling1-4/+3
Keeps existing address. No functional change. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>