mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-01 20:11:32 +02:00
Merge tag 'u-boot-rockchip-20240614' of https://source.denx.de/u-boot/custodians/u-boot-rockchip
CI: https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/pipelines/21111 - pmic fix for rk8xx; - pinctrl fix for rk3188/rv1126/rk3588; - mkimage fix for rockcihp "-l" option;
This commit is contained in:
commit
d571e8c544
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
/ {
|
/ {
|
||||||
chosen {
|
chosen {
|
||||||
u-boot,spl-boot-order = "same-as-spl", &sdmmc1, &sdmmc0;
|
u-boot,spl-boot-order = &sdmmc0, &sdhci;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6,14 +6,12 @@
|
|||||||
#include <abuf.h>
|
#include <abuf.h>
|
||||||
#include <adc.h>
|
#include <adc.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <command.h>
|
|
||||||
#include <display.h>
|
#include <display.h>
|
||||||
#include <dm.h>
|
#include <dm.h>
|
||||||
#include <dm/lists.h>
|
#include <dm/lists.h>
|
||||||
#include <env.h>
|
#include <env.h>
|
||||||
#include <fdt_support.h>
|
#include <fdt_support.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/iopoll.h>
|
|
||||||
#include <mipi_dsi.h>
|
#include <mipi_dsi.h>
|
||||||
#include <mmc.h>
|
#include <mmc.h>
|
||||||
#include <panel.h>
|
#include <panel.h>
|
||||||
@ -21,8 +19,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <video_bridge.h>
|
#include <video_bridge.h>
|
||||||
|
|
||||||
#define BOOT_BROM_DOWNLOAD 0xef08a53c
|
|
||||||
|
|
||||||
#define GPIO0_BASE 0xfdd60000
|
#define GPIO0_BASE 0xfdd60000
|
||||||
#define GPIO4_BASE 0xfe770000
|
#define GPIO4_BASE 0xfe770000
|
||||||
#define GPIO_SWPORT_DR_L 0x0000
|
#define GPIO_SWPORT_DR_L 0x0000
|
||||||
@ -36,14 +32,6 @@
|
|||||||
|
|
||||||
#define GPIO_WRITEMASK(bits) ((bits) << 16)
|
#define GPIO_WRITEMASK(bits) ((bits) << 16)
|
||||||
|
|
||||||
#define SARADC_BASE 0xfe720000
|
|
||||||
#define SARADC_DATA 0x0000
|
|
||||||
#define SARADC_STAS 0x0004
|
|
||||||
#define SARADC_ADC_STATUS BIT(0)
|
|
||||||
#define SARADC_CTRL 0x0008
|
|
||||||
#define SARADC_INPUT_SRC_MSK 0x7
|
|
||||||
#define SARADC_POWER_CTRL BIT(3)
|
|
||||||
|
|
||||||
#define DTB_DIR "rockchip/"
|
#define DTB_DIR "rockchip/"
|
||||||
|
|
||||||
struct rg3xx_model {
|
struct rg3xx_model {
|
||||||
@ -169,64 +157,12 @@ static const struct rg353_panel rg353_panel_details[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
* The device has internal eMMC, and while some devices have an exposed
|
|
||||||
* clk pin you can ground to force a bypass not all devices do. As a
|
|
||||||
* result it may be possible for some devices to become a perma-brick
|
|
||||||
* if a corrupted TPL or SPL stage with a valid header is flashed to
|
|
||||||
* the internal eMMC. Add functionality to read ADC channel 0 (the func
|
|
||||||
* button) as early as possible in the boot process to provide some
|
|
||||||
* protection against this. If we ever get an open TPL stage, we should
|
|
||||||
* consider moving this function there.
|
|
||||||
*/
|
|
||||||
void read_func_button(void)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
u32 reg;
|
|
||||||
|
|
||||||
/* Turn off SARADC to reset it. */
|
|
||||||
writel(0, (SARADC_BASE + SARADC_CTRL));
|
|
||||||
|
|
||||||
/* Enable channel 0 and power on SARADC. */
|
|
||||||
writel(((0 & SARADC_INPUT_SRC_MSK) | SARADC_POWER_CTRL),
|
|
||||||
(SARADC_BASE + SARADC_CTRL));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Wait for data to be ready. Use timeout of 20000us from
|
|
||||||
* rockchip_saradc driver.
|
|
||||||
*/
|
|
||||||
ret = readl_poll_timeout((SARADC_BASE + SARADC_STAS), reg,
|
|
||||||
!(reg & SARADC_ADC_STATUS), 20000);
|
|
||||||
if (ret) {
|
|
||||||
printf("ADC Timeout");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Read the data from the SARADC. */
|
|
||||||
reg = readl((SARADC_BASE + SARADC_DATA));
|
|
||||||
|
|
||||||
/* Turn the SARADC back off so it's ready to be used again. */
|
|
||||||
writel(0, (SARADC_BASE + SARADC_CTRL));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If the value is less than 30 the button is being pressed.
|
|
||||||
* Reset the device back into Rockchip download mode.
|
|
||||||
*/
|
|
||||||
if (reg <= 30) {
|
|
||||||
printf("download key pressed, entering download mode...");
|
|
||||||
writel(BOOT_BROM_DOWNLOAD, CONFIG_ROCKCHIP_BOOT_MODE_REG);
|
|
||||||
do_reset(NULL, 0, 0, NULL);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Start LED very early so user knows device is on. Set color
|
* Start LED very early so user knows device is on. Set color
|
||||||
* to red.
|
* to red.
|
||||||
*/
|
*/
|
||||||
void spl_board_init(void)
|
void spl_board_init(void)
|
||||||
{
|
{
|
||||||
read_func_button();
|
|
||||||
|
|
||||||
/* Set GPIO0_C5, GPIO0_C6, and GPIO0_C7 to output. */
|
/* Set GPIO0_C5, GPIO0_C6, and GPIO0_C7 to output. */
|
||||||
writel(GPIO_WRITEMASK(GPIO_C7 | GPIO_C6 | GPIO_C5) | \
|
writel(GPIO_WRITEMASK(GPIO_C7 | GPIO_C6 | GPIO_C5) | \
|
||||||
(GPIO_C7 | GPIO_C6 | GPIO_C5),
|
(GPIO_C7 | GPIO_C6 | GPIO_C5),
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
#include <linux/libfdt.h>
|
#include <linux/libfdt.h>
|
||||||
|
|
||||||
#include "pinctrl-rockchip.h"
|
#include "pinctrl-rockchip.h"
|
||||||
|
#include <dt-bindings/pinctrl/rockchip.h>
|
||||||
|
|
||||||
#define MAX_ROCKCHIP_PINS_ENTRIES 30
|
#define MAX_ROCKCHIP_PINS_ENTRIES 30
|
||||||
#define MAX_ROCKCHIP_GPIO_PER_BANK 32
|
#define MAX_ROCKCHIP_GPIO_PER_BANK 32
|
||||||
#define RK_FUNC_GPIO 0
|
|
||||||
|
|
||||||
static int rockchip_verify_config(struct udevice *dev, u32 bank, u32 pin)
|
static int rockchip_verify_config(struct udevice *dev, u32 bank, u32 pin)
|
||||||
{
|
{
|
||||||
@ -132,8 +132,12 @@ static int rockchip_get_mux(struct rockchip_pin_bank *bank, int pin)
|
|||||||
if (bank->iomux[iomux_num].type & IOMUX_GPIO_ONLY)
|
if (bank->iomux[iomux_num].type & IOMUX_GPIO_ONLY)
|
||||||
return RK_FUNC_GPIO;
|
return RK_FUNC_GPIO;
|
||||||
|
|
||||||
regmap = (bank->iomux[iomux_num].type & IOMUX_SOURCE_PMU)
|
if (bank->iomux[iomux_num].type & IOMUX_SOURCE_PMU)
|
||||||
? priv->regmap_pmu : priv->regmap_base;
|
regmap = priv->regmap_pmu;
|
||||||
|
else if (bank->iomux[iomux_num].type & IOMUX_L_SOURCE_PMU)
|
||||||
|
regmap = (pin % 8 < 4) ? priv->regmap_pmu : priv->regmap_base;
|
||||||
|
else
|
||||||
|
regmap = priv->regmap_base;
|
||||||
|
|
||||||
/* get basic quadrupel of mux registers and the correct reg inside */
|
/* get basic quadrupel of mux registers and the correct reg inside */
|
||||||
mux_type = bank->iomux[iomux_num].type;
|
mux_type = bank->iomux[iomux_num].type;
|
||||||
@ -143,6 +147,28 @@ static int rockchip_get_mux(struct rockchip_pin_bank *bank, int pin)
|
|||||||
if (bank->recalced_mask & BIT(pin))
|
if (bank->recalced_mask & BIT(pin))
|
||||||
rockchip_get_recalced_mux(bank, pin, ®, &bit, &mask);
|
rockchip_get_recalced_mux(bank, pin, ®, &bit, &mask);
|
||||||
|
|
||||||
|
if (IS_ENABLED(CONFIG_ROCKCHIP_RK3588)) {
|
||||||
|
if (bank->bank_num == 0) {
|
||||||
|
if (pin >= RK_PB4 && pin <= RK_PD7) {
|
||||||
|
u32 reg0 = 0;
|
||||||
|
|
||||||
|
reg0 = reg + 0x4000 - 0xC; /* PMU2_IOC_BASE */
|
||||||
|
ret = regmap_read(regmap, reg0, &val);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
ret = ((val >> bit) & mask);
|
||||||
|
if (ret != 8)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
reg = reg + 0x8000; /* BUS_IOC_BASE */
|
||||||
|
regmap = priv->regmap_base;
|
||||||
|
}
|
||||||
|
} else if (bank->bank_num > 0) {
|
||||||
|
reg += 0x8000; /* BUS_IOC_BASE */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret = regmap_read(regmap, reg, &val);
|
ret = regmap_read(regmap, reg, &val);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
@ -172,7 +198,7 @@ static int rockchip_verify_mux(struct rockchip_pin_bank *bank,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bank->iomux[iomux_num].type & IOMUX_GPIO_ONLY) {
|
if (bank->iomux[iomux_num].type & IOMUX_GPIO_ONLY) {
|
||||||
if (mux != IOMUX_GPIO_ONLY) {
|
if (mux != RK_FUNC_GPIO) {
|
||||||
debug("pin %d only supports a gpio mux\n", pin);
|
debug("pin %d only supports a gpio mux\n", pin);
|
||||||
return -ENOTSUPP;
|
return -ENOTSUPP;
|
||||||
}
|
}
|
||||||
@ -532,12 +558,14 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data(struct udevice *d
|
|||||||
|
|
||||||
/* preset iomux offset value, set new start value */
|
/* preset iomux offset value, set new start value */
|
||||||
if (iom->offset >= 0) {
|
if (iom->offset >= 0) {
|
||||||
if (iom->type & IOMUX_SOURCE_PMU)
|
if ((iom->type & IOMUX_SOURCE_PMU) ||
|
||||||
|
(iom->type & IOMUX_L_SOURCE_PMU))
|
||||||
pmu_offs = iom->offset;
|
pmu_offs = iom->offset;
|
||||||
else
|
else
|
||||||
grf_offs = iom->offset;
|
grf_offs = iom->offset;
|
||||||
} else { /* set current iomux offset */
|
} else { /* set current iomux offset */
|
||||||
iom->offset = (iom->type & IOMUX_SOURCE_PMU) ?
|
iom->offset = ((iom->type & IOMUX_SOURCE_PMU) ||
|
||||||
|
(iom->type & IOMUX_L_SOURCE_PMU)) ?
|
||||||
pmu_offs : grf_offs;
|
pmu_offs : grf_offs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -520,7 +520,7 @@ static int _buck_get_enable(struct udevice *pmic, int buck)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
return ret & mask ? true : false;
|
return (ret & mask) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _buck_set_suspend_enable(struct udevice *pmic, int buck, bool enable)
|
static int _buck_set_suspend_enable(struct udevice *pmic, int buck, bool enable)
|
||||||
@ -585,7 +585,7 @@ static int _buck_get_suspend_enable(struct udevice *pmic, int buck)
|
|||||||
val = pmic_reg_read(pmic, RK816_REG_DCDC_SLP_EN);
|
val = pmic_reg_read(pmic, RK816_REG_DCDC_SLP_EN);
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
return val;
|
return val;
|
||||||
ret = val & mask ? 1 : 0;
|
ret = (val & mask) ? 1 : 0;
|
||||||
break;
|
break;
|
||||||
case RK806_ID:
|
case RK806_ID:
|
||||||
{
|
{
|
||||||
@ -608,7 +608,7 @@ static int _buck_get_suspend_enable(struct udevice *pmic, int buck)
|
|||||||
val = pmic_reg_read(pmic, REG_SLEEP_SET_OFF1);
|
val = pmic_reg_read(pmic, REG_SLEEP_SET_OFF1);
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
return val;
|
return val;
|
||||||
ret = val & mask ? 0 : 1;
|
ret = (val & mask) ? 0 : 1;
|
||||||
break;
|
break;
|
||||||
case RK809_ID:
|
case RK809_ID:
|
||||||
case RK817_ID:
|
case RK817_ID:
|
||||||
@ -620,7 +620,7 @@ static int _buck_get_suspend_enable(struct udevice *pmic, int buck)
|
|||||||
val = pmic_reg_read(pmic, RK817_POWER_SLP_EN(0));
|
val = pmic_reg_read(pmic, RK817_POWER_SLP_EN(0));
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
return val;
|
return val;
|
||||||
ret = val & mask ? 1 : 0;
|
ret = (val & mask) ? 1 : 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
@ -723,7 +723,7 @@ static int _ldo_get_enable(struct udevice *pmic, int ldo)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
return ret & mask ? true : false;
|
return (ret & mask) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _nldo_get_enable(struct udevice *pmic, int nldo)
|
static int _nldo_get_enable(struct udevice *pmic, int nldo)
|
||||||
@ -980,7 +980,7 @@ static int _ldo_get_suspend_enable(struct udevice *pmic, int ldo)
|
|||||||
val = pmic_reg_read(pmic, RK816_REG_LDO_SLP_EN);
|
val = pmic_reg_read(pmic, RK816_REG_LDO_SLP_EN);
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
return val;
|
return val;
|
||||||
ret = val & mask ? 1 : 0;
|
ret = (val & mask) ? 1 : 0;
|
||||||
break;
|
break;
|
||||||
case RK808_ID:
|
case RK808_ID:
|
||||||
case RK818_ID:
|
case RK818_ID:
|
||||||
@ -988,7 +988,7 @@ static int _ldo_get_suspend_enable(struct udevice *pmic, int ldo)
|
|||||||
val = pmic_reg_read(pmic, REG_SLEEP_SET_OFF2);
|
val = pmic_reg_read(pmic, REG_SLEEP_SET_OFF2);
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
return val;
|
return val;
|
||||||
ret = val & mask ? 0 : 1;
|
ret = (val & mask) ? 0 : 1;
|
||||||
break;
|
break;
|
||||||
case RK809_ID:
|
case RK809_ID:
|
||||||
case RK817_ID:
|
case RK817_ID:
|
||||||
@ -997,13 +997,13 @@ static int _ldo_get_suspend_enable(struct udevice *pmic, int ldo)
|
|||||||
val = pmic_reg_read(pmic, RK817_POWER_SLP_EN(0));
|
val = pmic_reg_read(pmic, RK817_POWER_SLP_EN(0));
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
return val;
|
return val;
|
||||||
ret = val & mask ? 1 : 0;
|
ret = (val & mask) ? 1 : 0;
|
||||||
} else {
|
} else {
|
||||||
mask = 1 << ldo;
|
mask = 1 << ldo;
|
||||||
val = pmic_reg_read(pmic, RK817_POWER_SLP_EN(1));
|
val = pmic_reg_read(pmic, RK817_POWER_SLP_EN(1));
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
return val;
|
return val;
|
||||||
ret = val & mask ? 1 : 0;
|
ret = (val & mask) ? 1 : 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1134,14 +1134,14 @@ static int buck_get_enable(struct udevice *dev)
|
|||||||
return _buck_get_enable(dev->parent, buck);
|
return _buck_get_enable(dev->parent, buck);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _ldo_get_value(struct udevice *dev, const struct rk8xx_reg_info *info)
|
static int _ldo_get_value(struct udevice *pmic, const struct rk8xx_reg_info *info)
|
||||||
{
|
{
|
||||||
int mask = info->vsel_mask;
|
int mask = info->vsel_mask;
|
||||||
int ret, val;
|
int ret, val;
|
||||||
|
|
||||||
if (info->vsel_reg == NA)
|
if (info->vsel_reg == NA)
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
ret = pmic_reg_read(dev->parent, info->vsel_reg);
|
ret = pmic_reg_read(pmic, info->vsel_reg);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
val = ret & mask;
|
val = ret & mask;
|
||||||
@ -1154,7 +1154,7 @@ static int ldo_get_value(struct udevice *dev)
|
|||||||
int ldo = dev->driver_data - 1;
|
int ldo = dev->driver_data - 1;
|
||||||
const struct rk8xx_reg_info *info = get_ldo_reg(dev->parent, ldo, 0);
|
const struct rk8xx_reg_info *info = get_ldo_reg(dev->parent, ldo, 0);
|
||||||
|
|
||||||
return _ldo_get_value(dev, info);
|
return _ldo_get_value(dev->parent, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nldo_get_value(struct udevice *dev)
|
static int nldo_get_value(struct udevice *dev)
|
||||||
@ -1162,7 +1162,7 @@ static int nldo_get_value(struct udevice *dev)
|
|||||||
int nldo = dev->driver_data - 1;
|
int nldo = dev->driver_data - 1;
|
||||||
const struct rk8xx_reg_info *info = get_nldo_reg(dev->parent, nldo, 0);
|
const struct rk8xx_reg_info *info = get_nldo_reg(dev->parent, nldo, 0);
|
||||||
|
|
||||||
return _ldo_get_value(dev, info);
|
return _ldo_get_value(dev->parent, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pldo_get_value(struct udevice *dev)
|
static int pldo_get_value(struct udevice *dev)
|
||||||
@ -1170,10 +1170,10 @@ static int pldo_get_value(struct udevice *dev)
|
|||||||
int pldo = dev->driver_data - 1;
|
int pldo = dev->driver_data - 1;
|
||||||
const struct rk8xx_reg_info *info = get_pldo_reg(dev->parent, pldo, 0);
|
const struct rk8xx_reg_info *info = get_pldo_reg(dev->parent, pldo, 0);
|
||||||
|
|
||||||
return _ldo_get_value(dev, info);
|
return _ldo_get_value(dev->parent, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _ldo_set_value(struct udevice *dev, const struct rk8xx_reg_info *info, int uvolt)
|
static int _ldo_set_value(struct udevice *pmic, const struct rk8xx_reg_info *info, int uvolt)
|
||||||
{
|
{
|
||||||
int mask = info->vsel_mask;
|
int mask = info->vsel_mask;
|
||||||
int val;
|
int val;
|
||||||
@ -1189,7 +1189,7 @@ static int _ldo_set_value(struct udevice *dev, const struct rk8xx_reg_info *info
|
|||||||
debug("%s: volt=%d, reg=0x%x, mask=0x%x, val=0x%x\n",
|
debug("%s: volt=%d, reg=0x%x, mask=0x%x, val=0x%x\n",
|
||||||
__func__, uvolt, info->vsel_reg, mask, val);
|
__func__, uvolt, info->vsel_reg, mask, val);
|
||||||
|
|
||||||
return pmic_clrsetbits(dev->parent, info->vsel_reg, mask, val);
|
return pmic_clrsetbits(pmic, info->vsel_reg, mask, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ldo_set_value(struct udevice *dev, int uvolt)
|
static int ldo_set_value(struct udevice *dev, int uvolt)
|
||||||
@ -1197,7 +1197,7 @@ static int ldo_set_value(struct udevice *dev, int uvolt)
|
|||||||
int ldo = dev->driver_data - 1;
|
int ldo = dev->driver_data - 1;
|
||||||
const struct rk8xx_reg_info *info = get_ldo_reg(dev->parent, ldo, uvolt);
|
const struct rk8xx_reg_info *info = get_ldo_reg(dev->parent, ldo, uvolt);
|
||||||
|
|
||||||
return _ldo_set_value(dev, info, uvolt);
|
return _ldo_set_value(dev->parent, info, uvolt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nldo_set_value(struct udevice *dev, int uvolt)
|
static int nldo_set_value(struct udevice *dev, int uvolt)
|
||||||
@ -1205,7 +1205,7 @@ static int nldo_set_value(struct udevice *dev, int uvolt)
|
|||||||
int nldo = dev->driver_data - 1;
|
int nldo = dev->driver_data - 1;
|
||||||
const struct rk8xx_reg_info *info = get_nldo_reg(dev->parent, nldo, uvolt);
|
const struct rk8xx_reg_info *info = get_nldo_reg(dev->parent, nldo, uvolt);
|
||||||
|
|
||||||
return _ldo_set_value(dev, info, uvolt);
|
return _ldo_set_value(dev->parent, info, uvolt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pldo_set_value(struct udevice *dev, int uvolt)
|
static int pldo_set_value(struct udevice *dev, int uvolt)
|
||||||
@ -1213,10 +1213,10 @@ static int pldo_set_value(struct udevice *dev, int uvolt)
|
|||||||
int pldo = dev->driver_data - 1;
|
int pldo = dev->driver_data - 1;
|
||||||
const struct rk8xx_reg_info *info = get_pldo_reg(dev->parent, pldo, uvolt);
|
const struct rk8xx_reg_info *info = get_pldo_reg(dev->parent, pldo, uvolt);
|
||||||
|
|
||||||
return _ldo_set_value(dev, info, uvolt);
|
return _ldo_set_value(dev->parent, info, uvolt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _ldo_set_suspend_value(struct udevice *dev, const struct rk8xx_reg_info *info, int uvolt)
|
static int _ldo_set_suspend_value(struct udevice *pmic, const struct rk8xx_reg_info *info, int uvolt)
|
||||||
{
|
{
|
||||||
int mask = info->vsel_mask;
|
int mask = info->vsel_mask;
|
||||||
int val;
|
int val;
|
||||||
@ -1232,7 +1232,7 @@ static int _ldo_set_suspend_value(struct udevice *dev, const struct rk8xx_reg_in
|
|||||||
debug("%s: volt=%d, reg=0x%x, mask=0x%x, val=0x%x\n",
|
debug("%s: volt=%d, reg=0x%x, mask=0x%x, val=0x%x\n",
|
||||||
__func__, uvolt, info->vsel_sleep_reg, mask, val);
|
__func__, uvolt, info->vsel_sleep_reg, mask, val);
|
||||||
|
|
||||||
return pmic_clrsetbits(dev->parent, info->vsel_sleep_reg, mask, val);
|
return pmic_clrsetbits(pmic, info->vsel_sleep_reg, mask, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ldo_set_suspend_value(struct udevice *dev, int uvolt)
|
static int ldo_set_suspend_value(struct udevice *dev, int uvolt)
|
||||||
@ -1259,7 +1259,7 @@ static int pldo_set_suspend_value(struct udevice *dev, int uvolt)
|
|||||||
return _ldo_set_suspend_value(dev->parent, info, uvolt);
|
return _ldo_set_suspend_value(dev->parent, info, uvolt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _ldo_get_suspend_value(struct udevice *dev, const struct rk8xx_reg_info *info)
|
static int _ldo_get_suspend_value(struct udevice *pmic, const struct rk8xx_reg_info *info)
|
||||||
{
|
{
|
||||||
int mask = info->vsel_mask;
|
int mask = info->vsel_mask;
|
||||||
int val, ret;
|
int val, ret;
|
||||||
@ -1267,7 +1267,7 @@ static int _ldo_get_suspend_value(struct udevice *dev, const struct rk8xx_reg_in
|
|||||||
if (info->vsel_sleep_reg == NA)
|
if (info->vsel_sleep_reg == NA)
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
|
|
||||||
ret = pmic_reg_read(dev->parent, info->vsel_sleep_reg);
|
ret = pmic_reg_read(pmic, info->vsel_sleep_reg);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -1438,7 +1438,7 @@ static int switch_get_enable(struct udevice *dev)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
return ret & mask ? true : false;
|
return (ret & mask) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int switch_set_suspend_value(struct udevice *dev, int uvolt)
|
static int switch_set_suspend_value(struct udevice *dev, int uvolt)
|
||||||
@ -1493,21 +1493,21 @@ static int switch_get_suspend_enable(struct udevice *dev)
|
|||||||
val = pmic_reg_read(dev->parent, REG_SLEEP_SET_OFF1);
|
val = pmic_reg_read(dev->parent, REG_SLEEP_SET_OFF1);
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
return val;
|
return val;
|
||||||
ret = val & mask ? 0 : 1;
|
ret = (val & mask) ? 0 : 1;
|
||||||
break;
|
break;
|
||||||
case RK809_ID:
|
case RK809_ID:
|
||||||
mask = 1 << (sw + 6);
|
mask = 1 << (sw + 6);
|
||||||
val = pmic_reg_read(dev->parent, RK817_POWER_SLP_EN(0));
|
val = pmic_reg_read(dev->parent, RK817_POWER_SLP_EN(0));
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
return val;
|
return val;
|
||||||
ret = val & mask ? 1 : 0;
|
ret = (val & mask) ? 1 : 0;
|
||||||
break;
|
break;
|
||||||
case RK818_ID:
|
case RK818_ID:
|
||||||
mask = 1 << 6;
|
mask = 1 << 6;
|
||||||
val = pmic_reg_read(dev->parent, REG_SLEEP_SET_OFF1);
|
val = pmic_reg_read(dev->parent, REG_SLEEP_SET_OFF1);
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
return val;
|
return val;
|
||||||
ret = val & mask ? 0 : 1;
|
ret = (val & mask) ? 0 : 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -470,7 +470,7 @@ int rkcommon_verify_header(unsigned char *buf, int size,
|
|||||||
* If no 'imagename' is specified via the commandline (e.g. if this is
|
* If no 'imagename' is specified via the commandline (e.g. if this is
|
||||||
* 'dumpimage -l' w/o any further constraints), we accept any spl_info.
|
* 'dumpimage -l' w/o any further constraints), we accept any spl_info.
|
||||||
*/
|
*/
|
||||||
if (params->imagename == NULL)
|
if (params->imagename == NULL || !strlen(params->imagename))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Match the 'imagename' against the 'spl_hdr' found */
|
/* Match the 'imagename' against the 'spl_hdr' found */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user