aboutsummaryrefslogtreecommitdiff
path: root/platforms
AgeCommit message (Collapse)AuthorFilesLines
2017-09-15convert new witherspoon to dt helperOliver O'Halloran1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-15witherspoon: Deprecate manual npu creationOliver O'Halloran1-4/+54
In the future we will always create the npu nodes based on what's in the HDAT. For now we seperate witherspoon into an old and new platform where the old platform will assume a sequoia planar and create the relevant NPU nodes for that planar. If you have a redbud system this will be broken, but this should be fine for most cases. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-15platform/witherspoon: Add slot names to tableOliver O'Halloran2-22/+68
Add the other PCIe devices to the witherspoon slot tables. This provides a fall back for systems without IOSLOT information in the HDAT. This is mainly to allow DD1 systems to continue being useful. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-15astbmc: Add methods for handing DT based slotsOliver O'Halloran2-0/+49
Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-15core/pci-slots: Move slot-label construction to a helperOliver O'Halloran1-32/+2
Move this out of the astbmc specific part into a generic helper. This allows us to use it more commonly. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-15core/pcie-slots: Make dynamic slot creation genericOliver O'Halloran1-62/+12
astbmc has some code to handle devices that are behind a "slot" on a riser card that can't be added to the static slot tables for a system. We probably want to use this code outside the slot table handling so move it somewhere generic and rework it so slot table specifics aren't buried inside it. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-04platform/witherspoon: Remove PHB4_SHARED_SLOT_IDX_WITHERSPOON constantOliver O'Halloran1-6/+4
PHB4_SHARED_SLOT_IDX_WITHERSPOON is the index of the PHB which the shared slot is connected to rather than the index of the shared slot which the name suggests. This is confusing at best so this patch replaces the only usages of this macro with just the PHB number and a comment. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-04DT: Add ibm,firmware-versions nodeVasant Hegde1-0/+6
In P8, hostboot provides mini device tree. It contains /ibm,firmware-versions node which has various firmware component version details. In P9, OPAL is building device tree. This patch adds support to parse VERSION section of PNOR and create "/ibm,firmware-versions" device tree node. Sample output: /sys/firmware/devicetree/base/ibm,firmware-versions # lsprop . occ "6a00709" skiboot "v5.7-rc1-p344fb62" buildroot "2017.02.2-7-g23118ce" capp-ucode "9c73e9f" petitboot "v1.4.3-p98b6d83" sbe "02021c6" open-power "witherspoon-v1.17-128-gf1b53c7-dirty" .... .... Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Mukesh Ojha <mukesh02@linux.vnet.ibm.com> Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-08-11Recognize the 2s2u zz platformAnanth N Mavinakayanahalli1-0/+1
OPAL currently doesn't know about the 2s2u zz. It recognizes such a box as a generic BMC machine and fails to boot. Add the 2s2u as a supported platform. There will subsequently be a 2s2u-L system which may have a different compatible property, which will need to be handled later. Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-07-19platform/witherspoon: Enable eSEL loggingVasant Hegde3-1/+7
OpenBMC stack added IPMI OEM extension to log eSEL events. Lets enable eSEL logging from OPAL side. See: https://github.com/openbmc/openpower-host-ipmi-oem/blob/d9296050bcece5c2eca5ede0932d944b0ced66c9/oemhandler.cpp#L142 (yes, that is the documentation) Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: remove pnor access request, add link to OpenBMC doc] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-21platforms/astbmc/witherspoon.c: Add NPU2 slot mappingsAlistair Popple1-0/+272
For NVLink2 to function PCIe devices need to be associated with the right NVLinks. This association is supposed to be passed down to Skiboot via HDAT but those fields are still not correctly filled out. To work around this we add slot tables for the NVLinks similar to what we have for P8+. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-21platforms/astbmc/slots.c: Allow comparison of bus numbers when matching slotsAlistair Popple1-1/+1
When matching devices on multiple down stream PLX busses we need to compare more than just the device-id of the PCIe BDFN, so increase the mask to do so. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-19platforms/astbmc: Don't validate model on palmettoGavin Shan1-9/+2
The platform isn't compatible with palmetto until the root device-tree node's "model" property is NULL or "palmetto". However, we could have "TN71-BP012" for the property on palmetto. linux# cat /proc/device-tree/model TN71-BP012 This skips the validation on root device-tree node's "model" property on palmetto, meaning we check the "compatible" property only. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-16core/pci: Use PCI slot's power facality in pci_enable_bridge()Gavin Shan1-2/+4
The current implmentation has incorrect assumptions: there is always a PCI slot associated with root port and PCIe switch downstream port and all of them are capable to change its power state by register PCICAP_EXP_SLOTCTL. Firstly, there might not a PCI slot associated with the root port or PCIe switch downstream port. Secondly, the power isn't controlled by standard config register (PCICAP_EXP_SLOTCTL). There are I2C slave devices used to control the power states on Tuleta. In order to use the PCI slot's methods to manage the power states, this does: * Introduce PCI_SLOT_FLAG_ENFORCE, indicates the request operation is enforced to be applied. * pci_enable_bridge() is split into 3 functions: pci_bridge_power_on() to power it on; pci_enable_bridge() as a place holder and pci_bridge_wait_link() to wait the downstream link to come up. * In pci_bridge_power_on(), the PCI slot's specific power management methods are used if there is a PCI slot associated with the PCIe switch downstream port or root port. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-16platforms/ibm-fsp/firenze: Refactor firenze_pci_setup_power_mgt()Gavin Shan1-35/+44
This refactors firenze_pci_setup_power_mgt() and no logicial changes introduced: * Avoid nested if block; * Remove the local variable @buddy. The information is retrieved directly from struct firenze_pci_slot_info::buddy; * Comments to explain the fixed register offset (0x69) for slot's power control and shared power state between local slot and its buddy. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-16platforms/ibm-fsp/firenze: PCI slot fixup improvementGavin Shan1-46/+53
This introduces another data struct to describe the PCI slot fixup information. With that, the PCI slot fixup information table is decoupled from the PCI slot information table, to make the code easier to be maintained. In the meanwhile, the PCI slot information struct, which has been complexed, is simplified. It shouldn't introduce any functional changes. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-16platforms/ibm-fsp/firenze: Fix PCI slot power-off patternGavin Shan1-2/+2
When powering off the PCI slot, the corresponding bits should be set to 0bxx00xx00 instead of 0bxx11xx11. Otherwise, the specified PCI slot can't be put into power-off state. Fortunately, it didn't introduce any side-effects so far. Cc: stable # 5.3.0+ Fixes: 6884fe63ba1e ("platforms/ibm-fsp: Support PCI slot") Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-08platform/zz: Acknowledge OCC_LOAD mbox message in ZZShilpasri G Bhat1-1/+7
In P9 FSP box, OCC image is pre-loaded. So do not handle the load command and send SUCCESS to FSP on recieving OCC_LOAD mbox message. Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-07phb4: Activate shared PCI slot on witherspoonFrederic Barrat1-0/+94
Witherspoon systems come with a 'shared' PCI slot: physically, it looks like a x16 slot, but it's actually two x8 slots connected to two PHBs of two different chips. Taking advantage of it requires some logic on the PCI adapter. Only the Mellanox CX5 adapter is known to support it at the time of this writing. This patch enables support for the shared slot on witherspoon if a x16 adapter is detected. Each x8 slot has a presence bit, so both bits need to be set for the activation to take place. Slot sharing is activated through a gpio. Note that there's no easy way to be sure that the card is indeed a shared-slot compatible PCI adapter and not a normal x16 card. Plugging a normal x16 adapter on the shared slot should be avoided on witherspoon, as the link won't train on the second slot, resulting in a timeout and a longer boot time. Only the first slot is usable and the x16 adapter will end up using only half the lines. If the PCI card plugged on the physical slot is only x8 (or less), then the presence bit of the second slot is not set, so this patch does nothing. The x8 (or less) adapter should work like on any other physical slot. Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: re-org code, move into platform file] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-12GCC7: fixes for -Wimplicit-fallthrough expected regexesStewart Smith1-1/+2
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-04-28ibm-fsp: use opal-prd on p9 and aboveOliver O'Halloran1-0/+3
Previously the PRD tooling ran on the FSP, but it was moved into userspace on the host for OpenPower systems. For P9 this system was adopted for FSP systems too. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-04-20platform: Add p9dsuJim Yuan2-1/+56
Add p9dsu platform (AKA Boston). Signed-off-by: Jim Yuan <jim.yuan@supermicro.com> Signed-off-by: Michael Neuling <mikey@neuling.org>
2017-03-16zaius: Remove psi_set_external_irq_policy from platform initOliver O'Halloran1-1/+0
This function is specific to how Skiboot's P8 PSIHB driver. For P9 the PSIHB driver has been reworked completely and this doesn't do anything. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Acked-By: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-03-07System reset IPI facility and Mambo implementationNicholas Piggin1-0/+52
Add an opal call OPAL_SIGNAL_SYSTEM_RESET which allows system reset exceptions to be raised on other CPUs and act as an NMI IPI. There is an initial simple Mambo implementation, but allowances are made for a more complex hardware implementation. This API is based on the POWER8 implementation from Alistair Popple. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> [stewart@linux.vnet.ibm.com: minor RST fix] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-03-03platform: Add RomulusHank Chang2-1/+56
Signed-off-by: Hank Chang <chhank@tw.ibm.com> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-23astbmc/pnor: Use mbox-flash for flash accessesCyril Bur1-17/+31
If the BMC is MBOX protocol aware, request flash reads/writes over the MBOX regs. This inits the blocklevel for pnor access with mbox-flash. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-23ast-bmc: Use the mbox driverCyril Bur1-0/+42
The mbox registers are accessed via superIO, these need to be initialised. The mbox device node won't be present in the device tree hostboot passes us, so fixup the device tree. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-23platforms/astbmc: Support PCI slots for palmettoGavin Shan1-0/+84
This adds the PCI slots info for palmetto. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-22ast: Account for differences between 2400 vs 2500Michael Neuling1-10/+8
Currently astbmc_early_init() only applies to AST2400/POWER8. This fixes the code so it also applies to AST2500/POWER9 except for the PSI BAR fixup which is not needed on AST2500/POWER9. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-22ast: Look for POWER9 LPC in ast_fixup_dt()Michael Neuling1-0/+6
Currently ast_fixup_dt() only applies for P8. This enables P9 also. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-22platform: Add witherspoonMichael Neuling2-2/+61
+----------------------------------------------------------------------+ |ooooooooooooooooooooooooo=+++:++++::::~:::::::+==ooooooooooooooooooooo| |oooooooooooooooooooooo+++++++++++++:+:~...:++++:+==ooooooooooooooooooo| |oooooooooooooooooooo++++=++==+++::~~~~ .~~+++++++=oooooooooooooooooo| |oooooooooooooooooo+:++====+++::~..~~~~... .~:++++++++=oooooooooooooooo| |oooooooooooooooo=::++=+=++++:~~~:::::~~.. ~:++++++=++=ooooooooooooooo| |ooooooooooooooo=::+++++:++:::::+++:::~.....:++:+++++=++=oooooooooooooo| |oooooooooooooo+~::+:+:::::~::+++++++:~~:++::+++::++++===oooooooooooooo| |ooooooooooooo=:~:::::~:::::++++=+=+:::++++++:+++::++++====oooooooooooo| |ooooooooooooo:~::~::~~:::::++=+=++::+=++++++:++=:::++++===oooooooooooo| |oooooooooooo:~~~~~~~~~~:::+:++=+:++++++=+=+++++++:::+=+====ooooooooooo| |ooooooooooo+~~~~~~~~:~~:::++++::+=+++==+++++:::=+::::+=+===ooooooooooo| |oooooooooo=~~~:~~~~~~.~~:::++::++++++++++++++:++++::::+++==ooooooooooo| |oooooooooo:~.~~~~~.~..~~::::::+++++++++++++++:::++:::::=====oooooooooo| |ooooooooo+~..~:~....~.~~~~~~~~:+++++++::~~~~~::::++::::+==+=oooooo====| |oooooooo+~~.~:~~.~..~~::~... .~::+:+::~. ..~::::~::++=:+=o=o=====o| |ooooooo=~~..~:~~~ ~::~. .~~~:+++::~~:. .. .~:::~~~++=:+===oooooo=| |o=o==o=::~.~:::~~ :::+:~~~~~:::+:+=++:::::~~~:+++::~..:+=::+=====o==o| |=======~~.~::::: .~:++++++:::++++++++++++:++++++++:. .:++::+=o=======| |==o====~~~~~:::. .:::++++=+=+++:+++++++=+=+++++++: .~~+=:::=========| |ooo=oo=:~~~:~:: ..~~~:::+++++++++=+=++++++=++++:+:..~~~:+:~:===o=o=oo| |=o===o+:~~::~:.. ....~~~::+++++:~~:++::::++:+:+::+: .:::++~:+=ooooooo| |o=ooo=+:.::~~~. ... .~~~:::::+:::~~~:::++++::::::: ~::::=:~+=o=ooooo| |ooo=o+++:~~~~... .. .~~~::::+++++++++++++:::++:::: ~+:+:+~~:+o=oo=o=| |o=o=++==:~~..~. . ~~~:::::~~~:~~~~~:~~:::+::::~ .:::::+~.:+=o==o=o| |=o=+====:~..... ~~~:::+:::~:::::::+++:::::~ .+:~:++.~~+=oooooo| |====o==++:~.~~~... .~~~~:::+::::::+:+:+::::. :+:::+:.~:+=======| |o=====+=+=+~~~~... .~~:::::++++++++:+:::~ . .::++::~:::+==o====| |o==oo+=+=o=:::~~. .~..~~:++:++++++::~~..~...::+++++::+++=====o=| |=o====o=o=++::~. .~~~...~::::::::~...~~~~.~:+++++++++++==o==o=| |oo===oo=o=+:~~.... ~~~:~~~..........~~:::~~..:+++++++++===oooo=o| |=o===oo=+::~~~.. ~~~::~~~~~~~~~~~~:~~::~~~~~+++++++++====ooooo| |====++::~....... .. ~~:::~::::::~~~~~~~:~::::~.. .=+++=+=+====o=oo=| |==+:~~........ .. ...~:::::::::::::::~~::::::::~. .~+==++=++o===o=oo| |oo+.. ~~~~~:~::+::::::::::::::::::::::::~. ~:~~:=++=+==+==oooo| |=+:~~. .~~~:+::::+++:+::++::+:+:+:++:++:++:::~..+:.~::++++++++++==:| +----------------------------------------------------------------------+ Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-22astbmc/p8dnu: Enable PCI slot's power supply on PEX8718 in hot-add pathGavin Shan1-2/+4
This issue is reported from superMicro's "p8dnu" platform. PEX8718 is connected to PHB direct slot. We create dynamic PCI slots for its (2) downstream ports and all of them support surprise hotplug capability. The problem is power supply lost on hot-remove and it isn't turned on automatically on hot-add. It means the PCIe link behind the slot isn't up and the PCI adapter behind the slot can't be probed successfully. This fixes the issue by forcing to turn on the power supply on hardware when user (kernel) requests to do so, as we did for PEX9733. Reported-by: Hank Chang <hankmax0000@gmail.com> Signed-off-by: Gavin Shan <gwhsan@linux.vnet.ibm.com> Tested-by: Willie Liauw <williel@supermicro.com.tw> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-22astbmc/p8dnu: Enable PCI slot's power supply on PEX9733 in hot-add pathGavin Shan1-0/+13
This issue is reported from superMicro's "p8dnu" platform. PEX9733 is connected to PHB direct slot. We create dynamic PCI slots for its (5) downstream ports and all of them support surprise hotplug capability. The problem is power supply lost on hot-remove and it isn't turned on automatically on hot-add. It means the PCIe link behind the slot isn't up and the PCI adapter behind the slot can't be probed successfully. This fixes the issue by forcing to turn on the power supply on hardware when user (kernel) requests to do so. Those PCI slots are identified by additional flag (PCI_SLOT_FLAG_FORCE_POWERON). Reported-by: Hank Chang <hankmax0000@gmail.com> Signed-off-by: Gavin Shan <gwhsan@linux.vnet.ibm.com> Tested-by: Willie Liauw <williel@supermicro.com.tw> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-22platforms/astbmc: Support SMC's P8DNUWillie Liauw2-1/+361
This supports superMicro's P8DNU platform. Signed-off-by: Willie Liauw <williel@supermicro.com.tw> Signed-off-by: Hank Chang <hankmax0000@gmail.com> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-07uart: Fix Linux pass-through policyBenjamin Herrenschmidt2-1/+4
This was broken on Rhesus. Also add an nvram way of overriding the policy Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-02-02habanero/slottable: Remove Network Mezz(2, 0) from PHB1.ppaidipe@linux.vnet.ibm.com1-5/+0
With addition of latest callback of check_all_slot_table found below error message in habanero platform. [ 17.069198739,3] PCI: built-in device not found: Network Mezz (loc: 10) https://github.com/open-power/skiboot/issues/54 So PHB1 already having one Network Mezz(1,0) which is the only one there in the habanero platform design layout. check_all_slot_table found the additional Network Mezz(2,0) in slot table is in-correct. Fix this by removing it. Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-16platform: add zaiusOliver O'Halloran2-1/+54
WMWWMMMMMMWWMWMWMMMMMMMMMWWWMWMMMWMMWWWMWWWWWMWWWWWWWWWWMMWW WWKKWWWMMW0kXWWWMMMMMMMMMK wWWK ONW xW WW WWWN WW WWl xWWWl KWMMMMMMMMMXkkx .WWX k kWX lWW WN WWN KWW MWl x XMWl O OMMMMMMMMMMMMk OMWK oWk kMX lWW WN WW xWWW MWl NK WWl XK WWWMMMMMMWWW WWWK oWk kMX lWW WN WW 0MMM WWl NW NWl XN WWWMMWMMWWW0 .WWWK oWk xMX lWW WN WWX WWM WWl NN NMl Ko kWWWWWNNNNNN KNNN0 lNx xWX lWW WN WWW dWW WWl K xNNc L xXXXXXXXXXXO XXXXO lNo dX0 cXX XX NNWW WW XXc xXXXc kO KXXXXXXXXX OXXXXO l0o dX0 :XX KK XXXX KN XXo:kKXXXXl 0K KXXXXXXXX0 KXO oXx xX XXd dXXx oXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxxXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXNNWWWWNNNXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXNNXK00NNWWNNWWWNXXXXXXXXXXXXXXXXXXXXXXX0o XXXXXXXXXXXXXXXXXNNXOOO0XNXNNNXNWWWNXXXXXXXXXXXXXXXXXXXXKdcc XXXXXXXXXXXXXXXXNNKOOOk00XkxXNWWNKNWNXXXXXXXXXXXXXXXXX0dcccc XXXXXXXXXXXKXXXNWX00OOOO0OdloodKK0KWWNXXXXXXXXXXXXXXkocccccc XXXXXXXXXXXk0XNNKOOOdollokxlokkOOxOXWNXXXXXXXXXXXXKocccccccc KXXXXXXXXXXdkNX00O0ko:. ,ccc,..cKK0NNNXXXXXXXXXXOlccccccccc 0kOXXXXXXXKlON00O00Oo, ,lo; 'x0KWNNXXXXXXXXXkccccccccccc XKxox0XXXX0OWKOOO000Oxllodxxkdlldk0XWNNNXXXXXXKdcccccccccccc XXX0dcdkxdkWWK0OO00K0xlooooxkOkk0O0XWNNNXXXXXKoccccccccccccc KXXXXkccccdKNNX0KKK00dlllllllokKWXKNWWWNXXXX0occcccccccccccc dOKXKl:::::ONKKKXdO000xoooooodOKWNXWWWWNOO0klccccccccccccccc cccll::::::cl;cKk :OKNXkxxxkk0KKNWNWWWWNxoollcldlccccccccccc :::::::c:::;;;;:x oXWN0XWWWWXXNWWWWNWNKkdxllllxOxooooooollc ::;:doooooc;;;' ' .0WWXNWWWWKNKKWWNdkkdddddcllokOkxxxxxdxxx ::;ldlllod:;:;. ,doOWNWWNXX.cW0dcclddddxoccloOOxdxxdxxkk ;;;cdooodl;::, . .,:d0O;, ;:.ccc:cddddxl:clxOkxxxxkkkx ;;;oxlolo;;::. .ccc:ldxdddccllOkxxkxxkkx ;;;oooddl,::;. .l:c:oxdddlc::oxoxkxoc:: ;;;ooddd:;::' .l:c;odxdd:;;cxxko;;;;; ;,;ollol;:;:. ;l;;:xoool;;;xxd:,,,,, Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Enthusiastically-acked-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-16astbmc: Don't do P8 PSI or DT fixups on P9Oliver O'Halloran1-4/+10
We do some P8 specific hacks on BMC platforms to work around Hostboot not initialising the PSI BAR and to fix some problems in the hostboot provided device tree. These shouldn't be done on P9. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-16platform: add zzOliver O'Halloran2-1/+68
Adds a new platform for P9 FSP machines. Currently this is just a barebones FSP platform with the firenze/apollo PCI specific stuff removed. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-10mambo: add mprintf()Oliver O'Halloran1-0/+19
mprintf() is printf(), but it goes straight to the mambo console. This allows it to be independent of Skiboot's actual console infrastructure so it can be used for debugging the console drivers and for debugging code that runs before the console is setup. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-05treewide: squash sparse static warningsAndrew Donnellan2-3/+1
Add static to various declarations that can use it, as found by sparse. It turns out that one of these (fsp_pcie_inv_lock in platform/ibm-fsp/firenze.c) is actually unused, so remove it. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-04console: remove force_dummy_console()Oliver O'Halloran1-1/+0
force_dummy_console() was only ever used to ensure the dummy console would be initialised when the platform did not setup it's usual console. The new console init path will uses the dummy console by default so this is now unnecessary. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-04console: use opal_con_ops APIOliver O'Halloran2-4/+2
Adds a new structure that contains the implementations of the various OPAL console handlers. This is intended to replace the existing ad-hoc mechanism where the OPAL call handlers are overwritten in the OPAL console driver's init function. Currently this just moves the site where the OPAL call handlers are overwritten to inside of console.c, but it is intended to give us a mechanism for implementing features such as pointer validation for the OPAL console calls without having to manually update each driver. This also helps to clarify differences between the internal (skiboot) console and the external (OPAL) console. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-04console: move mambo con_ops into the platformOliver O'Halloran3-11/+69
There's no need for this to be in the skiboot core console code. Also do a few cleanups while we're shovling code around. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-04mambo: move callouts into separate header fileOliver O'Halloran2-39/+61
This just moves the mambo callout handlers into a private header file so we don't have to continue junking up the main platform file. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-12-13mambo: fake NVRAM supportChris Smart1-17/+3
This re-configures the Mambo platform to use the new fake NVRAM introduced by Jack Miller <jack@codezen.org> in commit: mambo: Add Fake NVRAM driver An existing NVRAM file can be loaded by pointing SKIBOOT_NVRAM environment variable to the file when running Mambo. If no NVRAM file is provided, the default is set to 256Kb and will be formatted automatically by Skiboot on boot, e.g.: [ 0.000975501,5 ] NVRAM: Size is 256 KB [ 0.002292860,3 ] NVRAM: Partition at offset 0x0 has incorrect 0 length [ 0.002298792,3 ] NVRAM: Re-initializing (size: 0x00040000) This has been tested in Mambo, on bare metal Linux, as well as OpenPower BMC machines. Signed-off-by: Chris Smart <chris@distroguy.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-12-13BMC/PCI: Check slot tables against detected devicesStewart Smith7-0/+94
On BMC machines, we have slot tables of built in PHBs, slots and devices that are physically present in the system (such as the BMC itself). We can use these tables to check what we *detected* against what *should* be in the system and throw an error if they differ. We have seen this occur a couple of times while still booting, giving the user just an empty petitboot screen and not much else to go on. This patch helps in that we get a skiboot error message, and at some point in the future when we pump them up to the OS we could get a big friendly error message telling you you're having a bad day. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Acked-by: Russell Currey <ruscur@russell.cc> [stewart@linux.vnet.ibm.com: add barreleye] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-11p8dtu: change OPAL esel command to IBM 0x3aleoluo1-0/+8
Signed-off-by: Jim Yuan <jim.yuan@supermicro.com> [stewart@linux.vnet.ibm.com: Adapted to new bmc_platform functionality] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-11Add SuperMicro p8dtu1u and p8dtu2u platformsleoluo2-1/+261
From: https://github.com/supermicro/p8dtu-op-build/blob/9e8242de579ce947a3d30df8b8ddb94584783f91/openpower/package/skiboot/skiboot-0001-add-p8dtu1u-and-p8dtu2u-mode-in-skiboot.patch Signed-off-by: Jim Yuan <jim.yuan@supermicro.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-08Add BMC platform to enable correct OEM IPMI commandsStewart Smith6-6/+18
An out of tree platform (p8dtu) uses a different IPMI OEM command for IPMI_PARTIAL_ADD_ESEL. This exposed some assumptions about the BMC implementation in our core code. Now, with platform.bmc, each platform can dictate (or detect) the BMC that is present. We allow it to be set at runtime rather than purely statically in struct platform as it's possible to have differing BMC implementations on the one machine (e.g. AMI BMC or OpenBMC). Acked-by: Jeremy Kerr <jk@ozlabs.org> [stewart@linux.vnet.ibm.com: remove enum, update (C) years] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>