diff mbox series

[v2] board: freescale: p1_p2_rdb_pc: Add env commands norlowerboot, norupperboot, sd2boot and defboot

Message ID 20220425145043.9945-1-pali@kernel.org
State Accepted
Commit 61fed3155f85059a25e71c44b9da5f6753fc84a4
Delegated to: Marek Behun
Headers show
Series [v2] board: freescale: p1_p2_rdb_pc: Add env commands norlowerboot, norupperboot, sd2boot and defboot | expand

Commit Message

Pali Rohár April 25, 2022, 2:50 p.m. UTC
All *boot env commands overrides default boot source location via i2c.
After board reset without power off, BootROM then starts booting U-Boot
from this specified location instead of the default one.

Add new env command defboot which reverts boot location to the default
value, which in most cases is configurable by HW DIP switches.

And add new env commands norlowerboot, norupperboot, sd2boot to boot from
other locations. norlowerboot would instruct BootROM to boot from lower NOR
bank, norupperboot from upper NOR bank and sd2boot from SD card with
alternative configuration.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
Changes in v2:
* Fix commit message
* Adapt code to use p1_p2_bootsrc.h
---
 include/configs/p1_p2_bootsrc.h | 20 ++++++++++++++++++++
 include/configs/p1_p2_rdb_pc.h  | 13 +++++++++++++
 2 files changed, 33 insertions(+)

Comments

Peng Fan (OSS) June 16, 2022, 9:01 a.m. UTC | #1
在 2022/4/25 22:50, Pali Rohár 写道:
> All *boot env commands overrides default boot source location via i2c.
> After board reset without power off, BootROM then starts booting U-Boot
> from this specified location instead of the default one.
>
> Add new env command defboot which reverts boot location to the default
> value, which in most cases is configurable by HW DIP switches.
>
> And add new env commands norlowerboot, norupperboot, sd2boot to boot from
> other locations. norlowerboot would instruct BootROM to boot from lower NOR
> bank, norupperboot from upper NOR bank and sd2boot from SD card with
> alternative configuration.
>
> Signed-off-by: Pali Rohár <pali@kernel.org>

Not able to apply this patch. Please new version.

Thanks,
Peng.
> ---
> Changes in v2:
> * Fix commit message
> * Adapt code to use p1_p2_bootsrc.h
> ---
>   include/configs/p1_p2_bootsrc.h | 20 ++++++++++++++++++++
>   include/configs/p1_p2_rdb_pc.h  | 13 +++++++++++++
>   2 files changed, 33 insertions(+)
>
> diff --git a/include/configs/p1_p2_bootsrc.h b/include/configs/p1_p2_bootsrc.h
> index a274c57786f5..60741ef544c0 100644
> --- a/include/configs/p1_p2_bootsrc.h
> +++ b/include/configs/p1_p2_bootsrc.h
> @@ -30,6 +30,18 @@
>   #define RST_NOR_CMD(var, ...) ""
>   #endif
>   
> +#ifdef __SW_BOOT_NOR_BANK_LO
> +#define RST_NOR_LO_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_NOR_BANK_LO, __SW_BOOT_MASK))
> +#else
> +#define RST_NOR_LO_CMD(var, ...) ""
> +#endif
> +
> +#ifdef __SW_BOOT_NOR_BANK_UP
> +#define RST_NOR_UP_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_NOR_BANK_UP, __SW_BOOT_MASK))
> +#else
> +#define RST_NOR_UP_CMD(var, ...) ""
> +#endif
> +
>   #ifdef __SW_BOOT_SPI
>   #define RST_SPI_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_SPI, __SW_BOOT_MASK))
>   #else
> @@ -42,6 +54,12 @@
>   #define RST_SD_CMD(var, ...) ""
>   #endif
>   
> +#ifdef __SW_BOOT_SD2
> +#define RST_SD2_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_SD2, __SW_BOOT_MASK))
> +#else
> +#define RST_SD2_CMD(var, ...) ""
> +#endif
> +
>   #ifdef __SW_BOOT_NAND
>   #define RST_NAND_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_NAND, __SW_BOOT_MASK))
>   #else
> @@ -53,3 +71,5 @@
>   #else
>   #define RST_PCIE_CMD(var, ...) ""
>   #endif
> +
> +#define RST_DEF_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(0x00, 0xff))
> diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
> index 47bd20eeeafb..50ce2d9aaed4 100644
> --- a/include/configs/p1_p2_rdb_pc.h
> +++ b/include/configs/p1_p2_rdb_pc.h
> @@ -25,6 +25,9 @@
>   #define __SW_NOR_BANK_MASK	0xfd
>   #define __SW_NOR_BANK_UP	0x00
>   #define __SW_NOR_BANK_LO	0x02
> +#define __SW_BOOT_NOR_BANK_UP	0x5c /* (__SW_BOOT_NOR | __SW_NOR_BANK_UP) */
> +#define __SW_BOOT_NOR_BANK_LO	0x5e /* (__SW_BOOT_NOR | __SW_NOR_BANK_LO) */
> +#define __SW_BOOT_NOR_BANK_MASK	0x01 /* (__SW_BOOT_MASK & __SW_NOR_BANK_MASK) */
>   #define CONFIG_SYS_L2_SIZE	(256 << 10)
>   #endif
>   
> @@ -54,6 +57,9 @@
>   #define __SW_NOR_BANK_MASK	0xfd
>   #define __SW_NOR_BANK_UP	0x00
>   #define __SW_NOR_BANK_LO	0x02
> +#define __SW_BOOT_NOR_BANK_UP	0x64 /* (__SW_BOOT_NOR | __SW_NOR_BANK_UP) */
> +#define __SW_BOOT_NOR_BANK_LO	0x66 /* (__SW_BOOT_NOR | __SW_NOR_BANK_LO) */
> +#define __SW_BOOT_NOR_BANK_MASK	0x01 /* (__SW_BOOT_MASK & __SW_NOR_BANK_MASK) */
>   #define CONFIG_SYS_L2_SIZE	(256 << 10)
>   /*
>    * Dynamic MTD Partition support with mtdparts
> @@ -73,6 +79,9 @@
>   #define __SW_NOR_BANK_MASK	0xfd
>   #define __SW_NOR_BANK_UP	0x00
>   #define __SW_NOR_BANK_LO	0x02
> +#define __SW_BOOT_NOR_BANK_UP	0xc8 /* (__SW_BOOT_NOR | __SW_NOR_BANK_UP) */
> +#define __SW_BOOT_NOR_BANK_LO	0xca /* (__SW_BOOT_NOR | __SW_NOR_BANK_LO) */
> +#define __SW_BOOT_NOR_BANK_MASK	0x01 /* (__SW_BOOT_MASK & __SW_NOR_BANK_MASK) */
>   #define CONFIG_SYS_L2_SIZE	(512 << 10)
>   /*
>    * Dynamic MTD Partition support with mtdparts
> @@ -605,10 +614,14 @@ __VSCFW_ADDR	\
>   MAP_NOR_LO_CMD(map_lowernorbank) \
>   MAP_NOR_UP_CMD(map_uppernorbank) \
>   RST_NOR_CMD(norboot) \
> +RST_NOR_LO_CMD(norlowerboot) \
> +RST_NOR_UP_CMD(norupperboot) \
>   RST_SPI_CMD(spiboot) \
>   RST_SD_CMD(sdboot) \
> +RST_SD2_CMD(sd2boot) \
>   RST_NAND_CMD(nandboot) \
>   RST_PCIE_CMD(pciboot) \
> +RST_DEF_CMD(defboot) \
>   ""
>   
>   #define CONFIG_USB_FAT_BOOT	\
Pali Rohár June 23, 2022, 1:43 p.m. UTC | #2
On Thursday 16 June 2022 17:01:50 Peng Fan (OSS) wrote:
> 在 2022/4/25 22:50, Pali Rohár 写道:
> > All *boot env commands overrides default boot source location via i2c.
> > After board reset without power off, BootROM then starts booting U-Boot
> > from this specified location instead of the default one.
> > 
> > Add new env command defboot which reverts boot location to the default
> > value, which in most cases is configurable by HW DIP switches.
> > 
> > And add new env commands norlowerboot, norupperboot, sd2boot to boot from
> > other locations. norlowerboot would instruct BootROM to boot from lower NOR
> > bank, norupperboot from upper NOR bank and sd2boot from SD card with
> > alternative configuration.
> > 
> > Signed-off-by: Pali Rohár <pali@kernel.org>
> 
> Not able to apply this patch.

And what is the reason? It applies cleanly on top of next branch, which
is today at commit 9121478ee6f2aee381f8fe49d8997d43527d351a.

See my steps and output:

    $ git clone https://source.denx.de/u-boot/u-boot.git -b next
    Cloning into 'u-boot'...
    remote: Enumerating objects: 861911, done.
    remote: Counting objects: 100% (15749/15749), done.
    remote: Compressing objects: 100% (3457/3457), done.
    remote: Total 861911 (delta 12303), reused 15650 (delta 12234), pack-reused 846162
    Receiving objects: 100% (861911/861911), 171.30 MiB | 38.97 MiB/s, done.
    Resolving deltas: 100% (721111/721111), done.

    $ cd u-boot

    $ wget https://patchwork.ozlabs.org/project/uboot/patch/20220425145043.9945-1-pali@kernel.org/mbox/ -O patch
    --2022-06-23 15:39:52--  https://patchwork.ozlabs.org/project/uboot/patch/20220425145043.9945-1-pali@kernel.org/mbox/
    Resolving patchwork.ozlabs.org (patchwork.ozlabs.org)... 2401:3900:2:1::2, 203.11.71.1
    Connecting to patchwork.ozlabs.org (patchwork.ozlabs.org)|2401:3900:2:1::2|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 8916 (8.7K) [text/plain]
    Saving to: 'patch'
    
    patch   100%[===============================>]   8.71K  --.-KB/s    in 0s
    
    2022-06-23 15:39:53 (57.2 MB/s) - 'patch' saved [8916/8916]

    $ git am patch
    Applying: board: freescale: p1_p2_rdb_pc: Add env commands norlowerboot, norupperboot, sd2boot and defboot

    $ git log --oneline | head -4
    b94d5df9eb49 board: freescale: p1_p2_rdb_pc: Add env commands norlowerboot, norupperboot, sd2boot and defboot
    9121478ee6f2 Merge branch '2022-06-22-platform-updates-and-additions' into next
    929e581a620f corstone1000: Convert to text file environment
    781a144a7a7e gxp: Convert to text file environment

> Please new version.
> 
> Thanks,
> Peng.
> > ---
> > Changes in v2:
> > * Fix commit message
> > * Adapt code to use p1_p2_bootsrc.h
> > ---
> >   include/configs/p1_p2_bootsrc.h | 20 ++++++++++++++++++++
> >   include/configs/p1_p2_rdb_pc.h  | 13 +++++++++++++
> >   2 files changed, 33 insertions(+)
> > 
> > diff --git a/include/configs/p1_p2_bootsrc.h b/include/configs/p1_p2_bootsrc.h
> > index a274c57786f5..60741ef544c0 100644
> > --- a/include/configs/p1_p2_bootsrc.h
> > +++ b/include/configs/p1_p2_bootsrc.h
> > @@ -30,6 +30,18 @@
> >   #define RST_NOR_CMD(var, ...) ""
> >   #endif
> > +#ifdef __SW_BOOT_NOR_BANK_LO
> > +#define RST_NOR_LO_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_NOR_BANK_LO, __SW_BOOT_MASK))
> > +#else
> > +#define RST_NOR_LO_CMD(var, ...) ""
> > +#endif
> > +
> > +#ifdef __SW_BOOT_NOR_BANK_UP
> > +#define RST_NOR_UP_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_NOR_BANK_UP, __SW_BOOT_MASK))
> > +#else
> > +#define RST_NOR_UP_CMD(var, ...) ""
> > +#endif
> > +
> >   #ifdef __SW_BOOT_SPI
> >   #define RST_SPI_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_SPI, __SW_BOOT_MASK))
> >   #else
> > @@ -42,6 +54,12 @@
> >   #define RST_SD_CMD(var, ...) ""
> >   #endif
> > +#ifdef __SW_BOOT_SD2
> > +#define RST_SD2_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_SD2, __SW_BOOT_MASK))
> > +#else
> > +#define RST_SD2_CMD(var, ...) ""
> > +#endif
> > +
> >   #ifdef __SW_BOOT_NAND
> >   #define RST_NAND_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_NAND, __SW_BOOT_MASK))
> >   #else
> > @@ -53,3 +71,5 @@
> >   #else
> >   #define RST_PCIE_CMD(var, ...) ""
> >   #endif
> > +
> > +#define RST_DEF_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(0x00, 0xff))
> > diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
> > index 47bd20eeeafb..50ce2d9aaed4 100644
> > --- a/include/configs/p1_p2_rdb_pc.h
> > +++ b/include/configs/p1_p2_rdb_pc.h
> > @@ -25,6 +25,9 @@
> >   #define __SW_NOR_BANK_MASK	0xfd
> >   #define __SW_NOR_BANK_UP	0x00
> >   #define __SW_NOR_BANK_LO	0x02
> > +#define __SW_BOOT_NOR_BANK_UP	0x5c /* (__SW_BOOT_NOR | __SW_NOR_BANK_UP) */
> > +#define __SW_BOOT_NOR_BANK_LO	0x5e /* (__SW_BOOT_NOR | __SW_NOR_BANK_LO) */
> > +#define __SW_BOOT_NOR_BANK_MASK	0x01 /* (__SW_BOOT_MASK & __SW_NOR_BANK_MASK) */
> >   #define CONFIG_SYS_L2_SIZE	(256 << 10)
> >   #endif
> > @@ -54,6 +57,9 @@
> >   #define __SW_NOR_BANK_MASK	0xfd
> >   #define __SW_NOR_BANK_UP	0x00
> >   #define __SW_NOR_BANK_LO	0x02
> > +#define __SW_BOOT_NOR_BANK_UP	0x64 /* (__SW_BOOT_NOR | __SW_NOR_BANK_UP) */
> > +#define __SW_BOOT_NOR_BANK_LO	0x66 /* (__SW_BOOT_NOR | __SW_NOR_BANK_LO) */
> > +#define __SW_BOOT_NOR_BANK_MASK	0x01 /* (__SW_BOOT_MASK & __SW_NOR_BANK_MASK) */
> >   #define CONFIG_SYS_L2_SIZE	(256 << 10)
> >   /*
> >    * Dynamic MTD Partition support with mtdparts
> > @@ -73,6 +79,9 @@
> >   #define __SW_NOR_BANK_MASK	0xfd
> >   #define __SW_NOR_BANK_UP	0x00
> >   #define __SW_NOR_BANK_LO	0x02
> > +#define __SW_BOOT_NOR_BANK_UP	0xc8 /* (__SW_BOOT_NOR | __SW_NOR_BANK_UP) */
> > +#define __SW_BOOT_NOR_BANK_LO	0xca /* (__SW_BOOT_NOR | __SW_NOR_BANK_LO) */
> > +#define __SW_BOOT_NOR_BANK_MASK	0x01 /* (__SW_BOOT_MASK & __SW_NOR_BANK_MASK) */
> >   #define CONFIG_SYS_L2_SIZE	(512 << 10)
> >   /*
> >    * Dynamic MTD Partition support with mtdparts
> > @@ -605,10 +614,14 @@ __VSCFW_ADDR	\
> >   MAP_NOR_LO_CMD(map_lowernorbank) \
> >   MAP_NOR_UP_CMD(map_uppernorbank) \
> >   RST_NOR_CMD(norboot) \
> > +RST_NOR_LO_CMD(norlowerboot) \
> > +RST_NOR_UP_CMD(norupperboot) \
> >   RST_SPI_CMD(spiboot) \
> >   RST_SD_CMD(sdboot) \
> > +RST_SD2_CMD(sd2boot) \
> >   RST_NAND_CMD(nandboot) \
> >   RST_PCIE_CMD(pciboot) \
> > +RST_DEF_CMD(defboot) \
> >   ""
> >   #define CONFIG_USB_FAT_BOOT	\
>
Pali Rohár July 3, 2022, 12:38 p.m. UTC | #3
PING!

On Thursday 23 June 2022 15:43:45 Pali Rohár wrote:
> On Thursday 16 June 2022 17:01:50 Peng Fan (OSS) wrote:
> > 在 2022/4/25 22:50, Pali Rohár 写道:
> > > All *boot env commands overrides default boot source location via i2c.
> > > After board reset without power off, BootROM then starts booting U-Boot
> > > from this specified location instead of the default one.
> > > 
> > > Add new env command defboot which reverts boot location to the default
> > > value, which in most cases is configurable by HW DIP switches.
> > > 
> > > And add new env commands norlowerboot, norupperboot, sd2boot to boot from
> > > other locations. norlowerboot would instruct BootROM to boot from lower NOR
> > > bank, norupperboot from upper NOR bank and sd2boot from SD card with
> > > alternative configuration.
> > > 
> > > Signed-off-by: Pali Rohár <pali@kernel.org>
> > 
> > Not able to apply this patch.
> 
> And what is the reason? It applies cleanly on top of next branch, which
> is today at commit 9121478ee6f2aee381f8fe49d8997d43527d351a.
> 
> See my steps and output:
> 
>     $ git clone https://source.denx.de/u-boot/u-boot.git -b next
>     Cloning into 'u-boot'...
>     remote: Enumerating objects: 861911, done.
>     remote: Counting objects: 100% (15749/15749), done.
>     remote: Compressing objects: 100% (3457/3457), done.
>     remote: Total 861911 (delta 12303), reused 15650 (delta 12234), pack-reused 846162
>     Receiving objects: 100% (861911/861911), 171.30 MiB | 38.97 MiB/s, done.
>     Resolving deltas: 100% (721111/721111), done.
> 
>     $ cd u-boot
> 
>     $ wget https://patchwork.ozlabs.org/project/uboot/patch/20220425145043.9945-1-pali@kernel.org/mbox/ -O patch
>     --2022-06-23 15:39:52--  https://patchwork.ozlabs.org/project/uboot/patch/20220425145043.9945-1-pali@kernel.org/mbox/
>     Resolving patchwork.ozlabs.org (patchwork.ozlabs.org)... 2401:3900:2:1::2, 203.11.71.1
>     Connecting to patchwork.ozlabs.org (patchwork.ozlabs.org)|2401:3900:2:1::2|:443... connected.
>     HTTP request sent, awaiting response... 200 OK
>     Length: 8916 (8.7K) [text/plain]
>     Saving to: 'patch'
>     
>     patch   100%[===============================>]   8.71K  --.-KB/s    in 0s
>     
>     2022-06-23 15:39:53 (57.2 MB/s) - 'patch' saved [8916/8916]
> 
>     $ git am patch
>     Applying: board: freescale: p1_p2_rdb_pc: Add env commands norlowerboot, norupperboot, sd2boot and defboot
> 
>     $ git log --oneline | head -4
>     b94d5df9eb49 board: freescale: p1_p2_rdb_pc: Add env commands norlowerboot, norupperboot, sd2boot and defboot
>     9121478ee6f2 Merge branch '2022-06-22-platform-updates-and-additions' into next
>     929e581a620f corstone1000: Convert to text file environment
>     781a144a7a7e gxp: Convert to text file environment
> 
> > Please new version.

Could you please say something what you want in new version?

> > Thanks,
> > Peng.
> > > ---
> > > Changes in v2:
> > > * Fix commit message
> > > * Adapt code to use p1_p2_bootsrc.h
> > > ---
> > >   include/configs/p1_p2_bootsrc.h | 20 ++++++++++++++++++++
> > >   include/configs/p1_p2_rdb_pc.h  | 13 +++++++++++++
> > >   2 files changed, 33 insertions(+)
> > > 
> > > diff --git a/include/configs/p1_p2_bootsrc.h b/include/configs/p1_p2_bootsrc.h
> > > index a274c57786f5..60741ef544c0 100644
> > > --- a/include/configs/p1_p2_bootsrc.h
> > > +++ b/include/configs/p1_p2_bootsrc.h
> > > @@ -30,6 +30,18 @@
> > >   #define RST_NOR_CMD(var, ...) ""
> > >   #endif
> > > +#ifdef __SW_BOOT_NOR_BANK_LO
> > > +#define RST_NOR_LO_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_NOR_BANK_LO, __SW_BOOT_MASK))
> > > +#else
> > > +#define RST_NOR_LO_CMD(var, ...) ""
> > > +#endif
> > > +
> > > +#ifdef __SW_BOOT_NOR_BANK_UP
> > > +#define RST_NOR_UP_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_NOR_BANK_UP, __SW_BOOT_MASK))
> > > +#else
> > > +#define RST_NOR_UP_CMD(var, ...) ""
> > > +#endif
> > > +
> > >   #ifdef __SW_BOOT_SPI
> > >   #define RST_SPI_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_SPI, __SW_BOOT_MASK))
> > >   #else
> > > @@ -42,6 +54,12 @@
> > >   #define RST_SD_CMD(var, ...) ""
> > >   #endif
> > > +#ifdef __SW_BOOT_SD2
> > > +#define RST_SD2_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_SD2, __SW_BOOT_MASK))
> > > +#else
> > > +#define RST_SD2_CMD(var, ...) ""
> > > +#endif
> > > +
> > >   #ifdef __SW_BOOT_NAND
> > >   #define RST_NAND_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_NAND, __SW_BOOT_MASK))
> > >   #else
> > > @@ -53,3 +71,5 @@
> > >   #else
> > >   #define RST_PCIE_CMD(var, ...) ""
> > >   #endif
> > > +
> > > +#define RST_DEF_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(0x00, 0xff))
> > > diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
> > > index 47bd20eeeafb..50ce2d9aaed4 100644
> > > --- a/include/configs/p1_p2_rdb_pc.h
> > > +++ b/include/configs/p1_p2_rdb_pc.h
> > > @@ -25,6 +25,9 @@
> > >   #define __SW_NOR_BANK_MASK	0xfd
> > >   #define __SW_NOR_BANK_UP	0x00
> > >   #define __SW_NOR_BANK_LO	0x02
> > > +#define __SW_BOOT_NOR_BANK_UP	0x5c /* (__SW_BOOT_NOR | __SW_NOR_BANK_UP) */
> > > +#define __SW_BOOT_NOR_BANK_LO	0x5e /* (__SW_BOOT_NOR | __SW_NOR_BANK_LO) */
> > > +#define __SW_BOOT_NOR_BANK_MASK	0x01 /* (__SW_BOOT_MASK & __SW_NOR_BANK_MASK) */
> > >   #define CONFIG_SYS_L2_SIZE	(256 << 10)
> > >   #endif
> > > @@ -54,6 +57,9 @@
> > >   #define __SW_NOR_BANK_MASK	0xfd
> > >   #define __SW_NOR_BANK_UP	0x00
> > >   #define __SW_NOR_BANK_LO	0x02
> > > +#define __SW_BOOT_NOR_BANK_UP	0x64 /* (__SW_BOOT_NOR | __SW_NOR_BANK_UP) */
> > > +#define __SW_BOOT_NOR_BANK_LO	0x66 /* (__SW_BOOT_NOR | __SW_NOR_BANK_LO) */
> > > +#define __SW_BOOT_NOR_BANK_MASK	0x01 /* (__SW_BOOT_MASK & __SW_NOR_BANK_MASK) */
> > >   #define CONFIG_SYS_L2_SIZE	(256 << 10)
> > >   /*
> > >    * Dynamic MTD Partition support with mtdparts
> > > @@ -73,6 +79,9 @@
> > >   #define __SW_NOR_BANK_MASK	0xfd
> > >   #define __SW_NOR_BANK_UP	0x00
> > >   #define __SW_NOR_BANK_LO	0x02
> > > +#define __SW_BOOT_NOR_BANK_UP	0xc8 /* (__SW_BOOT_NOR | __SW_NOR_BANK_UP) */
> > > +#define __SW_BOOT_NOR_BANK_LO	0xca /* (__SW_BOOT_NOR | __SW_NOR_BANK_LO) */
> > > +#define __SW_BOOT_NOR_BANK_MASK	0x01 /* (__SW_BOOT_MASK & __SW_NOR_BANK_MASK) */
> > >   #define CONFIG_SYS_L2_SIZE	(512 << 10)
> > >   /*
> > >    * Dynamic MTD Partition support with mtdparts
> > > @@ -605,10 +614,14 @@ __VSCFW_ADDR	\
> > >   MAP_NOR_LO_CMD(map_lowernorbank) \
> > >   MAP_NOR_UP_CMD(map_uppernorbank) \
> > >   RST_NOR_CMD(norboot) \
> > > +RST_NOR_LO_CMD(norlowerboot) \
> > > +RST_NOR_UP_CMD(norupperboot) \
> > >   RST_SPI_CMD(spiboot) \
> > >   RST_SD_CMD(sdboot) \
> > > +RST_SD2_CMD(sd2boot) \
> > >   RST_NAND_CMD(nandboot) \
> > >   RST_PCIE_CMD(pciboot) \
> > > +RST_DEF_CMD(defboot) \
> > >   ""
> > >   #define CONFIG_USB_FAT_BOOT	\
> >
Tom Rini July 8, 2022, 11:12 p.m. UTC | #4
[resend to the list too this time]

On Sat, Jul 09, 2022 at 12:43:44AM +0200, Pali Rohár wrote:
> PING????
> 
> I still have not received any response. What is the point?
> 
> On Sunday 03 July 2022 14:38:36 Pali Rohár wrote:
> > PING!
> > 
> > On Thursday 23 June 2022 15:43:45 Pali Rohár wrote:
> > > On Thursday 16 June 2022 17:01:50 Peng Fan (OSS) wrote:
> > > > 在 2022/4/25 22:50, Pali Rohár 写道:
> > > > > All *boot env commands overrides default boot source location via i2c.
> > > > > After board reset without power off, BootROM then starts booting U-Boot
> > > > > from this specified location instead of the default one.
> > > > > 
> > > > > Add new env command defboot which reverts boot location to the default
> > > > > value, which in most cases is configurable by HW DIP switches.
> > > > > 
> > > > > And add new env commands norlowerboot, norupperboot, sd2boot to boot from
> > > > > other locations. norlowerboot would instruct BootROM to boot from lower NOR
> > > > > bank, norupperboot from upper NOR bank and sd2boot from SD card with
> > > > > alternative configuration.
> > > > > 
> > > > > Signed-off-by: Pali Rohár <pali@kernel.org>
> > > > 
> > > > Not able to apply this patch.
> > > 
> > > And what is the reason? It applies cleanly on top of next branch, which
> > > is today at commit 9121478ee6f2aee381f8fe49d8997d43527d351a.

Peng, this patch doesn't apply currently but also looks fairly obvious
to adapt to top of tree.  Please just make it apply when you pick this
up, thanks.
Pali Rohár July 21, 2022, 10:20 p.m. UTC | #5
On Friday 08 July 2022 19:12:10 Tom Rini wrote:
> [resend to the list too this time]
> 
> On Sat, Jul 09, 2022 at 12:43:44AM +0200, Pali Rohár wrote:
> > PING????
> > 
> > I still have not received any response. What is the point?
> > 
> > On Sunday 03 July 2022 14:38:36 Pali Rohár wrote:
> > > PING!
> > > 
> > > On Thursday 23 June 2022 15:43:45 Pali Rohár wrote:
> > > > On Thursday 16 June 2022 17:01:50 Peng Fan (OSS) wrote:
> > > > > 在 2022/4/25 22:50, Pali Rohár 写道:
> > > > > > All *boot env commands overrides default boot source location via i2c.
> > > > > > After board reset without power off, BootROM then starts booting U-Boot
> > > > > > from this specified location instead of the default one.
> > > > > > 
> > > > > > Add new env command defboot which reverts boot location to the default
> > > > > > value, which in most cases is configurable by HW DIP switches.
> > > > > > 
> > > > > > And add new env commands norlowerboot, norupperboot, sd2boot to boot from
> > > > > > other locations. norlowerboot would instruct BootROM to boot from lower NOR
> > > > > > bank, norupperboot from upper NOR bank and sd2boot from SD card with
> > > > > > alternative configuration.
> > > > > > 
> > > > > > Signed-off-by: Pali Rohár <pali@kernel.org>
> > > > > 
> > > > > Not able to apply this patch.
> > > > 
> > > > And what is the reason? It applies cleanly on top of next branch, which
> > > > is today at commit 9121478ee6f2aee381f8fe49d8997d43527d351a.
> 
> Peng, this patch doesn't apply currently but also looks fairly obvious
> to adapt to top of tree.  Please just make it apply when you pick this
> up, thanks.
> 
> -- 
> Tom

Month ago it applied cleanly on next :-(
Pali Rohár Aug. 1, 2022, 1:01 p.m. UTC | #6
On Friday 22 July 2022 00:20:21 Pali Rohár wrote:
> On Friday 08 July 2022 19:12:10 Tom Rini wrote:
> > [resend to the list too this time]
> > 
> > On Sat, Jul 09, 2022 at 12:43:44AM +0200, Pali Rohár wrote:
> > > PING????
> > > 
> > > I still have not received any response. What is the point?
> > > 
> > > On Sunday 03 July 2022 14:38:36 Pali Rohár wrote:
> > > > PING!
> > > > 
> > > > On Thursday 23 June 2022 15:43:45 Pali Rohár wrote:
> > > > > On Thursday 16 June 2022 17:01:50 Peng Fan (OSS) wrote:
> > > > > > 在 2022/4/25 22:50, Pali Rohár 写道:
> > > > > > > All *boot env commands overrides default boot source location via i2c.
> > > > > > > After board reset without power off, BootROM then starts booting U-Boot
> > > > > > > from this specified location instead of the default one.
> > > > > > > 
> > > > > > > Add new env command defboot which reverts boot location to the default
> > > > > > > value, which in most cases is configurable by HW DIP switches.
> > > > > > > 
> > > > > > > And add new env commands norlowerboot, norupperboot, sd2boot to boot from
> > > > > > > other locations. norlowerboot would instruct BootROM to boot from lower NOR
> > > > > > > bank, norupperboot from upper NOR bank and sd2boot from SD card with
> > > > > > > alternative configuration.
> > > > > > > 
> > > > > > > Signed-off-by: Pali Rohár <pali@kernel.org>
> > > > > > 
> > > > > > Not able to apply this patch.
> > > > > 
> > > > > And what is the reason? It applies cleanly on top of next branch, which
> > > > > is today at commit 9121478ee6f2aee381f8fe49d8997d43527d351a.
> > 
> > Peng, this patch doesn't apply currently but also looks fairly obvious
> > to adapt to top of tree.  Please just make it apply when you pick this
> > up, thanks.
> > 
> > -- 
> > Tom
> 
> Month ago it applied cleanly on next :-(

Now I tested this patch and it still applies cleanly on top of master
branch. I just downloaded MBOX version from patchwork:
https://patchwork.ozlabs.org/project/uboot/patch/20220425145043.9945-1-pali@kernel.org/

Could you please process it? It is there since April.

And if it has issue, could you please say something about it?
diff mbox series

Patch

diff --git a/include/configs/p1_p2_bootsrc.h b/include/configs/p1_p2_bootsrc.h
index a274c57786f5..60741ef544c0 100644
--- a/include/configs/p1_p2_bootsrc.h
+++ b/include/configs/p1_p2_bootsrc.h
@@ -30,6 +30,18 @@ 
 #define RST_NOR_CMD(var, ...) ""
 #endif
 
+#ifdef __SW_BOOT_NOR_BANK_LO
+#define RST_NOR_LO_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_NOR_BANK_LO, __SW_BOOT_MASK))
+#else
+#define RST_NOR_LO_CMD(var, ...) ""
+#endif
+
+#ifdef __SW_BOOT_NOR_BANK_UP
+#define RST_NOR_UP_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_NOR_BANK_UP, __SW_BOOT_MASK))
+#else
+#define RST_NOR_UP_CMD(var, ...) ""
+#endif
+
 #ifdef __SW_BOOT_SPI
 #define RST_SPI_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_SPI, __SW_BOOT_MASK))
 #else
@@ -42,6 +54,12 @@ 
 #define RST_SD_CMD(var, ...) ""
 #endif
 
+#ifdef __SW_BOOT_SD2
+#define RST_SD2_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_SD2, __SW_BOOT_MASK))
+#else
+#define RST_SD2_CMD(var, ...) ""
+#endif
+
 #ifdef __SW_BOOT_NAND
 #define RST_NAND_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(__SW_BOOT_NAND, __SW_BOOT_MASK))
 #else
@@ -53,3 +71,5 @@ 
 #else
 #define RST_PCIE_CMD(var, ...) ""
 #endif
+
+#define RST_DEF_CMD(var, ...) __VAR_CMD_RST(var, __VA_ARGS__ __BOOTSRC_CMD(0x00, 0xff))
diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
index 47bd20eeeafb..50ce2d9aaed4 100644
--- a/include/configs/p1_p2_rdb_pc.h
+++ b/include/configs/p1_p2_rdb_pc.h
@@ -25,6 +25,9 @@ 
 #define __SW_NOR_BANK_MASK	0xfd
 #define __SW_NOR_BANK_UP	0x00
 #define __SW_NOR_BANK_LO	0x02
+#define __SW_BOOT_NOR_BANK_UP	0x5c /* (__SW_BOOT_NOR | __SW_NOR_BANK_UP) */
+#define __SW_BOOT_NOR_BANK_LO	0x5e /* (__SW_BOOT_NOR | __SW_NOR_BANK_LO) */
+#define __SW_BOOT_NOR_BANK_MASK	0x01 /* (__SW_BOOT_MASK & __SW_NOR_BANK_MASK) */
 #define CONFIG_SYS_L2_SIZE	(256 << 10)
 #endif
 
@@ -54,6 +57,9 @@ 
 #define __SW_NOR_BANK_MASK	0xfd
 #define __SW_NOR_BANK_UP	0x00
 #define __SW_NOR_BANK_LO	0x02
+#define __SW_BOOT_NOR_BANK_UP	0x64 /* (__SW_BOOT_NOR | __SW_NOR_BANK_UP) */
+#define __SW_BOOT_NOR_BANK_LO	0x66 /* (__SW_BOOT_NOR | __SW_NOR_BANK_LO) */
+#define __SW_BOOT_NOR_BANK_MASK	0x01 /* (__SW_BOOT_MASK & __SW_NOR_BANK_MASK) */
 #define CONFIG_SYS_L2_SIZE	(256 << 10)
 /*
  * Dynamic MTD Partition support with mtdparts
@@ -73,6 +79,9 @@ 
 #define __SW_NOR_BANK_MASK	0xfd
 #define __SW_NOR_BANK_UP	0x00
 #define __SW_NOR_BANK_LO	0x02
+#define __SW_BOOT_NOR_BANK_UP	0xc8 /* (__SW_BOOT_NOR | __SW_NOR_BANK_UP) */
+#define __SW_BOOT_NOR_BANK_LO	0xca /* (__SW_BOOT_NOR | __SW_NOR_BANK_LO) */
+#define __SW_BOOT_NOR_BANK_MASK	0x01 /* (__SW_BOOT_MASK & __SW_NOR_BANK_MASK) */
 #define CONFIG_SYS_L2_SIZE	(512 << 10)
 /*
  * Dynamic MTD Partition support with mtdparts
@@ -605,10 +614,14 @@  __VSCFW_ADDR	\
 MAP_NOR_LO_CMD(map_lowernorbank) \
 MAP_NOR_UP_CMD(map_uppernorbank) \
 RST_NOR_CMD(norboot) \
+RST_NOR_LO_CMD(norlowerboot) \
+RST_NOR_UP_CMD(norupperboot) \
 RST_SPI_CMD(spiboot) \
 RST_SD_CMD(sdboot) \
+RST_SD2_CMD(sd2boot) \
 RST_NAND_CMD(nandboot) \
 RST_PCIE_CMD(pciboot) \
+RST_DEF_CMD(defboot) \
 ""
 
 #define CONFIG_USB_FAT_BOOT	\