Qualcomm: fix sdm845 clocks and enable fastboot
cover Qualcomm: fix sdm845 clocks and enable fastboot
Fix clock init failures for USB and UFS on SDM845 devices, stub the RPMh clock controller, enable DM_USB_GADGET and fastboot support for all Qualcomm platforms supported by qcom_defconfig.
Fastboot isn't super useful yet, but can be used for flashing MMC (either internal or sdcard).
Depends on https://lore.kernel.org/u-boot/[email protected]
Depends on https://lore.kernel.org/u-boot/[email protected]/
---
Caleb Connolly (4):
clk/stub: add sdm845 rpmh clock clk/qcom: sdm845: add GCC_AGGRE_UFS_PHY_AXI_CLK
mach-snapdragon: enable DM_USB_GADGET by default
qcom_defconfig: enable fastboot
arch/arm/Kconfig | 1 + configs/dragonboard410c_defconfig | 1 + configs/qcom_defconfig | 5 +++++ drivers/clk/clk-stub.c | 1 + drivers/clk/qcom/clock-sdm845.c | 1 + 5 files changed, 9 insertions(+)
---
base-commit: dcb6a5e7651f4a6cebfad4389119407e2a852783
Caleb Connolly <[email protected]>
PATCH 1/4 clk/stub: add sdm845 rpmh clock
Necessary for UFS to successfully probe all clocks.
--- drivers/clk/clk-stub.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/clk-stub.c +1 -0
@@ -49,8 +49,9 @@ static struct clk_ops stub_clk_ops = { };static const struct udevice_id stub_clk_ids[] = { { .compatible ="qcom,rpmcc" }, + { .compatible ="qcom,sdm845-rpmh-clk" }, { .compatible ="qcom,sc7280-rpmh-clk" }, { .compatible ="qcom,sm8150-rpmh-clk" }, { .compatible ="qcom,sm8250-rpmh-clk" }, { .compatible ="qcom,sm8550-rpmh-clk" },
Signature · 1 line
2.49.0
Re: [PATCH 1/4] clk/stub: add sdm845 rpmh clock
Quoted 13 lines · Caleb Connolly
Necessary for UFS to successfully probe all clocks.
Signed-off-by Caleb Connolly <[email protected]>--- drivers/clk/clk-stub.c | 1 + 1 file changed, 1 insertion(+)drivers/clk/clk-stub.c +0
-0
drivers/clk/clk-stub.c static struct clk_ops stub_clk_ops = { · line 57
Quoted 9 lines
drivers/clk/clk-stub.c +1
-0@@ -49,8 +49,9 @@ static struct clk_ops stub_clk_ops = { };static const struct udevice_id stub_clk_ids[] = { { .compatible ="qcom,rpmcc" }, + { .compatible ="qcom,sdm845-rpmh-clk" }, { .compatible ="qcom,sc7280-rpmh-clk" }, { .compatible ="qcom,sm8150-rpmh-clk" }, { .compatible ="qcom,sm8250-rpmh-clk" }, { .compatible ="qcom,sm8550-rpmh-clk" },
PATCH 2/4 clk/qcom: sdm845: add GCC_AGGRE_UFS_PHY_AXI_CLK
In reply to Caleb ConnollyMissing for UFS.
--- drivers/clk/qcom/clock-sdm845.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/qcom/clock-sdm845.c +1 -0
@@ -113,8 +113,9 @@ static const struct gate_clk sdm845_clks[] = {GATE_CLK (GCC_UFS_CARD_RX_SYMBOL_1_CLK ,0x750a8 ,0x00000001 ),GATE_CLK (GCC_UFS_CARD_TX_SYMBOL_0_CLK ,0x75014 ,0x00000001 ),GATE_CLK (GCC_UFS_CARD_UNIPRO_CORE_CLK ,0x75054 ,0x00000001 ),GATE_CLK (GCC_UFS_MEM_CLKREF_CLK ,0x8c000 ,0x00000001 ), +GATE_CLK (GCC_AGGRE_UFS_PHY_AXI_CLK ,0x82024 ,0x00000001 ),GATE_CLK (GCC_UFS_PHY_AHB_CLK ,0x77010 ,0x00000001 ),GATE_CLK (GCC_UFS_PHY_AXI_CLK ,0x7700c ,0x00000001 ),GATE_CLK (GCC_UFS_PHY_ICE_CORE_CLK ,0x77058 ,0x00000001 ), GATE_CLK(GCC_UFS_PHY_PHY_AUX_CLK, 0x7708c, 0x00000001),
Signature · 1 line
2.49.0
Re: [PATCH 2/4] clk/qcom: sdm845: add GCC_AGGRE_UFS_PHY_AXI_CLK
Quoted 13 lines · Caleb Connolly
Missing for UFS.
Signed-off-by Caleb Connolly <[email protected]>--- drivers/clk/qcom/clock-sdm845.c | 1 + 1 file changed, 1 insertion(+)drivers/clk/qcom/clock-sdm845.c +0
-0
drivers/clk/qcom/clock-sdm845.c static const struct gate_clk sdm845_clks[] = { · line 121
Quoted 9 lines
drivers/clk/qcom/clock-sdm845.c +1
-0@@ -113,8 +113,9 @@ static const struct gate_clk sdm845_clks[] = {GATE_CLK (GCC_UFS_CARD_RX_SYMBOL_1_CLK ,0x750a8 ,0x00000001 ),GATE_CLK (GCC_UFS_CARD_TX_SYMBOL_0_CLK ,0x75014 ,0x00000001 ),GATE_CLK (GCC_UFS_CARD_UNIPRO_CORE_CLK ,0x75054 ,0x00000001 ),GATE_CLK (GCC_UFS_MEM_CLKREF_CLK ,0x8c000 ,0x00000001 ), +GATE_CLK (GCC_AGGRE_UFS_PHY_AXI_CLK ,0x82024 ,0x00000001 ),GATE_CLK (GCC_UFS_PHY_AHB_CLK ,0x77010 ,0x00000001 ),GATE_CLK (GCC_UFS_PHY_AXI_CLK ,0x7700c ,0x00000001 ),GATE_CLK (GCC_UFS_PHY_ICE_CORE_CLK ,0x77058 ,0x00000001 ), GATE_CLK(GCC_UFS_PHY_PHY_AUX_CLK, 0x7708c, 0x00000001),
PATCH 3/4 mach-snapdragon: enable DM_USB_GADGET by default
In reply to Caleb ConnollyThis is required for gadget modes to work on most platforms. It must be disabled for dragonboard410c since that doesn't use dwc3. USB on other MSM8916 platforms isn't supported by qcom_defconfig anyway.
--- arch/arm/Kconfig | 1 + configs/dragonboard410c_defconfig | 1 + 2 files changed, 2 insertions(+)
arch/arm/Kconfig +1 -0
@@ -1120,8 +1120,9 @@ config ARCH_SNAPDRAGON select SYSRESET select SYSRESET_PSCI imply OF_UPSTREAM imply CMD_DM + imply DM_USB_GADGET config ARCH_SOCFPGA bool "Altera SOCFPGA family" select ARCH_EARLY_INIT_R
configs/dragonboard410c_defconfig +1 -0
@@ -59,8 +59,9 @@ CONFIG_DM_PMIC=y CONFIG_PMIC_QCOM=y CONFIG_MSM_SERIAL=y CONFIG_SPMI_MSM=y CONFIG_USB=y +# CONFIG_DM_USB_GADGET is not set CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_MSM=y CONFIG_USB_ULPI_VIEWPORT=y CONFIG_USB_ULPI=y
Signature · 1 line
2.49.0
PATCH 4/4 qcom_defconfig: enable fastboot
In reply to Caleb ConnollyEnable fastboot support over USB, using MMC as the backend. This will be the internal eMMC on devices that have it, or the sdcard slot on devices with UFS (if available).
We don't use a fixed address for the fastboot buffer because it's allocated at runtime per-board. Entering fastboot mode should be done by executing "run fastboot" or manually running:
fastboot -l $fastboot_addr_r usb 0
--- configs/qcom_defconfig | 5 +++++ 1 file changed, 5 insertions(+)
configs/qcom_defconfig +5 -0
@@ -61,8 +61,13 @@ CONFIG_CLK_QCOM_SC7280=y CONFIG_CLK_QCOM_X1E80100=y CONFIG_DFU_MMC=y CONFIG_DFU_SCSI=y CONFIG_SYS_DFU_DATA_BUF_SIZE=0x200000 +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0x0 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=0 +CONFIG_FASTBOOT_MMC_USER_SUPPORT=y CONFIG_MSM_GPIO=y CONFIG_QCOM_PMIC_GPIO=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_QUP=y
Signature · 1 line
2.49.0
Re: [PATCH 4/4] qcom_defconfig: enable fastboot
Quoted 24 lines · Caleb Connolly
Enable fastboot support over USB, using MMC as the backend. This will be the internal eMMC on devices that have it, or the sdcard slot on devices with UFS (if available).
We don't use a fixed address for the fastboot buffer because it's allocated at runtime per-board. Entering fastboot mode should be done by executing "run fastboot" or manually running:
fastboot -l $fastboot_addr_r usb 0
Signed-off-by Caleb Connolly <[email protected]>--- configs/qcom_defconfig | 5 +++++ 1 file changed, 5 insertions(+)configs/qcom_defconfig +0
-0@@ -61,8 +61,13 @@ CONFIG_CLK_QCOM_SC7280=y CONFIG_CLK_QCOM_X1E80100=y CONFIG_DFU_MMC=y CONFIG_DFU_SCSI=y
configs/qcom_defconfig CONFIG_CLK_QCOM_SC7280=y · line 73
Quoted 10 lines
configs/qcom_defconfig +5
-0CONFIG_SYS_DFU_DATA_BUF_SIZE=0x200000 +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0x0 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=0 +CONFIG_FASTBOOT_MMC_USER_SUPPORT=y CONFIG_MSM_GPIO=y CONFIG_QCOM_PMIC_GPIO=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_QUP=y
Caleb Connolly
AppliedQuoted 8 lines · Caleb Connolly
Fix clock init failures for USB and UFS on SDM845 devices, stub the RPMh clock controller, enable
DM_USB_GADGETand fastboot support for all Qualcomm platforms supported byqcom_defconfig.Fastboot isn't super useful yet, but can be used for flashing MMC (either internal or sdcard).
[...]
Applied, thanks!
[1/4] clk/stub: add sdm845 rpmh clock
https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/f1db41b320b7
[2/4] clk/qcom: sdm845: add GCC_AGGRE_UFS_PHY_AXI_CLK
https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/15cde58aaf5f
[3/4] mach-snapdragon: enable DM_USB_GADGET by default
https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/7235dbedfce3
[4/4] qcom_defconfig: enable fastboot
https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/af2bc4c21dd1
Best regards,
Signature · 1 line
Caleb Connolly <[email protected]>