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

Strahinja Jankovic posted 6 patches 1 year, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221203231904.25155-1-strahinja.p.jankovic@gmail.com
Maintainers: Peter Maydell <peter.maydell@linaro.org>, Beniamino Galvani <b.galvani@gmail.com>, Niek Linnenbank <nieklinnenbank@gmail.com>
There is a newer version of this series
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                | 417 ++++++++++++++++++++++++++
hw/i2c/meson.build                    |   1 +
hw/misc/Kconfig                       |  10 +
hw/misc/allwinner-a10-ccm.c           | 224 ++++++++++++++
hw/misc/allwinner-a10-dramc.c         | 179 +++++++++++
hw/misc/allwinner-axp-209.c           | 263 ++++++++++++++++
hw/misc/meson.build                   |   3 +
include/hw/arm/allwinner-a10.h        |  27 ++
include/hw/arm/allwinner-h3.h         |   3 +
include/hw/i2c/allwinner-i2c.h        | 112 +++++++
include/hw/misc/allwinner-a10-ccm.h   |  67 +++++
include/hw/misc/allwinner-a10-dramc.h |  68 +++++
17 files changed, 1444 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/allwinner-axp-209.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 0/6] 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


Strahinja Jankovic (6):
  hw/misc: Allwinner-A10 Clock Controller Module Emulation
  hw/misc: Allwinner A10 DRAM Controller Emulation
  hw/i2c: Allwinner TWI/I2C Emulation
  hw/misc: Allwinner AXP-209 Emulation
  hw/arm: Add AXP-209 to Cubieboard
  hw/arm: Allwinner A10 enable SPL load from MMC

 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                | 417 ++++++++++++++++++++++++++
 hw/i2c/meson.build                    |   1 +
 hw/misc/Kconfig                       |  10 +
 hw/misc/allwinner-a10-ccm.c           | 224 ++++++++++++++
 hw/misc/allwinner-a10-dramc.c         | 179 +++++++++++
 hw/misc/allwinner-axp-209.c           | 263 ++++++++++++++++
 hw/misc/meson.build                   |   3 +
 include/hw/arm/allwinner-a10.h        |  27 ++
 include/hw/arm/allwinner-h3.h         |   3 +
 include/hw/i2c/allwinner-i2c.h        | 112 +++++++
 include/hw/misc/allwinner-a10-ccm.h   |  67 +++++
 include/hw/misc/allwinner-a10-dramc.h |  68 +++++
 17 files changed, 1444 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/allwinner-axp-209.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 0/6] Enable Cubieboard A10 boot SPL from SD card
Posted by Niek Linnenbank 1 year, 4 months ago
Hello Strahinja,

Thanks for contribution these patches, and also taking the H3 into account
:-)

I've ran the avocado based acceptance tests for both boards and got these
results:

$ ARMBIAN_ARTIFACTS_CACHED=yes AVOCADO_ALLOW_LARGE_STORAGE=yes
./build/tests/venv/bin/avocado --show=app,console run -t
machine:orangepi-pc tests/avocado/boot_linux_console.py
...
RESULTS    : PASS 5 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 |
CANCEL 0
JOB TIME   : 114.24 s

$ ./build/tests/venv/bin/avocado --show=app,console run -t
machine:cubieboard tests/avocado/boot_linux_console.py
...
RESULTS    : PASS 2 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 |
CANCEL 0
JOB TIME   : 22.79 s

So that shows both machines are still running fine. During startup of the
bionic 20.08 image for orangepi-pc it did show this message:
  console: i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
  console: sy8106a: probe of 0-0065 failed with error -110

The SY8106a appears to be an peripheral attached to the I2C bus on the
orangepi-pc, and we don't emulate the SY8106a yet, so that's an error to be
expected:
  https://linux-sunxi.org/SY8106A

So for the series:
Tested-by: Niek Linnenbank <nieklinnenbank@gmail.com>

I'll try to reply to each patch as well.

Kind regards,
Niek

On Sun, Dec 4, 2022 at 12:19 AM 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
>
>
> Strahinja Jankovic (6):
>   hw/misc: Allwinner-A10 Clock Controller Module Emulation
>   hw/misc: Allwinner A10 DRAM Controller Emulation
>   hw/i2c: Allwinner TWI/I2C Emulation
>   hw/misc: Allwinner AXP-209 Emulation
>   hw/arm: Add AXP-209 to Cubieboard
>   hw/arm: Allwinner A10 enable SPL load from MMC
>
>  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                | 417 ++++++++++++++++++++++++++
>  hw/i2c/meson.build                    |   1 +
>  hw/misc/Kconfig                       |  10 +
>  hw/misc/allwinner-a10-ccm.c           | 224 ++++++++++++++
>  hw/misc/allwinner-a10-dramc.c         | 179 +++++++++++
>  hw/misc/allwinner-axp-209.c           | 263 ++++++++++++++++
>  hw/misc/meson.build                   |   3 +
>  include/hw/arm/allwinner-a10.h        |  27 ++
>  include/hw/arm/allwinner-h3.h         |   3 +
>  include/hw/i2c/allwinner-i2c.h        | 112 +++++++
>  include/hw/misc/allwinner-a10-ccm.h   |  67 +++++
>  include/hw/misc/allwinner-a10-dramc.h |  68 +++++
>  17 files changed, 1444 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/allwinner-axp-209.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
>
>

-- 
Niek Linnenbank
Re: [PATCH 0/6] Enable Cubieboard A10 boot SPL from SD card
Posted by Strahinja Jankovic 1 year, 4 months ago
Hi Niek,

On Wed, Dec 7, 2022 at 9:25 PM Niek Linnenbank <nieklinnenbank@gmail.com> wrote:
>
> Hello Strahinja,
>
> Thanks for contribution these patches, and also taking the H3 into account :-)

Thank you for looking into these patches and all of the comments. I
will try to submit V2 of this patch set in the following days.

>
> I've ran the avocado based acceptance tests for both boards and got these results:
>
> $ ARMBIAN_ARTIFACTS_CACHED=yes AVOCADO_ALLOW_LARGE_STORAGE=yes ./build/tests/venv/bin/avocado --show=app,console run -t machine:orangepi-pc tests/avocado/boot_linux_console.py
> ...
> RESULTS    : PASS 5 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
> JOB TIME   : 114.24 s
>
> $ ./build/tests/venv/bin/avocado --show=app,console run -t machine:cubieboard tests/avocado/boot_linux_console.py
> ...
> RESULTS    : PASS 2 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
> JOB TIME   : 22.79 s

I did not think initially about avocado, but maybe I could also add an
SPL/SD boot test for the cubieboard, similarly to the way it is run
for Orange Pi, for V2 of the patch set?

Best regards,
Strahinja



>
> So that shows both machines are still running fine. During startup of the bionic 20.08 image for orangepi-pc it did show this message:
>   console: i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
>   console: sy8106a: probe of 0-0065 failed with error -110
>
> The SY8106a appears to be an peripheral attached to the I2C bus on the orangepi-pc, and we don't emulate the SY8106a yet, so that's an error to be expected:
>   https://linux-sunxi.org/SY8106A
>
> So for the series:
> Tested-by: Niek Linnenbank <nieklinnenbank@gmail.com>
>
> I'll try to reply to each patch as well.
>
> Kind regards,
> Niek
>
> On Sun, Dec 4, 2022 at 12:19 AM 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
>>
>>
>> Strahinja Jankovic (6):
>>   hw/misc: Allwinner-A10 Clock Controller Module Emulation
>>   hw/misc: Allwinner A10 DRAM Controller Emulation
>>   hw/i2c: Allwinner TWI/I2C Emulation
>>   hw/misc: Allwinner AXP-209 Emulation
>>   hw/arm: Add AXP-209 to Cubieboard
>>   hw/arm: Allwinner A10 enable SPL load from MMC
>>
>>  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                | 417 ++++++++++++++++++++++++++
>>  hw/i2c/meson.build                    |   1 +
>>  hw/misc/Kconfig                       |  10 +
>>  hw/misc/allwinner-a10-ccm.c           | 224 ++++++++++++++
>>  hw/misc/allwinner-a10-dramc.c         | 179 +++++++++++
>>  hw/misc/allwinner-axp-209.c           | 263 ++++++++++++++++
>>  hw/misc/meson.build                   |   3 +
>>  include/hw/arm/allwinner-a10.h        |  27 ++
>>  include/hw/arm/allwinner-h3.h         |   3 +
>>  include/hw/i2c/allwinner-i2c.h        | 112 +++++++
>>  include/hw/misc/allwinner-a10-ccm.h   |  67 +++++
>>  include/hw/misc/allwinner-a10-dramc.h |  68 +++++
>>  17 files changed, 1444 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/allwinner-axp-209.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
>>
>
>
> --
> Niek Linnenbank
>
Re: [PATCH 0/6] Enable Cubieboard A10 boot SPL from SD card
Posted by Niek Linnenbank 1 year, 4 months ago
Hi Strahinja,

On Thu, Dec 8, 2022 at 8:24 PM Strahinja Jankovic <
strahinjapjankovic@gmail.com> wrote:

> Hi Niek,
>
> On Wed, Dec 7, 2022 at 9:25 PM Niek Linnenbank <nieklinnenbank@gmail.com>
> wrote:
> >
> > Hello Strahinja,
> >
> > Thanks for contribution these patches, and also taking the H3 into
> account :-)
>
> Thank you for looking into these patches and all of the comments. I
> will try to submit V2 of this patch set in the following days.
>
> >
> > I've ran the avocado based acceptance tests for both boards and got
> these results:
> >
> > $ ARMBIAN_ARTIFACTS_CACHED=yes AVOCADO_ALLOW_LARGE_STORAGE=yes
> ./build/tests/venv/bin/avocado --show=app,console run -t
> machine:orangepi-pc tests/avocado/boot_linux_console.py
> > ...
> > RESULTS    : PASS 5 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 |
> CANCEL 0
> > JOB TIME   : 114.24 s
> >
> > $ ./build/tests/venv/bin/avocado --show=app,console run -t
> machine:cubieboard tests/avocado/boot_linux_console.py
> > ...
> > RESULTS    : PASS 2 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 |
> CANCEL 0
> > JOB TIME   : 22.79 s
>
> I did not think initially about avocado, but maybe I could also add an
> SPL/SD boot test for the cubieboard, similarly to the way it is run
> for Orange Pi, for V2 of the patch set?
>

Yeah that would be great. It can help to make testing easier when working
on your current code, since its all automated.
And when covering the SPL/SD boot with an acceptance test, it also helps to
ensure it keeps working with future updates to Qemu code too.

One thing to be aware of is to select an image with an URL that is stable.
Once a new test is merged, and the image is subsequently deleted
from the remote server, the test can't run anymore. We've had such a
problem before with the orangepi-pc tests.

Regards,
Niek


>
> Best regards,
> Strahinja
>
>
>
> >
> > So that shows both machines are still running fine. During startup of
> the bionic 20.08 image for orangepi-pc it did show this message:
> >   console: i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
> >   console: sy8106a: probe of 0-0065 failed with error -110
> >
> > The SY8106a appears to be an peripheral attached to the I2C bus on the
> orangepi-pc, and we don't emulate the SY8106a yet, so that's an error to be
> expected:
> >   https://linux-sunxi.org/SY8106A
> >
> > So for the series:
> > Tested-by: Niek Linnenbank <nieklinnenbank@gmail.com>
> >
> > I'll try to reply to each patch as well.
> >
> > Kind regards,
> > Niek
> >
> > On Sun, Dec 4, 2022 at 12:19 AM 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
> >>
> >>
> >> Strahinja Jankovic (6):
> >>   hw/misc: Allwinner-A10 Clock Controller Module Emulation
> >>   hw/misc: Allwinner A10 DRAM Controller Emulation
> >>   hw/i2c: Allwinner TWI/I2C Emulation
> >>   hw/misc: Allwinner AXP-209 Emulation
> >>   hw/arm: Add AXP-209 to Cubieboard
> >>   hw/arm: Allwinner A10 enable SPL load from MMC
> >>
> >>  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                | 417 ++++++++++++++++++++++++++
> >>  hw/i2c/meson.build                    |   1 +
> >>  hw/misc/Kconfig                       |  10 +
> >>  hw/misc/allwinner-a10-ccm.c           | 224 ++++++++++++++
> >>  hw/misc/allwinner-a10-dramc.c         | 179 +++++++++++
> >>  hw/misc/allwinner-axp-209.c           | 263 ++++++++++++++++
> >>  hw/misc/meson.build                   |   3 +
> >>  include/hw/arm/allwinner-a10.h        |  27 ++
> >>  include/hw/arm/allwinner-h3.h         |   3 +
> >>  include/hw/i2c/allwinner-i2c.h        | 112 +++++++
> >>  include/hw/misc/allwinner-a10-ccm.h   |  67 +++++
> >>  include/hw/misc/allwinner-a10-dramc.h |  68 +++++
> >>  17 files changed, 1444 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/allwinner-axp-209.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
> >>
> >
> >
> > --
> > Niek Linnenbank
> >
>


-- 
Niek Linnenbank