qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/31] PPC: mpc8544ds: Create device tree dynamically
@ 2012-06-05 23:52 Alexander Graf
  2012-06-05 23:52 ` [Qemu-devel] [PATCH 01/31] dt: allow add_subnode to create root subnodes Alexander Graf
                   ` (31 more replies)
  0 siblings, 32 replies; 63+ messages in thread
From: Alexander Graf @ 2012-06-05 23:52 UTC (permalink / raw)
  To: qemu-devel@nongnu.org Developers; +Cc: qemu-ppc Mailing List

Today we have two separate places where we keep information which device
is where:

  - hw/ppce500_mpc8544ds.c to instantiate all devices
  - pc-bios/mpc8544ds.dtb as device tree to tell the guest about devices

Every time we split crucial information, things can go terribly wrong. If
you update one file, but not the other, you can screw things up without
realizing it quickly.

The redundancy is also unnecessary, because QEMU already knows all the
information at which addresses its devices live. So we can generate the
device tree from the same variables - and even have the device tree adjust
if something changes in there.

The one functionality we lose with this approach is the ability to manually
patch the device tree to contain additional devices. To still be able to do
so easily, we introduce a new option -machine dumpdtb=<file> that creates a
dtb output file which can be used with -machine dtb=<file> later. In between
these 2 executions of QEMU, the dtb can be modified however much you like.

A lot of bits in this patch set are still hardcoded. We also don't accomodate
for dynamic creation of device tree nodes when -device is used. This requires
a bit more QOM'ification for us to be able to loop through all devices, so we
can dynamically create the device tree nodes for them. The basic concept should
still hold as is though.


Alex

v1 -> v2:

  - rename cell64 -> u64
  - don't treat memory as single u64
  - remove commit id from patch description
  - NEW: PPC: e500: Use new MPIC dt format
         PPC: e500: Use new SOC dt format
         PPC: e500: Define addresses as always 64bit
         PPC: e500: Extend address/size of / to 64bit
         dt: Add global option to set phandle start offset
         PPC: e500: Refactor serial dt generation

Alexander Graf (31):
  dt: allow add_subnode to create root subnodes
  dt: add helpers for 2, 3 and 4 cell adds
  dt: add helper for phandle references
  dt: temporarily disable subtree creation failure check
  dt: add helper for phandle enumeration
  dt: add helper for empty dt creation
  dt: add helper for phandle allocation
  dt: add helper for 64bit cell adds
  PPC: e500: require libfdt
  PPC: e500: dt: create memory node dynamically
  PPC: e500: dt: create /cpus node dynamically
  PPC: e500: dt: create /hypervisor node dynamically
  PPC: e500: dt: create / node dynamically
  PPC: e500: dt: create /chosen node dynamically
  PPC: e500: dt: create /soc8544 node dynamically
  PPC: e500: dt: create serial nodes dynamically
  PPC: e500: dt: create mpic node dynamically
  PPC: e500: dt: create global-utils node dynamically
  PPC: e500: dt: create pci node dynamically
  PPC: e500: dt: start with empty device tree
  dt: Add -machine dumpdtb option to dump the current dtb
  PPC: e500: dt: use 64bit cell helper
  PPC: e500: dt: use target_phys_addr_t for ramsize
  PPC: e500: enable manual loading of dtb blob
  Revert "dt: temporarily disable subtree creation failure check"
  PPC: e500: Use new MPIC dt format
  PPC: e500: Use new SOC dt format
  PPC: e500: Define addresses as always 64bit
  PPC: e500: Extend address/size of / to 64bit
  dt: Add global option to set phandle start offset
  PPC: e500: Refactor serial dt generation

 Makefile               |    1 -
 Makefile.target        |    2 +-
 device_tree.c          |  134 +++++++++++++++++++++++++++-
 device_tree.h          |   16 +++
 hw/ppce500_mpc8544ds.c |  237 +++++++++++++++++++++++++++++++++++++++++------
 pc-bios/mpc8544ds.dtb  |  Bin 2028 -> 0 bytes
 pc-bios/mpc8544ds.dts  |  119 ------------------------
 qemu-config.c          |    8 ++
 roms/openbios          |    2 +-
 9 files changed, 365 insertions(+), 154 deletions(-)
 delete mode 100644 pc-bios/mpc8544ds.dtb
 delete mode 100644 pc-bios/mpc8544ds.dts

^ permalink raw reply	[flat|nested] 63+ messages in thread
* [Qemu-devel] [PATCH 00/31] PPC: mpc8544ds: Create device tree dynamically
@ 2012-06-19 19:14 Alexander Graf
  2012-06-19 19:14 ` [Qemu-devel] [PATCH 04/31] dt: temporarily disable subtree creation failure check Alexander Graf
  0 siblings, 1 reply; 63+ messages in thread
From: Alexander Graf @ 2012-06-19 19:14 UTC (permalink / raw)
  To: qemu-devel qemu-devel; +Cc: qemu-ppc Mailing List

Today we have two separate places where we keep information which device
is where:

  - hw/ppce500_mpc8544ds.c to instantiate all devices
  - pc-bios/mpc8544ds.dtb as device tree to tell the guest about devices

Every time we split crucial information, things can go terribly wrong. If
you update one file, but not the other, you can screw things up without
realizing it quickly.

The redundancy is also unnecessary, because QEMU already knows all the
information at which addresses its devices live. So we can generate the
device tree from the same variables - and even have the device tree adjust
if something changes in there.

The one functionality we lose with this approach is the ability to manually
patch the device tree to contain additional devices. To still be able to do
so easily, we introduce a new option -machine dumpdtb=<file> that creates a
dtb output file which can be used with -machine dtb=<file> later. In between
these 2 executions of QEMU, the dtb can be modified however much you like.

A lot of bits in this patch set are still hardcoded. We also don't accomodate
for dynamic creation of device tree nodes when -device is used. This requires
a bit more QOM'ification for us to be able to loop through all devices, so we
can dynamically create the device tree nodes for them. The basic concept should
still hold as is though.


Alex

v1 -> v2:

  - rename cell64 -> u64
  - don't treat memory as single u64
  - remove commit id from patch description
  - NEW: PPC: e500: Use new MPIC dt format
         PPC: e500: Use new SOC dt format
         PPC: e500: Define addresses as always 64bit
         PPC: e500: Extend address/size of / to 64bit
         dt: Add global option to set phandle start offset
         PPC: e500: Refactor serial dt generation

v2 -> v3:

  - [phandle helper] rename "string" to target_node_path
  - [phandle helper] add correct header includes
  - use snprintf
  - create and use new multi-cell setting api

Alexander Graf (31):
  dt: allow add_subnode to create root subnodes
  dt: add helpers for multi-cell adds
  dt: add helper for phandle references
  dt: temporarily disable subtree creation failure check
  dt: add helper for phandle enumeration
  dt: add helper for empty dt creation
  dt: add helper for phandle allocation
  dt: add helper for 64bit cell adds
  PPC: e500: require libfdt
  PPC: e500: dt: create memory node dynamically
  PPC: e500: dt: create /cpus node dynamically
  PPC: e500: dt: create /hypervisor node dynamically
  PPC: e500: dt: create / node dynamically
  PPC: e500: dt: create /chosen node dynamically
  PPC: e500: dt: create /soc8544 node dynamically
  PPC: e500: dt: create serial nodes dynamically
  PPC: e500: dt: create mpic node dynamically
  PPC: e500: dt: create global-utils node dynamically
  PPC: e500: dt: create pci node dynamically
  PPC: e500: dt: start with empty device tree
  dt: Add -machine dumpdtb option to dump the current dtb
  PPC: e500: dt: use 64bit cell helper
  PPC: e500: dt: use target_phys_addr_t for ramsize
  PPC: e500: enable manual loading of dtb blob
  Revert "dt: temporarily disable subtree creation failure check"
  PPC: e500: Use new MPIC dt format
  PPC: e500: Use new SOC dt format
  PPC: e500: Define addresses as always 64bit
  PPC: e500: Extend address/size of / to 64bit
  dt: Add global option to set phandle start offset
  PPC: e500: Refactor serial dt generation

 Makefile               |    1 -
 device_tree.c          |  106 +++++++++++++++++++++-
 device_tree.h          |   20 ++++
 hw/ppc/Makefile.objs   |    2 +-
 hw/ppce500_mpc8544ds.c |  237 +++++++++++++++++++++++++++++++++++++++++------
 pc-bios/mpc8544ds.dtb  |  Bin 2028 -> 0 bytes
 pc-bios/mpc8544ds.dts  |  119 ------------------------
 qemu-config.c          |    8 ++
 8 files changed, 340 insertions(+), 153 deletions(-)
 delete mode 100644 pc-bios/mpc8544ds.dtb
 delete mode 100644 pc-bios/mpc8544ds.dts

^ permalink raw reply	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2012-06-19 19:15 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-05 23:52 [Qemu-devel] [PATCH 00/31] PPC: mpc8544ds: Create device tree dynamically Alexander Graf
2012-06-05 23:52 ` [Qemu-devel] [PATCH 01/31] dt: allow add_subnode to create root subnodes Alexander Graf
2012-06-06  5:30   ` Peter Crosthwaite
2012-06-05 23:52 ` [Qemu-devel] [PATCH 02/31] dt: add helpers for 2, 3 and 4 cell adds Alexander Graf
2012-06-06  5:01   ` Peter Crosthwaite
2012-06-06 15:55     ` Alexander Graf
2012-06-06 21:52       ` Scott Wood
2012-06-06 23:45         ` [Qemu-devel] [Qemu-ppc] " David Gibson
2012-06-07 11:27           ` Alexander Graf
2012-06-07 12:13             ` David Gibson
2012-06-08 13:00               ` Alexander Graf
2012-06-08 14:15                 ` David Gibson
2012-06-05 23:52 ` [Qemu-devel] [PATCH 03/31] dt: add helper for phandle references Alexander Graf
2012-06-06  5:06   ` Peter Crosthwaite
2012-06-05 23:52 ` [Qemu-devel] [PATCH 04/31] dt: temporarily disable subtree creation failure check Alexander Graf
2012-06-06  5:32   ` Peter Crosthwaite
2012-06-06 15:58     ` Alexander Graf
2012-06-05 23:52 ` [Qemu-devel] [PATCH 05/31] dt: add helper for phandle enumeration Alexander Graf
2012-06-06  5:11   ` Peter Crosthwaite
2012-06-06 15:58     ` Alexander Graf
2012-06-07  0:28       ` Peter Crosthwaite
2012-06-08 12:46         ` Alexander Graf
2012-06-09  1:02           ` Peter Crosthwaite
2012-06-19 14:03             ` Alexander Graf
2012-06-05 23:52 ` [Qemu-devel] [PATCH 06/31] dt: add helper for empty dt creation Alexander Graf
2012-06-06  5:34   ` Peter Crosthwaite
2012-06-05 23:52 ` [Qemu-devel] [PATCH 07/31] dt: add helper for phandle allocation Alexander Graf
2012-06-06  5:18   ` Peter Crosthwaite
2012-06-06 16:00     ` Alexander Graf
2012-06-06 16:55       ` Scott Wood
2012-06-07  0:15         ` Peter Crosthwaite
2012-06-07  0:31           ` Scott Wood
2012-06-05 23:52 ` [Qemu-devel] [PATCH 08/31] dt: add helper for 64bit cell adds Alexander Graf
2012-06-06  5:20   ` Peter Crosthwaite
2012-06-05 23:53 ` [Qemu-devel] [PATCH 09/31] PPC: e500: require libfdt Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 10/31] PPC: e500: dt: create memory node dynamically Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 11/31] PPC: e500: dt: create /cpus " Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 12/31] PPC: e500: dt: create /hypervisor " Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 13/31] PPC: e500: dt: create / " Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 14/31] PPC: e500: dt: create /chosen " Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 15/31] PPC: e500: dt: create /soc8544 " Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 16/31] PPC: e500: dt: create serial nodes dynamically Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 17/31] PPC: e500: dt: create mpic node dynamically Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 18/31] PPC: e500: dt: create global-utils " Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 19/31] PPC: e500: dt: create pci " Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 20/31] PPC: e500: dt: start with empty device tree Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 21/31] dt: Add -machine dumpdtb option to dump the current dtb Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 22/31] PPC: e500: dt: use 64bit cell helper Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 23/31] PPC: e500: dt: use target_phys_addr_t for ramsize Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 24/31] PPC: e500: enable manual loading of dtb blob Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 25/31] Revert "dt: temporarily disable subtree creation failure check" Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 26/31] PPC: e500: Use new MPIC dt format Alexander Graf
2012-06-07 21:08   ` [Qemu-devel] [Qemu-ppc] " Blue Swirl
2012-06-05 23:53 ` [Qemu-devel] [PATCH 27/31] PPC: e500: Use new SOC " Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 28/31] PPC: e500: Define addresses as always 64bit Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 29/31] PPC: e500: Extend address/size of / to 64bit Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 30/31] dt: Add global option to set phandle start offset Alexander Graf
2012-06-05 23:53 ` [Qemu-devel] [PATCH 31/31] PPC: e500: Refactor serial dt generation Alexander Graf
2012-06-07 21:09 ` [Qemu-devel] [PATCH 00/31] PPC: mpc8544ds: Create device tree dynamically Blue Swirl
2012-06-19 12:54   ` Alexander Graf
2012-06-19 18:39     ` Blue Swirl
2012-06-19 19:14       ` Alexander Graf
  -- strict thread matches above, loose matches on Subject: below --
2012-06-19 19:14 Alexander Graf
2012-06-19 19:14 ` [Qemu-devel] [PATCH 04/31] dt: temporarily disable subtree creation failure check Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).