Skip to content

Commit cfab9cb

Browse files
kernel: add mici and tizi dts overlays
1 parent ff3ef2d commit cfab9cb

File tree

5 files changed

+79
-22
lines changed

5 files changed

+79
-22
lines changed
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
#include "sdm845.dtsi"
55

66
/ {
7-
model = "comma.ai mici";
8-
compatible = "comma,mici", "qcom,sdm845";
9-
107
aliases {
118
serial0 = &uart9;
129
};

kernel/dts/sdm845-comma-mici.dts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/dts-v1/;
2+
3+
#include "sdm845-comma-common.dtsi"
4+
5+
/ {
6+
model = "comma.ai mici";
7+
compatible = "comma,mici", "qcom,sdm845";
8+
qcom,msm-id = <341 0x20001>, <321 0x20001>, <321 0x20000>, <348 0x20001>;
9+
qcom,board-id = <0x22 0>;
10+
};

kernel/dts/sdm845-comma-tizi.dts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/dts-v1/;
2+
3+
#include "sdm845-comma-common.dtsi"
4+
5+
/ {
6+
model = "comma.ai tizi";
7+
compatible = "comma,tizi", "qcom,sdm845";
8+
qcom,msm-id = <341 0x20001>, <321 0x20001>, <321 0x20000>, <348 0x20001>;
9+
qcom,board-id = <0x21 0>;
10+
};

kernel/patches/0001-Add-mici-dts-entry-in-makefile.patch renamed to kernel/patches/0001-Add-comma-dts-entry-in-makefile.patch

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 028e4f587364d096fbbd25b48c22cad71d0c3880 Mon Sep 17 00:00:00 2001
22
From: Robin Reckmann <robin.reckmann@gmail.com>
33
Date: Sat, 14 Mar 2026 18:53:20 +0900
4-
Subject: [PATCH] Add mici dts entry in makefile
4+
Subject: [PATCH] Add comma dts entry in makefile
55

66
---
77
arch/arm64/boot/dts/qcom/Makefile | 1 +
@@ -11,11 +11,12 @@ diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefi
1111
index 296688f7c..5f05ce5a1 100644
1212
--- a/arch/arm64/boot/dts/qcom/Makefile
1313
+++ b/arch/arm64/boot/dts/qcom/Makefile
14-
@@ -240,6 +240,7 @@ dtb-$(CONFIG_ARCH_QCOM) += sdm632-motorola-ocean.dtb
14+
@@ -240,6 +240,8 @@ dtb-$(CONFIG_ARCH_QCOM) += sdm632-motorola-ocean.dtb
1515
dtb-$(CONFIG_ARCH_QCOM) += sdm636-sony-xperia-ganges-mermaid.dtb
1616
dtb-$(CONFIG_ARCH_QCOM) += sdm660-xiaomi-lavender.dtb
1717
dtb-$(CONFIG_ARCH_QCOM) += sdm670-google-sargo.dtb
18-
+dtb-$(CONFIG_ARCH_QCOM) += sdm845-mici.dtb
18+
+dtb-$(CONFIG_ARCH_QCOM) += sdm845-comma-mici.dtb
19+
+dtb-$(CONFIG_ARCH_QCOM) += sdm845-comma-tizi.dtb
1920
dtb-$(CONFIG_ARCH_QCOM) += sdm845-db845c.dtb
2021

2122
sdm845-db845c-navigation-mezzanine-dtbs := sdm845-db845c.dtb sdm845-db845c-navigation-mezzanine.dtbo

tools/build/build_kernel.sh

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ BOOT_IMG=./boot.img
1414
BASE_DEFCONFIG="defconfig"
1515
CONFIG_FRAGMENT="$DIR/kernel/configs/vamos.config"
1616

17-
DTS_FILE="$DIR/kernel/dts/sdm845-mici.dts"
18-
DTB="qcom/$(basename "${DTS_FILE%.dts}.dtb")"
17+
COMMON_DTSI="$DIR/kernel/dts/sdm845-comma-common.dtsi"
18+
DTS_FILES=(
19+
"$DIR/kernel/dts/sdm845-comma-mici.dts"
20+
"$DIR/kernel/dts/sdm845-comma-tizi.dts"
21+
)
1922

2023
# Check submodule initted, need to run setup
2124
if [ ! -f "$KERNEL_DIR/Makefile" ]; then
@@ -90,19 +93,29 @@ build_kernel() {
9093
echo "CONFIG_EXTRA_FIRMWARE_DIR=\"$DIR/kernel/firmware\"" >> out/.config
9194
make olddefconfig O=out
9295

96+
local dtb_targets=()
97+
local dts_name
98+
local IMAGE_GZ_DTB
99+
100+
for dts in "${DTS_FILES[@]}"; do
101+
dts_name="$(basename "$dts")"
102+
dtb_targets+=("qcom/${dts_name%.dts}.dtb")
103+
done
104+
93105
echo "-- Building kernel with $(nproc) cores --"
94-
make -j$(nproc) O=out Image.gz "$DTB"
106+
make -j$(nproc) O=out Image.gz "${dtb_targets[@]}"
95107

96108
# Assemble Image.gz-dtb
97109
mkdir -p "$TMP_DIR"
98-
DTB_PATH="out/arch/arm64/boot/dts/$DTB"
99-
if [ ! -f "$DTB_PATH" ]; then
100-
echo "ERROR: DTB not found at $DTB_PATH"
101-
find out/arch/arm64/boot/dts -name '*.dtb' 2>/dev/null | head -20
102-
exit 1
103-
fi
110+
IMAGE_GZ_DTB="$TMP_DIR/Image.gz-dtb"
111+
cp out/arch/arm64/boot/Image.gz "$IMAGE_GZ_DTB"
112+
113+
for dts in "${DTS_FILES[@]}"; do
114+
dts_name="$(basename "$dts")"
115+
dtb_path="out/arch/arm64/boot/dts/qcom/${dts_name%.dts}.dtb"
116+
cat "$dtb_path" >> "$IMAGE_GZ_DTB"
117+
done
104118

105-
cat out/arch/arm64/boot/Image.gz "$DTB_PATH" > "$TMP_DIR/Image.gz-dtb"
106119
cd "$TMP_DIR"
107120

108121
# Create boot.img
@@ -147,14 +160,40 @@ cleanup() {
147160
}
148161

149162
install_dts() {
150-
local dts_name dtb_name
163+
local dst_dir="$KERNEL_DIR/arch/arm64/boot/dts/qcom"
151164

152-
dts_name="$(basename "$DTS_FILE")"
153-
dtb_name="${dts_name%.dts}.dtb"
165+
echo "-- Installing DTS/DTSI files --"
154166

155-
echo "-- Installing DTS $dts_name --"
156-
cp "$DTS_FILE" "$KERNEL_DIR/arch/arm64/boot/dts/qcom/"
167+
cp "$COMMON_DTSI" "$dst_dir/"
168+
for dts in "${DTS_FILES[@]}"; do
169+
cp "$dts" "$dst_dir/"
170+
done
157171
}
158172

159173
# Run build inside container
160-
docker exec -u "$(id -u):$(id -g)" $CONTAINER_ID bash -c "set -e; export BASE_DEFCONFIG='$BASE_DEFCONFIG' CONFIG_FRAGMENT='$CONFIG_FRAGMENT' DTS_FILE='$DTS_FILE' DIR=$DIR TOOLS=$TOOLS KERNEL_DIR=$KERNEL_DIR PATCHES_DIR=$PATCHES_DIR TMP_DIR=$TMP_DIR OUT_DIR=$OUT_DIR BOOT_IMG=$BOOT_IMG DTB=$DTB; $(declare -f apply_patches build_kernel clean_kernel_tree install_dts); build_kernel"
174+
docker exec -i -u "$(id -u):$(id -g)" "$CONTAINER_ID" bash <<EOF
175+
set -e
176+
177+
BASE_DEFCONFIG='$BASE_DEFCONFIG'
178+
CONFIG_FRAGMENT='$CONFIG_FRAGMENT'
179+
COMMON_DTSI='$COMMON_DTSI'
180+
DIR='$DIR'
181+
TOOLS='$TOOLS'
182+
KERNEL_DIR='$KERNEL_DIR'
183+
PATCHES_DIR='$PATCHES_DIR'
184+
TMP_DIR='$TMP_DIR'
185+
OUT_DIR='$OUT_DIR'
186+
BOOT_IMG='$BOOT_IMG'
187+
188+
DTS_FILES=(
189+
'${DTS_FILES[0]}'
190+
'${DTS_FILES[1]}'
191+
)
192+
193+
$(declare -f apply_patches)
194+
$(declare -f build_kernel)
195+
$(declare -f clean_kernel_tree)
196+
$(declare -f install_dts)
197+
198+
build_kernel
199+
EOF

0 commit comments

Comments
 (0)