mbox series

[u-boot-dm,+,u-boot-spi,v3,00/11] Support SPI NORs and OF partitions in `mtd list`

Message ID 20210225141336.6149-1-marek.behun@nic.cz
Headers show
Series Support SPI NORs and OF partitions in `mtd list` | expand

Message

Marek Behún Feb. 25, 2021, 2:13 p.m. UTC
Hello,

this is v3 of patchset that adds support for U-Boot to parse MTD
partitions from device-tree, and also improves support for SPI NOR
access via the `mtd` command.

Changes since v2:
- addressed Pali's comments in patch that adds partition parsing (4/7 in
  this version): no check for whether the `compatible` property is
  present in a partition node and added comment explaining mask flags)
- added 4 more patches:
  1) adding ofnode_get_path() function
  2) printing OF path in `mtd list`
  3) in `mtd read <name> ...`, <name> can now also be DM's device name
     or OF path
  4) the fact from 3) is added to `mtd help`

Changes since v1:
- added tests of ofnode_get_addr_size_index() and
  ofnode_get_addr_size_index_notrans() as requested by Simon
- the last patch now probes SPI NORs in both versions of
  mtd_probe_devices(), that is when MTDPARTS is enabled or disabled

Marek

Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Priyanka Jain <priyanka.jain@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Heiko Schocher <hs@denx.de>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Patrice CHOTARD <patrice.chotard@foss.st.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>

Marek Behún (11):
  dm: core: add test for ofnode_get_addr_size_index()
  dm: core: add non-translating version of ofnode_get_addr_size_index()
  dm: core: add ofnode_get_path()
  mtd: add support for parsing partitions defined in OF
  mtd: spi-nor: allow registering multiple MTDs when DM is enabled
  mtd: spi-nor: fill-in mtd->dev member
  mtd: remove mtd_probe() function
  mtd: probe SPI NOR devices in mtd_probe_devices()
  cmd: mtd: print device OF path in listing
  mtd: compare also with OF path and device name in get_mtd_device_nm()
  cmd: mtd: expand <name> argument definition in command help

 cmd/mtd.c                      |  11 ++-
 drivers/core/ofnode.c          |  44 ++++++++++-
 drivers/mtd/mtd-uclass.c       |  15 ----
 drivers/mtd/mtd_uboot.c        | 129 ++++++++++++++++++++-------------
 drivers/mtd/mtdcore.c          |  29 ++++++++
 drivers/mtd/mtdpart.c          |  63 ++++++++++++++++
 drivers/mtd/spi/sf_internal.h  |   4 +-
 drivers/mtd/spi/sf_mtd.c       |  19 ++++-
 drivers/mtd/spi/sf_probe.c     |   6 +-
 drivers/mtd/spi/spi-nor-core.c |   1 +
 drivers/mtd/spi/spi-nor-tiny.c |   1 +
 include/dm/ofnode.h            |  27 +++++++
 include/linux/mtd/mtd.h        |   9 +++
 include/mtd.h                  |   1 -
 test/dm/ofnode.c               |  50 +++++++++++++
 15 files changed, 334 insertions(+), 75 deletions(-)

Comments

Miquel Raynal Feb. 25, 2021, 3:57 p.m. UTC | #1
Hi Marek,

Marek Behún <marek.behun@nic.cz> wrote on Thu, 25 Feb 2021 15:13:25
+0100:

> Hello,
> 
> this is v3 of patchset that adds support for U-Boot to parse MTD
> partitions from device-tree, and also improves support for SPI NOR
> access via the `mtd` command.

Very nice contribution, I didn't reviewed in detail every change but
for what I saw:

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

for the whole series.

Thanks,
Miquèl
Patrice CHOTARD Feb. 26, 2021, 1:07 p.m. UTC | #2
Hi All

On 2/25/21 3:13 PM, Marek Behún wrote:
> Hello,
> 
> this is v3 of patchset that adds support for U-Boot to parse MTD
> partitions from device-tree, and also improves support for SPI NOR
> access via the `mtd` command.
> 
> Changes since v2:
> - addressed Pali's comments in patch that adds partition parsing (4/7 in
>   this version): no check for whether the `compatible` property is
>   present in a partition node and added comment explaining mask flags)
> - added 4 more patches:
>   1) adding ofnode_get_path() function
>   2) printing OF path in `mtd list`
>   3) in `mtd read <name> ...`, <name> can now also be DM's device name
>      or OF path
>   4) the fact from 3) is added to `mtd help`
> 
> Changes since v1:
> - added tests of ofnode_get_addr_size_index() and
>   ofnode_get_addr_size_index_notrans() as requested by Simon
> - the last patch now probes SPI NORs in both versions of
>   mtd_probe_devices(), that is when MTDPARTS is enabled or disabled
> 
> Marek
> 
> Cc: Jagan Teki <jagan@amarulasolutions.com>
> Cc: Priyanka Jain <priyanka.jain@nxp.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Jagan Teki <jagan@amarulasolutions.com>
> Cc: Patrick Delaunay <patrick.delaunay@st.com>
> Cc: Patrice CHOTARD <patrice.chotard@foss.st.com>
> Cc: Miquel Raynal <miquel.raynal@bootlin.com>
> 
> Marek Behún (11):
>   dm: core: add test for ofnode_get_addr_size_index()
>   dm: core: add non-translating version of ofnode_get_addr_size_index()
>   dm: core: add ofnode_get_path()
>   mtd: add support for parsing partitions defined in OF
>   mtd: spi-nor: allow registering multiple MTDs when DM is enabled
>   mtd: spi-nor: fill-in mtd->dev member
>   mtd: remove mtd_probe() function
>   mtd: probe SPI NOR devices in mtd_probe_devices()
>   cmd: mtd: print device OF path in listing
>   mtd: compare also with OF path and device name in get_mtd_device_nm()
>   cmd: mtd: expand <name> argument definition in command help
> 
>  cmd/mtd.c                      |  11 ++-
>  drivers/core/ofnode.c          |  44 ++++++++++-
>  drivers/mtd/mtd-uclass.c       |  15 ----
>  drivers/mtd/mtd_uboot.c        | 129 ++++++++++++++++++++-------------
>  drivers/mtd/mtdcore.c          |  29 ++++++++
>  drivers/mtd/mtdpart.c          |  63 ++++++++++++++++
>  drivers/mtd/spi/sf_internal.h  |   4 +-
>  drivers/mtd/spi/sf_mtd.c       |  19 ++++-
>  drivers/mtd/spi/sf_probe.c     |   6 +-
>  drivers/mtd/spi/spi-nor-core.c |   1 +
>  drivers/mtd/spi/spi-nor-tiny.c |   1 +
>  include/dm/ofnode.h            |  27 +++++++
>  include/linux/mtd/mtd.h        |   9 +++
>  include/mtd.h                  |   1 -
>  test/dm/ofnode.c               |  50 +++++++++++++
>  15 files changed, 334 insertions(+), 75 deletions(-)
> 

Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
on stm32mp1-ev1 

Thanks
Patrice