* [GIT PULL 0/4] samsung: Pull for v5.9
@ 2020-07-21 18:08 Krzysztof Kozlowski
2020-07-21 18:08 ` [GIT PULL 1/4] ARM: dts: samsung: DTS " Krzysztof Kozlowski
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2020-07-21 18:08 UTC (permalink / raw)
To: Olof Johansson, Arnd Bergmann, arm, soc
Cc: linux-samsung-soc, Kukjin Kim, linux-arm-kernel,
Krzysztof Kozlowski, linux-kernel
Hi,
I have for you three tags to pull and one drivers/soc patch to apply directly.
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 5+ messages in thread* [GIT PULL 1/4] ARM: dts: samsung: DTS for v5.9 2020-07-21 18:08 [GIT PULL 0/4] samsung: Pull for v5.9 Krzysztof Kozlowski @ 2020-07-21 18:08 ` Krzysztof Kozlowski 2020-07-21 18:08 ` [GIT PULL 2/4] arm64: " Krzysztof Kozlowski ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: Krzysztof Kozlowski @ 2020-07-21 18:08 UTC (permalink / raw) To: Olof Johansson, Arnd Bergmann, arm, soc Cc: linux-samsung-soc, Kukjin Kim, linux-arm-kernel, Krzysztof Kozlowski, linux-kernel The following changes since commit b3a9e3b9622ae10064826dccb4f7a52bd88c7407: Linux 5.8-rc1 (2020-06-14 12:45:04 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux.git tags/samsung-dt-5.9 for you to fetch changes up to f37b5d3aef8db06390cb7ef25585b39f89c1dedf: ARM: dts: exynos: Replace HTTP links with HTTPS ones (2020-07-20 16:43:28 +0200) ---------------------------------------------------------------- Samsung DTS ARM changes for v5.9 1. Enable Bluetooth on Artik5 (Exynos3250). 2. Enable accelerometer on Aries boards (Samsung Galaxy S family, S5Pv210); multiple fixes. 3. Fix highest frequencies on Exynos5800. 4. Fix rare USB instability on Odroid XU3 family (Exynos5422). 5. Minor DTS fixes and adjustments with dtschema. ---------------------------------------------------------------- Alexander A. Klimov (1): ARM: dts: exynos: Replace HTTP links with HTTPS ones Anand Moon (1): ARM: dts: exynos: Align L2 cache-controller nodename with dtschema Jonathan Bakker (5): ARM: dts: s5pv210: Add interrupt-controller property to gph3 ARM: dts: s5pv210: Correct fuelgauge definition on Aries ARM: dts: s5pv210: Add support for GP2A light sensor on Aries ARM: dts: s5pv210: Add BMA023 accelerometer support to Aries ARM: dts: s5pv210: Correct BCM4329 bluetooth node Krzysztof Kozlowski (5): ARM: dts: exynos: Fix missing empty reg/ranges property regulators on Trats ARM: dts: exynos: Remove DMA controller bus node name to fix dtschema warnings ARM: dts: exynos: Define fixed regulators in root node for consistency in Origen ARM: dts: exynos: Define fixed regulators in root node for consistency in Arndale ARM: dts: exynos: Define fixed regulators in root node for consistency in SMDK5420 Marek Szyprowski (3): ARM: dts: exynos: Extend all Exynos5800 A15's OPPs with max voltage data ARM: dts: exynos: Enable Bluetooth support for Artik5 board ARM: dts: exynos: Disable frequency scaling for FSYS bus on Odroid XU3 family arch/arm/boot/dts/exynos3250-artik5.dtsi | 41 ++++++++ arch/arm/boot/dts/exynos3250.dtsi | 47 ++++----- arch/arm/boot/dts/exynos4.dtsi | 70 ++++++------- arch/arm/boot/dts/exynos4210-trats.dts | 98 +++++++++--------- arch/arm/boot/dts/exynos4210-universal_c210.dts | 28 ++--- arch/arm/boot/dts/exynos4210.dtsi | 2 +- arch/arm/boot/dts/exynos4412-origen.dts | 21 ++-- arch/arm/boot/dts/exynos4412.dtsi | 2 +- arch/arm/boot/dts/exynos5250-arndale.dts | 86 +++++++--------- arch/arm/boot/dts/exynos5250.dtsi | 92 ++++++++--------- arch/arm/boot/dts/exynos5410-pinctrl.dtsi | 2 +- arch/arm/boot/dts/exynos5410.dtsi | 46 ++++----- arch/arm/boot/dts/exynos5420-smdk5420.dts | 53 ++++------ arch/arm/boot/dts/exynos5420.dtsi | 130 +++++++++++------------- arch/arm/boot/dts/exynos5422-odroid-core.dtsi | 6 -- arch/arm/boot/dts/exynos5800.dtsi | 6 +- arch/arm/boot/dts/s5pv210-aries.dtsi | 90 ++++++++++++++-- arch/arm/boot/dts/s5pv210-fascinate4g.dts | 17 ++++ arch/arm/boot/dts/s5pv210-pinctrl.dtsi | 2 + 19 files changed, 445 insertions(+), 394 deletions(-) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 5+ messages in thread
* [GIT PULL 2/4] arm64: dts: samsung: DTS for v5.9 2020-07-21 18:08 [GIT PULL 0/4] samsung: Pull for v5.9 Krzysztof Kozlowski 2020-07-21 18:08 ` [GIT PULL 1/4] ARM: dts: samsung: DTS " Krzysztof Kozlowski @ 2020-07-21 18:08 ` Krzysztof Kozlowski 2020-07-21 18:08 ` [GIT PULL 3/4] ARM: samsung: mach/soc " Krzysztof Kozlowski 2020-07-21 18:09 ` [PATCH 4/4] soc: samsung: exynos-regulator-coupler: Add simple voltage coupler for Exynos5800 Krzysztof Kozlowski 3 siblings, 0 replies; 5+ messages in thread From: Krzysztof Kozlowski @ 2020-07-21 18:08 UTC (permalink / raw) To: Olof Johansson, Arnd Bergmann, arm, soc Cc: linux-samsung-soc, Kukjin Kim, linux-arm-kernel, Krzysztof Kozlowski, linux-kernel The following changes since commit b3a9e3b9622ae10064826dccb4f7a52bd88c7407: Linux 5.8-rc1 (2020-06-14 12:45:04 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux.git tags/samsung-dt64-5.9 for you to fetch changes up to 229134cc51d739bc99264ee14b7a783d479ce205: arm64: dts: exynos: Add unit address to soc node and move thermal zones on Exynos7 (2020-07-07 08:45:47 +0200) ---------------------------------------------------------------- Samsung DTS ARM64 changes for v5.9 1. Enable UFS (Universal Flash Storage) on Exynos7 Espresso board. 2. Fix silent hang after boot off Exynos7 Espresso board. 3. Minor DTS fixes and adjustments with dtschema. ---------------------------------------------------------------- Alim Akhtar (3): arm64: dts: exynos: Add UFS node to Exynos7 arm64: dts: exynos: Fix silent hang after boot on Espresso arm64: dts: exynos: Keep LDO12 always-on on Espresso Krzysztof Kozlowski (5): arm64: dts: exynos: Describe PWM interrupts on Exynos7 arm64: dts: exynos: Remove generic arm,armv8-pmuv3 compatible arm64: dts: exynos: Remove DMA controller bus node name to fix dtschema warnings arm64: dts: exynos: Add unit address to soc node on Exynos5433 arm64: dts: exynos: Add unit address to soc node and move thermal zones on Exynos7 arch/arm64/boot/dts/exynos/exynos5433.dtsi | 53 +++++------ arch/arm64/boot/dts/exynos/exynos7-espresso.dts | 6 ++ arch/arm64/boot/dts/exynos/exynos7.dtsi | 111 ++++++++++++++++-------- 3 files changed, 103 insertions(+), 67 deletions(-) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 5+ messages in thread
* [GIT PULL 3/4] ARM: samsung: mach/soc for v5.9 2020-07-21 18:08 [GIT PULL 0/4] samsung: Pull for v5.9 Krzysztof Kozlowski 2020-07-21 18:08 ` [GIT PULL 1/4] ARM: dts: samsung: DTS " Krzysztof Kozlowski 2020-07-21 18:08 ` [GIT PULL 2/4] arm64: " Krzysztof Kozlowski @ 2020-07-21 18:08 ` Krzysztof Kozlowski 2020-07-21 18:09 ` [PATCH 4/4] soc: samsung: exynos-regulator-coupler: Add simple voltage coupler for Exynos5800 Krzysztof Kozlowski 3 siblings, 0 replies; 5+ messages in thread From: Krzysztof Kozlowski @ 2020-07-21 18:08 UTC (permalink / raw) To: Olof Johansson, Arnd Bergmann, arm, soc Cc: linux-samsung-soc, Kukjin Kim, linux-arm-kernel, Krzysztof Kozlowski, linux-kernel The following changes since commit b3a9e3b9622ae10064826dccb4f7a52bd88c7407: Linux 5.8-rc1 (2020-06-14 12:45:04 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux.git tags/samsung-soc-5.9 for you to fetch changes up to 3ecdf2a5d262df01bc100472cb909580d0fdce69: ARM: s3c24xx: Replace HTTP links with HTTPS ones (2020-07-20 16:42:28 +0200) ---------------------------------------------------------------- Samsung mach/soc changes for v5.9 1. Restore big.LITTLE cpuidle support on Exynos542x boards. 2. Cleanups and minor fixes. ---------------------------------------------------------------- Alexander A. Klimov (1): ARM: s3c24xx: Replace HTTP links with HTTPS ones Guillaume Tucker (1): ARM: exynos: clear L310_AUX_CTRL_FULL_LINE_ZERO in default l2c_aux_val Linus Walleij (1): ARM: s3c24xx: leds: Convert to use GPIO descriptors Marek Szyprowski (1): ARM: exynos: MCPM: Restore big.LITTLE cpuidle support arch/arm/mach-exynos/exynos.c | 2 +- arch/arm/mach-exynos/mcpm-exynos.c | 10 +++-- arch/arm/mach-s3c24xx/Kconfig | 2 +- arch/arm/mach-s3c24xx/common-smdk.c | 67 ++++++++++++++++++++---------- arch/arm/mach-s3c24xx/mach-h1940.c | 2 +- arch/arm/mach-s3c24xx/mach-mini2440.c | 65 ++++++++++++++++++++++++----- arch/arm/mach-s3c24xx/mach-n30.c | 56 +++++++++++++++++++++---- arch/arm/mach-s3c24xx/mach-qt2410.c | 12 +++++- arch/arm/mach-s3c24xx/mach-rx3715.c | 2 +- arch/arm/mach-s3c24xx/mach-vr1000.c | 38 +++++++++++++++-- drivers/leds/leds-s3c24xx.c | 36 ++++------------ include/linux/platform_data/leds-s3c24xx.h | 6 --- 12 files changed, 212 insertions(+), 86 deletions(-) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 4/4] soc: samsung: exynos-regulator-coupler: Add simple voltage coupler for Exynos5800 2020-07-21 18:08 [GIT PULL 0/4] samsung: Pull for v5.9 Krzysztof Kozlowski ` (2 preceding siblings ...) 2020-07-21 18:08 ` [GIT PULL 3/4] ARM: samsung: mach/soc " Krzysztof Kozlowski @ 2020-07-21 18:09 ` Krzysztof Kozlowski 3 siblings, 0 replies; 5+ messages in thread From: Krzysztof Kozlowski @ 2020-07-21 18:09 UTC (permalink / raw) To: Olof Johansson, Arnd Bergmann, arm, soc Cc: linux-samsung-soc, linux-kernel, Krzysztof Kozlowski, Kukjin Kim, linux-arm-kernel, Marek Szyprowski From: Marek Szyprowski <m.szyprowski@samsung.com> Add a simple custom voltage regulator coupler for Exynos5800 SoCs, which require coupling between "vdd_arm" and "vdd_int" regulators. This coupler ensures that the voltage values don't go below the bootloader-selected operation point during the boot process until the clients set their constraints. It is achieved by assuming minimal voltage value equal to the current value if no constraints are set. This also ensures proper voltage balancing if any of the client driver is missing. The balancing code comes from the regulator/core.c with the additional logic for handling regulators without client constraints applied added. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> --- arch/arm/mach-exynos/Kconfig | 1 + drivers/soc/samsung/Kconfig | 3 + drivers/soc/samsung/Makefile | 1 + .../soc/samsung/exynos-regulator-coupler.c | 221 ++++++++++++++++++ 4 files changed, 226 insertions(+) create mode 100644 drivers/soc/samsung/exynos-regulator-coupler.c diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 76838255b5fa..f185cd3d4c62 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -118,6 +118,7 @@ config SOC_EXYNOS5800 bool "Samsung EXYNOS5800" default y depends on SOC_EXYNOS5420 + select EXYNOS_REGULATOR_COUPLER config EXYNOS_MCPM bool diff --git a/drivers/soc/samsung/Kconfig b/drivers/soc/samsung/Kconfig index c7a2003687c7..264185664594 100644 --- a/drivers/soc/samsung/Kconfig +++ b/drivers/soc/samsung/Kconfig @@ -37,4 +37,7 @@ config EXYNOS_PM_DOMAINS bool "Exynos PM domains" if COMPILE_TEST depends on PM_GENERIC_DOMAINS || COMPILE_TEST +config EXYNOS_REGULATOR_COUPLER + bool "Exynos SoC Regulator Coupler" if COMPILE_TEST + depends on ARCH_EXYNOS || COMPILE_TEST endif diff --git a/drivers/soc/samsung/Makefile b/drivers/soc/samsung/Makefile index edd1d6ea064d..ecc3a32f6406 100644 --- a/drivers/soc/samsung/Makefile +++ b/drivers/soc/samsung/Makefile @@ -9,3 +9,4 @@ obj-$(CONFIG_EXYNOS_PMU) += exynos-pmu.o obj-$(CONFIG_EXYNOS_PMU_ARM_DRIVERS) += exynos3250-pmu.o exynos4-pmu.o \ exynos5250-pmu.o exynos5420-pmu.o obj-$(CONFIG_EXYNOS_PM_DOMAINS) += pm_domains.o +obj-$(CONFIG_EXYNOS_REGULATOR_COUPLER) += exynos-regulator-coupler.o diff --git a/drivers/soc/samsung/exynos-regulator-coupler.c b/drivers/soc/samsung/exynos-regulator-coupler.c new file mode 100644 index 000000000000..61a156b44a48 --- /dev/null +++ b/drivers/soc/samsung/exynos-regulator-coupler.c @@ -0,0 +1,221 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * http://www.samsung.com/ + * Author: Marek Szyprowski <m.szyprowski@samsung.com> + * + * Simplified generic voltage coupler from regulator core.c + * The main difference is that it keeps current regulator voltage + * if consumers didn't apply their constraints yet. + */ + +#include <linux/init.h> +#include <linux/kernel.h> +#include <linux/of.h> +#include <linux/regulator/coupler.h> +#include <linux/regulator/driver.h> +#include <linux/regulator/machine.h> + +static int regulator_get_optimal_voltage(struct regulator_dev *rdev, + int *current_uV, + int *min_uV, int *max_uV, + suspend_state_t state) +{ + struct coupling_desc *c_desc = &rdev->coupling_desc; + struct regulator_dev **c_rdevs = c_desc->coupled_rdevs; + struct regulation_constraints *constraints = rdev->constraints; + int desired_min_uV = 0, desired_max_uV = INT_MAX; + int max_current_uV = 0, min_current_uV = INT_MAX; + int highest_min_uV = 0, target_uV, possible_uV; + int i, ret, max_spread, n_coupled = c_desc->n_coupled; + bool done; + + *current_uV = -1; + + /* Find highest min desired voltage */ + for (i = 0; i < n_coupled; i++) { + int tmp_min = 0; + int tmp_max = INT_MAX; + + lockdep_assert_held_once(&c_rdevs[i]->mutex.base); + + ret = regulator_check_consumers(c_rdevs[i], + &tmp_min, + &tmp_max, state); + if (ret < 0) + return ret; + + if (tmp_min == 0) { + ret = regulator_get_voltage_rdev(c_rdevs[i]); + if (ret < 0) + return ret; + tmp_min = ret; + } + + /* apply constraints */ + ret = regulator_check_voltage(c_rdevs[i], &tmp_min, &tmp_max); + if (ret < 0) + return ret; + + highest_min_uV = max(highest_min_uV, tmp_min); + + if (i == 0) { + desired_min_uV = tmp_min; + desired_max_uV = tmp_max; + } + } + + max_spread = constraints->max_spread[0]; + + /* + * Let target_uV be equal to the desired one if possible. + * If not, set it to minimum voltage, allowed by other coupled + * regulators. + */ + target_uV = max(desired_min_uV, highest_min_uV - max_spread); + + /* + * Find min and max voltages, which currently aren't violating + * max_spread. + */ + for (i = 1; i < n_coupled; i++) { + int tmp_act; + + tmp_act = regulator_get_voltage_rdev(c_rdevs[i]); + if (tmp_act < 0) + return tmp_act; + + min_current_uV = min(tmp_act, min_current_uV); + max_current_uV = max(tmp_act, max_current_uV); + } + + /* + * Correct target voltage, so as it currently isn't + * violating max_spread + */ + possible_uV = max(target_uV, max_current_uV - max_spread); + possible_uV = min(possible_uV, min_current_uV + max_spread); + + if (possible_uV > desired_max_uV) + return -EINVAL; + + done = (possible_uV == target_uV); + desired_min_uV = possible_uV; + + /* Set current_uV if wasn't done earlier in the code and if necessary */ + if (*current_uV == -1) { + ret = regulator_get_voltage_rdev(rdev); + if (ret < 0) + return ret; + *current_uV = ret; + } + + *min_uV = desired_min_uV; + *max_uV = desired_max_uV; + + return done; +} + +static int exynos_coupler_balance_voltage(struct regulator_coupler *coupler, + struct regulator_dev *rdev, + suspend_state_t state) +{ + struct regulator_dev **c_rdevs; + struct regulator_dev *best_rdev; + struct coupling_desc *c_desc = &rdev->coupling_desc; + int i, ret, n_coupled, best_min_uV, best_max_uV, best_c_rdev; + unsigned int delta, best_delta; + unsigned long c_rdev_done = 0; + bool best_c_rdev_done; + + c_rdevs = c_desc->coupled_rdevs; + n_coupled = c_desc->n_coupled; + + /* + * Find the best possible voltage change on each loop. Leave the loop + * if there isn't any possible change. + */ + do { + best_c_rdev_done = false; + best_delta = 0; + best_min_uV = 0; + best_max_uV = 0; + best_c_rdev = 0; + best_rdev = NULL; + + /* + * Find highest difference between optimal voltage + * and current voltage. + */ + for (i = 0; i < n_coupled; i++) { + /* + * optimal_uV is the best voltage that can be set for + * i-th regulator at the moment without violating + * max_spread constraint in order to balance + * the coupled voltages. + */ + int optimal_uV = 0, optimal_max_uV = 0, current_uV = 0; + + if (test_bit(i, &c_rdev_done)) + continue; + + ret = regulator_get_optimal_voltage(c_rdevs[i], + ¤t_uV, + &optimal_uV, + &optimal_max_uV, + state); + if (ret < 0) + goto out; + + delta = abs(optimal_uV - current_uV); + + if (delta && best_delta <= delta) { + best_c_rdev_done = ret; + best_delta = delta; + best_rdev = c_rdevs[i]; + best_min_uV = optimal_uV; + best_max_uV = optimal_max_uV; + best_c_rdev = i; + } + } + + /* Nothing to change, return successfully */ + if (!best_rdev) { + ret = 0; + goto out; + } + + ret = regulator_set_voltage_rdev(best_rdev, best_min_uV, + best_max_uV, state); + + if (ret < 0) + goto out; + + if (best_c_rdev_done) + set_bit(best_c_rdev, &c_rdev_done); + + } while (n_coupled > 1); + +out: + return ret; +} + +static int exynos_coupler_attach(struct regulator_coupler *coupler, + struct regulator_dev *rdev) +{ + return 0; +} + +static struct regulator_coupler exynos_coupler = { + .attach_regulator = exynos_coupler_attach, + .balance_voltage = exynos_coupler_balance_voltage, +}; + +static int __init exynos_coupler_init(void) +{ + if (!of_machine_is_compatible("samsung,exynos5800")) + return 0; + + return regulator_coupler_register(&exynos_coupler); +} +arch_initcall(exynos_coupler_init); -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-07-21 18:11 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-07-21 18:08 [GIT PULL 0/4] samsung: Pull for v5.9 Krzysztof Kozlowski 2020-07-21 18:08 ` [GIT PULL 1/4] ARM: dts: samsung: DTS " Krzysztof Kozlowski 2020-07-21 18:08 ` [GIT PULL 2/4] arm64: " Krzysztof Kozlowski 2020-07-21 18:08 ` [GIT PULL 3/4] ARM: samsung: mach/soc " Krzysztof Kozlowski 2020-07-21 18:09 ` [PATCH 4/4] soc: samsung: exynos-regulator-coupler: Add simple voltage coupler for Exynos5800 Krzysztof Kozlowski
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).