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

2024-05-16 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 + driver

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

2024-05-16 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 --gi

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

2024-05-16 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 v2 04/12] ahci: DMA addressing fixes

2024-05-16 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

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

2024-05-16 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 v2 07/12] MIPS: boston: Imply various options

2024-05-16 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 v2 08/12] MIPS: boston: Provide default env vars

2024-05-16 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 v2 11/12] MIPS: boston: Migrate to OF_UPSTREAM

2024-05-16 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 v2 09/12] clk: boston: Allow to get regmap from parent device

2024-05-16 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 --- drivers/clk/clk_bos

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

2024-05-16 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 v2 12/12] mailmap: Update email for Paul Burton

2024-05-16 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

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

2024-05-16 Thread Jiaxun Yang
在2024年5月14日五月 上午6:45,Sumit Garg写道: > Hi Jiaxun, > [...] >> @@ -0,0 +1,10 @@ >> +// SPDX-License-Identifier: GPL-2.0+ >> + >> +&plat_regs { >> + compatible = "img,boston-platform-regs", "syscon", "simple-mfd"; >> + bootph-all; >> +}; >> + >> +&clk_boston { >> + bootph-all; >> +}

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

2024-05-16 Thread Jiaxun Yang
在2024年5月16日五月 下午3:00,Jonas Karlman写道: > Hi Jiaxun, > > On 2024-05-16 13:40, Jiaxun Yang wrote: >> 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

[PATCH 0/6] video: pixel format handling fixes and improvements

2024-05-16 Thread Jiaxun Yang
bpc for BMP display, now we can display any image depth on any target display controller. Please review. Thanks Signed-off-by: Jiaxun Yang --- Jiaxun Yang (6): video: Move generated bmp headers to include/generated video: Add gitignore for u_boot_logo.S video: Rework pixel format

[PATCH 2/6] video: Add gitignore for u_boot_logo.S

2024-05-16 Thread Jiaxun Yang
We don't want this generated file to be tracked by git. Signed-off-by: Jiaxun Yang --- drivers/video/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/.gitignore b/drivers/video/.gitignore new file mode 100644 index ..163c491c7630 --- /dev/null

[PATCH 1/6] video: Move generated bmp headers to include/generated

2024-05-16 Thread Jiaxun Yang
Emphasis that those headers are generated. Also naturally gitignore them. Signed-off-by: Jiaxun Yang --- Makefile | 2 +- board/aristainetos/aristainetos.c | 2 +- board/toradex/common/tdx-common.c | 2 +- common/splash.c | 4 ++-- tools/Makefile

[PATCH 3/6] video: Rework pixel format handling

2024-05-16 Thread Jiaxun Yang
el conversion functions are stripped to video_format.h so we can include them in sdl.c without pull in all u-boot headers, and inline those conversion functions everywhere. Signed-off-by: Jiaxun Yang --- drivers/video/console_truetype.c | 4 +- drivers/video/simplefb.c | 2 +- driver

[PATCH 4/6] video: bmp: Rework with video_rgb_to_pixel_*

2024-05-16 Thread Jiaxun Yang
: Jiaxun Yang --- drivers/video/video_bmp.c | 201 +- test/dm/video.c | 4 +- 2 files changed, 59 insertions(+), 146 deletions(-) diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c index 83380a87fd2b..80c276aaf231 100644 --- a

[PATCH 5/6] video: sandbox_sdl: Implement more pixel formats

2024-05-16 Thread Jiaxun Yang
Support most of possible pixel formats so we can test them in sandbox. Signed-off-by: Jiaxun Yang --- arch/sandbox/cpu/sdl.c | 58 +- arch/sandbox/include/asm/sdl.h | 17 - drivers/video/sandbox_sdl.c| 16 +++- include/dm

[PATCH 6/6] video: bochs: Setup framebuffer endian

2024-05-16 Thread Jiaxun Yang
l, my approach is to default to little endian framebuffer for ISAs except powerpc and perform endian switch to match this assumption. Signed-off-by: Jiaxun Yang --- drivers/video/bochs.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/video/bochs.c b/drivers/video/bochs.c

[PATCH 0/2] virtio_gpu driver and relevant fix

2024-05-16 Thread Jiaxun Yang
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 --- Jiaxun Yang (2): virtio: New

[PATCH 1/2] virtio: New virtio_gpu driver

2024-05-16 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 --- drivers/virtio/Kconfig | 29 +++ drivers/virtio/Makefile| 1 + drivers/virtio

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

2024-05-16 Thread Jiaxun Yang
spec to reflect this nature. Signed-off-by: Jiaxun Yang --- include/efi_api.h| 1 + lib/efi_loader/efi_gop.c | 9 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/efi_api.h b/include/efi_api.h index ab40b1b5ddf6..3eaefb322878 100644 --- a/include/efi_api.h

Re: [PATCH 0/2] virtio_gpu driver and relevant fix

2024-05-16 Thread Jiaxun Yang
在2024年5月17日五月 上午12:03,Jiaxun Yang写道: > Hi all, > > This series added support for virtio-gpu device, it has been > tested on QEMU riscv64 and aarch64. > > I also fixed a problem in EFI GOP so it works with EFI applications > as well. > > There is a problem remain

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

2024-05-16 Thread Jiaxun Yang
在2024年5月17日五月 上午2:44,Heinrich Schuchardt写道: [...] Hi Heinrich, >> >> plat = dev_get_uclass_plat(vdev); >>+ ops = video_get_ops(vid); >> fb_base = IS_ENABLED(CONFIG_VIDEO_COPY) ? plat->copy_base : plat->base; > > Wasn't this line introduced to handle the video sync case by pointing

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

[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 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 use

[PATCH 0/7] MIPS: Enable EFI support

2024-05-17 Thread Jiaxun Yang
[1]: https://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: J

[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/mip

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

2024-05-17 Thread Jiaxun Yang
ys 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/

[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 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 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 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

[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

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'

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

2024-05-17 Thread Jiaxun Yang
;>[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 >>--- >>Jiaxun Yang (7): >> MIPS: Implement setjmp >> efi: Allow runtime reloc

[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

[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

[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 + driver

[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 --gi

[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

[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 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 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 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 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 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 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 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 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 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 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

[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

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 d

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/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

[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: Intr

[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 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

[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 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 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 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 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 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

[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 --- a

[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 ---

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

2024-05-19 Thread Jiaxun Yang
: 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 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 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 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 00/10] xtensa: Enable qemu-xtensa board

2024-05-19 Thread Jiaxun Yang
64-2020.07-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

[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 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 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 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 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 --- dr

[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 ch

[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 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 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

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 wa

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 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 tha

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: boa

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_addre

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

2024-05-21 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. All

[PATCH 00/16] LoongArch initial support

2024-05-22 Thread Jiaxun Yang
intended to use U-Boot as an 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

[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 02/16] linux/io.h: Use map_physmem to implement ioremap

2024-05-22 Thread Jiaxun Yang
es VA == 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 10

[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 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 @@ ty

[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 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 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 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 10/16] LoongArch: Boot Image bits

2024-05-22 Thread Jiaxun Yang
that table 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

[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

<    1   2   3   >