All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] board: stm32mp1: add support of nor1 device in dfu command
@ 2021-11-25 10:54 Patrick Delaunay
  2021-11-30  9:57 ` Patrice CHOTARD
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Delaunay @ 2021-11-25 10:54 UTC (permalink / raw)
  To: u-boot; +Cc: Patrick Delaunay, Patrice Chotard, U-Boot STM32

Add support of mtd backend for nor1 when this device is present on the
board, on STM32MP157C-EV1 for example, as the support of several MTD
spi-nor instance are now supported with commit b7f060565e31 ("mtd:
spi-nor: allow registering multiple MTDs when DM is enabled").

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
---

 board/st/common/stm32mp_dfu.c |  4 ++++
 doc/board/st/stm32mp1.rst     | 18 ++++++++++--------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c
index 00d1fb8f59..a3f0da5b5b 100644
--- a/board/st/common/stm32mp_dfu.c
+++ b/board/st/common/stm32mp_dfu.c
@@ -132,6 +132,10 @@ void set_dfu_alt_info(char *interface, char *devstr)
 			mtd = get_mtd_device_nm("nor0");
 			if (!IS_ERR_OR_NULL(mtd))
 				board_get_alt_info_mtd(mtd, buf);
+
+			mtd = get_mtd_device_nm("nor1");
+			if (!IS_ERR_OR_NULL(mtd))
+				board_get_alt_info_mtd(mtd, buf);
 		}
 
 		mtd = get_mtd_device_nm("nand0");
diff --git a/doc/board/st/stm32mp1.rst b/doc/board/st/stm32mp1.rst
index 42bb94148d..0c5d3a90f0 100644
--- a/doc/board/st/stm32mp1.rst
+++ b/doc/board/st/stm32mp1.rst
@@ -645,16 +645,18 @@ On EV1 board, booting from SD card, without OP-TEE_::
   dev: eMMC alt: 15 name: mmc1_rootfs layout: RAW_ADDR
   dev: eMMC alt: 16 name: mmc1_userfs layout: RAW_ADDR
   dev: MTD alt: 17 name: nor0 layout: RAW_ADDR
-  dev: MTD alt: 18 name: nand0 layout: RAW_ADDR
-  dev: VIRT alt: 19 name: OTP layout: RAW_ADDR
-  dev: VIRT alt: 20 name: PMIC layout: RAW_ADDR
+  dev: MTD alt: 18 name: nor1 layout: RAW_ADDR
+  dev: MTD alt: 19 name: nand0 layout: RAW_ADDR
+  dev: VIRT alt: 20 name: OTP layout: RAW_ADDR
+  dev: VIRT alt: 21 name: PMIC layout: RAW_ADDR
 
 All the supported device are exported for dfu-util tool::
 
   $> dfu-util -l
-  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=20, name="PMIC", serial="002700333338511934383330"
-  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=19, name="OTP", serial="002700333338511934383330"
-  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=18, name="nand0", serial="002700333338511934383330"
+  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=21, name="PMIC", serial="002700333338511934383330"
+  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=20, name="OTP", serial="002700333338511934383330"
+  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=19, name="nand0", serial="002700333338511934383330"
+  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=18, name="nor1", serial="002700333338511934383330"
   Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=17, name="nor0", serial="002700333338511934383330"
   Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=16, name="mmc1_userfs", serial="002700333338511934383330"
   Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=15, name="mmc1_rootfs", serial="002700333338511934383330"
@@ -705,12 +707,12 @@ You can update the boot device:
 When the board is booting for nor0 or nand0,
 only the MTD partition on the boot devices are available, for example:
 
-- NOR (nor0 = alt 20) & NAND (nand0 = alt 26) ::
+- NOR (nor0 = alt 20, nor1 = alt 26) & NAND (nand0 = alt 27) :
 
   $> dfu-util -d 0483:5720 -a 21 -D tf-a-stm32mp157c-ev1.stm32
   $> dfu-util -d 0483:5720 -a 22 -D tf-a-stm32mp157c-ev1.stm32
   $> dfu-util -d 0483:5720 -a 23 -D fip-stm32mp157c-ev1.bin
-  $> dfu-util -d 0483:5720 -a 27 -D st-image-weston-openstlinux-weston-stm32mp1_nand_4_256_multivolume.ubi
+  $> dfu-util -d 0483:5720 -a 28 -D st-image-weston-openstlinux-weston-stm32mp1_nand_4_256_multivolume.ubi
 
 - NAND (nand0 = alt 21)::
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] board: stm32mp1: add support of nor1 device in dfu command
  2021-11-25 10:54 [PATCH] board: stm32mp1: add support of nor1 device in dfu command Patrick Delaunay
@ 2021-11-30  9:57 ` Patrice CHOTARD
  2021-11-30 13:38   ` [Uboot-stm32] " Patrice CHOTARD
  0 siblings, 1 reply; 3+ messages in thread
From: Patrice CHOTARD @ 2021-11-30  9:57 UTC (permalink / raw)
  To: Patrick Delaunay, u-boot; +Cc: U-Boot STM32

Hi Patrick

On 11/25/21 11:54 AM, Patrick Delaunay wrote:
> Add support of mtd backend for nor1 when this device is present on the
> board, on STM32MP157C-EV1 for example, as the support of several MTD
> spi-nor instance are now supported with commit b7f060565e31 ("mtd:
> spi-nor: allow registering multiple MTDs when DM is enabled").
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> ---
> 
>  board/st/common/stm32mp_dfu.c |  4 ++++
>  doc/board/st/stm32mp1.rst     | 18 ++++++++++--------
>  2 files changed, 14 insertions(+), 8 deletions(-)
> 
> diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c
> index 00d1fb8f59..a3f0da5b5b 100644
> --- a/board/st/common/stm32mp_dfu.c
> +++ b/board/st/common/stm32mp_dfu.c
> @@ -132,6 +132,10 @@ void set_dfu_alt_info(char *interface, char *devstr)
>  			mtd = get_mtd_device_nm("nor0");
>  			if (!IS_ERR_OR_NULL(mtd))
>  				board_get_alt_info_mtd(mtd, buf);
> +
> +			mtd = get_mtd_device_nm("nor1");
> +			if (!IS_ERR_OR_NULL(mtd))
> +				board_get_alt_info_mtd(mtd, buf);
>  		}
>  
>  		mtd = get_mtd_device_nm("nand0");
> diff --git a/doc/board/st/stm32mp1.rst b/doc/board/st/stm32mp1.rst
> index 42bb94148d..0c5d3a90f0 100644
> --- a/doc/board/st/stm32mp1.rst
> +++ b/doc/board/st/stm32mp1.rst
> @@ -645,16 +645,18 @@ On EV1 board, booting from SD card, without OP-TEE_::
>    dev: eMMC alt: 15 name: mmc1_rootfs layout: RAW_ADDR
>    dev: eMMC alt: 16 name: mmc1_userfs layout: RAW_ADDR
>    dev: MTD alt: 17 name: nor0 layout: RAW_ADDR
> -  dev: MTD alt: 18 name: nand0 layout: RAW_ADDR
> -  dev: VIRT alt: 19 name: OTP layout: RAW_ADDR
> -  dev: VIRT alt: 20 name: PMIC layout: RAW_ADDR
> +  dev: MTD alt: 18 name: nor1 layout: RAW_ADDR
> +  dev: MTD alt: 19 name: nand0 layout: RAW_ADDR
> +  dev: VIRT alt: 20 name: OTP layout: RAW_ADDR
> +  dev: VIRT alt: 21 name: PMIC layout: RAW_ADDR
>  
>  All the supported device are exported for dfu-util tool::
>  
>    $> dfu-util -l
> -  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=20, name="PMIC", serial="002700333338511934383330"
> -  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=19, name="OTP", serial="002700333338511934383330"
> -  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=18, name="nand0", serial="002700333338511934383330"
> +  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=21, name="PMIC", serial="002700333338511934383330"
> +  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=20, name="OTP", serial="002700333338511934383330"
> +  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=19, name="nand0", serial="002700333338511934383330"
> +  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=18, name="nor1", serial="002700333338511934383330"
>    Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=17, name="nor0", serial="002700333338511934383330"
>    Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=16, name="mmc1_userfs", serial="002700333338511934383330"
>    Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=15, name="mmc1_rootfs", serial="002700333338511934383330"
> @@ -705,12 +707,12 @@ You can update the boot device:
>  When the board is booting for nor0 or nand0,
>  only the MTD partition on the boot devices are available, for example:
>  
> -- NOR (nor0 = alt 20) & NAND (nand0 = alt 26) ::
> +- NOR (nor0 = alt 20, nor1 = alt 26) & NAND (nand0 = alt 27) :
>  
>    $> dfu-util -d 0483:5720 -a 21 -D tf-a-stm32mp157c-ev1.stm32
>    $> dfu-util -d 0483:5720 -a 22 -D tf-a-stm32mp157c-ev1.stm32
>    $> dfu-util -d 0483:5720 -a 23 -D fip-stm32mp157c-ev1.bin
> -  $> dfu-util -d 0483:5720 -a 27 -D st-image-weston-openstlinux-weston-stm32mp1_nand_4_256_multivolume.ubi
> +  $> dfu-util -d 0483:5720 -a 28 -D st-image-weston-openstlinux-weston-stm32mp1_nand_4_256_multivolume.ubi
>  
>  - NAND (nand0 = alt 21)::
>  
> 

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Thanks
Patrice

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Uboot-stm32] [PATCH] board: stm32mp1: add support of nor1 device in dfu command
  2021-11-30  9:57 ` Patrice CHOTARD
@ 2021-11-30 13:38   ` Patrice CHOTARD
  0 siblings, 0 replies; 3+ messages in thread
From: Patrice CHOTARD @ 2021-11-30 13:38 UTC (permalink / raw)
  To: Patrick Delaunay, u-boot; +Cc: U-Boot STM32

Hi Patrick

On 11/30/21 10:57 AM, Patrice CHOTARD wrote:
> Hi Patrick
> 
> On 11/25/21 11:54 AM, Patrick Delaunay wrote:
>> Add support of mtd backend for nor1 when this device is present on the
>> board, on STM32MP157C-EV1 for example, as the support of several MTD
>> spi-nor instance are now supported with commit b7f060565e31 ("mtd:
>> spi-nor: allow registering multiple MTDs when DM is enabled").
>>
>> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
>> ---
>>
>>  board/st/common/stm32mp_dfu.c |  4 ++++
>>  doc/board/st/stm32mp1.rst     | 18 ++++++++++--------
>>  2 files changed, 14 insertions(+), 8 deletions(-)
>>
>> diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c
>> index 00d1fb8f59..a3f0da5b5b 100644
>> --- a/board/st/common/stm32mp_dfu.c
>> +++ b/board/st/common/stm32mp_dfu.c
>> @@ -132,6 +132,10 @@ void set_dfu_alt_info(char *interface, char *devstr)
>>  			mtd = get_mtd_device_nm("nor0");
>>  			if (!IS_ERR_OR_NULL(mtd))
>>  				board_get_alt_info_mtd(mtd, buf);
>> +
>> +			mtd = get_mtd_device_nm("nor1");
>> +			if (!IS_ERR_OR_NULL(mtd))
>> +				board_get_alt_info_mtd(mtd, buf);
>>  		}
>>  
>>  		mtd = get_mtd_device_nm("nand0");
>> diff --git a/doc/board/st/stm32mp1.rst b/doc/board/st/stm32mp1.rst
>> index 42bb94148d..0c5d3a90f0 100644
>> --- a/doc/board/st/stm32mp1.rst
>> +++ b/doc/board/st/stm32mp1.rst
>> @@ -645,16 +645,18 @@ On EV1 board, booting from SD card, without OP-TEE_::
>>    dev: eMMC alt: 15 name: mmc1_rootfs layout: RAW_ADDR
>>    dev: eMMC alt: 16 name: mmc1_userfs layout: RAW_ADDR
>>    dev: MTD alt: 17 name: nor0 layout: RAW_ADDR
>> -  dev: MTD alt: 18 name: nand0 layout: RAW_ADDR
>> -  dev: VIRT alt: 19 name: OTP layout: RAW_ADDR
>> -  dev: VIRT alt: 20 name: PMIC layout: RAW_ADDR
>> +  dev: MTD alt: 18 name: nor1 layout: RAW_ADDR
>> +  dev: MTD alt: 19 name: nand0 layout: RAW_ADDR
>> +  dev: VIRT alt: 20 name: OTP layout: RAW_ADDR
>> +  dev: VIRT alt: 21 name: PMIC layout: RAW_ADDR
>>  
>>  All the supported device are exported for dfu-util tool::
>>  
>>    $> dfu-util -l
>> -  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=20, name="PMIC", serial="002700333338511934383330"
>> -  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=19, name="OTP", serial="002700333338511934383330"
>> -  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=18, name="nand0", serial="002700333338511934383330"
>> +  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=21, name="PMIC", serial="002700333338511934383330"
>> +  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=20, name="OTP", serial="002700333338511934383330"
>> +  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=19, name="nand0", serial="002700333338511934383330"
>> +  Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=18, name="nor1", serial="002700333338511934383330"
>>    Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=17, name="nor0", serial="002700333338511934383330"
>>    Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=16, name="mmc1_userfs", serial="002700333338511934383330"
>>    Found DFU: [0483:df11] ver=9999, devnum=99, cfg=1, intf=0, alt=15, name="mmc1_rootfs", serial="002700333338511934383330"
>> @@ -705,12 +707,12 @@ You can update the boot device:
>>  When the board is booting for nor0 or nand0,
>>  only the MTD partition on the boot devices are available, for example:
>>  
>> -- NOR (nor0 = alt 20) & NAND (nand0 = alt 26) ::
>> +- NOR (nor0 = alt 20, nor1 = alt 26) & NAND (nand0 = alt 27) :
>>  
>>    $> dfu-util -d 0483:5720 -a 21 -D tf-a-stm32mp157c-ev1.stm32
>>    $> dfu-util -d 0483:5720 -a 22 -D tf-a-stm32mp157c-ev1.stm32
>>    $> dfu-util -d 0483:5720 -a 23 -D fip-stm32mp157c-ev1.bin
>> -  $> dfu-util -d 0483:5720 -a 27 -D st-image-weston-openstlinux-weston-stm32mp1_nand_4_256_multivolume.ubi
>> +  $> dfu-util -d 0483:5720 -a 28 -D st-image-weston-openstlinux-weston-stm32mp1_nand_4_256_multivolume.ubi
>>  
>>  - NAND (nand0 = alt 21)::
>>  
>>
> 
> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
> Thanks
> Patrice
> _______________________________________________
> Uboot-stm32 mailing list
> Uboot-stm32@st-md-mailman.stormreply.com
> https://st-md-mailman.stormreply.com/mailman/listinfo/uboot-stm32
> 

Applied to u-boot-stm32/next
Thanks
Patrice

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-30 13:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-25 10:54 [PATCH] board: stm32mp1: add support of nor1 device in dfu command Patrick Delaunay
2021-11-30  9:57 ` Patrice CHOTARD
2021-11-30 13:38   ` [Uboot-stm32] " Patrice CHOTARD

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.