| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Add more generic support for MMIO based UARTs, simplify code,
use common initialization, and clean up the device-tree
representation as well.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement a flash driver using mambo bogus disk.
Works as a system flash (ie palmetto.pnor) or with disk images (via
Linux mtdblock).
Linux MTD needs this patch to perform at a resonable speed:
https://lists.ozlabs.org/pipermail/linuxppc-dev/2016-July/145202.html
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
Just one annotation here, pretty rare situation I think... but
best to bail on this one, as this certainly isn't something we
want in production.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
| |
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In firenze_pci_slot_init(), i2c_alloc_req() can return NULL though
it's very rare. We don't cover the case. If NULL I2C request returned
from the function, the I2C dependent power management won't be used.
This checks if i2c_alloc_req() returns valid I2C request or not.
Suggested-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After commit aa928bfbd891 ("platforms/astbmc: Support PCI slot")
is merged, we have the assumption that PHB's base location code
is always valid. It's not true on openPower platforms, including
Garrison. It causes the PCI slot location code isn't exposed via
device-tree.
This fixes the above issue. The PCI slot location code contains
the label only if PHB's base location code is invalid.
Reported-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Tested-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Found with static analysis:
939 id = ((uint64_t)p[1] << 32) | p[2];
value_overwrite: Overwriting previous write to id with value 0ULL.
940 id = 0;
Fixes: 6884fe63
Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
| |
We also convert from custom prlog() macros over to straight prlog
with the magic pr_fmt define.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reworks PCI stuff for astbmc platform to support PCI slot:
* The PCI slot is created in slot_table_get_slot_info().
* There are no platform dependent operations provided to PCI
slots at current stage.
* The slot location code is populated accordingly.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch reworks PCI stuff for IBM's Apollo and Firenze platforms to
support PCI slot:
* Platform shared PCI slot is represented by "struct lxvpd_pci_slot"
for Apollo and Firenze. The information of that is fetched from
VPD.
* Apollo platform uses "struct lxvpd_pci_slot" as its platform slot,
while Firenze platform uses "struct firenze_pci_slot" as its
platform slot in order to support external I2C-based PCI slot power
maangement as well as PERST supported by the downstream ports of
particular PLX PCIe switches.
* On Firenze platform, the properties and methods to manage PHB slot
might be overrided to utilize the capability of external power
management.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Every PCIE bridge port or PHB is expected to be bound with PCI slot
, to which various PCI slot's functionalities are attached (e.g. power,
link, reset). This supports PCI slot:
* PCI slot is reprsented by "struct pci_slot".
* "struct pci_slot_ops" represents the functions supported on the
PCI slot. It's initialized by PCI slot core at the beginning and
allowed to be overrided by platform partially or completely.
* On PCI hot plugging event, the PCI devices behind the slot are
enumarated. Device sub-tree is populated and sent to OS by OPAL
message.
* On PCI hot unplugging event, the PCI devices behind the slot are
destroyed. Device sub-tree is removed and the slot is powered off.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
The Garrison workbook numbers GPUs starting from GPU1 instead of
GPU0. Update the skiboot location codes to match.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
Add the slot location names for the PCI and NPU slots.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Claimed-to-be-Tested-By: Abhijit Saikia <Abhijit.Saikia@in.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The PHB slot location code ueses the ibm,phb-index property to find
slot location names. As the NPU is implemented as a different PHB type
it means the phb-index property overlaps with the other PHBs in the
system.
This patch changes the existing usage of phb-index to npu-index which
allows the phb-index property to be assigned a unique value which can
then be matched by the PHB slot location code.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We pre-allocate IPMI message for PANIC event and use that memory to send
PANIC event to BMC. Presently we return NULL if we have not initiated PANIC
event message. So we won't be able to log early failure events.
This patch tries to initialize ipmi message instead of returning NULL.
Also intialize elog before ipmi_sel_init. Otherwise we will not be able
to create elog message.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The I2C master clock source frequency is hardcoded to wrong value.
The correct frequency should be the nest clock frequency divided
by 16 as Ben said.
This fixes I2C master source frequency with the help of additional
properties "nest-frequency" and "bus-frequency" to root and xscom
device node separately.
Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[stewart@linux.vnet.ibm.com: fixup hdata test for added property]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
| |
Add terminate callback to mambo platform so that the simulator exits.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
| |
Signed-off-by: Johnny <johnny.cl.chang@foxconn.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since we are anyway on the way to standby and apparently the other
hypervisor also does this.
Tested-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Garrison is the first system to support Nvlink. Eventually Hostboot
should provide these device tree bindings. In the meantime this patch
will add the required fixups to enable the Nvlinks on Garrison.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|/
|
|
|
|
|
| |
The other SlotN names have no space.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, most astbmc platforms do their own call to prd_init(), but
garrison is out-of-sync.
This change moves the prd_init call to astbmc_early_init, so we don't
need to enable it on every platform.
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>
|
|
|
|
|
|
|
| |
Slot names courtesy of Sertac
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
| |
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Presently abort() function is not working on BMC based machine. System
hangs after abort/assert call. We have to reboot machine from BMC (IPMI
command or BMC console).
This patch introduces attention functionality for BMC based machine.
It logs eSEL event that contains OPAL version, file info and backtrace.
And calls cec_reboot... which takes care of rebooting host.
Note:
- This patch uses ipmi_queue_msg() instead of ipmi_queue_msg_sync() as
we are having some issues with sync path. This will resolved once we
sort out [1].
- This patch calls cec_reboot to reboot machine after logging eSEL event.
It queues IPMI message and bt_poll() should be working until we pass
reboot IPMI message to BMC. Hence we have while loop with time_wait_ms().
Alternatively we can use xscom_trigger_xstop().. but it will stop
immediately and eSEL logging fails.
[1] https://lists.ozlabs.org/pipermail/skiboot/2015-August/001824.html
Sample eSEL output after assert call:
------------------------------------
[hegdevasant@hegdevasant bin]$ strings fir01bmc.150820.120511.eSel.binary
BB821410
AT8335-GTA000000000000
AT8335-GTA000000000000UD
ATDESC
OPAL version : skiboot-5.1.1-44-geae3999-hegdevasant-dirty-bb31bfd
File info : core/init.c:463:0
CPU 0060 Backtrace:
S: 0000000031d83bc0 R: 000000003006086c .ipmi_terminate+0x110
S: 0000000031d83c60 R: 0000000030017f90 ._abort+0x80
S: 0000000031d83ce0 R: 0000000030017fd8 .assert_fail+0x34
S: 0000000031d83d60 R: 0000000030013dcc .load_and_boot_kernel+0x784
S: 0000000031d83e30 R: 000000003001437c .main_cpu_entry+0x57c
S: 0000000031d83f00 R: 0000000030002544 boot_entry+0x194
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Current abort() call works fine on FSP based system. We need different
mechanism on BMC based machine. Hence introduce platform hook for
terminate call.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we allocate ipmi_msg for every eSEL event.. But in PANIC
its not advised to allocate memory. Hence pre-allocate ipmi_msg for
PANIC event.
Note that we continue to allocate memory for normal event. Also with
current implementation we can log only one eSEL event in PANIC path.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
| |
Names provided by Ben Mashak
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
This adds some basic infrastructure for simple slot tables allowing
us to name slots and built-in devices on OPP machines.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[stewart@linux.vnet.ibm.com: add IBM (C) in new file, trim trailing whitespace]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This moves some fields that are specific to the LXVPD mechanism out
of the generic pci_slot_info into a private wrapper. Additionally,
most fields in pci_slot_info are made signed integers in order to
allow them to be set to "-1" which indicates that the field doesn't
have a meaningful value, and inhibits creation of the corresponding
device-tree property.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are some functions (notably: erase_chip and set_4b_mode) which cannot
be abstracted away by the blocklevel interface, this means that if they are
really needed (by pflash for example) then at the moment a program like
pflash would need to pass a blocklevel_device struct to libflash.
This forces libflash to trust that it was given a blocklevel that it did
init. If it didn't init it the container_of call will return junk and
libflash has no way to protect its self. This method (while very useful)
has destroyed type safety. As such, this commit reintroduces some
typesafety back into this stack.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
| |
See https://github.com/lucasdemarchi/codespel
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
FSP implements the IPMI commands support that can be accessed over
the mailbox interface from the host. The host needs to provide and
receive the message/data bytes of the IPMI command in the TCE space
in the KCS (Keyboard Controller Style) format.
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Acked-By: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Whenever FSP makes any changes to backup topology as part of either
routine hardware maintenance or fixing failed backup topology configuration,
it sends out mailbox command xE6, s/c 0x06, mod 0, to enable/disable
the backup topology. OPAL layer should keep itself up-to-date with accurate
details of current topology configurations. This will help OPAL layer to
successfully handle any TOD failover in future.
The FSP can only request that the currently inactive (backup) topology be
disabled or enabled. If the requested topology is currently the active
topology, then fail this request with a 0xB8 (TOD topology in use) status
as return code.
For disable request, set the backup topology status as disabled.
For enable request, scan all the available chips and find the new backup
master chip by looking at TOD status register of each chip.
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
In pnor_init(), there are chances of pointer bl being read before
assignment. Fix it by initializing it to NULL.
Fixes Coverity defect#97868.
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
This adds a driver for standard CMOS RTC chips and use it from
the QEMU platform.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support for running under qemu "powernv" platform, which
is currently available via the qemu repository at:
https://github.com/ozbenh/qemu branch "powernv"
qemu can't yet create DT entries for ISA devices so we hard wire the UART
and RTC devices in the device-tree like we do with other platforms.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|\
| |
| |
| |
| |
| | |
Complex merge fixups
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
| |
| |
| |
| |
| |
| | |
Based on instructions from the HW folks
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds support for the HW SerIRQ deserializer of the P8 LPC
bridge which is properly wired up on Naples. It also adds support
for detecting and reporting LPC error interrupts on all P8s.
On most platforms (Rhesus is the exception here due to the way it
lets Linux handle the UART interrupts directly), we modify the
device-tree to properly represent the LPC controller as a cascaded
interrupt-controller and the "interrupts" property of LPC devices
to contain the actual LPC interrupt number for the device.
We add a mechanism for drivers to register specific LPC interrupts,
and a "workaround" for pre-Naples P8 which platforms can use to call
all of them for when the external FPGA based deserializer is used.
There's also a callback on LPC resets which isn't used yet, we need
a bit more work on the general LPC error handling, but it can be
done a separate patches.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| | |
Found by llvm scan-build.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Call prd_init() on astbmc/firestone platform
in order to enable PRD in host kernel.
Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Converted all the libflash calls to use the blocklevel interface, modified all
callers to libflash to use the blocklevel interface.
This patch should introduce next to no functional change.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Increases boot-code-coverage (for Mambo):
Lines: 2043 to 2168 (8.3% to 8.8%)
Functions: 283 to 298 (14.7% to 15.4%)
Branches: 792 to 816 (6.4% to 6.5%)
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
By adding an explicit mambo platform we can do tricks like a fake
NVRAM, actually get RTC from mambo and generally be a bit better
in a simulator
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|\ \ |
|
| |\ \
| | |/ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
With many PCI cards, we'd hit a race where calls to
firenze_add_pcidev_to_fsp_inventory would step on each other leading to
memory corruption and finally an assert() in the allocator being hit
during boot.
Observed with 33+ devices.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
| | |
| | |
| | |
| | |
| | | |
Signed-off-by: Dan Horák <dan@danny.cz>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|