[PATCH] doc: Add UEFI supplement document

2024-05-29 Thread Jiaxun Yang
Add UEFI supplement document to define some behaviours on architectures not covered by the original specification. Signed-off-by: Jiaxun Yang --- Hi all, This document is in response to discussion at [1]. It is produced based on my attempt to port U-Boot UEFI to MIPS and Xtensa. I also plan

Re: [PATCH 1/1] Added arm64 assembly for examples/api crt0

2024-05-25 Thread Jiaxun Yang
在2024年5月21日五月 下午7:15,Tom Rini写道: [...] > > We have long not done a great job with the U-Boot standalone API stuff, > and for a number of years at this point a lot of the use cases it was > used for could instead be filled by making an EFI application. There's a > well defined API there, there's

[PATCH v2 2/2] efi: gop: Mark pixel_format as BLTONLY if we have sync hook

2024-05-24 Thread Jiaxun Yang
to reflect this nature. Signed-off-by: Jiaxun Yang --- v2: - Remove an unused variable --- include/efi_api.h| 1 + lib/efi_loader/efi_gop.c | 8 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/efi_api.h b/include/efi_api.h index ab40b1b5ddf6

[PATCH v2 1/2] virtio: New virtio_gpu driver

2024-05-24 Thread Jiaxun Yang
This driver is implemened based on latest VirtIO spec. It follows operation prodcure as defined in the spec. It implemented multihead (mirroring) support as well. Signed-off-by: Jiaxun Yang --- v2: - Add big endian code path - Reword typical resolution for Kconfig symbol

[PATCH v2 0/2] virtio_gpu driver and relevant fix

2024-05-24 Thread Jiaxun Yang
as a vidconsole. My current appraoch is to register virtio_init in init_sequence_r, just after pci_init. Is this a viable approach? Should I introduce a config like CONFIG_VIRTIO_INIT_R to allow it to be selected by boards? Thanks Signed-off-by: Jiaxun Yang --- Changes in v2: - Fix left over in previous

Re: [PATCH 16/16] efi: LoongArch: Implement everything

2024-05-23 Thread Jiaxun Yang
在2024年5月23日五月 下午5:26,Heinrich Schuchardt写道: >> diff --git a/arch/loongarch/lib/reloc_loongarch_efi.c >> b/arch/loongarch/lib/reloc_loongarch_efi.c >> new file mode 100644 >> index ..32a7d792103d >> --- /dev/null >> +++ b/arch/loongarch/lib/reloc_loongarch_efi.c > > The code seems

Re: [PATCH 15/16] efi: LoongArch: Define LoongArch bits everywhere

2024-05-23 Thread Jiaxun Yang
在2024年5月23日五月 下午5:14,Heinrich Schuchardt写道: [...] > Looking at > https://loongson.github.io/LoongArch-Documentation/LoongArch-toolchain-conventions-EN.html: > > There the following symbols are mentioned: > > __loongarch__ > __loongarch_grlen > > > Table 15. > C/C++ Built-in Macros Provided for

Re: [PATCH 00/16] LoongArch initial support

2024-05-23 Thread Jiaxun Yang
在2024年5月23日五月 下午4:25,Tom Rini写道: > On Wed, May 22, 2024 at 04:34:43PM +0100, Jiaxun Yang wrote: > >> Hi all, >> >> Sorry for flooding the mailing list recently, yet another huge RFC series >> ahead. >> >> So after working on MIPS, arm64be and Xte

[PATCH v2 10/10] doc: New documentation for qemu-xtensa

2024-05-22 Thread Jiaxun Yang
Introduce the board and provide instructions on how to get it work. Signed-off-by: Jiaxun Yang --- doc/board/emulation/index.rst | 1 + doc/board/emulation/qemu-xtensa.rst | 33 + 2 files changed, 34 insertions(+) diff --git a/doc/board/emulation

[PATCH v2 09/10] board: emulation: New board qemu-xtensa

2024-05-22 Thread Jiaxun Yang
Introduce the new board, define every bits. Signed-off-by: Jiaxun Yang --- v2: - Fix maintainers entries - Refine address mapping for noMMU machine - Add a dtsi overlay to describe different memory size for noMMU system --- arch/xtensa/Kconfig | 5

[PATCH v2 08/10] dts/upsteam: Add Makefile for xtensa

2024-05-22 Thread Jiaxun Yang
It is required to get it xtensa OF_UPSTREAM work. Reviewed-by: Sumit Garg Signed-off-by: Jiaxun Yang --- dts/upstream/src/xtensa/Makefile | 14 ++ 1 file changed, 14 insertions(+) diff --git a/dts/upstream/src/xtensa/Makefile b/dts/upstream/src/xtensa/Makefile new file mode 100644

[PATCH v2 07/10] drivers: cpu: Add xtensa CPU driver

2024-05-22 Thread Jiaxun Yang
Implement various CPU related functions. I'm actually just using it to get cpu clock frequency. Signed-off-by: Jiaxun Yang --- drivers/cpu/Kconfig | 6 +++ drivers/cpu/Makefile | 1 + drivers/cpu/xtensa_cpu.c | 117 +++ 3 files changed

[PATCH v2 06/10] drivers: serial: Add xtensa semihosting driver

2024-05-22 Thread Jiaxun Yang
Add xtensa semihosting driver. It can't use regular semihosting driver as Xtensa's has it's own semihosting ABI. Signed-off-by: Jiaxun Yang --- v2: - Fix simc_serial_pending implementation - Get puts work --- drivers/serial/Kconfig | 18 +- drivers

[PATCH v2 05/10] xtensa: Bring in semihosting headers and config options

2024-05-22 Thread Jiaxun Yang
They are all directly imported from Linux kernel. Reviewed-by: Max Filippov Signed-off-by: Jiaxun Yang --- arch/xtensa/Kconfig | 27 ++ arch/xtensa/include/asm/platform/simcall-gdbio.h | 34 +++ arch/xtensa/include/asm/platform/simcall-iss.h | 73

[PATCH v2 04/10] xtensa: Define PLATFORM_ELFFLAGS

2024-05-22 Thread Jiaxun Yang
u-boot.elf target requires it to work. Signed-off-by: Jiaxun Yang --- v2: - Concerning big endian CPU Note: CONFIG_SYS_BIG_ENDIAN will never be set for xtensa for now, but as we don't have big endian headers for xtensa core either I think it's fine for now. This will be improved after

[PATCH v2 03/10] xtensa: Implement phys virt conversion for PTP_MMU

2024-05-22 Thread Jiaxun Yang
For PTP_MMU our physical address is not directly mapped into virtual address space, we need to access physical memory from those fixed map segments. Implement phys_to_virt and virt_to_phys hook to reflect this setting. Signed-off-by: Jiaxun Yang --- arch/xtensa/include/asm/addrspace.h | 2

[PATCH v2 02/10] xtensa: Correct define of _end symbol

2024-05-22 Thread Jiaxun Yang
So U-Boot is using _end symbol to detect location of devicetree appended at the end of the ROM. It needs to be calculated based on end of .data load address, as in our lds .current address is address in RAM. Signed-off-by: Jiaxun Yang --- arch/xtensa/cpu/u-boot.lds | 2 ++ arch/xtensa

[PATCH v2 01/10] xtensa: Move dram_init to xtfpga board file

2024-05-22 Thread Jiaxun Yang
This is a board level stuff. Signed-off-by: Jiaxun Yang --- arch/xtensa/cpu/cpu.c | 5 - board/cadence/xtfpga/xtfpga.c | 5 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/xtensa/cpu/cpu.c b/arch/xtensa/cpu/cpu.c index abcd8f7984fa..d2266812229c 100644

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

2024-05-22 Thread Jiaxun Yang
-xtensa-dc232b-elf.tar.gz Signed-off-by: Jiaxun Yang --- 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-8fff0cb11...@flygoat.com --- Jiaxun Yang (10): xtensa: Move dram_init to xtfpga

[PATCH 06/16] LoongArch: skeleton and headers

2024-05-22 Thread Jiaxun Yang
Commit for directories, Kconfig, Makefile and headers Some of them are copied from linux, some of them are derived from other architectures, the rest are wriiten on my own. Signed-off-by: Jiaxun Yang --- arch/Kconfig | 15 + arch/loongarch/Kconfig

[PATCH 16/16] efi: LoongArch: Implement everything

2024-05-22 Thread Jiaxun Yang
Implement crt, reloc, linker scripts, wire things up in Makefiles and Kconfig. Signed-off-by: Jiaxun Yang --- arch/loongarch/config.mk | 4 + arch/loongarch/lib/Makefile | 12 ++ arch/loongarch/lib/crt0_loongarch_efi.S | 182 +++ arch

[PATCH 15/16] efi: LoongArch: Define LoongArch bits everywhere

2024-05-22 Thread Jiaxun Yang
They are all coming from UEFI spec, Microsoft PE sepc, or IANA websites. Signed-off-by: Jiaxun Yang --- boot/bootmeth_efi.c | 2 ++ include/asm-generic/pe.h | 2 ++ include/config_distro_bootcmd.h | 5 + include

[PATCH 14/16] board: emulation: Add qemu-loongarch

2024-05-22 Thread Jiaxun Yang
Yet another generic QEMU VIRT machine. QEMU placed FDT in memory before launching U-Boot, so we can just obtian FDT here. Signed-off-by: Jiaxun Yang --- arch/loongarch/Kconfig| 5 ++ arch/loongarch/dts/qemu-loongarch64.dts | 9 +++ board/emulation/qemu

[PATCH 13/16] timer: Add loongarch_timer driver

2024-05-22 Thread Jiaxun Yang
Implement a timer driver for LoongArch architecture driver. It's synced in hardware for every core in a system, and frequency information can be gathered from CPUCFG instruction. It is not described in fdt, thus I have to declare a DRVINFO for it. Signed-off-by: Jiaxun Yang --- drivers/timer

[PATCH 12/16] cpu: Add loongarch_cpu driver

2024-05-22 Thread Jiaxun Yang
Implement a driver for LoongArch CPU solely for gathering some information bits from FDT and CPU level config registers. Signed-off-by: Jiaxun Yang --- drivers/cpu/Kconfig | 6 ++ drivers/cpu/Makefile| 1 + drivers/cpu/loongarch_cpu.c | 148

[PATCH 11/16] LoongArch: Generic CPU type

2024-05-22 Thread Jiaxun Yang
Provide a generic CPU type with some common routines that expected to be implemented at CPU level. Signed-off-by: Jiaxun Yang --- arch/loongarch/Kconfig | 1 + arch/loongarch/cpu/generic/Kconfig | 13 + arch/loongarch/cpu/generic/Makefile | 7 +++ arch/loongarch

[PATCH 10/16] LoongArch: Boot Image bits

2024-05-22 Thread Jiaxun Yang
if we tell kernel we are not efi compatible by setting a0 boot argument to zero. Link: https://docs.kernel.org/arch/loongarch/booting.html Signed-off-by: Jiaxun Yang --- arch/loongarch/lib/Makefile | 2 + arch/loongarch/lib/bootm.c | 177 arch

[PATCH 09/16] LoongArch: Exception handling

2024-05-22 Thread Jiaxun Yang
Add exception entry assembly code, import stackframe.h from Linux, provide debug prints when exception happens. Signed-off-by: Jiaxun Yang --- arch/loongarch/Kconfig | 3 + arch/loongarch/cpu/Makefile | 2 +- arch/loongarch/cpu/genex.S | 21

[PATCH 08/16] LoongArch: CPU assembly routines

2024-05-22 Thread Jiaxun Yang
start.S for initialisation, smp_secondary routine for a spin-table like interface for secondary cpus. Signed-off-by: Jiaxun Yang --- arch/loongarch/cpu/Makefile| 4 + arch/loongarch/cpu/cpu.c | 28 ++ arch/loongarch/cpu/smp_secondary.S | 55 arch/loongarch

[PATCH 07/16] LoongArch: lib: General routines

2024-05-22 Thread Jiaxun Yang
Add some common library routines for the architecture. Signed-off-by: Jiaxun Yang --- arch/loongarch/lib/Makefile | 7 arch/loongarch/lib/asm-offsets.c | 66 arch/loongarch/lib/boot.c| 14 arch/loongarch/lib/cache.c | 73

[PATCH 05/16] image: Define IH_ARCH_LOONGARCH

2024-05-22 Thread Jiaxun Yang
Allocate the next value to IH_ARCH_LOONGARCH. Signed-off-by: Jiaxun Yang --- boot/image.c| 1 + include/image.h | 1 + 2 files changed, 2 insertions(+) diff --git a/boot/image.c b/boot/image.c index 073931cd7a3f..8955a095713d 100644 --- a/boot/image.c +++ b/boot/image.c @@ -96,6 +96,7

[PATCH 04/16] elf.h Define LoongArch bits

2024-05-22 Thread Jiaxun Yang
They all come from glibc's elf.h Signed-off-by: Jiaxun Yang --- include/elf.h | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/elf.h b/include/elf.h index a4ba74d8abeb..cb3bb20c4f2e 100644 --- a/include/elf.h +++ b/include/elf.h @@ -219,7 +219,8 @@ typedef

[PATCH 03/16] image: Take entry point as an output of setup_booti

2024-05-22 Thread Jiaxun Yang
For LoongArch the start of the image is not the entry point to the image. We refactor the code base to allow entry point to be supplied by setup_booti. Signed-off-by: Jiaxun Yang --- arch/arm/lib/image.c | 3 ++- arch/riscv/lib/image.c | 4 +++- arch/sandbox/lib/bootm.c | 2 +- boot

[PATCH 02/16] linux/io.h: Use map_physmem to implement ioremap

2024-05-22 Thread Jiaxun Yang
== PA it has no impact, for MIPS it has it's own ioremap implementation in asm/io.h anyway. Signed-off-by: Jiaxun Yang --- include/linux/io.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/io.h b/include/linux/io.h index 79847886be95..ada6525a1c6a 100644

[PATCH 01/16] lib: fdtdec: Handle multiple memory nodes

2024-05-22 Thread Jiaxun Yang
-off-by: Jiaxun Yang --- lib/fdtdec.c | 137 --- 1 file changed, 83 insertions(+), 54 deletions(-) diff --git a/lib/fdtdec.c b/lib/fdtdec.c index b2c59ab3818b..403b363043d6 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -1075,90 +1075,119

[PATCH 00/16] LoongArch initial support

2024-05-22 Thread Jiaxun Yang
OVMF replacement and second stage BL. Any comments are much appreciated! Thanks Signed-off-by: Jiaxun Yang --- Jiaxun Yang (16): lib: fdtdec: Handle multiple memory nodes linux/io.h: Use map_physmem to implement ioremap image: Take entry point as an output of setup_booti elf.h De

Re: [PATCH 2/7] efi: Allow runtime relocate to be disabled

2024-05-22 Thread Jiaxun Yang
在2024年5月21日五月 下午6:32,Ilias Apalodimas写道: [...] > What's ventoy? Googling it seems to be a tool for writing images? It's a sophisticated EFI application designed for network booting, more file system support etc... > >> It's nearly impossible to run MIPS OS in virtual (or paged) >> segment.

Re: [PATCH 2/7] efi: Allow runtime relocate to be disabled

2024-05-21 Thread Jiaxun Yang
在2024年5月21日五月 下午2:58,Ilias Apalodimas写道: > Hi Jiaxun, > > On Fri, 17 May 2024 at 19:33, Jiaxun Yang wrote: >> >> Allow runtime relocate to be disabled because on MIPS we >> never do that. It's guaranteed that OS won't call >> set_virtual_address_map and

Re: [PATCH 09/10] board: emulation: New board qemu-xtensa

2024-05-21 Thread Jiaxun Yang
在2024年5月21日五月 上午8:35,Max Filippov写道: [...] >> +++ b/board/emulation/qemu-xtensa/MAINTAINERS >> @@ -0,0 +1,7 @@ >> +QEMU XTENSA 'VIRT' BOARD >> +M: Jiaxun Yang >> +S: Maintained >> +F: board/emulation/qemu-xtensa/ >> +F: board/emulati

Re: [PATCH 06/10] drivers: serial: Add xtensa semihosting driver

2024-05-21 Thread Jiaxun Yang
在2024年5月21日五月 上午3:31,Max Filippov写道: > On Sun, May 19, 2024 at 1:53 PM Jiaxun Yang wrote: >> >> Add xtensa semihosting driver. >> >> It can't use regular semihosting driver as Xtensa's has it's own >> semihosting ABI. >> >> Note that semihostin

Re: [PATCH 04/10] xtensa: Define PLATFORM_ELFFLAGS

2024-05-20 Thread Jiaxun Yang
在2024年5月20日五月 下午4:18,Max Filippov写道: > On Sun, May 19, 2024 at 1:53 PM Jiaxun Yang wrote: >> >> u-boot.elf target requiures it to work. > > Typo. > >> Signed-off-by: Jiaxun Yang >> --- >> arch/xtensa/config.mk | 3 +++ >> 1 file changed

Re: [PATCH v3 11/12] MIPS: boston: Migrate to OF_UPSTREAM

2024-05-19 Thread Jiaxun Yang
在2024年5月19日五月 下午7:20,Daniel Schwierzeck写道: > > Reviewed-by: Daniel Schwierzeck > Hi Daniel, Thanks for reviewing the series. > [...] > > should be 'select' because the switch to upstream DTS is permanent and > it does not make sense for the user to be able to deselect this option > Do you

[PATCH 10/10] doc: New documentation for qemu-xtensa

2024-05-19 Thread Jiaxun Yang
Introduce the board and provide instructions on how to get it work. Signed-off-by: Jiaxun Yang --- doc/board/emulation/index.rst | 1 + doc/board/emulation/qemu-xtensa.rst | 33 + 2 files changed, 34 insertions(+) diff --git a/doc/board/emulation

[PATCH 09/10] board: emulation: New board qemu-xtensa

2024-05-19 Thread Jiaxun Yang
Introduce the new board, define every bits. Signed-off-by: Jiaxun Yang --- arch/xtensa/Kconfig | 5 +++ board/emulation/qemu-xtensa/Kconfig | 41 + board/emulation/qemu-xtensa/MAINTAINERS | 7 board/emulation/qemu-xtensa/Makefile

[PATCH 08/10] dts/upsteam: Add Makefile for xtensa

2024-05-19 Thread Jiaxun Yang
It is required to get it xtensa OF_UPSTREAM work. Signed-off-by: Jiaxun Yang --- dts/upstream/src/xtensa/Makefile | 14 ++ 1 file changed, 14 insertions(+) diff --git a/dts/upstream/src/xtensa/Makefile b/dts/upstream/src/xtensa/Makefile new file mode 100644 index

[PATCH 07/10] drivers: cpu: Add xtensa CPU driver

2024-05-19 Thread Jiaxun Yang
Implement various CPU related functions. I'm actually just using it to get cpu clock frequency. Signed-off-by: Jiaxun Yang --- drivers/cpu/Kconfig | 6 +++ drivers/cpu/Makefile | 1 + drivers/cpu/xtensa_cpu.c | 117 +++ 3 files changed

[PATCH 06/10] drivers: serial: Add xtensa semihosting driver

2024-05-19 Thread Jiaxun Yang
Add xtensa semihosting driver. It can't use regular semihosting driver as Xtensa's has it's own semihosting ABI. Note that semihosting supports puts in serial but I never managed to get it work, so it's putc only for now. Signed-off-by: Jiaxun Yang --- drivers/serial/Kconfig

[PATCH 05/10] xtensa: Bring in semihosting headers and config options

2024-05-19 Thread Jiaxun Yang
They are all directly imported from Linux kernel. Signed-off-by: Jiaxun Yang --- arch/xtensa/Kconfig | 27 ++ arch/xtensa/include/asm/platform/simcall-gdbio.h | 34 +++ arch/xtensa/include/asm/platform/simcall-iss.h | 73 +++ arch/xtensa

[PATCH 04/10] xtensa: Define PLATFORM_ELFFLAGS

2024-05-19 Thread Jiaxun Yang
u-boot.elf target requiures it to work. Signed-off-by: Jiaxun Yang --- arch/xtensa/config.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/xtensa/config.mk b/arch/xtensa/config.mk index b080e403..3ec936272f25 100644 --- a/arch/xtensa/config.mk +++ b/arch/xtensa/config.mk

[PATCH 02/10] xtensa: Correct define of _end symbol

2024-05-19 Thread Jiaxun Yang
So U-Boot is using _end symbol to detect location of devicetree appended at the end of the ROM. It needs to be calculated based on end of .data load address, as in our lds .current address is address in RAM. Signed-off-by: Jiaxun Yang --- arch/xtensa/cpu/u-boot.lds | 2 ++ arch/xtensa

[PATCH 03/10] xtensa: Implement phys virt conversion for PTP_MMU

2024-05-19 Thread Jiaxun Yang
For PTP_MMU our physical address is not directly mapped into virtual address space, we need to access physical memory from those fixed map segments. Implement phys_to_virt and virt_to_phys hook to reflect this setting. Signed-off-by: Jiaxun Yang --- arch/xtensa/include/asm/addrspace.h | 2

[PATCH 00/10] xtensa: Enable qemu-xtensa board

2024-05-19 Thread Jiaxun Yang
-xtensa-dc232b-elf.tar.gz Signed-off-by: Jiaxun Yang --- 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

[PATCH 01/10] xtensa: Move dram_init to xtfpga board file

2024-05-19 Thread Jiaxun Yang
This is a board level stuff. Signed-off-by: Jiaxun Yang --- arch/xtensa/cpu/cpu.c | 5 - board/cadence/xtfpga/xtfpga.c | 5 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/xtensa/cpu/cpu.c b/arch/xtensa/cpu/cpu.c index abcd8f7984fa..d2266812229c 100644

[PATCH 13/13] qemu-arm: Big endian enablement for arm64

2024-05-19 Thread Jiaxun Yang
Select a few config option and generate a new defconfig for big endian arm64. Signed-off-by: Jiaxun Yang --- board/emulation/qemu-arm/Kconfig | 2 + board/emulation/qemu-arm/MAINTAINERS | 1 + configs/qemu_arm64be_defconfig | 71 doc/board

[PATCH 12/13] config: Use CONFIG_SYS_BIG_ENDIAN in code whenever possible

2024-05-19 Thread Jiaxun Yang
So CONFIG_SYS_BIG_ENDIAN is our cross architecture option for selecting machine endian, while the old CONFIG_CPU_BIG_ENDIAN is defined by Arc only. Use it whenever possible to ensure big endian code path is enabled for all possible big endian machines. Signed-off-by: Jiaxun Yang --- Makefile

[PATCH 11/13] Kconfig: Unify endian support option

2024-05-19 Thread Jiaxun Yang
-by: Jiaxun Yang --- arch/Kconfig | 34 ++ arch/mips/Kconfig | 20 +++- arch/mips/mach-ath79/Kconfig | 8 arch/mips/mach-bmips/Kconfig | 20 ++-- arch/mips/mach-jz47xx/Kconfig | 2 +- arch/mips/mach

[PATCH 10/13] lib/crc32: Don't perform byte swap for arm64 crc32b

2024-05-19 Thread Jiaxun Yang
crc32b always calculate results in CPU's native endian, so there is no need to perform any endian swap. Signed-off-by: Jiaxun Yang --- lib/crc32.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/crc32.c b/lib/crc32.c index f36f1763064f..b991e477b31d 100644 --- a/lib

[PATCH 09/13] armv8: spin_table: Perform byte swap for jump address

2024-05-19 Thread Jiaxun Yang
Address comes from spin table is always little endian. Signed-off-by: Jiaxun Yang --- arch/arm/cpu/armv8/spin_table_v8.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/cpu/armv8/spin_table_v8.S b/arch/arm/cpu/armv8/spin_table_v8.S index 6d268432702f..023c82261ca6 100644

[PATCH 08/13] armv8: Allow endianness to be setted at reset entry

2024-05-19 Thread Jiaxun Yang
Provide a option to allow Endian at U-Boot's EL to be setted at reset entry. Signed-off-by: Jiaxun Yang --- arch/arm/cpu/armv8/Kconfig | 9 + arch/arm/cpu/armv8/start.S | 26 ++ 2 files changed, 35 insertions(+) diff --git a/arch/arm/cpu/armv8/Kconfig b/arch

[PATCH 07/13] arm: Perform byte swap for read and write in io.h

2024-05-19 Thread Jiaxun Yang
I/O is always assumed little endian, so perform byte swap if necessary, as what Linux did. Signed-off-by: Jiaxun Yang --- arch/arm/include/asm/io.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index

[PATCH 06/13] armv8: Big Endian enablement for compiler and linker

2024-05-19 Thread Jiaxun Yang
Pass flags to compilers and linkers, also modify linker scripts to set correct output format. Signed-off-by: Jiaxun Yang --- arch/arm/config.mk| 14 ++ arch/arm/cpu/armv8/u-boot-spl.lds | 6 ++ arch/arm/cpu/armv8/u-boot.lds | 4 arch/arm/lib

[PATCH 05/13] arm: Define endian related bits in system.h

2024-05-19 Thread Jiaxun Yang
So they can be used at a later point. Signed-off-by: Jiaxun Yang --- arch/arm/include/asm/system.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 43f7503571d7..886a9ffbee35 100644 --- a/arch/arm/include/asm/system.h

[PATCH 04/13] arm: Introduce CPU_LE/CPU_BE macros

2024-05-19 Thread Jiaxun Yang
They come from the same header in Linux. They are used to conditional select code on different endianness. Signed-off-by: Jiaxun Yang --- arch/arm/include/asm/assembler.h | 18 ++ 1 file changed, 18 insertions(+) diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include

[PATCH 03/13] arm: Fix assembler.h for arm64

2024-05-19 Thread Jiaxun Yang
Header guard is missing, and ret macro is not relevant for arm64. Both fixed. Signed-off-by: Jiaxun Yang --- arch/arm/include/asm/assembler.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index 4fda483b8d8d

[PATCH 02/13] arm: Don't select ARM_ASM_UNIFIED on arm64

2024-05-19 Thread Jiaxun Yang
We don't have thumb on arm64, so that's pointless and causing problems on some headers. Signed-off-by: Jiaxun Yang --- arch/arm/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 39ad03acd2e4..46c0d33b3c6e 100644 --- a/arch

[PATCH 01/13] tools/relocate-rela: Fix Big Endian elf64 handling

2024-05-19 Thread Jiaxun Yang
Implement elf64_to_cpu and use it when necessary. Signed-off-by: Jiaxun Yang --- tools/relocate-rela.c | 40 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/tools/relocate-rela.c b/tools/relocate-rela.c index 613abd25ef46..cbdd2552ec6e

[PATCH 00/13] Arm64 big endian enablement

2024-05-19 Thread Jiaxun Yang
can run more test on big endian systems. Boot tested on qemu. Please review. Thanks Signed-off-by: Jiaxun Yang --- Jiaxun Yang (13): tools/relocate-rela: Fix Big Endian elf64 handling arm: Don't select ARM_ASM_UNIFIED on arm64 arm: Fix assembler.h for arm64 arm: Introduce

Re: [PATCH 1/3] sandbox: Move HOST_ARCH detection to Kconfig

2024-05-18 Thread Jiaxun Yang
在2024年5月17日五月 下午11:09,Jiaxun Yang写道: [...] > diff --git a/lib/efi_selftest/efi_selftest_miniapp_exception.c > b/lib/efi_selftest/efi_selftest_miniapp_exception.c > index f668cdac4ab2..2dfbb7c74075 100644 > --- a/lib/efi_selftest/efi_selftest_miniapp_exception.c > +++ b/l

Re: [PATCH RFC] doc: Document address spaces used by U-Boot

2024-05-18 Thread Jiaxun Yang
在2024年5月18日五月 上午9:08,Heinrich Schuchardt写道: > On 5/17/24 13:45, Jiaxun Yang wrote: [...] Hi Heinrich, Ah sorry I should really spell check it before sending it off It was copied directly from my personal note. > %s/optinos/options/ > > Relating to gd->bd->bi_dram[

Re: [PATCH 1/7] MIPS: Implement setjmp

2024-05-17 Thread Jiaxun Yang
在2024年5月17日五月 下午10:11,Heinrich Schuchardt写道: [...] > As the jumpbuffer is only used inside U-Boot we should be able to use > the same register sequence independant of the bitness. Hi Heinrich, I chose to use ABI's stack frame because GDB requires it to perform proper unwinding and it helped

[PATCH 3/3] sandbox: Use pkg-config to detect and config sdl2

2024-05-17 Thread Jiaxun Yang
nfig. Signed-off-by: Jiaxun Yang --- Makefile | 3 ++- arch/sandbox/Kconfig | 2 +- arch/sandbox/config.mk | 5 ++--- doc/arch/sandbox/sandbox.rst | 6 -- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 596f6458

[PATCH 2/3] EFI: Make EFI loader depend sandbox HOST_ARCH

2024-05-17 Thread Jiaxun Yang
Since EFI loader on sandbox requires some architecture code, make it depend on HOST_ARCH to ensure it's only compiled on desired host. Signed-off-by: Jiaxun Yang --- lib/efi_loader/Kconfig | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/efi_loader/Kconfig b/lib

[PATCH 1/3] sandbox: Move HOST_ARCH detection to Kconfig

2024-05-17 Thread Jiaxun Yang
Move host arch detection to Kconfig so we can make some options depend on HOST_ARCH. Also now we are using compiler macros to detect target arch, which is more robust than looking at uname -a. Signed-off-by: Jiaxun Yang --- Makefile | 24

[PATCH 0/3] sandbox: HOST_ARCH improvements

2024-05-17 Thread Jiaxun Yang
. Tested on x86_64, cross compile and loosely tesed with qemu-user on riscv64, arm, aarch64. Thanks [1]: https://lore.kernel.org/u-boot/2cd8d385-f0a9-4a1b-827d-1c55cd7e3...@gmx.de/ Signed-off-by: Jiaxun Yang --- Jiaxun Yang (3): sandbox: Move HOST_ARCH detection to Kconfig EFI: Make EFI

[PATCH v3 12/12] mailmap: Update email for Paul Burton

2024-05-17 Thread Jiaxun Yang
Paul had left MIPS a couple of years ago, his email address is no longer valid. Replace it with his kenrel.org email, which has been used in kernel and QEMU, in case we still want to reach him. Signed-off-by: Jiaxun Yang --- .mailmap| 3 ++- board/imgtec/boston

[PATCH v3 11/12] MIPS: boston: Migrate to OF_UPSTREAM

2024-05-17 Thread Jiaxun Yang
We can now boot with upstream devicetree. Reviewed-by: Sumit Garg Signed-off-by: Jiaxun Yang --- arch/mips/Kconfig| 1 + arch/mips/dts/Makefile | 1 - arch/mips/dts/boston-u-boot.dtsi | 10 ++ arch/mips/dts/img,boston.dts | 222

[PATCH v3 10/12] dts/upstream: Add Makefile for MIPS

2024-05-17 Thread Jiaxun Yang
It is required to make OF_UPSTREAM work. Reviewed-by: Sumit Garg Signed-off-by: Jiaxun Yang --- dts/upstream/src/mips/Makefile | 14 ++ 1 file changed, 14 insertions(+) diff --git a/dts/upstream/src/mips/Makefile b/dts/upstream/src/mips/Makefile new file mode 100644 index

[PATCH v3 09/12] clk: boston: Allow to get regmap from parent device

2024-05-17 Thread Jiaxun Yang
In upstream devicetree, clk_boston is a child of syscon node and there is no "regmap" property for clk_boston node. Try to check parent device first to look for syscon. Signed-off-by: Jiaxun Yang --- v2: Move syscon_get_regmap to probe v3: Move syscon detection code to probe

[PATCH v3 08/12] MIPS: boston: Provide default env vars

2024-05-17 Thread Jiaxun Yang
Provide default environment variables on image loading address to make the board useful. Signed-off-by: Jiaxun Yang --- board/imgtec/boston/Kconfig| 4 board/imgtec/boston/boston.env | 9 + 2 files changed, 13 insertions(+) diff --git a/board/imgtec/boston/Kconfig b/board

[PATCH v3 07/12] MIPS: boston: Imply various options

2024-05-17 Thread Jiaxun Yang
This is a PC-like platform board. Enable drivers for most on-board devices to make it useful. Signed-off-by: Jiaxun Yang --- arch/mips/Kconfig | 27 +++ 1 file changed, 27 insertions(+) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index eb7f3ad23762..748b5175b2eb

[PATCH v3 06/12] MIPS: Provide dummy acpi_table.h

2024-05-17 Thread Jiaxun Yang
Some drivers need this header. Provide this dummy header as riscv did. Signed-off-by: Jiaxun Yang --- arch/mips/include/asm/acpi_table.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/mips/include/asm/acpi_table.h b/arch/mips/include/asm/acpi_table.h new file mode 100644

[PATCH v3 05/12] ahci: dwc_ahsata: Generalize the driver

2024-05-17 Thread Jiaxun Yang
Remove hard dependencies to arch headers, get clock from clk subsystem if arch clock function is not available, align compatible strings with devicetree binding. No functional change on existing platforms, just get it build on other platforms. Signed-off-by: Jiaxun Yang --- drivers/ata

[PATCH v3 04/12] ahci: DMA addressing fixes

2024-05-17 Thread Jiaxun Yang
address support for dwc_ahsata, ensure higher bits are written into registers/sg properly. Use memalign for allocating aligned buffer in dwc_ahsata so we don't have to do our own alignment in driver. Signed-off-by: Jiaxun Yang --- drivers/ata/ahci.c| 34

[PATCH v3 03/12] pci: Enable PCI_MAP_SYSTEM_MEMORY when ARCH_MAP_SYSMEM is not set

2024-05-17 Thread Jiaxun Yang
For MIPS we are always looking gd->dram in virtual address so PCI_MAP_SYSTEM_MEMORY should always be enabled. If in future we ever want to make it physical we have to set ARCH_MAP_SYSMEM. Signed-off-by: Jiaxun Yang --- drivers/pci/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --

[PATCH v3 02/12] pci: auto: Reduce bridge mem alignment boundary for boston

2024-05-17 Thread Jiaxun Yang
Boston has a very limited memory range for PCI controllers, where 1MB can't easily fit into it. Make alignment boundary of PCI memory resource allocation a Kconfig option and default to 0x1 for boston. Signed-off-by: Jiaxun Yang --- drivers/pci/Kconfig| 9 + drivers/pci

[PATCH v3 01/12] pci: xilinx: Handle size of ecam region properly

2024-05-17 Thread Jiaxun Yang
Probe size of ecam from devicetree properly and cap accessible bus number accorading to ecam region size to ensure we don't go beyond hardware address space. Also disable all interrupts to ensure errors are handled silently. Signed-off-by: Jiaxun Yang --- drivers/pci/pcie_xilinx.c | 53

[PATCH v3 00/12] MIPS: Boston: Various enhancements

2024-05-17 Thread Jiaxun Yang
-system-mips64el -M boston -cpu I6500 -bios ./u-boot.bin -nographic ``` This is my first u-boot contribution, please kindly advise if you have any comments. Thanks Signed-off-by: Jiaxun Yang --- Changes in v3: - Slight change in clk_boston probe order (Jonas) - Link to v2: https

Re: [PATCH 0/7] MIPS: Enable EFI support

2024-05-17 Thread Jiaxun Yang
https://sourceforge.net/projects/efify/ >>[5]: https://github.com/loongson-community/grub >>[6]: https://www.ventoy.net/en/index.html >> >>Signed-off-by: Jiaxun Yang >>--- >>Jiaxun Yang (7): >> MIPS: Implement setjmp >> efi: Allow runtime relocate to

Re: [PATCH 1/1] defconfig: disable VIDEO_COPY on the sandbox

2024-05-17 Thread Jiaxun Yang
elftest block image transfer > bootefi selftest > > Fixes: a75cf70d23ac ("efi: Correct handling of frame buffer") > Signed-off-by: Heinrich Schuchardt Reviewed-by: Jiaxun Yang It turns out that texture copy is only required for 8bpc display, which we don't ca

[PATCH 7/7] MIPS: Implement EFI supporting stuff

2024-05-17 Thread Jiaxun Yang
Implemented crt, ELF and EFI linking, ELF relocation handling and other necessary bits for MIPS EFI. Signed-off-by: Jiaxun Yang --- arch/mips/config.mk| 9 ++ arch/mips/lib/Makefile | 13 +++ arch/mips/lib/crt0_mips_efi.S | 239

[PATCH 6/7] MIPS: Define MIPS EFI related bits everywhere

2024-05-17 Thread Jiaxun Yang
Various file names, instruction defines, magic numbers related to MIPS's EFI implementation. PE magic numbers are from winnt.h, DHCP numbers are from IANA page, boot file names are from other implementations. Signed-off-by: Jiaxun Yang --- include/asm-generic/pe.h | 5

[PATCH 5/7] MIPS: Add smbios_start to arch_global_data

2024-05-17 Thread Jiaxun Yang
This is necessary for SMBIOS to build on MIPS. Signed-off-by: Jiaxun Yang --- arch/mips/include/asm/global_data.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/mips/include/asm/global_data.h b/arch/mips/include/asm/global_data.h index 147a95ecea8b..740bbcdb84e9 100644 --- a/arch

[PATCH 4/7] Makefile.lib: Enforce EFI CFLAGS/AFLAGS

2024-05-17 Thread Jiaxun Yang
EFI AFLAGS/CFLAGS should be enforced for those runtime supporting files as well, otherwise EFI applications will fail to compile on MIPS. Signed-off-by: Jiaxun Yang --- Makefile | 3 +++ scripts/Makefile.lib | 8 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git

[PATCH 3/7] Makefile.lib: Preserve .rodata section for EFI file

2024-05-17 Thread Jiaxun Yang
This is required in performing objcopy to MIPS EFI files. Signed-off-by: Jiaxun Yang --- scripts/Makefile.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 62f87517c09c..52aed7a65d47 100644 --- a/scripts/Makefile.lib +++ b

[PATCH 2/7] efi: Allow runtime relocate to be disabled

2024-05-17 Thread Jiaxun Yang
in this segment, so relocation is totally unnecessary. Also U-Boot does not use traditional .dyn.rel to perform relocation on MIPS, that makes implementation of runtime relocation pretty hard. Signed-off-by: Jiaxun Yang --- include/efi_loader.h | 26 ++ lib/efi_loader

[PATCH 1/7] MIPS: Implement setjmp

2024-05-17 Thread Jiaxun Yang
Implement setjmp with o32/n64 ABI's standard stack frame. Note that those two ABIs slightly disagreed on placement of registers so they are being implemented in two different files. Signed-off-by: Jiaxun Yang --- arch/mips/include/asm/setjmp.h | 36 +++ arch/mips/lib

[PATCH 0/7] MIPS: Enable EFI support

2024-05-17 Thread Jiaxun Yang
://github.com/kontais/EFI-MIPS [2]: https://github.com/loongson-community/firmware-nonfree [3]: http://www.kunluntech.com.cn/klbiosxl [4]: https://sourceforge.net/projects/efify/ [5]: https://github.com/loongson-community/grub [6]: https://www.ventoy.net/en/index.html Signed-off-by: Jiaxun Yang

Re: [PATCH v5 01/12] efi: Correct handling of frame buffer

2024-05-17 Thread Jiaxun Yang
在2024年5月17日五月 下午1:46,Heinrich Schuchardt写道: > On 11/19/23 20:11, Simon Glass wrote: >> The efi_gop driver uses private fields from the video uclass to obtain a >> pointer to the frame buffer. Use the platform data instead. >> >> Check the VIDEO_COPY setting to determine which frame buffer to

[PATCH RFC] doc: Document address spaces used by U-Boot

2024-05-17 Thread Jiaxun Yang
This serves as a reference for developers on how to handle all those address spaces for U-Boot. Signed-off-by: Jiaxun Yang --- Hi all, I was trying to clear up long standing myth of virtual address vs physical adddress mapping on MIPS by having a clear division betweem virt and phys adddress

Re: [PATCH 1/2] virtio: New virtio_gpu driver

2024-05-16 Thread Jiaxun Yang
在2024年5月17日五月 上午2:56,Heinrich Schuchardt写道: [...] >>+config VIRTIO_GPU_SIZE_X >>+ int "Width of display (X resolution)" >>+ default 1280 > > 1920x1080 would look like a reasonable default for me. 1280x1024 was chosen because it is the largest resolution being defined in VESA VBE, hence

  1   2   >