获取源代码
见《lichee nano 荔枝派入门——搭建环境》
个人建议使用如下命令克隆内核代码:
# 下载默认带480*272LCD的版本
git clone --depth=1 -b f1c100s-480272lcd-test https://github.com/Icenowy/linux.git
## 或者下载不带LCD驱动的版本
git clone --depth=1 -b f1c100s https://github.com/Icenowy/linux.git
切换分支
如果是使用下列命令直接克隆整个仓库:
git clone https://github.com/Icenowy/linux.git
则在下载完代码之后,需要进入内核目录,使用如下命令将分支切换到f1c100s-480272lcd-test或者f1c100s
# 切换到 f1c100s-480272lcd-test
git checkout -f f1c100s-480272lcd-test
# 或者切换到f1c100s
git checkout -f f1c100s
linux内核修改
dts文件
修改内核源码目录下的 ./arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dts
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins_a>;
status = "okay";
spi-max-frequency = <50000000>;
flash: xt25f128b@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "winbond,xt25f128b", "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <50000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x100000>;
read-only;
};
partition@100000 {
label = "dtb";
reg = <0x100000 0x10000>;
read-only;
};
partition@110000 {
label = "kernel";
reg = <0x110000 0x400000>;
read-only;
}