memtest86plus/system
Chao Li 97922cc4cf
Add LoongArch support (#410)
* lib/assert: Add LoongArch assert support

Added LoongArch break 3 assert instruction.

Signed-off-by: Chao Li <lichao@loongson.cn>

* lib/barrier: Add barrier method for LoongArch

Added LoongArch barriers in barrier_spin_wait and barrier_halt_wait
functions.

Signed-off-by: Chao Li <lichao@loognson.cn>

* lib/spinlock: Add LoongArch CPU pause

Because the LoongArch haven't pause instruction, using eight nops to
replace the pause.

Signed-off-by: Chao Li <lichao@loongson.cn>

* lib/string: Make LoongArch use the string function in the file

Since LoongArch GCC doesn't have built-in string functions, use the
string function instance in the sting.c

Signed-off-by: Chao Li <lichao@loongson.cn>

* lib/unistd: Add LoongArch CPU pause

Because the LoongArch haven't pause instruction, using eight nops to
replace the pause.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/acpi: Reduce the way of search RSDP for non-x86 ARCHs

Searching RSDP from legacy BIOS EDBA and reserved areas is available
only on i386 and x64.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/cache: Add LoongArch64 cache operations support

Added cache operations support for LoongArch64.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/cpuid: Add the compile limit

Make the `cpuid` function action only on i386/x64.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/heap: Add heap support for LoongArch64

LoongArch64 uses the low 256MB as the low memory.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/memrw: Add 8-bit and 16-bit memory operations

Added 8-bit and 16-bit memory access operations, which 8-bit uses
`movb` and 16-bit is `movw`.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/memrw: Add LoongArch memory access operations

Added 8/16/32/64-bit memory access operations for LoongArch64.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system: Add Loongson PCI vendor ID and Loongson 7A chipset EHCI workaround

1. Added Loongson PCI vendor ID.
2. Added Loongson 7A chipset ECHI workaround.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/io: Add LoongArch64 IO port operations

Added IO port operations for LoongArch64.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/reloc64: Add LoongArch64 relocations support

Added R_LARCH_RELATIVE and R_LARCH_NONE relocations support for
LoongArch64.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/serial: Add Loongson CPU serial port support

Add the serial port address perfix of Loongson CPU and obtain serial
port clock method.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/smbus: Rename smbus.c to i2c_x86.c

Renamed the smbus.c to i2c_x86.c in i386 and x64 platforms.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/smp: Add LoongArch SMP support

Added LoongArch multi-core support and a way of map to node numbers if
the NUMA is enabled.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/timers: Add LoongArch supports

In LoongArch, there is a stable counter that is independent of other
clocks, it like the TSC in x64. Using it to count the ticks per
millisecond.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/tsc: Add LoongArch support

Usually the frequency of stable counter is not same to CPU frequency, so
using the performance counter for the delay operations.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/usbhcd: Add LoongArch MMIO perfix

Added LoongArch64 MMIO address perfix, use for address the PCI memory
space.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/usbhcd: Add Loongson 7A2000 chipset OHCI BAR offset fix

If the BAR address is not fixed for the Loongson 7A2000 OHCI controller,
some prots will not be usable, This change currently only affects the
LoongArch platform.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system: Add the way to IO access via MMIO

Usually, it is access the IO like PCI IO via MMIO on non-X86 ARCHs, so
a method to access IO via MMIO is added.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system: Add the way to access PCI memory space via MMIO

Some uniformly address ARCHs access the PCI memory depended the MMIO, so
the method to access PCI memory via MMIO is added.

Signed-off-by: Chao Li <lichao@loongson.cn>

* app: Add LoongArch version support

Reduced the version field by two characters to support ARCH name
abbreviations with more than three characters, and added "la64" ARCH
version display.

Singed-off-by: Chao Li <lichao@loongson.cn>

* test/block_move: Add block move test via ASM for LoongArch

Add block move test inline assembly instance for LoongArch.

Signed-off-by: Chao Li <lichao@loongson.cn>

* test/mov_inv_fixed: Add LoongArch ASM version word write operation

Add LoongArch ASM version word write cycle if it uses the HAND_OPTIMISED.

Signed-off-by: Chao Li <lichao@loongson.cn>

* boot: Adjust the AP stack size for LoongArch

LoongArch exception will store all of the GP, FP and CSR on stack, it
need more stack size, make LoongArch AP using 2KB stack size.

Signed-off-by: Chao Li <lichao@loongson.cn>

* boot/efisetup: Add LoongArch CPU halt instruction

Add "idle 0" for LoongArch

Signed-off-by: Chao Li <lichao@loongson.cn>

* boot/efi: Limiting the ms_abi using scope

Make the ms_abi only work on i386 and x64.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/imc/loongson: Add Loongson LoongArch IMC support

Added the Loongson LoongArch CPU IMC instance, support read out the IMC
sequence, currently only supports reading MC0.

Signed-off-by: Chao Li <lichao@loongson.cn>

* app/loongarch: Add intrrupt handler for LoongArch

Added the LoongArch IRQ handler support.

Signed-off-by: Chao Li <lichao@loongson.cn>

* system/loongarch: Add LoongArch ARCH specific files

Added LoongArch ARCH specific files: cpuid.c, cpuinfo.c, hwctrl.c,
memctrl.c, temperature.c, vmem.c, registers.h

They use the same pubilc API for i386 and x64 platforms.

Signed-off-by: Chao Li <lichao@loongson.cn>

* boot: Add LoongArch startup and header

Added the header.S and startup64.S for LoongArch, CPU works on:
1. Page mode.
2. Load and store is cacheable.
3. Instructions is cacheable.
4. DMWn 0 and 1 is used.
5. To access non-cacheable areas, use the perfix 0x8000000000000000.

Signed-off Chao Li <lichao@loongson.cn>

* build64/la64: Add LoongArch64 build files

Add infrastructure files to build memtest86 plus for LoongArch64
platform.

Signed-off-by: Chao Li <lichao@loongson.cn>

* workflows: Add LoongArch64 CI supports

Adjust workflow logci, remvoe 32 and 64 wordsize, replace with "i386,
x86_64 and la64", add LoongArch64 build CI check.

Signed-off-by: Chao Li <lichao@loongson.cn>

---------

Signed-off-by: Chao Li <lichao@loongson.cn>
Signed-off-by: Chao Li <lichao@loognson.cn>
2024-08-30 13:38:46 +02:00
..
imc Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
loongarch Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
acpi.c Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
acpi.h Add initial NUMA awareness support (#378) 2024-03-13 01:43:26 +01:00
cache.h Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
cpuid.c [cpuinfo] Fix old CPUs (P5/P6-class) name and cache info (#267) 2023-03-03 13:21:27 +01:00
cpuid.h Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
cpuinfo.c cpuinfo: Fix VIA Samuel 2 L2 cache (#341) 2023-09-16 18:30:04 +02:00
cpuinfo.h Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
cpulocal.c Faster barrier implementation. 2022-02-28 22:05:21 +00:00
cpulocal.h Faster barrier implementation. 2022-02-28 22:05:21 +00:00
ehci.c Refactor the memrw functions to reduce the redundancy. (#415) 2024-07-16 08:55:13 +01:00
ehci.h Take ownership of all USB controllers before probing for devices. (#167) 2022-10-07 09:32:09 +01:00
font.c Initial commit. 2020-05-24 21:30:55 +01:00
font.h Exclude copyright notices from Doxygen file descriptions. 2022-02-19 19:56:55 +00:00
heap.c Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
heap.h Fix and improve documentation in heap.h (issue #232) 2023-01-03 11:55:51 +00:00
hwctrl.c Add the 64-bit and 32-bit CC flag 2024-07-22 22:50:15 +02:00
hwctrl.h Tidy up code for performing reset via the EFI runtime sevices. 2022-04-23 13:25:33 +01:00
hwquirks.c Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
hwquirks.h Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
i2c_x86.c Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
io.h Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
jedec_id.h Add detection for various JEDEC Manufacturers 2024-01-07 15:20:19 +01:00
keyboard.c By default, only enable USB keyboard detection when booted in UEFI mode. 2022-07-24 13:56:41 +01:00
keyboard.h Add usbdebug command line option and conditionally pause at end of USB scan. 2022-04-17 22:46:17 +01:00
memctrl.c Preliminary ECC support for AMD Zen CPUs (#353) 2023-11-29 12:53:05 +01:00
memctrl.h Preliminary ECC support for AMD Zen CPUs (#353) 2023-11-29 12:53:05 +01:00
memrw.h Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
memsize.h Exclude copyright notices from Doxygen file descriptions. 2022-02-19 19:56:55 +00:00
mmio.h Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
msr.h Preliminary ECC support for AMD Zen CPUs (#353) 2023-11-29 12:53:05 +01:00
ohci.c Refactor the memrw functions to reduce the redundancy. (#415) 2024-07-16 08:55:13 +01:00
ohci.h Take ownership of all USB controllers before probing for devices. (#167) 2022-10-07 09:32:09 +01:00
pci_mmio.c Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
pci.c Include unistd.h in pci.c to use usleep() 2022-05-20 13:46:29 +02:00
pci.h Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
pmem.c Fix the behaviour of sort_pm_map() (issue #392) 2024-04-09 20:07:09 +01:00
pmem.h Exclude copyright notices from Doxygen file descriptions. 2022-02-19 19:56:55 +00:00
reloc32.c Faster barrier implementation. 2022-02-28 22:05:21 +00:00
reloc64.c Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
screen.c Add the 64-bit and 32-bit CC flag 2024-07-22 22:50:15 +02:00
screen.h Add boot options to perform display rotation and set preferred screen resolution (#383) 2024-03-04 14:49:13 +01:00
serial.c Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
serial.h Add support for MMIO UART console (#300) 2023-05-12 15:49:00 +02:00
smbios.c Add the 64-bit and 32-bit CC flag 2024-07-22 22:50:15 +02:00
smbios.h Simple maintenance improvements (#145) 2022-08-15 17:51:48 +02:00
smbus.h Split SPD parsing and printing code from smbus.c to spd.c (#426) 2024-08-08 02:41:19 +02:00
smp.c Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
smp.h Add initial NUMA awareness support (#378) 2024-03-13 01:43:26 +01:00
spd.c Split SPD parsing and printing code from smbus.c to spd.c (#426) 2024-08-08 02:41:19 +02:00
spd.h Split SPD parsing and printing code from smbus.c to spd.c (#426) 2024-08-08 02:41:19 +02:00
temperature.c Fix various temperature-related issues on older Atom CPUs 2023-05-18 16:03:48 +02:00
temperature.h Add Memory Controller Registers polling to get current DRAM Timings/Frequency (#306) 2023-05-12 15:33:28 +02:00
timers.c Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
timers.h Add ACPI Timer as the primary TSC correction source and PIT Timer as fallback 2022-06-19 16:39:03 +02:00
tsc.h Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
uhci.c Refactor the memrw functions to reduce the redundancy. (#415) 2024-07-16 08:55:13 +01:00
uhci.h Take ownership of all USB controllers before probing for devices. (#167) 2022-10-07 09:32:09 +01:00
usb.h Exclude copyright notices from Doxygen file descriptions. 2022-02-19 19:56:55 +00:00
usbhcd.c Add LoongArch support (#410) 2024-08-30 13:38:46 +02:00
usbhcd.h Fix EHCI and XHCI drivers to handle USB1 hubs (issue #156) 2022-09-08 18:09:43 +01:00
vmem.c Add option to map_region to indicate we only use the region during startup. 2022-02-28 22:05:21 +00:00
vmem.h Rework memory mapping to allow for larger program size (#54) 2022-04-28 23:04:01 +02:00
xhci.c Refactor the memrw functions to reduce the redundancy. (#415) 2024-07-16 08:55:13 +01:00
xhci.h Take ownership of all USB controllers before probing for devices. (#167) 2022-10-07 09:32:09 +01:00