New boards support: db845c and qcs404-evb
Subsystems (7)
v3 cover New boards support: db845c and qcs404-evb
Add support for two new boards db845c and qcs404-evb:
- db845c is a 96boards compliant platform aka RB3 based on Qualcomm SDM845 SoC.
- qcs404-evb is an evaluation board from Qualcomm based on QCS404 SoC.
Both these platforms have one thing in common that u-boot is chain-loaded in 64-bit mode via Android Boot Loader (ABL) which is an EFI application. For further details on chain-loading refer to platform specific documentation:
- doc/board/qualcomm/sdm845.rst
- doc/board/qualcomm/qcs404.rst
Changes in v3:
- Add clocks re-initialization for UART and eMMC for qcs404-evb.
- Pick up Ramon's review tag for patches 1-7.
Changes in v2:
- Added patch #1 to fix DT node overrides in starqltechn-uboot.dtsi.
- Updated patch #2 commit description.
- Fixed a typo (s/96Board/96Boards/) in patch #5.
Sumit Garg (9):
board: starqltechn: Align DT node overrides with sdm845.dtsi
arm64: dts: sdm845: Remove redundant u-boot DT properties
clocks: sdm845: Import qcom,gcc-sdm845.h
uart: sdm845: Fix debug UART pinmux
board: qualcomm: Add support for dragonboard845c
mmc: msm_sdhci: Add SDCC version 5.0.0 support
pinctrl: qcom: Add pinctrl driver for QCS404 SoC
clocks: qcom: Add clock driver for QCS404 SoC
board: qualcomm: Add support for QCS404 EVB
arch/arm/dts/Makefile | 1 + arch/arm/dts/dragonboard845c-uboot.dtsi | 37 +++ arch/arm/dts/dragonboard845c.dts | 44 ++++ arch/arm/dts/qcs404-evb-uboot.dtsi | 24 ++ arch/arm/dts/qcs404-evb.dts | 81 ++++++ arch/arm/dts/sdm845.dtsi | 8 +- arch/arm/dts/starqltechn-uboot.dtsi | 18 +- arch/arm/dts/starqltechn.dts | 2 +- arch/arm/mach-snapdragon/Kconfig | 25 ++ arch/arm/mach-snapdragon/Makefile | 3 + arch/arm/mach-snapdragon/clock-qcs404.c | 79 ++++++ arch/arm/mach-snapdragon/clock-sdm845.c | 3 +- arch/arm/mach-snapdragon/clock-snapdragon.c | 1 + .../include/mach/sysmap-qcs404.h | 40 +++ arch/arm/mach-snapdragon/pinctrl-qcs404.c | 55 ++++ arch/arm/mach-snapdragon/pinctrl-snapdragon.c | 1 + arch/arm/mach-snapdragon/pinctrl-snapdragon.h | 1 + arch/arm/mach-snapdragon/sysmap-qcs404.c | 31 +++ board/qualcomm/dragonboard845c/Kconfig | 12 + board/qualcomm/dragonboard845c/MAINTAINERS | 6 + board/qualcomm/dragonboard845c/Makefile | 9 + board/qualcomm/dragonboard845c/db845c.its | 63 +++++ .../dragonboard845c/dragonboard845c.c | 9 + board/qualcomm/qcs404-evb/Kconfig | 15 ++ board/qualcomm/qcs404-evb/MAINTAINERS | 6 + board/qualcomm/qcs404-evb/Makefile | 6 + board/qualcomm/qcs404-evb/qcs404-evb.c | 33 +++ board/qualcomm/qcs404-evb/qcs404-evb.its | 64 +++++ configs/dragonboard845c_defconfig | 28 ++ configs/qcs404evb_defconfig | 39 +++ doc/board/qualcomm/index.rst | 1 + doc/board/qualcomm/qcs404.rst | 79 ++++++ doc/board/qualcomm/sdm845.rst | 100 ++++++- drivers/mmc/msm_sdhci.c | 96 ++++--- include/configs/dragonboard845c.h | 28 ++ include/configs/qcs404-evb.h | 27 ++ include/dt-bindings/clock/qcom,gcc-qcs404.h | 180 +++++++++++++ include/dt-bindings/clock/qcom,gcc-sdm845.h | 246 ++++++++++++++++++ 38 files changed, 1439 insertions(+), 62 deletions(-) create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi create mode 100644 arch/arm/dts/dragonboard845c.dts create mode 100644 arch/arm/dts/qcs404-evb-uboot.dtsi create mode 100644 arch/arm/dts/qcs404-evb.dts create mode 100644 arch/arm/mach-snapdragon/clock-qcs404.c create mode 100644 arch/arm/mach-snapdragon/include/mach/sysmap-qcs404.h create mode 100644 arch/arm/mach-snapdragon/pinctrl-qcs404.c create mode 100644 arch/arm/mach-snapdragon/sysmap-qcs404.c create mode 100644 board/qualcomm/dragonboard845c/Kconfig create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS create mode 100644 board/qualcomm/dragonboard845c/Makefile create mode 100644 board/qualcomm/dragonboard845c/db845c.its create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c create mode 100644 board/qualcomm/qcs404-evb/Kconfig create mode 100644 board/qualcomm/qcs404-evb/MAINTAINERS create mode 100644 board/qualcomm/qcs404-evb/Makefile create mode 100644 board/qualcomm/qcs404-evb/qcs404-evb.c create mode 100644 board/qualcomm/qcs404-evb/qcs404-evb.its create mode 100644 configs/dragonboard845c_defconfig create mode 100644 configs/qcs404evb_defconfig create mode 100644 doc/board/qualcomm/qcs404.rst create mode 100644 include/configs/dragonboard845c.h create mode 100644 include/configs/qcs404-evb.h create mode 100644 include/dt-bindings/clock/qcom,gcc-qcs404.h create mode 100644 include/dt-bindings/clock/qcom,gcc-sdm845.h
Signature · 1 line
2.25.1
PATCH v3 1/9 board: starqltechn: Align DT node overrides with sdm845.dtsi
Currently there is a mismatch among DT node overrides in starqltechn board DTS file and the actual DT nodes in the sdm845.dtsi. So fix that to align with DT nodes in sdm845.dtsi.
--- arch/arm/dts/starqltechn-uboot.dtsi | 18 ++++++++---------- arch/arm/dts/starqltechn.dts | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-)
arch/arm/dts/starqltechn-uboot.dtsi +8 -10
@@ -16,16 +16,14 @@ serial@a84000 { u-boot,dm-pre-reloc; }; - gcc { - clock-controller@100000 { - u-boot,dm-pre-reloc; - }; - gpio_north@3900000 { - u-boot,dm-pre-reloc; - }; - pinctrl@3900000 { - u-boot,dm-pre-reloc; - }; + clock-controller@100000 { + u-boot,dm-pre-reloc; + }; + gpio_north@3900000 { + u-boot,dm-pre-reloc; + }; + pinctrl_north@3900000 { + u-boot,dm-pre-reloc; }; }; };
arch/arm/dts/starqltechn.dts +1 -1
@@ -48,7 +48,7 @@ status = "okay"; }; - pinctrl@3900000 { + pinctrl_north@3900000 { muic_i2c: muic_i2c { pins = "GPIO_33", "GPIO_34"; drive-strength = <0x2>;
Signature · 1 line
2.25.1
Re: [PATCH v3 1/9] board: starqltechn: Align DT node overrides with sdm845.dtsi
Quoted 6 lines · Sumit Garg
Currently there is a mismatch among DT node overrides in starqltechn board DTS file and the actual DT nodes in the
sdm845.dtsi. So fix that to align with DT nodes insdm845.dtsi.Signed-off-by Sumit Garg <[email protected]>Reviewed-by Ramon Fried <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
PATCH v3 2/9 arm64: dts: sdm845: Remove redundant u-boot DT properties
In reply to Sumit GargAccording to u-boot DT recomendation, u-boot specific DT properties belong to *-uboot.dtsi. Also for starqltechn board (which is the only current consumer of sdm845.dtsi), the properties are already included in starqltechn-uboot.dtsi, so remove corresponding redundant properties.
--- arch/arm/dts/sdm845.dtsi | 3 --- 1 file changed, 3 deletions(-)
arch/arm/dts/sdm845.dtsi +0 -3
@@ -18,7 +18,6 @@ compatible = "simple-bus"; gcc: clock-controller@100000 { - u-boot,dm-pre-reloc; compatible = "qcom,gcc-sdm845"; reg = <0x100000 0x1f0000>; #clock-cells = <1>;
@@ -27,7 +26,6 @@ }; gpio_north: gpio_north@3900000 { - u-boot,dm-pre-reloc; #gpio-cells = <2>; compatible = "qcom,sdm845-pinctrl"; reg = <0x3900000 0x400000>;
@@ -38,7 +36,6 @@ }; tlmm_north: pinctrl_north@3900000 { - u-boot,dm-pre-reloc; compatible = "qcom,tlmm-sdm845"; reg = <0x3900000 0x400000>; gpio-count = <150>;
Signature · 1 line
2.25.1
Re: [PATCH v3 2/9] arm64: dts: sdm845: Remove redundant u-boot DT properties
Quoted 7 lines · Sumit Garg
According to u-boot DT recomendation, u-boot specific DT properties belong to *-uboot.dtsi. Also for starqltechn board (which is the only current consumer of
sdm845.dtsi), the properties are already included instarqltechn-uboot.dtsi, so remove corresponding redundant properties.Signed-off-by Sumit Garg <[email protected]>Reviewed-by Ramon Fried <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
PATCH v3 3/9 clocks: sdm845: Import qcom,gcc-sdm845.h
In reply to Sumit GargRather than using magic numbers as clock ids for peripherals import qcom,gcc-sdm845.h from Linux to be used standard macros for clock ids. So start using corresponding clk-id macro for debug UART.
--- arch/arm/dts/sdm845.dtsi | 3 +- arch/arm/mach-snapdragon/clock-sdm845.c | 3 +- include/dt-bindings/clock/qcom,gcc-sdm845.h | 246 ++++++++++++++++++++ 3 files changed, 250 insertions(+), 2 deletions(-) create mode 100644 include/dt-bindings/clock/qcom,gcc-sdm845.h
arch/arm/dts/sdm845.dtsi +2 -1
@@ -8,6 +8,7 @@ /dts-v1/; +#include <dt-bindings/clock/qcom,gcc-sdm845.h> #include "skeleton64.dtsi" / {
@@ -55,7 +56,7 @@ reg = <0xa84000 0x4000>; reg-names = "se_phys"; clock-names = "se-clk"; - clocks = <&gcc 0x58>; + clocks = <&gcc GCC_QUPV3_WRAP1_S1_CLK>; pinctrl-names = "default"; pinctrl-0 = <&qup_uart9>; qcom,wrapper-core = <0x8a>;
arch/arm/mach-snapdragon/clock-sdm845.c +2 -1
@@ -14,6 +14,7 @@#include <errno.h> #include <asm/io.h> #include <linux/bitops.h> +#include <dt-bindings/clock/qcom,gcc-sdm845.h> #include "clock-snapdragon.h" #define F (f, s, h, m, n) { (f), (s), (2 * (h) - 1), (m), (n) }
@@ -84,7 +85,7 @@ ulong msm_set_rate(struct clk *clk, ulong rate)struct msm_clk_priv *priv =dev_get_priv (clk->dev);switch (clk->id) { -case 0x58 :/*UART2*/ +case GCC_QUPV3_WRAP1_S1_CLK :/*UART2*/ return clk_init_uart (priv, rate);default :return 0 ;
include/dt-bindings/clock/qcom,gcc-sdm845.h new file +246 -0
246 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [PATCH v3 3/9] clocks: sdm845: Import qcom,gcc-sdm845.h
Quoted 6 lines · Sumit Garg
Rather than using magic numbers as clock ids for peripherals import qcom,gcc-sdm845.h from Linux to be used standard macros for clock ids. So start using corresponding clk-id macro for debug UART.
Signed-off-by Sumit Garg <[email protected]>Reviewed-by Ramon Fried <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
PATCH v3 4/9 uart: sdm845: Fix debug UART pinmux
In reply to Sumit GargConfigure debug UART pins as function: "qup9" rather than being regular gpios. It fixes a hang seen during pinmux setting.
--- arch/arm/dts/sdm845.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/dts/sdm845.dtsi +1 -1
@@ -47,7 +47,7 @@ /* DEBUG UART */ qup_uart9: qup-uart9-default { pins = "GPIO_4", "GPIO_5"; - function = "gpio"; + function = "qup9"; }; };
Signature · 1 line
2.25.1
Re: [PATCH v3 4/9] uart: sdm845: Fix debug UART pinmux
Quoted 5 lines · Sumit Garg
Configure debug UART pins as function: "qup9" rather than being regular gpios. It fixes a hang seen during pinmux setting.
Signed-off-by Sumit Garg <[email protected]>Reviewed-by Ramon Fried <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
PATCH v3 5/9 board: qualcomm: Add support for dragonboard845c
In reply to Sumit GargAdd support for 96Boards Dragonboard 845C aka Robotics RB3 development platform. This board complies with 96Boards Open Platform Specifications.
Features:
- Qualcomm Snapdragon SDA845 SoC
- 4GiB RAM
- 64GiB UFS drive
U-boot is chain loaded by ABL in 64-bit mode as part of boot.img. For detailed build and boot instructions, refer to doc/board/qualcomm/sdm845.rst, board: dragonboard845c.
--- arch/arm/dts/dragonboard845c-uboot.dtsi | 37 +++++++ arch/arm/dts/dragonboard845c.dts | 44 ++++++++ arch/arm/mach-snapdragon/Kconfig | 14 +++ board/qualcomm/dragonboard845c/Kconfig | 12 +++ board/qualcomm/dragonboard845c/MAINTAINERS | 6 ++ board/qualcomm/dragonboard845c/Makefile | 9 ++ board/qualcomm/dragonboard845c/db845c.its | 63 +++++++++++ .../dragonboard845c/dragonboard845c.c | 9 ++ configs/dragonboard845c_defconfig | 28 +++++ doc/board/qualcomm/sdm845.rst | 100 +++++++++++++++--- include/configs/dragonboard845c.h | 28 +++++ 11 files changed, 337 insertions(+), 13 deletions(-) create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi create mode 100644 arch/arm/dts/dragonboard845c.dts create mode 100644 board/qualcomm/dragonboard845c/Kconfig create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS create mode 100644 board/qualcomm/dragonboard845c/Makefile create mode 100644 board/qualcomm/dragonboard845c/db845c.its create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c create mode 100644 configs/dragonboard845c_defconfig create mode 100644 include/configs/dragonboard845c.h
arch/arm/dts/dragonboard845c-uboot.dtsi new file +37 -0
@@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * U-Boot addition to handle Qualcomm Robotics RB3 Development Platform + * (dragonboard845c) pins + * + * (C) Copyright 2022 Sumit Garg <[email protected]> + */ + +/ +{ + soc { + u-boot,dm-pre-reloc; + + serial@a84000 { + u-boot,dm-pre-reloc; + }; + + clock-controller@100000 { + u-boot,dm-pre-reloc; + }; + + pinctrl_north@3900000 { + u-boot,dm-pre-reloc; + }; + }; +}; + +&pm8998_pon { + key_vol_down { + gpios = <&pm8998_pon 1 0>; + label = "key_vol_down"; + }; + key_power { + gpios = <&pm8998_pon 0 0>; + label = "key_power"; + }; +};
arch/arm/dts/dragonboard845c.dts new file +44 -0
44 lines not on this page · raw message
arch/arm/mach-snapdragon/Kconfig +14 -0
@@ -44,6 +44,19 @@ config TARGET_DRAGONBOARD820C - 3GiB RAM - 32GiB UFS drive +config TARGET_DRAGONBOARD845C + bool "96Boards Dragonboard 845C" + help + Support for 96Boards Dragonboard 845C aka Robotics RB3 Development + Platform. This board complies with 96Boards Open Platform + Specifications. Features: + - Qualcomm Snapdragon SDA845 SoC + - 4GiB RAM + - 64GiB UFS drive + select MISC_INIT_R + select SDM845 + select DM_ETH if NET + config TARGET_STARQLTECHN bool "Samsung S9 SM-G9600(starqltechn)" help
@@ -60,6 +73,7 @@ endchoice source "board/qualcomm/dragonboard410c/Kconfig" source "board/qualcomm/dragonboard820c/Kconfig" +source "board/qualcomm/dragonboard845c/Kconfig" source "board/samsung/starqltechn/Kconfig" endif
board/qualcomm/dragonboard845c/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if TARGET_DRAGONBOARD845C + +config SYS_BOARD + default "dragonboard845c" + +config SYS_CONFIG_NAME + default "dragonboard845c" + +config SYS_VENDOR + default "qualcomm" + +endif
board/qualcomm/dragonboard845c/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +Qualcomm Robotics RB3 Development Platform (dragonboard845c) +M: Sumit Garg <[email protected]> +S: Maintained +F: board/qualcomm/dragonboard845c/ +F: include/configs/dragonboard845c.h +F: configs/dragonboard845c_defconfig
board/qualcomm/dragonboard845c/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2022 Sumit Garg <[email protected]> +# +# This empty file prevents make error. +# Board logic defined in board/qualcomm/common/sdm845.c, no custom logic for dragonboard845c so far. +# + +obj-y += dragonboard845c.o
board/qualcomm/dragonboard845c/db845c.its new file +63 -0
63 lines not on this page · raw message
board/qualcomm/dragonboard845c/dragonboard845c.c new file +9 -0
@@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* This empty file prevents make linking error. +* No custom logic for dragonboard845c so far. +* +* (C) Copyright 2022 Sumit Garg <[email protected]> +*/ + +void noop (void ) {}
configs/dragonboard845c_defconfig new file +28 -0
@@ -0,0 +1,28 @@ +CONFIG_ARM=y +CONFIG_SKIP_LOWLEVEL_INIT=y +CONFIG_COUNTER_FREQUENCY=19000000 +CONFIG_POSITION_INDEPENDENT=y +CONFIG_ARCH_SNAPDRAGON=y +CONFIG_DEFAULT_DEVICE_TREE="dragonboard845c" +CONFIG_TARGET_DRAGONBOARD845C=y +CONFIG_IDENT_STRING="\nQualcomm-DragonBoard 845C" +CONFIG_SYS_LOAD_ADDR=0x80000000 +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +CONFIG_BOOTDELAY=5 +CONFIG_SAVE_PREV_BL_FDT_ADDR=y +CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR=y +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_HUSH_PARSER=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_BMP=y +# CONFIG_NET is not set +CONFIG_CLK=y +CONFIG_MSM_GPIO=y +CONFIG_PM8916_GPIO=y +CONFIG_PINCTRL=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_PM8916=y +CONFIG_MSM_GENI_SERIAL=y +CONFIG_SPMI_MSM=y +CONFIG_LMB_MAX_REGIONS=64
doc/board/qualcomm/sdm845.rst +87 -13
122 lines not on this page · raw message
include/configs/dragonboard845c.h new file +28 -0
@@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Configuration file for Dragonboard 845c, based on Qualcomm SDA845 chip +* +* (C) Copyright 2022 Sumit Garg <[email protected]> +*/ + +#ifndef __CONFIGS_SDM845_H +#define __CONFIGS_SDM845_H + +#include <linux/sizes.h> +#include <asm/arch/sysmap-sdm845.h> + +#define CONFIG_SYS_BAUDRATE_TABLE { 115200, 230400, 460800, 921600 } + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "bootm_size=0x5000000\0" \ + "bootm_low=0x80000000\0" \ + "bootcmd=bootm $prevbl_initrd_start_addr\0" + +/* Size of malloc() pool */ +#define CONFIG_SYS_BOOTM_LEN SZ_64M + +/* Monitor Command Prompt */ +#define CONFIG_SYS_CBSIZE 512 +#define CONFIG_SYS_MAXARGS 64 + +#endif
Signature · 1 line
2.25.1
Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c
Quoted 8 lines · Sumit Garg
Add support for 96Boards Dragonboard 845C aka Robotics RB3 development platform. This board complies with 96Boards Open Platform Specifications.
Features:
- Qualcomm Snapdragon SDA845 SoC
- 4GiB RAM
- 64GiB UFS drive
Quoted 6 lines
U-boot is chain loaded by ABL in 64-bit mode as part of boot.img. For detailed build and boot instructions, refer to
doc/board/qualcomm/sdm845.rst, board: dragonboard845c.Signed-off-by Sumit Garg <[email protected]>Reviewed-by Ramon Fried <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c
In reply to Sumit GargHi Sumit,
Quoted 38 lines · Sumit Garg
Add support for 96Boards Dragonboard 845C aka Robotics RB3 development platform. This board complies with 96Boards Open Platform Specifications.
Features:
- Qualcomm Snapdragon SDA845 SoC
- 4GiB RAM
- 64GiB UFS driveU-boot is chain loaded by ABL in 64-bit mode as part of boot.img. For detailed build and boot instructions, refer to
doc/board/qualcomm/sdm845.rst, board: dragonboard845c.Signed-off-by Sumit Garg <[email protected]>Reviewed-by Ramon Fried <[email protected]>--- arch/arm/dts/dragonboard845c-uboot.dtsi | 37 +++++++ arch/arm/dts/dragonboard845c.dts | 44 ++++++++ arch/arm/mach-snapdragon/Kconfig | 14 +++ board/qualcomm/dragonboard845c/Kconfig | 12 +++ board/qualcomm/dragonboard845c/MAINTAINERS | 6 ++ board/qualcomm/dragonboard845c/Makefile | 9 ++ board/qualcomm/dragonboard845c/db845c.its | 63 +++++++++++ .../dragonboard845c/dragonboard845c.c | 9 ++ configs/dragonboard845c_defconfig | 28 +++++ doc/board/qualcomm/sdm845.rst | 100 +++++++++++++++--- include/configs/dragonboard845c.h | 28 +++++ 11 files changed, 337 insertions(+), 13 deletions(-) create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi create mode 100644 arch/arm/dts/dragonboard845c.dts create mode 100644 board/qualcomm/dragonboard845c/Kconfig create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS create mode 100644 board/qualcomm/dragonboard845c/Makefile create mode 100644 board/qualcomm/dragonboard845c/db845c.its create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c create mode 100644 configs/dragonboard845c_defconfig create mode 100644 include/configs/dragonboard845c.h
[..]
Quoted 11 lines
doc/board/qualcomm/sdm845.rst +1
-1@@ -35,9 +35,25 @@ Pack android boot image ^^^^^^^^^^^^^^^^^^^^^^^ We'll assemble android boot image with ``u-boot.bin`` instead of linux kernel, and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel -with appended dtb, so let's mimic linux to satisfy stock bootloader: +with appended dtb, so let's mimic linux to satisfy stock bootloader.
[..]
Quoted 44 lines
doc/board/qualcomm/sdm845.rst +44
-0+The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, based on +the Qualcomm SDM845 SoC. + +Steps: + +- Build u-boot:: + + $ export CROSS_COMPILE=<aarch64 toolchain prefix> + $ make dragonboard845c_defconfig + $ make + +- Create dummy dtb:: + + workdir=/tmp/prepare_payload + mkdir -p "$workdir" + mock_dtb="$workdir"/payload_mock.dtb + + dtc -I dts -O dtb -o "$mock_dtb" << EOF + /dts-v1/; + / { + #address-cells = <2>; + #size-cells = <2>; + + memory@80000000 { + device_type = "memory"; + /* We expect the bootloader to fill in the size */ + reg = <0 0x80000000 0 0>; + }; + + chosen { }; + }; + EOF + +- gzip u-boot:: + + gzip u-boot.bin + +- Append dtb to gzipped u-boot:: + + cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb + +- A ``db845c.its`` file can be found in ``board/qualcomm/dragonboard845c/`` + directory. It expects a folder as ``db845c_imgs/`` in the main directory + containing pre-built kernel, dts and ramdisk images. See ``db845c.its``
doc/board/qualcomm/sdm845.rst Now we've got everything to build android boot image::: · line 152
Quoted 10 lines
doc/board/qualcomm/sdm845.rst +10
-0+ for full path to images:: + + mkimage -f db845c.its db845c.itb + +- Now we've got everything to build android boot image:: + + mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \ + --output boot.img --pagesize 4096 --base 0x80000000 + +- Flash boot.img using db845c fastboot method.
What command should be used here? I can run 'fastboot devices' but am not sure what command to use to flash U-Boot.
Also, is it possible to flash U-Boot as a first-stage bootloader?
Quoted 40 lines
doc/board/qualcomm/sdm845.rst +3
-0+ +More information can be found on the `DragonBoard 845c page`_. .. _Samsung S9 page: https://en.wikipedia.org/wiki/Samsung_Galaxy_S9 +.. _DragonBoard 845c page: https://www.96boards.org/product/rb3-platform/include/configs/dragonboard845c.h new file +28
-1@@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Configuration file for Dragonboard 845c, based on Qualcomm SDA845 chip +* +* (C) Copyright 2022 Sumit Garg <[email protected]> +*/ + +#ifndef __CONFIGS_SDM845_H +#define __CONFIGS_SDM845_H + +#include <linux/sizes.h> +#include <asm/arch/sysmap-sdm845.h> + +#define CONFIG_SYS_BAUDRATE_TABLE { 115200, 230400, 460800, 921600 } + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "bootm_size=0x5000000\0" \ + "bootm_low=0x80000000\0" \ + "bootcmd=bootm $prevbl_initrd_start_addr\0" + +/* Size of malloc() pool */ +#define CONFIG_SYS_BOOTM_LEN SZ_64M + +/* Monitor Command Prompt */ +#define CONFIG_SYS_CBSIZE 512 +#define CONFIG_SYS_MAXARGS 64 + +#endif --
Quoted 2 lines
2.25.1
Regards,
Simon
Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c
Hi Simon,
Quoted 107 lines · Simon Glass
Hi Sumit,
Quoted 38 lines · Sumit Garg
Add support for 96Boards Dragonboard 845C aka Robotics RB3 development platform. This board complies with 96Boards Open Platform Specifications.
Features:
- Qualcomm Snapdragon SDA845 SoC
- 4GiB RAM
- 64GiB UFS driveU-boot is chain loaded by ABL in 64-bit mode as part of boot.img. For detailed build and boot instructions, refer to
doc/board/qualcomm/sdm845.rst, board: dragonboard845c.Signed-off-by Sumit Garg <[email protected]>Reviewed-by Ramon Fried <[email protected]>--- arch/arm/dts/dragonboard845c-uboot.dtsi | 37 +++++++ arch/arm/dts/dragonboard845c.dts | 44 ++++++++ arch/arm/mach-snapdragon/Kconfig | 14 +++ board/qualcomm/dragonboard845c/Kconfig | 12 +++ board/qualcomm/dragonboard845c/MAINTAINERS | 6 ++ board/qualcomm/dragonboard845c/Makefile | 9 ++ board/qualcomm/dragonboard845c/db845c.its | 63 +++++++++++ .../dragonboard845c/dragonboard845c.c | 9 ++ configs/dragonboard845c_defconfig | 28 +++++ doc/board/qualcomm/sdm845.rst | 100 +++++++++++++++--- include/configs/dragonboard845c.h | 28 +++++ 11 files changed, 337 insertions(+), 13 deletions(-) create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi create mode 100644 arch/arm/dts/dragonboard845c.dts create mode 100644 board/qualcomm/dragonboard845c/Kconfig create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS create mode 100644 board/qualcomm/dragonboard845c/Makefile create mode 100644 board/qualcomm/dragonboard845c/db845c.its create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c create mode 100644 configs/dragonboard845c_defconfig create mode 100644 include/configs/dragonboard845c.h[..]
Quoted 11 lines
doc/board/qualcomm/sdm845.rst +1
-1@@ -35,9 +35,25 @@ Pack android boot image ^^^^^^^^^^^^^^^^^^^^^^^ We'll assemble android boot image with ``u-boot.bin`` instead of linux kernel, and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel -with appended dtb, so let's mimic linux to satisfy stock bootloader: +with appended dtb, so let's mimic linux to satisfy stock bootloader.[..]
Quoted 49 lines
doc/board/qualcomm/sdm845.rst +49
-0+The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, based on +the Qualcomm SDM845 SoC. + +Steps: + +- Build u-boot:: + + $ export CROSS_COMPILE=<aarch64 toolchain prefix> + $ make dragonboard845c_defconfig + $ make + +- Create dummy dtb:: + + workdir=/tmp/prepare_payload + mkdir -p "$workdir" + mock_dtb="$workdir"/payload_mock.dtb + + dtc -I dts -O dtb -o "$mock_dtb" << EOF + /dts-v1/; + / { + #address-cells = <2>; + #size-cells = <2>; + + memory@80000000 { + device_type = "memory"; + /* We expect the bootloader to fill in the size */ + reg = <0 0x80000000 0 0>; + }; + + chosen { }; + }; + EOF + +- gzip u-boot:: + + gzip u-boot.bin + +- Append dtb to gzipped u-boot:: + + cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb + +- A ``db845c.its`` file can be found in ``board/qualcomm/dragonboard845c/`` + directory. It expects a folder as ``db845c_imgs/`` in the main directory + containing pre-built kernel, dts and ramdisk images. See ``db845c.its`` + for full path to images:: + + mkimage -f db845c.its db845c.itb + +- Now we've got everything to build android boot image::
Quoted 9 lines
doc/board/qualcomm/sdm845.rst Now we've got everything to build android boot image::: · line 152
Quoted 5 lines
doc/board/qualcomm/sdm845.rst +5
-0+ + mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \ + --output boot.img --pagesize 4096 --base 0x80000000 + +- Flash boot.img using db845c fastboot method.What command should be used here? I can run 'fastboot devices' but am not sure what command to use to flash U-Boot.
At the time of writing this doc, I thought it was understood how to flash boot.img on db845c. But I will make that more explicit. Since u-boot has to be chain loaded by ABL, the command to flash boot.img (containing u-boot) is as follows:
sudo fastboot flash boot boot.img
Quoted 2 lines
Also, is it possible to flash U-Boot as a first-stage bootloader?
That's not possible currently due to Qcom proprietary bootloader being used. But there were plans to replace atleast ABL with u-boot (See slide 9 from this Linaro connect Qcom keynote [1]). I hope that will materialize soon.
[1] https://resources.linaro.org/en/resource/necH5bQcfrhCCkjSGHXJyA
-Sumit
Quoted 45 lines
Quoted 40 lines
doc/board/qualcomm/sdm845.rst +3
-0+ +More information can be found on the `DragonBoard 845c page`_. .. _Samsung S9 page: https://en.wikipedia.org/wiki/Samsung_Galaxy_S9 +.. _DragonBoard 845c page: https://www.96boards.org/product/rb3-platform/include/configs/dragonboard845c.h new file +28
-1@@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Configuration file for Dragonboard 845c, based on Qualcomm SDA845 chip +* +* (C) Copyright 2022 Sumit Garg <[email protected]> +*/ + +#ifndef __CONFIGS_SDM845_H +#define __CONFIGS_SDM845_H + +#include <linux/sizes.h> +#include <asm/arch/sysmap-sdm845.h> + +#define CONFIG_SYS_BAUDRATE_TABLE { 115200, 230400, 460800, 921600 } + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "bootm_size=0x5000000\0" \ + "bootm_low=0x80000000\0" \ + "bootcmd=bootm $prevbl_initrd_start_addr\0" + +/* Size of malloc() pool */ +#define CONFIG_SYS_BOOTM_LEN SZ_64M + +/* Monitor Command Prompt */ +#define CONFIG_SYS_CBSIZE 512 +#define CONFIG_SYS_MAXARGS 64 + +#endif --Quoted 2 lines
2.25.1
Regards,
Simon
Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c
Hi Sumit,
Quoted 131 lines · Sumit Garg
Hi Simon,
Quoted 107 lines · Simon Glass
Hi Sumit,
Quoted 38 lines · Sumit Garg
Add support for 96Boards Dragonboard 845C aka Robotics RB3 development platform. This board complies with 96Boards Open Platform Specifications.
Features:
- Qualcomm Snapdragon SDA845 SoC
- 4GiB RAM
- 64GiB UFS driveU-boot is chain loaded by ABL in 64-bit mode as part of boot.img. For detailed build and boot instructions, refer to
doc/board/qualcomm/sdm845.rst, board: dragonboard845c.Signed-off-by Sumit Garg <[email protected]>Reviewed-by Ramon Fried <[email protected]>--- arch/arm/dts/dragonboard845c-uboot.dtsi | 37 +++++++ arch/arm/dts/dragonboard845c.dts | 44 ++++++++ arch/arm/mach-snapdragon/Kconfig | 14 +++ board/qualcomm/dragonboard845c/Kconfig | 12 +++ board/qualcomm/dragonboard845c/MAINTAINERS | 6 ++ board/qualcomm/dragonboard845c/Makefile | 9 ++ board/qualcomm/dragonboard845c/db845c.its | 63 +++++++++++ .../dragonboard845c/dragonboard845c.c | 9 ++ configs/dragonboard845c_defconfig | 28 +++++ doc/board/qualcomm/sdm845.rst | 100 +++++++++++++++--- include/configs/dragonboard845c.h | 28 +++++ 11 files changed, 337 insertions(+), 13 deletions(-) create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi create mode 100644 arch/arm/dts/dragonboard845c.dts create mode 100644 board/qualcomm/dragonboard845c/Kconfig create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS create mode 100644 board/qualcomm/dragonboard845c/Makefile create mode 100644 board/qualcomm/dragonboard845c/db845c.its create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c create mode 100644 configs/dragonboard845c_defconfig create mode 100644 include/configs/dragonboard845c.h[..]
Quoted 11 lines
doc/board/qualcomm/sdm845.rst +1
-1@@ -35,9 +35,25 @@ Pack android boot image ^^^^^^^^^^^^^^^^^^^^^^^ We'll assemble android boot image with ``u-boot.bin`` instead of linux kernel, and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel -with appended dtb, so let's mimic linux to satisfy stock bootloader: +with appended dtb, so let's mimic linux to satisfy stock bootloader.[..]
Quoted 49 lines
doc/board/qualcomm/sdm845.rst +49
-0+The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, based on +the Qualcomm SDM845 SoC. + +Steps: + +- Build u-boot:: + + $ export CROSS_COMPILE=<aarch64 toolchain prefix> + $ make dragonboard845c_defconfig + $ make + +- Create dummy dtb:: + + workdir=/tmp/prepare_payload + mkdir -p "$workdir" + mock_dtb="$workdir"/payload_mock.dtb + + dtc -I dts -O dtb -o "$mock_dtb" << EOF + /dts-v1/; + / { + #address-cells = <2>; + #size-cells = <2>; + + memory@80000000 { + device_type = "memory"; + /* We expect the bootloader to fill in the size */ + reg = <0 0x80000000 0 0>; + }; + + chosen { }; + }; + EOF + +- gzip u-boot:: + + gzip u-boot.bin + +- Append dtb to gzipped u-boot:: + + cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb + +- A ``db845c.its`` file can be found in ``board/qualcomm/dragonboard845c/`` + directory. It expects a folder as ``db845c_imgs/`` in the main directory + containing pre-built kernel, dts and ramdisk images. See ``db845c.its`` + for full path to images:: + + mkimage -f db845c.its db845c.itb + +- Now we've got everything to build android boot image::Quoted 9 lines
doc/board/qualcomm/sdm845.rst Now we've got everything to build android boot image::: · line 152
Quoted 5 lines
doc/board/qualcomm/sdm845.rst +5
-0+ + mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \ + --output boot.img --pagesize 4096 --base 0x80000000 + +- Flash boot.img using db845c fastboot method.What command should be used here? I can run 'fastboot devices' but am not sure what command to use to flash U-Boot.
At the time of writing this doc, I thought it was understood how to flash boot.img on db845c. But I will make that more explicit. Since u-boot has to be chain loaded by ABL, the command to flash boot.img (containing u-boot) is as follows:
sudo fastboot flash boot boot.img
Quoted 2 lines
Also, is it possible to flash U-Boot as a first-stage bootloader?
Quoted 7 lines
That's not possible currently due to Qcom proprietary bootloader being used. But there were plans to replace atleast ABL with u-boot (See slide 9 from this Linaro connect Qcom keynote [1]). I hope that will materialize soon.
[1] https://resources.linaro.org/en/resource/necH5bQcfrhCCkjSGHXJyA
Thank you for the link. I am pleased to hear it and hope it plays out as that slide seems to indicate.
I would like to suggest that 96 boards should use open-source firmware when they launch. Once they launch there is little incentive to clean things up.
Regards,
Simon
Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c
Quoted 143 lines · Simon Glass
Hi Sumit,
Quoted 131 lines · Sumit Garg
Hi Simon,
Quoted 107 lines · Simon Glass
Hi Sumit,
Quoted 38 lines · Sumit Garg
Add support for 96Boards Dragonboard 845C aka Robotics RB3 development platform. This board complies with 96Boards Open Platform Specifications.
Features:
- Qualcomm Snapdragon SDA845 SoC
- 4GiB RAM
- 64GiB UFS driveU-boot is chain loaded by ABL in 64-bit mode as part of boot.img. For detailed build and boot instructions, refer to
doc/board/qualcomm/sdm845.rst, board: dragonboard845c.Signed-off-by Sumit Garg <[email protected]>Reviewed-by Ramon Fried <[email protected]>--- arch/arm/dts/dragonboard845c-uboot.dtsi | 37 +++++++ arch/arm/dts/dragonboard845c.dts | 44 ++++++++ arch/arm/mach-snapdragon/Kconfig | 14 +++ board/qualcomm/dragonboard845c/Kconfig | 12 +++ board/qualcomm/dragonboard845c/MAINTAINERS | 6 ++ board/qualcomm/dragonboard845c/Makefile | 9 ++ board/qualcomm/dragonboard845c/db845c.its | 63 +++++++++++ .../dragonboard845c/dragonboard845c.c | 9 ++ configs/dragonboard845c_defconfig | 28 +++++ doc/board/qualcomm/sdm845.rst | 100 +++++++++++++++--- include/configs/dragonboard845c.h | 28 +++++ 11 files changed, 337 insertions(+), 13 deletions(-) create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi create mode 100644 arch/arm/dts/dragonboard845c.dts create mode 100644 board/qualcomm/dragonboard845c/Kconfig create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS create mode 100644 board/qualcomm/dragonboard845c/Makefile create mode 100644 board/qualcomm/dragonboard845c/db845c.its create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c create mode 100644 configs/dragonboard845c_defconfig create mode 100644 include/configs/dragonboard845c.h[..]
Quoted 11 lines
doc/board/qualcomm/sdm845.rst +1
-1@@ -35,9 +35,25 @@ Pack android boot image ^^^^^^^^^^^^^^^^^^^^^^^ We'll assemble android boot image with ``u-boot.bin`` instead of linux kernel, and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel -with appended dtb, so let's mimic linux to satisfy stock bootloader: +with appended dtb, so let's mimic linux to satisfy stock bootloader.[..]
Quoted 49 lines
doc/board/qualcomm/sdm845.rst +49
-0+The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, based on +the Qualcomm SDM845 SoC. + +Steps: + +- Build u-boot:: + + $ export CROSS_COMPILE=<aarch64 toolchain prefix> + $ make dragonboard845c_defconfig + $ make + +- Create dummy dtb:: + + workdir=/tmp/prepare_payload + mkdir -p "$workdir" + mock_dtb="$workdir"/payload_mock.dtb + + dtc -I dts -O dtb -o "$mock_dtb" << EOF + /dts-v1/; + / { + #address-cells = <2>; + #size-cells = <2>; + + memory@80000000 { + device_type = "memory"; + /* We expect the bootloader to fill in the size */ + reg = <0 0x80000000 0 0>; + }; + + chosen { }; + }; + EOF + +- gzip u-boot:: + + gzip u-boot.bin + +- Append dtb to gzipped u-boot:: + + cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb + +- A ``db845c.its`` file can be found in ``board/qualcomm/dragonboard845c/`` + directory. It expects a folder as ``db845c_imgs/`` in the main directory + containing pre-built kernel, dts and ramdisk images. See ``db845c.its`` + for full path to images:: + + mkimage -f db845c.its db845c.itb + +- Now we've got everything to build android boot image::Quoted 9 lines
doc/board/qualcomm/sdm845.rst Now we've got everything to build android boot image::: · line 152
Quoted 5 lines
doc/board/qualcomm/sdm845.rst +5
-0+ + mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \ + --output boot.img --pagesize 4096 --base 0x80000000 + +- Flash boot.img using db845c fastboot method.What command should be used here? I can run 'fastboot devices' but am not sure what command to use to flash U-Boot.
At the time of writing this doc, I thought it was understood how to flash boot.img on db845c. But I will make that more explicit. Since u-boot has to be chain loaded by ABL, the command to flash boot.img (containing u-boot) is as follows:
sudo fastboot flash boot boot.img
Quoted 2 lines
Also, is it possible to flash U-Boot as a first-stage bootloader?
Quoted 7 lines
That's not possible currently due to Qcom proprietary bootloader being used. But there were plans to replace atleast ABL with u-boot (See slide 9 from this Linaro connect Qcom keynote [1]). I hope that will materialize soon.
[1] https://resources.linaro.org/en/resource/necH5bQcfrhCCkjSGHXJyA
Quoted 6 lines
Thank you for the link. I am pleased to hear it and hope it plays out as that slide seems to indicate.
I would like to suggest that 96 boards should use open-source firmware when they launch. Once they launch there is little incentive to clean things up.
It's something that has been suggested from the outset but the fact is there is no way to enforce it.
Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c
Hi Peter,
Quoted 148 lines · Peter Robinson
Quoted 146 lines · Simon Glass
Hi Sumit,
Quoted 131 lines · Sumit Garg
Hi Simon,
Quoted 107 lines · Simon Glass
Hi Sumit,
Quoted 38 lines · Sumit Garg
Add support for 96Boards Dragonboard 845C aka Robotics RB3 development platform. This board complies with 96Boards Open Platform Specifications.
Features:
- Qualcomm Snapdragon SDA845 SoC
- 4GiB RAM
- 64GiB UFS driveU-boot is chain loaded by ABL in 64-bit mode as part of boot.img. For detailed build and boot instructions, refer to
doc/board/qualcomm/sdm845.rst, board: dragonboard845c.Signed-off-by Sumit Garg <[email protected]>Reviewed-by Ramon Fried <[email protected]>--- arch/arm/dts/dragonboard845c-uboot.dtsi | 37 +++++++ arch/arm/dts/dragonboard845c.dts | 44 ++++++++ arch/arm/mach-snapdragon/Kconfig | 14 +++ board/qualcomm/dragonboard845c/Kconfig | 12 +++ board/qualcomm/dragonboard845c/MAINTAINERS | 6 ++ board/qualcomm/dragonboard845c/Makefile | 9 ++ board/qualcomm/dragonboard845c/db845c.its | 63 +++++++++++ .../dragonboard845c/dragonboard845c.c | 9 ++ configs/dragonboard845c_defconfig | 28 +++++ doc/board/qualcomm/sdm845.rst | 100 +++++++++++++++--- include/configs/dragonboard845c.h | 28 +++++ 11 files changed, 337 insertions(+), 13 deletions(-) create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi create mode 100644 arch/arm/dts/dragonboard845c.dts create mode 100644 board/qualcomm/dragonboard845c/Kconfig create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS create mode 100644 board/qualcomm/dragonboard845c/Makefile create mode 100644 board/qualcomm/dragonboard845c/db845c.its create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c create mode 100644 configs/dragonboard845c_defconfig create mode 100644 include/configs/dragonboard845c.h[..]
Quoted 11 lines
doc/board/qualcomm/sdm845.rst +1
-1@@ -35,9 +35,25 @@ Pack android boot image ^^^^^^^^^^^^^^^^^^^^^^^ We'll assemble android boot image with ``u-boot.bin`` instead of linux kernel, and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel -with appended dtb, so let's mimic linux to satisfy stock bootloader: +with appended dtb, so let's mimic linux to satisfy stock bootloader.[..]
Quoted 49 lines
doc/board/qualcomm/sdm845.rst +49
-0+The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, based on +the Qualcomm SDM845 SoC. + +Steps: + +- Build u-boot:: + + $ export CROSS_COMPILE=<aarch64 toolchain prefix> + $ make dragonboard845c_defconfig + $ make + +- Create dummy dtb:: + + workdir=/tmp/prepare_payload + mkdir -p "$workdir" + mock_dtb="$workdir"/payload_mock.dtb + + dtc -I dts -O dtb -o "$mock_dtb" << EOF + /dts-v1/; + / { + #address-cells = <2>; + #size-cells = <2>; + + memory@80000000 { + device_type = "memory"; + /* We expect the bootloader to fill in the size */ + reg = <0 0x80000000 0 0>; + }; + + chosen { }; + }; + EOF + +- gzip u-boot:: + + gzip u-boot.bin + +- Append dtb to gzipped u-boot:: + + cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb + +- A ``db845c.its`` file can be found in ``board/qualcomm/dragonboard845c/`` + directory. It expects a folder as ``db845c_imgs/`` in the main directory + containing pre-built kernel, dts and ramdisk images. See ``db845c.its`` + for full path to images:: + + mkimage -f db845c.its db845c.itb + +- Now we've got everything to build android boot image::Quoted 9 lines
doc/board/qualcomm/sdm845.rst Now we've got everything to build android boot image::: · line 152
Quoted 5 lines
doc/board/qualcomm/sdm845.rst +5
-0+ + mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \ + --output boot.img --pagesize 4096 --base 0x80000000 + +- Flash boot.img using db845c fastboot method.What command should be used here? I can run 'fastboot devices' but am not sure what command to use to flash U-Boot.
At the time of writing this doc, I thought it was understood how to flash boot.img on db845c. But I will make that more explicit. Since u-boot has to be chain loaded by ABL, the command to flash boot.img (containing u-boot) is as follows:
sudo fastboot flash boot boot.img
Quoted 2 lines
Also, is it possible to flash U-Boot as a first-stage bootloader?
Quoted 7 lines
That's not possible currently due to Qcom proprietary bootloader being used. But there were plans to replace atleast ABL with u-boot (See slide 9 from this Linaro connect Qcom keynote [1]). I hope that will materialize soon.
[1] https://resources.linaro.org/en/resource/necH5bQcfrhCCkjSGHXJyA
Thank you for the link. I am pleased to hear it and hope it plays out as that slide seems to indicate.
Quoted 6 lines
Quoted 3 lines
I would like to suggest that 96 boards should use open-source firmware when they launch. Once they launch there is little incentive to clean things up.
It's something that has been suggested from the outset but the fact is there is no way to enforce it.
Er, the board is listed on Linaros web site and has presumably been blessed by Linaro. So don't bless it until the patches are send and/or landed?
Regards,
Simon
Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c
Hi Simon,
Quoted 156 lines · Simon Glass
Hi Peter,
Quoted 152 lines · Peter Robinson
Quoted 149 lines · Simon Glass
Hi Sumit,
Quoted 131 lines · Sumit Garg
Hi Simon,
Quoted 107 lines · Simon Glass
Hi Sumit,
Quoted 38 lines · Sumit Garg
Add support for 96Boards Dragonboard 845C aka Robotics RB3 development platform. This board complies with 96Boards Open Platform Specifications.
Features:
- Qualcomm Snapdragon SDA845 SoC
- 4GiB RAM
- 64GiB UFS driveU-boot is chain loaded by ABL in 64-bit mode as part of boot.img. For detailed build and boot instructions, refer to
doc/board/qualcomm/sdm845.rst, board: dragonboard845c.Signed-off-by Sumit Garg <[email protected]>Reviewed-by Ramon Fried <[email protected]>--- arch/arm/dts/dragonboard845c-uboot.dtsi | 37 +++++++ arch/arm/dts/dragonboard845c.dts | 44 ++++++++ arch/arm/mach-snapdragon/Kconfig | 14 +++ board/qualcomm/dragonboard845c/Kconfig | 12 +++ board/qualcomm/dragonboard845c/MAINTAINERS | 6 ++ board/qualcomm/dragonboard845c/Makefile | 9 ++ board/qualcomm/dragonboard845c/db845c.its | 63 +++++++++++ .../dragonboard845c/dragonboard845c.c | 9 ++ configs/dragonboard845c_defconfig | 28 +++++ doc/board/qualcomm/sdm845.rst | 100 +++++++++++++++--- include/configs/dragonboard845c.h | 28 +++++ 11 files changed, 337 insertions(+), 13 deletions(-) create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi create mode 100644 arch/arm/dts/dragonboard845c.dts create mode 100644 board/qualcomm/dragonboard845c/Kconfig create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS create mode 100644 board/qualcomm/dragonboard845c/Makefile create mode 100644 board/qualcomm/dragonboard845c/db845c.its create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c create mode 100644 configs/dragonboard845c_defconfig create mode 100644 include/configs/dragonboard845c.h[..]
Quoted 11 lines
doc/board/qualcomm/sdm845.rst +1
-1@@ -35,9 +35,25 @@ Pack android boot image ^^^^^^^^^^^^^^^^^^^^^^^ We'll assemble android boot image with ``u-boot.bin`` instead of linux kernel, and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel -with appended dtb, so let's mimic linux to satisfy stock bootloader: +with appended dtb, so let's mimic linux to satisfy stock bootloader.[..]
Quoted 49 lines
doc/board/qualcomm/sdm845.rst +49
-0+The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, based on +the Qualcomm SDM845 SoC. + +Steps: + +- Build u-boot:: + + $ export CROSS_COMPILE=<aarch64 toolchain prefix> + $ make dragonboard845c_defconfig + $ make + +- Create dummy dtb:: + + workdir=/tmp/prepare_payload + mkdir -p "$workdir" + mock_dtb="$workdir"/payload_mock.dtb + + dtc -I dts -O dtb -o "$mock_dtb" << EOF + /dts-v1/; + / { + #address-cells = <2>; + #size-cells = <2>; + + memory@80000000 { + device_type = "memory"; + /* We expect the bootloader to fill in the size */ + reg = <0 0x80000000 0 0>; + }; + + chosen { }; + }; + EOF + +- gzip u-boot:: + + gzip u-boot.bin + +- Append dtb to gzipped u-boot:: + + cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb + +- A ``db845c.its`` file can be found in ``board/qualcomm/dragonboard845c/`` + directory. It expects a folder as ``db845c_imgs/`` in the main directory + containing pre-built kernel, dts and ramdisk images. See ``db845c.its`` + for full path to images:: + + mkimage -f db845c.its db845c.itb + +- Now we've got everything to build android boot image::Quoted 9 lines
doc/board/qualcomm/sdm845.rst Now we've got everything to build android boot image::: · line 152
Quoted 5 lines
doc/board/qualcomm/sdm845.rst +5
-0+ + mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \ + --output boot.img --pagesize 4096 --base 0x80000000 + +- Flash boot.img using db845c fastboot method.What command should be used here? I can run 'fastboot devices' but am not sure what command to use to flash U-Boot.
At the time of writing this doc, I thought it was understood how to flash boot.img on db845c. But I will make that more explicit. Since u-boot has to be chain loaded by ABL, the command to flash boot.img (containing u-boot) is as follows:
sudo fastboot flash boot boot.img
Quoted 2 lines
Also, is it possible to flash U-Boot as a first-stage bootloader?
Quoted 7 lines
That's not possible currently due to Qcom proprietary bootloader being used. But there were plans to replace atleast ABL with u-boot (See slide 9 from this Linaro connect Qcom keynote [1]). I hope that will materialize soon.
[1] https://resources.linaro.org/en/resource/necH5bQcfrhCCkjSGHXJyA
Thank you for the link. I am pleased to hear it and hope it plays out as that slide seems to indicate.
I would like to suggest that 96 boards should use open-source firmware when they launch. Once they launch there is little incentive to clean things up.
Quoted 6 lines
Quoted 2 lines
It's something that has been suggested from the outset but the fact is there is no way to enforce it.
Er, the board is listed on Linaros web site and has presumably been blessed by Linaro. So don't bless it until the patches are send and/or landed?
I see the reasoning behind your thoughts but I would suggest you read through [1]. It should provide you with enough background thinking.
[1] https://www.96boards.org/compliance/
-Sumit
Quoted 3 lines
Regards,
Simon
Re: [PATCH v3 5/9] board: qualcomm: Add support for dragonboard845c
Hi Sumit,
Quoted 163 lines · Sumit Garg
Hi Simon,
Quoted 159 lines · Simon Glass
Hi Peter,
Quoted 154 lines · Peter Robinson
Quoted 143 lines · Simon Glass
Hi Sumit,
Quoted 131 lines · Sumit Garg
Hi Simon,
Quoted 107 lines · Simon Glass
Hi Sumit,
Quoted 38 lines · Sumit Garg
Add support for 96Boards Dragonboard 845C aka Robotics RB3 development platform. This board complies with 96Boards Open Platform Specifications.
Features:
- Qualcomm Snapdragon SDA845 SoC
- 4GiB RAM
- 64GiB UFS driveU-boot is chain loaded by ABL in 64-bit mode as part of boot.img. For detailed build and boot instructions, refer to
doc/board/qualcomm/sdm845.rst, board: dragonboard845c.Signed-off-by Sumit Garg <[email protected]>Reviewed-by Ramon Fried <[email protected]>--- arch/arm/dts/dragonboard845c-uboot.dtsi | 37 +++++++ arch/arm/dts/dragonboard845c.dts | 44 ++++++++ arch/arm/mach-snapdragon/Kconfig | 14 +++ board/qualcomm/dragonboard845c/Kconfig | 12 +++ board/qualcomm/dragonboard845c/MAINTAINERS | 6 ++ board/qualcomm/dragonboard845c/Makefile | 9 ++ board/qualcomm/dragonboard845c/db845c.its | 63 +++++++++++ .../dragonboard845c/dragonboard845c.c | 9 ++ configs/dragonboard845c_defconfig | 28 +++++ doc/board/qualcomm/sdm845.rst | 100 +++++++++++++++--- include/configs/dragonboard845c.h | 28 +++++ 11 files changed, 337 insertions(+), 13 deletions(-) create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi create mode 100644 arch/arm/dts/dragonboard845c.dts create mode 100644 board/qualcomm/dragonboard845c/Kconfig create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS create mode 100644 board/qualcomm/dragonboard845c/Makefile create mode 100644 board/qualcomm/dragonboard845c/db845c.its create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c create mode 100644 configs/dragonboard845c_defconfig create mode 100644 include/configs/dragonboard845c.h[..]
Quoted 11 lines
doc/board/qualcomm/sdm845.rst +1
-1@@ -35,9 +35,25 @@ Pack android boot image ^^^^^^^^^^^^^^^^^^^^^^^ We'll assemble android boot image with ``u-boot.bin`` instead of linux kernel, and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel -with appended dtb, so let's mimic linux to satisfy stock bootloader: +with appended dtb, so let's mimic linux to satisfy stock bootloader.[..]
Quoted 49 lines
doc/board/qualcomm/sdm845.rst +49
-0+The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, based on +the Qualcomm SDM845 SoC. + +Steps: + +- Build u-boot:: + + $ export CROSS_COMPILE=<aarch64 toolchain prefix> + $ make dragonboard845c_defconfig + $ make + +- Create dummy dtb:: + + workdir=/tmp/prepare_payload + mkdir -p "$workdir" + mock_dtb="$workdir"/payload_mock.dtb + + dtc -I dts -O dtb -o "$mock_dtb" << EOF + /dts-v1/; + / { + #address-cells = <2>; + #size-cells = <2>; + + memory@80000000 { + device_type = "memory"; + /* We expect the bootloader to fill in the size */ + reg = <0 0x80000000 0 0>; + }; + + chosen { }; + }; + EOF + +- gzip u-boot:: + + gzip u-boot.bin + +- Append dtb to gzipped u-boot:: + + cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb + +- A ``db845c.its`` file can be found in ``board/qualcomm/dragonboard845c/`` + directory. It expects a folder as ``db845c_imgs/`` in the main directory + containing pre-built kernel, dts and ramdisk images. See ``db845c.its`` + for full path to images:: + + mkimage -f db845c.its db845c.itb + +- Now we've got everything to build android boot image::Quoted 9 lines
doc/board/qualcomm/sdm845.rst
Quoted 5 lines
doc/board/qualcomm/sdm845.rst +5
-0+ + mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \ + --output boot.img --pagesize 4096 --base 0x80000000 + +- Flash boot.img using db845c fastboot method.What command should be used here? I can run 'fastboot devices' but am not sure what command to use to flash U-Boot.
At the time of writing this doc, I thought it was understood how to flash boot.img on db845c. But I will make that more explicit. Since u-boot has to be chain loaded by ABL, the command to flash boot.img (containing u-boot) is as follows:
sudo fastboot flash boot boot.img
Quoted 2 lines
Also, is it possible to flash U-Boot as a first-stage bootloader?
Quoted 7 lines
That's not possible currently due to Qcom proprietary bootloader being used. But there were plans to replace atleast ABL with u-boot (See slide 9 from this Linaro connect Qcom keynote [1]). I hope that will materialize soon.
[1] https://resources.linaro.org/en/resource/necH5bQcfrhCCkjSGHXJyA
Quoted 6 lines
Thank you for the link. I am pleased to hear it and hope it plays out as that slide seems to indicate.
I would like to suggest that 96 boards should use open-source firmware when they launch. Once they launch there is little incentive to clean things up.
It's something that has been suggested from the outset but the fact is there is no way to enforce it.
Quoted 8 lines
Quoted 3 lines
Er, the board is listed on Linaros web site and has presumably been blessed by Linaro. So don't bless it until the patches are send and/or landed?
I see the reasoning behind your thoughts but I would suggest you read through [1]. It should provide you with enough background thinking.
"It is recommended that all documentation required under the 96Boards program for the board and SoC be freely available from the 96Boards website. Any documentation that cannot be provided from the 96Boards website shall be available from a vendor or other public website that can be linked to from the 96Boards website."
So are the SoC docs available for this board?
"It is strongly recommended one open source bootloader to be provided for the board that executes immediately after the internal SoC startup code. The source for this bootloader should be available from a publicly accessible site or integrated into the bootloader trees onhttps://github.com/96boards"
My reading of this is that an open source bootloader is optional. Would it not make sense to make it mandatory?
"It is strongly recommended that vendors of an ARMv8 board provide a port of the ARM Trusted Firmware (ATF) and PSCI reference implementations, and a port of the Tianocore EDK2 UEFI reference implementation."
Why suggest a UEFI port? Wouldn't suggesting U-Boot be a lot more useful in terms of building the open source community?
Regards,
Simon
PATCH v3 6/9 mmc: msm_sdhci: Add SDCC version 5.0.0 support
In reply to Sumit GargFor SDCC version 5.0.0, MCI registers are removed from SDCC interface and some registers are moved to HC. So add support to use the new compatible string "qcom,sdhci-msm-v5". Based on this new msm variant, pick the relevant variant data and use it to detect MCI presence thereby configuring register read/write to msm specific registers.
--- drivers/mmc/msm_sdhci.c | 96 +++++++++++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 32 deletions(-)
drivers/mmc/msm_sdhci.c +64 -32
@@ -22,18 +22,17 @@#define SDCC_MCI_POWER_SW_RST BIT(7)/* This is undocumented register */ -#define SDCC_MCI_VERSION 0x50 -#define SDCC_MCI_VERSION_MAJOR_SHIFT 28 -#define SDCC_MCI_VERSION_MAJOR_MASK (0xf << SDCC_MCI_VERSION_MAJOR_SHIFT) -#define SDCC_MCI_VERSION_MINOR_MASK 0xff +#define SDCC_MCI_VERSION 0x50 +#define SDCC_V5_VERSION 0x318 + +#define SDCC_VERSION_MAJOR_SHIFT 28 +#define SDCC_VERSION_MAJOR_MASK (0xf << SDCC_VERSION_MAJOR_SHIFT) +#define SDCC_VERSION_MINOR_MASK 0xff#define SDCC_MCI_STATUS2 0x6C#define SDCC_MCI_STATUS2_MCI_ACT 0x1#define SDCC_MCI_HC_MODE 0x78 -/* Offset to SDHCI registers */ -#define SDCC_SDHCI_OFFSET 0x900 -/* Non standard (?) SDHCI register */ #define SDHCI_VENDOR_SPEC_CAPABILITIES0 0x11c
@@ -47,6 +46,10 @@ struct msm_sdhc {void *base; }; +struct msm_sdhc_variant_info { +bool mci_removed; +}; +DECLARE_GLOBAL_DATA_PTR ;static int msm_sdc_clk_init (struct udevice *dev)
@@ -85,25 +88,8 @@ static int msm_sdc_clk_init(struct udevice *dev)return 0 ; } -static int msm_sdc_probe (struct udevice *dev) +static int msm_sdc_mci_init (struct msm_sdhc *prv) { -struct mmc_uclass_priv *upriv =dev_get_uclass_priv (dev); -struct msm_sdhc_plat *plat =dev_get_plat (dev); -struct msm_sdhc *prv =dev_get_priv (dev); -struct sdhci_host *host = &prv->host; -u32 core_version, core_minor, core_major; -u32 caps; -int ret; - - host->quirks =SDHCI_QUIRK_WAIT_SEND_CMD |SDHCI_QUIRK_BROKEN_R1B ; - - host->max_clk =0 ; - -/* Init clocks */ - ret =msm_sdc_clk_init (dev); -if (ret) -return ret; -/* Reset the core and Enable SDHC mode */ writel (readl (prv->base +SDCC_MCI_POWER ) |SDCC_MCI_POWER_SW_RST , prv->base +SDCC_MCI_POWER );
@@ -126,12 +112,45 @@ static int msm_sdc_probe(struct udevice *dev)/* Enable host-controller mode */ writel (1 , prv->base +SDCC_MCI_HC_MODE ); - core_version =readl (prv->base +SDCC_MCI_VERSION ); +return 0 ; +} - core_major = (core_version &SDCC_MCI_VERSION_MAJOR_MASK ); - core_major >>=SDCC_MCI_VERSION_MAJOR_SHIFT ; +static int msm_sdc_probe (struct udevice *dev) +{ +struct mmc_uclass_priv *upriv =dev_get_uclass_priv (dev); +struct msm_sdhc_plat *plat =dev_get_plat (dev); +struct msm_sdhc *prv =dev_get_priv (dev); +const struct msm_sdhc_variant_info *var_info; +struct sdhci_host *host = &prv->host; +u32 core_version, core_minor, core_major; +u32 caps; +int ret; - core_minor = core_version &SDCC_MCI_VERSION_MINOR_MASK ; + host->quirks =SDHCI_QUIRK_WAIT_SEND_CMD |SDHCI_QUIRK_BROKEN_R1B ; + + host->max_clk =0 ; + +/* Init clocks */ + ret =msm_sdc_clk_init (dev); +if (ret) +return ret; + + var_info = (void *)dev_get_driver_data (dev); +if (!var_info->mci_removed) { + ret =msm_sdc_mci_init (prv); +if (ret) +return ret; + } + +if (!var_info->mci_removed) + core_version =readl (prv->base +SDCC_MCI_VERSION ); +else + core_version =readl (host->ioaddr +SDCC_V5_VERSION ); + + core_major = (core_version &SDCC_VERSION_MAJOR_MASK ); + core_major >>=SDCC_VERSION_MAJOR_SHIFT ; + + core_minor = core_version &SDCC_VERSION_MINOR_MASK ;/* * Support for some capabilities is not advertised by newer
@@ -161,9 +180,13 @@ static int msm_sdc_probe(struct udevice *dev)static int msm_sdc_remove (struct udevice *dev) {struct msm_sdhc *priv =dev_get_priv (dev); +const struct msm_sdhc_variant_info *var_info; + + var_info = (void *)dev_get_driver_data (dev); -/* Disable host-controller mode */ -writel (0 , priv->base +SDCC_MCI_HC_MODE ); +/* Disable host-controller mode */ +if (!var_info->mci_removed) +writel (0 , priv->base +SDCC_MCI_HC_MODE );return 0 ; }
@@ -195,8 +218,17 @@ static int msm_sdc_bind(struct udevice *dev)return sdhci_bind (dev, &plat->mmc, &plat->cfg); } +static const struct msm_sdhc_variant_info msm_sdhc_mci_var = { + .mci_removed = false, +}; + +static const struct msm_sdhc_variant_info msm_sdhc_v5_var = { + .mci_removed = true, +}; +static const struct udevice_id msm_mmc_ids[] = { - { .compatible ="qcom,sdhci-msm-v4" }, + { .compatible ="qcom,sdhci-msm-v4" , .data = (ulong)&msm_sdhc_mci_var }, + { .compatible ="qcom,sdhci-msm-v5" , .data = (ulong)&msm_sdhc_v5_var }, { } };
Signature · 1 line
2.25.1
Re: [PATCH v3 6/9] mmc: msm_sdhci: Add SDCC version 5.0.0 support
Quoted 8 lines · Sumit Garg
For SDCC version 5.0.0, MCI registers are removed from SDCC interface and some registers are moved to HC. So add support to use the new compatible string "qcom,sdhci-msm-v5". Based on this new msm variant, pick the relevant variant data and use it to detect MCI presence thereby configuring register read/write to msm specific registers.
Signed-off-by Sumit Garg <[email protected]>Reviewed-by Ramon Fried <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
PATCH v3 7/9 pinctrl: qcom: Add pinctrl driver for QCS404 SoC
In reply to Sumit GargCurrently this pinctrl driver only supports BLSP UART2 specific pin configuration.
--- arch/arm/mach-snapdragon/Makefile | 1 + arch/arm/mach-snapdragon/pinctrl-qcs404.c | 55 +++++++++++++++++++ arch/arm/mach-snapdragon/pinctrl-snapdragon.c | 1 + arch/arm/mach-snapdragon/pinctrl-snapdragon.h | 1 + 4 files changed, 58 insertions(+) create mode 100644 arch/arm/mach-snapdragon/pinctrl-qcs404.c
arch/arm/mach-snapdragon/Makefile +1 -0
@@ -15,4 +15,5 @@ obj-y += dram.o obj-y += pinctrl-snapdragon.o obj-y += pinctrl-apq8016.o obj-y += pinctrl-apq8096.o +obj-y += pinctrl-qcs404.o obj-$(CONFIG_SDM845) += pinctrl-sdm845.o
arch/arm/mach-snapdragon/pinctrl-qcs404.c new file +55 -0
55 lines not on this page · raw message
arch/arm/mach-snapdragon/pinctrl-snapdragon.c +1 -0
@@ -119,6 +119,7 @@ static const struct udevice_id msm_pinctrl_ids[] = {#ifdef CONFIG_SDM845 { .compatible = "qcom,tlmm-sdm845", .data = (ulong)&sdm845_data },#endif + { .compatible = "qcom,tlmm-qcs404", .data = (ulong)&qcs404_data }, { } };
arch/arm/mach-snapdragon/pinctrl-snapdragon.h +1 -0
@@ -28,5 +28,6 @@ struct pinctrl_function {extern struct msm_pinctrl_data apq8016_data;extern struct msm_pinctrl_data apq8096_data;extern struct msm_pinctrl_data sdm845_data; +extern struct msm_pinctrl_data qcs404_data;#endif
Signature · 1 line
2.25.1
Re: [PATCH v3 7/9] pinctrl: qcom: Add pinctrl driver for QCS404 SoC
Quoted 5 lines · Sumit Garg
Currently this pinctrl driver only supports BLSP UART2 specific pin configuration.
Signed-off-by Sumit Garg <[email protected]>Reviewed-by Ramon Fried <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
PATCH v3 8/9 clocks: qcom: Add clock driver for QCS404 SoC
In reply to Sumit GargCurrently this clock driver initializes clocks for UART and eMMC. Along with this import "qcom,gcc-qcs404.h" header from Linux mainline to support DT bindings.
--- arch/arm/mach-snapdragon/clock-qcs404.c | 79 ++++++++ arch/arm/mach-snapdragon/clock-snapdragon.c | 1 + .../include/mach/sysmap-qcs404.h | 40 ++++ include/dt-bindings/clock/qcom,gcc-qcs404.h | 180 ++++++++++++++++++ 4 files changed, 300 insertions(+) create mode 100644 arch/arm/mach-snapdragon/clock-qcs404.c create mode 100644 arch/arm/mach-snapdragon/include/mach/sysmap-qcs404.h create mode 100644 include/dt-bindings/clock/qcom,gcc-qcs404.h
arch/arm/mach-snapdragon/clock-qcs404.c new file +79 -0
@@ -0,0 +1,79 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* +* Clock drivers for Qualcomm QCS404 +* +* (C) Copyright 2022 Sumit Garg <[email protected]> +*/ + +#include <common.h> +#include <clk-uclass.h> +#include <dm.h> +#include <errno.h> +#include <asm/io.h> +#include <linux/bitops.h> +#include "clock-snapdragon.h" + +#include <dt-bindings/clock/qcom,gcc-qcs404.h> + +/* GPLL0 clock control registers */ +#define GPLL0_STATUS_ACTIVE BIT(31) + +static struct vote_clk gcc_blsp1_ahb_clk = { + .cbcr_reg =BLSP1_AHB_CBCR , + .ena_vote =APCS_CLOCK_BRANCH_ENA_VOTE , + .vote_bit =BIT (10 ) |BIT (5 ) |BIT (4 ), +}; + +static const struct bcr_regs uart2_regs = { + .cfg_rcgr =BLSP1_UART2_APPS_CFG_RCGR , + .cmd_rcgr =BLSP1_UART2_APPS_CMD_RCGR , + .M =BLSP1_UART2_APPS_M , + .N =BLSP1_UART2_APPS_N , + .D =BLSP1_UART2_APPS_D , +}; + +static const struct bcr_regs sdc_regs = { + .cfg_rcgr =SDCC_CFG_RCGR (1 ), + .cmd_rcgr =SDCC_CMD_RCGR (1 ), + .M =SDCC_M (1 ), + .N =SDCC_N (1 ), + .D =SDCC_D (1 ), +}; + +static struct pll_vote_clk gpll0_vote_clk = { + .status =GPLL0_STATUS , + .status_bit =GPLL0_STATUS_ACTIVE , + .ena_vote =APCS_GPLL_ENA_VOTE , + .vote_bit =BIT (0 ), +}; + +ulong msm_set_rate (struct clk *clk,ulong rate) +{ +struct msm_clk_priv *priv =dev_get_priv (clk->dev); + +switch (clk->id) { +case GCC_BLSP1_UART2_APPS_CLK : +/* UART: 115200 */ +clk_rcg_set_rate_mnd (priv->base, &uart2_regs,0 ,12 ,125 , +CFG_CLK_SRC_CXO ); +clk_enable_cbc (priv->base +BLSP1_UART2_APPS_CBCR ); +break ; +case GCC_BLSP1_AHB_CLK : +clk_enable_vote_clk (priv->base, &gcc_blsp1_ahb_clk); +break ; +case GCC_SDCC1_APPS_CLK : +/* SDCC1: 200MHz */ +clk_rcg_set_rate_mnd (priv->base, &sdc_regs,4 ,0 ,0 , +CFG_CLK_SRC_GPLL0 ); +clk_enable_gpll0 (priv->base, &gpll0_vote_clk); +clk_enable_cbc (priv->base +SDCC_APPS_CBCR (1 )); +break ; +case GCC_SDCC1_AHB_CLK : +clk_enable_cbc (priv->base +SDCC_AHB_CBCR (1 )); +break ; +default : +return 0 ; + } + +return 0 ; +}
arch/arm/mach-snapdragon/clock-snapdragon.c +1 -0
@@ -136,6 +136,7 @@ static const struct udevice_id msm_clk_ids[] = { { .compatible = "qcom,gcc-msm8996" }, { .compatible = "qcom,gcc-apq8096" }, { .compatible = "qcom,gcc-sdm845" }, + { .compatible = "qcom,gcc-qcs404" }, { } };
arch/arm/mach-snapdragon/include/mach/sysmap-qcs404.h new file +40 -0
@@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Qualcomm QCS404 sysmap +* +* (C) Copyright 2022 Sumit Garg <[email protected]> +*/ +#ifndef _MACH_SYSMAP_QCS404_H +#define _MACH_SYSMAP_QCS404_H + +#define GICD_BASE (0x0b000000) +#define GICC_BASE (0x0b002000) + +/* Clocks: (from CLK_CTL_BASE) */ +#define GPLL0_STATUS (0x21000) +#define APCS_GPLL_ENA_VOTE (0x45000) +#define APCS_CLOCK_BRANCH_ENA_VOTE (0x45004) + +/* BLSP1 AHB clock (root clock for BLSP) */ +#define BLSP1_AHB_CBCR 0x1008 + +/* Uart clock control registers */ +#define BLSP1_UART2_BCR (0x3028) +#define BLSP1_UART2_APPS_CBCR (0x302C) +#define BLSP1_UART2_APPS_CMD_RCGR (0x3034) +#define BLSP1_UART2_APPS_CFG_RCGR (0x3038) +#define BLSP1_UART2_APPS_M (0x303C) +#define BLSP1_UART2_APPS_N (0x3040) +#define BLSP1_UART2_APPS_D (0x3044) + +/* SD controller clock control registers */ +#define SDCC_BCR (n) (((n) * 0x1000) + 0x41000) +#define SDCC_CMD_RCGR (n) (((n) * 0x1000) + 0x41004) +#define SDCC_CFG_RCGR (n) (((n) * 0x1000) + 0x41008) +#define SDCC_M (n) (((n) * 0x1000) + 0x4100C) +#define SDCC_N (n) (((n) * 0x1000) + 0x41010) +#define SDCC_D (n) (((n) * 0x1000) + 0x41014) +#define SDCC_APPS_CBCR (n) (((n) * 0x1000) + 0x41018) +#define SDCC_AHB_CBCR (n) (((n) * 0x1000) + 0x4101C) + +#endif
include/dt-bindings/clock/qcom,gcc-qcs404.h new file +180 -0
180 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [PATCH v3 8/9] clocks: qcom: Add clock driver for QCS404 SoC
Quoted 5 lines · Sumit Garg
Currently this clock driver initializes clocks for UART and eMMC. Along with this import "qcom,gcc-qcs404.h" header from Linux mainline to support DT bindings.
Signed-off-by Sumit Garg <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
PATCH v3 9/9 board: qualcomm: Add support for QCS404 EVB
In reply to Sumit GargAdd support for Qualcomm QCS404 SoC based evaluation board.
Features:
- Qualcomm Snapdragon QCS404 SoC
- 1GiB RAM
- 8GiB eMMC, uSD slot
U-boot is chain loaded by ABL in 64-bit mode as part of boot.img. For detailed build and boot instructions, refer to doc/board/qualcomm/qcs404.rst.
--- arch/arm/dts/Makefile | 1 + arch/arm/dts/qcs404-evb-uboot.dtsi | 24 +++++++ arch/arm/dts/qcs404-evb.dts | 81 ++++++++++++++++++++++++ arch/arm/mach-snapdragon/Kconfig | 11 ++++ arch/arm/mach-snapdragon/Makefile | 2 + arch/arm/mach-snapdragon/sysmap-qcs404.c | 31 +++++++++ board/qualcomm/qcs404-evb/Kconfig | 15 +++++ board/qualcomm/qcs404-evb/MAINTAINERS | 6 ++ board/qualcomm/qcs404-evb/Makefile | 6 ++ board/qualcomm/qcs404-evb/qcs404-evb.c | 33 ++++++++++ board/qualcomm/qcs404-evb/qcs404-evb.its | 64 +++++++++++++++++++ configs/qcs404evb_defconfig | 39 ++++++++++++ doc/board/qualcomm/index.rst | 1 + doc/board/qualcomm/qcs404.rst | 79 +++++++++++++++++++++++ include/configs/qcs404-evb.h | 27 ++++++++ 15 files changed, 420 insertions(+) create mode 100644 arch/arm/dts/qcs404-evb-uboot.dtsi create mode 100644 arch/arm/dts/qcs404-evb.dts create mode 100644 arch/arm/mach-snapdragon/sysmap-qcs404.c create mode 100644 board/qualcomm/qcs404-evb/Kconfig create mode 100644 board/qualcomm/qcs404-evb/MAINTAINERS create mode 100644 board/qualcomm/qcs404-evb/Makefile create mode 100644 board/qualcomm/qcs404-evb/qcs404-evb.c create mode 100644 board/qualcomm/qcs404-evb/qcs404-evb.its create mode 100644 configs/qcs404evb_defconfig create mode 100644 doc/board/qualcomm/qcs404.rst create mode 100644 include/configs/qcs404-evb.h
arch/arm/dts/Makefile +1 -0
@@ -502,6 +502,7 @@ dtb-$(CONFIG_TARGET_TEN64) += fsl-ls1088a-ten64.dtb dtb-$(CONFIG_TARGET_DRAGONBOARD410C) += dragonboard410c.dtb dtb-$(CONFIG_TARGET_DRAGONBOARD820C) += dragonboard820c.dtb dtb-$(CONFIG_TARGET_STARQLTECHN) += starqltechn.dtb +dtb-$(CONFIG_TARGET_QCS404EVB) += qcs404-evb.dtb dtb-$(CONFIG_TARGET_STEMMY) += ste-ux500-samsung-stemmy.dtb
arch/arm/dts/qcs404-evb-uboot.dtsi new file +24 -0
@@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * U-Boot addition to handle QCS404 EVB pre-relocation devices + * + * (C) Copyright 2022 Sumit Garg <[email protected]> + */ + +/ { + soc { + u-boot,dm-pre-reloc; + + pinctrl_north@1300000 { + u-boot,dm-pre-reloc; + }; + + clock-controller@1800000 { + u-boot,dm-pre-reloc; + }; + + serial@78b1000 { + u-boot,dm-pre-reloc; + }; + }; +};
arch/arm/dts/qcs404-evb.dts new file +81 -0
81 lines not on this page · raw message
arch/arm/mach-snapdragon/Kconfig +11 -0
@@ -69,11 +69,22 @@ config TARGET_STARQLTECHN select SDM845 select DM_ETH if NET +config TARGET_QCS404EVB + bool "Qualcomm Technologies, Inc. QCS404 EVB" + select LINUX_KERNEL_IMAGE_HEADER + help + Support for Qualcomm Technologies, Inc. QCS404 evaluation board. + Features: + - Qualcomm Snapdragon QCS404 SoC + - 1GiB RAM + - 8GiB eMMC, uSD slot + endchoice source "board/qualcomm/dragonboard410c/Kconfig" source "board/qualcomm/dragonboard820c/Kconfig" source "board/qualcomm/dragonboard845c/Kconfig" source "board/samsung/starqltechn/Kconfig" +source "board/qualcomm/qcs404-evb/Kconfig" endif
arch/arm/mach-snapdragon/Makefile +2 -0
@@ -17,3 +17,5 @@ obj-y += pinctrl-apq8016.o obj-y += pinctrl-apq8096.o obj-y += pinctrl-qcs404.o obj-$(CONFIG_SDM845) += pinctrl-sdm845.o +obj-$(CONFIG_TARGET_QCS404EVB) += clock-qcs404.o +obj-$(CONFIG_TARGET_QCS404EVB) += sysmap-qcs404.o
arch/arm/mach-snapdragon/sysmap-qcs404.c new file +31 -0
@@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Qualcomm QCS404 memory map +* +* (C) Copyright 2022 Sumit Garg <[email protected]> +*/ + +#include <common.h> +#include <asm/armv8/mmu.h> + +static struct mm_region qcs404_mem_map[] = { + { + .virt =0x0UL ,/* Peripheral block */ + .phys =0x0UL ,/* Peripheral block */ + .size =0x8000000UL , + .attrs =PTE_BLOCK_MEMTYPE (MT_DEVICE_NGNRNE ) | +PTE_BLOCK_NON_SHARE | +PTE_BLOCK_PXN |PTE_BLOCK_UXN + }, { + .virt =0x80000000UL ,/* DDR */ + .phys =0x80000000UL ,/* DDR */ + .size =0x40000000UL , + .attrs =PTE_BLOCK_MEMTYPE (MT_NORMAL ) | +PTE_BLOCK_INNER_SHARE + }, { +/* List terminator */ +0 , + } +}; + +struct mm_region *mem_map = qcs404_mem_map;
board/qualcomm/qcs404-evb/Kconfig new file +15 -0
@@ -0,0 +1,15 @@ +if TARGET_QCS404EVB + +config SYS_BOARD + default "qcs404-evb" + +config SYS_VENDOR + default "qualcomm" + +config SYS_SOC + default "qcs404" + +config SYS_CONFIG_NAME + default "qcs404-evb" + +endif
board/qualcomm/qcs404-evb/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +Qualcomm Technologies, Inc. QCS404 evaluation board +M: Sumit Garg <[email protected]> +S: Maintained +F: board/qualcomm/qcs404-evb/ +F: include/configs/qcs404-evb.h +F: configs/qcs404evb_defconfig
board/qualcomm/qcs404-evb/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2022 Sumit Garg <[email protected]> +# + +obj-y += qcs404-evb.o
board/qualcomm/qcs404-evb/qcs404-evb.c new file +33 -0
@@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Board init file for QCS404-EVB +* +* (C) Copyright 2022 Sumit Garg <[email protected]> +*/ + +#include <common.h> +#include <cpu_func.h> +#include <dm.h> +#include <env.h> +#include <init.h> +#include <asm/cache.h> +#include <asm/global_data.h> +#include <fdt_support.h> +#include <asm/arch/dram.h> + +DECLARE_GLOBAL_DATA_PTR ; + +int dram_init (void ) +{ +return fdtdec_setup_mem_size_base (); +} + +int board_init (void ) +{ +return 0 ; +} + +void reset_cpu (void ) +{ +psci_system_reset (); +}
board/qualcomm/qcs404-evb/qcs404-evb.its new file +64 -0
64 lines not on this page · raw message
configs/qcs404evb_defconfig new file +39 -0
@@ -0,0 +1,39 @@ +CONFIG_ARM=y +CONFIG_SKIP_LOWLEVEL_INIT=y +CONFIG_COUNTER_FREQUENCY=19000000 +CONFIG_POSITION_INDEPENDENT=y +CONFIG_ARCH_SNAPDRAGON=y +CONFIG_DEFAULT_DEVICE_TREE="qcs404-evb" +CONFIG_TARGET_QCS404EVB=y +CONFIG_IDENT_STRING="\nQualcomm QCS404-EVB" +CONFIG_SYS_TEXT_BASE=0x0 +CONFIG_SYS_LOAD_ADDR=0x80000000 +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +CONFIG_BOOTDELAY=5 +CONFIG_SAVE_PREV_BL_FDT_ADDR=y +CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR=y +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_HUSH_PARSER=y +CONFIG_CMD_BMP=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_MMC=y +CONFIG_CMD_GPT=y +CONFIG_CMD_PART=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_EXT4_WRITE=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +# CONFIG_NET is not set +CONFIG_CLK=y +CONFIG_PINCTRL=y +CONFIG_DM_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_ADMA=y +CONFIG_MMC_SDHCI_MSM=y +CONFIG_MMC_HS400_SUPPORT=y +CONFIG_MSM_SERIAL=y +CONFIG_LMB_MAX_REGIONS=64 +CONFIG_USE_BOOTARGS=y +CONFIG_BOOTARGS="earlycon ignore_loglevel root= clk_ignore_unused"
doc/board/qualcomm/index.rst +1 -0
@@ -8,3 +8,4 @@ Qualcomm dragonboard410c sdm845 + qcs404
doc/board/qualcomm/qcs404.rst new file +79 -0
79 lines not on this page · raw message
include/configs/qcs404-evb.h new file +27 -0
@@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Configuration file for QCS404 evaluation board +* +* (C) Copyright 2022 Sumit Garg <[email protected]> +*/ + +#ifndef __CONFIGS_QCS404EVB_H +#define __CONFIGS_QCS404EVB_H + +#include <linux/sizes.h> +#include <asm/arch/sysmap-qcs404.h> + +#define CONFIG_SYS_BAUDRATE_TABLE { 115200, 230400, 460800, 921600 } + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "bootm_size=0x5000000\0" \ + "bootm_low=0x80000000\0" \ + "bootcmd=bootm $prevbl_initrd_start_addr\0" + +#define CONFIG_SYS_BOOTM_LEN SZ_64M + +/* Monitor Command Prompt */ +#define CONFIG_SYS_CBSIZE 512 +#define CONFIG_SYS_MAXARGS 64 + +#endif
Signature · 1 line
2.25.1
Re: [PATCH v3 9/9] board: qualcomm: Add support for QCS404 EVB
Hi Sumit,
Quoted 87 lines · Sumit Garg
Add support for Qualcomm QCS404 SoC based evaluation board.
Features:
- Qualcomm Snapdragon QCS404 SoC
- 1GiB RAM
- 8GiB eMMC, uSD slotU-boot is chain loaded by ABL in 64-bit mode as part of boot.img. For detailed build and boot instructions, refer to
doc/board/qualcomm/qcs404.rst.Signed-off-by Sumit Garg <[email protected]>--- arch/arm/dts/Makefile | 1 + arch/arm/dts/qcs404-evb-uboot.dtsi | 24 +++++++ arch/arm/dts/qcs404-evb.dts | 81 ++++++++++++++++++++++++ arch/arm/mach-snapdragon/Kconfig | 11 ++++ arch/arm/mach-snapdragon/Makefile | 2 + arch/arm/mach-snapdragon/sysmap-qcs404.c | 31 +++++++++ board/qualcomm/qcs404-evb/Kconfig | 15 +++++ board/qualcomm/qcs404-evb/MAINTAINERS | 6 ++ board/qualcomm/qcs404-evb/Makefile | 6 ++ board/qualcomm/qcs404-evb/qcs404-evb.c | 33 ++++++++++ board/qualcomm/qcs404-evb/qcs404-evb.its | 64 +++++++++++++++++++ configs/qcs404evb_defconfig | 39 ++++++++++++ doc/board/qualcomm/index.rst | 1 + doc/board/qualcomm/qcs404.rst | 79 +++++++++++++++++++++++ include/configs/qcs404-evb.h | 27 ++++++++ 15 files changed, 420 insertions(+) create mode 100644 arch/arm/dts/qcs404-evb-uboot.dtsi create mode 100644 arch/arm/dts/qcs404-evb.dts create mode 100644 arch/arm/mach-snapdragon/sysmap-qcs404.c create mode 100644 board/qualcomm/qcs404-evb/Kconfig create mode 100644 board/qualcomm/qcs404-evb/MAINTAINERS create mode 100644 board/qualcomm/qcs404-evb/Makefile create mode 100644 board/qualcomm/qcs404-evb/qcs404-evb.c create mode 100644 board/qualcomm/qcs404-evb/qcs404-evb.its create mode 100644 configs/qcs404evb_defconfig create mode 100644 doc/board/qualcomm/qcs404.rst create mode 100644 include/configs/qcs404-evb.h[...]
arch/arm/dts/qcs404-evb.dts new file +39
-0@@ -0,0 +1,81 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Qualcomm QCS404 based evaluation board device tree source + * + * (C) Copyright 2022 Sumit Garg <[email protected]> + */ + +/dts-v1/; + +#include "skeleton64.dtsi" +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/pinctrl/pinctrl-snapdragon.h> +#include <dt-bindings/clock/qcom,gcc-qcs404.h> + +/ { + model = "Qualcomm Technologies, Inc. QCS404 EVB"; + compatible = "qcom,qcs404-evb", "qcom,qcs404"; + #address-cells = <0x2>; + #size-cells = <0x2>; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + serial0 = &debug_uart; + }; + + memory { + device_type = "memory"; + reg = <0 0x80000000 0 0x40000000>; + }; + + soc { + #address-cells = <0x1>; + #size-cells = <0x1>; + ranges = <0x0 0x0 0x0 0xffffffff>; + compatible = "simple-bus"; +
arch/arm/dts/qcs404-evb.dts line 49
Quoted 10 lines
arch/arm/dts/qcs404-evb.dts new file +10
-0+ pinctrl_north@1300000 { + compatible = "qcom,tlmm-qcs404"; + reg = <0x1300000 0x200000>; + + blsp1_uart2: uart { + pins = "GPIO_17", "GPIO_18"; + function = "blsp_uart2"; + }; + }; +
I know you're just following the example of the existing Qualcomm boards here but I think we should really avoid adding any more custom device trees that are inconsistent with the official (upstream) Linux bindings.
Many other boards in U-Boot have moved to using the upstream Linux DTs as-is (with some additions in -u-boot.dtsi) and I think we should do the same for the Qualcomm boards. Judging from Tom's comments on other patches (e.g. [1]), this might even be a requirement now?
The SPMI fix I just sent for DB410c/DB820c [2] is a good example why it is important to have bindings consistent with Linux. Looking at your patch reminded me that I never sent this fix (thanks!).
Can you check how hard it would be to reuse the upstream QCS404 DT?
Thanks!
Stephan
[1]: https://lore.kernel.org/u-boot/20220601152800.GJ25375@bill-the-cat/
[2]: https://lore.kernel.org/u-boot/[email protected]/
Re: [PATCH v3 9/9] board: qualcomm: Add support for QCS404 EVB
Hi Stephan,
Quoted 106 lines · Stephan Gerhold
Hi Sumit,
Quoted 87 lines · Sumit Garg
Add support for Qualcomm QCS404 SoC based evaluation board.
Features:
- Qualcomm Snapdragon QCS404 SoC
- 1GiB RAM
- 8GiB eMMC, uSD slotU-boot is chain loaded by ABL in 64-bit mode as part of boot.img. For detailed build and boot instructions, refer to
doc/board/qualcomm/qcs404.rst.Signed-off-by Sumit Garg <[email protected]>--- arch/arm/dts/Makefile | 1 + arch/arm/dts/qcs404-evb-uboot.dtsi | 24 +++++++ arch/arm/dts/qcs404-evb.dts | 81 ++++++++++++++++++++++++ arch/arm/mach-snapdragon/Kconfig | 11 ++++ arch/arm/mach-snapdragon/Makefile | 2 + arch/arm/mach-snapdragon/sysmap-qcs404.c | 31 +++++++++ board/qualcomm/qcs404-evb/Kconfig | 15 +++++ board/qualcomm/qcs404-evb/MAINTAINERS | 6 ++ board/qualcomm/qcs404-evb/Makefile | 6 ++ board/qualcomm/qcs404-evb/qcs404-evb.c | 33 ++++++++++ board/qualcomm/qcs404-evb/qcs404-evb.its | 64 +++++++++++++++++++ configs/qcs404evb_defconfig | 39 ++++++++++++ doc/board/qualcomm/index.rst | 1 + doc/board/qualcomm/qcs404.rst | 79 +++++++++++++++++++++++ include/configs/qcs404-evb.h | 27 ++++++++ 15 files changed, 420 insertions(+) create mode 100644 arch/arm/dts/qcs404-evb-uboot.dtsi create mode 100644 arch/arm/dts/qcs404-evb.dts create mode 100644 arch/arm/mach-snapdragon/sysmap-qcs404.c create mode 100644 board/qualcomm/qcs404-evb/Kconfig create mode 100644 board/qualcomm/qcs404-evb/MAINTAINERS create mode 100644 board/qualcomm/qcs404-evb/Makefile create mode 100644 board/qualcomm/qcs404-evb/qcs404-evb.c create mode 100644 board/qualcomm/qcs404-evb/qcs404-evb.its create mode 100644 configs/qcs404evb_defconfig create mode 100644 doc/board/qualcomm/qcs404.rst create mode 100644 include/configs/qcs404-evb.h[...]
arch/arm/dts/qcs404-evb.dts new file +39
-0@@ -0,0 +1,81 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Qualcomm QCS404 based evaluation board device tree source + * + * (C) Copyright 2022 Sumit Garg <[email protected]> + */ + +/dts-v1/; + +#include "skeleton64.dtsi" +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/pinctrl/pinctrl-snapdragon.h> +#include <dt-bindings/clock/qcom,gcc-qcs404.h> + +/ { + model = "Qualcomm Technologies, Inc. QCS404 EVB"; + compatible = "qcom,qcs404-evb", "qcom,qcs404"; + #address-cells = <0x2>; + #size-cells = <0x2>; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + serial0 = &debug_uart; + }; + + memory { + device_type = "memory"; + reg = <0 0x80000000 0 0x40000000>; + }; + + soc { + #address-cells = <0x1>; + #size-cells = <0x1>; + ranges = <0x0 0x0 0x0 0xffffffff>; + compatible = "simple-bus"; +arch/arm/dts/qcs404-evb.dts line 49
Quoted 10 lines
arch/arm/dts/qcs404-evb.dts new file +10
-0+ pinctrl_north@1300000 { + compatible = "qcom,tlmm-qcs404"; + reg = <0x1300000 0x200000>; + + blsp1_uart2: uart { + pins = "GPIO_17", "GPIO_18"; + function = "blsp_uart2"; + }; + }; +I know you're just following the example of the existing Qualcomm boards here but I think we should really avoid adding any more custom device trees that are inconsistent with the official (upstream) Linux bindings.
Quoted 5 lines
Many other boards in U-Boot have moved to using the upstream Linux DTs as-is (with some additions in
-u-boot.dtsi) and I think we should do the same for the Qualcomm boards. Judging from Tom's comments on other patches (e.g. [1]), this might even be a requirement now?
I overall agree with this and you can already see patches #2 and #3 in this patch-set following this guideline.
Quoted 4 lines
The SPMI fix I just sent for DB410c/DB820c [2] is a good example why it is important to have bindings consistent with Linux. Looking at your patch reminded me that I never sent this fix (thanks!).
Makes sense and I can echo with this while adding new boards support its difficult to cope up with different DT expectations from Linux and u-boot drivers.
Quoted 2 lines
Can you check how hard it would be to reuse the upstream QCS404 DT?
It turned out to be patch [1] on top of this patch-set. Please help me to test it on boards you have access to.
[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
-Sumit
Quoted 5 lines
Thanks!
Stephan[1]: https://lore.kernel.org/u-boot/20220601152800.GJ25375@bill-the-cat/
[2]: https://lore.kernel.org/u-boot/[email protected]/
Re: [PATCH v3 9/9] board: qualcomm: Add support for QCS404 EVB
Quoted 9 lines · Sumit Garg
Quoted 2 lines · Stephan Gerhold
Can you check how hard it would be to reuse the upstream QCS404 DT?
It turned out to be patch [1] on top of this patch-set. Please help me to test it on boards you have access to.
[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
Thanks! Do you happen to have time to check the other custom bindings in SDM845 as well? I see two other differences there in addition to the pinctrl:
1. "qcom,msm-geni-uart": Linux has an additional "qcom,geni-se-qup" node around that.
2. The "qcom,pm8998-pwrkey" should be in an additional "qcom,pm8998-pon" container node and then called "qcom,pm8941-pwrkey".
Also, in U-Boot the keys are modelled as GPIOs which is a bit strange (I don't think they can be set to output mode for example). But it might be fine to keep that in the -u-boot.dtsi part for now.
I would be happy to investigate and test the remaining DB410c-specific parts (e.g. USB there). Cleaning up the DT differences has been on my TODO list for quite some time but I never got to it, sadly...
Thanks!
Stephan
Re: [PATCH v3 9/9] board: qualcomm: Add support for QCS404 EVB
Quoted 12 lines · Stephan Gerhold
Quoted 9 lines · Sumit Garg
Quoted 2 lines · Stephan Gerhold
Can you check how hard it would be to reuse the upstream QCS404 DT?
It turned out to be patch [1] on top of this patch-set. Please help me to test it on boards you have access to.
[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
Quoted 7 lines
Thanks! Do you happen to have time to check the other custom bindings in SDM845 as well? I see two other differences there in addition to the pinctrl:
1. "qcom,msm-geni-uart": Linux has an additional "qcom,geni-se-qup" node around that.
Yeah that is for a wrapper serial engine driver around UART, SPI, I2C, I3C, etc. Text from "drivers/soc/qcom/qcom-geni-se.c":
/**
* DOC: Software description
*
* GENI SE Wrapper driver is structured into 2 parts:
*
* geni_wrapper represents QUP Wrapper controller. This part of the driver
* manages QUP Wrapper information such as hardware version, clock
* performance table that is common to all the internal serial engines. *
* geni_se represents serial engine. This part of the driver manages serial
* engine information such as clocks, containing QUP Wrapper, etc. This part
* of driver also supports operations (eg. initialize the concerned serial
* engine, select between FIFO and DMA mode of operation etc.) that are
* common to all the serial engines and are independent of serial interfaces. */
I am unsure if there really exists a use-case for that in u-boot but I guess we should be able to add a dummy driver just to satisfy the upstream Linux kernel DT binding.
Quoted 8 lines
2. The "qcom,pm8998-pwrkey" should be in an additional "qcom,pm8998-pon" container node and then called "qcom,pm8941-pwrkey".
Also, in U-Boot the keys are modelled as GPIOs which is a bit strange (I don't think they can be set to output mode for example). But it might be fine to keep that in the
-u-boot.dtsipart for now.
Okay, I will try to look at these as follow up patches.
Quoted 4 lines
I would be happy to investigate and test the remaining DB410c-specific parts (e.g. USB there). Cleaning up the DT differences has been on my TODO list for quite some time but I never got to it, sadly...
No worries, it's a community effort which often takes a backseat on the TODO list.
-Sumit
Quoted 2 lines
Thanks!
Stephan
Re: [PATCH v3 9/9] board: qualcomm: Add support for QCS404 EVB
In reply to Sumit GargQuoted 7 lines · Sumit Garg
Add support for Qualcomm QCS404 SoC based evaluation board.
Features:
- Qualcomm Snapdragon QCS404 SoC
- 1GiB RAM
- 8GiB eMMC, uSD slot
Quoted 5 lines
U-boot is chain loaded by ABL in 64-bit mode as part of boot.img. For detailed build and boot instructions, refer to
doc/board/qualcomm/qcs404.rst.Signed-off-by Sumit Garg <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
Hi Tom, Ramon,
Quoted 22 lines · Sumit Garg
Add support for two new boards db845c and qcs404-evb:
- db845c is a 96boards compliant platform aka RB3 based on Qualcomm SDM845 SoC.
- qcs404-evb is an evaluation board from Qualcomm based on QCS404 SoC.Both these platforms have one thing in common that u-boot is chain-loaded in 64-bit mode via Android Boot Loader (ABL) which is an EFI application. For further details on chain-loading refer to platform specific documentation:
-doc/board/qualcomm/sdm845.rst
-doc/board/qualcomm/qcs404.rstChanges in v3:
- Add clocks re-initialization for UART and eMMC for qcs404-evb.
- Pick up Ramon's review tag for patches 1-7.Changes in v2:
- Added patch #1 to fix DT node overrides instarqltechn-uboot.dtsi.
- Updated patch #2 commit description.
- Fixed a typo (s/96Board/96Boards/) in patch #5.
Quoted 11 lines
Sumit Garg (9):
board: starqltechn: Align DT node overrides withsdm845.dtsi
arm64: dts: sdm845: Remove redundant u-boot DT properties
clocks: sdm845: Import qcom,gcc-sdm845.h
uart: sdm845: Fix debug UART pinmux
board: qualcomm: Add support for dragonboard845c
mmc:msm_sdhci: Add SDCC version 5.0.0 support
pinctrl: qcom: Add pinctrl driver for QCS404 SoC
clocks: qcom: Add clock driver for QCS404 SoC
board: qualcomm: Add support for QCS404 EVB
Do we have any further comments on this patch-set? If there aren't any then can you help picking it up?
-Sumit
Quoted 68 lines
arch/arm/dts/Makefile | 1 + arch/arm/dts/dragonboard845c-uboot.dtsi | 37 +++ arch/arm/dts/dragonboard845c.dts | 44 ++++ arch/arm/dts/qcs404-evb-uboot.dtsi | 24 ++ arch/arm/dts/qcs404-evb.dts | 81 ++++++ arch/arm/dts/sdm845.dtsi | 8 +- arch/arm/dts/starqltechn-uboot.dtsi | 18 +- arch/arm/dts/starqltechn.dts | 2 +- arch/arm/mach-snapdragon/Kconfig | 25 ++ arch/arm/mach-snapdragon/Makefile | 3 + arch/arm/mach-snapdragon/clock-qcs404.c | 79 ++++++ arch/arm/mach-snapdragon/clock-sdm845.c | 3 +- arch/arm/mach-snapdragon/clock-snapdragon.c | 1 + .../include/mach/sysmap-qcs404.h | 40 +++ arch/arm/mach-snapdragon/pinctrl-qcs404.c | 55 ++++ arch/arm/mach-snapdragon/pinctrl-snapdragon.c | 1 + arch/arm/mach-snapdragon/pinctrl-snapdragon.h | 1 + arch/arm/mach-snapdragon/sysmap-qcs404.c | 31 +++ board/qualcomm/dragonboard845c/Kconfig | 12 + board/qualcomm/dragonboard845c/MAINTAINERS | 6 + board/qualcomm/dragonboard845c/Makefile | 9 + board/qualcomm/dragonboard845c/db845c.its | 63 +++++ .../dragonboard845c/dragonboard845c.c | 9 + board/qualcomm/qcs404-evb/Kconfig | 15 ++ board/qualcomm/qcs404-evb/MAINTAINERS | 6 + board/qualcomm/qcs404-evb/Makefile | 6 + board/qualcomm/qcs404-evb/qcs404-evb.c | 33 +++ board/qualcomm/qcs404-evb/qcs404-evb.its | 64 +++++ configs/dragonboard845c_defconfig | 28 ++ configs/qcs404evb_defconfig | 39 +++ doc/board/qualcomm/index.rst | 1 + doc/board/qualcomm/qcs404.rst | 79 ++++++ doc/board/qualcomm/sdm845.rst | 100 ++++++- drivers/mmc/msm_sdhci.c | 96 ++++--- include/configs/dragonboard845c.h | 28 ++ include/configs/qcs404-evb.h | 27 ++ include/dt-bindings/clock/qcom,gcc-qcs404.h | 180 +++++++++++++ include/dt-bindings/clock/qcom,gcc-sdm845.h | 246 ++++++++++++++++++ 38 files changed, 1439 insertions(+), 62 deletions(-) create mode 100644 arch/arm/dts/dragonboard845c-uboot.dtsi create mode 100644 arch/arm/dts/dragonboard845c.dts create mode 100644 arch/arm/dts/qcs404-evb-uboot.dtsi create mode 100644 arch/arm/dts/qcs404-evb.dts create mode 100644 arch/arm/mach-snapdragon/clock-qcs404.c create mode 100644 arch/arm/mach-snapdragon/include/mach/sysmap-qcs404.h create mode 100644 arch/arm/mach-snapdragon/pinctrl-qcs404.c create mode 100644 arch/arm/mach-snapdragon/sysmap-qcs404.c create mode 100644 board/qualcomm/dragonboard845c/Kconfig create mode 100644 board/qualcomm/dragonboard845c/MAINTAINERS create mode 100644 board/qualcomm/dragonboard845c/Makefile create mode 100644 board/qualcomm/dragonboard845c/db845c.its create mode 100644 board/qualcomm/dragonboard845c/dragonboard845c.c create mode 100644 board/qualcomm/qcs404-evb/Kconfig create mode 100644 board/qualcomm/qcs404-evb/MAINTAINERS create mode 100644 board/qualcomm/qcs404-evb/Makefile create mode 100644 board/qualcomm/qcs404-evb/qcs404-evb.c create mode 100644 board/qualcomm/qcs404-evb/qcs404-evb.its create mode 100644 configs/dragonboard845c_defconfig create mode 100644 configs/qcs404evb_defconfig create mode 100644 doc/board/qualcomm/qcs404.rst create mode 100644 include/configs/dragonboard845c.h create mode 100644 include/configs/qcs404-evb.h create mode 100644 include/dt-bindings/clock/qcom,gcc-qcs404.h create mode 100644 include/dt-bindings/clock/qcom,gcc-sdm845.h--
2.25.1
Quoted 37 lines · Sumit Garg
Hi Tom, Ramon,
Quoted 22 lines · Sumit Garg
Add support for two new boards db845c and qcs404-evb:
- db845c is a 96boards compliant platform aka RB3 based on Qualcomm SDM845 SoC.
- qcs404-evb is an evaluation board from Qualcomm based on QCS404 SoC.Both these platforms have one thing in common that u-boot is chain-loaded in 64-bit mode via Android Boot Loader (ABL) which is an EFI application. For further details on chain-loading refer to platform specific documentation:
-doc/board/qualcomm/sdm845.rst
-doc/board/qualcomm/qcs404.rstChanges in v3:
- Add clocks re-initialization for UART and eMMC for qcs404-evb.
- Pick up Ramon's review tag for patches 1-7.Changes in v2:
- Added patch #1 to fix DT node overrides instarqltechn-uboot.dtsi.
- Updated patch #2 commit description.
- Fixed a typo (s/96Board/96Boards/) in patch #5.Quoted 11 lines
Sumit Garg (9):
board: starqltechn: Align DT node overrides withsdm845.dtsi
arm64: dts: sdm845: Remove redundant u-boot DT properties
clocks: sdm845: Import qcom,gcc-sdm845.h
uart: sdm845: Fix debug UART pinmux
board: qualcomm: Add support for dragonboard845c
mmc:msm_sdhci: Add SDCC version 5.0.0 support
pinctrl: qcom: Add pinctrl driver for QCS404 SoC
clocks: qcom: Add clock driver for QCS404 SoC
board: qualcomm: Add support for QCS404 EVB
Quoted 2 lines
Do we have any further comments on this patch-set? If there aren't any then can you help picking it up?
If there's no further comments, I'll pick it up in a week or two (the usual time between last comments and applying non-regression / critical bugfix patches).
Signature · 1 line
Tom
Quoted 39 lines · Tom Rini
Quoted 37 lines · Sumit Garg
Hi Tom, Ramon,
Quoted 33 lines · Sumit Garg
Add support for two new boards db845c and qcs404-evb:
- db845c is a 96boards compliant platform aka RB3 based on Qualcomm SDM845 SoC.
- qcs404-evb is an evaluation board from Qualcomm based on QCS404 SoC.Both these platforms have one thing in common that u-boot is chain-loaded in 64-bit mode via Android Boot Loader (ABL) which is an EFI application. For further details on chain-loading refer to platform specific documentation:
-doc/board/qualcomm/sdm845.rst
-doc/board/qualcomm/qcs404.rstChanges in v3:
- Add clocks re-initialization for UART and eMMC for qcs404-evb.
- Pick up Ramon's review tag for patches 1-7.Changes in v2:
- Added patch #1 to fix DT node overrides instarqltechn-uboot.dtsi.
- Updated patch #2 commit description.
- Fixed a typo (s/96Board/96Boards/) in patch #5.Sumit Garg (9):
board: starqltechn: Align DT node overrides withsdm845.dtsi
arm64: dts: sdm845: Remove redundant u-boot DT properties
clocks: sdm845: Import qcom,gcc-sdm845.h
uart: sdm845: Fix debug UART pinmux
board: qualcomm: Add support for dragonboard845c
mmc:msm_sdhci: Add SDCC version 5.0.0 support
pinctrl: qcom: Add pinctrl driver for QCS404 SoC
clocks: qcom: Add clock driver for QCS404 SoC
board: qualcomm: Add support for QCS404 EVB
Quoted 6 lines
Quoted 2 lines
Do we have any further comments on this patch-set? If there aren't any then can you help picking it up?
If there's no further comments, I'll pick it up in a week or two (the usual time between last comments and applying non-regression / critical bugfix patches).
Sure, thanks.
-Sumit
Quoted 3 lines
--
Tom