[PATCH 1/1] spl: Improve error message for SPL memory allocation

2024-03-13 Thread Leo Yu-Chi Liang
There could be two memory allocation scheme in SPL phase. Explicitly print the corresponding error message. Signed-off-by: Leo Yu-Chi Liang --- common/spl/spl_fit.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index

[PATCH v2 6/6] andes: ae350: Enable MISC_INIT_R for ae350 platform

2023-12-25 Thread Leo Yu-Chi Liang
Enable MISC_INIT_R for ae350 to support CPU name detection and re-sync the configs via make savedefconfig. Signed-off-by: Leo Yu-Chi Liang --- configs/ae350_rv32_defconfig | 5 +++-- configs/ae350_rv32_spl_defconfig | 5 +++-- configs/ae350_rv32_spl_xip_defconfig | 5 +++-- configs

[PATCH v2 5/6] andes: ae350: Save cpu name to env

2023-12-25 Thread Leo Yu-Chi Liang
Detect CPU name through marchid and then save it to env. Signed-off-by: Leo Yu-Chi Liang --- board/AndesTech/ae350/ae350.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/board/AndesTech/ae350/ae350.c b/board/AndesTech/ae350/ae350.c index bef9e3149e..4e53fee5d2

[PATCH v2 4/6] andes: cpu: Enable cache and TLB ECC support

2023-12-25 Thread Leo Yu-Chi Liang
Andes CPU supports cache and TLB ECC. Enable them by default. Signed-off-by: Leo Yu-Chi Liang --- arch/riscv/cpu/andesv5/cpu.c| 3 ++- arch/riscv/include/asm/arch-andes/csr.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/riscv/cpu/andesv5/cpu.c b/arch

[PATCH v2 3/6] andes: cpu: Enable memboost feature

2023-12-25 Thread Leo Yu-Chi Liang
Andes CPU has memboost feature including prefetch, write-around and non-blocking load. Enable them by default. Signed-off-by: Leo Yu-Chi Liang --- arch/riscv/cpu/andesv5/cpu.c| 9 - arch/riscv/include/asm/arch-andes/csr.h | 6 ++ 2 files changed, 14 insertions(+), 1

[PATCH v2 2/6] andes: ae350: Implement cache switch via Kconfig

2023-12-25 Thread Leo Yu-Chi Liang
Kconfig provides SYS_[I|D]CACHE_OFF config options to switch off caches. Provide the corresponding implementation to the options. Signed-off-by: Leo Yu-Chi Liang --- arch/riscv/cpu/andesv5/cpu.c | 25 - board/AndesTech/ae350/ae350.c | 3 ++- 2 files changed, 18

[PATCH v2 1/6] andes: csr.h: Clean up CSR definition

2023-12-25 Thread Leo Yu-Chi Liang
Signed-off-by: Leo Yu-Chi Liang --- arch/riscv/include/asm/arch-andes/csr.h | 20 arch/riscv/include/asm/csr.h| 1 + 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/arch/riscv/include/asm/arch-andes/csr.h b/arch/riscv/include/asm/arch-andes

[PATCH 5/5] andes: ae350: Save cpu name to env

2023-12-25 Thread Leo Yu-Chi Liang
Detect CPU name through marchid and then save it to env. Signed-off-by: Leo Yu-Chi Liang --- board/AndesTech/ae350/ae350.c | 20 1 file changed, 20 insertions(+) diff --git a/board/AndesTech/ae350/ae350.c b/board/AndesTech/ae350/ae350.c index bef9e3149e..9faf46d96e 100644

[PATCH 4/5] andes: cpu: Enable cache and TLB ECC support

2023-12-25 Thread Leo Yu-Chi Liang
Andes CPU supports cache and TLB ECC. Enable them by default. Signed-off-by: Leo Yu-Chi Liang --- arch/riscv/cpu/andesv5/cpu.c| 1 + arch/riscv/include/asm/arch-andes/csr.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/arch/riscv/cpu/andesv5/cpu.c b/arch/riscv/cpu/andesv5

[PATCH 3/5] andes: cpu: Enable memboost feature

2023-12-25 Thread Leo Yu-Chi Liang
Andes CPU has memboost feature including prefetch, write-around and non-blocking load. Enable them by default. Signed-off-by: Leo Yu-Chi Liang --- arch/riscv/cpu/andesv5/cpu.c| 7 +++ arch/riscv/include/asm/arch-andes/csr.h | 6 ++ 2 files changed, 13 insertions(+) diff

[PATCH 2/5] andes: ae350: Implement cache switch via Kconfig

2023-12-25 Thread Leo Yu-Chi Liang
Kconfig provides SYS_[I|D]CACHE_OFF config options to switch off caches. Implement the corresponding options. Signed-off-by: Leo Yu-Chi Liang --- arch/riscv/cpu/andesv5/cpu.c | 9 +++-- board/AndesTech/ae350/ae350.c | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git

[PATCH 1/5] andes: csr.h: Clean up CSR definition

2023-12-25 Thread Leo Yu-Chi Liang
Signed-off-by: Leo Yu-Chi Liang --- arch/riscv/include/asm/arch-andes/csr.h | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/arch/riscv/include/asm/arch-andes/csr.h b/arch/riscv/include/asm/arch-andes/csr.h index 393d51c6dd..93aa8b2343 100644 --- a/arch

[PATCH v2 2/2] riscv: ae350: Adjust the memory layout of ae350

2023-02-14 Thread Leo Yu-Chi Liang
Adjust the initial stack pointer address to 0x1000(256M) Signed-off-by: Leo Yu-Chi Liang --- Change v1 -> v2: * Modify the address from 0x100(16MB) to 0x1000(256MB) --- configs/ae350_rv32_spl_defconfig | 6 +++--- configs/ae350_rv32_spl_xip_defconfig | 6 +++--- conf

[PATCH v2 1/2] riscv: Rename Andes cpu and board names

2023-02-14 Thread Leo Yu-Chi Liang
The current ae350-related defconfigs could also support newer Andes CPU IP, so modify the names of CPU from ax25 to andesv5, and board name from ax25-ae350 to ae350. Signed-off-by: Leo Yu-Chi Liang Reviewed-by: Yu Chien Peter Lin Reviewed-by: Rick Chen --- arch/riscv/Kconfig

[V3,1/1] riscv: Increase the upper bound of NR_CPUS to 4095

2023-02-13 Thread Leo Yu-Chi Liang
ine CONFIG_NR_CPUS to be 1 if CONFIG_NR_CPUS is not defined. Tested on sifive unmatched. Signed-off-by: Xiang W Signed-off-by: Leo Yu-Chi Liang --- Changes v2 -> v3: - Fix the calculation of the GD_AVAILABLE_HARTS start address - Fix compilation error for defconfigs that do not define CONFIG_N

[PATCH 2/2] riscv: ae350: Adjust the memory layout of ae350

2023-02-09 Thread Leo Yu-Chi Liang
Signed-off-by: Leo Yu-Chi Liang --- configs/ae350_rv32_spl_defconfig | 6 +++--- configs/ae350_rv32_spl_xip_defconfig | 6 +++--- configs/ae350_rv64_spl_defconfig | 6 +++--- configs/ae350_rv64_spl_xip_defconfig | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git

[PATCH 1/2] riscv: Rename Andes cpu and board names

2023-02-09 Thread Leo Yu-Chi Liang
The current ae350-related defconfigs could also support newer Andes CPU IP, so modify the names of CPU from ax25 to andesv5, and board name from ax25-ae350 to ae350. Signed-off-by: Leo Yu-Chi Liang --- arch/riscv/Kconfig | 8 arch/riscv/cpu/{ax25

[PATCH 1/1] riscv: ae350: Fix XIP config boot failure

2022-05-31 Thread Leo Yu-Chi Liang
P mode, to be returned. Fix this. Fixes: 2e8d2f88439d ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards") Signed-off-by: Rick Chen Signed-off-by: Leo Yu-Chi Liang --- arch/riscv/cpu/start.S | 3 ++- board/AndesTech/ax25-ae350/ax25-ae350.c | 17 +++-- 2 files changed, 13

[PATCH v2, 1/1] riscv: Clean up asm/io.h

2022-05-19 Thread Leo Yu-Chi Liang
l off confusing #ifdef __mem_pci block") Signed-off-by: Leo Yu-Chi Liang Reviewed-by: Bin Meng --- arch/riscv/include/asm/io.h | 117 +--- 1 file changed, 1 insertion(+), 116 deletions(-) diff --git a/arch/riscv/include/asm/io.h b/arch/riscv/include/asm/i

[PATCH 1/1] riscv: Clean up asm/io.h

2022-05-18 Thread Leo Yu-Chi Liang
of the file. Signed-off-by: Leo Yu-Chi Liang --- arch/riscv/include/asm/io.h | 117 +--- 1 file changed, 1 insertion(+), 116 deletions(-) diff --git a/arch/riscv/include/asm/io.h b/arch/riscv/include/asm/io.h index fc39bb2c70..49bffac03c 100644 --- a/arch/riscv

[PATCH 1/1] board: ae350: Support autoboot from RAM

2021-11-03 Thread Leo Yu-Chi Liang
$cmd } The address where the kernel is loaded can be altered by changing the value of KERNEL_IMAGE_ADDR. Signed-off-by: Leo Yu-Chi Liang --- include/configs/ax25-ae350.h | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/configs/ax25-ae350.h b/include/configs/a

[PATCH v2] riscv: ae350: Use #if defined instead of CONFIG_IS_ENABLED

2021-11-01 Thread Leo Yu-Chi Liang
According to ./include/linux/kconfig.h, CONFIG_IS_ENABLED(OF_BOARD) expands to 0 when CONFIG_SPL_BUILD is defined because there is no CONFIG_SPL_OF_BOARD. Use #if defined instead. Fixes: 2e8d2f88439d ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards") Signed-off-by: Leo Yu-Chi Liang

[PATCH] Fix syntax error

2021-10-27 Thread Leo Yu-Chi Liang
This statement has an unmatched parentheses, fix it. Signed-off-by: Leo Yu-Chi Liang --- common/image-board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/image-board.c b/common/image-board.c index e7660352e9..ddf30c6730 100644 --- a/common/image-board.c +++ b

[PATCH] riscv: ae350: Use #if defined instead of CONFIG_IS_ENABLED

2021-10-27 Thread Leo Yu-Chi Liang
According to ./include/linux/kconfig.h, CONFIG_IS_ENABLED(OF_BOARD) expands to 0 when CONFIG_SPL_BUILD is defined because there is no CONFIG_SPL_OF_BOARD. Use #if defined instead. Signed-off-by: Leo Yu-Chi Liang --- board/AndesTech/ax25-ae350/ax25-ae350.c | 4 ++-- 1 file changed, 2 insertions

[PATCH 1/1] riscv: ae350: enable Coherence Manager for ae350

2021-09-22 Thread Leo Yu-Chi Liang
If Coherence Manager were not set in the beginning, u-boot-spl would sometimes fail to boot to u-boot proper. Enable CM and I/D cache at the same time in harts_early_init Signed-off-by: Leo Yu-Chi Liang --- arch/riscv/cpu/ax25/cpu.c | 42 +++ 1 file changed

[PATCH 1/1] riscv: Fix linking error when building u-boot-spl with no SMP support

2020-06-29 Thread Leo Yu-Chi Liang
Switch off SMP support when building u-boot-spl would cause linking error as follow: undefined reference to 'secondary hart relocate' and 'smp_call_function'. Add macro to wrap up proper code region that needs SMP configuration on. Signed-off by: Leo Liang Cc: r...@andestech.com ---