rk3568 norflash+pcei nvme 设置

打印 上一主题 下一主题

主题 651|帖子 651|积分 1953

rk3568 norflash+pcei nvme 设置

1,添加parameter_nor.txt文件

device/rockchip/rk356x/rk3568_xx/parameter_nor.txt
  1. FIRMWARE_VER: 12.0
  2. MACHINE_MODEL: rk3568_s_aio
  3. MACHINE_ID: 007
  4. MANUFACTURER: rockchip
  5. MAGIC: 0x5041524B
  6. ATAG: 0x00200800
  7. MACHINE: rk3568_s_aio
  8. CHECK_MASK: 0x80
  9. PWR_HLD: 0,0,A,0,1
  10. TYPE: GPT
  11. CMDLINE:mtdparts=rk29xxnand:0x00002800@0x00004000(uboot)
复制代码
2 修改编译规则

  1. 在这里插入代码片diff --git a/code/RKTools/linux/Linux_Pack_Firmware/rockdev/mkupdate.sh b/code/RKTools/linux/Linux_Pack_Firmware/rockdev/mkupdate.sh
  2. index 0e00949f39e..7270b527312 100755
  3. --- a/code/RKTools/linux/Linux_Pack_Firmware/rockdev/mkupdate.sh
  4. +++ b/code/RKTools/linux/Linux_Pack_Firmware/rockdev/mkupdate.sh
  5. @@ -43,5 +43,33 @@ fi
  6. echo "start to make update.img..."
  7. ./afptool -pack ./ $IMAGE_PATH/update.img $PACKAGE_FILE || pause
  8. ./rkImageMaker ${vendor_id_map[$PLATFORM]} $IMAGE_PATH/MiniLoaderAll.bin $IMAGE_PATH/update.img update.img -os_type:androidos || pause
  9. -echo "Making update.img OK."
  10. +
  11. +echo "start to make pcie update.img..."
  12. +
  13. + ./afptool -pack ./ $IMAGE_PATH/update.img $PACKAGE_FILE || pause
  14. +./rkImageMaker ${vendor_id_map[$PLATFORM]} $IMAGE_PATH/MiniLoaderAll.bin $IMAGE_PATH/update.img pcie_update.img -os_type:androidos -storage:pcie || pause
  15. +echo "Making $IMAGE_PATH/pcie_update.img OK."
  16. +
  17. +
  18. +echo "regenernate $PACKAGE_FILE..."
  19. +if [ -f "$PACKAGE_FILE" ]; then
  20. +    rm -rf $PACKAGE_FILE
  21. +fi
  22. +cp $IMAGE_PATH/parameter.txt $IMAGE_PATH/parameter.txt.bak
  23. +cp $IMAGE_PATH/parameter_nor.txt $IMAGE_PATH/parameter.txt
  24. +
  25. +./gen-package-file.sh $IMAGE_PATH > $PACKAGE_FILE
  26. +
  27. +echo "start to make spinor update.img..."
  28. +
  29. +./afptool -pack ./ $IMAGE_PATH/update.img $PACKAGE_FILE || pause
  30. +./rkImageMaker ${vendor_id_map[$PLATFORM]} $IMAGE_PATH/MiniLoaderAll.bin $IMAGE_PATH/update.img spinor_update.img -os_type:androidos -storage:spinor || pause
  31. +echo "Making $IMAGE_PATH/spi_update.img OK."
  32. +
  33. +./rkImageMaker -merge ./update.img ./spinor_update.img ./pcie_update.img
  34. +
  35. +
  36. +mv $IMAGE_PATH/parameter.txt.bak $IMAGE_PATH/parameter.txt
  37. +
  38. +
  39. exit 0
  40. diff --git a/code/device/rockchip/common/build/rockchip/RebuildParameter.mk b/code/device/rockchip/common/build/rockchip/RebuildParameter.mk
  41. index acc11e0b470..3bff517d2bd 100644
  42. --- a/code/device/rockchip/common/build/rockchip/RebuildParameter.mk
  43. +++ b/code/device/rockchip/common/build/rockchip/RebuildParameter.mk
  44. @@ -5,7 +5,8 @@ $(info build parameter.txt with $(PRODUCT_PARAMETER_TEMPLATE)....)
  45. ifeq ($(strip $(BOARD_USES_AB_IMAGE)), true)
  46. partition_list := security:4M,uboot_a:4M,trust_a:4M,misc:4M
  47. else
  48. -partition_list := security:4M,uboot:4M,trust:4M,misc:4M
  49. +# partition_list := security:4M,uboot:5M,trust:4M,misc:4M
  50. +partition_list := security:4M,misc:4M
  51. endif # BOARD_USES_AB_IMAGE
  52. ifeq ($(strip $(BOARD_USES_AB_IMAGE)), true)
  53. diff --git a/code/device/rockchip/common/mkimage.sh b/code/device/rockchip/common/mkimage.sh
  54. index 69b733e0bbd..288c24564a2 100755
  55. --- a/code/device/rockchip/common/mkimage.sh
  56. +++ b/code/device/rockchip/common/mkimage.sh
  57. @@ -193,6 +193,7 @@ then
  58. else
  59.      if [ -f $OUT/parameter.txt ]; then
  60.          cp -a $OUT/parameter.txt $IMAGE_PATH/parameter.txt
  61. +        cp -a ${TARGET_DEVICE_DIR}/parameter_nor.txt $IMAGE_PATH/parameter_nor.txt
  62.      else
  63.          echo "$PARAMETER not fount!"
  64.      fi
  65.      
  66. diff --git a/code/mkimage.sh b/code/mkimage.sh
  67. index 69b733e0bbd..288c24564a2 100755
  68. --- a/code/mkimage.sh
  69. +++ b/code/mkimage.sh
  70. @@ -193,6 +193,7 @@ then
  71. else
  72.      if [ -f $OUT/parameter.txt ]; then
  73.          cp -a $OUT/parameter.txt $IMAGE_PATH/parameter.txt
  74. +        cp -a ${TARGET_DEVICE_DIR}/parameter_nor.txt $IMAGE_PATH/parameter_nor.txt
  75.      else
  76.          echo "$PARAMETER not fount!"
  77.      fi
  78.    
复制代码
3 修改uboot

  1. diff --git a/code/u-boot/arch/arm/dts/rk3568-u-boot.dtsi b/code/u-boot/arch/arm/dts/rk3568-u-boot.dtsi
  2. index 3eb39374f05..134645c5f68 100644
  3. --- a/code/u-boot/arch/arm/dts/rk3568-u-boot.dtsi
  4. +++ b/code/u-boot/arch/arm/dts/rk3568-u-boot.dtsi
  5. @@ -15,7 +15,32 @@
  6.         chosen {
  7.                 stdout-path = &uart2;
  8. -                u-boot,spl-boot-order = &sdmmc0, &sdhci, &nandc0, &spi_nand, &spi_nor;
  9. +                u-boot,spl-boot-order = &sdhci, &spi_nand, &spi_nor;
  10. +        };
  11. +
  12. +        dc_12v: dc-12v {
  13. +                u-boot,dm-pre-reloc;
  14. +                compatible = "regulator-fixed";
  15. +                regulator-name = "dc_12v";
  16. +                regulator-always-on;
  17. +                regulator-boot-on;
  18. +                regulator-min-microvolt = <12000000>;
  19. +                regulator-max-microvolt = <12000000>;
  20. +        };
  21. +
  22. +        vcc3v3_pcie: gpio-regulator {
  23. +                u-boot,dm-pre-reloc;
  24. +                compatible = "regulator-fixed";
  25. +                regulator-name = "vcc3v3_pcie";
  26. +                regulator-min-microvolt = <3300000>;
  27. +                regulator-max-microvolt = <3300000>;
  28. +                regulator-always-on;
  29. +                enable-active-high;
  30. +                gpio = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; //跟进实际情况修改
  31. +                startup-delay-us = <5000>;
  32. +                vin-supply = <&dc_12v>;
  33.         };
  34. };
  35. @@ -367,16 +392,24 @@
  36.         u-boot,dm-pre-reloc;
  37. };
  38. +&pcie30_phy_grf {
  39. +    u-boot,dm-pre-reloc;
  40. +};
  41. +
  42. &pcie30phy {
  43.         u-boot,dm-pre-reloc;
  44.         status = "okay";
  45. };
  46. &pcie3x2 {
  47.         u-boot,dm-pre-reloc;
  48. +        reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>; /跟进实际情况修改
  49. +        vpcie3v3-supply = <&vcc3v3_pcie>;
  50.         status = "okay";
  51. };
  52. +
  53. &pinctrl {
  54.         u-boot,dm-pre-reloc;
  55.         status = "okay";
  56. diff --git a/code/u-boot/configs/rk3568_defconfig b/code/u-boot/configs/rk3568_defconfig
  57. index fbd9820acc5..5b44113dd33 100644
  58. --- a/code/u-boot/configs/rk3568_defconfig
  59. +++ b/code/u-boot/configs/rk3568_defconfig
  60. @@ -220,3 +220,19 @@ CONFIG_RK_AVB_LIBAVB_USER=y
  61. CONFIG_OPTEE_CLIENT=y
  62. CONFIG_OPTEE_V2=y
  63. CONFIG_OPTEE_ALWAYS_USE_SECURITY_PARTITION=y
  64. +
  65. +CONFIG_ROCKCHIP_BOOTDEV="nvme 0"
  66. +CONFIG_EMBED_KERNEL_DTB_ALWAYS=y
  67. +CONFIG_SPL_FIT_IMAGE_KB=2560
  68. +# 改成实际使用的 dtb 把kernel编译的dtb拷贝到uboot/dts目录下
  69. +CONFIG_EMBED_KERNEL_DTB_PATH="dts/rk3568-aio-ddr4-v10.dtb"
  70. +CONFIG_NVME=y
  71. +CONFIG_CMD_NVME=y
  72. +CONFIG_CMD_PCI=y
  73. +CONFIG_PCI=y
  74. +CONFIG_DM_PCI=y
  75. +CONFIG_DM_PCI_COMPAT=y
  76. +CONFIG_PCIE_DW_ROCKCHIP=y
  77. +CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
  78. +CONFIG_PHY_ROCKCHIP_SNPS_PCIE3=y
  79. +CONFIG_DM_REGULATOR_FIXED=y
  80. \ No newline at end of file
复制代码
4 修改BoardConfig.mk

  1. diff --git a/code/device/rockchip/rk356x/BoardConfig.mk b/code/device/rockchip/rk356x/BoardConfig.mk
  2. index c035a7fe6cf..c30bf1c75f3 100755
  3. --- a/code/device/rockchip/rk356x/BoardConfig.mk
  4. +++ b/code/device/rockchip/rk356x/BoardConfig.mk
  5. @@ -24,7 +24,8 @@ PRODUCT_KERNEL_DTS ?= rk3568-evb1-ddr4-v10
  6. # BOARD_AVB_ENABLE := true
  7. # used for fstab_generator, sdmmc controller address
  8. -PRODUCT_BOOT_DEVICE := fe310000.sdhci,fe330000.nandc
  9. +# PRODUCT_BOOT_DEVICE := fe310000.sdhci,fe330000.nandc
  10. +PRODUCT_BOOT_DEVICE := 3c0800000.pcie
复制代码
5 修改kernel pcei设置

  1. @@ -91,12 +91,16 @@
  2.         vcc3v3_pcie: gpio-regulator {
  3.                 compatible = "regulator-fixed";
  4.                 regulator-name = "vcc3v3_pcie";
  5. +               pinctrl-names = "default";
  6. +               pinctrl-0 = <&pcie3x2_en>;
  7.                 regulator-min-microvolt = <3300000>;
  8.                 regulator-max-microvolt = <3300000>;
  9. +               regulator-always-on;
  10.                 enable-active-high;
  11.                 gpio = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>;
  12.                 startup-delay-us = <5000>;
  13.         vcc3v3_bu: vcc3v3-bu {
  14. @@ -505,13 +509,15 @@
  15. };
  16. &pcie30phy {
  17. -       status = "disabled";
  18. +       status = "okay";
  19. };
  20. &pcie3x2 {
  21.         reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>;
  22.         vpcie3v3-supply = <&vcc3v3_pcie>;
  23. -       status = "disabled";
  24. +       // pinctrl-names = "default";
  25. +       // pinctrl-0 = <&pcie30x2m1_pins>;
  26. +       status = "okay";
  27. };
  28. &pinctrl {
  29. +       pcie3x2{
  30. +               pcie3x2_rst: pcie3x2-rst {
  31. +                       rockchip,pins = <2 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
  32. +               };
  33. +               pcie3x2_en: pcie3x2-en {
  34. +                       rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>;
  35. +               };
  36. +       };
  37. +
  38.         cam {
  39.                 camera_pwr: camera-pwr {
  40.                         rockchip,pins =
复制代码
6 编译

  1. 第一次编译完kernel 拷贝出dtb到uboot/dts,在编译
  2. ./build.sh -AUCKu
复制代码
7 烧录

切换到Maskrom

全包烧录
注意烧录工具版本


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

水军大提督

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表