Skip to content

Commit 94bfd67

Browse files
authored
Create main.yml
1 parent 77ca174 commit 94bfd67

1 file changed

Lines changed: 110 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: 编译读书郎G60(sun50iw1p1)dtb
2+
3+
# 触发条件:推送代码到master分支(或手动触发)
4+
on:
5+
push:
6+
branches: [ master ]
7+
paths: [ "linux/kernel/arch/arm64/boot/dts/**" ] # 仅当dts目录变更时触发
8+
workflow_dispatch: # 允许手动触发
9+
10+
jobs:
11+
compile-dtb:
12+
runs-on: ubuntu-latest # 使用Ubuntu环境
13+
steps:
14+
# 步骤1:检出仓库代码
15+
- name: 检出SoCXin/A64仓库
16+
uses: actions/checkout@v4
17+
18+
# 步骤2:安装编译依赖(device-tree-compiler)
19+
- name: 安装dtc工具
20+
run: sudo apt-get update && sudo apt-get install -y device-tree-compiler
21+
22+
# 步骤3:添加读书郎G60的适配配置到sun50iw1p1.dtsi
23+
- name: 注入G60硬件配置
24+
run: |
25+
# 进入dts目录
26+
cd linux/kernel/arch/arm64/boot/dts
27+
# 向sun50iw1p1.dtsi追加屏幕、存储、触控配置(对应之前的适配代码)
28+
cat >> sun50iw1p1.dtsi << 'EOF'
29+
30+
/* 读书郎G60 - 屏幕配置(800x1280) */
31+
&display {
32+
compatible = "allwinner,sun50iw1p1-display";
33+
status = "okay";
34+
display-timings {
35+
native-mode = <&timing0>;
36+
timing0: timing0 {
37+
clock-frequency = <50000000>;
38+
hactive = <800>;
39+
vactive = <1280>;
40+
hfront-porch = <20>;
41+
hback-porch = <20>;
42+
hsync-len = <10>;
43+
vfront-porch = <10>;
44+
vback-porch = <10>;
45+
vsync-len = <5>;
46+
hsync-active = <0>;
47+
vsync-active = <0>;
48+
de-active = <1>;
49+
pixelclk-active = <0>;
50+
};
51+
};
52+
};
53+
54+
&lcd0 {
55+
status = "okay";
56+
lcd_used = <1>;
57+
lcd_driver_name = "default_lcd";
58+
lcd_if = <0>;
59+
lcd_width = <800>;
60+
lcd_height = <1280>;
61+
lcd_dclk_freq = <50>;
62+
lcd_pwm_used = <1>;
63+
lcd_pwm_ch = <0>;
64+
lcd_pwm_freq = <1000>;
65+
lcd_pwm_pol = <1>;
66+
};
67+
68+
/* 读书郎G60 - 存储分区配置 */
69+
&mmc0 {
70+
status = "okay";
71+
bus-width = <8>;
72+
cap-mmc-highspeed;
73+
mmc-hs200-1_8v;
74+
max-frequency = <150000000>;
75+
non-removable;
76+
partition@0 { label = "bootloader"; reg = <0x0 0x400000>; };
77+
partition@400000 { label = "env"; reg = <0x400000 0x100000>; };
78+
partition@500000 { label = "boot"; reg = <0x500000 0x800000>; };
79+
partition@d00000 { label = "system"; reg = <0xd00000 0x40000000>; };
80+
partition@40d00000 { label = "data"; reg = <0x40d00000 0x7f300000>; };
81+
};
82+
83+
/* 读书郎G60 - 触控配置(GT911) */
84+
&i2c0 {
85+
status = "okay";
86+
clock-frequency = <400000>;
87+
gt911@14 {
88+
compatible = "goodix,gt911";
89+
reg = <0x14>;
90+
interrupt-parent = <&pio>;
91+
interrupts = <4 10 IRQ_TYPE_EDGE_FALLING>;
92+
reset-gpios = <&pio 4 9 GPIO_ACTIVE_LOW>;
93+
touchscreen-size-x = <800>;
94+
touchscreen-size-y = <1280>;
95+
};
96+
};
97+
EOF
98+
99+
# 步骤4:编译dtb文件
100+
- name: 编译sun50iw1p1.dtsi为G60 dtb
101+
run: |
102+
cd linux/kernel/arch/arm64/boot/dts
103+
dtc -I dts -O dtb -o g60-readboy.dtb sun50iw1p1.dtsi
104+
105+
# 步骤5:上传编译好的dtb作为Artifact
106+
- name: 上传G60 dtb文件
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: g60-readboy-dtb
110+
path: linux/kernel/arch/arm64/boot/dts/g60-readboy.dtb

0 commit comments

Comments
 (0)