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

NanoPC-T6 missing sfc node in device tree #290

Closed
Joshua-Riek opened this issue Aug 1, 2023 · 3 comments
Closed

NanoPC-T6 missing sfc node in device tree #290

Joshua-Riek opened this issue Aug 1, 2023 · 3 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@Joshua-Riek
Copy link
Owner

Joshua-Riek commented Aug 1, 2023

The devnode /dev/mtdblock0 does not exist. The device tree is missing the sfc node.

@Joshua-Riek Joshua-Riek self-assigned this Aug 1, 2023
@Joshua-Riek Joshua-Riek added bug Something isn't working enhancement New feature or request labels Aug 1, 2023
@Joshua-Riek
Copy link
Owner Author

Here is a patch for the missing sfc node.

diff --git a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts
index 47a1030a4c73..5a62a440c243 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts
@@ -478,6 +478,37 @@ &pcie3x4 {
        status = "okay";
 };
 
+&sfc {
+       status = "okay";
+       max-freq = <50000000>;
+       #address-cells = <1>;
+       #size-cells = <0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&fspim1_pins>;
+
+       spi_flash: spi-flash@0 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "jedec,spi-nor";
+               reg = <0x0>;
+               spi-max-frequency = <50000000>;
+               spi-tx-bus-width = <1>;
+               spi-rx-bus-width = <4>;
+               status = "okay";
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       loader@0 {
+                               label = "loader";
+                               reg = <0x0 0x1000000>;
+                       };
+               };
+       };
+};
+
 &pinctrl {
        gpio-leds {
                sys_led_pin: sys-led-pin {
@@ -537,6 +568,25 @@ pcie_m2_1_pwren: pcie-m21-pwren {
                };
        };
 
+       fspi {
+               /omit-if-no-ref/
+               fspim1_pins: fspim1-pins {
+                       rockchip,pins =
+                               /* fspi_clk_m1 */
+                               <2 RK_PB3 2 &pcfg_pull_up_drv_level_2>,
+                               /* fspi_cs0n_m1 */
+                               <2 RK_PB4 2 &pcfg_pull_up_drv_level_2>,
+                               /* fspi_d0_m1 */
+                               <2 RK_PA6 2 &pcfg_pull_up_drv_level_2>,
+                               /* fspi_d1_m1 */
+                               <2 RK_PA7 2 &pcfg_pull_up_drv_level_2>,
+                               /* fspi_d2_m1 */
+                               <2 RK_PB0 2 &pcfg_pull_up_drv_level_2>,
+                               /* fspi_d3_m1 */
+                               <2 RK_PB1 2 &pcfg_pull_up_drv_level_2>;
+               };
+    };
+
        sdmmc {
                sd_s0_pwr: sd-s0-pwr {
                        rockchip,pins = <4 RK_PA5 RK_FUNC_GPIO &pcfg_pull_down>;

@Joshua-Riek
Copy link
Owner Author

This patch was confirmed working by @young-bob, see #223 (comment).

@young-bob
Copy link

Yes, I confirmed and succeeded on the v1.21 image.

The steps from the wiki are as below.

  1. Download the v1.21 NanoPC-T6 image and flash it to an SD Card.
https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v1.21/ubuntu-22.04.2-preinstalled-desktop-arm64-nanopc-t6.img.xz
  1. Boot from the SD Card.
  2. Update rk3588-nanopc-t6.dtb.
wget https://github.com/Joshua-Riek/ubuntu-rockchip/files/12152840/rk3588-nanopc-t6.zip
unzip rk3588-nanopc-t6.zip 
sudo cp rk3588-nanopc-t6.dtb /boot/firmware/dtbs/rk3588-nanopc-t6.dtb
sync
sudo reboot
  1. Write the bootloader to the SPI NOR flash.
sudo dd if=/lib/u-boot-friendlyelec-rk3588/rkspi_loader.img of=/dev/mtdblock0 conv=notrunc
sync
  1. Write the NanoPC-T6 image to NVMe
xz -dc ubuntu-22.04.2-preinstalled-desktop-arm64-nanopc-t6.img.xz | sudo dd of=/dev/nvme0n1 bs=4k
sync
  1. Remove the SD Card and reboot, the system will load from NVMe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants