From d31a3bd08ed46c51cdc5f5f126f2a721c5425bfb Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Mon, 10 Feb 2025 16:27:25 +0000 Subject: clk: add stub clock driver Add a stub clock driver which can be used to bind clock controllers which aren't required for the platform to boot, but which are needed for U-Boot drivers to work. In addition, add a NOP parent driver to allow for binding the parent nodes of the clock. Initially this driver supports a Qualcomm platform where the MMC driver tries to fetch the RPM clock controller, which is not actually required for the device to work. Reviewed-by: Neil Armstrong Acked-by: Ilias Apalodimas Signed-off-by: Caleb Connolly --- drivers/clk/Kconfig | 7 ++++++ drivers/clk/Makefile | 1 + drivers/clk/clk-stub.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 drivers/clk/clk-stub.c diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index d9d518d7038..18bd640a68b 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -96,6 +96,13 @@ config SPL_CLK_GPIO Enable this option to add GPIO-controlled clock gate driver in U-Boot SPL. +config CLK_STUB + bool "Stub clock driver" + depends on CLK + help + Enable this to provide a stub clock driver for non-essential clock + controllers. + config CLK_BCM6345 bool "Clock controller driver for BCM6345" depends on CLK && ARCH_BMIPS diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index 7f84f22d4b1..fe0e49f6112 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -11,6 +11,7 @@ obj-$(CONFIG_$(PHASE_)CLK_CCF) += clk.o clk-divider.o clk-mux.o clk-gate.o obj-$(CONFIG_$(PHASE_)CLK_CCF) += clk-fixed-factor.o obj-$(CONFIG_$(PHASE_)CLK_COMPOSITE_CCF) += clk-composite.o obj-$(CONFIG_$(PHASE_)CLK_GPIO) += clk-gpio.o +obj-$(CONFIG_$(PHASE_)CLK_STUB) += clk-stub.o obj-y += adi/ obj-y += analogbits/ diff --git a/drivers/clk/clk-stub.c b/drivers/clk/clk-stub.c new file mode 100644 index 00000000000..ea817031fa6 --- /dev/null +++ b/drivers/clk/clk-stub.c @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Stub clk driver for non-essential clocks. + * + * This driver should be used for clock controllers + * which are described as dependencies in DT but aren't + * actually necessary for hardware functionality. + */ + +#include +#include + +/* NOP parent nodes to stub clocks */ +static const struct udevice_id nop_parent_ids[] = { + { .compatible = "qcom,rpm-proc" }, + { .compatible = "qcom,glink-rpm" }, + { .compatible = "qcom,rpm-sm6115" }, + { } +}; + +U_BOOT_DRIVER(nop_parent) = { + .name = "nop_parent", + .id = UCLASS_NOP, + .of_match = nop_parent_ids, + .bind = dm_scan_fdt_dev, + .flags = DM_FLAG_DEFAULT_PD_CTRL_OFF, +}; + +static ulong stub_clk_set_rate(struct clk *clk, ulong rate) +{ + return (clk->rate = rate); +} + +static ulong stub_clk_get_rate(struct clk *clk) +{ + return clk->rate; +} + +static int stub_clk_nop(struct clk *clk) +{ + return 0; +} + +static struct clk_ops stub_clk_ops = { + .set_rate = stub_clk_set_rate, + .get_rate = stub_clk_get_rate, + .enable = stub_clk_nop, + .disable = stub_clk_nop, +}; + +static const struct udevice_id stub_clk_ids[] = { + { .compatible = "qcom,rpmcc" }, + { .compatible = "qcom,sm8250-rpmh-clk" }, + { .compatible = "qcom,sm8550-rpmh-clk" }, + { .compatible = "qcom,sm8650-rpmh-clk" }, + { } +}; + +U_BOOT_DRIVER(clk_stub) = { + .name = "clk_stub", + .id = UCLASS_CLK, + .ops = &stub_clk_ops, + .of_match = stub_clk_ids, + .flags = DM_FLAG_DEFAULT_PD_CTRL_OFF, +}; + -- cgit v1.3.1 From b72d6a9d619b000875699fde633b26c0ec1bca67 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Mon, 10 Feb 2025 16:27:26 +0000 Subject: qcom_defconfig: enable stub clock Enable the stub clock driver for rpmcc Reviewed-by: Neil Armstrong Acked-by: Ilias Apalodimas Signed-off-by: Caleb Connolly --- configs/qcom_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/qcom_defconfig b/configs/qcom_defconfig index e4abfdf16bb..9f5518a9fe9 100644 --- a/configs/qcom_defconfig +++ b/configs/qcom_defconfig @@ -58,6 +58,7 @@ CONFIG_CLK_QCOM_SM8550=y CONFIG_CLK_QCOM_SM8650=y CONFIG_CLK_QCOM_SC7280=y CONFIG_CLK_QCOM_X1E80100=y +CONFIG_CLK_STUB=y CONFIG_DFU_MMC=y CONFIG_DFU_SCSI=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x200000 -- cgit v1.3.1 From 506f6a384c335e86c4812c5e734dea4eabc21130 Mon Sep 17 00:00:00 2001 From: Julius Lehmann Date: Mon, 10 Feb 2025 16:27:27 +0000 Subject: clk: stub: add sm8150 compatible id Add support for sm8150 clock controller to clk stub driver. Signed-off-by: Julius Lehmann Reviewed-by: Neil Armstrong --- drivers/clk/clk-stub.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/clk-stub.c b/drivers/clk/clk-stub.c index ea817031fa6..5fbbb07b7f7 100644 --- a/drivers/clk/clk-stub.c +++ b/drivers/clk/clk-stub.c @@ -50,6 +50,7 @@ static struct clk_ops stub_clk_ops = { static const struct udevice_id stub_clk_ids[] = { { .compatible = "qcom,rpmcc" }, + { .compatible = "qcom,sm8150-rpmh-clk" }, { .compatible = "qcom,sm8250-rpmh-clk" }, { .compatible = "qcom,sm8550-rpmh-clk" }, { .compatible = "qcom,sm8650-rpmh-clk" }, -- cgit v1.3.1 From e57b72abb71b267d9b7b61181dc2ce902b47f425 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Mon, 10 Feb 2025 16:30:23 +0000 Subject: power: regulator: add additional supported LDOs for pm8150l Add the other LDOs that our rpmh driver can currently support. Some of these are used on the RB5 to power the sdcard. Reviewed-by: Neil Armstrong Tested-by: Amit Pundir Signed-off-by: Caleb Connolly --- drivers/power/regulator/qcom-rpmh-regulator.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/power/regulator/qcom-rpmh-regulator.c b/drivers/power/regulator/qcom-rpmh-regulator.c index 70df51b5fa4..cd2b1a654c1 100644 --- a/drivers/power/regulator/qcom-rpmh-regulator.c +++ b/drivers/power/regulator/qcom-rpmh-regulator.c @@ -481,6 +481,13 @@ static const struct rpmh_vreg_init_data pm8150_vreg_data[] = { static const struct rpmh_vreg_init_data pm8150l_vreg_data[] = { RPMH_VREG("ldo1", "ldo%s1", &pmic5_pldo_lv, "vdd-l1-l8"), + RPMH_VREG("ldo4", "ldo%s4", &pmic5_pldo, "vdd-l4-l5-l6"), + RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo, "vdd-l4-l5-l6"), + RPMH_VREG("ldo6", "ldo%s6", &pmic5_pldo, "vdd-l4-l5-l6"), + RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo, "vdd-l7-l11"), + RPMH_VREG("ldo8", "ldo%s8", &pmic5_pldo_lv, "vdd-l1-l8"), + RPMH_VREG("ldo9", "ldo%s9", &pmic5_pldo, "vdd-l9-l10"), + RPMH_VREG("ldo10", "ldo%s10", &pmic5_pldo, "vdd-l9-l10"), RPMH_VREG("ldo11", "ldo%s11", &pmic5_pldo, "vdd-l7-l11"), {} }; -- cgit v1.3.1 From 554562f7b50d780eea64763d444b6ddd2c216072 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Mon, 10 Feb 2025 16:30:24 +0000 Subject: pinctrl: qcom: sm8250: fix pin count The pin count wasn't updated when the special pins were added, as a result it was never possible to configure the special pins on SM8250 boards. Fix the pin count and allow the special pins to be configured. This fixes sdcard support on the RB5. Fixes: 58fa52042471 ("pinctr: qcom: sm8250: add special pins pins configuration data") Reviewed-by: Neil Armstrong Tested-by: Amit Pundir Signed-off-by: Caleb Connolly --- drivers/pinctrl/qcom/pinctrl-sm8250.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/qcom/pinctrl-sm8250.c b/drivers/pinctrl/qcom/pinctrl-sm8250.c index cab42fa64ed..b21cdc4d24b 100644 --- a/drivers/pinctrl/qcom/pinctrl-sm8250.c +++ b/drivers/pinctrl/qcom/pinctrl-sm8250.c @@ -107,7 +107,7 @@ static unsigned int sm8250_get_function_mux(__maybe_unused unsigned int pin, uns static struct msm_pinctrl_data sm8250_data = { .pin_data = { .pin_offsets = sm8250_pin_offsets, - .pin_count = ARRAY_SIZE(sm8250_pin_offsets), + .pin_count = 184, .special_pins_start = 180, .special_pins_data = sm8250_special_pins_data, }, -- cgit v1.3.1 From 6267ce556595e0586aee3a7d63042d105dc3fa4e Mon Sep 17 00:00:00 2001 From: Sam Day Date: Mon, 3 Feb 2025 16:42:20 +0000 Subject: cmd: ufetch: use 3-bit colour ANSI codes Currently, the 8-bit escapes are being used, which aren't supported by vidconsole_escape_char. Since the current usage maps directly to the 3-bit equivalents anyway, let's use those instead. With this change, the fetch output looks as fetching in the vidconsole as it does over serial! Signed-off-by: Sam Day Tested-by: Alexey Minnekhanov Tested-by: Ferass El Hafidi --- cmd/ufetch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/ufetch.c b/cmd/ufetch.c index ed5a856c7ab..46bd16824e6 100644 --- a/cmd/ufetch.c +++ b/cmd/ufetch.c @@ -24,8 +24,8 @@ DECLARE_GLOBAL_DATA_PTR; #define LINE_WIDTH 40 -#define BLUE "\033[38;5;4m" -#define YELLOW "\033[38;5;11m" +#define BLUE "\033[34m" +#define YELLOW "\033[33m" #define BOLD "\033[1m" #define RESET "\033[0m" static const char * const logo_lines[] = { -- cgit v1.3.1