rk3568 norflash+pcei nvme 设置
1,添加parameter_nor.txt文件
device/rockchip/rk356x/rk3568_xx/parameter_nor.txt
- FIRMWARE_VER: 12.0
- MACHINE_MODEL: rk3568_s_aio
- MACHINE_ID: 007
- MANUFACTURER: rockchip
- MAGIC: 0x5041524B
- ATAG: 0x00200800
- MACHINE: rk3568_s_aio
- CHECK_MASK: 0x80
- PWR_HLD: 0,0,A,0,1
- TYPE: GPT
- CMDLINE:mtdparts=rk29xxnand:0x00002800@0x00004000(uboot)
复制代码 2 修改编译规则
- 在这里插入代码片diff --git a/code/RKTools/linux/Linux_Pack_Firmware/rockdev/mkupdate.sh b/code/RKTools/linux/Linux_Pack_Firmware/rockdev/mkupdate.sh
- index 0e00949f39e..7270b527312 100755
- --- a/code/RKTools/linux/Linux_Pack_Firmware/rockdev/mkupdate.sh
- +++ b/code/RKTools/linux/Linux_Pack_Firmware/rockdev/mkupdate.sh
- @@ -43,5 +43,33 @@ fi
- echo "start to make update.img..."
- ./afptool -pack ./ $IMAGE_PATH/update.img $PACKAGE_FILE || pause
- ./rkImageMaker ${vendor_id_map[$PLATFORM]} $IMAGE_PATH/MiniLoaderAll.bin $IMAGE_PATH/update.img update.img -os_type:androidos || pause
- -echo "Making update.img OK."
- +
- +echo "start to make pcie update.img..."
- +
- + ./afptool -pack ./ $IMAGE_PATH/update.img $PACKAGE_FILE || pause
- +./rkImageMaker ${vendor_id_map[$PLATFORM]} $IMAGE_PATH/MiniLoaderAll.bin $IMAGE_PATH/update.img pcie_update.img -os_type:androidos -storage:pcie || pause
- +echo "Making $IMAGE_PATH/pcie_update.img OK."
- +
- +
- +echo "regenernate $PACKAGE_FILE..."
- +if [ -f "$PACKAGE_FILE" ]; then
- + rm -rf $PACKAGE_FILE
- +fi
- +cp $IMAGE_PATH/parameter.txt $IMAGE_PATH/parameter.txt.bak
- +cp $IMAGE_PATH/parameter_nor.txt $IMAGE_PATH/parameter.txt
- +
- +./gen-package-file.sh $IMAGE_PATH > $PACKAGE_FILE
- +
- +echo "start to make spinor update.img..."
- +
- +./afptool -pack ./ $IMAGE_PATH/update.img $PACKAGE_FILE || pause
- +./rkImageMaker ${vendor_id_map[$PLATFORM]} $IMAGE_PATH/MiniLoaderAll.bin $IMAGE_PATH/update.img spinor_update.img -os_type:androidos -storage:spinor || pause
- +echo "Making $IMAGE_PATH/spi_update.img OK."
- +
- +./rkImageMaker -merge ./update.img ./spinor_update.img ./pcie_update.img
- +
- +
- +mv $IMAGE_PATH/parameter.txt.bak $IMAGE_PATH/parameter.txt
- +
- +
- exit 0
- diff --git a/code/device/rockchip/common/build/rockchip/RebuildParameter.mk b/code/device/rockchip/common/build/rockchip/RebuildParameter.mk
- index acc11e0b470..3bff517d2bd 100644
- --- a/code/device/rockchip/common/build/rockchip/RebuildParameter.mk
- +++ b/code/device/rockchip/common/build/rockchip/RebuildParameter.mk
- @@ -5,7 +5,8 @@ $(info build parameter.txt with $(PRODUCT_PARAMETER_TEMPLATE)....)
- ifeq ($(strip $(BOARD_USES_AB_IMAGE)), true)
- partition_list := security:4M,uboot_a:4M,trust_a:4M,misc:4M
- else
- -partition_list := security:4M,uboot:4M,trust:4M,misc:4M
- +# partition_list := security:4M,uboot:5M,trust:4M,misc:4M
- +partition_list := security:4M,misc:4M
- endif # BOARD_USES_AB_IMAGE
-
- ifeq ($(strip $(BOARD_USES_AB_IMAGE)), true)
- diff --git a/code/device/rockchip/common/mkimage.sh b/code/device/rockchip/common/mkimage.sh
- index 69b733e0bbd..288c24564a2 100755
- --- a/code/device/rockchip/common/mkimage.sh
- +++ b/code/device/rockchip/common/mkimage.sh
- @@ -193,6 +193,7 @@ then
- else
- if [ -f $OUT/parameter.txt ]; then
- cp -a $OUT/parameter.txt $IMAGE_PATH/parameter.txt
- + cp -a ${TARGET_DEVICE_DIR}/parameter_nor.txt $IMAGE_PATH/parameter_nor.txt
- else
- echo "$PARAMETER not fount!"
- fi
-
- diff --git a/code/mkimage.sh b/code/mkimage.sh
- index 69b733e0bbd..288c24564a2 100755
- --- a/code/mkimage.sh
- +++ b/code/mkimage.sh
- @@ -193,6 +193,7 @@ then
- else
- if [ -f $OUT/parameter.txt ]; then
- cp -a $OUT/parameter.txt $IMAGE_PATH/parameter.txt
- + cp -a ${TARGET_DEVICE_DIR}/parameter_nor.txt $IMAGE_PATH/parameter_nor.txt
- else
- echo "$PARAMETER not fount!"
- fi
-
复制代码 3 修改uboot
- diff --git a/code/u-boot/arch/arm/dts/rk3568-u-boot.dtsi b/code/u-boot/arch/arm/dts/rk3568-u-boot.dtsi
- index 3eb39374f05..134645c5f68 100644
- --- a/code/u-boot/arch/arm/dts/rk3568-u-boot.dtsi
- +++ b/code/u-boot/arch/arm/dts/rk3568-u-boot.dtsi
- @@ -15,7 +15,32 @@
-
- chosen {
- stdout-path = &uart2;
- - u-boot,spl-boot-order = &sdmmc0, &sdhci, &nandc0, &spi_nand, &spi_nor;
- + u-boot,spl-boot-order = &sdhci, &spi_nand, &spi_nor;
- + };
- +
- + dc_12v: dc-12v {
- + u-boot,dm-pre-reloc;
- + compatible = "regulator-fixed";
- + regulator-name = "dc_12v";
- + regulator-always-on;
- + regulator-boot-on;
- + regulator-min-microvolt = <12000000>;
- + regulator-max-microvolt = <12000000>;
- + };
- +
- + vcc3v3_pcie: gpio-regulator {
- + u-boot,dm-pre-reloc;
- + compatible = "regulator-fixed";
- + regulator-name = "vcc3v3_pcie";
- + regulator-min-microvolt = <3300000>;
- + regulator-max-microvolt = <3300000>;
- + regulator-always-on;
- + enable-active-high;
- + gpio = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; //跟进实际情况修改
- + startup-delay-us = <5000>;
- + vin-supply = <&dc_12v>;
- };
- };
-
- @@ -367,16 +392,24 @@
- u-boot,dm-pre-reloc;
- };
-
- +&pcie30_phy_grf {
- + u-boot,dm-pre-reloc;
- +};
- +
- &pcie30phy {
- u-boot,dm-pre-reloc;
- status = "okay";
- };
-
- &pcie3x2 {
- u-boot,dm-pre-reloc;
- + reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>; /跟进实际情况修改
- + vpcie3v3-supply = <&vcc3v3_pcie>;
- status = "okay";
- };
-
- +
- &pinctrl {
- u-boot,dm-pre-reloc;
- status = "okay";
- diff --git a/code/u-boot/configs/rk3568_defconfig b/code/u-boot/configs/rk3568_defconfig
- index fbd9820acc5..5b44113dd33 100644
- --- a/code/u-boot/configs/rk3568_defconfig
- +++ b/code/u-boot/configs/rk3568_defconfig
- @@ -220,3 +220,19 @@ CONFIG_RK_AVB_LIBAVB_USER=y
- CONFIG_OPTEE_CLIENT=y
- CONFIG_OPTEE_V2=y
- CONFIG_OPTEE_ALWAYS_USE_SECURITY_PARTITION=y
- +
- +CONFIG_ROCKCHIP_BOOTDEV="nvme 0"
- +CONFIG_EMBED_KERNEL_DTB_ALWAYS=y
- +CONFIG_SPL_FIT_IMAGE_KB=2560
- +# 改成实际使用的 dtb 把kernel编译的dtb拷贝到uboot/dts目录下
- +CONFIG_EMBED_KERNEL_DTB_PATH="dts/rk3568-aio-ddr4-v10.dtb"
- +CONFIG_NVME=y
- +CONFIG_CMD_NVME=y
- +CONFIG_CMD_PCI=y
- +CONFIG_PCI=y
- +CONFIG_DM_PCI=y
- +CONFIG_DM_PCI_COMPAT=y
- +CONFIG_PCIE_DW_ROCKCHIP=y
- +CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
- +CONFIG_PHY_ROCKCHIP_SNPS_PCIE3=y
- +CONFIG_DM_REGULATOR_FIXED=y
- \ No newline at end of file
复制代码 4 修改BoardConfig.mk
- diff --git a/code/device/rockchip/rk356x/BoardConfig.mk b/code/device/rockchip/rk356x/BoardConfig.mk
- index c035a7fe6cf..c30bf1c75f3 100755
- --- a/code/device/rockchip/rk356x/BoardConfig.mk
- +++ b/code/device/rockchip/rk356x/BoardConfig.mk
- @@ -24,7 +24,8 @@ PRODUCT_KERNEL_DTS ?= rk3568-evb1-ddr4-v10
-
- # BOARD_AVB_ENABLE := true
- # used for fstab_generator, sdmmc controller address
- -PRODUCT_BOOT_DEVICE := fe310000.sdhci,fe330000.nandc
- +# PRODUCT_BOOT_DEVICE := fe310000.sdhci,fe330000.nandc
- +PRODUCT_BOOT_DEVICE := 3c0800000.pcie
复制代码 5 修改kernel pcei设置
- @@ -91,12 +91,16 @@
- vcc3v3_pcie: gpio-regulator {
- compatible = "regulator-fixed";
- regulator-name = "vcc3v3_pcie";
- + pinctrl-names = "default";
- + pinctrl-0 = <&pcie3x2_en>;
- regulator-min-microvolt = <3300000>;
- regulator-max-microvolt = <3300000>;
- + regulator-always-on;
- enable-active-high;
- gpio = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>;
- startup-delay-us = <5000>;
- vcc3v3_bu: vcc3v3-bu {
- @@ -505,13 +509,15 @@
- };
- &pcie30phy {
- - status = "disabled";
- + status = "okay";
- };
- &pcie3x2 {
- reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>;
- vpcie3v3-supply = <&vcc3v3_pcie>;
- - status = "disabled";
- + // pinctrl-names = "default";
- + // pinctrl-0 = <&pcie30x2m1_pins>;
- + status = "okay";
- };
- &pinctrl {
- + pcie3x2{
- + pcie3x2_rst: pcie3x2-rst {
- + rockchip,pins = <2 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
- + };
- + pcie3x2_en: pcie3x2-en {
- + rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>;
- + };
- + };
- +
- cam {
- camera_pwr: camera-pwr {
- rockchip,pins =
复制代码 6 编译
- 第一次编译完kernel 拷贝出dtb到uboot/dts,在编译
- ./build.sh -AUCKu
复制代码 7 烧录
切换到Maskrom
全包烧录
注意烧录工具版本
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |