文章目录
新建一个板级配置文件
我的目标
通过./build.sh lunch
来选择我的板子配置。
在目录sdk/project/cfg
目录下新建一个xxxx.mk
文件,文件名字格式如下:
bash
BoardConfig-"启动介质"-"电源方案"-"硬件版本"-"应用场景".mk
bash
----------------------------------------------------------------
0. BoardConfig_IPC/BoardConfig-EMMC-NONE-RV1103_Luckfox_Pico-IPC.mk
boot medium(启动介质): EMMC
power solution(电源方案): NONE
hardware version(硬件版本): RV1103_Luckfox_Pico
applicaton(应用场景): IPC
----------------------------------------------------------------
----------------------------------------------------------------
1. BoardConfig_IPC/BoardConfig-SPI_NAND-NONE-RV1103_Luckfox_Pico_Plus-IPC.mk
boot medium(启动介质): SPI_NAND
power solution(电源方案): NONE
hardware version(硬件版本): RV1103_Luckfox_Pico_Plus
applicaton(应用场景): IPC
----------------------------------------------------------------
BoardConfig-EMMC-NONE-RV1103_Luckfox_Pico-IPC.mk
BoardConfig-SPI_NAND-NONE-RV1103_Luckfox_Pico_Plus-IPC.mk
-
作为大区分
_
作为字符串内部的区分
而我的目标是,在板子RV1103_Luckfox_Pico
的基础上加入了,sd卡、sdio-wifi卡和spi-nand Flash,故我取了一个名字
BoardConfig-SPI_NAND-NONE-RV1103_Luckfox_Pico_Pro-SD_WIFI_IPC.mk
脚本解析出来是:
bash
----------------------------------------------------------------
2. BoardConfig_IPC/BoardConfig-SPI_NAND-NONE-RV1103_Luckfox_Pico_Pro-SD_WIFI_IPC.mk
boot medium(启动介质): SPI_NAND
power solution(电源方案): NONE
hardware version(硬件版本): RV1103_Luckfox_Pico_Pro
applicaton(应用场景): SD_WIFI_IPC
----------------------------------------------------------------
它的主要内容
bash
#!/bin/bash
# Target arch
export RK_ARCH=arm
# Target CHIP
export RK_CHIP=rv1106
# Target Toolchain Cross Compile
export RK_TOOLCHAIN_CROSS=arm-rockchip830-linux-uclibcgnueabihf
# Target boot medium: emmc/spi_nor/spi_nand
export RK_BOOT_MEDIUM=spi_nand
# Uboot defconfig
export RK_UBOOT_DEFCONFIG=rv1106_defconfig
# Uboot defconfig fragment
export RK_UBOOT_DEFCONFIG_FRAGMENT=rk-sfc.config
# Kernel defconfig
export RK_KERNEL_DEFCONFIG=luckfox_sd_wifi_rv1106_linux_defconfig
# Kernel dts
export RK_KERNEL_DTS=rv1103g-luckfox-pico-pro.dts
...
plus板设备树的继承关系:
rv1103.dtsi rv1103g-luckfox-pico-plus.dts rv1106-evb.dtsi rv1103-luckfox-pico-plus-ipc.dtsi rv1106.dtsi rv1106-amp.dtsi rv1106-amp.dtsi dt-bindings/input/input.h
我的板设备树的继承关系:
rv1103.dtsi rv1103g-luckfox-pico-pro.dts rv1106-evb.dtsi rv1103-luckfox-pico-pro-ipc.dtsi rv1106.dtsi rv1106-amp.dtsi rv1106-amp.dtsi dt-bindings/input/input.h
rv1103g-luckfox-pico-pro.dts相对于rv1103g-luckfox-pico-plus.dts的主要修改:
c
/**********spi nand flash**********/
&sfc {
status = "okay";
flash@0 {
compatible = "spi-nand";
reg = <0>;
spi-max-frequency = <75000000>;
spi-rx-bus-width = <4>;
spi-tx-bus-width = <1>;
};
};
/**********mmc interface for sd card**********/
&sdmmc {
max-frequency = <50000000>;
no-sdio;
no-mmc;
bus-width = <4>;
cap-mmc-highspeed;
cap-sd-highspeed;
disable-wp;
pinctrl-names = "default";
pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_det &sdmmc0_bus4>;
status = "okay";
};
/***********mmc interface for wifi**********/
&emmc {
max-frequency = <50000000>;
no-sdio;
no-mmc;
bus-width = <4>;
cap-mmc-highspeed;
cap-sd-highspeed;
disable-wp;
pinctrl-names = "default";
pinctrl-0 = <&sdmmc1_clk &sdmmc1_cmd &sdmmc1_det &sdmmc1_bus4>;
status = "okay";
};
/**********ETH**********/
//&gmac {
// status = "okay";
//};