summaryrefslogtreecommitdiff
path: root/drivers/power
Commit message (Collapse)AuthorAgeFilesLines
* x86: apl: Add PMC driverSimon Glass2019-12-151-0/+56
| | | | | | | | Add a driver for the Apollo Lake SoC. It supports the basic operations and can use device tree or of-platdata. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: sandbox: Add a PMC emulator and testSimon Glass2019-12-154-0/+353
| | | | | | | Add a simple PMC for sandbox to permit tests to run. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* x86: power: Add an ACPI PMC uclassSimon Glass2019-12-154-0/+220
| | | | | | | | | Intel x86 SoCs have a power manager/controller which handles several power-related aspects of the platform. Add a uclass for this, with a few useful operations. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* common: Move get_ticks() function out of common.hSimon Glass2019-12-021-0/+1
| | | | | | | This function belongs in time.h so move it over and add a comment. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* power: fan53555: fix fan53555_regulator_set_valueVasily Khoruzhick2019-11-231-1/+1
| | | | | | | | | fan53555_regulator_set_value() passes its own dev to pmic_clrsetbits() instead of its parent (pmic). As result u-boot crashes when you try to set voltage on fan53555 regulator Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
* power: fan53555: add support for Silergy SYR82X and SYR83XVasily Khoruzhick2019-11-232-14/+38
| | | | | | | | | SYR82X and SYR83X are almost identical to FAN53555, the only difference is different die ID and revision, voltage ranges and steps. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Tested-by: Anand Moon <linux.amoon@gmail.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
* Merge tag 'u-boot-imx-20191105' of ↵Tom Rini2019-11-123-250/+337
|\ | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20191105 ------------------- i.MX8MN SoC support ROM API image download support i.MX8MM enet enabling
| * power: domain: add i.MX8 scu power domain driverPeng Fan2019-11-052-1/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The power domain tree is not accepted by Linux Kernel upstream. only a single pd node is used currently, as following: pd: imx8qx-pd { compatible = "fsl,imx8qm-scu-pd", "fsl,scu-pd"; #power-domain-cells = <1>; }; So to migrate to use upstream linux dts, we also need a driver to support this. This patch is to support the new method, compared with legacy power domain tree, it will be simpiler, because each device will has resource id as power domain index, it will be directly passed to scfw, and no need to let power domain build that tree. If multiple power domain is needed, it is the dts node should has correctly power domains entry added and sequence correct. Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * power: domain: make imx8-power-domain.c legacyPeng Fan2019-11-052-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The current i.MX8 power domain driver is based on i.MX vendor power domain tree which will retire later. The Linux upstream use a single pd node for power domain driver, and U-Boot will adopt that. When U-Boot i.MX8 dts synced with Linux Kernel upstream and related driver ready, the legacy driver will be removed. Signed-off-by: Peng Fan <peng.fan@nxp.com>
* | Merge tag 'u-boot-rockchip-20191110' of ↵Tom Rini2019-11-113-88/+1010
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-rockchip - Add support for rockchip pmic rk805,rk809, rk816, rk817 - Add rk3399 board Leez support - Fix bug in rk3328 ram driver - Adapt SPL to support ATF bl31 with entry at 0x40000 - Fix the u8 type comparision with '-1'. - Fix checkpatch warning for multi blank line and review signature.
| * | power: pmic: rk809: support rk809 pmicJoseph Chen2019-11-102-1/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RK809 is a Power Management IC (PMIC) for multimedia and handheld devices. They contains the following components: - Regulators(5*BUCKs, 9*LDOs, 2*SWITCHes) - RTC - Clocking Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
| * | power: pmic: rk817: support rk817 pmicJoseph Chen2019-11-102-7/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RK817 is a Power Management IC (PMIC) for multimedia and handheld devices. They contains the following components: - Regulators(4*BUCKs, 1* BOOST, 9*LDOs, 1*SWITCH) - RTC - Clocking Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
| * | power: pmic: rk805: support rk805 pmicElaine Zhang2019-11-102-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RK805 are a Power Management IC (PMIC) for multimedia and handheld devices. They contains the following components: - Regulators(4*BUCKs, 3*LDOs) - RTC - Clocking Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
| * | power: pmic: rk816: support rk816 pmicElaine Zhang2019-11-102-5/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RK816 is a Power Management IC (PMIC) for multimedia and handheld devices. They contains the following components: - Regulators(4*BUCKs, 1*BOOST, 6*LDOs, 1*SWITCH) - RTC - Clocking Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
| * | power: regulator: rk8xx: update the driver for rk808 and rk818Elaine Zhang2019-11-101-82/+465
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to adapt the following pmics, make the interface more compatible. Support buck and ldo suspend voltage setting and getting. Supprot buck and ldo suspend enable/disable setting and getting. Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
| * | dm: regulator: support regulator more stateJoseph Chen2019-11-101-0/+70
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | support parse regulator standard property: regulator-off-in-suspend; regulator-init-microvolt; regulator-suspend-microvolt: regulator_get_suspend_enable regulator_set_suspend_enable regulator_get_suspend_value regulator_set_suspend_value Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
* | power: regulator: tps65941: add regulator supportKeerthy2019-11-073-0/+418
| | | | | | | | | | | | | | The driver provides regulator set/get voltage enable/disable functions for tps65941 family of PMICs. Signed-off-by: Keerthy <j-keerthy@ti.com>
* | power: pmic: tps65941: Add support for tps65941 family of PMICsKeerthy2019-11-073-0/+91
| | | | | | | | | | | | Add support to bind the regulators/child nodes with the pmic. Signed-off-by: Keerthy <j-keerthy@ti.com>
* | power: regulator: tps6236x: add support for tps6236x regulatorsTero Kristo2019-11-073-0/+134
|/ | | | | | | | | TPS6236x is a family of step down DC-DC converters optimized for battery powered portable applications for a small solution size. Add a regulator driver for supporting these devices. Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Keerthy <j-keerthy@ti.com>
* mach-imx: Adding new argument for SIP call interfaceYe Li2019-11-031-2/+4
| | | | | | | | | | | Need to pass total 5 arguments for SIP HAB call on i.MX8MQ, so update the interface to add new argument. Signed-off-by: Ye Li <ye.li@nxp.com> [agust: fixed imx8m-power-domain build] Signed-off-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Patrick Wildt <patrick@blueri.se> Reviewed-by: Peng Fan <peng.fan@nxp.com>
* power: pmic: Kconfig: add CONFIG_SPL_DM_PMIC_BD71837Peng Fan2019-11-031-0/+8
| | | | | | | Add CONFIG_SPL_DM_PMIC_BD71837 to make this driver could be used in SPL stage Signed-off-by: Peng Fan <peng.fan@nxp.com>
* pmic: bd71837: drop DEBUG macroPeng Fan2019-11-031-2/+0
| | | | | | Drop DEBUG macro definition which is used for debug purpose. Signed-off-by: Peng Fan <peng.fan@nxp.com>
* power: domain: add Amlogic Everything-Else power domain driverNeil Armstrong2019-10-183-0/+438
| | | | | | | | | | Based on the 54ecb8f7028c ("Linux 5.4-rc1") Everything-Else power domain driver for Amlogic SoCs. This driver handles the VPU Power domain and other domains from the Everything-Else part of the SM1 and G12A SoCs. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
* power: domain: meson-gx-pwrc: add G12A supportNeil Armstrong2019-10-181-10/+145
| | | | | | | | Add Amlogic G12A support for the gx-pwrc driver, aligned on the Linux v5.2 driver. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Anatolij Gustschin <agust@denx.de>
* power: domain: Introduce dev_power_domain_offLokesh Vutla2019-10-151-7/+28
| | | | | | | | Add dev_power_domain_off() api to disable all the power-domains corresponding to a device Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: domain: add dev_power_domain_onPeng Fan2019-10-151-0/+21
| | | | | | | | | | Add this new API to power on multiple domains attached to a device. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Changed to static inline and added a condition into C file: Signed-off-by: Simon Glass <sjg@chromium.org>
* regulator: fixed: Modify enable-active-high behaviorPatrice Chotard2019-10-111-1/+6
| | | | | | | | | | | | | | | Regulator should not be enabled at probe time if regulator-boot-on property is not in the dt node. "enable-active-high" property is only used to indicate the GPIO polarity. See kernel documentation : - Documentation/devicetree/bindings/regulator/fixed-regulator.yaml - Documentation/devicetree/bindings/regulator/gpio-regulator.yaml Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
* imx: add support for i.MX8MQ power domain controllerPatrick Wildt2019-10-083-0/+145
| | | | | | | | | | Add support for the power domain controller that's used on the i.MX8MQ. This will be needed to be able to power on the PCIe controller. Bindings taken from Linux, driver implementation taken from the i.MX8 power domain controller and adjusted for the i.MX8M SoC. Signed-off-by: Patrick Wildt <patrick@blueri.se>
* stpmic1: simplify stpmic1_sysreset_requestPatrick Delaunay2019-08-271-8/+1
| | | | | | | Retrieve parent device from dev->parent instead of calling uclass_get_device_by_driver() Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* pmu: stpmic1: change specific NVM api to MISCPatrick Delaunay2019-08-271-42/+56
| | | | | | | | | Use MISC u-class to export the NVM register (starting at 0xF8 offset) and avoid specific API. - SHADOW have offset < 0. - NVM have register > 0 Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* sysreset: move stm32mp sysreset poweroff implementation to sysreset uclassUrja Rannikko2019-08-191-0/+1
| | | | | | | | | | | | | | | This is a generic implementation. Add CONFIG_SYSRESET_CMD_POWEROFF to signal when we need it. Enable it from the STPMIC1 config and in sandbox. The config flag is transitionary, that is it can be removed after all poweroff implementations use sysreset, and just have CMD_POWEROFF depend on sysreset. Signed-off-by: Urja Rannikko <urjaman@gmail.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com> Tested-by: Patrick Delaunay <patrick.delaunay@st.com>
* power: domain: ti-sci-power-domain: Add device ID info to get/set_device failureNishanth Menon2019-08-121-4/+4
| | | | | | | | | | | Failure log for ti_sci_power_domain_on/off is as below: "ti_sci_power_domain_on: get/set_device failed (-19)" The above information is useless for debug without information on what specific device access failed. So add that information as well. Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
* Merge branch '2019-07-26-ti-imports'WIP/27Jul2019Tom Rini2019-07-271-1/+30
|\ | | | | | | | | - Bring in the rest of the J271E platform - Various OMAP3/AM3517, DA850 fixes
| * power: domain: ti_sci_power_domains: Add support for exclusive and shared accessLokesh Vutla2019-07-261-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TISCI protocol supports for enabling the device either with exclusive permissions for the requesting host or with sharing across the hosts. There are certain devices which are exclusive to Linux context and there are certain devices that are shared across different host contexts. So add support for getting this information from DT by increasing the power-domain cells to 2. For keeping the DT backward compatibility intact, defaulting the device permissions to set the exclusive flag set. In this case the power-domain-cells is 1. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
* | regulator: bd718x7: support ROHM BD71837 and BD71847 PMICsMatti Vaittinen2019-07-194-5/+513
|/ | | | | | | | | | | | | | | | | | | | | | | | | BD71837 and BD71847 is PMIC intended for powering single-core, dual-core, and quad-core SoC’s such as NXP-i.MX 8M. BD71847 is used for example on NXP imx8mm EVK. Add regulator driver for ROHM BD71837 and BD71847 PMICs. BD71837 contains 8 bucks and 7 LDOS. BD71847 is reduced version containing 6 bucks and 6 LDOs. Voltages for DVS bucks (1-4 on BD71837, 1 and 2 on BD71847) can be adjusted when regulators are enabled. For other bucks and LDOs we may have over- or undershooting if voltage is adjusted when regulator is enabled. Thus this is prevented by default. BD718x7 has a quirk which may leave power output disabled after reset if enable/disable state was controlled by SW. Thus the SW control is only allowed for BD71837 bucks 3 and 4 by default. The impact of this limitation must be evaluated board-by board and restrictions may need to be modified. (Linux driver get's these limitations from DT and we may want to implement same on u-Boot driver). Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* regulator: Allow enabling GPIO regulatorSven Schwermer2019-07-182-1/+19
| | | | | | | | | | Drivers need to be able to enable regulators that may be implemented as GPIO regulators. Example: fsl_esdhc enables the vqmmc supply which is commonly implemented as a GPIO regulator in order to switch between I/O voltage levels. Signed-off-by: Sven Schwermer <sven@svenschwermer.de> Reviewed-by: Lukasz Majewski <lukma@denx.de>
* regulator: Factor out common enable codeSven Schwermer2019-07-185-69/+124
| | | | | | | | | In preparation of being able to enable/disable GPIO regulators, the code that will be shared among the two kinds to regulators is factored out into its own source files. Signed-off-by: Sven Schwermer <sven@svenschwermer.de> Reviewed-by: Lukasz Majewski <lukma@denx.de>
* Merge tag 'u-boot-stm32-20190712' of ↵Tom Rini2019-07-143-4/+10
|\ | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-stm - syscon: add support for power off - stm32mp1: add op-tee config - stm32mp1: add specific commands: stboard and stm32key - add stm32 mailbox driver - solve many stm32 warnings when building with W=1 - update stm32 gpio driver
| * power: stpmic1: Fix warnings when compiling with W=1Patrick Delaunay2019-07-121-0/+1
| | | | | | | | | | | | | | This patch solves the following warnings: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
| * power: regulator: stm32: Fix warnings when compiling with W=1Patrick Delaunay2019-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This patch solves the following warnings: drivers/power/regulator/stm32-vrefbuf.c: In function 'stm32_vrefbuf_set_value': warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (uV == stm32_vrefbuf_voltages[i]) { ^~ Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
| * pmic: stpmic1: add support for SYSRESET_POWER_OFFPatrick Delaunay2019-07-121-3/+8
| | | | | | | | | | | | | | | | | | Adds support for SYSRESET_POWER_OFF = PMIC power off used by command power off and introduced by commit 751fed426f87 ("sysreset: Add a way to find the last reset"). The driver use SYSRESET_POWER for the PMIC-level power cycle, with restart. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* | regulator: Allow autosetting fixed regulatorsSven Schwermer2019-07-131-0/+3
| | | | | | | | | | | | | | | | | | | | Fixed regulators don't have a set_value method. Therefore, trying to set their value will always return -ENOSYS. Signed-off-by: Sven Schwermer <sven@svenschwermer.de> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | power: regulator: Kconfig: Add SPL_DM_REGULATOR configs for ↵Keerthy2019-07-131-0/+26
| | | | | | | | | | | | | | | | | | | | palmas/lp873x/lp87565 Add SPL_DM_REGULATOR configs for palmas/lp873x/lp87565. These were missing and the Makefile already assumes them to be defined. Add the corresponding SPL config options. This enables the regulator support in SPL. Signed-off-by: Keerthy <j-keerthy@ti.com>
* | power: pmic: Kconfig: Add SPL_PMIC configs for palmas/lp873x/lp87565Keerthy2019-07-131-0/+21
|/ | | | | | | | Add SPL_PMIC configs for palmas/lp873x/lp87565. These were missing and the Makefile already assumes them to be defined. Add the corresponding SPL config options. This enables the pmics in SPL. Signed-off-by: Keerthy <j-keerthy@ti.com>
* regulator: bd71837: copy the bd71837 pmic driver from NXP imx u-bootMatti Vaittinen2019-06-113-0/+97
| | | | | | | | | | | | https://source.codeaurora.org/external/imx/uboot-imx cherry picked, styled and merged commits: - MLK-18387 pmic: Add pmic driver for BD71837: e9a3bec2e95a - MLK-18590 pmic: bd71837: Change to use new fdt API: acdc5c297a96 Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* power: pfuze100: Fix off by one error in voltage table handlingTrent Piepho2019-06-111-2/+2
| | | | | | | | | | | The code that sets a regulator by looking up the voltage in a table had an off by one error. vsel_mask is a bitmask, not the number of table entries, so a vsel_mask value of 0x7 indicates there are 8, not 7, entries in the table. Cc: Peng Fan <Peng.Fan@freescale.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Trent Piepho <tpiepho@impinj.com>
* Merge tag 'u-boot-stm32-20190412' of https://github.com/patrickdelaunay/u-bootTom Rini2019-04-128-775/+942
|\ | | | | | | | | | | | | | | | | | | | | | | stm32 patches for v2019.07-rc1 - Add trusted boot with TF-A for stm32mp1 - stm32mp1 dts files sync'ed with Linux version - add STM32MP1 Discovery boards (DK1 and DK2) - add STMFX gpio expander driver - misc improvement for stm3mp1 supports - rename stpmu1 to stpmic1 (official name) - stm32_qspi: move to exec_op (spi nor driver for stm32 mpu and mcu) - add STM32 FMC2 NAND flash controller driver
| * stpmic1: add NVM update support in fuse commandPatrick Delaunay2019-04-121-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add functions to read/update the non volatile memory of STPMIC1 (8 bytes-register at 0xF8 address) and allow access with fuse command (bank=1, word > 0xF8). For example: STM32MP> fuse read 1 0xf8 8 Reading bank 1: Word 0x000000f8: 000000ee 00000092 000000c0 00000002 Word 0x000000fc: 000000f2 00000080 00000002 00000033 Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
| * pmic: stpmu1: add power switch off supportPatrick Delaunay2019-04-121-0/+46
| | | | | | | | | | | | | | Add sysreset support, and support power switch off request, needed by poweroff command. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
| * stpmic1: update register namesPatrick Delaunay2019-04-121-57/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Alignment with STPMIC1 datasheet s/MAIN_CONTROL_REG/MAIN_CR/g s/MASK_RESET_BUCK/BUCKS_MRST_CR/g s/MASK_RESET_LDOS/LDOS_MRST_CR/g s/BUCKX_CTRL_REG/BUCKX_MAIN_CR/g s/VREF_CTRL_REG/REFDDR_MAIN_CR/g s/LDOX_CTRL_REG/LDOX_MAIN_CR/g s/USB_CTRL_REG/BST_SW_CR/g s/STPMIC1_NVM_USER_STATUS_REG/STPMIC1_NVM_SR/g s/STPMIC1_NVM_USER_CONTROL_REG/STPMIC1_NVM_CR/g and update all the associated defines. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>