Skip to contentSkip to conversation

: cmd: part: add part block command

PATCH New razvan.becheriu at gmail.com 2 participants 10 messages Jun 1, 2020 – Jun 5, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : cmd: part: add part block command

The Intel Edison OTA process requires a conversion of data size from bytes to number of blocks. The following functions are used:

# function ota_conv_sizes
# Convert a bytes size to a block size
# input bytesize : size in bytes to convert
# input blksize : size of a block in bytes
# output num_blk : converted size in blocks

# function ota_mmc_write
# Write a memory buffer to mmc drive
# input floadaddr : address of buffer to write
# input u_part_start : block start in mmc
# input num_blk : number of block to write

This patch adds the cmd part sub-command 'block' which returns the partition block size in bytes.

#1 lore raw

PATCH 1/1 cmd: part: Add 'block' sub-command

From: Razvan Becheriu <[email protected]>

Add part block sub-command which returns block size.

e.g.:
part block mmc $mmcdev system_a system_a_index

---
 cmd/part.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
cmd/part.c +14 -0
index 5e4e45ca6d..d78d914e7a 100644
@@ -25,6 +25,7 @@
 enum cmd_part_info {
 	CMD_PART_INFO_START = 0,
 	CMD_PART_INFO_SIZE,
+	CMD_PART_INFO_BLOCK,
 	CMD_PART_INFO_NUMBER
 };
 
@@ -151,6 +152,9 @@ static int do_part_info(int argc, char * const argv[], enum cmd_part_info param)
 	case CMD_PART_INFO_SIZE:
 		snprintf(buf, sizeof(buf), LBAF, info.size);
 		break;
+	case CMD_PART_INFO_BLOCK:
+		snprintf(buf, sizeof(buf), LBAF, info.blksz);
+		break;
 	case CMD_PART_INFO_NUMBER:
 		snprintf(buf, sizeof(buf), "0x%x", part);
 		break;
@@ -177,6 +181,11 @@ static int do_part_size(int argc, char * const argv[])
 	return do_part_info(argc, argv, CMD_PART_INFO_SIZE);
 }
 
+static int do_part_block(int argc, char * const argv[])
+{
+	return do_part_info(argc, argv, CMD_PART_INFO_BLOCK);
+}
+
 static int do_part_number(int argc, char * const argv[])
 {
 	return do_part_info(argc, argv, CMD_PART_INFO_NUMBER);
@@ -195,6 +204,8 @@ static int do_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		return do_part_start(argc - 2, argv + 2);
 	else if (!strcmp(argv[1], "size"))
 		return do_part_size(argc - 2, argv + 2);
+	else if (!strcmp(argv[1], "block"))
+		return do_part_block(argc - 2, argv + 2);
 	else if (!strcmp(argv[1], "number"))
 		return do_part_number(argc - 2, argv + 2);
 
@@ -219,6 +230,9 @@ U_BOOT_CMD(
 	"part size <interface> <dev> <part> <varname>\n"
 	"    - set environment variable to the size of the partition (in blocks)\n"
 	"      part can be either partition number or partition name\n"
+	"part block <interface> <dev> <part> <varname>\n"
+	"    - set environment variable to the size of the partition block\n"
+	"      part can be either partition number or partition name\n"
 	"part number <interface> <dev> <part> <varname>\n"
 	"    - set environment variable to the partition number using the partition name\n"
 	"      part must be specified as partition name"
Signature · 1 line
2.25.1
#2 lore raw

PATCH 1/1 cmd: part: Add 'block' sub-command

Quoted 56 lines · razvan.becheriu at gmail.com

From: Razvan Becheriu <[email protected]>

Add part block sub-command which returns block size.

e.g.:
part block mmc $mmcdev system_a system_a_index

---
 cmd/part.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
cmd/part.c +11 -0
index 5e4e45ca6d..d78d914e7a 100644
@@ -25,6 +25,7 @@
 enum cmd_part_info {
 	CMD_PART_INFO_START = 0,
 	CMD_PART_INFO_SIZE,
+	CMD_PART_INFO_BLOCK,
 	CMD_PART_INFO_NUMBER
 };
 
@@ -151,6 +152,9 @@ static int do_part_info(int argc, char * const argv[], enum cmd_part_info param)
 	case CMD_PART_INFO_SIZE:
 		snprintf(buf, sizeof(buf), LBAF, info.size);
 		break;
+	case CMD_PART_INFO_BLOCK:
+		snprintf(buf, sizeof(buf), LBAF, info.blksz);
+		break;
 	case CMD_PART_INFO_NUMBER:
 		snprintf(buf, sizeof(buf), "0x%x", part);
 		break;
@@ -177,6 +181,11 @@ static int do_part_size(int argc, char * const argv[])
 	return do_part_info(argc, argv, CMD_PART_INFO_SIZE);
 }
 
+static int do_part_block(int argc, char * const argv[])
+{
+	return do_part_info(argc, argv, CMD_PART_INFO_BLOCK);
+}
+
 static int do_part_number(int argc, char * const argv[])
 {
 	return do_part_info(argc, argv, CMD_PART_INFO_NUMBER);
@@ -195,6 +204,8 @@ static int do_part(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		return do_part_start(argc - 2, argv + 2);
 	else if (!strcmp(argv[1], "size"))
 		return do_part_size(argc - 2, argv + 2);
+	else if (!strcmp(argv[1], "block"))
+		return do_part_block(argc - 2, argv + 2);
 	else if (!strcmp(argv[1], "number"))
 		return do_part_number(argc - 2, argv + 2);
 

cmd/part.c U_BOOT_CMD( · line 238

Quoted 9 lines
cmd/part.c +3 -0
@@ -219,6 +230,9 @@ U_BOOT_CMD(
 	"part size <interface> <dev> <part> <varname>\n"
 	"    - set environment variable to the size of the partition (in blocks)\n"
 	"      part can be either partition number or partition name\n"
+	"part block <interface> <dev> <part> <varname>\n"
+	"    - set environment variable to the size of the partition block\n"
+	"      part can be either partition number or partition name\n"
 	"part number <interface> <dev> <part> <varname>\n"
 	"    - set environment variable to the partition number using the partition name\n"
 	"      part must be specified as partition name"

I believe you can solve the problems mentioned in the cover letter with setexpr to do the conversion so nak on this patch, thanks.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200602/efed1ccb/attachment.sig>
#3 lore raw

PATCH 1/1 : cmd: part: add part block command

In reply to razvan.becheriu at gmail.com
Quoted 10 lines · razvan.becheriu at gmail.com

The Intel Edison OTA process requires a conversion of data size from bytes to number of blocks. The following functions are used:

# function ota_conv_sizes
# Convert a bytes size to a block size
# input bytesize : size in bytes to convert
# input blksize : size of a block in bytes
# output num_blk : converted size in blocks

Quoted 8 lines

# function ota_mmc_write
# Write a memory buffer to mmc drive
# input floadaddr : address of buffer to write
# input u_part_start : block start in mmc
# input num_blk : number of block to write

This patch adds the cmd part sub-command 'block' which returns the partition block size in bytes.

This is usually done with the setexpr command today, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200602/45b0f8be/attachment.sig>
#4 lore raw

PATCH 1/1 : cmd: part: add part block command

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

setexpr can compute the divide/multiply part, but we still need to get the partition block size somehow.

I know that this is 0x200 by default, but we can not hardcode that in the scripts. we should read that from the partition info.

Quoted 1 line · trini at konsulko.com

On Mon, Jun 01, 2020 at 01:20:25PM +0300, razvan.becheriu at gmail.com

Quoted 16 lines · wrote:
Quoted 16 lines

The Intel Edison OTA process requires a conversion of data size from bytes to number of blocks. The following functions are used:

# function ota_conv_sizes
# Convert a bytes size to a block size
# input bytesize : size in bytes to convert
# input blksize : size of a block in bytes
# output num_blk : converted size in blocks

# function ota_mmc_write
# Write a memory buffer to mmc drive
# input floadaddr : address of buffer to write
# input u_part_start : block start in mmc
# input num_blk : number of block to write

Quoted 7 lines
Quoted 2 lines

This patch adds the cmd part sub-command 'block' which returns the partition block size in bytes.

This is usually done with the setexpr command today, thanks!

--
Tom

-----BEGIN PGP SIGNATURE-----
Version: FlowCrypt 7.7.7 Gmail Encryption
Comment: Seamlessly send and receive encrypted email

wsFcBAEBCAAGBQJe1pWTAAoJECfW4OyT2xPzMlgQAJVisTh8t9wGyC0vGmt0 B3vdRqbo2KyHILomQffFSvPxw2s3KiXSCYzL7rXe+rnSQhVAylnCoM2NQSxi 66alVw6yQzxdLSmOddQmemuH5AEpVV3XFRfG4t78upRarfDffQn2xAy0OFs4 /1jrAktvxcXvaZetwu3Idi/lzoFynqT44Nbv1xpjRJgGyTseZh9xXCB5f6rr sxQTAq5H7Ez+v2XkXtQLoJJnO51N4lBjjoXv+nbWYYBwBOLgOlQMXDNVpY4W mY4Dc71GEl2YH7tF7mpzKNZuOKUUpLlMh5FOm17QsL3XjuORIUhwUjKYKzIR kWRi/Inr4MoYH7eIlK/CCzXEMkrLSAkforcrN2kuolY229vGVuDiSUsrFawV xfsqGTLGKJmYnYXiBDNSrqOQGSk4UDLydP/EAGxyvwq4m2pVLRQlVxttfejU aD0eh1x6QLBTC2B55VlASyg8KFnobpUMJEWiMJMa3lcytbGLahqSbEax9ZF3 5rdsxWXuW6rv4zJvKzAnSt6dz3qI6vDJy3/5RoE0Zoxp9O5p7uSsTMPxpu2b bDYoJY4+Th5MNXQYb7F2WAj1G42a1J6QNM3RsTFbDULYCSLPxqa5dOhLJI+U Fv9ezGedKkAAhmeKhfFVqCX1O5UGIPrYfV5NRDRFVpmNXd4GjhRfSs0Ozfdw
D0ty
=Nf5n
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0x27D6E0EC93DB13F3.asc
Type: application/pgp-keys
Size: 3236 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200602/5df7ca30/attachment.key>

#5 lore raw

PATCH 1/1 : cmd: part: add part block command

Quoted 8 lines · razvan becheriu

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

setexpr can compute the divide/multiply part, but we still need to get the partition block size somehow.

I know that this is 0x200 by default, but we can not hardcode that in the scripts. we should read that from the partition info.

So there's plenty of examples today of hard-coding that value. Are you worried about a potential future change or an exists today problem you can't otherwise determine the hardware revision of at run-time? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200602/97f83999/attachment.sig>
#6 lore raw

PATCH 1/1 : cmd: part: add part block command

In reply to razvan becheriu

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

here is the implementation of the functions:

# function ota_conv_sizes
# Convert a bytes size to a block size
# input  bytesize : size in bytes to convert
# input  blksize  : size of a block in bytes
# output num_blk  : converted size in blocks
setenv ota_conv_sizes 'setexpr num_blk $bytesize / $blksize ; setexpr
mod_blk $bytesize % $blksize ; if itest $mod_blk > 0 ; then setexpr num_blk
$num_blk + 1; fi;'
# function ota_mmc_write
# Write a memory buffer to mmc drive
# input floadaddr    : address of buffer to write
# input u_part_start : block start in mmc
# input num_blk      : number of block to write
setenv ota_mmc_write 'if itest $ota_verbose == 1 ; then echo "mmc write
${floadaddr} ${u_part_start} ${num_blk};"; fi; mmc write $floadaddr
$u_part_start $num_blk; ret=$?; if itest $ret != 0 ; then setenv
ota_abort_reason "mmc write ${floadaddr} ${u_part_start} ${num_blk}
failed"; setenv ota_abort 1; fi;'

the old u-boot version supported 'part info mmc 0:${u_part_num} u_part_start u_part_sz u_part_blksz;' to get the block size.

# function ota_get_partition_attributes
# Retrieve partition attribute
# input  u_part_num   : partition number
# output u_part_start : partition start block number
# output u_part_sz    : partition size in blocks
# output u_part_blksz : partition block size in bytes
setenv ota_get_partition_attributes 'if itest $ota_verbose == 1 ; then echo
"part info mmc 0:${u_part_num} u_part_start u_part_sz u_part_blksz;"; fi;
part info mmc 0:${u_part_num} u_part_start u_part_sz u_part_blksz;ret=$?;
if itest $ret != 0 ; then setenv ota_abort_reason "part info mmc
0:${u_part_num} u_part_start u_part_sz u_part_blksz failed: ${ret}"; setenv
ota_abort 1; fi;'

the new u-boot does not, so we need an explicit command 'part block mmc 0 ${u_part_lbl} u_part_blksz;'

# function ota_get_partition_attributes_alternative
# Retrieve partition attribute
# input  u_part_lbl   : partition label
# output u_part_start : partition start block number
# output u_part_sz    : partition size in blocks
# output u_part_blksz : partition block size in bytes
setenv ota_get_partition_attributes_alternative 'if itest $ota_verbose == 1
; then echo "part start mmc 0 ${u_part_lbl} u_part_start; part size mmc 0
${u_part_lbl} u_part_sz; part block mmc 0 ${u_part_lbl} u_part_blksz;"; fi;
part start mmc 0 ${u_part_lbl} u_part_start;ret=$?; if itest $ret != 0 ;
then setenv ota_abort_reason "part start mmc 0 ${u_part_lbl} u_part_start
failed: ${ret}"; setenv ota_abort 1; fi; part size mmc 0 ${u_part_lbl}
u_part_sz;ret=$?; if itest $ret != 0 ; then setenv ota_abort_reason "part
size mmc 0 ${u_part_lbl} u_part_sz failed: ${ret}"; setenv ota_abort 1; fi;
part block mmc 0 ${u_part_lbl} u_part_blksz;ret=$?; if itest $ret != 0 ;
then setenv ota_abort_reason "part block mmc 0 ${u_part_lbl} u_part_blksz
failed: ${ret}"; setenv ota_abort 1; fi;'
Quoted 1 line · razvan.becheriu at gmail.com

setexpr can compute the divide/multiply part, but we still need to get

the

Quoted 31 lines

partition block size somehow.

I know that this is 0x200 by default, but we can not hardcode that in the scripts. we should read that from the partition info.

Quoted 1 line · trini at konsulko.com

On Mon, Jun 01, 2020 at 01:20:25PM +0300, razvan.becheriu at gmail.com

Quoted 23 lines · wrote:
Quoted 10 lines

The Intel Edison OTA process requires a conversion of data size from bytes to number of blocks. The following functions are used:

# function ota_conv_sizes
# Convert a bytes size to a block size
# input bytesize : size in bytes to convert
# input blksize : size of a block in bytes
# output num_blk : converted size in blocks

Quoted 8 lines

# function ota_mmc_write
# Write a memory buffer to mmc drive
# input floadaddr : address of buffer to write
# input u_part_start : block start in mmc
# input num_blk : number of block to write

This patch adds the cmd part sub-command 'block' which returns the partition block size in bytes.

This is usually done with the setexpr command today, thanks!

--
Tom

-----BEGIN PGP SIGNATURE-----
Version: FlowCrypt 7.7.7 Gmail Encryption
Comment: Seamlessly send and receive encrypted email

wsFcBAEBCAAGBQJe1pxAAAoJECfW4OyT2xPzxxwQAI5G7KPEypB2gBNWNKIt pH1MBgqMFC90mG8OtLjmCESVmiHZig/fzmEBbTIvyvE1KrEZfy4crjbrkkv3 gwv+Ro26HqtyuuuP0XjO/owWdDuAfdodwRb++YLnV8SgDvZhrf9ttcMX+OpT kxXunxw1OsAP7Y2S9TxL0ujkKjTxgVW9oRPwWus8c7IRzKrq9SEcob0BFkRV WrpiEa5K9RrXtsbRyw0OCY8vMr78f/6LJ91kNgGK0orYZF/gCEIw4gCHVopP 1x+O4JRhvxa7FGItB6Odrar01tqmIrSIFKfnyw7bzIXrxa/RLMU5nBLTPxUu 8rQkAGiuM2RwX+zK3odcczL1zXn1aXS+TJAvUYIJWpw1LxiGMc7SMBpegnov lp6J6imZ2MYMsQ9s0yrpkRST45Qid6qWsYspXu5ZJoEsX+rnmb72drm3PXbs 6Blu5H612nmsnuVAqtyR8H6ElvETpQtC9jFyD66LWXmRZyaeuywXxubiSW54 /VL2JiPC9Rm2weHASTyT1O9+IHyKU9uCBryvpMsf0geHiyaHxDEwIUfUuHiS DFCwbtxoG/nslEmw4CUZZ6dS22mPdAkUuc8oVPBTIf1mrF8AOM04XZHvYqNP GEPjWdGYnRLSB4WFxwxT4/5eSm76K72otMVsFPuUT4XvuUbMTSIpSNAh24az 9Q90
=sNXc
-----END PGP SIGNATURE-----

#7 lore raw

PATCH 1/1 : cmd: part: add part block command

Quoted 25 lines · razvan becheriu

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

here is the implementation of the functions:

# function ota_conv_sizes
# Convert a bytes size to a block size
# input  bytesize : size in bytes to convert
# input  blksize  : size of a block in bytes
# output num_blk  : converted size in blocks
setenv ota_conv_sizes 'setexpr num_blk $bytesize / $blksize ; setexpr
mod_blk $bytesize % $blksize ; if itest $mod_blk > 0 ; then setexpr num_blk
$num_blk + 1; fi;'
# function ota_mmc_write
# Write a memory buffer to mmc drive
# input floadaddr    : address of buffer to write
# input u_part_start : block start in mmc
# input num_blk      : number of block to write
setenv ota_mmc_write 'if itest $ota_verbose == 1 ; then echo "mmc write
${floadaddr} ${u_part_start} ${num_blk};"; fi; mmc write $floadaddr
$u_part_start $num_blk; ret=$?; if itest $ret != 0 ; then setenv
ota_abort_reason "mmc write ${floadaddr} ${u_part_start} ${num_blk}
failed"; setenv ota_abort 1; fi;'
Quoted 2 lines

the old u-boot version supported 'part info mmc 0:${u_part_num} u_part_start u_part_sz u_part_blksz;' to get the block size.

Old upstream U-Boot?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200602/cac556f5/attachment.sig>
#8 lore raw

PATCH 1/1 : cmd: part: add part block command

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

hm...

It seems that the changes never reached upstream:

git://github.com/01org/edison-u-boot.git branch edison-v2014.04

this branch was implementing 'part info' sub-command which was useful to retrieve partition info.

the new repo:

git://github.com/edison-fw/u-boot.git branch acpi-v2020.04 does implement 'part number' but does not implement neither 'info' or 'block'.

I do not insist for you to take this patch, but I think it is useful (it is the simplest version which supports all needed functionality).

If you think the same, let me know. I can change name of the sub-command or implement this in a different way, if needed.

Thank you,
Razvan

Quoted 6 lines · trini at konsulko.com
Quoted 5 lines · razvan becheriu

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

here is the implementation of the functions:

Quoted 7 lines
Quoted 7 lines
# function ota_conv_sizes
# Convert a bytes size to a block size
# input  bytesize : size in bytes to convert
# input  blksize  : size of a block in bytes
# output num_blk  : converted size in blocks
setenv ota_conv_sizes 'setexpr num_blk $bytesize / $blksize ; setexpr
mod_blk $bytesize % $blksize ; if itest $mod_blk > 0 ; then setexpr

num_blk

Quoted 13 lines
Quoted 13 lines

$num_blk + 1; fi;'

# function ota_mmc_write
# Write a memory buffer to mmc drive
# input floadaddr    : address of buffer to write
# input u_part_start : block start in mmc
# input num_blk      : number of block to write
setenv ota_mmc_write 'if itest $ota_verbose == 1 ; then echo "mmc write
${floadaddr} ${u_part_start} ${num_blk};"; fi; mmc write $floadaddr
$u_part_start $num_blk; ret=$?; if itest $ret != 0 ; then setenv
ota_abort_reason "mmc write ${floadaddr} ${u_part_start} ${num_blk}
failed"; setenv ota_abort 1; fi;'
Quoted 7 lines
Quoted 2 lines

the old u-boot version supported 'part info mmc 0:${u_part_num} u_part_start u_part_sz u_part_blksz;' to get the block size.

Old upstream U-Boot?

--
Tom

-----BEGIN PGP SIGNATURE-----
Version: FlowCrypt 7.7.7 Gmail Encryption
Comment: Seamlessly send and receive encrypted email

wsFcBAEBCAAGBQJe1qdHAAoJECfW4OyT2xPzjDsQAMJXfApPKklwOEWoUXdV NslWt02UhJrdgg5kztuPxiaHH5sdTEwBj98Ub6B8guhBDeIIoHPp8NYEyRLj MrCQTsAaM5+QyB1V2BVm7ZYEcTFrpAoaXy0gwKFKllzixpsGEv+99PqT5wDV ihGLwYWjoTZXCEVazYSoGPWp10s0qpkWmXsCHhGp8GYl1t5Ut0oif8RIx6jl xGIFXs9vpKi2jsklx4SYSNdpdMPjzB0y+ssG1T5VjovAmb6O/0y0Cv+i+ZYS UaoJRRMSpwHQ3UNVfuB4TdH7CRiDl8QX2mPCK28JYJSRqxHj7cyD8urp6brE 8xOzIcbb873I3BLXcITkIkcHBRvkp3durqWrmPcSRn0UtqdXaSKv1q9c3LeV 9rQNhE6vF2KmuKm8P5BuLNFUUlkRcf9umRDXm22e8Fah/S82WD08Uh+o5GBB YzLuXjFfKYCcyi/aQDl3OYpQ3fBZUrmAzJQpPJ/RpsmFAQTJH1QIq98P21Kx qTUCQPKpctgXlDxx3UgCitN/NXbGTXUVQmBvLZm62Ch750VaBtYf70tSzQYE n+p5P+EhEfy5MQmU9XWnJ1LIc9TirOGn7IUzu0p+BxT4b+qpazkWQUvhkNB5 R4rfUwr0wcouMi1jzgEinriYAhU90ezKZOBA2ENsr6aPnhgXwdG9nGEcCX4A UpZA
=OUpE
-----END PGP SIGNATURE-----

#9 lore raw

PATCH 1/1 : cmd: part: add part block command

Quoted 11 lines · razvan becheriu

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

hm...

It seems that the changes never reached upstream:

git://github.com/01org/edison-u-boot.git branch edison-v2014.04

this branch was implementing 'part info' sub-command which was useful to retrieve partition info.

Ah, I thought it might be something like this, thanks for digging in to it.

Quoted 10 lines

the new repo:

git://github.com/edison-fw/u-boot.git branch acpi-v2020.04 does implement 'part number' but does not implement neither 'info' or 'block'.

I do not insist for you to take this patch, but I think it is useful (it is the simplest version which supports all needed functionality).

If you think the same, let me know. I can change name of the sub-command or implement this in a different way, if needed.

I think for now I just want to defer on this. We just aren't at the point where we can't solve this by knowing ahead of time what the blocksize is. I'm sure it will be a problem at some point, but the other part of the problem is figuring out how to add this functionality in an opt-in way that still looks clean when written. If you have some ideas on that however, I'd be happy to review. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200605/11f1a986/attachment.sig>