[BPI-R3] Identify / Verify NOR, NAND, eMMC & SD Devices


In order to restore the installation in NOR I messed up when trying to update OpenWRT, I want to verify which the path to each device. I want to mount NOR when I booted from NAND and attempt to restore NOR by copying over the “backup” installation. So far I found in the wiki but could not find more details:

NOR: ???
NAND: /dev/mtdblock0
eMMC: /dev/mmcblk0boot0
eMMC Boot Partition: /dev/mmcblk0


Thanks Mike

Nand/nor are connected via same spi-bus like sd/emmc are accessable via 1 mmc-controller. I have a uboot-way to determine which device is connected each and load the right ftd overlay if this helps.

you cannot mount nor when booted from nand…either nand or nor is accessable on spi (same for sd/emmc) and they will get same device-number if the fdt is loaded correctly

Use the spi-tools package? Did you check dmesg ?

lsblk and check the size? Nand and nor are different size I believe.

lsblk isn’t available on the vanilla OpenWRT Snapshoot for BPI-R3 it seems. I have seen the spi-tools but couldn’t find anything specific detailing out it capabilities. Just have seen the spi-tools being used once in the plethora of posts, wikis and tutorials out there. Going to check the spi-tools out if I fail to utilize @frank-w tremendous supporting comments.

Also OpenWrt uses probing within U-Boot to communicate the position of switch C and D to OpenWrt/Linux (by selecting the appropriate device tree overlay).

While in theory it would be possible to have both, NAND and NOR connected in a usable way at the same time on the same bus (using SPI chip-select lines), this is not how it works on the BPi-R3.

If switch C is in position 1 for NAND, you won’t be able to access NOR at all.

If switch C is in position 0 for NOR, you won’t be able to access NAND at all.

This is because both devices use the same chip-select line, and sadly instead of having two chip-select lines (CS0 and CS1) and using the dip switch C to swap CS0 and CS1, the dip switch directly selects which of the two is connected to CS0 (and there is no CS1 at all). So this was a decision of the board designers, supposedly to not waste an additional SoC pin for CS1 and in order not to need another multiplexer IC for swapping CS0 and CS1.

A similar situation applies for eMMC vs. microSD, also here you can only use one of them at the time, this time a multiplexer IC is used, but it switches the first 4 data lines to be connected either to microSD or to the eMMC.

To also answer your question, applying the restrictions explained above, the Linux device names of each storage chip are:

eMMC /dev/mmcblk0, /dev/mmcblk0p*, /dev/mmcblk0boot0, /dev/mmcblk0boo1 and /dev/mmcblk0rpmb

microSD /dev/mmcblk0, /dev/mmcblk0p*

NOR /dev/mtd*, /dev/mtdblock*

NAND /dev/mtd*, /dev/mtdblock*, /dev/ubi?_?, /dev/ubiblock?_?

1 Like