[U-Boot] [PATCH 26/30] bdinfo: riscv: print fdt_blob address

Rick Chen rickchen36 at gmail.com
Wed Oct 24 06:54:58 UTC 2018


> > > Print the address of the u-boot device tree.
> > >
> >
> > This is unnecessary as it is already done by 'fdt' command.
> >

Hi Bin & Lukas

At the beginning, I really don't understand the fdt Usage:
Maybe I am not so familiar with fdt.
I can't find any string about fdt_blob. It seem not describe so clearly
After I trace fdt.c, I finally know to get it as below.

RISC-V # bdinfo
boot_params = 0x00000400
...
baudrate    = 38400 bps
fdt_blob    = 0x3FF0F340
RISC-V #

RISC-V # fdt addr -c
The address of the fdt is 0x3ff0f340

Usage:
fdt addr [-c]  <addr> [<length>]   - Set the [control] fdt location to <addr>
fdt move   <fdt> <newaddr> <length> - Copy the fdt to <addr> and make it active
fdt resize [<extrasize>]            - Resize fdt to size + padding to
4k addr + some optional <extrasize> if needed
fdt print  <path> [<prop>]          - Recursive print starting at <path>
fdt list   <path> [<prop>]          - Print one level starting at <path>
fdt get value <var> <path> <prop>   - Get <property> and store in <var>
fdt get name <var> <path> <index>   - Get name of node <index> and
store in <var>
fdt get addr <var> <path> <prop>    - Get start address of <property>
and store in <var>
fdt get size <var> <path> [<prop>]  - Get size of [<property>] or num
nodes and store in <var>
fdt set    <path> <prop> [<val>]    - Set <property> [to <val>]
fdt mknode <path> <node>            - Create a new node after <path>
fdt rm     <path> [<prop>]          - Delete the node or <property>
fdt header                          - Display header info
fdt bootcpu <id>                    - Set boot cpuid
fdt memory <addr> <size>            - Add/Update memory node
fdt rsvmem print                    - Show current mem reserves
fdt rsvmem add <addr> <size>        - Add a mem reserve
fdt rsvmem delete <index>           - Delete a mem reserves
fdt chosen [<start> <end>]          - Add/update the /chosen branch in the tree
                                        <start>/<end> - initrd start/end addr

It seem that other arch (MICROBLAZE, ARM) also print fdt_blob in bdinfo cmd.
So I think this patch can be accepted.

Reviewed-by: Rick Chen <rick at andestech.com>

Rick


> > > Signed-off-by: Lukas Auer <lukas.auer at aisec.fraunhofer.de>
> > > ---
> > >
> > >  cmd/bdinfo.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> >
> > Regards,
> > Bin


More information about the U-Boot mailing list