mbox series

[v2,00/10] xtensa: Enable qemu-xtensa board

Message ID 20240522-qemu-xtensa-v2-0-04bf7e42b10b@flygoat.com
Headers show
Series xtensa: Enable qemu-xtensa board | expand

Message

Jiaxun Yang May 22, 2024, 5:07 p.m. UTC
Hi all,

This series enabled qemu-xtensa board.

For dc232b CPU it needs to be built with toolchain[1].

This is a side product of me investigating architectures
physical address != virtual address in U-Boot. Now we can
get it covered under CI and regular tests.

VirtIO devices are not working as expected, due to U-Boot's
assumption on VA == PA everywhere, I'm going to get this fixed
later.

My Xtensa knowledge is pretty limited, Xtensa people please
feel free to point out if I got anything wrong.

Thanks
[1]: https://github.com/foss-xtensa/toolchain/releases/download/2020.07/x86_64-2020.07-xtensa-dc232b-elf.tar.gz

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
Changes in v2:
- Fix noMMU memory mappings
- Addressing Max's comments in other patches
- Link to v1: https://lore.kernel.org/r/20240519-qemu-xtensa-v1-0-8fff0cb11c19@flygoat.com

---
Jiaxun Yang (10):
      xtensa: Move dram_init to xtfpga board file
      xtensa: Correct define of _end symbol
      xtensa: Implement phys virt conversion for PTP_MMU
      xtensa: Define PLATFORM_ELFFLAGS
      xtensa: Bring in semihosting headers and config options
      drivers: serial: Add xtensa semihosting driver
      drivers: cpu: Add xtensa CPU driver
      dts/upsteam: Add Makefile for xtensa
      board: emulation: New board qemu-xtensa
      doc: New documentation for qemu-xtensa

 arch/xtensa/Kconfig                              |  32 +++++++
 arch/xtensa/config.mk                            |   6 ++
 arch/xtensa/cpu/cpu.c                            |   5 -
 arch/xtensa/cpu/u-boot.lds                       |   2 +
 arch/xtensa/dts/virt-u-boot.dtsi                 |  17 ++++
 arch/xtensa/include/asm/addrspace.h              |   2 +
 arch/xtensa/include/asm/io.h                     |  32 +++++++
 arch/xtensa/include/asm/ldscript.h               |   1 -
 arch/xtensa/include/asm/platform/simcall-gdbio.h |  34 +++++++
 arch/xtensa/include/asm/platform/simcall-iss.h   |  73 ++++++++++++++
 arch/xtensa/include/asm/platform/simcall.h       | 110 +++++++++++++++++++++
 board/cadence/xtfpga/xtfpga.c                    |   5 +
 board/emulation/qemu-xtensa/Kconfig              |  42 ++++++++
 board/emulation/qemu-xtensa/MAINTAINERS          |   8 ++
 board/emulation/qemu-xtensa/Makefile             |   5 +
 board/emulation/qemu-xtensa/qemu-xtensa.c        |  60 ++++++++++++
 configs/qemu-xtensa-dc232b_defconfig             |  32 +++++++
 doc/board/emulation/index.rst                    |   1 +
 doc/board/emulation/qemu-xtensa.rst              |  33 +++++++
 drivers/cpu/Kconfig                              |   6 ++
 drivers/cpu/Makefile                             |   1 +
 drivers/cpu/xtensa_cpu.c                         | 117 +++++++++++++++++++++++
 drivers/serial/Kconfig                           |  18 +++-
 drivers/serial/Makefile                          |   1 +
 drivers/serial/serial_xtensa_semihosting.c       |  92 ++++++++++++++++++
 dts/upstream/src/xtensa/Makefile                 |  14 +++
 include/configs/qemu-xtensa.h                    |  36 +++++++
 27 files changed, 778 insertions(+), 7 deletions(-)
---
base-commit: 3be9f399e911cfc437a37ac826441f1d96da1c9b
change-id: 20240519-qemu-xtensa-5fb95bb474e9

Best regards,

Comments

Max Filippov May 24, 2024, 11:52 p.m. UTC | #1
Hi Jiaxun,

On Wed, May 22, 2024 at 06:07:56PM +0100, Jiaxun Yang wrote:
> This is a side product of me investigating architectures
> physical address != virtual address in U-Boot. Now we can
> get it covered under CI and regular tests.
> 
> VirtIO devices are not working as expected, due to U-Boot's
> assumption on VA == PA everywhere, I'm going to get this fixed
> later.
> 
> My Xtensa knowledge is pretty limited, Xtensa people please
> feel free to point out if I got anything wrong.
> 
> Thanks
> [1]: https://github.com/foss-xtensa/toolchain/releases/download/2020.07/x86_64-2020.07-xtensa-dc232b-elf.tar.gz
> 
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
> Changes in v2:
> - Fix noMMU memory mappings
> - Addressing Max's comments in other patches
> - Link to v1: https://lore.kernel.org/r/20240519-qemu-xtensa-v1-0-8fff0cb11c19@flygoat.com
> 
> ---

Tested-by: Max Filippov <jcmvbkbc@gmail.com>

As expected the build fails for big-endian cores and peripherals are
non-functional on MMUv2 cores.