[PATCH v3 0/7] Enable Cubieboard A10 boot SPL from SD card

Strahinja Jankovic posted 7 patches 1 year, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221226220303.14420-1-strahinja.p.jankovic@gmail.com
Maintainers: Beniamino Galvani <b.galvani@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Strahinja Jankovic <strahinja.p.jankovic@gmail.com>, Niek Linnenbank <nieklinnenbank@gmail.com>, Cleber Rosa <crosa@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>
MAINTAINERS                           |   2 +
docs/system/arm/cubieboard.rst        |   1 +
docs/system/arm/orangepi.rst          |   1 +
hw/arm/Kconfig                        |   5 +
hw/arm/allwinner-a10.c                |  40 +++
hw/arm/allwinner-h3.c                 |  11 +-
hw/arm/cubieboard.c                   |  11 +
hw/i2c/Kconfig                        |   4 +
hw/i2c/allwinner-i2c.c                | 459 ++++++++++++++++++++++++++
hw/i2c/meson.build                    |   1 +
hw/i2c/trace-events                   |   5 +
hw/misc/Kconfig                       |  10 +
hw/misc/allwinner-a10-ccm.c           | 224 +++++++++++++
hw/misc/allwinner-a10-dramc.c         | 179 ++++++++++
hw/misc/axp209.c                      | 238 +++++++++++++
hw/misc/meson.build                   |   3 +
hw/misc/trace-events                  |   5 +
include/hw/arm/allwinner-a10.h        |  27 ++
include/hw/arm/allwinner-h3.h         |   3 +
include/hw/i2c/allwinner-i2c.h        |  55 +++
include/hw/misc/allwinner-a10-ccm.h   |  67 ++++
include/hw/misc/allwinner-a10-dramc.h |  68 ++++
tests/avocado/boot_linux_console.py   |  47 +++
23 files changed, 1465 insertions(+), 1 deletion(-)
create mode 100644 hw/i2c/allwinner-i2c.c
create mode 100644 hw/misc/allwinner-a10-ccm.c
create mode 100644 hw/misc/allwinner-a10-dramc.c
create mode 100644 hw/misc/axp209.c
create mode 100644 include/hw/i2c/allwinner-i2c.h
create mode 100644 include/hw/misc/allwinner-a10-ccm.h
create mode 100644 include/hw/misc/allwinner-a10-dramc.h
[PATCH v3 0/7] Enable Cubieboard A10 boot SPL from SD card
Posted by Strahinja Jankovic 1 year, 4 months ago
This patch series adds missing Allwinner A10 modules needed for
successful SPL boot:
- Clock controller module
- DRAM controller
- I2C0 controller (added also for Allwinner H3 since it is the same)
- AXP-209 connected to I2C0 bus

It also updates Allwinner A10 emulation so SPL is copied from attached
SD card if `-kernel` parameter is not passed when starting QEMU
(approach adapted from Allwinner H3 implementation).

Boot from SD card has been tested with Cubieboard Armbian SD card image and custom
Yocto image built for Cubieboard.
Example usage for Armbian image:
qemu-system-arm -M cubieboard -nographic -sd ~/Armbian_22.11.0-trunk_Cubieboard_kinetic_edge_6.0.7.img

v3:
* new avocado test for SD card boot for Cubieboard with OpenWrt image 
* renamed file and functions for AXP209 so there is not allwinner prefix
* replaced cast with I2C_BUS in AXP209 instantiation for Cubieboard
* squashed commit with Cubieboard and OrangePi-PC documentation update
with actual code changes
* added myself as Designated Reviewer to the Allwinner-A10 section in
MAINTAINERS file and added hw/misc/axp209.c to the same section.

v2:
* replaced DB_PRINTF with tracing functions
* removed .init function in AXP209 since .reset covers functionality
* moved defines to allwinner_i2c.c from header file
* updated docs with information about TWI
* minor code style fixes


Strahinja Jankovic (7):
  hw/misc: Allwinner-A10 Clock Controller Module Emulation
  hw/misc: Allwinner A10 DRAM Controller Emulation
  {hw/i2c,docs/system/arm}: Allwinner TWI/I2C Emulation
  hw/misc: AXP209 PMU Emulation
  hw/arm: Add AXP209 to Cubieboard
  hw/arm: Allwinner A10 enable SPL load from MMC
  tests/avocado: Add SD boot test to Cubieboard

 MAINTAINERS                           |   2 +
 docs/system/arm/cubieboard.rst        |   1 +
 docs/system/arm/orangepi.rst          |   1 +
 hw/arm/Kconfig                        |   5 +
 hw/arm/allwinner-a10.c                |  40 +++
 hw/arm/allwinner-h3.c                 |  11 +-
 hw/arm/cubieboard.c                   |  11 +
 hw/i2c/Kconfig                        |   4 +
 hw/i2c/allwinner-i2c.c                | 459 ++++++++++++++++++++++++++
 hw/i2c/meson.build                    |   1 +
 hw/i2c/trace-events                   |   5 +
 hw/misc/Kconfig                       |  10 +
 hw/misc/allwinner-a10-ccm.c           | 224 +++++++++++++
 hw/misc/allwinner-a10-dramc.c         | 179 ++++++++++
 hw/misc/axp209.c                      | 238 +++++++++++++
 hw/misc/meson.build                   |   3 +
 hw/misc/trace-events                  |   5 +
 include/hw/arm/allwinner-a10.h        |  27 ++
 include/hw/arm/allwinner-h3.h         |   3 +
 include/hw/i2c/allwinner-i2c.h        |  55 +++
 include/hw/misc/allwinner-a10-ccm.h   |  67 ++++
 include/hw/misc/allwinner-a10-dramc.h |  68 ++++
 tests/avocado/boot_linux_console.py   |  47 +++
 23 files changed, 1465 insertions(+), 1 deletion(-)
 create mode 100644 hw/i2c/allwinner-i2c.c
 create mode 100644 hw/misc/allwinner-a10-ccm.c
 create mode 100644 hw/misc/allwinner-a10-dramc.c
 create mode 100644 hw/misc/axp209.c
 create mode 100644 include/hw/i2c/allwinner-i2c.h
 create mode 100644 include/hw/misc/allwinner-a10-ccm.h
 create mode 100644 include/hw/misc/allwinner-a10-dramc.h

-- 
2.30.2
Re: [PATCH v3 0/7] Enable Cubieboard A10 boot SPL from SD card
Posted by Peter Maydell 1 year, 3 months ago
On Mon, 26 Dec 2022 at 22:03, Strahinja Jankovic
<strahinjapjankovic@gmail.com> wrote:
>
> This patch series adds missing Allwinner A10 modules needed for
> successful SPL boot:
> - Clock controller module
> - DRAM controller
> - I2C0 controller (added also for Allwinner H3 since it is the same)
> - AXP-209 connected to I2C0 bus
>
> It also updates Allwinner A10 emulation so SPL is copied from attached
> SD card if `-kernel` parameter is not passed when starting QEMU
> (approach adapted from Allwinner H3 implementation).
>
> Boot from SD card has been tested with Cubieboard Armbian SD card image and custom
> Yocto image built for Cubieboard.
> Example usage for Armbian image:
> qemu-system-arm -M cubieboard -nographic -sd ~/Armbian_22.11.0-trunk_Cubieboard_kinetic_edge_6.0.7.img



Applied to target-arm.next, thanks.

-- PMM