[PATCH v1 0/3] arm: NPCM: fix npcm bmc error

1. fix incorrect ram size with ecc enabld
2. add name for gpio function
3. add baud rate table
Jim Liu (3): pinctrl: npcm8xx: add name for gpio function arm: NPCM: modify baud rate table and dram setting arm: npcm8xx: support dcache off
arch/arm/mach-npcm/npcm8xx/Kconfig | 4 ++++ arch/arm/mach-npcm/npcm8xx/cpu.c | 12 +++++++++++- board/nuvoton/arbel_evb/arbel_evb.c | 16 ++++++++-------- configs/arbel_evb_defconfig | 1 + drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c | 1 + include/configs/arbel.h | 4 +++- include/configs/poleg.h | 1 + 7 files changed, 29 insertions(+), 10 deletions(-)

Signed-off-by: Jim Liu JJLIU0@nuvoton.com --- drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c index 7976e3b3ed..ff49819b58 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c @@ -329,6 +329,7 @@ struct group_info {
static const struct group_info npcm8xx_groups[] = { FUNC_LIST + {FN_gpio, "GPIO", NULL, 0, 0, 0} };
/* Pin flags */

Signed-off-by: Jim Liu JJLIU0@nuvoton.com --- board/nuvoton/arbel_evb/arbel_evb.c | 16 ++++++++-------- configs/arbel_evb_defconfig | 1 + include/configs/arbel.h | 4 +++- include/configs/poleg.h | 1 + 4 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/board/nuvoton/arbel_evb/arbel_evb.c b/board/nuvoton/arbel_evb/arbel_evb.c index e52e0a59ab..3fb49a9549 100644 --- a/board/nuvoton/arbel_evb/arbel_evb.c +++ b/board/nuvoton/arbel_evb/arbel_evb.c @@ -16,7 +16,7 @@ #define DRAM_1GB_SIZE 0x40000000ULL #define DRAM_2GB_ECC_SIZE 0x70000000ULL #define DRAM_2GB_SIZE 0x80000000ULL -#define DRAM_4GB_ECC_SIZE 0xE00000000ULL +#define DRAM_4GB_ECC_SIZE 0xE0000000ULL #define DRAM_4GB_SIZE 0x100000000ULL
DECLARE_GLOBAL_DATA_PTR; @@ -29,7 +29,6 @@ int board_init(void) int dram_init(void) { struct npcm_gcr *gcr = (struct npcm_gcr *)NPCM_GCR_BA; - uint64_t delta = 0ULL;
/* * get dram active size value from bootblock. @@ -62,26 +61,27 @@ int dram_init(void) gd->bd->bi_dram[1].size = 0; break; case DRAM_4GB_ECC_SIZE: - gd->bd->bi_dram[0].size = DRAM_2GB_ECC_SIZE; + gd->bd->bi_dram[0].size = DRAM_2GB_SIZE; gd->bd->bi_dram[1].start = DRAM_4GB_SIZE; - gd->bd->bi_dram[1].size = DRAM_2GB_SIZE; - delta = DRAM_4GB_SIZE - DRAM_2GB_ECC_SIZE; + gd->bd->bi_dram[1].size = DRAM_2GB_SIZE - (DRAM_4GB_SIZE - DRAM_4GB_ECC_SIZE); + /* use bank0 only */ + gd->ram_size = DRAM_2GB_SIZE; break; case DRAM_4GB_SIZE: gd->bd->bi_dram[0].size = DRAM_2GB_SIZE; gd->bd->bi_dram[1].start = DRAM_4GB_SIZE; gd->bd->bi_dram[1].size = DRAM_2GB_SIZE; - delta = DRAM_4GB_SIZE - DRAM_2GB_SIZE; + /* use bank0 only */ + gd->ram_size = DRAM_2GB_SIZE; break; default: gd->bd->bi_dram[0].size = DRAM_1GB_SIZE; gd->bd->bi_dram[1].start = 0; gd->bd->bi_dram[1].size = 0; + gd->ram_size = DRAM_1GB_SIZE; break; }
- gd->ram_size -= delta; - return 0; }
diff --git a/configs/arbel_evb_defconfig b/configs/arbel_evb_defconfig index ce7f2355e1..eb6b0c05c4 100644 --- a/configs/arbel_evb_defconfig +++ b/configs/arbel_evb_defconfig @@ -58,6 +58,7 @@ CONFIG_MMC_SDHCI_NPCM=y CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH_MACRONIX=y CONFIG_SPI_FLASH_WINBOND=y +# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set CONFIG_PHY_BROADCOM=y CONFIG_PHY_GIGE=y CONFIG_ETH_DESIGNWARE=y diff --git a/include/configs/arbel.h b/include/configs/arbel.h index 891257bc93..f103f7e452 100644 --- a/include/configs/arbel.h +++ b/include/configs/arbel.h @@ -7,10 +7,12 @@ #define __CONFIG_ARBEL_H
#define CFG_SYS_SDRAM_BASE 0x0 -#define CFG_SYS_BOOTMAPSZ (30 << 20) +#define CFG_SYS_BOOTMAPSZ (128 << 20) #define CFG_SYS_BOOTM_LEN (20 << 20) #define CFG_SYS_INIT_RAM_ADDR CFG_SYS_SDRAM_BASE #define CFG_SYS_INIT_RAM_SIZE 0x8000 +#define CFG_SYS_BAUDRATE_TABLE { 9600, 14400, 19200, 38400, 57600, 115200, 230400, \ + 380400, 460800, 921600 }
/* Default environemnt variables */ #define CFG_EXTRA_ENV_SETTINGS "uimage_flash_addr=80400000\0" \ diff --git a/include/configs/poleg.h b/include/configs/poleg.h index 1e96e838be..5bea70b8b4 100644 --- a/include/configs/poleg.h +++ b/include/configs/poleg.h @@ -12,6 +12,7 @@
#define CFG_SYS_BOOTMAPSZ (0x30 << 20) #define CFG_SYS_SDRAM_BASE 0x0 +#define CFG_SYS_BAUDRATE_TABLE { 57600, 115200, 230400, 460800 }
/* Default environemnt variables */ #define CFG_EXTRA_ENV_SETTINGS "uimage_flash_addr=80200000\0" \

do not enable dcache by setting CONFIG_SYS_NPCM_DCACHE_OFF=y
Signed-off-by: Jim Liu JJLIU0@nuvoton.com --- arch/arm/mach-npcm/npcm8xx/Kconfig | 4 ++++ arch/arm/mach-npcm/npcm8xx/cpu.c | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-npcm/npcm8xx/Kconfig b/arch/arm/mach-npcm/npcm8xx/Kconfig index 5f4a0506dc..163e7e7d48 100644 --- a/arch/arm/mach-npcm/npcm8xx/Kconfig +++ b/arch/arm/mach-npcm/npcm8xx/Kconfig @@ -6,6 +6,10 @@ config SYS_CPU config SYS_SOC default "npcm8xx"
+config SYS_NPCM_DCACHE_OFF + bool "Do not enable dcache" + default n + config TARGET_ARBEL_EVB bool "Arbel Evaluation Board" help diff --git a/arch/arm/mach-npcm/npcm8xx/cpu.c b/arch/arm/mach-npcm/npcm8xx/cpu.c index af59452609..fc691de950 100644 --- a/arch/arm/mach-npcm/npcm8xx/cpu.c +++ b/arch/arm/mach-npcm/npcm8xx/cpu.c @@ -81,7 +81,8 @@ int print_cpuinfo(void)
int arch_cpu_init(void) { - if (!IS_ENABLED(CONFIG_SYS_DCACHE_OFF)) { + if (!IS_ENABLED(CONFIG_SYS_DCACHE_OFF) && + !IS_ENABLED(CONFIG_SYS_NPCM_DCACHE_OFF)) { /* Enable cache to speed up system running */ if (get_sctlr() & CR_M) return 0; @@ -143,3 +144,12 @@ int timer_init(void)
return 0; } + +void enable_caches(void) +{ + icache_enable(); + + if (!IS_ENABLED(CONFIG_SYS_NPCM_DCACHE_OFF)) + dcache_enable(); + +}

On Tue, Sep 26, 2023 at 04:56:50PM +0800, Jim Liu wrote:
do not enable dcache by setting CONFIG_SYS_NPCM_DCACHE_OFF=y
Signed-off-by: Jim Liu JJLIU0@nuvoton.com
arch/arm/mach-npcm/npcm8xx/Kconfig | 4 ++++ arch/arm/mach-npcm/npcm8xx/cpu.c | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-npcm/npcm8xx/Kconfig b/arch/arm/mach-npcm/npcm8xx/Kconfig index 5f4a0506dc..163e7e7d48 100644 --- a/arch/arm/mach-npcm/npcm8xx/Kconfig +++ b/arch/arm/mach-npcm/npcm8xx/Kconfig @@ -6,6 +6,10 @@ config SYS_CPU config SYS_SOC default "npcm8xx"
+config SYS_NPCM_DCACHE_OFF
- bool "Do not enable dcache"
- default n
config TARGET_ARBEL_EVB bool "Arbel Evaluation Board" help
Why do we need a new Kconfig option here on top of the existing generic ones to control cache?

Hi Tom
Thanks for the quick review.
if we set the CONFIG_SYS_DCACHE_OFF the armv8 will build error. So we added a workaround for our bmc uboot.
the error message as below:
CONFIG_SYS_DCACHE_OFF can't be enabled on armv8, or the following build error would happen.
arch/arm/cpu/armv8/cpu.o: in function `cleanup_before_linux': arch/arm/cpu/armv8/cpu.c:60: undefined reference to `icache_disable' arch/arm/cpu/armv8/cpu.c:68: undefined reference to `dcache_disable' arch/arm/cpu/armv8/cpu.c:69: undefined reference to `invalidate_dcache_all'
Best regards, Jim
On Tue, Sep 26, 2023 at 9:48 PM Tom Rini trini@konsulko.com wrote:
On Tue, Sep 26, 2023 at 04:56:50PM +0800, Jim Liu wrote:
do not enable dcache by setting CONFIG_SYS_NPCM_DCACHE_OFF=y
Signed-off-by: Jim Liu JJLIU0@nuvoton.com
arch/arm/mach-npcm/npcm8xx/Kconfig | 4 ++++ arch/arm/mach-npcm/npcm8xx/cpu.c | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-npcm/npcm8xx/Kconfig b/arch/arm/mach-npcm/npcm8xx/Kconfig index 5f4a0506dc..163e7e7d48 100644 --- a/arch/arm/mach-npcm/npcm8xx/Kconfig +++ b/arch/arm/mach-npcm/npcm8xx/Kconfig @@ -6,6 +6,10 @@ config SYS_CPU config SYS_SOC default "npcm8xx"
+config SYS_NPCM_DCACHE_OFF
bool "Do not enable dcache"
default n
config TARGET_ARBEL_EVB bool "Arbel Evaluation Board" help
Why do we need a new Kconfig option here on top of the existing generic ones to control cache?
-- Tom

On Thu, Sep 28, 2023 at 08:49:23AM +0800, Jim Liu wrote:
Hi Tom
Thanks for the quick review.
if we set the CONFIG_SYS_DCACHE_OFF the armv8 will build error. So we added a workaround for our bmc uboot.
the error message as below:
CONFIG_SYS_DCACHE_OFF can't be enabled on armv8, or the following build error would happen.
arch/arm/cpu/armv8/cpu.o: in function `cleanup_before_linux': arch/arm/cpu/armv8/cpu.c:60: undefined reference to `icache_disable' arch/arm/cpu/armv8/cpu.c:68: undefined reference to `dcache_disable' arch/arm/cpu/armv8/cpu.c:69: undefined reference to `invalidate_dcache_all'
OK, so you need https://patchwork.ozlabs.org/project/uboot/patch/20230811054228.3721455-1-bh... to be applied, as-is, yes? Thanks!
Best regards, Jim
On Tue, Sep 26, 2023 at 9:48 PM Tom Rini trini@konsulko.com wrote:
On Tue, Sep 26, 2023 at 04:56:50PM +0800, Jim Liu wrote:
do not enable dcache by setting CONFIG_SYS_NPCM_DCACHE_OFF=y
Signed-off-by: Jim Liu JJLIU0@nuvoton.com
arch/arm/mach-npcm/npcm8xx/Kconfig | 4 ++++ arch/arm/mach-npcm/npcm8xx/cpu.c | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-npcm/npcm8xx/Kconfig b/arch/arm/mach-npcm/npcm8xx/Kconfig index 5f4a0506dc..163e7e7d48 100644 --- a/arch/arm/mach-npcm/npcm8xx/Kconfig +++ b/arch/arm/mach-npcm/npcm8xx/Kconfig @@ -6,6 +6,10 @@ config SYS_CPU config SYS_SOC default "npcm8xx"
+config SYS_NPCM_DCACHE_OFF
bool "Do not enable dcache"
default n
config TARGET_ARBEL_EVB bool "Arbel Evaluation Board" help
Why do we need a new Kconfig option here on top of the existing generic ones to control cache?
-- Tom

Hi Tom
Thanks for your understanding. but this patch is an incomplete patch. After I applied this patch I had another error.
arch/arm/cpu/armv8/cache_v8.c:773:2: error: #error Please describe your MMU layout in CONFIG_SYS_MEM_MAP and enable dcache. 773 | #error Please describe your MMU layout in CONFIG_SYS_MEM_MAP and enable dcache.
This error is the same as that link.
Best regards, Jim
On Thu, Sep 28, 2023 at 8:23 PM Tom Rini trini@konsulko.com wrote:
On Thu, Sep 28, 2023 at 08:49:23AM +0800, Jim Liu wrote:
Hi Tom
Thanks for the quick review.
if we set the CONFIG_SYS_DCACHE_OFF the armv8 will build error. So we added a workaround for our bmc uboot.
the error message as below:
CONFIG_SYS_DCACHE_OFF can't be enabled on armv8, or the following build error would happen.
arch/arm/cpu/armv8/cpu.o: in function `cleanup_before_linux': arch/arm/cpu/armv8/cpu.c:60: undefined reference to `icache_disable' arch/arm/cpu/armv8/cpu.c:68: undefined reference to `dcache_disable' arch/arm/cpu/armv8/cpu.c:69: undefined reference to `invalidate_dcache_all'
OK, so you need https://patchwork.ozlabs.org/project/uboot/patch/20230811054228.3721455-1-bh... to be applied, as-is, yes? Thanks!
Best regards, Jim
On Tue, Sep 26, 2023 at 9:48 PM Tom Rini trini@konsulko.com wrote:
On Tue, Sep 26, 2023 at 04:56:50PM +0800, Jim Liu wrote:
do not enable dcache by setting CONFIG_SYS_NPCM_DCACHE_OFF=y
Signed-off-by: Jim Liu JJLIU0@nuvoton.com
arch/arm/mach-npcm/npcm8xx/Kconfig | 4 ++++ arch/arm/mach-npcm/npcm8xx/cpu.c | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-npcm/npcm8xx/Kconfig b/arch/arm/mach-npcm/npcm8xx/Kconfig index 5f4a0506dc..163e7e7d48 100644 --- a/arch/arm/mach-npcm/npcm8xx/Kconfig +++ b/arch/arm/mach-npcm/npcm8xx/Kconfig @@ -6,6 +6,10 @@ config SYS_CPU config SYS_SOC default "npcm8xx"
+config SYS_NPCM_DCACHE_OFF
bool "Do not enable dcache"
default n
config TARGET_ARBEL_EVB bool "Arbel Evaluation Board" help
Why do we need a new Kconfig option here on top of the existing generic ones to control cache?
-- Tom
-- Tom

On Thu, Sep 28, 2023 at 10:32:51PM +0800, Jim Liu wrote:
Hi Tom
Thanks for your understanding. but this patch is an incomplete patch. After I applied this patch I had another error.
arch/arm/cpu/armv8/cache_v8.c:773:2: error: #error Please describe your MMU layout in CONFIG_SYS_MEM_MAP and enable dcache. 773 | #error Please describe your MMU layout in CONFIG_SYS_MEM_MAP and enable dcache.
This error is the same as that link.
Please use that patch as a starting point (and also possibly needing to grab https://patchwork.ozlabs.org/project/uboot/patch/20230822075112.717992-2-bhu... as that's how I'd like to proceed with addressing this generic armv8 issue, thanks!
Best regards, Jim
On Thu, Sep 28, 2023 at 8:23 PM Tom Rini trini@konsulko.com wrote:
On Thu, Sep 28, 2023 at 08:49:23AM +0800, Jim Liu wrote:
Hi Tom
Thanks for the quick review.
if we set the CONFIG_SYS_DCACHE_OFF the armv8 will build error. So we added a workaround for our bmc uboot.
the error message as below:
CONFIG_SYS_DCACHE_OFF can't be enabled on armv8, or the following build error would happen.
arch/arm/cpu/armv8/cpu.o: in function `cleanup_before_linux': arch/arm/cpu/armv8/cpu.c:60: undefined reference to `icache_disable' arch/arm/cpu/armv8/cpu.c:68: undefined reference to `dcache_disable' arch/arm/cpu/armv8/cpu.c:69: undefined reference to `invalidate_dcache_all'
OK, so you need https://patchwork.ozlabs.org/project/uboot/patch/20230811054228.3721455-1-bh... to be applied, as-is, yes? Thanks!
Best regards, Jim
On Tue, Sep 26, 2023 at 9:48 PM Tom Rini trini@konsulko.com wrote:
On Tue, Sep 26, 2023 at 04:56:50PM +0800, Jim Liu wrote:
do not enable dcache by setting CONFIG_SYS_NPCM_DCACHE_OFF=y
Signed-off-by: Jim Liu JJLIU0@nuvoton.com
arch/arm/mach-npcm/npcm8xx/Kconfig | 4 ++++ arch/arm/mach-npcm/npcm8xx/cpu.c | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-npcm/npcm8xx/Kconfig b/arch/arm/mach-npcm/npcm8xx/Kconfig index 5f4a0506dc..163e7e7d48 100644 --- a/arch/arm/mach-npcm/npcm8xx/Kconfig +++ b/arch/arm/mach-npcm/npcm8xx/Kconfig @@ -6,6 +6,10 @@ config SYS_CPU config SYS_SOC default "npcm8xx"
+config SYS_NPCM_DCACHE_OFF
bool "Do not enable dcache"
default n
config TARGET_ARBEL_EVB bool "Arbel Evaluation Board" help
Why do we need a new Kconfig option here on top of the existing generic ones to control cache?
-- Tom
-- Tom

Hi Tom
I followed your suggestion to modify the code. but still have errors. Should I use my workaround?
Best regards, Jim
On Thu, Sep 28, 2023 at 9:17 AM Tom Rini trini@konsulko.com wrote:
On Thu, Sep 28, 2023 at 10:32:51PM +0800, Jim Liu wrote:
Hi Tom
Thanks for your understanding. but this patch is an incomplete patch. After I applied this patch I had another error.
arch/arm/cpu/armv8/cache_v8.c:773:2: error: #error Please describe your MMU layout in CONFIG_SYS_MEM_MAP and enable dcache. 773 | #error Please describe your MMU layout in CONFIG_SYS_MEM_MAP and enable dcache.
This error is the same as that link.
Please use that patch as a starting point (and also possibly needing to grab https://patchwork.ozlabs.org/project/uboot/patch/20230822075112.717992-2-bhu... as that's how I'd like to proceed with addressing this generic armv8 issue, thanks!
Best regards, Jim
On Thu, Sep 28, 2023 at 8:23 PM Tom Rini trini@konsulko.com wrote:
On Thu, Sep 28, 2023 at 08:49:23AM +0800, Jim Liu wrote:
Hi Tom
Thanks for the quick review.
if we set the CONFIG_SYS_DCACHE_OFF the armv8 will build error. So we added a workaround for our bmc uboot.
the error message as below:
CONFIG_SYS_DCACHE_OFF can't be enabled on armv8, or the following build error would happen.
arch/arm/cpu/armv8/cpu.o: in function `cleanup_before_linux': arch/arm/cpu/armv8/cpu.c:60: undefined reference to `icache_disable' arch/arm/cpu/armv8/cpu.c:68: undefined reference to `dcache_disable' arch/arm/cpu/armv8/cpu.c:69: undefined reference to `invalidate_dcache_all'
OK, so you need https://patchwork.ozlabs.org/project/uboot/patch/20230811054228.3721455-1-bh... to be applied, as-is, yes? Thanks!
Best regards, Jim
On Tue, Sep 26, 2023 at 9:48 PM Tom Rini trini@konsulko.com wrote:
On Tue, Sep 26, 2023 at 04:56:50PM +0800, Jim Liu wrote:
do not enable dcache by setting CONFIG_SYS_NPCM_DCACHE_OFF=y
Signed-off-by: Jim Liu JJLIU0@nuvoton.com
arch/arm/mach-npcm/npcm8xx/Kconfig | 4 ++++ arch/arm/mach-npcm/npcm8xx/cpu.c | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-npcm/npcm8xx/Kconfig b/arch/arm/mach-npcm/npcm8xx/Kconfig index 5f4a0506dc..163e7e7d48 100644 --- a/arch/arm/mach-npcm/npcm8xx/Kconfig +++ b/arch/arm/mach-npcm/npcm8xx/Kconfig @@ -6,6 +6,10 @@ config SYS_CPU config SYS_SOC default "npcm8xx"
+config SYS_NPCM_DCACHE_OFF
bool "Do not enable dcache"
default n
config TARGET_ARBEL_EVB bool "Arbel Evaluation Board" help
Why do we need a new Kconfig option here on top of the existing generic ones to control cache?
-- Tom
-- Tom
-- Tom

On Mon, Oct 02, 2023 at 12:40:54AM -0700, Jim Liu wrote:
Hi Tom
I followed your suggestion to modify the code. but still have errors. Should I use my workaround?
No, please figure out the errors, or at least post what you've got, thanks.
Best regards, Jim
On Thu, Sep 28, 2023 at 9:17 AM Tom Rini trini@konsulko.com wrote:
On Thu, Sep 28, 2023 at 10:32:51PM +0800, Jim Liu wrote:
Hi Tom
Thanks for your understanding. but this patch is an incomplete patch. After I applied this patch I had another error.
arch/arm/cpu/armv8/cache_v8.c:773:2: error: #error Please describe your MMU layout in CONFIG_SYS_MEM_MAP and enable dcache. 773 | #error Please describe your MMU layout in CONFIG_SYS_MEM_MAP and enable dcache.
This error is the same as that link.
Please use that patch as a starting point (and also possibly needing to grab https://patchwork.ozlabs.org/project/uboot/patch/20230822075112.717992-2-bhu... as that's how I'd like to proceed with addressing this generic armv8 issue, thanks!
Best regards, Jim
On Thu, Sep 28, 2023 at 8:23 PM Tom Rini trini@konsulko.com wrote:
On Thu, Sep 28, 2023 at 08:49:23AM +0800, Jim Liu wrote:
Hi Tom
Thanks for the quick review.
if we set the CONFIG_SYS_DCACHE_OFF the armv8 will build error. So we added a workaround for our bmc uboot.
the error message as below:
CONFIG_SYS_DCACHE_OFF can't be enabled on armv8, or the following build error would happen.
arch/arm/cpu/armv8/cpu.o: in function `cleanup_before_linux': arch/arm/cpu/armv8/cpu.c:60: undefined reference to `icache_disable' arch/arm/cpu/armv8/cpu.c:68: undefined reference to `dcache_disable' arch/arm/cpu/armv8/cpu.c:69: undefined reference to `invalidate_dcache_all'
OK, so you need https://patchwork.ozlabs.org/project/uboot/patch/20230811054228.3721455-1-bh... to be applied, as-is, yes? Thanks!
Best regards, Jim
On Tue, Sep 26, 2023 at 9:48 PM Tom Rini trini@konsulko.com wrote:
On Tue, Sep 26, 2023 at 04:56:50PM +0800, Jim Liu wrote:
> do not enable dcache by setting CONFIG_SYS_NPCM_DCACHE_OFF=y > > Signed-off-by: Jim Liu JJLIU0@nuvoton.com > --- > arch/arm/mach-npcm/npcm8xx/Kconfig | 4 ++++ > arch/arm/mach-npcm/npcm8xx/cpu.c | 12 +++++++++++- > 2 files changed, 15 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mach-npcm/npcm8xx/Kconfig b/arch/arm/mach-npcm/npcm8xx/Kconfig > index 5f4a0506dc..163e7e7d48 100644 > --- a/arch/arm/mach-npcm/npcm8xx/Kconfig > +++ b/arch/arm/mach-npcm/npcm8xx/Kconfig > @@ -6,6 +6,10 @@ config SYS_CPU > config SYS_SOC > default "npcm8xx" > > +config SYS_NPCM_DCACHE_OFF > + bool "Do not enable dcache" > + default n > + > config TARGET_ARBEL_EVB > bool "Arbel Evaluation Board" > help
Why do we need a new Kconfig option here on top of the existing generic ones to control cache?
-- Tom
-- Tom
-- Tom

Hi Tom
Thanks for your reply. I will create another thread for this topic.
Best regards, Jim
On Mon, Oct 2, 2023 at 7:04 AM Tom Rini trini@konsulko.com wrote:
On Mon, Oct 02, 2023 at 12:40:54AM -0700, Jim Liu wrote:
Hi Tom
I followed your suggestion to modify the code. but still have errors. Should I use my workaround?
No, please figure out the errors, or at least post what you've got, thanks.
Best regards, Jim
On Thu, Sep 28, 2023 at 9:17 AM Tom Rini trini@konsulko.com wrote:
On Thu, Sep 28, 2023 at 10:32:51PM +0800, Jim Liu wrote:
Hi Tom
Thanks for your understanding. but this patch is an incomplete patch. After I applied this patch I had another error.
arch/arm/cpu/armv8/cache_v8.c:773:2: error: #error Please describe your MMU layout in CONFIG_SYS_MEM_MAP and enable dcache. 773 | #error Please describe your MMU layout in CONFIG_SYS_MEM_MAP and enable dcache.
This error is the same as that link.
Please use that patch as a starting point (and also possibly needing to grab https://patchwork.ozlabs.org/project/uboot/patch/20230822075112.717992-2-bhu... as that's how I'd like to proceed with addressing this generic armv8 issue, thanks!
Best regards, Jim
On Thu, Sep 28, 2023 at 8:23 PM Tom Rini trini@konsulko.com wrote:
On Thu, Sep 28, 2023 at 08:49:23AM +0800, Jim Liu wrote:
Hi Tom
Thanks for the quick review.
if we set the CONFIG_SYS_DCACHE_OFF the armv8 will build error. So we added a workaround for our bmc uboot.
the error message as below:
CONFIG_SYS_DCACHE_OFF can't be enabled on armv8, or the following build error would happen.
arch/arm/cpu/armv8/cpu.o: in function `cleanup_before_linux': arch/arm/cpu/armv8/cpu.c:60: undefined reference to `icache_disable' arch/arm/cpu/armv8/cpu.c:68: undefined reference to `dcache_disable' arch/arm/cpu/armv8/cpu.c:69: undefined reference to `invalidate_dcache_all'
OK, so you need https://patchwork.ozlabs.org/project/uboot/patch/20230811054228.3721455-1-bh... to be applied, as-is, yes? Thanks!
Best regards, Jim
On Tue, Sep 26, 2023 at 9:48 PM Tom Rini trini@konsulko.com wrote: > > On Tue, Sep 26, 2023 at 04:56:50PM +0800, Jim Liu wrote: > > > do not enable dcache by setting CONFIG_SYS_NPCM_DCACHE_OFF=y > > > > Signed-off-by: Jim Liu JJLIU0@nuvoton.com > > --- > > arch/arm/mach-npcm/npcm8xx/Kconfig | 4 ++++ > > arch/arm/mach-npcm/npcm8xx/cpu.c | 12 +++++++++++- > > 2 files changed, 15 insertions(+), 1 deletion(-) > > > > diff --git a/arch/arm/mach-npcm/npcm8xx/Kconfig b/arch/arm/mach-npcm/npcm8xx/Kconfig > > index 5f4a0506dc..163e7e7d48 100644 > > --- a/arch/arm/mach-npcm/npcm8xx/Kconfig > > +++ b/arch/arm/mach-npcm/npcm8xx/Kconfig > > @@ -6,6 +6,10 @@ config SYS_CPU > > config SYS_SOC > > default "npcm8xx" > > > > +config SYS_NPCM_DCACHE_OFF > > + bool "Do not enable dcache" > > + default n > > + > > config TARGET_ARBEL_EVB > > bool "Arbel Evaluation Board" > > help > > Why do we need a new Kconfig option here on top of the existing generic > ones to control cache? > > -- > Tom
-- Tom
-- Tom
-- Tom
participants (2)
-
Jim Liu
-
Tom Rini