Re: [PATCH v4 0/4] SPL NVMe support

2023-07-20 Thread mchitale
On Mon, 2023-07-17 at 11:12 -0400, Tom Rini wrote:
> On Mon, Jul 17, 2023 at 01:39:52PM +0530, mchit...@ventanamicro.com
> wrote:
> > On Wed, 2023-07-12 at 13:12 -0400, Tom Rini wrote:
> > > On Wed, Jul 12, 2023 at 03:27:45PM +0200, Heinrich Schuchardt
> > > wrote:
> > > > On 12.07.23 15:06, mchit...@ventanamicro.com wrote:
> > > > > Hi Tom,
> > > > > 
> > > > > On Tue, 2023-06-20 at 09:37 -0400, Tom Rini wrote:
> > > > > > On Sat, 03 Jun 2023 19:32:52 +0530, Mayuresh Chitale wrote:
> > > > > > 
> > > > > > > This patchset adds support to load images of the SPL's
> > > > > > > next
> > > > > > > booting
> > > > > > > stage from a NVMe device.
> > > > > > > 
> > > > > > > Changes in v4:
> > > > > > > - Drop patch 4
> > > > > > > - Modify patch 2 to use generic fs.h APIs
> > > > > > > 
> > > > > > > [...]
> > > > > > 
> > > > > > With one change, which is that the "disk/part.c" in 4/4
> > > > > > were
> > > > > > not
> > > > > > required for
> > > > > > any platform in tree and also broke testcases, and so was
> > > > > > dropped,
> > > > > > this has now
> > > > > > been applied to u-boot/next. If you can explain a bit more
> > > > > > what
> > > > > > the
> > > > > > problem you
> > > > > > had was, we can look in to it. I suspect you need to test
> > > > > > for
> > > > > > not
> > > > > > SPL_ENV_SUPPORT  but ENV_SUPPORT itself.
> > > > > > 
> > > > > Thanks.
> > > > > When SPL_NVME is enabled the build breaks with the following
> > > > > error:
> > > > > riscv64-unknown-linux-gnu-ld.bfd: disk/part.o: in function
> > > > > `blk_get_device_part_str':
> > > > > u-boot/disk/part.c:473: undefined reference to `env_get'
> > > > > make[2]: *** [u-boot/scripts/Makefile.spl:527: spl/u-boot-
> > > > > spl]
> > > > > Error 1
> > > > > make[1]: *** [/u-boot/Makefile:2053: spl/u-boot-spl] Error 2
> > > > > 
> > > > > One possible fix is:
> > > > > 
> > > > > if ((!IS_ENABLED(CONFIG_SPL) &&
> > > > > IS_ENABLED(CONFIG_ENV_SUPPORT))
> > > > > (IS_ENABLED(CONFIG_SPL) &&
> > > > > IS_ENABLED(CONFIG_SPL_ENV_SUPPORT)))
> > > > >   if (!dev_part_str || !strlen(dev_part_str)
> > > > > > > !strcmp(dev_part_str, "-"))
> > > > >   dev_part_str = env_get("bootdevice");
> > > > > 
> > > > > 
> > > > 
> > > > I think CONFIG_SPL_ENV_SUPPORT should depend on
> > > > CONFIG_ENV_SUPPORT
> > > > in
> > > > common/spl/Kconfig.
> > > 
> > > Not strictly, but checking for CONFIG_IS_ENABLED(ENV_SUPPORT)
> > > should
> > > do
> > > what's desired here?
> > 
> > When SPL_NVME & SPL_BLK_FS is enabled, the spl_blk_fs driver calls
> > fs_set_blk_dev to the set the device & partition before accessing
> > it
> > and fs_set_blk_dev internally tries to get the device & partition
> > from
> > the bootdevice env variable if it was not passed by the caller.
> > However
> > for SPL build, when SPL_ENV_SUPPORT is not enabled nothing provides
> > env_get and hence the build fails.
> 
> OK.  So in the code we should be able to test with
> CONFIG_IS_ENABLED(ENV_SUPPORT) is that will be true for ((SPL and
> SPL environment support) or (Main U-Boot and environment support) or
> (TPL and TPL env)).

Thanks! I will send the patch with this change.
> 



Re: [PATCH v4 0/4] SPL NVMe support

2023-07-17 Thread Tom Rini
On Mon, Jul 17, 2023 at 01:39:52PM +0530, mchit...@ventanamicro.com wrote:
> On Wed, 2023-07-12 at 13:12 -0400, Tom Rini wrote:
> > On Wed, Jul 12, 2023 at 03:27:45PM +0200, Heinrich Schuchardt wrote:
> > > On 12.07.23 15:06, mchit...@ventanamicro.com wrote:
> > > > Hi Tom,
> > > > 
> > > > On Tue, 2023-06-20 at 09:37 -0400, Tom Rini wrote:
> > > > > On Sat, 03 Jun 2023 19:32:52 +0530, Mayuresh Chitale wrote:
> > > > > 
> > > > > > This patchset adds support to load images of the SPL's next
> > > > > > booting
> > > > > > stage from a NVMe device.
> > > > > > 
> > > > > > Changes in v4:
> > > > > > - Drop patch 4
> > > > > > - Modify patch 2 to use generic fs.h APIs
> > > > > > 
> > > > > > [...]
> > > > > 
> > > > > With one change, which is that the "disk/part.c" in 4/4 were
> > > > > not
> > > > > required for
> > > > > any platform in tree and also broke testcases, and so was
> > > > > dropped,
> > > > > this has now
> > > > > been applied to u-boot/next. If you can explain a bit more what
> > > > > the
> > > > > problem you
> > > > > had was, we can look in to it. I suspect you need to test for
> > > > > not
> > > > > SPL_ENV_SUPPORT  but ENV_SUPPORT itself.
> > > > > 
> > > > Thanks.
> > > > When SPL_NVME is enabled the build breaks with the following
> > > > error:
> > > > riscv64-unknown-linux-gnu-ld.bfd: disk/part.o: in function
> > > > `blk_get_device_part_str':
> > > > u-boot/disk/part.c:473: undefined reference to `env_get'
> > > > make[2]: *** [u-boot/scripts/Makefile.spl:527: spl/u-boot-spl]
> > > > Error 1
> > > > make[1]: *** [/u-boot/Makefile:2053: spl/u-boot-spl] Error 2
> > > > 
> > > > One possible fix is:
> > > > 
> > > > if ((!IS_ENABLED(CONFIG_SPL) && IS_ENABLED(CONFIG_ENV_SUPPORT))
> > > > ||
> > > > (IS_ENABLED(CONFIG_SPL) &&
> > > > IS_ENABLED(CONFIG_SPL_ENV_SUPPORT)))
> > > > if (!dev_part_str || !strlen(dev_part_str)
> > > > > > !strcmp(dev_part_str, "-"))
> > > > dev_part_str = env_get("bootdevice");
> > > > 
> > > > 
> > > 
> > > I think CONFIG_SPL_ENV_SUPPORT should depend on CONFIG_ENV_SUPPORT
> > > in
> > > common/spl/Kconfig.
> > 
> > Not strictly, but checking for CONFIG_IS_ENABLED(ENV_SUPPORT) should
> > do
> > what's desired here?
> 
> When SPL_NVME & SPL_BLK_FS is enabled, the spl_blk_fs driver calls
> fs_set_blk_dev to the set the device & partition before accessing it
> and fs_set_blk_dev internally tries to get the device & partition from
> the bootdevice env variable if it was not passed by the caller. However
> for SPL build, when SPL_ENV_SUPPORT is not enabled nothing provides
> env_get and hence the build fails.

OK.  So in the code we should be able to test with
CONFIG_IS_ENABLED(ENV_SUPPORT) is that will be true for ((SPL and
SPL environment support) or (Main U-Boot and environment support) or
(TPL and TPL env)).

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v4 0/4] SPL NVMe support

2023-07-17 Thread mchitale
On Wed, 2023-07-12 at 13:12 -0400, Tom Rini wrote:
> On Wed, Jul 12, 2023 at 03:27:45PM +0200, Heinrich Schuchardt wrote:
> > On 12.07.23 15:06, mchit...@ventanamicro.com wrote:
> > > Hi Tom,
> > > 
> > > On Tue, 2023-06-20 at 09:37 -0400, Tom Rini wrote:
> > > > On Sat, 03 Jun 2023 19:32:52 +0530, Mayuresh Chitale wrote:
> > > > 
> > > > > This patchset adds support to load images of the SPL's next
> > > > > booting
> > > > > stage from a NVMe device.
> > > > > 
> > > > > Changes in v4:
> > > > > - Drop patch 4
> > > > > - Modify patch 2 to use generic fs.h APIs
> > > > > 
> > > > > [...]
> > > > 
> > > > With one change, which is that the "disk/part.c" in 4/4 were
> > > > not
> > > > required for
> > > > any platform in tree and also broke testcases, and so was
> > > > dropped,
> > > > this has now
> > > > been applied to u-boot/next. If you can explain a bit more what
> > > > the
> > > > problem you
> > > > had was, we can look in to it. I suspect you need to test for
> > > > not
> > > > SPL_ENV_SUPPORT  but ENV_SUPPORT itself.
> > > > 
> > > Thanks.
> > > When SPL_NVME is enabled the build breaks with the following
> > > error:
> > > riscv64-unknown-linux-gnu-ld.bfd: disk/part.o: in function
> > > `blk_get_device_part_str':
> > > u-boot/disk/part.c:473: undefined reference to `env_get'
> > > make[2]: *** [u-boot/scripts/Makefile.spl:527: spl/u-boot-spl]
> > > Error 1
> > > make[1]: *** [/u-boot/Makefile:2053: spl/u-boot-spl] Error 2
> > > 
> > > One possible fix is:
> > > 
> > > if ((!IS_ENABLED(CONFIG_SPL) && IS_ENABLED(CONFIG_ENV_SUPPORT))
> > > ||
> > > (IS_ENABLED(CONFIG_SPL) &&
> > > IS_ENABLED(CONFIG_SPL_ENV_SUPPORT)))
> > >   if (!dev_part_str || !strlen(dev_part_str)
> > > > > !strcmp(dev_part_str, "-"))
> > >   dev_part_str = env_get("bootdevice");
> > > 
> > > 
> > 
> > I think CONFIG_SPL_ENV_SUPPORT should depend on CONFIG_ENV_SUPPORT
> > in
> > common/spl/Kconfig.
> 
> Not strictly, but checking for CONFIG_IS_ENABLED(ENV_SUPPORT) should
> do
> what's desired here?

When SPL_NVME & SPL_BLK_FS is enabled, the spl_blk_fs driver calls
fs_set_blk_dev to the set the device & partition before accessing it
and fs_set_blk_dev internally tries to get the device & partition from
the bootdevice env variable if it was not passed by the caller. However
for SPL build, when SPL_ENV_SUPPORT is not enabled nothing provides
env_get and hence the build fails.



Re: [PATCH v4 0/4] SPL NVMe support

2023-07-12 Thread Tom Rini
On Wed, Jul 12, 2023 at 03:27:45PM +0200, Heinrich Schuchardt wrote:
> On 12.07.23 15:06, mchit...@ventanamicro.com wrote:
> > Hi Tom,
> > 
> > On Tue, 2023-06-20 at 09:37 -0400, Tom Rini wrote:
> > > On Sat, 03 Jun 2023 19:32:52 +0530, Mayuresh Chitale wrote:
> > > 
> > > > This patchset adds support to load images of the SPL's next booting
> > > > stage from a NVMe device.
> > > > 
> > > > Changes in v4:
> > > > - Drop patch 4
> > > > - Modify patch 2 to use generic fs.h APIs
> > > > 
> > > > [...]
> > > 
> > > With one change, which is that the "disk/part.c" in 4/4 were not
> > > required for
> > > any platform in tree and also broke testcases, and so was dropped,
> > > this has now
> > > been applied to u-boot/next. If you can explain a bit more what the
> > > problem you
> > > had was, we can look in to it. I suspect you need to test for not
> > > SPL_ENV_SUPPORT  but ENV_SUPPORT itself.
> > > 
> > Thanks.
> > When SPL_NVME is enabled the build breaks with the following error:
> > riscv64-unknown-linux-gnu-ld.bfd: disk/part.o: in function
> > `blk_get_device_part_str':
> > u-boot/disk/part.c:473: undefined reference to `env_get'
> > make[2]: *** [u-boot/scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
> > make[1]: *** [/u-boot/Makefile:2053: spl/u-boot-spl] Error 2
> > 
> > One possible fix is:
> > 
> > if ((!IS_ENABLED(CONFIG_SPL) && IS_ENABLED(CONFIG_ENV_SUPPORT)) ||
> > (IS_ENABLED(CONFIG_SPL) && IS_ENABLED(CONFIG_SPL_ENV_SUPPORT)))
> > if (!dev_part_str || !strlen(dev_part_str)
> > || !strcmp(dev_part_str, "-"))
> > dev_part_str = env_get("bootdevice");
> > 
> > 
> 
> I think CONFIG_SPL_ENV_SUPPORT should depend on CONFIG_ENV_SUPPORT in
> common/spl/Kconfig.

Not strictly, but checking for CONFIG_IS_ENABLED(ENV_SUPPORT) should do
what's desired here?

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v4 0/4] SPL NVMe support

2023-07-12 Thread Heinrich Schuchardt

On 12.07.23 15:06, mchit...@ventanamicro.com wrote:

Hi Tom,

On Tue, 2023-06-20 at 09:37 -0400, Tom Rini wrote:

On Sat, 03 Jun 2023 19:32:52 +0530, Mayuresh Chitale wrote:


This patchset adds support to load images of the SPL's next booting
stage from a NVMe device.

Changes in v4:
- Drop patch 4
- Modify patch 2 to use generic fs.h APIs

[...]


With one change, which is that the "disk/part.c" in 4/4 were not
required for
any platform in tree and also broke testcases, and so was dropped,
this has now
been applied to u-boot/next. If you can explain a bit more what the
problem you
had was, we can look in to it. I suspect you need to test for not
SPL_ENV_SUPPORT  but ENV_SUPPORT itself.


Thanks.
When SPL_NVME is enabled the build breaks with the following error:
riscv64-unknown-linux-gnu-ld.bfd: disk/part.o: in function
`blk_get_device_part_str':
u-boot/disk/part.c:473: undefined reference to `env_get'
make[2]: *** [u-boot/scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
make[1]: *** [/u-boot/Makefile:2053: spl/u-boot-spl] Error 2

One possible fix is:

if ((!IS_ENABLED(CONFIG_SPL) && IS_ENABLED(CONFIG_ENV_SUPPORT)) ||
(IS_ENABLED(CONFIG_SPL) && IS_ENABLED(CONFIG_SPL_ENV_SUPPORT)))
if (!dev_part_str || !strlen(dev_part_str)
|| !strcmp(dev_part_str, "-"))
dev_part_str = env_get("bootdevice");




I think CONFIG_SPL_ENV_SUPPORT should depend on CONFIG_ENV_SUPPORT in
common/spl/Kconfig.

Best regards

Heinrich



Re: [PATCH v4 0/4] SPL NVMe support

2023-07-12 Thread mchitale
Hi Tom,

On Tue, 2023-06-20 at 09:37 -0400, Tom Rini wrote:
> On Sat, 03 Jun 2023 19:32:52 +0530, Mayuresh Chitale wrote:
> 
> > This patchset adds support to load images of the SPL's next booting
> > stage from a NVMe device.
> > 
> > Changes in v4:
> > - Drop patch 4
> > - Modify patch 2 to use generic fs.h APIs
> > 
> > [...]
> 
> With one change, which is that the "disk/part.c" in 4/4 were not
> required for
> any platform in tree and also broke testcases, and so was dropped,
> this has now
> been applied to u-boot/next. If you can explain a bit more what the
> problem you
> had was, we can look in to it. I suspect you need to test for not
> SPL_ENV_SUPPORT  but ENV_SUPPORT itself.
> 
Thanks. 
When SPL_NVME is enabled the build breaks with the following error:
riscv64-unknown-linux-gnu-ld.bfd: disk/part.o: in function
`blk_get_device_part_str':
u-boot/disk/part.c:473: undefined reference to `env_get'
make[2]: *** [u-boot/scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
make[1]: *** [/u-boot/Makefile:2053: spl/u-boot-spl] Error 2

One possible fix is:

if ((!IS_ENABLED(CONFIG_SPL) && IS_ENABLED(CONFIG_ENV_SUPPORT)) ||
   (IS_ENABLED(CONFIG_SPL) && IS_ENABLED(CONFIG_SPL_ENV_SUPPORT)))
if (!dev_part_str || !strlen(dev_part_str)
|| !strcmp(dev_part_str, "-"))
dev_part_str = env_get("bootdevice");




Re: [PATCH v4 0/4] SPL NVMe support

2023-06-20 Thread Tom Rini
On Sat, 03 Jun 2023 19:32:52 +0530, Mayuresh Chitale wrote:

> This patchset adds support to load images of the SPL's next booting
> stage from a NVMe device.
> 
> Changes in v4:
> - Drop patch 4
> - Modify patch 2 to use generic fs.h APIs
> 
> [...]

With one change, which is that the "disk/part.c" in 4/4 were not required for
any platform in tree and also broke testcases, and so was dropped, this has now
been applied to u-boot/next. If you can explain a bit more what the problem you
had was, we can look in to it. I suspect you need to test for not
SPL_ENV_SUPPORT  but ENV_SUPPORT itself.

-- 
Tom



[PATCH v4 0/4] SPL NVMe support

2023-06-03 Thread Mayuresh Chitale
This patchset adds support to load images of the SPL's next booting
stage from a NVMe device.

Changes in v4:
- Drop patch 4
- Modify patch 2 to use generic fs.h APIs

Changes in v3:
- Add generic API to fetch payload from Ext or FAT filesystems
- Remove reduntant SPL_PCI_PNP config check

Changes in v2:
- Rebase on v2023.07-rc1
- Use uclass ID for blk APIs
- Add support to load FIT images from ext filesystem

Mayuresh Chitale (5):
  spl: Add Kconfig options for NVME
  spl: blk: Support loading images from fs
  nvme: pci: Enable for SPL
  spl: Support loading a FIT from ext FS
  common: spl: Add spl NVMe boot support

Mayuresh Chitale (4):
  spl: Add Kconfig options for NVME
  spl: blk: Support loading images from fs
  nvme: pci: Enable for SPL
  common: spl: Add spl NVMe boot support

 arch/riscv/include/asm/spl.h |   1 +
 common/spl/Kconfig   |  27 +++
 common/spl/Makefile  |   2 +
 common/spl/spl_blk_fs.c  | 134 +++
 common/spl/spl_nvme.c|  32 +
 disk/part.c  |  10 +--
 drivers/Makefile |   1 +
 drivers/block/Kconfig|   7 ++
 drivers/nvme/Makefile|   2 +-
 drivers/pci/Kconfig  |   6 ++
 include/spl.h|   3 +
 11 files changed, 220 insertions(+), 5 deletions(-)
 create mode 100644 common/spl/spl_blk_fs.c
 create mode 100644 common/spl/spl_nvme.c

-- 
2.34.1