Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nanopi-m6: add support for SPI flash boot #7652

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

efectn
Copy link
Member

@efectn efectn commented Jan 4, 2025

Description

This PR adds SPI Flash boot support to NanoPi M6. Also add some missing Uboot config properties which are necessary for M2 SSD boot.

  • Since eMMC and SPI Flash shares the same PINMUX, they can not be activated from devicetree at the same time. Enabling SPI node breaks eMMC when the MMC is attached. It is necessary to build two defconfigs/uboot to solve it.

Kernel PR: armbian/linux-rockchip#314

GitHub issue reference:
Jira reference number [AR-9999]

How Has This Been Tested?

  • Test SPI Flash + M2 boot
  • Test eMMC boot

Checklist:

Please delete options that are not relevant.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@efectn efectn requested a review from igorpecovnik as a code owner January 4, 2025 12:51
@github-actions github-actions bot added size/small PR with less then 50 lines Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Jan 4, 2025
@efectn efectn force-pushed the nanopi-m6-spi-flash-boot branch from 4c19387 to 88cfff5 Compare January 4, 2025 12:52
@efectn efectn changed the title rockchip64-edge: bump to 6.13 nanopi-m6: add support for SPI flash boot Jan 4, 2025
@github-actions github-actions bot added size/large PR with 250 lines or more and removed size/small PR with less then 50 lines labels Jan 4, 2025
@efectn efectn marked this pull request as draft January 4, 2025 17:55
@rpardini
Copy link
Member

rpardini commented Jan 4, 2025

diff --git a/config/boards/nanopi-m6.conf b/config/boards/nanopi-m6.conf
index 0589dccd0a..2c0fd87fa4 100644
--- a/config/boards/nanopi-m6.conf
+++ b/config/boards/nanopi-m6.conf
@@ -12,10 +12,12 @@ BOOT_FDT_FILE="rockchip/rk3588s-nanopi-m6.dtb"
 BOOT_SCENARIO="spl-blobs"

 DEFAULT_OVERLAYS="nanopi-m6-display-dsi1-yx35" # Enable YX35 LCD
+BOOT_SUPPORT_SPI="yes"
+BOOT_SPI_RKSPI_LOADER="yes"

 function post_family_config__nanopi_m6_support_spi_boot() {
        UBOOT_TARGET_MAP="nanopi-m6-rk3588s_defconfig BL31=$RKBIN_DIR/$BL31_BLOB spl/u-boot-spl.bin u-boot.dtb u-boot.itb;;idbloader.img u-boot.itb
-nanopi-m6-spi-rk3588s_defconfig BL31=$RKBIN_DIR/$BL31_BLOB;; rkspi_loader.img"
+    nanopi-m6-spi-rk3588s_defconfig BL31=$RKBIN_DIR/$BL31_BLOB spl/u-boot-spl.bin u-boot.dtb u-boot.itb;;rkspi_loader.img"
 }

Add support for both eMMC/SPI boot
@efectn efectn force-pushed the nanopi-m6-spi-flash-boot branch from c4ce534 to bd65e84 Compare January 6, 2025 19:08
@efectn
Copy link
Member Author

efectn commented Jan 6, 2025

diff --git a/config/boards/nanopi-m6.conf b/config/boards/nanopi-m6.conf
index 0589dccd0a..2c0fd87fa4 100644
--- a/config/boards/nanopi-m6.conf
+++ b/config/boards/nanopi-m6.conf
@@ -12,10 +12,12 @@ BOOT_FDT_FILE="rockchip/rk3588s-nanopi-m6.dtb"
 BOOT_SCENARIO="spl-blobs"

 DEFAULT_OVERLAYS="nanopi-m6-display-dsi1-yx35" # Enable YX35 LCD
+BOOT_SUPPORT_SPI="yes"
+BOOT_SPI_RKSPI_LOADER="yes"

 function post_family_config__nanopi_m6_support_spi_boot() {
        UBOOT_TARGET_MAP="nanopi-m6-rk3588s_defconfig BL31=$RKBIN_DIR/$BL31_BLOB spl/u-boot-spl.bin u-boot.dtb u-boot.itb;;idbloader.img u-boot.itb
-nanopi-m6-spi-rk3588s_defconfig BL31=$RKBIN_DIR/$BL31_BLOB;; rkspi_loader.img"
+    nanopi-m6-spi-rk3588s_defconfig BL31=$RKBIN_DIR/$BL31_BLOB spl/u-boot-spl.bin u-boot.dtb u-boot.itb;;rkspi_loader.img"
 }

Thanks Ricardo, everything is OK now!

@efectn efectn marked this pull request as ready for review January 6, 2025 19:18
@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge 02 Milestone: First quarter release labels Jan 7, 2025
@igorpecovnik igorpecovnik merged commit b73c6e4 into armbian:main Jan 7, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
02 Milestone: First quarter release Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/large PR with 250 lines or more
Development

Successfully merging this pull request may close these issues.

3 participants