u-boot hangs when attaching an mtd to ubi using spinor flash

Discussion around AT91RM9200 and SAM9 Series Products.

Moderator: nferre

davisroman
Posts: 3
Joined: Sun Dec 04, 2016 4:38 am

u-boot hangs when attaching an mtd to ubi using spinor flash

Fri Jan 20, 2017 4:58 am

Hello,

I'm seeing unusual behavior when u-boot attempts to attach an mtd partition to a ubi device using a spi-nor flash (MX25L51245G).

When the mtd partition size is set to less than 15MiB, the attach works, however when the mtd partition size is increased to 16MB or
greater, u-boot displays the message"ubi0: attaching mtd1" and hangs indefinately.

I've searched online but I have yet to find anything that might shed some light on this issue.

Here are the steps to reproduce:

Code: Select all

$ git clone https://github.com/linux4sam/u-boot-at91.git -b u-boot-2016.03-at91
$ cd u-boot-at91/
Patch the following config file: configs/at91sam9x5ek_spiflash_defconfig

Code: Select all

--- configs/at91sam9x5ek_spiflash_defconfig	2017-01-20 15:44:01.000000000 -0500
+++ configs/at91sam9x5ek_spiflash_defconfig	2017-01-20 16:00:56.023206653 -0500
@@ -1,7 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_TARGET_AT91SAM9X5EK=y
-CONFIG_SPL=y
 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9X5,SYS_USE_SPIFLASH"
 CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_IMI is not set
@@ -10,4 +9,8 @@ CONFIG_SYS_PROMPT="U-Boot> "
 # CONFIG_CMD_FPGA is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_SPI_FLASH=y
-CONFIG_SPI_FLASH_ATMEL=y
+CONFIG_SPI_FLASH_ABOVE_16MB=y
+CONFIG_SPI_FLASH_4B_OPCODES=y
+CONFIG_SPI_FLASH_MACRONIX=y
+# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
+CONFIG_SPI_FLASH_MTD=y

Code: Select all

$ make at91sam9x5ek_spiflash_defconfig
$ make
Copy u-boot.bin onto the board

1) The following is the case where the rootfs mtd partition attaches successfully and it's value is set to 15MB

Code: Select all

U-Boot> setenv mtdparts 'mtdparts=spi32766.0:64k(bootstrap),512k(uboot),15M(rootfs)'
U-Boot> setenv mtdids 'nor0=spi32766.0'
U-Boot> sf probe 0
U-Boot> ubi part rootfs
SF: Detected MX25L51235F with page size 256 Bytes, erase size 64 KiB, total 64 MiB
ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: attached mtd1 (name "mtd=2", size 15 MiB)
ubi0: PEB size: 65536 bytes (64 KiB), LEB size: 65408 bytes
ubi0: min./max. I/O unit sizes: 1/256, sub-page size 1
ubi0: VID header offset: 64 (aligned 64), data offset: 128
ubi0: good PEBs: 240, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 943000472
ubi0: available PEBs: 236, total reserved PEBs: 4, PEBs reserved for bad PEB handling: 0
U-Boot>
2) The following is the case where the rootfs mtd partition fails to attach. It's size is set to 16MB

Code: Select all

U-Boot> setenv mtdparts 'mtdparts=spi32766.0:64k(bootstrap),512k(uboot),16M(rootfs)'
U-Boot> setenv mtdids 'nor0=spi32766.0'
U-Boot> sf probe 0
U-Boot> ubi part rootfs
SF: Detected MX25L51235F with page size 256 Bytes, erase size 64 KiB, total 64 MiB
ubi0: attaching mtd1
At this point, u-boot is now hung and the only difference between case 1 and case 2 is the size of the rootfs mtd partition changed from 15MB to 16MB

I would greatly appreciate any ideas. Unfortunately at this point, I'm stuck on this issue.

Thank you,

Davis
blue_z
Location: USA
Posts: 1560
Joined: Thu Apr 19, 2007 10:15 pm

Re: u-boot hangs when attaching an mtd to ubi using spinor f

Mon Jan 23, 2017 9:56 am

davisroman wrote:I'm seeing unusual behavior when u-boot attempts to attach an mtd partition to a ubi device using a spi-nor flash (MX25L51245G).
...

Code: Select all

SF: Detected MX25L51235F with page size 256 Bytes, erase size 64 KiB, total 64 MiB
Why is that chip detected as a MX25L51235F?

Regards

Return to “SAM9 ARM9 MPU”

Who is online

Users browsing this forum: No registered users and 2 guests