U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Looijmans <mike.looijmans@topic.nl>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Subject: block devices on MTD and UBI
Date: Tue, 18 Mar 2025 10:04:19 +0100	[thread overview]
Message-ID: <cd57ac47-02b6-458e-86a7-7c837a89b550@topic.nl> (raw)

I think I have everything set up to access MTD (and UBI) devices as 
"block", however, lsblk always ignores them, and refuses to list 
anything but the mmc. I can read ubifs and boot from it though, and 
since UBI runs on top of MTD block devices, MTD block device should be 
working, right?

I also have UBI_BLOCK enabled, so I would expect UBI volumes to appear 
in the "lsblk" as well.

Example U-boot session:

Zynq> mtd list
SF: Detected n25q256ax1 with page size 256 Bytes, erase size 64 KiB, 
total 32 MiB
List of MTD devices:
* nor0
   - device: flash@0
   - parent: spi@e000d000
   - driver: jedec_spi_nor
   - path: /axi/spi@e000d000/flash@0
   - type: NOR flash
   - block size: 0x10000 bytes
   - min I/O: 0x1 bytes
   - 0x000000000000-0x000002000000 : "nor0"
           - 0x000000000000-0x000000100000 : "qspi-boot-bin"
           - 0x000000100000-0x000002000000 : "qspi-rootfs"

Zynq> lsblk
Block Driver          Devices
-----------------------------
efi_blk             : <none>
mmc_blk             : mmc 0
mtd_blk             : <none>
ubi_blk             : <none>
usb_storage_blk     : <none>

Zynq> ubi part qspi-rootfs
Zynq> ubi list
0: qspi-rootfs
Zynq> lsblk
Block Driver          Devices
-----------------------------
efi_blk             : <none>
mmc_blk             : mmc 0
mtd_blk             : <none>
ubi_blk             : <none>
usb_storage_blk     : <none>


I would have expected the SPI NOR flash to appear in the "mtd_blk" 
devices, and would expect the UBI volumes to appear in the "ubi_blk" list.
What am I missing?

What I'm aiming for here is to be able to:
- Read from squashfs in (raw) MTD partition (NOR flash is ideal for that)
- Read kernel/devicetree (fit) from UBI volume
- Read from squashfs inside UBI volume


I can read files from UBIFS (and boot into Linux using bootcmd_ubifs) 
just fine, e.g.:
Zynq> ubifsmount ubi0:qspi-rootfs
Zynq> ls ubi 0
<DIR>        5200  Fri Mar 09 12:34:56 2018  bin
<DIR>         160  Fri Mar 09 12:34:56 2018  dev
<DIR>        4984  Fri Mar 09 12:34:56 2018  etc
...


-- 
Mike Looijmans
System Expert

TOPIC Embedded Products B.V.
Materiaalweg 4, 5681 RJ Best
The Netherlands

T: +31 (0) 499 33 69 69
E: mike.looijmans@topic.nl
W: www.topic.nl




             reply	other threads:[~2025-03-18  9:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18  9:04 Mike Looijmans [this message]
2025-03-19 14:06 ` block devices on MTD and UBI Heiko Schocher
2025-03-20 16:03   ` Mike Looijmans
2025-03-24 13:58     ` Mike Looijmans
  -- strict thread matches above, loose matches on Subject: below --
2025-03-25  8:00 Oskar Nilsson
2025-03-26  5:21 ` Heiko Schocher
2025-03-26  9:33   ` Oskar Nilsson

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=cd57ac47-02b6-458e-86a7-7c837a89b550@topic.nl \
    --to=mike.looijmans@topic.nl \
    --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