summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Fill in the function that finds the GPIO baseMatt Spinler2018-08-141-2/+90
| | | | | | | | | | | Finds the GPIO base value to use in the GPIO number calculation. This is most likely specific to ASPEED BMCs, though as with the calling code additional support can be added in the future if required. Change-Id: Ie0d2b87286ab4bf6b05b61245bd821ab2a9d602a Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fill in function to convert GPIO pin to a numberMatt Spinler2018-08-141-1/+60
| | | | | | | | | | | | Convert the pin, like "A7" to the number that identifies that GPIO in /sys/class/gpio/. This most likely only supports ASPEED BMCs, though of course support can be added for others if the need arises and this code is still in use. Change-Id: I404716652ffc29c27933ed13225bc074341fa473 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Use cJSON to get the GPIO definitionsMatt Spinler2018-08-142-30/+110
| | | | | | | | | | | | In gpio_init, read the GPIO definitions out of the JSON instead of D-Bus. As many applications configure several GPIOs at once, the cJSON structure for the GPIOs stays loaded in memory until explicitly freed by calling gpio_inits_done(). Change-Id: I3ba216545a4a367744ce1fac09ca19c4d8d9d302 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Use cJSON to read the GPIO configurationMatt Spinler2018-08-141-129/+158
| | | | | | | | | | | Change the read_gpios function to get the power GPIO configuration out of JSON instead of D-Bus. Note that the Host Control GPIOs are no longer used and will be removed from the GpioConfigs structure in a future commit. Change-Id: If95f9b4f11af052148332aec436abd23e2e5819d Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add documentation on GPIO JSONMatt Spinler2018-08-141-0/+69
| | | | | | | Document the JSON format for the GPIO configuration. Change-Id: I74f9300f480724615ff031a7c75973224c86a760 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add function to load in the GPIO data from JSON.Matt Spinler2018-08-143-2/+79
| | | | | | | | | | | | | | Use the cJSON module to load in the GPIO definitions used by the other skeleton code into a cJSON structure. Its memory should be released by calling cJSON_Delete on it when complete. This is the first commit in a series that will move the GPIO configuration data from D-Bus into a JSON file, which is both more appropriate for read only data and the first step in getting rid of the system_manager.py file that currently hosts it. Change-Id: If1ef19e7988d28e3075828f61e88a606631bcd89 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* hostctl: Move to kernel FSI interfaceJoel Stanley2018-08-142-138/+108
| | | | | | | | | The Power8 systems now use the in-kernel FSI driver, so the GPIOs used for bitbanging are not available. This modifies the FSI SBE startup code to use the kernel FSI infrastructure. Change-Id: Ie7f7faab6af89b4311734eae4e252485a2163764 Signed-off-by: Joel Stanley <joel@jms.id.au>
* Add MAINTAINERS fileAndrew Jeffery2018-06-051-0/+46
| | | | | Change-Id: I0980c573087588bbdac7f224b36bdb9c48370d66 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* Spelling fixesGunnar Mills2018-04-112-2/+2
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: Ic21c2fe45c509d9821963e49610a2adbf761f8f9 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add error handing to recovery from gpio config failureYong Li2018-04-093-0/+7
| | | | | | | | | | | | | | | Sometimes these chassis related services will fail with below error: Power GPIO: call to getGpioConfiguration failed: GDBus.Error:org.freedesktop.DBus.Error.Service Unknown: The name org.openbmc.managers.System was not provided by any .service files These gpio pins cannot be configured properly, and cannot power on/off host. Add error handing to terminate the service in such error, systemd will restart them to try again Change-Id: I3ce7383825f2b9715fdd82e1dec0725cef83073c Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
* bmc_update.py: Use BMC state manager to reboot BMCLei YU2018-04-041-4/+6
| | | | | | | | | | | | | | | It was using BMC control service to call warmReset() to reboot BMC. But now legacy BMC control service is removed so the call will fail. Use BMC state manager instead to trigger BMC reboot. Partially resolves openbmc/openbmc#3064. Tested: Run legacy code update and verify PrepareForupdate() does reboot the BMC. Change-Id: I9f0fcddce9fb8f4007db0dd17b3cd3840c8848fc Signed-off-by: Lei YU <mine260309@gmail.com>
* Remove inventory_items.py from installationAndrew Geissler2018-04-021-1/+1
| | | | | | | | | | | The old inventory manager is no longer needed with the final integration of phosphor-inventory-manager complete https://gerrit.openbmc-project.xyz/#/c/8793/ must be merged before this commit. Change-Id: I9ce3616b0e9aa272ea1254073e4c7b28353abf0a Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Add getObjectFrom* interfaces back inAndrew Geissler2018-03-271-1/+33
| | | | | | | | | | | | | | | | | Got a bit zealous with the removal of "legacy" interfaces from system_manager.py in https://gerrit.openbmc-project.xyz/#/c/8874/ and removed some still required by phosphor-host-ipmid code for some of the legacy sensors. Only adding the minimum required back in with this commit. Tested: Flashed image on witherspoon and verified host errors are no longer reported. Resolves openbmc/openbmc#2975 Change-Id: I6ba601be6310c57122f5e2f1dc37c6eae5417771 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Port to python 3CamVan Nguyen2018-03-127-44/+68
| | | | | | | | | | Port code to python 3 yet remain backward compatible to python 2. This port is in preparation for yocto 2.4 upgrade. Partially resolves openbmc/openbmc#2920 Change-Id: If174ce9444bde4e21fb086764f4def017e423201 Signed-off-by: CamVan Nguyen <ctnguyen@us.ibm.com>
* pytools: Add completion script for obmcutilAndrew Jeffery2018-02-261-0/+11
| | | | | Change-Id: Ia248f971e2c8a1ff80f1e6947ef0af283d4ec9ba Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* Remove all legacy function from system managerAndrew Geissler2018-02-161-132/+0
| | | | | | | | | | | | | | This commit removes all of the un-used interfaces in order to get it down to its bare function and to make eventual removal of this legacy application easier Tested: Built image and verified witherspoon system still powers on as expected and no new errors or issues show up in basic regression. Change-Id: I55b7f3ebe68ce224bfccf14b0e9a4ceb4617f3d8 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Remove use of settings in chassis_control.pyAndrew Geissler2018-02-151-16/+0
| | | | | | | | | | | | This application is slowly being deprecated. This change is to allow us to pull the legacy settings object out of the image. Tested: I built an image with these changes plus the removal of settings and verified our CT regression bucket still passed. Change-Id: Ia9416b2faba9a0e3b10f433a0e597530f75177e5 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Remove use of legacy system stateAndrew Geissler2018-02-155-118/+198
| | | | | | | | | The OpenBMC state function has been moved to the phosphor-state-manager repository. The chassis power state is tracked via systemd targets so notification from this power application is no longer needed. Change-Id: Ie74b0fe589944ab65645f92ab3539c2ee74dda9c Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* pep8 fixesAdriana Kobylak2018-02-1210-27/+47
| | | | | | | | Also ignore the configs/ directory since it only contains system configuration files named <system>.py. Change-Id: I0416239c4030ce5bc39473e65e560016cd4ffc75 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* obmcutil: alias status to stateJoel Stanley2018-01-311-1/+2
| | | | | | | | Save users who assume the machine status is available with 'obmcutil status' by aliasing status to state. Change-Id: Icdfa6f62ff6f719386edd892ec80fe29c32087f0 Signed-off-by: Joel Stanley <joel@jms.id.au>
* Allow PGOOD polling interval of 500msMatt Spinler2017-12-221-2/+2
| | | | | | | | | | The code has an explicit check for a minimum allowed PGOOD polling interval. Decrease that from 1s to 500ms as there are new requirements on a specific system to poll at the 500ms. Change-Id: If42ecc9244b5e0d8d5b5c17275241f820537d34a Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Rename board configuration fileJames Feist2017-12-121-0/+0
| | | | | | | The device tree file is s2600wf.dts, update to match. Change-Id: Iefcfefd8b6329aa9afb4b831882e2861a0f6a30a Signed-off-by: James Feist <james.feist@linux.intel.com>
* Updating PS redundancy object path.Dhruvaraj Subhashchandran2017-12-091-1/+1
| | | | | | | | | | | Changing the PS redundancy object path from /org/openbmc/sensors/host/PowerSupplyRedundancy to /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy since All Witherspoon REST API URIs should being with xyz/openbmc_project or org/open_power Change-Id: Ic1360cef2b4939835d47b995a8542aee598bb939 Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
* Add lseek to support GPIO read/writeYong Li2017-12-041-0/+17
| | | | | | | | | GPIO api does not support repeat read(read multi times after one open). A workaround is close and reopen the device before the second read. The root cause is that the file descriptor is not moved to beginning of the file, this patch can fix this issue Change-Id: I40e5602669c9ab6f0dddf5aa77040466cbfa3738 Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
* Add initial Wfp config to be able to build platform.James Feist2017-11-281-0/+42
| | | | | | | Wfp is an Intel platform. Change-Id: I0991d404f6c5fb8d35d7b524caff0d194d75ee90 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Remove pci_reset from Romulus configLei YU2017-11-231-2/+1
| | | | | | | | The pci_reset GPIOs are not connected on PASS2 Romulus. There is no need to toggle the GPIOs. Change-Id: I78afa4358e2540d72517d5f2ae953f0e6319db1e Signed-off-by: Lei YU <mine260309@gmail.com>
* Spelling fixesGunnar Mills2017-10-256-81/+81
| | | | | Change-Id: Ia4ded0c195204543c3df671ea471610237f5f44b Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add basename for file name in download managerGunnar Mills2017-10-241-2/+3
| | | | | | | | | | | | Added getting the basename for the output file name in download manager. This is to prevent any security holes that would let the user out of the FLASH_DOWNLOAD_PATH dir. (e.g. passing a file name of ../etc/shadow) Resolves openbmc/openbmc#1898 Change-Id: Ie33fe56599e86c29da4b2eae8ef070f0866d054c Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* pytools: obmcutil: Add `chassiskill` commandAndrew Jeffery2017-10-191-0/+78
| | | | | | | | | | | | | | | Nick reported an issue where the BMC became unusable after the host hit a bug and began "spewing a lot of messages to the console". Save ourselves some DBus transactions and immediate execution of systemd transitions by introducing a `chassiskill` command to directly deassert the the power-up GPIO ourselves. This will immediately terminate the host and free up resources for the BMC to become responsive. As a bonus, the PGOOD monitoring will then execute to clean up the resulting inconsistent BMC/Host state for us. Change-Id: I106a4202b6544b8e78b04938230a4eeee5f132bb Requested-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Optionally wait for standby before getting objectsAndrew Jeffery2017-10-171-1/+42
| | | | | | | | | | | If the user passes --wait, try to immediately get the object but wait until we reach standby before trying again if the first attempt fails. The correct strategy is probably to look for registration of names on the bus, but this ghetto approach also works. Change-Id: I71b6f5d4fcf5841510da6f9877726b875b019d51 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Use 'in' test rather than dict.has_key()Andrew Jeffery2017-10-171-2/+2
| | | | | Change-Id: I51b4d8a9760e0c73f0c36ff6619a484718db3a4b Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Remove unnecessary parenthesesAndrew Jeffery2017-10-171-1/+1
| | | | | Change-Id: I902c6674111a6c1790d08ddf02819dddeede970d Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Implement verbose modeAndrew Jeffery2017-10-171-0/+17
| | | | | | | | | | | | | | | | | | Verbose output is limited to state change requests at the moment, as they are the operations that take significant amounts of time. Further, the verbose output is implemented as following the tail of the journal until the requested state change either succeeds or fails. In testing it was observed that the journal output tends to lag the DBus event that signals the completion of the state transition. As such the patch adds a tuning parameter defining a further waiting period beyond the receipt of the completion signal so that the verbose output looks "reasonable". The default value of the tuning parameter was roughly chosen to correlate well with the journal output on a Witherspoon system for the `poweron` command. Change-Id: I847e2bfeba55d6a3d7d1f7ff1ba1901993c9b505 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Implement blocking behaviourAndrew Jeffery2017-10-171-13/+63
| | | | | | | | | | | | | | | | | | | | The technique to block is to attach a listener for systemd JobRemoved property change events, change the desired OpenBMC state management property to trigger the systemd transition, and then run the gobject dbus mainloop. We terminate the mainloop by invoking quit() in the callback on the captured mainloop object. Additionally, the result of the transition (success or failure) is judged in the callback. We can't obtain the result by returning it, and as we are using Python 2 we cannot meaningfully mutate captured variables to expose it. Instead, a variable is created on the callback function object after it is defined but before the function is invoked, which is mutated inside the function (which can reference its own object) when called. The result is retrieved after the mainloop has terminated and is propagated up the call chain to form the exit status. Change-Id: Ic19aa604631177abea7580de2357d8c6812ee874 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Use format string for all-props outputAndrew Jeffery2017-10-171-1/+1
| | | | | Change-Id: I9d803da8c0ff8862039bb5b7adc07952208820d1 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Consistent naming for command descriptorsAndrew Jeffery2017-10-171-17/+17
| | | | | Change-Id: Ibb6d90dbca9c1bffd7b714dc70342b7927ced94e Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Use argparseAndrew Jeffery2017-10-171-28/+9
| | | | | Change-Id: Id33e3802530aa1bf0cb2af88c16bd94f8bfa219d Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Drop ElementTree and json importsAndrew Jeffery2017-10-171-2/+0
| | | | | Change-Id: I2e310eef36eb7bcea58d1567dcf3efe9a9dbeeb8 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Introduce run_all_commands()Andrew Jeffery2017-10-171-5/+13
| | | | | | | | | | This implements the partner for-loop to the run_one_command() function, moving the implementation out of main(). Again this is to elevate the main() implementation to a higher level of abstraction and reduce cyclomatic complexity. Change-Id: I0abe5ee026750efd10dafb6f113359f035ba5bd8 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Introduce run_one_command()Andrew Jeffery2017-10-171-20/+21
| | | | | | | | | Move the complexity of the for-loop body implementation away from the loop itself. This reduces the general cyclomatic complexity a little and allows for easier consideration of the implementation in isolation. Change-Id: Id779dec720d3582cf89cd9981bcfd8b101b0d386 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Drop redundant prop assignment and testAndrew Jeffery2017-10-161-5/+2
| | | | | Change-Id: I0b1b023aeac7103f0be92201c2475193b0f69e5c Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Collapse redundant assignment and testAndrew Jeffery2017-10-161-4/+1
| | | | | Change-Id: Ie461546c9056829b1b4a081a4031ac91c10e6a42 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Drop ability to set properties from the commandlineAndrew Jeffery2017-10-161-2/+0
| | | | | | | | | This was prioritised below the built-in value anyway so I suspect it is an unused feature, especially now that the org.openbmc interfaces (and the method feature) have gone away. Change-Id: Icd5ab91b5fc08b0f6cc461390f4ac39f7e9e41cd Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Collapse nested conditionsAndrew Jeffery2017-10-161-3/+2
| | | | | Change-Id: Idb1f30dc553cfa95b4669df317a5dbac5dbe8966 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Assign None to val by defaultAndrew Jeffery2017-10-161-2/+1
| | | | | | | And remove a now-redundant branch. Change-Id: I92e91cfb307a98cd60a26e5e5d34bf0ddc384d3f Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Properly use format stringAndrew Jeffery2017-10-161-1/+1
| | | | | | | This changes the format slightly, but not for the worse in my opinion. Change-Id: Ie9297c22f8c3ceff4fc56ae567dbdbb0f128dd51 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Drop parentheses from conditionsAndrew Jeffery2017-10-161-3/+3
| | | | | Change-Id: I85b74febc33e8f44d9df86718ce6e3ba1d6d6933 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Make prop use None instead of empty stringAndrew Jeffery2017-10-161-2/+2
| | | | | Change-Id: I54e04fba2108edce0dbe504ae40f4ae4e073188e Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Rename property_value to valAndrew Jeffery2017-10-161-5/+5
| | | | | Change-Id: I768fbffde2025bb0f92b3aa82fe00f558a68fc2b Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Rename property_name to propAndrew Jeffery2017-10-161-6/+6
| | | | | Change-Id: Ia71c777dd41ca5551319f0a733dbdfce248a876b Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
OpenPOWER on IntegriCloud