From 6e74c6af32057f8e9fb97b781807c55f834d2063 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 6 Mar 2019 19:37:49 +0100 Subject: adc: exynos-adc: Fix wrong bit operation used to stop the ADC When stopping the ADC_V2_CON1_STC_EN should be cleared. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Lukasz Majewski Tested-by: Anand Moon Signed-off-by: Minkyu Kang --- drivers/adc/exynos-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/adc/exynos-adc.c b/drivers/adc/exynos-adc.c index d33e3d6..12c49fc 100644 --- a/drivers/adc/exynos-adc.c +++ b/drivers/adc/exynos-adc.c @@ -62,7 +62,7 @@ int exynos_adc_stop(struct udevice *dev) /* Stop conversion */ cfg = readl(®s->con1); - cfg |= ~ADC_V2_CON1_STC_EN; + cfg &= ~ADC_V2_CON1_STC_EN; writel(cfg, ®s->con1); -- cgit v1.1 From 311eaf743075da4f8a0b33faf1c75e6a8ba67df4 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 6 Mar 2019 19:37:50 +0100 Subject: power: regulator: s2mps11: Fix step for LDO27 and LDO35 LDO27 and LDO35 have 25 mV step, not 50 mV. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Lukasz Majewski Tested-by: Anand Moon Signed-off-by: Minkyu Kang --- drivers/power/regulator/s2mps11_regulator.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/power/regulator/s2mps11_regulator.c b/drivers/power/regulator/s2mps11_regulator.c index ced504e..723d27f 100644 --- a/drivers/power/regulator/s2mps11_regulator.c +++ b/drivers/power/regulator/s2mps11_regulator.c @@ -346,6 +346,8 @@ static int s2mps11_ldo_hex2volt(int ldo, int hex) case 11: case 22: case 23: + case 27: + case 35: uV = hex * S2MPS11_LDO_STEP + S2MPS11_LDO_UV_MIN; break; default: @@ -366,6 +368,8 @@ static int s2mps11_ldo_volt2hex(int ldo, int uV) case 11: case 22: case 23: + case 27: + case 35: hex = (uV - S2MPS11_LDO_UV_MIN) / S2MPS11_LDO_STEP; break; default: -- cgit v1.1 From e3ee4be3210a79e39af9b15077f0b119095ee52f Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 6 Mar 2019 19:37:51 +0100 Subject: arm: exynos: Detect revision later, when all resources are ready Detection of board revision is done early - before power setup. In case of Odroid XU3/XU4/HC1 family, the detection is done using ADC which is supplied by LDO4/VDD_ADC regulator. This regulator could be turned off (e.g. by kernel before reboot). If ADC is used early, the regulators are not yet available and the detection won't work. Split the revision detection out of set_board_type() into separate function called later - either when displaying board info (in late mode) or during misc_init_r. The idea is that set_board_type() will be called early so its method of detection are limited to flattened device tree (exynos5-dt-types.c for Exynos5) or GPIO (odroid.c for Exynos4412). The newly added set_board_revision() can be called only later, when resources like regulator are available. This is necessary to fix the detection of Odroid HC1 after reboot, if kernel turned off the LDO4 regulator. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Lukasz Majewski Tested-by: Anand Moon Signed-off-by: Minkyu Kang --- board/samsung/common/board.c | 23 ++++++++++++++++++++++- board/samsung/common/exynos5-dt-types.c | 16 +++++++++++++--- board/samsung/odroid/odroid.c | 8 ++++++++ include/samsung/misc.h | 1 + 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c index 96228a8..58ecb22 100644 --- a/board/samsung/common/board.c +++ b/board/samsung/common/board.c @@ -253,7 +253,18 @@ int board_eth_init(bd_t *bis) int checkboard(void) { if (IS_ENABLED(CONFIG_BOARD_TYPES)) { - const char *board_info = get_board_type(); + const char *board_info; + + if (IS_ENABLED(CONFIG_DISPLAY_BOARDINFO_LATE)) { + /* + * Printing type requires having revision, although + * this will succeed only if done late. + * Otherwise revision will be set in misc_init_r(). + */ + set_board_revision(); + } + + board_info = get_board_type(); if (board_info) printf("Type: %s\n", board_info); @@ -287,6 +298,16 @@ int board_late_init(void) #ifdef CONFIG_MISC_INIT_R int misc_init_r(void) { + if (IS_ENABLED(CONFIG_BOARD_TYPES) && + !IS_ENABLED(CONFIG_DISPLAY_BOARDINFO_LATE)) { + /* + * If revision was not set by late display boardinfo, + * set it here. At this point regulators should be already + * available. + */ + set_board_revision(); + } + #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG set_board_info(); #endif diff --git a/board/samsung/common/exynos5-dt-types.c b/board/samsung/common/exynos5-dt-types.c index 7a86e91..7c1271d 100644 --- a/board/samsung/common/exynos5-dt-types.c +++ b/board/samsung/common/exynos5-dt-types.c @@ -192,8 +192,11 @@ const char *get_board_type(void) /** * set_board_type() - set board type in gd->board_type. - * As default type set EXYNOS5_BOARD_GENERIC, if detect Odroid, - * then set its proper type. + * As default type set EXYNOS5_BOARD_GENERIC. If Odroid is detected, + * set its proper type based on device tree. + * + * This might be called early when some more specific ways to detect revision + * are not yet available. */ void set_board_type(void) { @@ -211,8 +214,15 @@ void set_board_type(void) gd->board_type = of_match->data; break; } +} - /* If Odroid, then check its revision */ +/** + * set_board_revision() - set detailed board type in gd->board_type. + * Should be called when resources (e.g. regulators) are available + * so ADC can be used to detect the specific revision of a board. + */ +void set_board_revision(void) +{ if (board_is_odroidxu3()) gd->board_type = odroid_get_board_type(); } diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c index 552333f..4be8cc9 100644 --- a/board/samsung/odroid/odroid.c +++ b/board/samsung/odroid/odroid.c @@ -54,6 +54,14 @@ void set_board_type(void) gd->board_type = ODROID_TYPE_U3; } +void set_board_revision(void) +{ + /* + * Revision already set by set_board_type() because it can be + * executed early. + */ +} + const char *get_board_type(void) { const char *board_type[] = {"u3", "x2"}; diff --git a/include/samsung/misc.h b/include/samsung/misc.h index 017560c..4ff28a1 100644 --- a/include/samsung/misc.h +++ b/include/samsung/misc.h @@ -33,6 +33,7 @@ char *get_dfu_alt_system(char *interface, char *devstr); char *get_dfu_alt_boot(char *interface, char *devstr); #endif void set_board_type(void); +void set_board_revision(void); const char *get_board_type(void); #endif /* __SAMSUNG_MISC_COMMON_H__ */ -- cgit v1.1 From 345a53685f7dc7a8da8fbc1be596c02c7209bfbf Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 6 Mar 2019 19:37:52 +0100 Subject: arm: exynos: odroid-xu3: Display info late to have proper type Printing the "Type" of board requires proper detection of revision which can happen only late because regulators are needed. Signed-off-by: Krzysztof Kozlowski Tested-by: Anand Moon Signed-off-by: Minkyu Kang --- board/samsung/common/board.c | 2 +- configs/odroid-xu3_defconfig | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c index 58ecb22..9adbd1e 100644 --- a/board/samsung/common/board.c +++ b/board/samsung/common/board.c @@ -249,7 +249,7 @@ int board_eth_init(bd_t *bis) return 0; } -#ifdef CONFIG_DISPLAY_BOARDINFO +#if defined(CONFIG_DISPLAY_BOARDINFO) || defined(CONFIG_DISPLAY_BOARDINFO_LATE) int checkboard(void) { if (IS_ENABLED(CONFIG_BOARD_TYPES)) { diff --git a/configs/odroid-xu3_defconfig b/configs/odroid-xu3_defconfig index e35f8d6..682460a 100644 --- a/configs/odroid-xu3_defconfig +++ b/configs/odroid-xu3_defconfig @@ -10,6 +10,8 @@ CONFIG_FIT=y CONFIG_FIT_BEST_MATCH=y CONFIG_SILENT_CONSOLE=y CONFIG_CONSOLE_MUX=y +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_MISC_INIT_R=y CONFIG_BOARD_TYPES=y CONFIG_SYS_PROMPT="ODROID-XU3 # " -- cgit v1.1 From fce86100606d14e53517a3601849646e69715465 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 6 Mar 2019 19:37:53 +0100 Subject: arm: exynos: Wait till ADC stabilizes before checking Odroid HC1 revision Fix detection of Odroid HC1 (Exynos5422) after reboot if kernel disabled the LDO4/VDD_ADC regulator. The LDO4 supplies both ADC block and the ADC input AIN9. Voltage on AIN9 will rise slowly, so use delay of 5 milliseconds instead of timers-based loop to wait for voltage stabilization. First reads on Odroid HC1 return 305, 1207, 1297 and finally 1308 (reference value is 1309). Signed-off-by: Krzysztof Kozlowski Tested-by: Anand Moon Signed-off-by: Minkyu Kang --- board/samsung/common/exynos5-dt-types.c | 38 ++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/board/samsung/common/exynos5-dt-types.c b/board/samsung/common/exynos5-dt-types.c index 7c1271d..516c329 100644 --- a/board/samsung/common/exynos5-dt-types.c +++ b/board/samsung/common/exynos5-dt-types.c @@ -57,12 +57,48 @@ static unsigned int odroid_get_rev(void) return 0; } +/* + * Read ADC at least twice and check the resuls. If regulator providing voltage + * on to measured point was just turned on, first reads might require time + * to stabilize. + */ +static int odroid_get_adc_val(unsigned int *adcval) +{ + unsigned int adcval_prev = 0; + int ret, retries = 20; + + ret = adc_channel_single_shot("adc", CONFIG_ODROID_REV_AIN, + &adcval_prev); + if (ret) + return ret; + + while (retries--) { + mdelay(5); + + ret = adc_channel_single_shot("adc", CONFIG_ODROID_REV_AIN, + adcval); + if (ret) + return ret; + + /* + * If difference between ADC reads is less than 3%, + * accept the result + */ + if ((100 * abs(*adcval - adcval_prev) / adcval_prev) < 3) + return ret; + + adcval_prev = *adcval; + } + + return ret; +} + static int odroid_get_board_type(void) { unsigned int adcval; int ret, i; - ret = adc_channel_single_shot("adc", CONFIG_ODROID_REV_AIN, &adcval); + ret = odroid_get_adc_val(&adcval); if (ret) goto rev_default; -- cgit v1.1 From e66d1cb3c2344ee5bbf2059e75fa94350aea9f5f Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 6 Mar 2019 19:37:54 +0100 Subject: regulator: Add support for ramp delay Changing voltage and enabling regulator might require delays so the regulator stabilizes at expected level. Add support for "regulator-ramp-delay" binding which can introduce required time to both enabling the regulator and to changing the voltage. Signed-off-by: Krzysztof Kozlowski Tested-by: Anand Moon Signed-off-by: Minkyu Kang --- doc/device-tree-bindings/regulator/regulator.txt | 2 + drivers/power/regulator/regulator-uclass.c | 47 +++++++++++++++++++++++- include/power/regulator.h | 2 + 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/doc/device-tree-bindings/regulator/regulator.txt b/doc/device-tree-bindings/regulator/regulator.txt index 65b69c4..4ba642b 100644 --- a/doc/device-tree-bindings/regulator/regulator.txt +++ b/doc/device-tree-bindings/regulator/regulator.txt @@ -35,6 +35,7 @@ Optional properties: - regulator-max-microamp: a maximum allowed Current value - regulator-always-on: regulator should never be disabled - regulator-boot-on: enabled by bootloader/firmware +- regulator-ramp-delay: ramp delay for regulator (in uV/us) Note The "regulator-name" constraint is used for setting the device's uclass @@ -60,4 +61,5 @@ ldo0 { regulator-max-microamp = <100000>; regulator-always-on; regulator-boot-on; + regulator-ramp-delay = <12000>; }; diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c index 6f355b9..9118b8e 100644 --- a/drivers/power/regulator/regulator-uclass.c +++ b/drivers/power/regulator/regulator-uclass.c @@ -35,10 +35,22 @@ int regulator_get_value(struct udevice *dev) return ops->get_value(dev); } +static void regulator_set_value_ramp_delay(struct udevice *dev, int old_uV, + int new_uV, unsigned int ramp_delay) +{ + int delay = DIV_ROUND_UP(abs(new_uV - old_uV), ramp_delay); + + debug("regulator %s: delay %u us (%d uV -> %d uV)\n", dev->name, delay, + old_uV, new_uV); + + udelay(delay); +} + int regulator_set_value(struct udevice *dev, int uV) { const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); struct dm_regulator_uclass_platdata *uc_pdata; + int ret, old_uV = uV, is_enabled = 0; uc_pdata = dev_get_uclass_platdata(dev); if (uc_pdata->min_uV != -ENODATA && uV < uc_pdata->min_uV) @@ -49,7 +61,20 @@ int regulator_set_value(struct udevice *dev, int uV) if (!ops || !ops->set_value) return -ENOSYS; - return ops->set_value(dev, uV); + if (uc_pdata->ramp_delay) { + is_enabled = regulator_get_enable(dev); + old_uV = regulator_get_value(dev); + } + + ret = ops->set_value(dev, uV); + + if (!ret) { + if (uc_pdata->ramp_delay && old_uV > 0 && is_enabled) + regulator_set_value_ramp_delay(dev, old_uV, uV, + uc_pdata->ramp_delay); + } + + return ret; } /* @@ -107,6 +132,7 @@ int regulator_set_enable(struct udevice *dev, bool enable) { const struct dm_regulator_ops *ops = dev_get_driver_ops(dev); struct dm_regulator_uclass_platdata *uc_pdata; + int ret, old_enable = 0; if (!ops || !ops->set_enable) return -ENOSYS; @@ -115,7 +141,22 @@ int regulator_set_enable(struct udevice *dev, bool enable) if (!enable && uc_pdata->always_on) return -EACCES; - return ops->set_enable(dev, enable); + if (uc_pdata->ramp_delay) + old_enable = regulator_get_enable(dev); + + ret = ops->set_enable(dev, enable); + if (!ret) { + if (uc_pdata->ramp_delay && !old_enable && enable) { + int uV = regulator_get_value(dev); + + if (uV > 0) { + regulator_set_value_ramp_delay(dev, 0, uV, + uc_pdata->ramp_delay); + } + } + } + + return ret; } int regulator_set_enable_if_allowed(struct udevice *dev, bool enable) @@ -335,6 +376,8 @@ static int regulator_pre_probe(struct udevice *dev) -ENODATA); uc_pdata->always_on = dev_read_bool(dev, "regulator-always-on"); uc_pdata->boot_on = dev_read_bool(dev, "regulator-boot-on"); + uc_pdata->ramp_delay = dev_read_u32_default(dev, "regulator-ramp-delay", + 0); /* Those values are optional (-ENODATA if unset) */ if ((uc_pdata->min_uV != -ENODATA) && diff --git a/include/power/regulator.h b/include/power/regulator.h index 314160a..6c6e2cd 100644 --- a/include/power/regulator.h +++ b/include/power/regulator.h @@ -150,6 +150,7 @@ enum regulator_flag { * @always_on* - bool type, true or false * @boot_on* - bool type, true or false * TODO(sjg@chromium.org): Consider putting the above two into @flags + * @ramp_delay - Time to settle down after voltage change (unit: uV/us) * @flags: - flags value (see REGULATOR_FLAG_...) * @name** - fdt regulator name - should be taken from the device tree * ctrl_reg: - Control register offset used to enable/disable regulator @@ -169,6 +170,7 @@ struct dm_regulator_uclass_platdata { int max_uV; int min_uA; int max_uA; + unsigned int ramp_delay; bool always_on; bool boot_on; const char *name; -- cgit v1.1 From 000ee4b7395236a50c7cb261d74efec6207cfa80 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 6 Mar 2019 19:37:55 +0100 Subject: power: regulator: s2mps11: Add enable delay According to datasheet, the output on LDO regulators will start appearing after 10-15 us. Signed-off-by: Krzysztof Kozlowski Tested-by: Anand Moon Signed-off-by: Minkyu Kang --- drivers/power/regulator/s2mps11_regulator.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/power/regulator/s2mps11_regulator.c b/drivers/power/regulator/s2mps11_regulator.c index 723d27f..67d1f96 100644 --- a/drivers/power/regulator/s2mps11_regulator.c +++ b/drivers/power/regulator/s2mps11_regulator.c @@ -551,7 +551,16 @@ static int ldo_get_enable(struct udevice *dev) static int ldo_set_enable(struct udevice *dev, bool enable) { - return s2mps11_ldo_enable(dev, PMIC_OP_SET, &enable); + int ret; + + ret = s2mps11_ldo_enable(dev, PMIC_OP_SET, &enable); + if (ret) + return ret; + + /* Wait the "enable delay" for voltage to start to rise */ + udelay(15); + + return 0; } static int ldo_get_mode(struct udevice *dev) -- cgit v1.1 From b5d3faa9f9a4efaaa0dd295ef4fd34ff47ed0448 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 6 Mar 2019 19:37:56 +0100 Subject: arm: dts: exynos: Add supply for ADC block to Odroid XU3 family The ADC block requires VDD supply to be on so provide one. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Lukasz Majewski Tested-by: Anand Moon Signed-off-by: Minkyu Kang --- arch/arm/dts/exynos5422-odroidxu3.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/dts/exynos5422-odroidxu3.dts b/arch/arm/dts/exynos5422-odroidxu3.dts index e859dd1..9dfae90 100644 --- a/arch/arm/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/dts/exynos5422-odroidxu3.dts @@ -32,6 +32,7 @@ adc@12D10000 { u-boot,dm-pre-reloc; + vdd-supply = <&ldo4_reg>; status = "okay"; }; -- cgit v1.1 From ae781d56fe9872593fbb2b6d66d3413472033ca7 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 6 Mar 2019 19:37:57 +0100 Subject: arm: dts: exynos: Add ramp delay property to LDO regulators to Odroid XU3 family Add startup time to LDO regulators of S2MPS11 PMIC on Odroid XU3/XU4/HC1 family of boards to be sure the voltage is proper before relying on the regulator. The datasheet for all the S2MPS1x family is inconsistent here and does not specify unambiguously the value of ramp delay for LDO. It mentions 30 mV/us in one timing diagram but then omits it completely in LDO regulator characteristics table (it is specified for bucks). However the vendor kernels for Galaxy S5 and Odroid XU3 use values of 12 mV/us or 24 mV/us. Without the ramp delay value the consumers do not wait for voltage settle after changing it. Although the proper value of ramp delay for LDOs is unknown, it seems safer to use at least some value from reference kernel than to leave it unset. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Lukasz Majewski Tested-by: Anand Moon Signed-off-by: Minkyu Kang --- arch/arm/dts/exynos5422-odroidxu3.dts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm/dts/exynos5422-odroidxu3.dts b/arch/arm/dts/exynos5422-odroidxu3.dts index 9dfae90..04ecc40 100644 --- a/arch/arm/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/dts/exynos5422-odroidxu3.dts @@ -45,6 +45,7 @@ regulator-name = "vdd_ldo1"; regulator-min-microvolt = <1000000>; regulator-max-microvolt = <1000000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -52,18 +53,21 @@ regulator-name = "vddq_mmc0"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; }; ldo4_reg: LDO4 { regulator-name = "vdd_adc"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; }; ldo5_reg: LDO5 { regulator-name = "vdd_ldo5"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -71,6 +75,7 @@ regulator-name = "vdd_ldo6"; regulator-min-microvolt = <1000000>; regulator-max-microvolt = <1000000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -78,6 +83,7 @@ regulator-name = "vdd_ldo7"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -85,6 +91,7 @@ regulator-name = "vdd_ldo8"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -92,6 +99,7 @@ regulator-name = "vdd_ldo9"; regulator-min-microvolt = <3000000>; regulator-max-microvolt = <3000000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -99,6 +107,7 @@ regulator-name = "vdd_ldo10"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -106,6 +115,7 @@ regulator-name = "vdd_ldo11"; regulator-min-microvolt = <1000000>; regulator-max-microvolt = <1000000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -113,6 +123,7 @@ regulator-name = "vdd_ldo12"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -120,12 +131,14 @@ regulator-name = "vddq_mmc2"; regulator-min-microvolt = <2800000>; regulator-max-microvolt = <2800000>; + regulator-ramp-delay = <12000>; }; ldo15_reg: LDO15 { regulator-name = "vdd_ldo15"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -133,6 +146,7 @@ regulator-name = "vdd_ldo16"; regulator-min-microvolt = <2200000>; regulator-max-microvolt = <2200000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -140,6 +154,7 @@ regulator-name = "vdd_ldo17"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -147,18 +162,21 @@ regulator-name = "vdd_emmc_1V8"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <12000>; }; ldo19_reg: LDO19 { regulator-name = "vdd_sd"; regulator-min-microvolt = <2800000>; regulator-max-microvolt = <2800000>; + regulator-ramp-delay = <12000>; }; ldo24_reg: LDO24 { regulator-name = "tsp_io"; regulator-min-microvolt = <2800000>; regulator-max-microvolt = <2800000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; @@ -166,6 +184,7 @@ regulator-name = "vdd_ldo26"; regulator-min-microvolt = <3000000>; regulator-max-microvolt = <3000000>; + regulator-ramp-delay = <12000>; regulator-always-on; }; -- cgit v1.1 From 326f98193e38b1f48b92a1daa90d8f46d15045a9 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Fri, 22 Feb 2019 19:36:40 +0100 Subject: arm: exynos: arndale: Replace Chander Kashyap inactive maintainer Last activity from Arndale (Exynos5250) board maintainer Chander Kashyap was in January 2014 (Signed-off). Recently his samsung.com email bounces with 550 (5.1.1 Recipient address rejected: User unknown). Add Krzysztof Kozlowski as odd fixer for this board. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Minkyu Kang --- board/samsung/arndale/MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/samsung/arndale/MAINTAINERS b/board/samsung/arndale/MAINTAINERS index 7dc1785..98ccaa4 100644 --- a/board/samsung/arndale/MAINTAINERS +++ b/board/samsung/arndale/MAINTAINERS @@ -1,6 +1,6 @@ ARNDALE BOARD -M: Chander Kashyap -S: Maintained +M: Krzysztof Kozlowski +S: Odd Fixes F: board/samsung/arndale/ F: include/configs/arndale.h F: configs/arndale_defconfig -- cgit v1.1 From 08e0ee059c3a72e2fd1f1f582128ca267b0a5f45 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Fri, 22 Feb 2019 19:36:41 +0100 Subject: configs: odroid_xu3: Use consistent syntax for #include When including other header from configs, use consistent <> syntax. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Lukasz Majewski Signed-off-by: Minkyu Kang --- include/configs/odroid_xu3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h index f178549..7f4cff1 100644 --- a/include/configs/odroid_xu3.h +++ b/include/configs/odroid_xu3.h @@ -7,7 +7,7 @@ #ifndef __CONFIG_ODROID_XU3_H #define __CONFIG_ODROID_XU3_H -#include "exynos5420-common.h" +#include #include #define CONFIG_BOARD_COMMON -- cgit v1.1 From d9cab9f92060cc19e3b79ec98cf2aa192d1be474 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Fri, 22 Feb 2019 19:36:42 +0100 Subject: configs: odroid_xu3: Unify indentation File mixed space and tab indentation. Unify it. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Lukasz Majewski Signed-off-by: Minkyu Kang --- include/configs/odroid_xu3.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h index 7f4cff1..5e765a2 100644 --- a/include/configs/odroid_xu3.h +++ b/include/configs/odroid_xu3.h @@ -18,7 +18,7 @@ #define TZPC_BASE_OFFSET 0x10000 -#define SDRAM_BANK_SIZE (256UL << 20UL) /* 256 MB */ +#define SDRAM_BANK_SIZE (256UL << 20UL) /* 256 MB */ /* Reserve the last 22 MiB for the secure firmware */ #define CONFIG_SYS_MEM_TOP_HIDE (22UL << 20UL) #define CONFIG_TZSW_RESERVED_DRAM_SIZE CONFIG_SYS_MEM_TOP_HIDE @@ -28,7 +28,7 @@ #define CONFIG_ENV_SIZE (SZ_1K * 16) #define CONFIG_ENV_OFFSET (SZ_1K * 3136) /* ~3 MiB offset */ -#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - 0x1000000) +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - 0x1000000) #define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0" @@ -38,7 +38,7 @@ /* DFU */ #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M #define DFU_DEFAULT_POLL_TIMEOUT 300 -#define DFU_MANIFEST_POLL_TIMEOUT 25000 +#define DFU_MANIFEST_POLL_TIMEOUT 25000 /* THOR */ #define CONFIG_G_DNL_THOR_VENDOR_NUM CONFIG_USB_GADGET_VENDOR_NUM @@ -85,11 +85,11 @@ #define CONFIG_SET_DFU_ALT_BUF_LEN (SZ_1K) /* Set soc_rev, soc_id, board_rev, boardname, fdtfile */ -#define CONFIG_ODROID_REV_AIN 9 +#define CONFIG_ODROID_REV_AIN 9 #define CONFIG_REVISION_TAG #undef CONFIG_SYS_BOARD -#define CONFIG_SYS_BOARD "odroid" +#define CONFIG_SYS_BOARD "odroid" /* Define new extra env settings, including DFU settings */ #undef CONFIG_EXTRA_ENV_SETTINGS -- cgit v1.1 From e6b1467081d3fb3f86933a14cda1d864eb0e6ac8 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Fri, 22 Feb 2019 19:36:43 +0100 Subject: arm: exynos: Remove duplicated "boardname" env setting Various places in the code set "boardname" env property. It was used for booting from ITB images and choosing proper DTB file name. Instead of duplicating it, use existing U-Boot wide - "board_name". Signed-off-by: Krzysztof Kozlowski Reviewed-by: Lukasz Majewski Signed-off-by: Minkyu Kang --- board/samsung/common/bootscripts/autoboot.cmd | 10 +++++----- board/samsung/common/misc.c | 2 +- include/configs/odroid.h | 2 +- include/configs/odroid_xu3.h | 8 ++++++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/board/samsung/common/bootscripts/autoboot.cmd b/board/samsung/common/bootscripts/autoboot.cmd index 11c724c..d66bccc 100644 --- a/board/samsung/common/bootscripts/autoboot.cmd +++ b/board/samsung/common/bootscripts/autoboot.cmd @@ -3,7 +3,7 @@ # ./tools/mkimage -c none -A arm -T script -d autoboot.cmd boot.scr # # It requires a list of environment variables to be defined before load: -# platform dependent: boardname, fdtfile, console +# platform dependent: board_name, fdtfile, console # system dependent: mmcbootdev, mmcbootpart, mmcrootdev, mmcrootpart, rootfstype # setenv fdtaddr "40800000" @@ -35,17 +35,17 @@ else setenv initrd_addr -; fi;" -#### Routine: boot_fit - check that env $boardname is set and boot proper config of ITB image +#### Routine: boot_fit - check that env $board_name is set and boot proper config of ITB image setenv setboot_fit " -if test -e '${boardname}'; then +if test -e '${board_name}'; then setenv fdt_addr ; setenv initrd_addr ; setenv kerneladdr 0x42000000; setenv kernelname Image.itb; - setenv itbcfg "\"#${boardname}\""; + setenv itbcfg "\"#${board_name}\""; setenv imgbootcmd bootm; else - echo Warning! Variable: \$boardname is undefined!; + echo Warning! Variable: \$board_name is undefined!; fi" #### Routine: setboot_uimg - prepare env to boot uImage diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c index 05243fc..53cd1b2 100644 --- a/board/samsung/common/misc.c +++ b/board/samsung/common/misc.c @@ -101,7 +101,7 @@ void set_board_info(void) bdtype = ""; sprintf(info, "%s%s", bdname, bdtype); - env_set("boardname", info); + env_set("board_name", info); #endif snprintf(info, ARRAY_SIZE(info), "%s%x-%s%s.dtb", CONFIG_SYS_SOC, s5p_cpu_id, bdname, bdtype); diff --git a/include/configs/odroid.h b/include/configs/odroid.h index b8809c8d..9f2d43e 100644 --- a/include/configs/odroid.h +++ b/include/configs/odroid.h @@ -132,7 +132,7 @@ "setenv kernelname Image.itb;" \ "run loadkernel;" \ "run kernel_args;" \ - "bootm ${kernel_addr_r}#${boardname}\0" \ + "bootm ${kernel_addr_r}#${board_name}\0" \ "boot_uimg=" \ "setenv kernelname uImage;" \ "run check_dtb;" \ diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h index 5e765a2..af6004e 100644 --- a/include/configs/odroid_xu3.h +++ b/include/configs/odroid_xu3.h @@ -84,10 +84,14 @@ #define CONFIG_SET_DFU_ALT_INFO #define CONFIG_SET_DFU_ALT_BUF_LEN (SZ_1K) -/* Set soc_rev, soc_id, board_rev, boardname, fdtfile */ +/* Set soc_rev, soc_id, board_rev, board_name, fdtfile */ #define CONFIG_ODROID_REV_AIN 9 #define CONFIG_REVISION_TAG +/* + * Need to override existing one (smdk5420) with odroid so set_board_info will + * use proper prefix when creating full board_name (SYS_BOARD + type) + */ #undef CONFIG_SYS_BOARD #define CONFIG_SYS_BOARD "odroid" @@ -101,7 +105,7 @@ "rootfstype=ext4\0" \ "console=" CONFIG_DEFAULT_CONSOLE \ "fdtfile=exynos5422-odroidxu3.dtb\0" \ - "boardname=odroidxu3\0" \ + "board_name=odroidxu3\0" \ "mmcbootdev=0\0" \ "mmcrootdev=0\0" \ "mmcbootpart=1\0" \ -- cgit v1.1 From be26c4af3abcfa39780892746865b899c269dcfa Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Thu, 21 Feb 2019 17:32:00 +0100 Subject: arm: dts: exynos: Adjust whitespace around status property Just add spaces around '=' sign for clarity. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Simon Glass Signed-off-by: Minkyu Kang --- arch/arm/dts/exynos5422-odroidxu3.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/dts/exynos5422-odroidxu3.dts b/arch/arm/dts/exynos5422-odroidxu3.dts index 04ecc40..6df6be9 100644 --- a/arch/arm/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/dts/exynos5422-odroidxu3.dts @@ -276,7 +276,7 @@ }; serial@12C20000 { - status="okay"; + status = "okay"; }; mmc@12200000 { -- cgit v1.1 From 5d331905273dbdbf31bbbcd7d399404c1c3c9396 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 6 Mar 2019 10:23:09 +0100 Subject: arm: exynos: odroid: Fix build if BOARD_TYPES are not set CONFIG_BOARD_TYPES is necessary for Odroid X/X2/U3 boards to detect proper revision. However building should succeed even without it. While moving code around, document also the reference clock selection. This fixes the build error without CONFIG_BOARD_TYPES: board/samsung/odroid/odroid.c: In function 'board_usb_init': board/samsung/odroid/odroid.c:473:8: error: 'gd_t' {aka 'volatile struct global_data'} has no member named 'board_type' if (gd->board_type == ODROID_TYPE_U3) ^~ Signed-off-by: Krzysztof Kozlowski Signed-off-by: Minkyu Kang --- board/samsung/odroid/odroid.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c index 4be8cc9..3e594fd 100644 --- a/board/samsung/odroid/odroid.c +++ b/board/samsung/odroid/odroid.c @@ -470,18 +470,33 @@ struct dwc2_plat_otg_data s5pc210_otg_data = { #if defined(CONFIG_USB_GADGET) || defined(CONFIG_CMD_USB) +static void set_usb3503_ref_clk(void) +{ +#ifdef CONFIG_BOARD_TYPES + /* + * gpx3-0 chooses primary (low) or secondary (high) reference clock + * frequencies table. The choice of clock is done through hard-wired + * REF_SEL pins. + * The Odroid Us have reference clock at 24 MHz (00 entry from secondary + * table) and Odroid Xs have it at 26 MHz (01 entry from primary table). + */ + if (gd->board_type == ODROID_TYPE_U3) + gpio_direction_output(EXYNOS4X12_GPIO_X30, 0); + else + gpio_direction_output(EXYNOS4X12_GPIO_X30, 1); +#else + /* Choose Odroid Xs frequency without board types */ + gpio_direction_output(EXYNOS4X12_GPIO_X30, 1); +#endif /* CONFIG_BOARD_TYPES */ +} + int board_usb_init(int index, enum usb_init_type init) { #ifdef CONFIG_CMD_USB struct udevice *dev; int ret; - /* Set Ref freq 0 => 24MHz, 1 => 26MHz*/ - /* Odroid Us have it at 24MHz, Odroid Xs at 26MHz */ - if (gd->board_type == ODROID_TYPE_U3) - gpio_direction_output(EXYNOS4X12_GPIO_X30, 0); - else - gpio_direction_output(EXYNOS4X12_GPIO_X30, 1); + set_usb3503_ref_clk(); /* Disconnect, Reset, Connect */ gpio_direction_output(EXYNOS4X12_GPIO_X34, 0); -- cgit v1.1 From 934e7287951e11a3227beb2d01694f4c36c91f7f Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Thu, 7 Mar 2019 17:03:03 +0900 Subject: espresso7420: remove duplicated config Signed-off-by: Minkyu Kang --- include/configs/espresso7420.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/configs/espresso7420.h b/include/configs/espresso7420.h index 4e3b26c..5aeb009 100644 --- a/include/configs/espresso7420.h +++ b/include/configs/espresso7420.h @@ -21,8 +21,6 @@ /* select serial console configuration */ #define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0" -#define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0" - /* DRAM Memory Banks */ #define SDRAM_BANK_SIZE (256UL << 20UL) /* 256 MB */ -- cgit v1.1 From 0fd36730396a86e5513b45221af60889e6028654 Mon Sep 17 00:00:00 2001 From: Anand Moon Date: Sun, 24 Feb 2019 18:11:34 +0530 Subject: ARM: Odroid XU3: Enable driver I2C support for OdroidXU3 This commit enables support for I2C S3C424X0 driver. Signed-off-by: Anand Moon Acked-by: Lukasz Majewski Signed-off-by: Minkyu Kang --- configs/odroid-xu3_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/odroid-xu3_defconfig b/configs/odroid-xu3_defconfig index 682460a..887522a 100644 --- a/configs/odroid-xu3_defconfig +++ b/configs/odroid-xu3_defconfig @@ -35,6 +35,7 @@ CONFIG_ADC=y CONFIG_ADC_EXYNOS=y CONFIG_DFU_MMC=y CONFIG_MMC_DW=y +CONFIG_SYS_I2C_S3C24X0=y CONFIG_SMC911X=y CONFIG_SMC911X_BASE=0x5000000 CONFIG_DM_PMIC=y -- cgit v1.1 From 1411298cbca83a8527d2c1b5c4d299871fc34cf1 Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Thu, 14 Mar 2019 09:38:41 +0900 Subject: arndale: fix unknown status set status to Maintained Signed-off-by: Minkyu Kang Cc: Krzysztof Kozlowski --- board/samsung/arndale/MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/samsung/arndale/MAINTAINERS b/board/samsung/arndale/MAINTAINERS index 98ccaa4..aa64c7a 100644 --- a/board/samsung/arndale/MAINTAINERS +++ b/board/samsung/arndale/MAINTAINERS @@ -1,6 +1,6 @@ ARNDALE BOARD M: Krzysztof Kozlowski -S: Odd Fixes +S: Maintained F: board/samsung/arndale/ F: include/configs/arndale.h F: configs/arndale_defconfig -- cgit v1.1