Re: [PATCH v2 2/2] lmb: add max number of region in lmb_dump_region() output

2023-04-07 Thread Tom Rini
On Wed, Mar 22, 2023 at 07:12:26PM +0100, Patrick Delaunay wrote:

> Add the max number of region in lmb dump; this patch allows to
> check the limit for usage of the LMB regions, memory or reserved.
> 
> Result on STM32MP157C-DK2:
> 
> STM32MP> bdinfo
> .
> lmb_dump_all:
>  memory.cnt = 0x1 / max = 0x2
>  memory[0][0xc000-0xdfff], 0x2000 bytes flags: 0
>  reserved.cnt = 0x6 / max = 0x10
>  reserved[0]  [0x1000-0x10045fff], 0x00046000 bytes flags: 4
>  reserved[1]  [0x3000-0x3003], 0x0004 bytes flags: 4
>  reserved[2]  [0x3800-0x3800], 0x0001 bytes flags: 4
>  reserved[3]  [0xd400-0xd7ff], 0x0400 bytes flags: 4
>  reserved[4]  [0xdcae5000-0xdfff], 0x0351b000 bytes flags: 0
>  reserved[5]  [0xddafb5b8-0xdfff], 0x02504a48 bytes flags: 0
> 
> 
> Reported-by: Mark Millard 
> Signed-off-by: Patrick Delaunay 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


[PATCH v2 2/2] lmb: add max number of region in lmb_dump_region() output

2023-03-22 Thread Patrick Delaunay
Add the max number of region in lmb dump; this patch allows to
check the limit for usage of the LMB regions, memory or reserved.

Result on STM32MP157C-DK2:

STM32MP> bdinfo
.
lmb_dump_all:
 memory.cnt = 0x1 / max = 0x2
 memory[0]  [0xc000-0xdfff], 0x2000 bytes flags: 0
 reserved.cnt = 0x6 / max = 0x10
 reserved[0][0x1000-0x10045fff], 0x00046000 bytes flags: 4
 reserved[1][0x3000-0x3003], 0x0004 bytes flags: 4
 reserved[2][0x3800-0x3800], 0x0001 bytes flags: 4
 reserved[3][0xd400-0xd7ff], 0x0400 bytes flags: 4
 reserved[4][0xdcae5000-0xdfff], 0x0351b000 bytes flags: 0
 reserved[5][0xddafb5b8-0xdfff], 0x02504a48 bytes flags: 0


Reported-by: Mark Millard 
Signed-off-by: Patrick Delaunay 
---

(no changes since v1)

 lib/lmb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/lmb.c b/lib/lmb.c
index 8fbe453dfa9d..b2c233edb64e 100644
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -27,7 +27,7 @@ static void lmb_dump_region(struct lmb_region *rgn, char 
*name)
enum lmb_flags flags;
int i;
 
-   printf(" %s.cnt  = 0x%lx\n", name, rgn->cnt);
+   printf(" %s.cnt = 0x%lx / max = 0x%lx\n", name, rgn->cnt, rgn->max);
 
for (i = 0; i < rgn->cnt; i++) {
base = rgn->region[i].base;
-- 
2.25.1