Skip to content
  • Daniel Henrique Barboza's avatar
    bf353ad5
    qmp/hmp, device_tree.c: introduce dumpdtb · bf353ad5
    Daniel Henrique Barboza authored
    
    
    To save the FDT blob we have the '-machine dumpdtb=<file>' property.
    With this property set, the machine saves the FDT in <file> and exit.
    The created file can then be converted to plain text dts format using
    'dtc'.
    
    There's nothing particularly sophisticated into saving the FDT that
    can't be done with the machine at any state, as long as the machine has
    a valid FDT to be saved.
    
    The 'dumpdtb' command receives a 'filename' parameter and, if the FDT is
    available via current_machine->fdt, save it in dtb format to 'filename'.
    In short, this is a '-machine dumpdtb' that can be fired on demand via
    QMP/HMP.
    
    This command will always be executed in-band (i.e. holding BQL),
    avoiding potential race conditions with machines that might change the
    FDT during runtime (e.g. PowerPC 'pseries' machine).
    
    Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Cc: Markus Armbruster <armbru@redhat.com>
    Cc: Alistair Francis <alistair.francis@wdc.com>
    Cc: David Gibson <david@gibson.dropbear.id.au>
    Acked-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
    Message-Id: <20220926173855.1159396-2-danielhb413@gmail.com>
    bf353ad5
    qmp/hmp, device_tree.c: introduce dumpdtb
    Daniel Henrique Barboza authored
    
    
    To save the FDT blob we have the '-machine dumpdtb=<file>' property.
    With this property set, the machine saves the FDT in <file> and exit.
    The created file can then be converted to plain text dts format using
    'dtc'.
    
    There's nothing particularly sophisticated into saving the FDT that
    can't be done with the machine at any state, as long as the machine has
    a valid FDT to be saved.
    
    The 'dumpdtb' command receives a 'filename' parameter and, if the FDT is
    available via current_machine->fdt, save it in dtb format to 'filename'.
    In short, this is a '-machine dumpdtb' that can be fired on demand via
    QMP/HMP.
    
    This command will always be executed in-band (i.e. holding BQL),
    avoiding potential race conditions with machines that might change the
    FDT during runtime (e.g. PowerPC 'pseries' machine).
    
    Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Cc: Markus Armbruster <armbru@redhat.com>
    Cc: Alistair Francis <alistair.francis@wdc.com>
    Cc: David Gibson <david@gibson.dropbear.id.au>
    Acked-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
    Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
    Message-Id: <20220926173855.1159396-2-danielhb413@gmail.com>
Loading