How to set different vendor nor flash in u-boot device tree

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set different vendor nor flash in u-boot device tree

1,637 Views
tzongruey
Contributor I

Hi,

We use Macronix and Winbond NOR flash to our LS1088ardb board.
Therefore, we add Macronix and Winbond ids in spi-nor-ids.c
The following code is we added in u-boot spi-nor-ids.c

#ifdef CONFIG_SPI_FLASH_MACRONIX
....

{ INFO("mx25u51245g", 0xc2253a, 0, 64 * 1024, 1024, SECT_4K | SPI_NOR_4B_OPCODES) },

......
#endif

#ifdef CONFIG_SPI_FLASH_WINBOND
......
{
INFO("w25q512nwq", 0xef6020, 0, 64 * 1024, 1024,
SECT_4K | SPI_NOR_4B_OPCODES)
},
......
#endif

If we use Macronix nor flash, we set u-boot fsl-ls 1088a-rdb.dts qspi part as the follow.

qflash0: mx25u51245g0@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "macronix,mx25u51245g";
spi-max-frequency = <50000000>;
reg = <0>;
};


When we change to use Winbond nor flash, we change u-boot fsl-ls 1088a-rdb.dts qspi part as the follow.

qflash0: w25q512nw@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "winbond,w25q512";
spi-max-frequency = <50000000>;
reg = <0>;
};


We want to support both of these NOR flashes.
We are confused about that if we want the u-boot to support both NOR flashes.
How to set the u-boot fsl-ls 1088a-rdb.dts qspi part?

Thanks

 

0 Kudos
Reply
2 Replies

1,617 Views
LFGP
NXP TechSupport
NXP TechSupport

We don't have anything like that from our side, but it seems possible to do, see below:

First of all, You should find unused memory regions in the LS1088 physical address space for each NOR flash and modify the device_tree, qspi part for each one NOR_Flash.

There isn't any mechanism that you can use inside device_tree to decide what NOR flash will use the system in the boot process;  So, you need to set the "environment variable" setenv and use the command bootargs to specify which one NOR_flash to use, in U-boot of corse.
It is something like the below:
Uboot > setenv bootargs root=/dev/ram rw initrd=0x21100000,6000000 ramdisk_size=15360 console=ttyS0,115200 mem=32M
Uboot > saveenv
You will need to do that every time you want to switch between NOR flash.

I hope that helps you.

0 Kudos
Reply

1,614 Views
tzongruey
Contributor I

Hi,

Our boards are currently changed to boot from NOR flash.
Each of our boards only has one NOR flash.
Our boards may use two types of NORs, Macronix mx25u51245g or Winbond w25q512nwq for factory manufacture.
So I would like to know if there is a way that qflash@0 can support both types of NOR at the same address in the device tree
But our boards have been changed to boot from NOR flash, I think it couldn't decide what NOR flash will use the system in the u-boot environment variable
It means the board should recognize which type of NOR flash is used when booting up.

Thanks

0 Kudos
Reply