public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] u-boot hangs when attaching an mtd to ubi using spinor flash, MX25L51245G
Date: Wed, 25 Jan 2017 20:48:04 +0100	[thread overview]
Message-ID: <588900F4.5010603@denx.de> (raw)
In-Reply-To: <CACfi_Z3Kav0UafTnxqKGTnsbwJVfsZ0SZHL1VUtP5Ua9gUPpfw@mail.gmail.com>

Hello Davis,

Am 20.01.2017 um 02:15 schrieb Davis Roman:
> 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.

No real idea ... can you enable UBI DEBUG output?

Are the sectors behind 576k + 15MiB erased? Or contain they some crap?

May you can try to erase the rootfs partition before attaching?

bye,
Heiko
> I've searched through the u-boot mailing archives but I have yet to
> find anything that might shed some light on this issue.
>
> Here are the steps to reproduce:
>
> $ 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: include/configs/at91sam9x5ek_spiflash_defconfig
>
> --- include/configs/at91sam9x5ek_spiflash_defconfig     2017-01-19
> 19:08:50.257475024 -0500
> +++ include/configs/at91sam9x5ek_spiflash_defconfig     2017-01-19
> 19:12:37.045475024 -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,7 @@ 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_MTD=y
>
> $ 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
>
> 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
>
> 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
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

      parent reply	other threads:[~2017-01-25 19:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-20  1:15 [U-Boot] u-boot hangs when attaching an mtd to ubi using spinor flash, MX25L51245G Davis Roman
2017-01-20  3:05 ` Davis Roman
2017-01-25 19:48 ` Heiko Schocher [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=588900F4.5010603@denx.de \
    --to=hs@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox