Skip to content

ppc: qemu: Convert qemu-ppce500 to driver model and enable additional driver support

Bin Meng qemu-devel u-boot 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest38 patches 0 repliesNew
  2. v238 patches 1 replySuperseded
  3. v126 patches 1 replySuperseded

Changes in v3 from the cover letter

- rebase on top of u-boot/master

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/38pci: fsl_pci_init: Dynamically allocate the PCI regionsdrivers/pci/fsl_pci_init.c+5 -00 replies
2/38ppc: qemu: Update MAINTAINERS for correct email addressboard/freescale/qemu-ppce500/MAINTAINERS+1 -10 replies
3/38common: fdt_support: Support special case of PCI address in fdt_read_prop()common/fdt_support.c+17 -30 replies
4/38ppc: qemu: Support non-identity PCI bus addressboard/freescale/qemu-ppce500/qemu-ppce500.c+14 -151 reply
4/38ppc: qemu: Support non-identity PCI bus address+0 -01 reply
4/38ppc: qemu: Support non-identity PCI bus address+0 -01 reply
4/38ppc: qemu: Support non-identity PCI bus address+0 -01 reply
5/38ppc: qemu: Fix CONFIG_SYS_PCI_MAP_ENDinclude/configs/qemu-ppce500.h+1 -10 replies
6/38ppc: mpc85xx: Wrap LAW related codes with CONFIG_FSL_LAWarch/powerpc/cpu/mpc85xx/cpu.c arch/powerpc/cpu/mpc85xx/cpu_init_early.c+4 -01 reply
7/38ppc: qemu: Drop init_laws() and print_laws()board/freescale/qemu-ppce500/qemu-ppce500.c+0 -100 replies
8/38ppc: qemu: Drop board_early_init_f()board/freescale/qemu-ppce500/qemu-ppce500.c configs/qemu-ppce500_defconfig+0 -60 replies
9/38ppc: qemu: Enable OF_CONTROLboard/freescale/qemu-ppce500/qemu-ppce500.c configs/qemu-ppce500_defconfig+12 -10 replies
10/38ppc: qemu: Enable driver modelconfigs/qemu-ppce500_defconfig+2 -00 replies
11/38include: Remove extern from addr_map.hinclude/addr_map.h+4 -40 replies
12/38lib: addr_map: Move address_map[] type to the header fileinclude/addr_map.h lib/addr_map.c+9 -50 replies
13/38cmd: Add a command to display the address mapcmd/Kconfig cmd/Makefile cmd/addrmap.c +2 more+85 -01 reply
14/38test: cmd: Add a basic test for 'addrmap' commandinclude/test/suites.h test/cmd/Makefile test/cmd/addrmap.c +1 more+47 -01 reply
15/38lib: kconfig: Mention CONFIG_ADDR_MAP limitation in the helplib/Kconfig+2 -00 replies
16/38ppc: io.h: Use addrmap_ translation APIs only in post-relocation phasearch/powerpc/include/asm/io.h+9 -60 replies
17/38common: Move initr_addr_map() to a bit earliercommon/board_r.c+3 -31 reply
18/38ppc: qemu: Switch over to use DM serialboard/freescale/qemu-ppce500/qemu-ppce500.c configs/qemu-ppce500_defconfig include/configs/qemu-ppce500.h+7 -100 replies
19/38pci: mpc85xx: Wrap LAW programming with CONFIG_FSL_LAWdrivers/pci/pci_mpc85xx.c+4 -01 reply
20/38pci: mpc85xx: Support controller register physical address beyond 32-bitdrivers/pci/pci_mpc85xx.c+2 -30 replies
21/38pci: mpc85xx: Support 64-bit bus and cpu addressdrivers/pci/pci_mpc85xx.c+8 -80 replies
22/38ppc: qemu: Switch over to use DM ETH and PCIboard/freescale/qemu-ppce500/qemu-ppce500.c configs/qemu-ppce500_defconfig include/configs/qemu-ppce500.h+24 -1040 replies
23/38ppc: qemu: Drop CONFIG_OF_BOARD_SETUPboard/freescale/qemu-ppce500/qemu-ppce500.c configs/qemu-ppce500_defconfig+0 -80 replies
24/38cmd: Fix virtio command dependencycmd/Kconfig+1 -00 replies
25/38ppc: qemu: Enable VirtIO NET supportboard/freescale/qemu-ppce500/qemu-ppce500.c configs/qemu-ppce500_defconfig+10 -00 replies
26/38virtio: Fix VirtIO BLK driver dependencydrivers/virtio/Kconfig+1 -00 replies
27/38ppc: qemu: Enable VirtIO BLK supportconfigs/qemu-ppce500_defconfig+3 -00 replies
28/38ppc: mpc85xx: Add 'gpibe' register to 'struct ccsr_gpio'arch/powerpc/include/asm/immap_85xx.h+1 -00 replies
29/38gpio: mpc8xxx: Support controller register physical address beyond 32-bitarch/powerpc/include/asm/arch-mpc85xx/gpio.h drivers/gpio/mpc8xxx_gpio.c+5 -40 replies
30/38ppc: qemu: Enable GPIO supportconfigs/qemu-ppce500_defconfig+3 -00 replies
31/38dm: sysreset: Add a Kconfig option for the 'reset' commanddrivers/sysreset/Kconfig drivers/sysreset/sysreset-uclass.c+8 -01 reply
32/38ppc: qemu: Enable support for power off via GPIOconfigs/qemu-ppce500_defconfig+5 -10 replies
33/38ppc: qemu: Enable RTC support via I2Cconfigs/qemu-ppce500_defconfig include/configs/qemu-ppce500.h+6 -00 replies
34/38ppc: qemu: Delete the temporary FDT virtual-physical mapping after U-Boot is relocatedboard/freescale/qemu-ppce500/qemu-ppce500.c+10 -10 replies
35/38ppc: qemu: Drop a custom env variable 'fdt_addr_r'board/freescale/qemu-ppce500/qemu-ppce500.c include/configs/qemu-ppce500.h+1 -40 replies
36/38ppc: qemu: Drop fixed_sdram()board/freescale/qemu-ppce500/qemu-ppce500.c+0 -50 replies
37/38ppc: qemu: Move board directory from board/freescale to board/emulationarch/powerpc/cpu/mpc85xx/Kconfig board/emulation/qemu-ppce500/Kconfig board/emulation/qemu-ppce500/MAINTAINERS +2 more+5 -30 replies
38/38doc: Add a reST document for qemu-ppce500doc/board/emulation/index.rst doc/board/emulation/qemu-ppce500.rst+89 -00 replies

Reviews trailers per patch

35 of 41 patches have a Reviewed-by or Acked-by.

PatchSimon GlassPriyanka JainHeiko Schocher
1/38R-b
2/38R-b R-b
3/38R-b R-b
4/38
4/38
4/38
4/38
5/38R-b
6/38R-b
7/38
8/38R-b
9/38R-b R-b
10/38R-b R-b
11/38R-b R-b
12/38R-b R-b
13/38R-b R-b
14/38R-b
15/38R-b R-b
16/38R-b
17/38R-b R-b
18/38R-b R-b
19/38R-b R-b
20/38R-b R-b
21/38R-b
22/38R-b R-b
23/38
24/38R-b R-b
25/38R-b
26/38R-b R-b
27/38R-b
28/38R-b
29/38R-b
30/38R-b
31/38R-b R-b
32/38R-b
33/38R-b
34/38R-b
35/38R-b
36/38R-b
37/38R-b
38/38R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/38] ppc: qemu: Convert qemu-ppce500 to driver model and enable additional driver support

At present when building qemu-ppce500 the following warnings are seen:

===================== WARNING ====================== This board does not use CONFIG_DM. CONFIG_DM will be compulsory starting with the v2020.01 release. Failure to update may result in board removal.
UPD include/generated/timestamp_autogenerated.h
See doc/driver-model/migration.rst for more info.
====================================================
===================== WARNING ====================== This board does not use CONFIG_DM_PCI Please update the board to use CONFIG_DM_PCI before the v2019.07 release. Failure to update by the deadline may result in board removal. See doc/driver-model/migration.rst for more info.
====================================================
===================== WARNING ====================== This board does not use CONFIG_DM_ETH (Driver Model for Ethernet drivers). Please update the board to use CONFIG_DM_ETH before the v2020.07 release. Failure to update by the deadline may result in board removal. See doc/driver-model/migration.rst for more info.
====================================================

The conversion of qemu-ppce500 board to driver model is long overdue.

When testing the exisitng qemu-ppce500 support, PCI was found broken. This is caused by 2 separate issues:

- One issue was caused by U-Boot:
Commit e002474158d1 ("pci: pci-uclass: Dynamically allocate the PCI regions") Patch #1 updated the non-DM fsl_pci_init driver to dynamically allocate the PCI regions, to keep in sync with the pci uclass driver
- One issue was caused by QEMU:
commit e6b4e5f4795b ("PPC: e500: Move CCSR and MMIO space to upper end of address space") commit cb3778a0455a ("PPC: e500 pci host: Add support for ATMUs")
Patch #3-4 fixed this issue to keep in sync with latest QEMU upstream

Patch #5-8, #34-36 are minor fixes and clean-ups.

Starting from patch#9, these are driver model conversion patches.

Patch #11-17 are mainly related to CONFIG_ADDR_MAP, a library to support targets that have non-identity virtual-physical address mappings. A new command 'addrmap' is introduced to aid debugging, and a fix to arch/powerpc/asm/include/io.h is made to correct the usage of CONFIG_ADDR_MAP as it can only be used in the post- relocation phase. Also the initialization of this library is moved a bit earlier in the post-relocation phase otherwise device drivers won't work.

Patch #19-21 are 85xx PCI driver fixes. It adds support to controller register physical address beyond 32-bit, as well as support to 64-bit bus and cpu address as current upstream QEMU uses 64-bit cpu address.

Starting from patch#24, these are additional driver support patches.

Patch #24, #26 are minor fix to the 'virtio' command and BLK driver dependency.

Patch #25 enables the VirtIO NET support as by default a VirtIO standard PCI networking device is connected as an ethernet interface at PCI address 0.1.0.

Patch #27 enables the VirtIO BLK driver support.

Patch #28-30 enables the GPIO support.

Patch #31-32 enables poweroff via GPIO.

Patch #33 enables RTC over the I2C bus.

Patch #37 moves the qemu-ppce500 boards codes to board/emulation as that is the place for other QEMU targets like x86, arm, riscv.

Patch #38 adds a reST document to describe how to build and run U-Boot for the QEMU ppce500 machine.

I hope we can make this series to U-Boot v2021.04 release.

This series is available at u-boot-x86/qemu-ppc for testing.

This cover letter is cc'ed to QEMU mailing list for a heads-up. A future patch will be sent to QEMU mailing list to bring its in-tree U-Boot source codes up-to-date.

Changes in v3:
- rebase on top of u-boot/master

Changes in v2:
- drop the revert patch of commit e002474158d1
- new patch: pci: fsl_pci_init: Dynamically allocate the PCI regions
- add more details in the commit message, and put some comments
in the codes to explain why
- add doc/usage/addrmap.rst
- new patch: test: cmd: Add a basic test for 'addrmap' command
- new patch: virtio: Fix VirtIO BLK driver dependency
- new patch: ppc: qemu: Enable VirtIO BLK support
- new patch: ppc: mpc85xx: Add 'gpibe' register to 'struct ccsr_gpio'
- new patch: gpio: mpc8xxx: Support controller register physical address beyond 32-bit
- new patch: ppc: qemu: Enable GPIO support
- new patch: dm: sysreset: Add a Kconfig option for the 'reset' command
- new patch: ppc: qemu: Enable support for power off via GPIO
- new patch: ppc: qemu: Enable RTC support via I2C
- new patch: ppc: qemu: Delete the temporary FDT virtual-physical mapping after U-Boot is relocated
- new patch: ppc: qemu: Drop a custom env variable 'fdt_addr_r'
- new patch: ppc: qemu: Drop fixed_sdram()
- add descriptions for VirtIO BLK, RTC and power off

Bin Meng (38):
pci: fsl_pci_init: Dynamically allocate the PCI regions
ppc: qemu: Update MAINTAINERS for correct email address
common: fdt_support: Support special case of PCI address in

    fdt_read_prop()
  ppc: qemu: Support non-identity PCI bus address
  ppc: qemu: Fix CONFIG_SYS_PCI_MAP_END
  ppc: mpc85xx: Wrap LAW related codes with CONFIG_FSL_LAW
  ppc: qemu: Drop init_laws() and print_laws()
  ppc: qemu: Drop board_early_init_f()
  ppc: qemu: Enable OF_CONTROL
  ppc: qemu: Enable driver model
  include: Remove extern from addr_map.h
  lib: addr_map: Move address_map[] type to the header file
  cmd: Add a command to display the address map
  test: cmd: Add a basic test for 'addrmap' command
  lib: kconfig: Mention CONFIG_ADDR_MAP limitation in the help
  ppc: io.h: Use addrmap_ translation APIs only in post-relocation phase
  common: Move initr_addr_map() to a bit earlier
  ppc: qemu: Switch over to use DM serial
  pci: mpc85xx: Wrap LAW programming with CONFIG_FSL_LAW
  pci: mpc85xx: Support controller register physical address beyond
    32-bit
  pci: mpc85xx: Support 64-bit bus and cpu address
  ppc: qemu: Switch over to use DM ETH and PCI
  ppc: qemu: Drop CONFIG_OF_BOARD_SETUP
  cmd: Fix virtio command dependency
  ppc: qemu: Enable VirtIO NET support
  virtio: Fix VirtIO BLK driver dependency
  ppc: qemu: Enable VirtIO BLK support
  ppc: mpc85xx: Add 'gpibe' register to 'struct ccsr_gpio'
  gpio: mpc8xxx: Support controller register physical address beyond
    32-bit

ppc: qemu: Enable GPIO support
dm: sysreset: Add a Kconfig option for the 'reset' command
ppc: qemu: Enable support for power off via GPIO
ppc: qemu: Enable RTC support via I2C
ppc: qemu: Delete the temporary FDT virtual-physical mapping after
U-Boot is relocated
ppc: qemu: Drop a custom env variable 'fdt_addr_r'
ppc: qemu: Drop fixed_sdram()
ppc: qemu: Move board directory from board/freescale to
board/emulation
doc: Add a reST document for qemu-ppce500

 arch/powerpc/cpu/mpc85xx/Kconfig                   |   2 +-
 arch/powerpc/cpu/mpc85xx/cpu.c                     |   2 +
 arch/powerpc/cpu/mpc85xx/cpu_init_early.c          |   2 +
 arch/powerpc/include/asm/arch-mpc85xx/gpio.h       |   2 +-
 arch/powerpc/include/asm/immap_85xx.h              |   1 +
 arch/powerpc/include/asm/io.h                      |  15 +-
 .../{freescale => emulation}/qemu-ppce500/Kconfig  |   2 +-
 board/emulation/qemu-ppce500/MAINTAINERS           |   7 +
 .../{freescale => emulation}/qemu-ppce500/Makefile |   0
 .../qemu-ppce500/qemu-ppce500.c                    | 178 +++++++--------------
 board/freescale/qemu-ppce500/MAINTAINERS           |   6 -
 cmd/Kconfig                                        |   8 +
 cmd/Makefile                                       |   1 +
 cmd/addrmap.c                                      |  35 ++++
 common/board_r.c                                   |   6 +-
 common/fdt_support.c                               |  20 ++-
 configs/qemu-ppce500_defconfig                     |  27 +++-
 doc/board/emulation/index.rst                      |   1 +
 doc/board/emulation/qemu-ppce500.rst               |  88 ++++++++++
 doc/usage/addrmap.rst                              |  41 +++++
 doc/usage/index.rst                                |   1 +
 drivers/gpio/mpc8xxx_gpio.c                        |   7 +-
 drivers/pci/fsl_pci_init.c                         |   5 +
 drivers/pci/pci_mpc85xx.c                          |  25 +--
 drivers/sysreset/Kconfig                           |   6 +
 drivers/sysreset/sysreset-uclass.c                 |   2 +
 drivers/virtio/Kconfig                             |   1 +
 include/addr_map.h                                 |  16 +-
 include/configs/qemu-ppce500.h                     |  30 +---
 include/test/suites.h                              |   2 +
 lib/Kconfig                                        |   2 +
 lib/addr_map.c                                     |   6 +-
 test/cmd/Makefile                                  |   1 +
 test/cmd/addrmap.c                                 |  38 +++++
 test/cmd_ut.c                                      |   6 +
 35 files changed, 397 insertions(+), 195 deletions(-)
 rename board/{freescale => emulation}/qemu-ppce500/Kconfig (86%)
 create mode 100644 board/emulation/qemu-ppce500/MAINTAINERS
 rename board/{freescale => emulation}/qemu-ppce500/Makefile (100%)
 rename board/{freescale => emulation}/qemu-ppce500/qemu-ppce500.c (65%)
 delete mode 100644 board/freescale/qemu-ppce500/MAINTAINERS
 create mode 100644 cmd/addrmap.c
 create mode 100644 doc/board/emulation/qemu-ppce500.rst
 create mode 100644 doc/usage/addrmap.rst
 create mode 100644 test/cmd/addrmap.c
Signature · 1 line
2.7.4