• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂d35b2113745dca34f1557cfad394e6ea79531f2b (tree)
時間2022-07-26 02:02:04
作者Sumit Garg <sumit.garg@lina...>
CommiterTom Rini

Log Message

board: qualcomm: Add support for dragonboard845c

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

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 <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

Change Summary

差異

--- /dev/null
+++ b/arch/arm/dts/dragonboard845c-uboot.dtsi
@@ -0,0 +1,37 @@
1+// SPDX-License-Identifier: GPL-2.0+
2+/*
3+ * U-Boot addition to handle Qualcomm Robotics RB3 Development Platform
4+ * (dragonboard845c) pins
5+ *
6+ * (C) Copyright 2022 Sumit Garg <sumit.garg@linaro.org>
7+ */
8+
9+/
10+{
11+ soc {
12+ u-boot,dm-pre-reloc;
13+
14+ serial@a84000 {
15+ u-boot,dm-pre-reloc;
16+ };
17+
18+ clock-controller@100000 {
19+ u-boot,dm-pre-reloc;
20+ };
21+
22+ pinctrl_north@3900000 {
23+ u-boot,dm-pre-reloc;
24+ };
25+ };
26+};
27+
28+&pm8998_pon {
29+ key_vol_down {
30+ gpios = <&pm8998_pon 1 0>;
31+ label = "key_vol_down";
32+ };
33+ key_power {
34+ gpios = <&pm8998_pon 0 0>;
35+ label = "key_power";
36+ };
37+};
--- /dev/null
+++ b/arch/arm/dts/dragonboard845c.dts
@@ -0,0 +1,44 @@
1+// SPDX-License-Identifier: GPL-2.0+
2+/*
3+ * Qualcomm Robotics RB3 Development (dragonboard845c) board device
4+ * tree source
5+ *
6+ * (C) Copyright 2022 Sumit Garg <sumit.garg@linaro.org>
7+ */
8+
9+/dts-v1/;
10+
11+#include "sdm845.dtsi"
12+
13+/ {
14+ model = "Thundercomm Dragonboard 845c";
15+ compatible = "thundercomm,db845c", "qcom,sdm845";
16+ #address-cells = <2>;
17+ #size-cells = <2>;
18+
19+ chosen {
20+ stdout-path = "serial0:115200n8";
21+ };
22+
23+ aliases {
24+ serial0 = &debug_uart;
25+ };
26+
27+ memory {
28+ device_type = "memory";
29+ reg = <0 0x80000000 0 0xfdfa0000>;
30+ };
31+
32+ psci {
33+ compatible = "arm,psci-1.0";
34+ method = "smc";
35+ };
36+
37+ soc: soc {
38+ serial@a84000 {
39+ status = "okay";
40+ };
41+ };
42+};
43+
44+#include "dragonboard845c-uboot.dtsi"
--- a/arch/arm/mach-snapdragon/Kconfig
+++ b/arch/arm/mach-snapdragon/Kconfig
@@ -44,6 +44,19 @@ config TARGET_DRAGONBOARD820C
4444 - 3GiB RAM
4545 - 32GiB UFS drive
4646
47+config TARGET_DRAGONBOARD845C
48+ bool "96Boards Dragonboard 845C"
49+ help
50+ Support for 96Boards Dragonboard 845C aka Robotics RB3 Development
51+ Platform. This board complies with 96Boards Open Platform
52+ Specifications. Features:
53+ - Qualcomm Snapdragon SDA845 SoC
54+ - 4GiB RAM
55+ - 64GiB UFS drive
56+ select MISC_INIT_R
57+ select SDM845
58+ select DM_ETH if NET
59+
4760 config TARGET_STARQLTECHN
4861 bool "Samsung S9 SM-G9600(starqltechn)"
4962 help
@@ -60,6 +73,7 @@ endchoice
6073
6174 source "board/qualcomm/dragonboard410c/Kconfig"
6275 source "board/qualcomm/dragonboard820c/Kconfig"
76+source "board/qualcomm/dragonboard845c/Kconfig"
6377 source "board/samsung/starqltechn/Kconfig"
6478
6579 endif
--- /dev/null
+++ b/board/qualcomm/dragonboard845c/Kconfig
@@ -0,0 +1,12 @@
1+if TARGET_DRAGONBOARD845C
2+
3+config SYS_BOARD
4+ default "dragonboard845c"
5+
6+config SYS_CONFIG_NAME
7+ default "dragonboard845c"
8+
9+config SYS_VENDOR
10+ default "qualcomm"
11+
12+endif
--- /dev/null
+++ b/board/qualcomm/dragonboard845c/MAINTAINERS
@@ -0,0 +1,6 @@
1+Qualcomm Robotics RB3 Development Platform (dragonboard845c)
2+M: Sumit Garg <sumit.garg@linaro.org>
3+S: Maintained
4+F: board/qualcomm/dragonboard845c/
5+F: include/configs/dragonboard845c.h
6+F: configs/dragonboard845c_defconfig
--- /dev/null
+++ b/board/qualcomm/dragonboard845c/Makefile
@@ -0,0 +1,9 @@
1+# SPDX-License-Identifier: GPL-2.0+
2+#
3+# (C) Copyright 2022 Sumit Garg <sumit.garg@linaro.org>
4+#
5+# This empty file prevents make error.
6+# Board logic defined in board/qualcomm/common/sdm845.c, no custom logic for dragonboard845c so far.
7+#
8+
9+obj-y += dragonboard845c.o
--- /dev/null
+++ b/board/qualcomm/dragonboard845c/db845c.its
@@ -0,0 +1,63 @@
1+/*
2+ * U-Boot uImage source file with multiple kernels, ramdisks and FDT blobs
3+ */
4+
5+/dts-v1/;
6+
7+/ {
8+ description = "Various kernels, ramdisks and FDT blobs";
9+ #address-cells = <1>;
10+
11+ images {
12+ kernel-1 {
13+ description = "5.15.0-qcomlt-arm64";
14+ data = /incbin/("./db845c_imgs/Image.gz--5.15-r0-dragonboard-845c-20211218193034-511.bin");
15+ type = "kernel";
16+ arch = "arm64";
17+ os = "linux";
18+ compression = "gzip";
19+ load = <0x80000000>;
20+ entry = <0x80000000>;
21+ hash-1 {
22+ algo = "sha1";
23+ };
24+ };
25+
26+ ramdisk-1 {
27+ description = "initramfs-test-full-image-dragonboard-845c";
28+ data = /incbin/("./db845c_imgs/initramfs-test-full-image-dragonboard-845c-20211218193034-511.rootfs.cpio.gz");
29+ type = "ramdisk";
30+ arch = "arm64";
31+ os = "linux";
32+ compression = "gzip";
33+ load = <00000000>;
34+ entry = <00000000>;
35+ hash-1 {
36+ algo = "sha1";
37+ };
38+ };
39+
40+ fdt-1 {
41+ description = "sdm845-db845c-fdt";
42+ data = /incbin/("./db845c_imgs/sdm845-db845c--5.15-r0-dragonboard-845c-20211218193034.dtb");
43+ type = "flat_dt";
44+ arch = "arm64";
45+ compression = "none";
46+ hash-1 {
47+ algo = "sha1";
48+ };
49+ };
50+
51+ };
52+
53+ configurations {
54+ default = "config-1";
55+
56+ config-1 {
57+ description = "db845c kernel-5.15.0 configuration";
58+ kernel = "kernel-1";
59+ ramdisk = "ramdisk-1";
60+ fdt = "fdt-1";
61+ };
62+ };
63+};
--- /dev/null
+++ b/board/qualcomm/dragonboard845c/dragonboard845c.c
@@ -0,0 +1,9 @@
1+// SPDX-License-Identifier: GPL-2.0+
2+/*
3+ * This empty file prevents make linking error.
4+ * No custom logic for dragonboard845c so far.
5+ *
6+ * (C) Copyright 2022 Sumit Garg <sumit.garg@linaro.org>
7+ */
8+
9+void noop(void) {}
--- /dev/null
+++ b/configs/dragonboard845c_defconfig
@@ -0,0 +1,29 @@
1+CONFIG_ARM=y
2+CONFIG_SKIP_LOWLEVEL_INIT=y
3+CONFIG_COUNTER_FREQUENCY=19000000
4+CONFIG_POSITION_INDEPENDENT=y
5+CONFIG_ARCH_SNAPDRAGON=y
6+CONFIG_DEFAULT_DEVICE_TREE="dragonboard845c"
7+CONFIG_TARGET_DRAGONBOARD845C=y
8+CONFIG_IDENT_STRING="\nQualcomm-DragonBoard 845C"
9+CONFIG_SYS_LOAD_ADDR=0x80000000
10+CONFIG_FIT=y
11+CONFIG_FIT_VERBOSE=y
12+CONFIG_BOOTDELAY=5
13+CONFIG_SAVE_PREV_BL_FDT_ADDR=y
14+CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR=y
15+# CONFIG_DISPLAY_CPUINFO is not set
16+CONFIG_HUSH_PARSER=y
17+CONFIG_SYS_MAXARGS=64
18+CONFIG_SYS_CBSIZE=512
19+CONFIG_CMD_GPIO=y
20+# CONFIG_NET is not set
21+CONFIG_CLK=y
22+CONFIG_MSM_GPIO=y
23+CONFIG_PM8916_GPIO=y
24+CONFIG_PINCTRL=y
25+CONFIG_DM_PMIC=y
26+CONFIG_PMIC_PM8916=y
27+CONFIG_MSM_GENI_SERIAL=y
28+CONFIG_SPMI_MSM=y
29+CONFIG_LMB_MAX_REGIONS=64
--- a/doc/board/qualcomm/sdm845.rst
+++ b/doc/board/qualcomm/sdm845.rst
@@ -35,9 +35,25 @@ Pack android boot image
3535 ^^^^^^^^^^^^^^^^^^^^^^^
3636 We'll assemble android boot image with ``u-boot.bin`` instead of linux kernel,
3737 and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel
38-with appended dtb, so let's mimic linux to satisfy stock bootloader:
38+with appended dtb, so let's mimic linux to satisfy stock bootloader.
3939
40-- create dump dtb::
40+Boards
41+------------
42+starqlte
43+^^^^^^^^^^^^
44+
45+The starqltechn is a production board for Samsung S9 (SM-G9600) phone,
46+based on the Qualcomm SDM845 SoC.
47+
48+Steps:
49+
50+- Build u-boot::
51+
52+ $ export CROSS_COMPILE=<aarch64 toolchain prefix>
53+ $ make starqltechn_defconfig
54+ $ make
55+
56+- Create dump dtb::
4157
4258 workdir=/tmp/prepare_payload
4359 mkdir -p "$workdir"
@@ -56,10 +72,15 @@ with appended dtb, so let's mimic linux to satisfy stock bootloader:
5672 };
5773 EOF
5874
59-- gzip u-boot ``gzip u-boot.bin``
60-- append dtb to gzipped u-boot: ``cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb``
75+- gzip u-boot::
76+
77+ gzip u-boot.bin
6178
62-Now we've got everything to build android boot image:::
79+- Append dtb to gzipped u-boot::
80+
81+ cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb
82+
83+- Now we've got everything to build android boot image::
6384
6485 mkbootimg --base 0x0 --kernel_offset 0x00008000 \
6586 --ramdisk_offset 0x02000000 --tags_offset 0x01e00000 \
@@ -68,16 +89,69 @@ Now we've got everything to build android boot image:::
6889 --kernel u-boot.bin.gz-dtb \
6990 -o boot.img
7091
71-Flash image with your phone's flashing method.
92+- Flash image with your phone's flashing method.
7293
73-Boards
74-------------
75-starqlte
76-^^^^^^^^^^^^
94+More information can be found on the `Samsung S9 page`_.
7795
78-The starqltechn is a production board for Samsung S9 (SM-G9600) phone,
79-based on the Qualcomm SDM845 SoC.
96+dragonboard845c
97+^^^^^^^^^^^^^^^
8098
81-More information can be found on the `Samsung S9 page`_.
99+The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, based on
100+the Qualcomm SDM845 SoC.
101+
102+Steps:
103+
104+- Build u-boot::
105+
106+ $ export CROSS_COMPILE=<aarch64 toolchain prefix>
107+ $ make dragonboard845c_defconfig
108+ $ make
109+
110+- Create dummy dtb::
111+
112+ workdir=/tmp/prepare_payload
113+ mkdir -p "$workdir"
114+ mock_dtb="$workdir"/payload_mock.dtb
115+
116+ dtc -I dts -O dtb -o "$mock_dtb" << EOF
117+ /dts-v1/;
118+ / {
119+ #address-cells = <2>;
120+ #size-cells = <2>;
121+
122+ memory@80000000 {
123+ device_type = "memory";
124+ /* We expect the bootloader to fill in the size */
125+ reg = <0 0x80000000 0 0>;
126+ };
127+
128+ chosen { };
129+ };
130+ EOF
131+
132+- gzip u-boot::
133+
134+ gzip u-boot.bin
135+
136+- Append dtb to gzipped u-boot::
137+
138+ cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb
139+
140+- A ``db845c.its`` file can be found in ``board/qualcomm/dragonboard845c/``
141+ directory. It expects a folder as ``db845c_imgs/`` in the main directory
142+ containing pre-built kernel, dts and ramdisk images. See ``db845c.its``
143+ for full path to images::
144+
145+ mkimage -f db845c.its db845c.itb
146+
147+- Now we've got everything to build android boot image::
148+
149+ mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \
150+ --output boot.img --pagesize 4096 --base 0x80000000
151+
152+- Flash boot.img using db845c fastboot method.
153+
154+More information can be found on the `DragonBoard 845c page`_.
82155
83156 .. _Samsung S9 page: https://en.wikipedia.org/wiki/Samsung_Galaxy_S9
157+.. _DragonBoard 845c page: https://www.96boards.org/product/rb3-platform/
--- /dev/null
+++ b/include/configs/dragonboard845c.h
@@ -0,0 +1,21 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
2+/*
3+ * Configuration file for Dragonboard 845c, based on Qualcomm SDA845 chip
4+ *
5+ * (C) Copyright 2022 Sumit Garg <sumit.garg@linaro.org>
6+ */
7+
8+#ifndef __CONFIGS_SDM845_H
9+#define __CONFIGS_SDM845_H
10+
11+#include <linux/sizes.h>
12+#include <asm/arch/sysmap-sdm845.h>
13+
14+#define CONFIG_SYS_BAUDRATE_TABLE { 115200, 230400, 460800, 921600 }
15+
16+#define CONFIG_EXTRA_ENV_SETTINGS \
17+ "bootm_size=0x5000000\0" \
18+ "bootm_low=0x80000000\0" \
19+ "bootcmd=bootm $prevbl_initrd_start_addr\0"
20+
21+#endif