Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions board/adi/ev-sc598-som/nand.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Micron 8Gb (1GB) SPI NAND flash
# Model: MT29F8G01ADAFD12-AAT:F
# Datasheet: https://www.micron.com/content/dam/micron/global/secure/products/data-sheet/nand-flash/70-series/m70a-4-8gb-nand-spi-auto.pdf
# Label: U4
flash nand-1G {
pebsize = 256K
numpebs = 4096
minimum-io-unit-size = 4096
sub-page-size = 4096
vid-header-offset = 4096
}

image nand.img {
flash {}
flashtype = "nand-1G"

partition u-boot-spl {
image = "u-boot-spl.ldr"
size = 256K
}

partition u-boot {
image = "u-boot.ldr"
size = 768K
}

partition dtb {
image = "sc598-som-nand.dtb"
size = 256K
}

partition kernel {
image = "Image"
size = 32M
}

partition rootfs {
image = "rootfs.ubi"
}
}
89 changes: 89 additions & 0 deletions board/adi/ev-sc598-som/patches/linux/dts/adi/sc598-som-nand.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2026 Analog Devices Incorporated
*/

/dts-v1/;

#include "sc598-som-revE.dtsi"

/ {
model = "ADI SC598-SOM with NAND";
compatible = "adi,sc598-som-nand", "adi,sc59x-64";
};

/*
* Clock configuration for faster SPI NAND performance.
*
* Default SPI clock sources (sclk0_0, oclk_0) are both 62.5 MHz, limiting
* SPI speed. Reconfigure oclk_0 to 250 MHz instead of using sclk0_0
* because sclk0_0 is shared by UARTs, I2C, timers, watchdog, and Ethernet.
*
* CGU0_ODIV: 1000 MHz / 4 = 250 MHz (was / 16 = 62.5 MHz)
* SPI_SEL: Use oclk_0 as SPI parent
* EMMC_SEL: Switch eMMC to dclk_0_half (eMMC defaults to oclk_0, which
* would break it at 250 MHz - "Internal clock never stabilised")
*
* time nanddump /dev/mtd4 -l 1048576 -f /dev/null
* ~21 MHz (original): 0.24s (~4.4 MB/s)
* 62.5 MHz: 0.20s (~5.2 MB/s)
* 83.3 MHz: 0.19s (~5.5 MB/s)
* 125 MHz: probe failed (ID reads 0xffffffff)
*/
&clk {
assigned-clocks = <&clk ADSP_SC598_CLK_CGU0_ODIV>, <&clk ADSP_SC598_CLK_SPI_SEL>, <&clk ADSP_SC598_CLK_EMMC_SEL>;
assigned-clock-rates = <250000000>, <0>, <0>;
assigned-clock-parents = <0>, <&clk ADSP_SC598_CLK_CGU0_OCLK>, <&clk ADSP_SC598_CLK_DCLK0_HALF>;
};

&mmc0 {
status = "disabled";
};

&spi2 {
/delete-node/ is25lp01g@0;

som_flash: spi-nand@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "micron,mt29f1g01abafd", "spi-nand";
reg = <0>;
spi-max-frequency = <83000000>;
spi-rx-bus-width = <4>;
spi-tx-bus-width = <4>;
nand-ecc-mode = "on-die";
nand-ecc-strength = <1>;
nand-ecc-step-size = <512>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
label = "u-boot-spl";
reg = <0x0 0x40000>;
};

partition@40000 {
label = "u-boot";
reg = <0x40000 0xC0000>;
};

partition@100000 {
label = "dtb";
reg = <0x100000 0x40000>;
};

partition@140000 {
label = "kernel";
reg = <0x140000 0x2000000>;
};

partition@2140000 {
label = "rootfs";
reg = <0x2140000 0x3DEC0000>;
};
};
};
};
2 changes: 2 additions & 0 deletions board/adi/ev-sc598-som/patches/linux/nand.fragment
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_MTD_SPI_NAND=y
CONFIG_MTD_UBI=y
58 changes: 58 additions & 0 deletions board/adi/ev-sc598-som/patches/uboot/dts/sc598-som-nand.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2026 Analog Devices Incorporated
*/

/dts-v1/;

#include "sc598-som-revE.dtsi"

/ {
model = "ADI SC598-SOM with NAND";
compatible = "adi,sc598-som-nand", "adi,sc59x-64";
};

&spi2 {
/delete-node/ is25lp01g@1;

som_flash: spi-nand@1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spi-nand";
reg = <1>;
spi-max-frequency = <25000000>;
spi-rx-bus-width = <4>;
spi-tx-bus-width = <4>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
label = "u-boot-spl";
reg = <0x0 0x40000>;
};

partition@40000 {
label = "u-boot";
reg = <0x40000 0xC0000>;
};

partition@100000 {
label = "dtb";
reg = <0x100000 0x40000>;
};

partition@140000 {
label = "kernel";
reg = <0x140000 0x2000000>;
};

partition@2140000 {
label = "rootfs";
reg = <0x2140000 0x3DEC0000>;
};
};
};
};
4 changes: 4 additions & 0 deletions board/adi/ev-sc598-som/patches/uboot/nand.fragment
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CONFIG_DEFAULT_DEVICE_TREE="sc598-som-nand"
CONFIG_DM_MTD=y
CONFIG_MTD_SPI_NAND=y
CONFIG_SUPPORT_RAW_INITRD=y
9 changes: 9 additions & 0 deletions configs/adi_sc598_nand.fragment
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
BR2_LINUX_KERNEL_INTREE_DTS_NAME="adi/sc598-som-nand"
BR2_LINUX_KERNEL_CUSTOM_DTS_DIR="$(BR2_EXTERNAL)/board/adi/ev-sc598-som/patches/linux/dts/"
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL)/board/adi/ev-sc598-som/patches/linux/nand.fragment"
BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="$(BR2_EXTERNAL)/board/adi/ev-sc598-som/patches/uboot/dts/sc598-som-nand.dts"
BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL)/board/adi/ev-sc598-som/patches/uboot/nand.fragment"
BR2_ROOTFS_POST_IMAGE_SCRIPT_ARGS="-c $(BR2_EXTERNAL)/board/adi/ev-sc598-som/nand.cfg"
# BR2_TARGET_ROOTFS_EXT2 is not set
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_CPIO_GZIP=y
Loading