]> git.dujemihanovic.xyz Git - u-boot.git/commit
mach-snapdragon: generalise board support
authorCaleb Connolly <caleb.connolly@linaro.org>
Mon, 26 Feb 2024 17:26:24 +0000 (17:26 +0000)
committerCaleb Connolly <caleb.connolly@linaro.org>
Fri, 1 Mar 2024 14:44:37 +0000 (14:44 +0000)
commit059d526af3123935c1fb525d12953d570d392f7c
tree8932e080a4ec2b37379090306976af9df991e14b
parent9d5e434eb24d1bc73c8eb881bee95949a798f150
mach-snapdragon: generalise board support

Historically, Qualcomm boards have relied on heavy hardcoding in U-Boot,
in many cases to the specific SoC but also to the board itself (e.g.
memory map). This has been largely resolved by modernising the Qualcomm
drivers in U-Boot, however the board code still largely follows this
model.

This patch removes the board specific memory maps and duplicated board
init code, replacing it with generic init code.

The memory map is now built at runtime based on data read from DT, this
allows for the memory map to be provided without having to recompile
U-Boot. Support is also added for booting with appended DTBs, so that
the first-stage bootloader can populate the memory map for us.

The sdm845 specific init code is dropped entirely, it set an environment
variable depending on if a button was pressed, but this variable wasn't
used in U-Boot, and could be written to use the button command instead.

The KASLR detection is also dropped as with appended dtb, the kaslr seed
can be read directly from the DTB passed to U-Boot.

A new qcom_defconfig is added, with the aim of providing a generic
U-Boot configuration that will work on as many Qualcomm boards as
possible. It replaces the defconfig files for the Dragonboard 845c,
Galaxy S9, and QCS404 EVB. For now the db410c and 820c are excluded as
they still have some board code left.

Similarly, the config headers for db845c, starqltechn, and qcs404-evb
are replaced by a single qcom header.

The previously db410c-specific board_usb_init() function is made to be
generic and is added to mach-snapdragon. While we lack proper modelling
for USB configuration, using a well-known named pinctrl state is a
reasonably generic middleground, and works using upstream DT. This
function will do nothing unless the USB node has a pinctrl state named
"device", in which case it will be set when entering USB peripheral
mode.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org> #qcs404
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
27 files changed:
arch/arm/Kconfig
arch/arm/dts/Makefile
arch/arm/mach-snapdragon/Kconfig
arch/arm/mach-snapdragon/Makefile
arch/arm/mach-snapdragon/board.c [new file with mode: 0644]
arch/arm/mach-snapdragon/init_sdm845.c [deleted file]
arch/arm/mach-snapdragon/sysmap-apq8016.c [deleted file]
arch/arm/mach-snapdragon/sysmap-apq8096.c [deleted file]
arch/arm/mach-snapdragon/sysmap-qcs404.c [deleted file]
arch/arm/mach-snapdragon/sysmap-sdm845.c [deleted file]
board/qualcomm/dragonboard410c/Kconfig [deleted file]
board/qualcomm/dragonboard410c/dragonboard410c.c
board/qualcomm/dragonboard820c/Kconfig [deleted file]
board/qualcomm/dragonboard820c/dragonboard820c.c
board/qualcomm/dragonboard845c/Kconfig [deleted file]
board/qualcomm/qcs404-evb/Kconfig [deleted file]
board/qualcomm/qcs404-evb/qcs404-evb.c
configs/dragonboard410c_defconfig
configs/dragonboard820c_defconfig
configs/dragonboard845c_defconfig [deleted file]
configs/qcom_defconfig [new file with mode: 0644]
configs/qcs404evb_defconfig
configs/starqltechn_defconfig [deleted file]
include/configs/dragonboard845c.h [deleted file]
include/configs/qcom.h [new file with mode: 0644]
include/configs/qcs404-evb.h [deleted file]
include/configs/sdm845.h [deleted file]