summaryrefslogtreecommitdiffstats
path: root/libopenbmc_intf
Commit message (Collapse)AuthorAgeFilesLines
* skeleton: Use ioctl gpio handlingAnthony Wilson2019-04-102-197/+60
| | | | | | | | | | | | | Now that chassiskill is a standalone app and is using ioctl gpio handling (through the gpioplus library), the gpio libraries here need to use ioctl as well for chassiskill to be compatible. Tested: Verified chassiskill works as intended and checked that nothing else broke. Change-Id: I67c431027d31e87c332c3e1771fc2d3423f56652 Signed-off-by: Anthony Wilson <wilsonan@us.ibm.com>
* Remove unnecessary args from GPIO functionsMatt Spinler2018-08-144-4/+4
| | | | | | | | Now that gpio_init() and read_gpios() doesn't use D-Bus, they don't need the D-Bus connection parameter. Change-Id: Id7f3ee6547bed7c0c0eed5d75cba2d6ff239d0fa Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Remove host control GPIOs from GpioConfigsMatt Spinler2018-08-142-19/+0
| | | | | | | These are not used anymore. Change-Id: I4bf8f0538aafeec768075fd51236a50f1f97b3d8 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* 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-141-1/+1
| | | | | | | | | 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>
* Remove use of legacy system stateAndrew Geissler2018-02-153-108/+197
| | | | | | | | | 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>
* 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>
* Spelling fixesGunnar Mills2017-10-251-76/+76
| | | | | Change-Id: Ia4ded0c195204543c3df671ea471610237f5f44b Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Rename power_gpio to gpio_configs.Lei YU2017-01-123-3/+3
| | | | | Change-Id: I22382fbb19a077e333aba93ae81ae614ec0cb70a Signed-off-by: Lei YU <mine260309@gmail.com>
* GPIO abstraction for power and host controlLei YU2017-01-122-55/+113
| | | | | | | | | | | | | | | | | | | | In libopenbmc_intf/power_gpio.c there are GPIO abstractions for power related GPIOs. Host control related GPIOs need to do the same abstraction. The changes include: 1. Add host control related GPIOs in gpio_configs and update system_manager.py 2. Update control_host_obj.c to use the abstracted GPIOs 3. Update GPIO_CONFIGS for all machines and add host control related GPIOs power_gpio will be renamed to gpio_configs in next commit; Resolves openbmc/openbmc#814 Change-Id: I7832065d495d7d64c5df2f5b177005b97e68900a Signed-off-by: Lei YU <mine260309@gmail.com>
* Initialize GError* to NULL before calling g_dbus_proxy_new_synLei YU2016-11-191-1/+1
| | | | | | | | | | | | This fixes the crash issue of power_control when manually build and replace executable or library. The reason why it does not crash on a full OpenBMC build may be due to the prelink clear the stack (not sure). Fixes openbmc/openbmc#818. Change-Id: I17b0e2188ebe14815d67a7f07eba4906bde75e3c Signed-off-by: Lei YU <mine260309@gmail.com>
* op-pwrctl: Hold PCI resets until BootProgress passes BASE_INITIALIZATION stateYi Li2016-11-182-2/+37
| | | | | | | | | | | | When powering on host, hold PCI resets until hostboot passes stage "BASE_INITIALIZATION"(0x14). This fix applies to Firestone and Garrison. Partially resolves openbmc/openbmc#315 Change-Id: Ic71c81406ac188b34df89569e2264ea0b94406f3 Signed-off-by: Yi Li <adamliyi@msn.com>
* Add IPMI 2.0 ColdReset command supportNan Li2016-11-013-17/+174
| | | | | | | | | | * Implement reset by reboot command issued in a shell * Work with related changes in phosphor-host-ipmid repo Resolves openbmc/openbmc#437 Change-Id: I8143b1ee9c0d547ee47e5bd3659a5126b6e5af98 Signed-off-by: Nan Li <william.bjlinan@hotmail.com>
* pwrctl: Add latch output to power controlXo Wang2016-10-042-2/+10
| | | | | | | | | | | | On the Zaius machine, the BMC signals that power up the CPU are gated by a latch to protect against GPIO blips during BMC reset/power loss. This adds an optional power GPIO configuration that controls the latch's enable pin. Its behavior is to assert high when the op-pwrctl runs, allowing power_up lines to propagate past their latches. Signed-off-by: Xo Wang <xow@google.com> Change-Id: Ibf0d1db771033cb9bba82575cca1bd21cfb3ad3d
* system_manager, libobmc-intf: Add power GPIO configuration interfaceXo Wang2016-10-043-2/+170
| | | | | | | | | | | | | This adds a dbus call (in org.openbmc.managers.System) and C binding (in libopenbmc-intf) to read a POWER_CONFIG from the Python system configuration that abstracts GPIO functionality (power good, reset, etc) from their net names in GPIO_CONFIG. This should eventually replace machine-specific patches to op-pwrctl that define their own power and reset lines. Change-Id: I56eaaf60ef852b68124e4a765942243ad17d06ac Signed-off-by: Xo Wang <xow@google.com>
* gpio: Avoid glitching 'out'-direction GPIOsPatrick Williams2016-08-241-3/+21
| | | | | Change-Id: I42dafd3235d13ec57f7b15e043bc3fe82fdb4665 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* gpio: Fix sprintf to uninitialized pointerPatrick Williams2016-08-241-1/+3
| | | | | Change-Id: Ife1759b1533b37e0a8c94748334ea2c5f02ba873 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* gpio: Clean trailing whitespacePatrick Williams2016-08-241-6/+6
| | | | | Change-Id: I359e5bab739e3b029a3331b0acfbf54e8db1120c Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* libopenbmc_intf: Fix non-arm devmem implementationJoel Stanley2016-06-291-1/+1
| | | | | | | | | | Fixes the following error: In file included from button_reset_obj.c:4:0: ../libopenbmc_intf/openbmc.h:39:15: error: return type defaults to ‘int’ [-Werror=implicit-int] static inline devmem(uint32_t val, uint32_t reg) Signed-off-by: Joel Stanley <joel@jms.id.au>
* libopenbmc_intf rules simplificationBrad Bishop2016-06-271-18/+25
| | | | | | | | | Don't use rules.mk for libopenbmc_intf. There isn't enough overlap here to warrant the extra complexity. Fix an issue where the library is rebuilt for every make invocation. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Create a libopenbmc_intf symlinkBrad Bishop2016-06-271-0/+2
| | | | | | | | | Create a libopenbmc_intf symlink in the build target to enable things like: -L ../libopenbmc_intf -lopenbmc_intf Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Update and run libopenbmc_intf codegenBrad Bishop2016-06-272-4/+4
| | | | | | | Update codegen to reflect new path xml/output locations. Run updated codegen. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Move libopenbmc_intf codegen/xmlBrad Bishop2016-06-274-2/+36726
| | | | | | To the libopenbmc_intf directory. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* libopenbmc_intf include path updateBrad Bishop2016-06-272-2/+1
| | | | | | | | | Remove the interfaces prefix from applications including openbmc_intf.h. Use brackets rather than quotes in prep for a libopenbmc_intf SDK package. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add force link option to install targetBrad Bishop2016-06-271-1/+1
| | | | | | This allows 'make install' to be invoked more than once. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add install-headers targetBrad Bishop2016-06-271-1/+6
| | | | | | | Install the libopenbmc_intf includes in prep for a devel package. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Enable user-overriable CFLAGSBrad Bishop2016-06-211-2/+2
| | | | | | | | | Put required CFLAGS (ie pkg-config --cflags) in ALL_CFLAGS and append user specified CFLAGS to that. Use CFLAGS during link. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Reorganize directory structureBrad Bishop2016-06-106-0/+349
Moving to directory per-application layout. This facilitates building single applications which is useful in the Yocto build environment since different applications satisfy different OpenBMC build requirements. A number of issues are also addressed: - All applications were pulling in libsystemd and the gdbus libs irrespective of whether or not they were needed. - gpio.o duplicated in every application - moved to libopenbmc_intf - Added install target Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud