From f7dcdaaea1c2850e5edefd09263edece6f336064 Mon Sep 17 00:00:00 2001 From: Paul Philippov Date: Sun, 7 Jan 2024 05:24:08 -0500 Subject: [PATCH 01/19] grammar incl. in commands --- boards.cfg | 14 +++++++------- include/configs/bootes.h | 2 +- include/configs/box.h | 2 +- include/configs/columba.h | 2 +- include/configs/hercules.h | 2 +- include/configs/mango.h | 2 +- include/configs/musca.h | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/boards.cfg b/boards.cfg index cd86cbdb..8e8bd086 100644 --- a/boards.cfg +++ b/boards.cfg @@ -557,25 +557,25 @@ fornax_uImage_rvms mips xburst fornax ingenic fornax_uImage_rvms_ssi1_nor mips xburst fornax ingenic m200 fornax:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC0,SSI1_TO_SPI_NOR fornax_v20_uImage_rvms mips xburst fornax ingenic m200 fornax:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC0,FORNAX_V20 fornax_v30_uImage_rvms mips xburst fornax ingenic m200 fornax:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC0,FORNAX_V30 -hercules_uImage_rvms_msc1 mips xburst hercules ingenic t15 hercules:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC1,SFC_COMMOND +hercules_uImage_rvms_msc1 mips xburst hercules ingenic t15 hercules:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC1,SFC_COMMAND hercules_uImage_rvms_msc1_ddr2 mips xburst hercules ingenic t15 hercules:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC1,DDR_TYPE_DDR2 hercules_uImage_rvms_spinor mips xburst hercules ingenic t15 hercules:SPL_SPI_SUPPORT,SPI_NOR hercules_uImage_rvms_sfcnor mips xburst hercules ingenic t15 hercules:SPL_SFC_SUPPORT,SFC_NOR hercules_uImage_rvms_sfcnand mips xburst hercules ingenic t15 hercules:SPL_SFC_SUPPORT,SFC_NAND box_uImage_rvms_sfcnor mips xburst box ingenic t15 box:SPL_SFC_SUPPORT,SFC_NOR -box_uImage_rvms_msc1 mips xburst box ingenic t15 box:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC1,SFC_COMMOND -musca_uImage_rvms_msc0 mips xburst musca ingenic t10 musca:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC0,SFC_COMMOND +box_uImage_rvms_msc1 mips xburst box ingenic t15 box:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC1,SFC_COMMAND +musca_uImage_rvms_msc0 mips xburst musca ingenic t10 musca:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC0,SFC_COMMAND musca_uImage_rvms_sfcnor mips xburst musca ingenic t10 musca:SPL_SFC_SUPPORT,ENV_IS_IN_SPI_FLASH,SFC_NOR,SFC_NOR_8M musca_uImage_rvms_sfcnor_slt mips xburst musca ingenic t10 musca:SPL_SFC_SUPPORT,ENV_IS_IN_SPI_FLASH,SFC_NOR,SFC_NOR_16M -mango_uImage_rvms_msc0 mips xburst mango ingenic t10 mango:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC0,SFC_COMMOND +mango_uImage_rvms_msc0 mips xburst mango ingenic t10 mango:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC0,SFC_COMMAND mango_uImage_rvms_sfcnor mips xburst mango ingenic t10 mango:SPL_SFC_SUPPORT,SFC_NOR,SFC_NOR_16M isvp_t10_sfcnor mips xburst isvp_t10 ingenic t10 isvp_t10:SPL_SFC_SUPPORT,ENV_IS_IN_SPI_FLASH,SFC_NOR,JZ_MMC_MSC0 isvp_t10_sfcnor_lite mips xburst isvp_t10 ingenic t10 isvp_t10:SPL_SFC_SUPPORT,ENV_IS_IN_SPI_FLASH,SFC_NOR,JZ_MMC_MSC0,LITE_VERSION -isvp_t10_msc0 mips xburst isvp_t10 ingenic t10 isvp_t10:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC0,SFC_COMMOND,LITE_VERSION +isvp_t10_msc0 mips xburst isvp_t10 ingenic t10 isvp_t10:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC0,SFC_COMMAND,LITE_VERSION isvp_t20_sfcnor mips xburst isvp_t20 ingenic t20 isvp_t20:SPL_SFC_SUPPORT,ENV_IS_IN_SPI_FLASH,SFC_NOR,JZ_MMC_MSC0 isvp_t20_sfcnor_lite mips xburst isvp_t20 ingenic t20 isvp_t20:SPL_SFC_SUPPORT,ENV_IS_IN_SPI_FLASH,SFC_NOR,JZ_MMC_MSC0,LITE_VERSION isvp_t20_sfcnor_ddr128M mips xburst isvp_t20 ingenic t20 isvp_t20:SPL_SFC_SUPPORT,ENV_IS_IN_SPI_FLASH,SFC_NOR,JZ_MMC_MSC0,DDR2_128M -isvp_t20_msc0 mips xburst isvp_t20 ingenic t20 isvp_t20:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC0,SFC_COMMOND,LITE_VERSION +isvp_t20_msc0 mips xburst isvp_t20 ingenic t20 isvp_t20:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC0,SFC_COMMAND,LITE_VERSION isvp_t21_sfcnor mips xburst isvp_t21 ingenic t21 isvp_t21:SPL_SFC_SUPPORT,ENV_IS_IN_SPI_FLASH,SPL_SFC_NOR,JZ_MMC_MSC0 isvp_t30_sfcnor mips xburst isvp_t30 ingenic t30 isvp_t30:SPL_SFC_SUPPORT,ENV_IS_IN_SPI_FLASH,SPL_SFC_NOR,JZ_MMC_MSC0 isvp_t30_sfcnor_lite mips xburst isvp_t30 ingenic t30 isvp_t30:SPL_SFC_SUPPORT,ENV_IS_IN_SPI_FLASH,SPL_SFC_NOR,JZ_MMC_MSC0,LITE_VERSION @@ -599,7 +599,7 @@ isvp_t31al_sfcnor_ddr128M mips xburst isvp_t31 ingenic isvp_t31al_msc0_ddr128M mips xburst isvp_t31 ingenic t31 isvp_t31:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC0,SFC_COMMAND,DDR2_128M isvp_t31lc_sfcnor mips xburst isvp_t31 ingenic t31 isvp_t31:SPL_SFC_SUPPORT,ENV_IS_IN_SPI_FLASH,SPL_SFC_NOR,JZ_MMC_MSC0,T31LC columba_uImage_rvms_sfcnor mips xburst columba ingenic t10 columba:SPL_SFC_SUPPORT,SFC_NOR -bootes_uImage_rvms_msc1 mips xburst bootes ingenic t15 bootes:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC1,SFC_COMMOND +bootes_uImage_rvms_msc1 mips xburst bootes ingenic t15 bootes:SPL_MMC_SUPPORT,ENV_IS_IN_MMC,GPT_CREATOR,JZ_MMC_MSC1,SFC_COMMAND bootes_uImage_rvms_sfcnor_16M mips xburst bootes ingenic t15 bootes:SPL_SFC_SUPPORT,ENV_IS_IN_SPI_FLASH,SFC_NOR,SFC_NOR_16M bootes_uImage_rvms_sfcnor_8M mips xburst bootes ingenic t15 bootes:SPL_SFC_SUPPORT,ENV_IS_IN_SPI_FLASH,SFC_NOR,SFC_NOR_8M bootes_uImage_rvms_sfcnor_4M mips xburst bootes ingenic t15 bootes:SPL_SFC_SUPPORT,ENV_IS_IN_SPI_FLASH,SFC_NOR,SFC_NOR_4M diff --git a/include/configs/bootes.h b/include/configs/bootes.h index 9fe4c490..32b762bd 100644 --- a/include/configs/bootes.h +++ b/include/configs/bootes.h @@ -156,7 +156,7 @@ #define CONFIG_UBOOT_OFFSET (26 * 1024) #endif /* CONFIG_SPI_NOR */ -#ifdef CONFIG_SFC_COMMOND +#ifdef CONFIG_SFC_COMMAND #define CONFIG_CMD_SF #define CONFIG_SPI_FLASH #define CONFIG_JZ_SFC_PA diff --git a/include/configs/box.h b/include/configs/box.h index b43d23c9..92416ab8 100644 --- a/include/configs/box.h +++ b/include/configs/box.h @@ -114,7 +114,7 @@ #define CONFIG_JZ_MMC_MSC1_PE 1 #endif -#ifdef CONFIG_SFC_COMMOND +#ifdef CONFIG_SFC_COMMAND #define CONFIG_CMD_SF #define CONFIG_SPI_FLASH #define CONFIG_JZ_SFC_PA diff --git a/include/configs/columba.h b/include/configs/columba.h index e724f2be..3934693f 100644 --- a/include/configs/columba.h +++ b/include/configs/columba.h @@ -128,7 +128,7 @@ #define CONFIG_UBOOT_OFFSET (26 * 1024) #endif /* CONFIG_SPI_NOR */ -#ifdef CONFIG_SFC_COMMOND +#ifdef CONFIG_SFC_COMMAND #define CONFIG_CMD_SF #define CONFIG_SPI_FLASH #define CONFIG_JZ_SFC_PA diff --git a/include/configs/hercules.h b/include/configs/hercules.h index be133404..e4907a15 100644 --- a/include/configs/hercules.h +++ b/include/configs/hercules.h @@ -141,7 +141,7 @@ #define CONFIG_UBOOT_OFFSET (26 * 1024) #endif -#ifdef CONFIG_SFC_COMMOND +#ifdef CONFIG_SFC_COMMAND #define CONFIG_CMD_SF #define CONFIG_SPI_FLASH #define CONFIG_JZ_SFC_PA diff --git a/include/configs/mango.h b/include/configs/mango.h index c8257a42..159222c8 100644 --- a/include/configs/mango.h +++ b/include/configs/mango.h @@ -142,7 +142,7 @@ #define CONFIG_UBOOT_OFFSET (26 * 1024) #endif /* CONFIG_SPI_NOR */ -#ifdef CONFIG_SFC_COMMOND +#ifdef CONFIG_SFC_COMMAND #define CONFIG_CMD_SF #define CONFIG_SPI_FLASH #define CONFIG_JZ_SFC_PA diff --git a/include/configs/musca.h b/include/configs/musca.h index 84937016..93b6fcd7 100644 --- a/include/configs/musca.h +++ b/include/configs/musca.h @@ -147,7 +147,7 @@ #define CONFIG_UBOOT_OFFSET (26 * 1024) #endif /* CONFIG_SPI_NOR */ -#ifdef CONFIG_SFC_COMMOND +#ifdef CONFIG_SFC_COMMAND #define CONFIG_CMD_SF #define CONFIG_SPI_FLASH #define CONFIG_JZ_SFC_PA From d7e5bd9493cf815e9eab8ad1b10f1c67ac8a05db Mon Sep 17 00:00:00 2001 From: Paul Philippov Date: Sun, 7 Jan 2024 05:24:43 -0500 Subject: [PATCH 02/19] refactor to fix collision of enums --- common/cmd_gpio.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/common/cmd_gpio.c b/common/cmd_gpio.c index 53b76da2..40108d13 100644 --- a/common/cmd_gpio.c +++ b/common/cmd_gpio.c @@ -16,10 +16,10 @@ #endif enum gpio_cmd { - GPIO_INPUT_, - GPIO_SET, - GPIO_CLEAR, - GPIO_TOGGLE, + GPIO_CMD_INPUT, + GPIO_CMD_SET, + GPIO_CMD_CLEAR, + GPIO_CMD_TOGGLE, }; static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) @@ -39,15 +39,16 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (argc != 3) show_usage: return CMD_RET_USAGE; + str_cmd = argv[1]; str_gpio = argv[2]; /* parse the behavior */ switch (*str_cmd) { - case 'i': sub_cmd = GPIO_INPUT; break; - case 's': sub_cmd = GPIO_SET; break; - case 'c': sub_cmd = GPIO_CLEAR; break; - case 't': sub_cmd = GPIO_TOGGLE; break; + case 'i': sub_cmd = GPIO_CMD_INPUT; break; + case 's': sub_cmd = GPIO_CMD_SET; break; + case 'c': sub_cmd = GPIO_CMD_CLEAR; break; + case 't': sub_cmd = GPIO_CMD_TOGGLE; break; default: goto show_usage; } @@ -63,15 +64,15 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } /* finally, let's do it: set direction and exec command */ - if (sub_cmd == GPIO_INPUT) { + if (sub_cmd == GPIO_CMD_INPUT) { gpio_direction_input(gpio); value = gpio_get_value(gpio); } else { switch (sub_cmd) { - case GPIO_SET: value = 1; break; - case GPIO_CLEAR: value = 0; break; - case GPIO_TOGGLE: value = !gpio_get_value(gpio); break; - default: goto show_usage; + case GPIO_CMD_SET: value = 1; break; + case GPIO_CMD_CLEAR: value = 0; break; + case GPIO_CMD_TOGGLE: value = !gpio_get_value(gpio); break; + default: goto show_usage; } gpio_direction_output(gpio, value); } From 35dd8d5d55cdfc78c44f121af4fd1db18bbb3e09 Mon Sep 17 00:00:00 2001 From: Paul Philippov Date: Sun, 7 Jan 2024 05:31:04 -0500 Subject: [PATCH 03/19] grammar --- include/configs/isvp_t10.h | 5 +++-- include/configs/isvp_t20.h | 7 ++++--- include/configs/isvp_t21.h | 9 +++++++-- include/configs/isvp_t30.h | 14 ++++++++------ include/configs/isvp_t31.h | 29 ++++++++++++++++++++++++++++- 5 files changed, 50 insertions(+), 14 deletions(-) diff --git a/include/configs/isvp_t10.h b/include/configs/isvp_t10.h index 3a9fd9f0..07bee484 100644 --- a/include/configs/isvp_t10.h +++ b/include/configs/isvp_t10.h @@ -37,15 +37,16 @@ #ifdef CONFIG_LITE_VERSION #define CONFIG_SYS_APLL_FREQ 712704000 /*If APLL not use mast be set 0*/ +#define CONFIG_SYS_APLL_FREQ 712704000 /*If APLLis not used it must be set to 0*/ #define CONFIG_SYS_APLL_MNOD ((59 << 20) | (2 << 14) | (1 << 11) | (1 << 8)) #define CONFIG_SYS_APLL_FRAC 0x645a1c #else -#define CONFIG_SYS_APLL_FREQ 860160000 /*If APLL not use mast be set 0*/ +#define CONFIG_SYS_APLL_FREQ 860160000 /*If APLLis not used it must be set to 0*/ #define CONFIG_SYS_APLL_MNOD ((71 << 20) | (2 << 14) | (1 << 11) | (1 << 8)) #define CONFIG_SYS_APLL_FRAC 0xae147a #endif -#define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL not use mast be set 0*/ +#define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLLis not used it must be set to 0*/ #define SEL_SCLKA 2 #define SEL_CPU 1 diff --git a/include/configs/isvp_t20.h b/include/configs/isvp_t20.h index 20d194c8..bcbcd7b4 100644 --- a/include/configs/isvp_t20.h +++ b/include/configs/isvp_t20.h @@ -37,16 +37,17 @@ #ifdef CONFIG_LITE_VERSION #define CONFIG_SYS_APLL_FREQ 712704000 /*If APLL not use mast be set 0*/ +#define CONFIG_SYS_APLL_FREQ 712704000 /*If APLL is not used it must be set to 0*/ #define CONFIG_SYS_APLL_MNOD ((59 << 20) | (2 << 14) | (1 << 11) | (1 << 8)) #define CONFIG_SYS_APLL_FRAC 0x645a1c #else -#define CONFIG_SYS_APLL_FREQ 860160000 /*If APLL not use mast be set 0*/ +#define CONFIG_SYS_APLL_FREQ 860160000 /*If APLL is not used it must be set to 0*/ #define CONFIG_SYS_APLL_MNOD ((71 << 20) | (2 << 14) | (1 << 11) | (1 << 8)) #define CONFIG_SYS_APLL_FRAC 0xae147a #endif -#define CONFIG_SYS_MPLL_FREQ 1000000000 /*If MPLL not use mast be set 0*/ +#define CONFIG_SYS_MPLL_FREQ 1000000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((125 << 20) | (3 << 14) | (1 << 11) | (1 << 8)) -#define CONFIG_SYS_VPLL_FREQ 1200000000 /*If VPLL not use mast be set 0*/ +#define CONFIG_SYS_VPLL_FREQ 1200000000 /*If VPLL is not used it must be set to 0*/ #define SEL_SCLKA 2 #define SEL_CPU 1 diff --git a/include/configs/isvp_t21.h b/include/configs/isvp_t21.h index 1d4dec6a..b13f627c 100644 --- a/include/configs/isvp_t21.h +++ b/include/configs/isvp_t21.h @@ -37,31 +37,36 @@ #ifdef CONFIG_HIGH_PERF #define CONFIG_SYS_APLL_FREQ 1200000000 /*If MPLL not use mast be set 0*/ +#define CONFIG_SYS_APLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_APLL_MNOD ((49 << 20) | (0 << 14) | (1 << 11) | (3<<5)) #define DDR_500M #else -#define CONFIG_SYS_APLL_FREQ 864000000 /*If APLL not use mast be set 0*/ +#define CONFIG_SYS_APLL_FREQ 864000000 /*If APLL is not used it must be set to 0*/ #define CONFIG_SYS_APLL_MNOD ((71 << 20) | (1 << 14) | (1 << 11) | (2<<5)) #define DDR_450M #endif #ifdef DDR_400M #define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL not use mast be set 0*/ +#define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((149 << 20) | (2 << 14) | (1 << 11) | (1<<5)) #elif defined DDR_450M #define CONFIG_SYS_MPLL_FREQ 900000000 /*If MPLL not use mast be set 0*/ +#define CONFIG_SYS_MPLL_FREQ 900000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((74 << 20) | (1 << 14) | (1 << 11) | (2<<5)) #elif defined DDR_500M #define CONFIG_SYS_MPLL_FREQ 1000000000 /*If MPLL not use mast be set 0*/ +#define CONFIG_SYS_MPLL_FREQ 1000000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((124 << 20) | (2 << 14) | (1 << 11) | (1<<5)) #elif defined DDR_600M #define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL not use mast be set 0*/ +#define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((149 << 20) | (2 << 14) | (1 << 11) | (1<<5)) #else #error please define DDR_FREQ #endif -#define CONFIG_SYS_VPLL_FREQ 1200000000 /*If VPLL not use mast be set 0*/ +#define CONFIG_SYS_VPLL_FREQ 1200000000 /*If VPLL is not used it must be set to 0*/ #define SEL_SCLKA 2 #define SEL_CPU 1 diff --git a/include/configs/isvp_t30.h b/include/configs/isvp_t30.h index e7d4163f..5f76ebae 100644 --- a/include/configs/isvp_t30.h +++ b/include/configs/isvp_t30.h @@ -37,13 +37,13 @@ #if defined(CONFIG_LITE_VERSION) -#define CONFIG_SYS_APLL_FREQ 750000000 /*If APLL not use mast be set 0*/ +#define CONFIG_SYS_APLL_FREQ 750000000 /*If APLL is not used it must be set to 0*/ #define CONFIG_SYS_APLL_MNOD ((124 << 20) | (1 << 14) | (2 << 11) | (2<<5)) #elif defined(CONFIG_T30A) -#define CONFIG_SYS_APLL_FREQ 1200000000 /*If APLL not use mast be set 0*/ +#define CONFIG_SYS_APLL_FREQ 1200000000 /*If APLL is not used it must be set to 0*/ #define CONFIG_SYS_APLL_MNOD ((149 << 20) | (2 << 14) | (1 << 11) | (1<<5)) #else -#define CONFIG_SYS_APLL_FREQ 900000000 /*If APLL not use mast be set 0*/ +#define CONFIG_SYS_APLL_FREQ 900000000 /*If APLL is not used it must be set to 0*/ #define CONFIG_SYS_APLL_MNOD ((74 << 20) | (1 << 14) | (1 << 11) | (2<<5)) #endif @@ -55,23 +55,25 @@ #ifdef DDR_400M #define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL not use mast be set 0*/ +#define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((149 << 20) | (2 << 14) | (1 << 11) | (1<<5)) #elif defined DDR_500M #if 1 -#define CONFIG_SYS_MPLL_FREQ 1000000000 /*If MPLL not use mast be set 0*/ +#define CONFIG_SYS_MPLL_FREQ 1000000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((124 << 20) | (2 << 14) | (1 << 11) | (1<<5)) #else -#define CONFIG_SYS_MPLL_FREQ 1500000000 /*If MPLL not use mast be set 0*/ +#define CONFIG_SYS_MPLL_FREQ 1500000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((249 << 20) | (3 << 14) | (1 << 11) | (1<<5)) #endif #elif defined DDR_600M #define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL not use mast be set 0*/ +#define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((149 << 20) | (2 << 14) | (1 << 11) | (1<<5)) #else #error please define DDR_FREQ #endif -#define CONFIG_SYS_VPLL_FREQ 1200000000 /*If VPLL not use mast be set 0*/ +#define CONFIG_SYS_VPLL_FREQ 1200000000 /*If VPLL is not used it must be set to 0*/ #define CONFIG_SYS_EPLL_MNOD ((197 << 20) | (3 << 14) | (1 << 11) | (1<<5)) #define CONFIG_SYS_EPLL_FREQ 1188000000 #define SEL_SCLKA 2 diff --git a/include/configs/isvp_t31.h b/include/configs/isvp_t31.h index 6727c5dd..2f537820 100644 --- a/include/configs/isvp_t31.h +++ b/include/configs/isvp_t31.h @@ -86,6 +86,17 @@ #elif defined APLL_1800M #define CONFIG_SYS_APLL_FREQ 1800000000 /*If MPLL not use mast be set 0*/ #define CONFIG_SYS_APLL_MNOD ((150 << 20) | (1 << 14) | (2 << 11) | (1<<8)) +#define CONFIG_SYS_APLL_FREQ 804000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_FREQ 864000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_FREQ 900000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_FREQ 1000000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_FREQ 1008000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_FREQ 1104000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_FREQ 1200000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_FREQ 1392000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_FREQ 1404000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_FREQ 1500000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_FREQ 1800000000 /*If MPLL is not used it must be set to 0*/ #else #error please define APLL_FREQ #endif @@ -138,11 +149,27 @@ #elif defined DDR_900M #define CONFIG_SYS_MPLL_FREQ 1800000000 /*If MPLL not use mast be set 0*/ #define CONFIG_SYS_MPLL_MNOD ((150 << 20) | (1 << 14) | (2 << 11) | (1<<8)) +#define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_FREQ 900000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_FREQ 1000000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_FREQ 1080000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_FREQ 1308000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_FREQ 1404000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_FREQ 1500000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_FREQ 1524000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_FREQ 1548000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_FREQ 1572000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_FREQ 1596000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_FREQ 1608000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_FREQ 1620000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_FREQ 1632000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_FREQ 1800000000 /*If MPLL is not used it must be set to 0*/ #else #error please define DDR_FREQ #endif -#define CONFIG_SYS_VPLL_FREQ 1200000000 /*If VPLL not use mast be set 0*/ +#define CONFIG_SYS_VPLL_FREQ 1200000000 /*If VPLL is not used it must be set to 0*/ #define SEL_SCLKA 2 #define SEL_CPU 1 #define SEL_H0 2 From c3da6babe3563c0c056e96df48d7b20d25182263 Mon Sep 17 00:00:00 2001 From: Paul Philippov Date: Sun, 7 Jan 2024 05:41:59 -0500 Subject: [PATCH 04/19] expand #ifdef for better readability, fix missed defined() --- include/configs/isvp_t10.h | 49 ++++---- include/configs/isvp_t20.h | 45 ++++---- include/configs/isvp_t21.h | 84 +++++++------- include/configs/isvp_t30.h | 66 ++++++----- include/configs/isvp_t31.h | 228 ++++++++++++++----------------------- 5 files changed, 204 insertions(+), 268 deletions(-) diff --git a/include/configs/isvp_t10.h b/include/configs/isvp_t10.h index 07bee484..fd14b2af 100644 --- a/include/configs/isvp_t10.h +++ b/include/configs/isvp_t10.h @@ -35,8 +35,7 @@ /*#define CONFIG_DDR_AUTO_SELF_REFRESH*/ #define CONFIG_SPL_DDR_SOFT_TRAINING -#ifdef CONFIG_LITE_VERSION -#define CONFIG_SYS_APLL_FREQ 712704000 /*If APLL not use mast be set 0*/ +#if defined(CONFIG_LITE_VERSION) #define CONFIG_SYS_APLL_FREQ 712704000 /*If APLLis not used it must be set to 0*/ #define CONFIG_SYS_APLL_MNOD ((59 << 20) | (2 << 14) | (1 << 11) | (1 << 8)) #define CONFIG_SYS_APLL_FRAC 0x645a1c @@ -112,22 +111,22 @@ */ #define BOOTARGS_COMMON "console=ttyS1,115200n8 mem=39M@0x0 ispmem=5M@0x2700000 rmem=20M@0x2c00000" -#ifdef CONFIG_SPL_MMC_SUPPORT - #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" -#elif CONFIG_SFC_NOR - #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" +#if defined(CONFIG_SPL_MMC_SUPPORT) +#define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" +#elif defined(CONFIG_SFC_NOR) +#define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" #endif /** * Boot command definitions. */ -#ifdef CONFIG_SPL_MMC_SUPPORT +#if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_BOOTCOMMAND "mmc read 0x80600000 0x1800 0x3000; bootm 0x80600000" #endif -#ifdef CONFIG_SFC_NOR - #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" -#endif /* CONFIG_SFC_NOR */ +#if defined(CONFIG_SFC_NOR) +#define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" +#endif /** * Drivers configuration. @@ -139,12 +138,12 @@ #define CONFIG_JZ_MMC 1 #endif /* JZ_MMC_MSC0 || JZ_MMC_MSC1 */ -#ifdef CONFIG_JZ_MMC_MSC0 +#if defined(CONFIG_JZ_MMC_MSC0) #define CONFIG_JZ_MMC_SPLMSC 0 #define CONFIG_JZ_MMC_MSC0_PB 1 #endif -#ifdef CONFIG_SFC_COMMOND +#if defined(CONFIG_SFC_COMMAND) #define CONFIG_CMD_SF #define CONFIG_SPI_FLASH #define CONFIG_JZ_SFC_PA @@ -160,7 +159,7 @@ #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SPI_SPL_CHECK #define CONFIG_JZ_SFC_PA -#ifdef CONFIG_SPI_NAND +#if defined(CONFIG_SPI_NAND) #define CONFIG_UBOOT_OFFSET (26 * 1024) #define CONFIG_SPI_NAND_BPP (2048 + 64) /*Bytes Per Page*/ #define CONFIG_SPI_NAND_PPB (64) /*Page Per Block*/ @@ -180,7 +179,7 @@ #endif #endif /* CONFIG_SPL_SFC_SUPPORT */ -#ifdef CONFIG_JZ_SFC +#if defined(CONFIG_JZ_SFC) #define CONFIG_SPIFLASH_PART_OFFSET 0x3c00 #define CONFIG_SPI_NORFLASH_PART_OFFSET 0x3c74 #define CONFIG_NOR_MAJOR_VERSION_NUMBER 1 @@ -243,7 +242,7 @@ /************************ USB CONFIG ***************************/ #define CONFIG_CMD_USB -#ifdef CONFIG_CMD_USB +#if defined(CONFIG_CMD_USB) #define CONFIG_USB_DWC2 #define CONFIG_USB_DWC2_REG_ADDR 0x13500000 #define CONFIG_USB_HOST_ETHER @@ -297,11 +296,11 @@ /** * Environment */ -#ifdef CONFIG_ENV_IS_IN_MMC +#if defined(CONFIG_ENV_IS_IN_MMC) #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_ENV_SIZE (32 << 10) #define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) -#elif CONFIG_ENV_IS_IN_SPI_FLASH +#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH) #define CONFIG_ENV_SECT_SIZE (1024 * 16) #define CONFIG_ENV_SIZE (1024 * 16) #define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN + CONFIG_UBOOT_OFFSET) @@ -320,7 +319,7 @@ #define CONFIG_SPL_NO_CPU_SUPPORT_CODE #define CONFIG_SPL_START_S_PATH "$(CPUDIR)/$(SOC)" -#ifdef CONFIG_SPL_NOR_SUPPORT +#if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/$(SOC)/u-boot-nor-spl.lds" #else /* CONFIG_SPL_NOR_SUPPORT */ #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/$(SOC)/u-boot-spl.lds" @@ -335,7 +334,7 @@ #define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_GPIO_SUPPORT -#ifdef CONFIG_SPL_NOR_SUPPORT +#if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_TEXT_BASE 0xba000000 #else #define CONFIG_SPL_TEXT_BASE 0x80001000 @@ -344,21 +343,21 @@ #define CONFIG_SPL_MAX_SIZE (26 * 1024) #define CONFIG_SPL_LZOP -#ifdef CONFIG_SPL_LZOP +#if defined(CONFIG_SPL_LZOP) #define CONFIG_DECMP_BUFFER_ADRS 0x80200000 #endif -#ifdef CONFIG_SPL_MMC_SUPPORT +#if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT #endif /* CONFIG_SPL_MMC_SUPPORT */ -#ifdef CONFIG_SPL_SPI_SUPPORT +#if defined(CONFIG_SPL_SPI_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SPI_SPL_CHECK #define CONFIG_SYS_SPI_BOOT_FREQ 1000000 #endif /* CONFIG_SPL_SPI_SUPPORT */ -#ifdef CONFIG_SPL_NOR_SUPPORT +#if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SYS_UBOOT_BASE (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_PAD_TO - 0x40) //0x40 = sizeof (image_header) #define CONFIG_SYS_OS_BASE 0 @@ -369,7 +368,7 @@ /** * GPT configuration */ -#ifdef CONFIG_GPT_CREATOR +#if defined(CONFIG_GPT_CREATOR) #define CONFIG_GPT_TABLE_PATH "$(TOPDIR)/board/$(BOARDDIR)" #else /* USE MBR + zero-GPT-table instead if no gpt table defined*/ @@ -391,7 +390,7 @@ #endif /* JFFS2 configuration */ -#ifdef CONFIG_CMD_JFFS2 +#if defined(CONFIG_CMD_JFFS2) #define CONFIG_CMD_FLASH #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_SYS_MAX_FLASH_SECT 256 diff --git a/include/configs/isvp_t20.h b/include/configs/isvp_t20.h index bcbcd7b4..b96a4dfe 100644 --- a/include/configs/isvp_t20.h +++ b/include/configs/isvp_t20.h @@ -35,8 +35,7 @@ /*#define CONFIG_DDR_AUTO_SELF_REFRESH*/ #define CONFIG_SPL_DDR_SOFT_TRAINING -#ifdef CONFIG_LITE_VERSION -#define CONFIG_SYS_APLL_FREQ 712704000 /*If APLL not use mast be set 0*/ +#if defined(CONFIG_LITE_VERSION) #define CONFIG_SYS_APLL_FREQ 712704000 /*If APLL is not used it must be set to 0*/ #define CONFIG_SYS_APLL_MNOD ((59 << 20) | (2 << 14) | (1 << 11) | (1 << 8)) #define CONFIG_SYS_APLL_FRAC 0x645a1c @@ -95,7 +94,7 @@ #define CONFIG_DDR_DW32 0 /* 1-32bit-width, 0-16bit-width */ #define CONFIG_DDRC_CTRL_PDT DDRC_CTRL_PDT_128 -#ifdef CONFIG_DDR2_128M +#if defined(CONFIG_DDR2_128M) #define CONFIG_DDR2_M14D1G1664A #else #define CONFIG_DDR2_M14D5121632A @@ -116,14 +115,14 @@ /** * Boot arguments definitions. */ -#ifdef CONFIG_DDR2_128M +#if defined(CONFIG_DDR2_128M) #define BOOTARGS_COMMON "console=ttyS1,115200n8 mem=96M@0x0 ispmem=8M@0x6000000 rmem=24M@0x6800000" #else #define BOOTARGS_COMMON "console=ttyS1,115200n8 mem=32M@0x0 ispmem=8M@0x2000000 rmem=24M@0x2800000" #endif -#ifdef CONFIG_SPL_MMC_SUPPORT - #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" +#if defined(CONFIG_SPL_MMC_SUPPORT) +#define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" #elif defined(CONFIG_SFC_NOR) #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" #endif @@ -131,11 +130,11 @@ /** * Boot command definitions. */ -#ifdef CONFIG_SPL_MMC_SUPPORT +#if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_BOOTCOMMAND "mmc read 0x80600000 0x1800 0x3000; bootm 0x80600000" #endif -#ifdef CONFIG_SFC_NOR +#if defined(CONFIG_SFC_NOR) #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" #endif /* CONFIG_SFC_NOR */ @@ -149,12 +148,12 @@ #define CONFIG_JZ_MMC 1 #endif /* JZ_MMC_MSC0 || JZ_MMC_MSC1 */ -#ifdef CONFIG_JZ_MMC_MSC0 +#if defined(CONFIG_JZ_MMC_MSC0) #define CONFIG_JZ_MMC_SPLMSC 0 #define CONFIG_JZ_MMC_MSC0_PB 1 #endif -#ifdef CONFIG_SFC_COMMOND +#if defined(CONFIG_SFC_COMMAND) #define CONFIG_CMD_SF #define CONFIG_SPI_FLASH #define CONFIG_JZ_SFC_PA @@ -170,7 +169,7 @@ #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SPI_SPL_CHECK #define CONFIG_JZ_SFC_PA -#ifdef CONFIG_SPI_NAND +#if defined(CONFIG_SPI_NAND) #define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE /*(26 * 1024)*/ #define CONFIG_SPI_NAND_BPP (2048 + 64) /*Bytes Per Page*/ #define CONFIG_SPI_NAND_PPB (64) /*Page Per Block*/ @@ -190,7 +189,7 @@ #endif #endif /* CONFIG_SPL_SFC_SUPPORT */ -#ifdef CONFIG_JZ_SFC +#if defined(CONFIG_JZ_SFC) #define CONFIG_SPIFLASH_PART_OFFSET 0x3c00 #define CONFIG_SPI_NORFLASH_PART_OFFSET 0x3c74 #define CONFIG_NOR_MAJOR_VERSION_NUMBER 1 @@ -251,7 +250,7 @@ /*#define CONFIG_CMD_I2C*/ /************************ USB CONFIG ***************************/ -#define CONFIG_CMD_USB +#if defined(CONFIG_CMD_USB) #ifdef CONFIG_CMD_USB #define CONFIG_USB_DWC2 #define CONFIG_USB_DWC2_REG_ADDR 0x13500000 @@ -306,11 +305,11 @@ /** * Environment */ -#ifdef CONFIG_ENV_IS_IN_MMC +#if defined(CONFIG_ENV_IS_IN_MMC) #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_ENV_SIZE (32 << 10) #define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) -#elif CONFIG_ENV_IS_IN_SPI_FLASH +#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH) #define CONFIG_ENV_SECT_SIZE (1024 * 16) #define CONFIG_ENV_SIZE (1024 * 16) #define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN + CONFIG_UBOOT_OFFSET) @@ -329,7 +328,7 @@ #define CONFIG_SPL_NO_CPU_SUPPORT_CODE #define CONFIG_SPL_START_S_PATH "$(CPUDIR)/$(SOC)" -#ifdef CONFIG_SPL_NOR_SUPPORT +#if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/$(SOC)/u-boot-nor-spl.lds" #else /* CONFIG_SPL_NOR_SUPPORT */ #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/$(SOC)/u-boot-spl.lds" @@ -344,7 +343,7 @@ #define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_GPIO_SUPPORT -#ifdef CONFIG_SPL_NOR_SUPPORT +#if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_TEXT_BASE 0xba000000 #else #define CONFIG_SPL_TEXT_BASE 0x80001000 @@ -353,21 +352,21 @@ #define CONFIG_SPL_MAX_SIZE (26 * 1024) #define CONFIG_SPL_LZOP -#ifdef CONFIG_SPL_LZOP +#if defined(CONFIG_SPL_LZOP) #define CONFIG_DECMP_BUFFER_ADRS 0x80200000 #endif -#ifdef CONFIG_SPL_MMC_SUPPORT +#if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT #endif /* CONFIG_SPL_MMC_SUPPORT */ -#ifdef CONFIG_SPL_SPI_SUPPORT +#if defined(CONFIG_SPL_SPI_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SPI_SPL_CHECK #define CONFIG_SYS_SPI_BOOT_FREQ 1000000 #endif /* CONFIG_SPL_SPI_SUPPORT */ -#ifdef CONFIG_SPL_NOR_SUPPORT +#if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SYS_UBOOT_BASE (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_PAD_TO - 0x40) //0x40 = sizeof (image_header) #define CONFIG_SYS_OS_BASE 0 @@ -378,7 +377,7 @@ /** * GPT configuration */ -#ifdef CONFIG_GPT_CREATOR +#if defined(CONFIG_GPT_CREATOR) #define CONFIG_GPT_TABLE_PATH "$(TOPDIR)/board/$(BOARDDIR)" #else /* USE MBR + zero-GPT-table instead if no gpt table defined*/ @@ -400,7 +399,7 @@ #endif /* JFFS2 configuration */ -#ifdef CONFIG_CMD_JFFS2 +#if defined(CONFIG_CMD_JFFS2) #define CONFIG_CMD_FLASH #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_SYS_MAX_FLASH_SECT 256 diff --git a/include/configs/isvp_t21.h b/include/configs/isvp_t21.h index b13f627c..af26865c 100644 --- a/include/configs/isvp_t21.h +++ b/include/configs/isvp_t21.h @@ -35,8 +35,7 @@ /*#define CONFIG_DDR_AUTO_SELF_REFRESH*/ #define CONFIG_SPL_DDR_SOFT_TRAINING -#ifdef CONFIG_HIGH_PERF -#define CONFIG_SYS_APLL_FREQ 1200000000 /*If MPLL not use mast be set 0*/ +#if defined(CONFIG_HIGH_PERF) #define CONFIG_SYS_APLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_APLL_MNOD ((49 << 20) | (0 << 14) | (1 << 11) | (3<<5)) #define DDR_500M @@ -46,20 +45,16 @@ #define DDR_450M #endif -#ifdef DDR_400M -#define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL not use mast be set 0*/ +#if defined(DDR_400M) #define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((149 << 20) | (2 << 14) | (1 << 11) | (1<<5)) -#elif defined DDR_450M -#define CONFIG_SYS_MPLL_FREQ 900000000 /*If MPLL not use mast be set 0*/ +#elif defined(DDR_450M) #define CONFIG_SYS_MPLL_FREQ 900000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((74 << 20) | (1 << 14) | (1 << 11) | (2<<5)) -#elif defined DDR_500M -#define CONFIG_SYS_MPLL_FREQ 1000000000 /*If MPLL not use mast be set 0*/ +#elif defined(DDR_500M) #define CONFIG_SYS_MPLL_FREQ 1000000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((124 << 20) | (2 << 14) | (1 << 11) | (1<<5)) -#elif defined DDR_600M -#define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL not use mast be set 0*/ +#elif defined(DDR_600M) #define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((149 << 20) | (2 << 14) | (1 << 11) | (1<<5)) #else @@ -73,19 +68,19 @@ #define SEL_H0 2 #define SEL_H2 2 -#ifdef DDR_400M +#if defined(DDR_400M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 -#elif defined DDR_450M +#elif defined(DDR_450M) #define DIV_PCLK 8 #define DIV_H2 4 #define DIV_H0 4 -#elif defined DDR_500M +#elif defined(DDR_500M) #define DIV_PCLK 8 #define DIV_H2 4 #define DIV_H0 4 -#elif defined DDR_600M +#elif defined(DDR_600M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 @@ -109,13 +104,13 @@ #define CONFIG_DDR_SEL_PLL MPLL #define CONFIG_SYS_CPU_FREQ CONFIG_SYS_APLL_FREQ -#ifdef DDR_400M +#if defined(DDR_400M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 3) -#elif defined DDR_450M +#elif defined(DDR_450M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_500M +#elif defined(DDR_500M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_600M +#elif defined(DDR_600M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) #else #error please define DDR_FREQ @@ -143,7 +138,7 @@ #define CONFIG_DDR_DW32 0 /* 1-32bit-width, 0-16bit-width */ #define CONFIG_DDRC_CTRL_PDT DDRC_CTRL_PDT_128 -#ifdef CONFIG_DDR2_128M +#if defined(CONFIG_DDR2_128M) #define CONFIG_DDR2_M14D1G1664A #define CONFIG_DDR_TYPE_DDR2 #else @@ -169,7 +164,7 @@ /** * Boot arguments definitions. */ -#if (defined(CONFIG_DDR2_128M)) +#if defined(CONFIG_DDR2_128M) #define BOOTARGS_COMMON "console=ttyS1,115200n8 mem=106M@0x0 rmem=22M@0x6a00000" #else #define BOOTARGS_COMMON "console=ttyS1,115200n8 mem=43M@0x0 rmem=21M@0x2B00000" @@ -179,7 +174,7 @@ #define CONFIG_SPL_SFC_SUPPORT #define CONFIG_JZ_SFC #define CONFIG_SPL_VERSION 1 -#ifdef CONFIG_SPL_SFC_NOR +#if defined(CONFIG_SPL_SFC_NOR) #define CONFIG_SFC_NOR #else #define CONFIG_SFC_NAND @@ -188,8 +183,8 @@ /*#define CONFIG_SPI_QUAD*/ #endif /* defined(CONFIG_SPL_SFC_NOR) || defined(CONFIG_SPL_SFC_NAND) */ -#ifdef CONFIG_SPL_MMC_SUPPORT - #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" +#if defined(CONFIG_SPL_MMC_SUPPORT) +#define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" #elif defined(CONFIG_SFC_NOR) #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" #endif @@ -197,11 +192,11 @@ /** * Boot command definitions. */ -#ifdef CONFIG_SPL_MMC_SUPPORT +#if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_BOOTCOMMAND "mmc read 0x80600000 0x1800 0x3000; bootm 0x80600000" #endif -#ifdef CONFIG_SFC_NOR +#if defined(CONFIG_SFC_NOR) #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" #endif /* CONFIG_SFC_NOR */ @@ -215,12 +210,12 @@ #define CONFIG_JZ_MMC 1 #endif /* JZ_MMC_MSC0 || JZ_MMC_MSC1 */ -#ifdef CONFIG_JZ_MMC_MSC0 +#if defined(CONFIG_JZ_MMC_MSC0) #define CONFIG_JZ_MMC_SPLMSC 0 #define CONFIG_JZ_MMC_MSC0_PB 1 #endif -#ifdef CONFIG_SFC_COMMAND/* SD card start */ +#if defined(CONFIG_SFC_COMMAND) /* SD card start */ #if 1 #define CONFIG_SFC_NOR_COMMAND /* support nor command */ #else @@ -228,7 +223,7 @@ #endif #endif /* CONFIG_SFC_COMMAND */ -#ifdef CONFIG_SFC_NOR_COMMAND +#if defined(CONFIG_SFC_NOR_COMMAND) #define CONFIG_CMD_SF #define CONFIG_SPI_FLASH #define CONFIG_JZ_SFC_PA @@ -244,7 +239,7 @@ #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SPI_SPL_CHECK #define CONFIG_JZ_SFC_PA -#ifdef CONFIG_SPI_NAND +#if defined(CONFIG_SPI_NAND) #define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE /*(26 * 1024)*/ #define CONFIG_SPI_NAND_BPP (2048 + 64) /*Bytes Per Page*/ #define CONFIG_SPI_NAND_PPB (64) /*Page Per Block*/ @@ -264,7 +259,7 @@ #endif #endif /* CONFIG_SPL_SFC_SUPPORT */ -#ifdef CONFIG_JZ_SFC +#if defined(CONFIG_JZ_SFC) #define CONFIG_SPIFLASH_PART_OFFSET 0x3c00 #define CONFIG_SPI_NORFLASH_PART_OFFSET 0x3c74 #define CONFIG_NOR_MAJOR_VERSION_NUMBER 1 @@ -274,7 +269,7 @@ #endif /* END SFC */ -#ifdef CONFIG_NORFLASH_32M +#if defined(CONFIG_NORFLASH_32M) #define CONFIG_SPI_FLASH_BAR #endif @@ -290,7 +285,8 @@ #define GMAC_PHY_RMII 2 #define GMAC_PHY_GMII 3 #define GMAC_PHY_RGMII 4 -#ifdef GMAC_PHY_INNER + +#if defined(GMAC_PHY_INNER) #define CONFIG_NET_GMAC_PHY_MODE GMAC_PHY_MII #else #define CONFIG_NET_GMAC_PHY_MODE GMAC_PHY_RMII @@ -302,7 +298,7 @@ #define PHY_TYPE_IP101G 4 #define PHY_TYPE_OMNI 5 -#ifdef GMAC_PHY_INNER +#if defined(GMAC_PHY_INNER) #define CONFIG_NET_PHY_TYPE PHY_TYPE_OMNI #else #define CONFIG_NET_PHY_TYPE PHY_TYPE_IP101G @@ -338,7 +334,7 @@ /************************ USB CONFIG ***************************/ #define CONFIG_CMD_USB -#ifdef CONFIG_CMD_USB +#if defined(CONFIG_CMD_USB) #define CONFIG_USB_DWC2 #define CONFIG_USB_DWC2_REG_ADDR 0x13500000 #define CONFIG_USB_HOST_ETHER @@ -392,11 +388,11 @@ /** * Environment */ -#ifdef CONFIG_ENV_IS_IN_MMC +#if defined(CONFIG_ENV_IS_IN_MMC) #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_ENV_SIZE (32 << 10) #define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) -#elif CONFIG_ENV_IS_IN_SPI_FLASH +#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH) #define CONFIG_ENV_SECT_SIZE (1024 * 16) #define CONFIG_ENV_SIZE (1024 * 16) #define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN + CONFIG_UBOOT_OFFSET) @@ -415,7 +411,7 @@ #define CONFIG_SPL_NO_CPU_SUPPORT_CODE #define CONFIG_SPL_START_S_PATH "$(CPUDIR)/$(SOC)" -#ifdef CONFIG_SPL_NOR_SUPPORT +#if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/$(SOC)/u-boot-nor-spl.lds" #else /* CONFIG_SPL_NOR_SUPPORT */ #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/$(SOC)/u-boot-spl.lds" @@ -430,7 +426,7 @@ #define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_GPIO_SUPPORT -#ifdef CONFIG_SPL_NOR_SUPPORT +#if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_TEXT_BASE 0xba000000 #else #define CONFIG_SPL_TEXT_BASE 0x80001000 @@ -439,21 +435,21 @@ #define CONFIG_SPL_MAX_SIZE (26 * 1024) #define CONFIG_SPL_LZOP -#ifdef CONFIG_SPL_LZOP +#if defined(CONFIG_SPL_LZOP) #define CONFIG_DECMP_BUFFER_ADRS 0x80200000 #endif -#ifdef CONFIG_SPL_MMC_SUPPORT +#if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT #endif /* CONFIG_SPL_MMC_SUPPORT */ -#ifdef CONFIG_SPL_SPI_SUPPORT +#if defined(CONFIG_SPL_SPI_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SPI_SPL_CHECK #define CONFIG_SYS_SPI_BOOT_FREQ 1000000 #endif /* CONFIG_SPL_SPI_SUPPORT */ -#ifdef CONFIG_SPL_NOR_SUPPORT +#if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SYS_UBOOT_BASE (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_PAD_TO - 0x40) //0x40 = sizeof (image_header) #define CONFIG_SYS_OS_BASE 0 @@ -464,7 +460,7 @@ /** * GPT configuration */ -#ifdef CONFIG_GPT_CREATOR +#if defined(CONFIG_GPT_CREATOR) #define CONFIG_GPT_TABLE_PATH "$(TOPDIR)/board/$(BOARDDIR)" #else /* USE MBR + zero-GPT-table instead if no gpt table defined*/ @@ -486,7 +482,7 @@ #endif /* JFFS2 configuration */ -#ifdef CONFIG_CMD_JFFS2 +#if defined(CONFIG_CMD_JFFS2) #define CONFIG_CMD_FLASH #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_SYS_MAX_FLASH_SECT 256 diff --git a/include/configs/isvp_t30.h b/include/configs/isvp_t30.h index 5f76ebae..da55af04 100644 --- a/include/configs/isvp_t30.h +++ b/include/configs/isvp_t30.h @@ -47,17 +47,16 @@ #define CONFIG_SYS_APLL_MNOD ((74 << 20) | (1 << 14) | (1 << 11) | (2<<5)) #endif -#if (defined(CONFIG_T30A) || defined(CONFIG_DDR3_128M)) +#if defined(CONFIG_T30A) || defined(CONFIG_DDR3_128M) #define DDR_600M #else #define DDR_500M #endif -#ifdef DDR_400M -#define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL not use mast be set 0*/ +#if defined(DDR_400M) #define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((149 << 20) | (2 << 14) | (1 << 11) | (1<<5)) -#elif defined DDR_500M +#elif defined(DDR_500M) #if 1 #define CONFIG_SYS_MPLL_FREQ 1000000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((124 << 20) | (2 << 14) | (1 << 11) | (1<<5)) @@ -65,8 +64,7 @@ #define CONFIG_SYS_MPLL_FREQ 1500000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((249 << 20) | (3 << 14) | (1 << 11) | (1<<5)) #endif -#elif defined DDR_600M -#define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL not use mast be set 0*/ +#elif defined(DDR_600M) #define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ #define CONFIG_SYS_MPLL_MNOD ((149 << 20) | (2 << 14) | (1 << 11) | (1<<5)) #else @@ -81,15 +79,15 @@ #define SEL_H0 2 #define SEL_H2 2 -#ifdef DDR_400M +#if defined(DDR_400M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 -#elif defined DDR_500M +#elif defined(DDR_500M) #define DIV_PCLK 8 #define DIV_H2 4 #define DIV_H0 4 -#elif defined DDR_600M +#elif defined(DDR_600M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 @@ -113,11 +111,11 @@ #define CONFIG_DDR_SEL_PLL MPLL #define CONFIG_SYS_CPU_FREQ CONFIG_SYS_APLL_FREQ -#ifdef DDR_400M +#if defined(DDR_400M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 3) -#elif defined DDR_500M +#elif defined(DDR_500M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_600M +#elif defined(DDR_600M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) #else #error please define DDR_FREQ @@ -145,7 +143,7 @@ #define CONFIG_DDR_DW32 0 /* 1-32bit-width, 0-16bit-width */ #define CONFIG_DDRC_CTRL_PDT DDRC_CTRL_PDT_128 -#ifdef CONFIG_DDR2_128M +#if defined(CONFIG_DDR2_128M) #define CONFIG_DDR2_M14D1G1664A #define CONFIG_DDR_TYPE_DDR2 #elif defined(CONFIG_DDR3_128M) @@ -173,7 +171,7 @@ /** * Boot arguments definitions. */ -#if (defined(CONFIG_DDR2_128M) || defined(CONFIG_DDR3_128M)) +#if defined(CONFIG_DDR2_128M) || defined(CONFIG_DDR3_128M) #define BOOTARGS_COMMON "console=ttyS1,115200n8 mem=106M@0x0 rmem=22M@0x6a00000" #else #define BOOTARGS_COMMON "console=ttyS1,115200n8 mem=42M@0x0 rmem=22M@0x2a00000" @@ -183,7 +181,7 @@ #define CONFIG_SPL_SFC_SUPPORT #define CONFIG_JZ_SFC #define CONFIG_SPL_VERSION 1 -#ifdef CONFIG_SPL_SFC_NOR +#if defined(CONFIG_SPL_SFC_NOR) #define CONFIG_SFC_NOR #else #define CONFIG_SFC_NAND @@ -192,8 +190,8 @@ /*#define CONFIG_SPI_QUAD*/ #endif /* defined(CONFIG_SPL_SFC_NOR) || defined(CONFIG_SPL_SFC_NAND) */ -#ifdef CONFIG_SPL_MMC_SUPPORT - #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" +#if defined(CONFIG_SPL_MMC_SUPPORT) +#define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" #elif defined(CONFIG_SFC_NOR) #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" #endif @@ -201,11 +199,11 @@ /** * Boot command definitions. */ -#ifdef CONFIG_SPL_MMC_SUPPORT +#if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_BOOTCOMMAND "mmc read 0x80600000 0x1800 0x3000; bootm 0x80600000" #endif -#ifdef CONFIG_SFC_NOR +#if defined(CONFIG_SFC_NOR) #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" #endif /* CONFIG_SFC_NOR */ @@ -219,12 +217,12 @@ #define CONFIG_JZ_MMC 1 #endif /* JZ_MMC_MSC0 || JZ_MMC_MSC1 */ -#ifdef CONFIG_JZ_MMC_MSC0 +#if defined(CONFIG_JZ_MMC_MSC0) #define CONFIG_JZ_MMC_SPLMSC 0 #define CONFIG_JZ_MMC_MSC0_PB 1 #endif -#ifdef CONFIG_SFC_COMMOND +#if defined(CONFIG_SFC_COMMAND) #define CONFIG_CMD_SF #define CONFIG_SPI_FLASH #define CONFIG_JZ_SFC_PA @@ -240,7 +238,7 @@ #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SPI_SPL_CHECK #define CONFIG_JZ_SFC_PA -#ifdef CONFIG_SPI_NAND +#if defined(CONFIG_SPI_NAND) #define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE /*(26 * 1024)*/ #define CONFIG_SPI_NAND_BPP (2048 + 64) /*Bytes Per Page*/ #define CONFIG_SPI_NAND_PPB (64) /*Page Per Block*/ @@ -260,7 +258,7 @@ #endif #endif /* CONFIG_SPL_SFC_SUPPORT */ -#ifdef CONFIG_JZ_SFC +#if defined(CONFIG_JZ_SFC) #define CONFIG_SPIFLASH_PART_OFFSET 0x3c00 #define CONFIG_SPI_NORFLASH_PART_OFFSET 0x3c74 #define CONFIG_NOR_MAJOR_VERSION_NUMBER 1 @@ -270,7 +268,7 @@ #endif /* END SFC */ -#ifdef CONFIG_NORFLASH_32M +#if defined(CONFIG_NORFLASH_32M) #define CONFIG_SPI_FLASH_BAR #endif @@ -325,7 +323,7 @@ /*#define CONFIG_CMD_I2C*/ /************************ USB CONFIG ***************************/ -#define CONFIG_CMD_USB +#if defined(CONFIG_CMD_USB) #ifdef CONFIG_CMD_USB #define CONFIG_USB_DWC2 #define CONFIG_USB_DWC2_REG_ADDR 0x13500000 @@ -380,7 +378,7 @@ /** * Environment */ -#ifdef CONFIG_ENV_IS_IN_MMC +#if defined(CONFIG_ENV_IS_IN_MMC) #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_ENV_SIZE (32 << 10) #define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) @@ -403,7 +401,7 @@ #define CONFIG_SPL_NO_CPU_SUPPORT_CODE #define CONFIG_SPL_START_S_PATH "$(CPUDIR)/$(SOC)" -#ifdef CONFIG_SPL_NOR_SUPPORT +#if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/$(SOC)/u-boot-nor-spl.lds" #else /* CONFIG_SPL_NOR_SUPPORT */ #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/$(SOC)/u-boot-spl.lds" @@ -418,7 +416,7 @@ #define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_GPIO_SUPPORT -#ifdef CONFIG_SPL_NOR_SUPPORT +#if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_TEXT_BASE 0xba000000 #else #define CONFIG_SPL_TEXT_BASE 0x80001000 @@ -427,21 +425,21 @@ #define CONFIG_SPL_MAX_SIZE (26 * 1024) #define CONFIG_SPL_LZOP -#ifdef CONFIG_SPL_LZOP +#if defined(CONFIG_SPL_LZOP) #define CONFIG_DECMP_BUFFER_ADRS 0x80200000 #endif -#ifdef CONFIG_SPL_MMC_SUPPORT +#if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT #endif /* CONFIG_SPL_MMC_SUPPORT */ -#ifdef CONFIG_SPL_SPI_SUPPORT +#if defined(CONFIG_SPL_SPI_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SPI_SPL_CHECK #define CONFIG_SYS_SPI_BOOT_FREQ 1000000 #endif /* CONFIG_SPL_SPI_SUPPORT */ -#ifdef CONFIG_SPL_NOR_SUPPORT +#if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SYS_UBOOT_BASE (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_PAD_TO - 0x40) //0x40 = sizeof (image_header) #define CONFIG_SYS_OS_BASE 0 @@ -452,7 +450,7 @@ /** * GPT configuration */ -#ifdef CONFIG_GPT_CREATOR +#if defined(CONFIG_GPT_CREATOR) #define CONFIG_GPT_TABLE_PATH "$(TOPDIR)/board/$(BOARDDIR)" #else /* USE MBR + zero-GPT-table instead if no gpt table defined*/ @@ -474,7 +472,7 @@ #endif /* JFFS2 configuration */ -#ifdef CONFIG_CMD_JFFS2 +#if defined(CONFIG_CMD_JFFS2) #define CONFIG_CMD_FLASH #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_SYS_MAX_FLASH_SECT 256 diff --git a/include/configs/isvp_t31.h b/include/configs/isvp_t31.h index 2f537820..c9fb9bc1 100644 --- a/include/configs/isvp_t31.h +++ b/include/configs/isvp_t31.h @@ -53,117 +53,62 @@ #define DDR_500M #endif -#ifdef APLL_804M -#define CONFIG_SYS_APLL_FREQ 804000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_APLL_MNOD ((67 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined APLL_864M -#define CONFIG_SYS_APLL_FREQ 864000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_APLL_MNOD ((72 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined APLL_900M -#define CONFIG_SYS_APLL_FREQ 900000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_APLL_MNOD ((75 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined APLL_1000M -#define CONFIG_SYS_APLL_FREQ 1000000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_APLL_MNOD ((125 << 20) | (1 << 14) | (3 << 11) | (1<<8)) -#elif defined APLL_1008M -#define CONFIG_SYS_APLL_FREQ 1008000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_APLL_MNOD ((84 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined APLL_1104M -#define CONFIG_SYS_APLL_FREQ 1104000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_APLL_MNOD ((92 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined APLL_1200M -#define CONFIG_SYS_APLL_FREQ 1200000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_APLL_MNOD ((100 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined APLL_1392M -#define CONFIG_SYS_APLL_FREQ 1392000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_APLL_MNOD ((116 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined APLL_1400M -#define CONFIG_SYS_APLL_FREQ 1404000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_APLL_MNOD ((117 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined APLL_1500M -#define CONFIG_SYS_APLL_FREQ 1500000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_APLL_MNOD ((125 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined APLL_1800M -#define CONFIG_SYS_APLL_FREQ 1800000000 /*If MPLL not use mast be set 0*/ -#define CONFIG_SYS_APLL_MNOD ((150 << 20) | (1 << 14) | (2 << 11) | (1<<8)) +#if defined(APLL_804M) #define CONFIG_SYS_APLL_FREQ 804000000 /*If APLL is not used it must be set to 0*/ +#elif defined(APLL_864M) #define CONFIG_SYS_APLL_FREQ 864000000 /*If APLL is not used it must be set to 0*/ +#elif defined(APLL_900M) #define CONFIG_SYS_APLL_FREQ 900000000 /*If APLL is not used it must be set to 0*/ +#elif defined(APLL_1000M) #define CONFIG_SYS_APLL_FREQ 1000000000 /*If APLL is not used it must be set to 0*/ +#elif defined(APLL_1008M) #define CONFIG_SYS_APLL_FREQ 1008000000 /*If APLL is not used it must be set to 0*/ #define CONFIG_SYS_APLL_FREQ 1104000000 /*If APLL is not used it must be set to 0*/ +#elif defined(APLL_1200M) #define CONFIG_SYS_APLL_FREQ 1200000000 /*If APLL is not used it must be set to 0*/ +#elif defined(APLL_1392M) #define CONFIG_SYS_APLL_FREQ 1392000000 /*If APLL is not used it must be set to 0*/ +#elif defined(APLL_1400M) #define CONFIG_SYS_APLL_FREQ 1404000000 /*If APLL is not used it must be set to 0*/ +#elif defined(APLL_1500M) #define CONFIG_SYS_APLL_FREQ 1500000000 /*If APLL is not used it must be set to 0*/ +#elif defined(APLL_1800M) #define CONFIG_SYS_APLL_FREQ 1800000000 /*If MPLL is not used it must be set to 0*/ #else #error please define APLL_FREQ #endif -#ifdef DDR_400M -#define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((100 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined DDR_450M -#define CONFIG_SYS_MPLL_FREQ 900000000 /*If MPLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((75 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined DDR_500M -#define CONFIG_SYS_MPLL_FREQ 1000000000 /*If MPLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((125 << 20) | (1 << 14) | (3 << 11) | (1<<8)) -#elif defined DDR_540M -#define CONFIG_SYS_MPLL_FREQ 1080000000 /*If MPLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((90 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined DDR_600M -#define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((100 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined DDR_650M -#define CONFIG_SYS_MPLL_FREQ 1308000000 /*If MPLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((109 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined DDR_700M -#define CONFIG_SYS_MPLL_FREQ 1404000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((117 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined DDR_750M -#define CONFIG_SYS_MPLL_FREQ 1500000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((125 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined DDR_762M -#define CONFIG_SYS_MPLL_FREQ 1524000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((127 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined DDR_774M -#define CONFIG_SYS_MPLL_FREQ 1548000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((129 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined DDR_786M -#define CONFIG_SYS_MPLL_FREQ 1572000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((131 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined DDR_798M -#define CONFIG_SYS_MPLL_FREQ 1596000000 /*If APLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((133 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined DDR_800M -#define CONFIG_SYS_MPLL_FREQ 1608000000 /*If MPLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((134 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined DDR_810M -#define CONFIG_SYS_MPLL_FREQ 1620000000 /*If MPLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((135 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined DDR_816M -#define CONFIG_SYS_MPLL_FREQ 1632000000 /*If MPLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((136 << 20) | (1 << 14) | (2 << 11) | (1<<8)) -#elif defined DDR_900M -#define CONFIG_SYS_MPLL_FREQ 1800000000 /*If MPLL not use mast be set 0*/ -#define CONFIG_SYS_MPLL_MNOD ((150 << 20) | (1 << 14) | (2 << 11) | (1<<8)) +#if defined(DDR_400M) #define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ +#elif defined(DDR_450M) #define CONFIG_SYS_MPLL_FREQ 900000000 /*If MPLL is not used it must be set to 0*/ +#elif defined(DDR_500M) #define CONFIG_SYS_MPLL_FREQ 1000000000 /*If MPLL is not used it must be set to 0*/ +#elif defined(DDR_540M) #define CONFIG_SYS_MPLL_FREQ 1080000000 /*If MPLL is not used it must be set to 0*/ +#elif defined(DDR_600M) #define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ +#elif defined(DDR_650M) #define CONFIG_SYS_MPLL_FREQ 1308000000 /*If MPLL is not used it must be set to 0*/ +#elif defined(DDR_700M) #define CONFIG_SYS_MPLL_FREQ 1404000000 /*If APLL is not used it must be set to 0*/ +#elif defined(DDR_750M) #define CONFIG_SYS_MPLL_FREQ 1500000000 /*If APLL is not used it must be set to 0*/ +#elif defined(DDR_762M) #define CONFIG_SYS_MPLL_FREQ 1524000000 /*If APLL is not used it must be set to 0*/ +#elif defined(DDR_774M) #define CONFIG_SYS_MPLL_FREQ 1548000000 /*If APLL is not used it must be set to 0*/ +#elif defined(DDR_786M) #define CONFIG_SYS_MPLL_FREQ 1572000000 /*If APLL is not used it must be set to 0*/ +#elif defined(DDR_798M) #define CONFIG_SYS_MPLL_FREQ 1596000000 /*If APLL is not used it must be set to 0*/ +#elif defined(DDR_800M) #define CONFIG_SYS_MPLL_FREQ 1608000000 /*If MPLL is not used it must be set to 0*/ +#elif defined(DDR_810M) #define CONFIG_SYS_MPLL_FREQ 1620000000 /*If MPLL is not used it must be set to 0*/ +#elif defined(DDR_816M) #define CONFIG_SYS_MPLL_FREQ 1632000000 /*If MPLL is not used it must be set to 0*/ +#elif defined(DDR_900M) #define CONFIG_SYS_MPLL_FREQ 1800000000 /*If MPLL is not used it must be set to 0*/ #else #error please define DDR_FREQ @@ -175,67 +120,67 @@ #define SEL_H0 2 #define SEL_H2 2 -#ifdef DDR_400M +#if defined(DDR_400M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 -#elif defined DDR_450M +#elif defined(DDR_450M) #define DIV_PCLK 8 #define DIV_H2 4 #define DIV_H0 4 -#elif defined DDR_500M +#elif defined(DDR_500M) #define DIV_PCLK 8 #define DIV_H2 4 #define DIV_H0 4 -#elif defined DDR_540M +#elif defined(DDR_540M) #define DIV_PCLK 8 #define DIV_H2 4 #define DIV_H0 4 -#elif defined DDR_600M +#elif defined(DDR_600M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 -#elif defined DDR_650M +#elif defined(DDR_650M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 -#elif defined DDR_700M +#elif defined(DDR_700M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 -#elif defined DDR_750M +#elif defined(DDR_750M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 -#elif defined DDR_762M +#elif defined(DDR_762M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 -#elif defined DDR_774M +#elif defined(DDR_774M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 -#elif defined DDR_786M +#elif defined(DDR_786M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 -#elif defined DDR_798M +#elif defined(DDR_798M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 -#elif defined DDR_800M +#elif defined(DDR_800M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 -#elif defined DDR_810M +#elif defined(DDR_810M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 -#elif defined DDR_816M +#elif defined(DDR_816M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 -#elif defined DDR_900M +#elif defined(DDR_900M) #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 @@ -259,37 +204,37 @@ #define CONFIG_DDR_SEL_PLL MPLL #define CONFIG_SYS_CPU_FREQ CONFIG_SYS_APLL_FREQ -#ifdef DDR_400M +#if defined(DDR_400M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 3) -#elif defined DDR_450M +#elif defined(DDR_450M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_500M +#elif defined(DDR_500M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_540M +#elif defined(DDR_540M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_600M +#elif defined(DDR_600M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_650M +#elif defined(DDR_650M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_700M +#elif defined(DDR_700M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_750M +#elif defined(DDR_750M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_762M +#elif defined(DDR_762M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_774M +#elif defined(DDR_774M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_786M +#elif defined(DDR_786M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_798M +#elif defined(DDR_798M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_800M +#elif defined(DDR_800M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_810M +#elif defined(DDR_810M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_816M +#elif defined(DDR_816M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) -#elif defined DDR_900M +#elif defined(DDR_900M) #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) #else #error please define DDR_FREQ @@ -317,7 +262,7 @@ #define CONFIG_DDR_DW32 0 /* 1-32bit-width, 0-16bit-width */ #define CONFIG_DDRC_CTRL_PDT DDRC_CTRL_PDT_128 -#ifdef CONFIG_DDR2_128M +#if defined(CONFIG_DDR2_128M) #define CONFIG_DDR2_M14D1G1664A #define CONFIG_DDR_TYPE_DDR2 #elif defined(CONFIG_DDR3_128M) @@ -347,6 +292,7 @@ #define CONFIG_OF_LIBFDT 1 #endif #ifdef CONFIG_OF_LIBFDT +#if defined(CONFIG_OF_LIBFDT) #define IMAGE_ENABLE_OF_LIBFDT 1 #define CONFIG_LMB #endif @@ -354,7 +300,7 @@ /** * Boot arguments definitions. */ -#if (defined(CONFIG_DDR2_128M) || defined(CONFIG_DDR3_128M)) +#if defined(CONFIG_DDR2_128M) || defined(CONFIG_DDR3_128M) #define BOOTARGS_COMMON "console=ttyS1,115200n8 mem=64M@0x0 rmem=64M@0x4000000" #else #define BOOTARGS_COMMON "console=ttyS1,115200n8 mem=42M@0x0 rmem=22M@0x2a00000" @@ -364,7 +310,7 @@ #define CONFIG_SPL_SFC_SUPPORT #define CONFIG_JZ_SFC #define CONFIG_SPL_VERSION 1 -#ifdef CONFIG_SPL_SFC_NOR +#if defined(CONFIG_SPL_SFC_NOR) #define CONFIG_SFC_NOR #else #define CONFIG_SFC_NAND @@ -373,11 +319,10 @@ /*#define CONFIG_SPI_QUAD*/ #endif /* defined(CONFIG_SPL_SFC_NOR) || defined(CONFIG_SPL_SFC_NAND) */ -#ifdef CONFIG_SPL_MMC_SUPPORT - #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" +#if defined(CONFIG_SPL_MMC_SUPPORT) +#define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" #elif defined(CONFIG_SFC_NOR) -#ifdef CONFIG_OF_LIBFDT - #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:320k(boot),2496k(kernel),2048k(root),64k(dtb),-(appfs)" +#if defined(CONFIG_OF_LIBFDT) #else #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" #endif @@ -388,19 +333,19 @@ /** * Boot command definitions. */ -#ifdef CONFIG_SPL_MMC_SUPPORT +#if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_BOOTCOMMAND "mmc read 0x80600000 0x1800 0x3000; bootm 0x80600000" #endif -#ifdef CONFIG_SFC_NOR -#ifdef CONFIG_OF_LIBFDT +#if defined(CONFIG_SFC_NOR) +#if defined(CONFIG_OF_LIBFDT) #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x50000 0x270000;sf read 0x83000000 0x540000 0x10000;bootm 0x80600000 - 0x83000000" #else #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" #endif #endif /* CONFIG_SFC_NOR */ -#ifdef CONFIG_SFC_NAND +#if defined(CONFIG_SFC_NAND) #define CONFIG_BOOTCOMMAND "nand read 0x80600000 0x100000 0x800000;bootm 0x80600000" #endif @@ -414,20 +359,19 @@ #define CONFIG_JZ_MMC 1 #endif /* JZ_MMC_MSC0 || JZ_MMC_MSC1 */ -#ifdef CONFIG_JZ_MMC_MSC0 +#if defined(CONFIG_JZ_MMC_MSC0) #define CONFIG_JZ_MMC_SPLMSC 0 #define CONFIG_JZ_MMC_MSC0_PB 1 #endif -#ifdef CONFIG_SFC_COMMAND/* SD card start */ -#if 1 +#if defined(CONFIG_SFC_COMMAND)/* SD card start */ #define CONFIG_SFC_NOR_COMMAND /* support nor command */ #else #define CONFIG_SFC_NAND_COMMAND /* support nand command */ #endif #endif /* CONFIG_SFC_COMMAND */ -#ifdef CONFIG_SFC_NOR_COMMAND +#if defined(CONFIG_SFC_NOR_COMMAND) #define CONFIG_CMD_SF #define CONFIG_SPI_FLASH #define CONFIG_JZ_SFC_PA @@ -466,7 +410,7 @@ #define CONFIG_SPI_STANDARD //if the nand is QUAD mode, please annotate it. the default is one lan. #endif -#ifdef CONFIG_SPL_SFC_SUPPORT +#if defined(CONFIG_SPL_SFC_SUPPORT) /*SFCNAND env*/ /* spi nand environment */ #define CONFIG_SYS_REDUNDAND_ENVIRONMENT @@ -490,7 +434,7 @@ #endif #endif /* CONFIG_SPL_SFC_SUPPORT */ -#ifdef CONFIG_NORFLASH_32M +#if defined(CONFIG_NORFLASH_32M) #define CONFIG_SPI_FLASH_BAR #endif @@ -556,7 +500,7 @@ /************************ USB CONFIG ***************************/ #define CONFIG_CMD_USB -#ifdef CONFIG_CMD_USB +#if defined(CONFIG_CMD_USB) #define CONFIG_USB_DWC2 #define CONFIG_USB_DWC2_REG_ADDR 0x13500000 #define CONFIG_USB_HOST_ETHER @@ -596,7 +540,7 @@ #if defined(CONFIG_SFC_NAND) || defined(CONFIG_SFC_NAND_COMMAND) #define CONFIG_SYS_MONITOR_LEN (400 * 1024) #else -#ifdef CONFIG_OF_LIBFDT /* support device tree */ +#if defined(CONFIG_OF_LIBFDT) #define CONFIG_SYS_MONITOR_LEN (246 * 1024) #else #define CONFIG_SYS_MONITOR_LEN (214 * 1024) @@ -618,11 +562,11 @@ /** * Environment */ -#ifdef CONFIG_ENV_IS_IN_MMC +#if defined(CONFIG_ENV_IS_IN_MMC) #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_ENV_SIZE (32 << 10) #define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) -#elif CONFIG_ENV_IS_IN_SPI_FLASH +#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH) #define CONFIG_ENV_SECT_SIZE (1024 * 16) #define CONFIG_ENV_SIZE (1024 * 16) #define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN + CONFIG_UBOOT_OFFSET) @@ -637,7 +581,7 @@ #define CONFIG_SPL_NO_CPU_SUPPORT_CODE #define CONFIG_SPL_START_S_PATH "$(CPUDIR)/$(SOC)" -#ifdef CONFIG_SPL_NOR_SUPPORT +#if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/$(SOC)/u-boot-nor-spl.lds" #else /* CONFIG_SPL_NOR_SUPPORT */ #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/$(SOC)/u-boot-spl.lds" @@ -660,7 +604,7 @@ #define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_GPIO_SUPPORT -#ifdef CONFIG_SPL_NOR_SUPPORT +#if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_TEXT_BASE 0xba000000 #else #define CONFIG_SPL_TEXT_BASE 0x80001000 @@ -669,21 +613,21 @@ #define CONFIG_SPL_MAX_SIZE (26 * 1024) #define CONFIG_SPL_LZOP -#ifdef CONFIG_SPL_LZOP +#if defined(CONFIG_SPL_LZOP) #define CONFIG_DECMP_BUFFER_ADRS 0x80200000 #endif -#ifdef CONFIG_SPL_MMC_SUPPORT +#if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT #endif /* CONFIG_SPL_MMC_SUPPORT */ -#ifdef CONFIG_SPL_SPI_SUPPORT +#if defined(CONFIG_SPL_SPI_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SPI_SPL_CHECK #define CONFIG_SYS_SPI_BOOT_FREQ 1000000 #endif /* CONFIG_SPL_SPI_SUPPORT */ -#ifdef CONFIG_SPL_NOR_SUPPORT +#if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT #define CONFIG_SYS_UBOOT_BASE (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_PAD_TO - 0x40) //0x40 = sizeof (image_header) #define CONFIG_SYS_OS_BASE 0 @@ -694,7 +638,7 @@ /** * GPT configuration */ -#ifdef CONFIG_GPT_CREATOR +#if defined(CONFIG_GPT_CREATOR) #define CONFIG_GPT_TABLE_PATH "$(TOPDIR)/board/$(BOARDDIR)" #else /* USE MBR + zero-GPT-table instead if no gpt table defined*/ @@ -716,7 +660,7 @@ #endif /* JFFS2 configuration */ -#ifdef CONFIG_CMD_JFFS2 +#if defined(CONFIG_CMD_JFFS2) #define CONFIG_CMD_FLASH #define CONFIG_SYS_MAX_FLASH_BANKS 1 #define CONFIG_SYS_MAX_FLASH_SECT 256 From 617a5297de230e49da9b93496b5566a7a67dffe3 Mon Sep 17 00:00:00 2001 From: Paul Philippov Date: Sun, 7 Jan 2024 05:43:55 -0500 Subject: [PATCH 05/19] mostly formatting --- include/configs/isvp_common.h | 84 ++++++++++++++------------------ include/configs/isvp_t10.h | 47 +++++++++++++----- include/configs/isvp_t20.h | 53 +++++++++++++-------- include/configs/isvp_t21.h | 45 ++++++++++++------ include/configs/isvp_t30.h | 48 ++++++++++++------- include/configs/isvp_t31.h | 90 ++++++++++++++++++++++++----------- 6 files changed, 226 insertions(+), 141 deletions(-) diff --git a/include/configs/isvp_common.h b/include/configs/isvp_common.h index 8273dad6..11df0bfa 100644 --- a/include/configs/isvp_common.h +++ b/include/configs/isvp_common.h @@ -22,8 +22,7 @@ #define CONFIG_SYS_PROMPT "OpenIPC # " #define CONFIG_AUTOBOOT_KEYED -#define CONFIG_AUTOBOOT_PROMPT \ - "Press Ctrl-c to abort autoboot... %d \n", bootdelay +#define CONFIG_AUTOBOOT_PROMPT "Press Ctrl-c to abort autoboot... %d \n", bootdelay #define CONFIG_AUTOBOOT_STOP_STR "\x3" #define CONFIG_SYS_LONGHELP @@ -60,65 +59,52 @@ #define CONFIG_CMD_SDSTART 1 -#define CONFIG_BOOTCOMMAND \ - "setenv setargs setenv bootargs ${bootargs};" \ - "run setargs;" \ - "sf probe 0;" \ - "sf read ${baseaddr} 0x50000 0x300000;" \ - "bootm ${baseaddr}" - -#if (defined(CONFIG_DDR2_128M) || defined(CONFIG_DDR3_128M)) +#if defined(CONFIG_DDR2_128M) || defined(CONFIG_DDR3_128M) #define CONFIG_EXTRA_SETTINGS \ - "totalmem=128M\0" \ - "osmem=64M\0" \ - "rmem=64M@0x4000000\0" +"totalmem=128M\0" \ +"osmem=64M\0" \ +"rmem=64M@0x4000000\0" #else #define CONFIG_EXTRA_SETTINGS \ - "totalmem=64M\0" \ - "osmem=40M\0" \ - "rmem=24M@0x2800000\0" +"totalmem=64M\0" \ +"osmem=40M\0" \ +"rmem=24M@0x2800000\0" #endif -#ifdef CONFIG_SPL_MMC_SUPPORT +#if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_BOOTCOMMAND \ - "mmc rescan;" \ - "setenv setargs setenv bootargs ${bootargs};" \ - "run setargs;" \ - "mmc read ${baseaddr} 0x1800 0x3000;"\ - "bootm ${baseaddr}" -#endif - -#ifdef CONFIG_SFC_NOR +"setenv setargs setenv bootargs ${bootargs};run setargs;" \ +"mmc rescan;mmc read ${baseaddr} 0x1800 0x3000;" \ +"bootm ${baseaddr};" +#elif defined(CONFIG_SFC_NOR) #define CONFIG_BOOTCOMMAND \ - "sf probe;" \ - "setenv setargs setenv bootargs ${bootargs};" \ - "run setargs;" \ - "sf read ${baseaddr} 0x50000 \\${kern_len};" \ - "bootm ${baseaddr}" -#endif - -#ifdef CONFIG_SFC_NAND +"setenv setargs setenv bootargs ${bootargs};run setargs;" \ +"sf probe;sf read ${baseaddr} 0x50000 \\${kern_len};" \ +"bootm ${baseaddr};" +#elif defined(CONFIG_SFC_NAND) +#define CONFIG_BOOTCOMMAND \ +"setenv setargs setenv bootargs ${bootargs};run setargs;" \ +"sf probe;sfcnand read 0x50000 0x200000 ${baseaddr};" \ +"bootm ${baseaddr};" +#else #define CONFIG_BOOTCOMMAND \ - "sf probe;" \ - "setenv setargs setenv bootargs ${bootargs};" \ - "run setargs;" \ - "sfcnand read 0x50000 0x200000 ${baseaddr};" \ - "bootm ${baseaddr}" +"setenv setargs setenv bootargs ${bootargs};run setargs;" \ +"sf probe;sf read ${baseaddr} 0x50000 0x250000;" \ +"bootm ${baseaddr};" #endif #define CONFIG_BOOTARGS \ - "mem=\${osmem} rmem=\${rmem} console=\${serialport},\${baudrate}n8" \ - " panic=\${panic_timeout} root=/dev/mtdblock3 rootfstype=squashfs" \ - " init=/init mtdparts=jz_sfc:256k(boot),64k(env)," \ - "\\${kern_size}(kernel),\\${rootfs_size}(rootfs),-(rootfs_data)" +"mem=\${osmem} rmem=\${rmem} console=\${serialport},\${baudrate}n8" \ +" panic=\${panic_timeout} root=/dev/mtdblock3 rootfstype=squashfs init=/init" \ +" mtdparts=jz_sfc:256k(boot),64k(env),\\${kern_size}(kernel),\\${rootfs_size}(rootfs),-(rootfs_data)" #define CONFIG_EXTRA_ENV_SETTINGS \ - "baseaddr=0x80600000\0" \ - "panic_timeout=10\0" \ - "serialport=ttyS1\0" \ - "restore=n\0" \ - "soc="CONFIG_SOC"\0" \ - CONFIG_EXTRA_SETTINGS \ - CONFIG_GPIO_SETTINGS +"baseaddr=0x80600000\0" \ +"panic_timeout=10\0" \ +"serialport=ttyS1\0" \ +"restore=n\0" \ +"soc="CONFIG_SOC"\0" \ +CONFIG_EXTRA_SETTINGS \ +CONFIG_GPIO_SETTINGS #endif /*__CONFIG_ISVP_COMMON__*/ diff --git a/include/configs/isvp_t10.h b/include/configs/isvp_t10.h index fd14b2af..6a3b6aa4 100644 --- a/include/configs/isvp_t10.h +++ b/include/configs/isvp_t10.h @@ -51,9 +51,11 @@ #define SEL_CPU 1 #define SEL_H0 2 #define SEL_H2 2 + #define DIV_PCLK 12 #define DIV_H2 6 #define DIV_H0 6 + #define DIV_L2 2 #define DIV_CPU 1 #define CONFIG_SYS_CPCCR_SEL (((SEL_SCLKA & 3) << 30) \ @@ -69,6 +71,7 @@ #define CONFIG_CPU_SEL_PLL APLL #define CONFIG_DDR_SEL_PLL MPLL #define CONFIG_SYS_CPU_FREQ CONFIG_SYS_APLL_FREQ + #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 3) #define CONFIG_SYS_EXTAL 24000000 /* EXTAL freq: 24 MHz */ @@ -81,10 +84,11 @@ #define CONFIG_SYS_UART_INDEX 1 #define CONFIG_BAUDRATE 115200 -/*#define CONFIG_DDR_TEST_CPU -#define CONFIG_DDR_TEST*/ +/* +#define CONFIG_DDR_TEST_CPU +#define CONFIG_DDR_TEST +*/ -#define CONFIG_DDR_TYPE_DDR2 #define CONFIG_DDR_PARAMS_CREATOR #define CONFIG_DDR_HOST_CC #define CONFIG_DDR_FORCE_SELECT_CS1 @@ -92,19 +96,27 @@ #define CONFIG_DDR_CS1 0 /* 1-connected, 0-disconnected */ #define CONFIG_DDR_DW32 0 /* 1-32bit-width, 0-16bit-width */ #define CONFIG_DDRC_CTRL_PDT DDRC_CTRL_PDT_128 + #define CONFIG_DDR2_M14D5121632A +#define CONFIG_DDR_TYPE_DDR2 #define CONFIG_DDR_PHY_IMPEDANCE 40000 #define CONFIG_DDR_PHY_ODT_IMPEDANCE 50000 //75000 -/*#define CONFIG_DDR_PHY_IMPED_PULLUP 0xf*/ -/*#define CONFIG_DDR_PHY_IMPED_PULLDOWN 0xf*/ +/* +#define CONFIG_DDR_PHY_IMPED_PULLUP 0xf +#define CONFIG_DDR_PHY_IMPED_PULLDOWN 0xf +*/ -/* #define CONFIG_DDR_DLL_OFF */ +/* +#define CONFIG_DDR_DLL_OFF +*/ -/*#define CONFIG_DDR_CHIP_ODT*/ -/*#define CONFIG_DDR_PHY_ODT*/ -/*#define CONFIG_DDR_PHY_DQ_ODT*/ -/*#define CONFIG_DDR_PHY_DQS_ODT*/ +/* +#define CONFIG_DDR_CHIP_ODT +#define CONFIG_DDR_PHY_ODT +#define CONFIG_DDR_PHY_DQ_ODT +#define CONFIG_DDR_PHY_DQS_ODT +*/ /** * Boot arguments definitions. @@ -172,7 +184,7 @@ #define CONFIG_CMD_SF #define CONFIG_SPI_FLASH_INGENIC #define CONFIG_SPI_FLASH -#define CONFIG_UBOOT_OFFSET (26 * 1024) +#define CONFIG_UBOOT_OFFSET (26 * 1024) #define CONFIG_SPL_SFC_NOR #define CONFIG_SPI_DUAL /*#define CONFIG_SPI_QUAD*/ @@ -276,7 +288,7 @@ #define CONFIG_SYS_MAXARGS 64 #define CONFIG_SYS_LONGHELP #define CONFIG_SYS_PROMPT CONFIG_SYS_BOARD "# " -#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ +#define CONFIG_SYS_CBSIZE 1024 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) #define CONFIG_SYS_MONITOR_LEN (214 * 1024) @@ -404,6 +416,17 @@ #define CONFIG_SYS_MAX_FLASH_SECT 0 #endif +/* + Platform Default GPIOs: + + hichip_mmc_enable = 62 + pps_mmc_enable = 61 + wyze_mmc_enable = 48 +*/ + +#define CONFIG_GPIO_SETTINGS \ +"" + #include "isvp_common.h" #endif /*__CONFIG_ISVP_T10_H__*/ diff --git a/include/configs/isvp_t20.h b/include/configs/isvp_t20.h index b96a4dfe..813775b5 100644 --- a/include/configs/isvp_t20.h +++ b/include/configs/isvp_t20.h @@ -52,9 +52,11 @@ #define SEL_CPU 1 #define SEL_H0 2 #define SEL_H2 2 + #define DIV_PCLK 10 #define DIV_H2 5 #define DIV_H0 5 + #define DIV_L2 2 #define DIV_CPU 1 #define CONFIG_SYS_CPCCR_SEL (((SEL_SCLKA & 3) << 30) \ @@ -70,6 +72,7 @@ #define CONFIG_CPU_SEL_PLL APLL #define CONFIG_DDR_SEL_PLL MPLL #define CONFIG_SYS_CPU_FREQ CONFIG_SYS_APLL_FREQ + #define CONFIG_SYS_MEM_FREQ (CONFIG_SYS_MPLL_FREQ / 2) #define CONFIG_SYS_EXTAL 24000000 /* EXTAL freq: 24 MHz */ @@ -82,10 +85,10 @@ #define CONFIG_SYS_UART_INDEX 1 #define CONFIG_BAUDRATE 115200 -/*#define CONFIG_DDR_TEST_CPU -#define CONFIG_DDR_TEST*/ - -#define CONFIG_DDR_TYPE_DDR2 +/* +#define CONFIG_DDR_TEST_CPU +#define CONFIG_DDR_TEST +*/ #define CONFIG_DDR_PARAMS_CREATOR #define CONFIG_DDR_HOST_CC #define CONFIG_DDR_FORCE_SELECT_CS1 @@ -99,18 +102,25 @@ #else #define CONFIG_DDR2_M14D5121632A #endif +#define CONFIG_DDR_TYPE_DDR2 #define CONFIG_DDR_PHY_IMPEDANCE 40000 #define CONFIG_DDR_PHY_ODT_IMPEDANCE 50000 //75000 -/*#define CONFIG_DDR_PHY_IMPED_PULLUP 0xf*/ -/*#define CONFIG_DDR_PHY_IMPED_PULLDOWN 0xf*/ +/* +#define CONFIG_DDR_PHY_IMPED_PULLUP 0xf +#define CONFIG_DDR_PHY_IMPED_PULLDOWN 0xf +*/ -/* #define CONFIG_DDR_DLL_OFF */ +/* +#define CONFIG_DDR_DLL_OFF +*/ -/*#define CONFIG_DDR_CHIP_ODT*/ -/*#define CONFIG_DDR_PHY_ODT*/ -/*#define CONFIG_DDR_PHY_DQ_ODT*/ -/*#define CONFIG_DDR_PHY_DQS_ODT*/ +/* +#define CONFIG_DDR_CHIP_ODT +#define CONFIG_DDR_PHY_ODT +#define CONFIG_DDR_PHY_DQ_ODT +#define CONFIG_DDR_PHY_DQS_ODT +*/ /** * Boot arguments definitions. @@ -124,7 +134,7 @@ #if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" #elif defined(CONFIG_SFC_NOR) - #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" +#define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" #endif /** @@ -136,7 +146,7 @@ #if defined(CONFIG_SFC_NOR) #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" -#endif /* CONFIG_SFC_NOR */ +#endif /** * Drivers configuration. @@ -209,6 +219,7 @@ #define GMAC_PHY_RMII 2 #define GMAC_PHY_GMII 3 #define GMAC_PHY_RGMII 4 + #define CONFIG_NET_GMAC_PHY_MODE GMAC_PHY_RMII #define PHY_TYPE_DM9161 1 @@ -285,7 +296,7 @@ #define CONFIG_SYS_MAXARGS 64 #define CONFIG_SYS_LONGHELP #define CONFIG_SYS_PROMPT CONFIG_SYS_BOARD "# " -#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ +#define CONFIG_SYS_CBSIZE 1024 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) #define CONFIG_SYS_MONITOR_LEN (214 * 1024) @@ -336,7 +347,9 @@ #define CONFIG_SPL_PAD_TO 26624 /* equal to spl max size in M200 */ -#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 86 //0x5A //wli changed 0x20 /* 16KB offset */ +#define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE +#define CONFIG_MMC_RAW_UBOOT_OFFSET (CONFIG_UBOOT_OFFSET / 1024 + 17) +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR (CONFIG_MMC_RAW_UBOOT_OFFSET * 2)//0x5A //wli changed 0x20 /* 16KB offset */ #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400 /* 512 KB */ #define CONFIG_SPL_BOARD_INIT @@ -383,11 +396,11 @@ /* USE MBR + zero-GPT-table instead if no gpt table defined*/ #define CONFIG_MBR_P0_OFF 64mb #define CONFIG_MBR_P0_END 556mb -#define CONFIG_MBR_P0_TYPE linux +#define CONFIG_MBR_P0_TYPE linux #define CONFIG_MBR_P1_OFF 580mb -#define CONFIG_MBR_P1_END 1604mb -#define CONFIG_MBR_P1_TYPE linux +#define CONFIG_MBR_P1_END 1604mb +#define CONFIG_MBR_P1_TYPE linux #define CONFIG_MBR_P2_OFF 28mb #define CONFIG_MBR_P2_END 58mb @@ -413,8 +426,6 @@ #define CONFIG_SYS_MAX_FLASH_SECT 0 #endif -#include "isvp_common.h" - /* Platform Default GPIOs: @@ -427,4 +438,6 @@ "gpio_dev=47O\0" \ "gpio_dev_net=43O 48o 43o\0" +#include "isvp_common.h" + #endif /*__CONFIG_ISVP_T10_H__*/ diff --git a/include/configs/isvp_t21.h b/include/configs/isvp_t21.h index af26865c..6dbf72f7 100644 --- a/include/configs/isvp_t21.h +++ b/include/configs/isvp_t21.h @@ -127,8 +127,10 @@ #define CONFIG_BAUDRATE 115200 #define CONFIG_SYS_UART_CONTROLLER_STEP 0x1000 -/*#define CONFIG_DDR_TEST_CPU -#define CONFIG_DDR_TEST*/ +/* +#define CONFIG_DDR_TEST_CPU +#define CONFIG_DDR_TEST +*/ #define CONFIG_DDR_INNOPHY #define CONFIG_DDR_PARAMS_CREATOR #define CONFIG_DDR_HOST_CC @@ -151,15 +153,21 @@ #define CONFIG_DDR_PHY_IMPEDANCE 40000 #define CONFIG_DDR_PHY_ODT_IMPEDANCE 50000 //75000 -/*#define CONFIG_DDR_PHY_IMPED_PULLUP 0xf*/ -/*#define CONFIG_DDR_PHY_IMPED_PULLDOWN 0xf*/ +/* +#define CONFIG_DDR_PHY_IMPED_PULLUP 0xf +#define CONFIG_DDR_PHY_IMPED_PULLDOWN 0xf +*/ -/* #define CONFIG_DDR_DLL_OFF */ +/* +#define CONFIG_DDR_DLL_OFF +*/ -/*#define CONFIG_DDR_CHIP_ODT*/ -/*#define CONFIG_DDR_PHY_ODT*/ -/*#define CONFIG_DDR_PHY_DQ_ODT*/ -/*#define CONFIG_DDR_PHY_DQS_ODT*/ +/* +#define CONFIG_DDR_CHIP_ODT +#define CONFIG_DDR_PHY_ODT +#define CONFIG_DDR_PHY_DQ_ODT +#define CONFIG_DDR_PHY_DQS_ODT +*/ /** * Boot arguments definitions. @@ -186,7 +194,7 @@ #if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" #elif defined(CONFIG_SFC_NOR) - #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" +#define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" #endif /** @@ -198,7 +206,7 @@ #if defined(CONFIG_SFC_NOR) #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" -#endif /* CONFIG_SFC_NOR */ +#endif /** * Drivers configuration. @@ -368,7 +376,7 @@ #define CONFIG_SYS_MAXARGS 64 #define CONFIG_SYS_LONGHELP #define CONFIG_SYS_PROMPT CONFIG_SYS_BOARD "# " -#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ +#define CONFIG_SYS_CBSIZE 1024 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) #define CONFIG_SYS_MONITOR_LEN (214 * 1024) @@ -466,11 +474,11 @@ /* USE MBR + zero-GPT-table instead if no gpt table defined*/ #define CONFIG_MBR_P0_OFF 64mb #define CONFIG_MBR_P0_END 556mb -#define CONFIG_MBR_P0_TYPE linux +#define CONFIG_MBR_P0_TYPE linux #define CONFIG_MBR_P1_OFF 580mb -#define CONFIG_MBR_P1_END 1604mb -#define CONFIG_MBR_P1_TYPE linux +#define CONFIG_MBR_P1_END 1604mb +#define CONFIG_MBR_P1_TYPE linux #define CONFIG_MBR_P2_OFF 28mb #define CONFIG_MBR_P2_END 58mb @@ -496,6 +504,13 @@ #define CONFIG_SYS_MAX_FLASH_SECT 0 #endif +/* + Platform Default GPIOs: +*/ + +#define CONFIG_GPIO_SETTINGS \ + "" + #include "isvp_common.h" #endif /*__CONFIG_ISVP_T10_H__*/ diff --git a/include/configs/isvp_t30.h b/include/configs/isvp_t30.h index da55af04..9f83240d 100644 --- a/include/configs/isvp_t30.h +++ b/include/configs/isvp_t30.h @@ -35,7 +35,6 @@ /*#define CONFIG_DDR_AUTO_SELF_REFRESH*/ #define CONFIG_SPL_DDR_SOFT_TRAINING - #if defined(CONFIG_LITE_VERSION) #define CONFIG_SYS_APLL_FREQ 750000000 /*If APLL is not used it must be set to 0*/ #define CONFIG_SYS_APLL_MNOD ((124 << 20) | (1 << 14) | (2 << 11) | (2<<5)) @@ -132,8 +131,10 @@ #define CONFIG_BAUDRATE 115200 #define CONFIG_SYS_UART_CONTROLLER_STEP 0x1000 -/*#define CONFIG_DDR_TEST_CPU -#define CONFIG_DDR_TEST*/ +/* +#define CONFIG_DDR_TEST_CPU +#define CONFIG_DDR_TEST +*/ #define CONFIG_DDR_INNOPHY #define CONFIG_DDR_PARAMS_CREATOR #define CONFIG_DDR_HOST_CC @@ -158,15 +159,21 @@ #define CONFIG_DDR_PHY_IMPEDANCE 40000 #define CONFIG_DDR_PHY_ODT_IMPEDANCE 50000 //75000 -/*#define CONFIG_DDR_PHY_IMPED_PULLUP 0xf*/ -/*#define CONFIG_DDR_PHY_IMPED_PULLDOWN 0xf*/ +/* +#define CONFIG_DDR_PHY_IMPED_PULLUP 0xf +#define CONFIG_DDR_PHY_IMPED_PULLDOWN 0xf +*/ -/* #define CONFIG_DDR_DLL_OFF */ +/* +#define CONFIG_DDR_DLL_OFF +*/ -/*#define CONFIG_DDR_CHIP_ODT*/ -/*#define CONFIG_DDR_PHY_ODT*/ -/*#define CONFIG_DDR_PHY_DQ_ODT*/ -/*#define CONFIG_DDR_PHY_DQS_ODT*/ +/* +#define CONFIG_DDR_CHIP_ODT +#define CONFIG_DDR_PHY_ODT +#define CONFIG_DDR_PHY_DQ_ODT +#define CONFIG_DDR_PHY_DQS_ODT +*/ /** * Boot arguments definitions. @@ -193,7 +200,7 @@ #if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" #elif defined(CONFIG_SFC_NOR) - #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" +#define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" #endif /** @@ -205,7 +212,7 @@ #if defined(CONFIG_SFC_NOR) #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" -#endif /* CONFIG_SFC_NOR */ +#endif /** * Drivers configuration. @@ -282,6 +289,7 @@ #define GMAC_PHY_RMII 2 #define GMAC_PHY_GMII 3 #define GMAC_PHY_RGMII 4 + #define CONFIG_NET_GMAC_PHY_MODE GMAC_PHY_RMII #define PHY_TYPE_DM9161 1 @@ -358,7 +366,7 @@ #define CONFIG_SYS_MAXARGS 64 #define CONFIG_SYS_LONGHELP #define CONFIG_SYS_PROMPT CONFIG_SYS_BOARD "# " -#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ +#define CONFIG_SYS_CBSIZE 1024 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) #define CONFIG_SYS_MONITOR_LEN (214 * 1024) @@ -382,7 +390,7 @@ #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_ENV_SIZE (32 << 10) #define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) -#elif CONFIG_ENV_IS_IN_SPI_FLASH +#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH) #define CONFIG_ENV_SECT_SIZE (1024 * 16) #define CONFIG_ENV_SIZE (1024 * 16) #define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN + CONFIG_UBOOT_OFFSET) @@ -456,11 +464,11 @@ /* USE MBR + zero-GPT-table instead if no gpt table defined*/ #define CONFIG_MBR_P0_OFF 64mb #define CONFIG_MBR_P0_END 556mb -#define CONFIG_MBR_P0_TYPE linux +#define CONFIG_MBR_P0_TYPE linux #define CONFIG_MBR_P1_OFF 580mb -#define CONFIG_MBR_P1_END 1604mb -#define CONFIG_MBR_P1_TYPE linux +#define CONFIG_MBR_P1_END 1604mb +#define CONFIG_MBR_P1_TYPE linux #define CONFIG_MBR_P2_OFF 28mb #define CONFIG_MBR_P2_END 58mb @@ -486,6 +494,12 @@ #define CONFIG_SYS_MAX_FLASH_SECT 0 #endif +/* + Platform Default GPIOs: +*/ +#define CONFIG_GPIO_SETTINGS \ + "" + #include "isvp_common.h" #endif /*__CONFIG_ISVP_T10_H__*/ diff --git a/include/configs/isvp_t31.h b/include/configs/isvp_t31.h index c9fb9bc1..3d6e85a4 100644 --- a/include/configs/isvp_t31.h +++ b/include/configs/isvp_t31.h @@ -55,61 +55,89 @@ #if defined(APLL_804M) #define CONFIG_SYS_APLL_FREQ 804000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_MNOD ((67 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(APLL_864M) #define CONFIG_SYS_APLL_FREQ 864000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_MNOD ((72 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(APLL_900M) #define CONFIG_SYS_APLL_FREQ 900000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_MNOD ((75 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(APLL_1000M) #define CONFIG_SYS_APLL_FREQ 1000000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_MNOD ((125 << 20) | (1 << 14) | (3 << 11) | (1 << 8)) #elif defined(APLL_1008M) #define CONFIG_SYS_APLL_FREQ 1008000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_MNOD ((84 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) +#elif defined(APLL_1104M) #define CONFIG_SYS_APLL_FREQ 1104000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_MNOD ((92 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(APLL_1200M) #define CONFIG_SYS_APLL_FREQ 1200000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_MNOD ((100 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(APLL_1392M) #define CONFIG_SYS_APLL_FREQ 1392000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_MNOD ((116 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(APLL_1400M) #define CONFIG_SYS_APLL_FREQ 1404000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_MNOD ((117 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(APLL_1500M) #define CONFIG_SYS_APLL_FREQ 1500000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_MNOD ((125 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(APLL_1800M) #define CONFIG_SYS_APLL_FREQ 1800000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_APLL_MNOD ((150 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #else #error please define APLL_FREQ #endif #if defined(DDR_400M) #define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((100 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(DDR_450M) #define CONFIG_SYS_MPLL_FREQ 900000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((75 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(DDR_500M) #define CONFIG_SYS_MPLL_FREQ 1000000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((125 << 20) | (1 << 14) | (3 << 11) | (1 << 8)) #elif defined(DDR_540M) #define CONFIG_SYS_MPLL_FREQ 1080000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((90 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(DDR_600M) #define CONFIG_SYS_MPLL_FREQ 1200000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((100 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(DDR_650M) #define CONFIG_SYS_MPLL_FREQ 1308000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((109 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(DDR_700M) #define CONFIG_SYS_MPLL_FREQ 1404000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((117 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(DDR_750M) #define CONFIG_SYS_MPLL_FREQ 1500000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((125 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(DDR_762M) #define CONFIG_SYS_MPLL_FREQ 1524000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((127 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(DDR_774M) #define CONFIG_SYS_MPLL_FREQ 1548000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((129 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(DDR_786M) #define CONFIG_SYS_MPLL_FREQ 1572000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((131 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(DDR_798M) #define CONFIG_SYS_MPLL_FREQ 1596000000 /*If APLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((133 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(DDR_800M) #define CONFIG_SYS_MPLL_FREQ 1608000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((134 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(DDR_810M) #define CONFIG_SYS_MPLL_FREQ 1620000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((135 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(DDR_816M) #define CONFIG_SYS_MPLL_FREQ 1632000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((136 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #elif defined(DDR_900M) #define CONFIG_SYS_MPLL_FREQ 1800000000 /*If MPLL is not used it must be set to 0*/ +#define CONFIG_SYS_MPLL_MNOD ((150 << 20) | (1 << 14) | (2 << 11) | (1 << 8)) #else #error please define DDR_FREQ #endif @@ -251,8 +279,10 @@ #define CONFIG_BAUDRATE 115200 #define CONFIG_SYS_UART_CONTROLLER_STEP 0x1000 -/*#define CONFIG_DDR_TEST_CPU -#define CONFIG_DDR_TEST*/ +/* +#define CONFIG_DDR_TEST_CPU +#define CONFIG_DDR_TEST +*/ #define CONFIG_DDR_INNOPHY #define CONFIG_DDR_PARAMS_CREATOR #define CONFIG_DDR_HOST_CC @@ -277,21 +307,26 @@ #define CONFIG_DDR_PHY_IMPEDANCE 40000 #define CONFIG_DDR_PHY_ODT_IMPEDANCE 50000 //75000 -/*#define CONFIG_DDR_PHY_IMPED_PULLUP 0xf*/ -/*#define CONFIG_DDR_PHY_IMPED_PULLDOWN 0xf*/ +/* +#define CONFIG_DDR_PHY_IMPED_PULLUP 0xf +#define CONFIG_DDR_PHY_IMPED_PULLDOWN 0xf +*/ -/* #define CONFIG_DDR_DLL_OFF */ +/* +#define CONFIG_DDR_DLL_OFF +*/ -/*#define CONFIG_DDR_CHIP_ODT*/ -/*#define CONFIG_DDR_PHY_ODT*/ -/*#define CONFIG_DDR_PHY_DQ_ODT*/ -/*#define CONFIG_DDR_PHY_DQS_ODT*/ +/* +#define CONFIG_DDR_CHIP_ODT +#define CONFIG_DDR_PHY_ODT +#define CONFIG_DDR_PHY_DQ_ODT +#define CONFIG_DDR_PHY_DQS_ODT +*/ /* Device Tree Configuration*/ -#if 0 +/* #define CONFIG_OF_LIBFDT 1 -#endif -#ifdef CONFIG_OF_LIBFDT +*/ #if defined(CONFIG_OF_LIBFDT) #define IMAGE_ENABLE_OF_LIBFDT 1 #define CONFIG_LMB @@ -323,11 +358,12 @@ #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" #elif defined(CONFIG_SFC_NOR) #if defined(CONFIG_OF_LIBFDT) +#define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:320k(boot),2496k(kernel),2048k(root),64k(dtb),-(appfs)" #else - #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" +#define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" #endif #elif defined(CONFIG_SFC_NAND) - #define CONFIG_BOOTARGS BOOTARGS_COMMON " ip=off init=/linuxrc ubi.mtd=2 root=ubi0:rootfs ubi.mtd=3 rootfstype=ubifs rw" +#define CONFIG_BOOTARGS BOOTARGS_COMMON " ip=off init=/linuxrc ubi.mtd=2 root=ubi0:rootfs ubi.mtd=3 rootfstype=ubifs rw" #endif /** @@ -343,7 +379,7 @@ #else #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" #endif -#endif /* CONFIG_SFC_NOR */ +#endif #if defined(CONFIG_SFC_NAND) #define CONFIG_BOOTCOMMAND "nand read 0x80600000 0x100000 0x800000;bootm 0x80600000" @@ -390,7 +426,7 @@ #if defined(CONFIG_SPL_SFC_NAND) || defined(CONFIG_SFC_NAND_COMMAND) #define CONFIG_NAND_BURNER #define CONFIG_SFC_NAND_RATE 100000000 -#define CONFIG_SPIFLASH_PART_OFFSET (26 * 1024) +#define CONFIG_SPIFLASH_PART_OFFSET CONFIG_SPL_MAX_SIZE #define CONFIG_SPI_NAND_BPP (2048 + 64) /*Bytes Per Page*/ #define CONFIG_SPI_NAND_PPB (64) /*Page Per Block*/ #define CONFIG_MTD_SFCNAND @@ -406,31 +442,29 @@ #define CONFIG_MTD_PARTITIONS #define MTDIDS_DEFAULT "nand0=nand" #define MTDPARTS_DEFAULT "mtdparts=nand:1M(boot),8M(kernel),40M(rootfs),-(data)" -#if 1 #define CONFIG_SPI_STANDARD //if the nand is QUAD mode, please annotate it. the default is one lan. -#endif #if defined(CONFIG_SPL_SFC_SUPPORT) /*SFCNAND env*/ /* spi nand environment */ #define CONFIG_SYS_REDUNDAND_ENVIRONMENT -#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K*/ +#define CONFIG_ENV_SECT_SIZE 0x20000 #define SPI_NAND_BLK 0x20000 /*the spi nand block size */ -#define CONFIG_ENV_SIZE SPI_NAND_BLK /* uboot is 1M but the last block size is the env*/ -#define CONFIG_ENV_OFFSET 0xC0000 /* offset is 768k */ +#define CONFIG_ENV_SIZE SPI_NAND_BLK +#define CONFIG_ENV_OFFSET 0xC0000 #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) #define CONFIG_ENV_IS_IN_SFC_NAND #endif /* MTD support */ #define CONFIG_SYS_NAND_SELF_INIT -#define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE /*(26 * 1024)*/ +#define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE #elif defined(CONFIG_SPL_SFC_NOR) #define CONFIG_CMD_SF #define CONFIG_SPI_FLASH_INGENIC #define CONFIG_SPI_FLASH -#define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE /*(26 * 1024)*/ +#define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE #endif #endif /* CONFIG_SPL_SFC_SUPPORT */ @@ -502,7 +536,7 @@ #define CONFIG_CMD_USB #if defined(CONFIG_CMD_USB) #define CONFIG_USB_DWC2 -#define CONFIG_USB_DWC2_REG_ADDR 0x13500000 +#define CONFIG_USB_DWC2_REG_ADDR 0x13500000 #define CONFIG_USB_HOST_ETHER #define CONFIG_USB_ETHER_ASIX #define CONFIG_USB_STORAGE @@ -534,7 +568,7 @@ #define CONFIG_SYS_MAXARGS 64 #define CONFIG_SYS_LONGHELP #define CONFIG_SYS_PROMPT CONFIG_SYS_BOARD "# " -#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ +#define CONFIG_SYS_CBSIZE 1024 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) #if defined(CONFIG_SFC_NAND) || defined(CONFIG_SFC_NAND_COMMAND) @@ -545,7 +579,7 @@ #else #define CONFIG_SYS_MONITOR_LEN (214 * 1024) #endif -#endif /* CONFIG_SFC_NAND || CONFIG_SFC_NAND_COMMOD */ +#endif #define CONFIG_SYS_MALLOC_LEN (32 * 1024 * 1024) #define CONFIG_SYS_BOOTPARAMS_LEN (128 * 1024) @@ -674,8 +708,6 @@ #define CONFIG_SYS_MAX_FLASH_SECT 0 #endif -#include "isvp_common.h" - /* Platform Default GPIOs: @@ -688,4 +720,6 @@ "gpio_dev=62O\0" \ "gpio_dev_net=61o 48o\0" +#include "isvp_common.h" + #endif /*__CONFIG_ISVP_T10_H__*/ From 77b39cee124e7a9c5d44b5e9d05adf393df9120a Mon Sep 17 00:00:00 2001 From: Paul Philippov Date: Sun, 7 Jan 2024 06:03:29 -0500 Subject: [PATCH 06/19] fix if else endif --- include/configs/isvp_t31.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/configs/isvp_t31.h b/include/configs/isvp_t31.h index 3d6e85a4..3418b08d 100644 --- a/include/configs/isvp_t31.h +++ b/include/configs/isvp_t31.h @@ -375,14 +375,14 @@ #if defined(CONFIG_SFC_NOR) #if defined(CONFIG_OF_LIBFDT) - #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x50000 0x270000;sf read 0x83000000 0x540000 0x10000;bootm 0x80600000 - 0x83000000" +#define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x50000 0x270000;sf read 0x83000000 0x540000 0x10000;bootm 0x80600000 - 0x83000000" #else - #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" +#define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" #endif #endif #if defined(CONFIG_SFC_NAND) - #define CONFIG_BOOTCOMMAND "nand read 0x80600000 0x100000 0x800000;bootm 0x80600000" +#define CONFIG_BOOTCOMMAND "nand read 0x80600000 0x100000 0x800000;bootm 0x80600000" #endif /** @@ -404,7 +404,6 @@ #define CONFIG_SFC_NOR_COMMAND /* support nor command */ #else #define CONFIG_SFC_NAND_COMMAND /* support nand command */ -#endif #endif /* CONFIG_SFC_COMMAND */ #if defined(CONFIG_SFC_NOR_COMMAND) From 081977d4d1a5f6d4ca4a05c309a4ce83f0818c37 Mon Sep 17 00:00:00 2001 From: Paul Philippov Date: Sun, 7 Jan 2024 12:13:54 -0500 Subject: [PATCH 07/19] cleaned overrides --- include/configs/isvp_common.h | 49 ++++++++++++++++- include/configs/isvp_t10.h | 67 ++++++++++++---------- include/configs/isvp_t20.h | 66 ++++++++++++---------- include/configs/isvp_t21.h | 89 +++++++++++++++++++----------- include/configs/isvp_t30.h | 8 +-- include/configs/isvp_t31.h | 101 ++++++++++++++++++++-------------- 6 files changed, 241 insertions(+), 139 deletions(-) diff --git a/include/configs/isvp_common.h b/include/configs/isvp_common.h index 11df0bfa..4441756a 100644 --- a/include/configs/isvp_common.h +++ b/include/configs/isvp_common.h @@ -22,7 +22,7 @@ #define CONFIG_SYS_PROMPT "OpenIPC # " #define CONFIG_AUTOBOOT_KEYED -#define CONFIG_AUTOBOOT_PROMPT "Press Ctrl-c to abort autoboot... %d \n", bootdelay +#define CONFIG_AUTOBOOT_PROMPT "Press Ctrl-c to abort autoboot... %d %d\n", bootdelay #define CONFIG_AUTOBOOT_STOP_STR "\x3" #define CONFIG_SYS_LONGHELP @@ -59,6 +59,49 @@ #define CONFIG_CMD_SDSTART 1 +/** + * Command configuration. + */ + +/* +#define CONFIG_AUTO_COMPLETE +#define CONFIG_CMD_BOOTD +#define CONFIG_CMD_CONSOLE +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_ECHO +#define CONFIG_CMD_EXT2 +#define CONFIG_CMD_EXT4 +#define CONFIG_CMD_FLASH +#define CONFIG_CMD_FLOCK +#define CONFIG_CMD_GETTIME +#define CONFIG_CMD_I2C +#define CONFIG_CMD_JFFS2 +#define CONFIG_CMD_LOADB +#define CONFIG_CMD_LOADS +#define CONFIG_CMD_MEMORY +#define CONFIG_CMD_MISC +#define CONFIG_CMD_MMC +#define CONFIG_CMD_MTDPARTS +#define CONFIG_CMD_NET +#define CONFIG_CMD_PING +#define CONFIG_CMD_RUN +#define CONFIG_CMD_SAVEENV +#define CONFIG_CMD_SF +#define CONFIG_CMD_SOURCE +#define CONFIG_CMD_TFTPDOWNLOAD +#define CONFIG_CMD_USB +#define CONFIG_CMD_WATCHDOG + +#if defined(CONFIG_SPL_SFC_NAND) || defined(CONFIG_SFC_NAND_COMMAND) +#define CONFIG_CMD_MTDPARTS +#define CONFIG_CMD_NAND +#define CONFIG_CMD_SFCNAND +#define CONFIG_CMD_SFC_NAND +#define CONFIG_CMD_UBI +#define CONFIG_CMD_UBIFS +#endif +*/ + #if defined(CONFIG_DDR2_128M) || defined(CONFIG_DDR3_128M) #define CONFIG_EXTRA_SETTINGS \ "totalmem=128M\0" \ @@ -94,8 +137,8 @@ #endif #define CONFIG_BOOTARGS \ -"mem=\${osmem} rmem=\${rmem} console=\${serialport},\${baudrate}n8" \ -" panic=\${panic_timeout} root=/dev/mtdblock3 rootfstype=squashfs init=/init" \ +"mem=\\${osmem} rmem=\\${rmem} console=\\${serialport},\\${baudrate}n8" \ +" panic=\\${panic_timeout} root=/dev/mtdblock3 rootfstype=squashfs init=/init" \ " mtdparts=jz_sfc:256k(boot),64k(env),\\${kern_size}(kernel),\\${rootfs_size}(rootfs),-(rootfs_data)" #define CONFIG_EXTRA_ENV_SETTINGS \ diff --git a/include/configs/isvp_t10.h b/include/configs/isvp_t10.h index 6a3b6aa4..d2b7d384 100644 --- a/include/configs/isvp_t10.h +++ b/include/configs/isvp_t10.h @@ -88,7 +88,6 @@ #define CONFIG_DDR_TEST_CPU #define CONFIG_DDR_TEST */ - #define CONFIG_DDR_PARAMS_CREATOR #define CONFIG_DDR_HOST_CC #define CONFIG_DDR_FORCE_SELECT_CS1 @@ -101,7 +100,7 @@ #define CONFIG_DDR_TYPE_DDR2 #define CONFIG_DDR_PHY_IMPEDANCE 40000 -#define CONFIG_DDR_PHY_ODT_IMPEDANCE 50000 //75000 +#define CONFIG_DDR_PHY_ODT_IMPEDANCE 50000 /* 75000 */ /* #define CONFIG_DDR_PHY_IMPED_PULLUP 0xf #define CONFIG_DDR_PHY_IMPED_PULLDOWN 0xf @@ -123,11 +122,13 @@ */ #define BOOTARGS_COMMON "console=ttyS1,115200n8 mem=39M@0x0 ispmem=5M@0x2700000 rmem=20M@0x2c00000" +/* #if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" #elif defined(CONFIG_SFC_NOR) #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" #endif +*/ /** * Boot command definitions. @@ -136,9 +137,11 @@ #define CONFIG_BOOTCOMMAND "mmc read 0x80600000 0x1800 0x3000; bootm 0x80600000" #endif +/* #if defined(CONFIG_SFC_NOR) #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" #endif +*/ /** * Drivers configuration. @@ -163,7 +166,7 @@ #define CONFIG_SFC_NOR #define CONFIG_SPI_FLASH_INGENIC #define CONFIG_SPI_DUAL -/*#define CONFIG_SPI_QUAD*/ +/* #define CONFIG_SPI_QUAD */ #endif /* SFC */ @@ -172,7 +175,7 @@ #define CONFIG_SPI_SPL_CHECK #define CONFIG_JZ_SFC_PA #if defined(CONFIG_SPI_NAND) -#define CONFIG_UBOOT_OFFSET (26 * 1024) +#define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE #define CONFIG_SPI_NAND_BPP (2048 + 64) /*Bytes Per Page*/ #define CONFIG_SPI_NAND_PPB (64) /*Page Per Block*/ #define CONFIG_SPL_SFC_NAND @@ -184,10 +187,10 @@ #define CONFIG_CMD_SF #define CONFIG_SPI_FLASH_INGENIC #define CONFIG_SPI_FLASH -#define CONFIG_UBOOT_OFFSET (26 * 1024) +#define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE #define CONFIG_SPL_SFC_NOR #define CONFIG_SPI_DUAL -/*#define CONFIG_SPI_QUAD*/ +/* #define CONFIG_SPI_QUAD */ #endif #endif /* CONFIG_SPL_SFC_SUPPORT */ @@ -229,28 +232,31 @@ /** * Command configuration. */ -#define CONFIG_CMD_NET /* networking support */ +#define CONFIG_CMD_TFTPDOWNLOAD +/* #define CONFIG_CMD_WATCHDOG */ +#define CONFIG_CMD_NET #define CONFIG_CMD_DHCP #define CONFIG_CMD_PING -#define CONFIG_CMD_BOOTD /* bootd */ -#define CONFIG_CMD_SAVEENV /* saveenv */ - -#define CONFIG_CMD_CONSOLE /* coninfo */ -#define CONFIG_CMD_ECHO /* echo arguments */ -#define CONFIG_CMD_FAT /* FAT support */ +#define CONFIG_CMD_BOOTD +#define CONFIG_CMD_SAVEENV +#define CONFIG_CMD_CONSOLE +#define CONFIG_CMD_ECHO +/* #define CONFIG_CMD_FAT */ #define CONFIG_CMD_EXT2 #define CONFIG_CMD_EXT4 -#define CONFIG_CMD_LOADB /* loadb */ -#define CONFIG_CMD_LOADS /* loads */ -#define CONFIG_CMD_MEMORY /* md mm nm mw cp cmp crc base loop mtest */ -#define CONFIG_CMD_MISC /* Misc functions like sleep etc*/ -#define CONFIG_CMD_MMC /* MMC/SD support */ -#define CONFIG_CMD_RUN /* run command in env variable */ -#define CONFIG_CMD_SOURCE /* "source" command support */ +/* #define CONFIG_CMD_JFFS2 */ +#define CONFIG_CMD_LOADB +#define CONFIG_CMD_LOADS +#define CONFIG_CMD_MEMORY +#define CONFIG_CMD_MISC +#define CONFIG_CMD_MMC +#define CONFIG_CMD_RUN +#define CONFIG_CMD_SOURCE #define CONFIG_CMD_GETTIME #define CONFIG_CMDLINE_EDITING #define CONFIG_AUTO_COMPLETE -/*#define CONFIG_CMD_I2C*/ +/* #define CONFIG_CMD_I2C */ +/* #define CONFIG_CMD_FLOCK */ /************************ USB CONFIG ***************************/ #define CONFIG_CMD_USB @@ -288,12 +294,14 @@ #define CONFIG_SYS_MAXARGS 64 #define CONFIG_SYS_LONGHELP #define CONFIG_SYS_PROMPT CONFIG_SYS_BOARD "# " -#define CONFIG_SYS_CBSIZE 1024 +/* #define CONFIG_SYS_CBSIZE 1024 */ #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) +/* #define CONFIG_SYS_MONITOR_LEN (214 * 1024) #define CONFIG_SYS_MALLOC_LEN (32 * 1024 * 1024) #define CONFIG_SYS_BOOTPARAMS_LEN (128 * 1024) +*/ #define CONFIG_SYS_SDRAM_BASE 0x80000000 /* cached (KSEG0) address */ #define CONFIG_SYS_SDRAM_MAX_TOP 0x84000000 /* don't run into IO space */ @@ -308,6 +316,7 @@ /** * Environment */ +/* #if defined(CONFIG_ENV_IS_IN_MMC) #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_ENV_SIZE (32 << 10) @@ -321,6 +330,7 @@ #define CONFIG_ENV_SIZE (32 << 10) #define CONFIG_ENV_OFFSET (CONFIG_SYS_NAND_BLOCK_SIZE * 5) #endif +*/ /** * SPL configuration @@ -337,9 +347,12 @@ #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/$(SOC)/u-boot-spl.lds" #endif /* CONFIG_SPL_NOR_SUPPORT */ -#define CONFIG_SPL_PAD_TO 26624 /* equal to spl max size in M200 */ +#define CONFIG_SPL_PAD_TO 26624 +#define CONFIG_SPL_MAX_SIZE (26 * 1024) -#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 86 //0x5A //wli changed 0x20 /* 16KB offset */ +#define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE +#define CONFIG_MMC_RAW_UBOOT_OFFSET (CONFIG_UBOOT_OFFSET / 1024 + 17) +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR (CONFIG_MMC_RAW_UBOOT_OFFSET * 2) #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400 /* 512 KB */ #define CONFIG_SPL_BOARD_INIT @@ -352,8 +365,6 @@ #define CONFIG_SPL_TEXT_BASE 0x80001000 #endif /*CONFIG_SPL_NOR_SUPPORT*/ -#define CONFIG_SPL_MAX_SIZE (26 * 1024) - #define CONFIG_SPL_LZOP #if defined(CONFIG_SPL_LZOP) #define CONFIG_DECMP_BUFFER_ADRS 0x80200000 @@ -418,10 +429,6 @@ /* Platform Default GPIOs: - - hichip_mmc_enable = 62 - pps_mmc_enable = 61 - wyze_mmc_enable = 48 */ #define CONFIG_GPIO_SETTINGS \ diff --git a/include/configs/isvp_t20.h b/include/configs/isvp_t20.h index 813775b5..56284441 100644 --- a/include/configs/isvp_t20.h +++ b/include/configs/isvp_t20.h @@ -105,7 +105,7 @@ #define CONFIG_DDR_TYPE_DDR2 #define CONFIG_DDR_PHY_IMPEDANCE 40000 -#define CONFIG_DDR_PHY_ODT_IMPEDANCE 50000 //75000 +#define CONFIG_DDR_PHY_ODT_IMPEDANCE 50000 /* 75000 */ /* #define CONFIG_DDR_PHY_IMPED_PULLUP 0xf #define CONFIG_DDR_PHY_IMPED_PULLDOWN 0xf @@ -131,11 +131,13 @@ #define BOOTARGS_COMMON "console=ttyS1,115200n8 mem=32M@0x0 ispmem=8M@0x2000000 rmem=24M@0x2800000" #endif +/* #if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" #elif defined(CONFIG_SFC_NOR) #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" #endif +*/ /** * Boot command definitions. @@ -144,9 +146,11 @@ #define CONFIG_BOOTCOMMAND "mmc read 0x80600000 0x1800 0x3000; bootm 0x80600000" #endif +/* #if defined(CONFIG_SFC_NOR) #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" #endif +*/ /** * Drivers configuration. @@ -171,7 +175,7 @@ #define CONFIG_SFC_NOR #define CONFIG_SPI_FLASH_INGENIC #define CONFIG_SPI_DUAL -/*#define CONFIG_SPI_QUAD*/ +/* #define CONFIG_SPI_QUAD */ #endif /* SFC */ @@ -180,7 +184,7 @@ #define CONFIG_SPI_SPL_CHECK #define CONFIG_JZ_SFC_PA #if defined(CONFIG_SPI_NAND) -#define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE /*(26 * 1024)*/ +#define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE #define CONFIG_SPI_NAND_BPP (2048 + 64) /*Bytes Per Page*/ #define CONFIG_SPI_NAND_PPB (64) /*Page Per Block*/ #define CONFIG_SPL_SFC_NAND @@ -192,10 +196,10 @@ #define CONFIG_CMD_SF #define CONFIG_SPI_FLASH_INGENIC #define CONFIG_SPI_FLASH -#define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE /*(26 * 1024)*/ +#define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE #define CONFIG_SPL_SFC_NOR #define CONFIG_SPI_DUAL -/*#define CONFIG_SPI_QUAD*/ +/* #define CONFIG_SPI_QUAD */ #endif #endif /* CONFIG_SPL_SFC_SUPPORT */ @@ -237,32 +241,35 @@ /** * Command configuration. */ -#define CONFIG_CMD_NET /* networking support */ +#define CONFIG_CMD_TFTPDOWNLOAD +/* #define CONFIG_CMD_WATCHDOG */ +#define CONFIG_CMD_NET #define CONFIG_CMD_DHCP #define CONFIG_CMD_PING -#define CONFIG_CMD_BOOTD /* bootd */ -#define CONFIG_CMD_SAVEENV /* saveenv */ - -#define CONFIG_CMD_CONSOLE /* coninfo */ -#define CONFIG_CMD_ECHO /* echo arguments */ -#define CONFIG_CMD_FAT /* FAT support */ +#define CONFIG_CMD_BOOTD +#define CONFIG_CMD_SAVEENV +#define CONFIG_CMD_CONSOLE +#define CONFIG_CMD_ECHO +/* #define CONFIG_CMD_FAT */ #define CONFIG_CMD_EXT2 #define CONFIG_CMD_EXT4 -#define CONFIG_CMD_LOADB /* loadb */ -#define CONFIG_CMD_LOADS /* loads */ -#define CONFIG_CMD_MEMORY /* md mm nm mw cp cmp crc base loop mtest */ -#define CONFIG_CMD_MISC /* Misc functions like sleep etc*/ -#define CONFIG_CMD_MMC /* MMC/SD support */ -#define CONFIG_CMD_RUN /* run command in env variable */ -#define CONFIG_CMD_SOURCE /* "source" command support */ +/* #define CONFIG_CMD_JFFS2 */ +#define CONFIG_CMD_LOADB +#define CONFIG_CMD_LOADS +#define CONFIG_CMD_MEMORY +#define CONFIG_CMD_MISC +#define CONFIG_CMD_MMC +#define CONFIG_CMD_RUN +#define CONFIG_CMD_SOURCE #define CONFIG_CMD_GETTIME #define CONFIG_CMDLINE_EDITING #define CONFIG_AUTO_COMPLETE -/*#define CONFIG_CMD_I2C*/ +/* #define CONFIG_CMD_I2C */ +/* #define CONFIG_CMD_FLOCK */ /************************ USB CONFIG ***************************/ +#define CONFIG_CMD_USB #if defined(CONFIG_CMD_USB) -#ifdef CONFIG_CMD_USB #define CONFIG_USB_DWC2 #define CONFIG_USB_DWC2_REG_ADDR 0x13500000 #define CONFIG_USB_HOST_ETHER @@ -296,12 +303,14 @@ #define CONFIG_SYS_MAXARGS 64 #define CONFIG_SYS_LONGHELP #define CONFIG_SYS_PROMPT CONFIG_SYS_BOARD "# " -#define CONFIG_SYS_CBSIZE 1024 +/* #define CONFIG_SYS_CBSIZE 1024 */ #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) +/* #define CONFIG_SYS_MONITOR_LEN (214 * 1024) #define CONFIG_SYS_MALLOC_LEN (32 * 1024 * 1024) #define CONFIG_SYS_BOOTPARAMS_LEN (128 * 1024) +*/ #define CONFIG_SYS_SDRAM_BASE 0x80000000 /* cached (KSEG0) address */ #define CONFIG_SYS_SDRAM_MAX_TOP 0x84000000 /* don't run into IO space */ @@ -316,6 +325,7 @@ /** * Environment */ +/* #if defined(CONFIG_ENV_IS_IN_MMC) #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_ENV_SIZE (32 << 10) @@ -329,6 +339,7 @@ #define CONFIG_ENV_SIZE (32 << 10) #define CONFIG_ENV_OFFSET (CONFIG_SYS_NAND_BLOCK_SIZE * 5) #endif +*/ /** * SPL configuration @@ -345,11 +356,12 @@ #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/$(SOC)/u-boot-spl.lds" #endif /* CONFIG_SPL_NOR_SUPPORT */ -#define CONFIG_SPL_PAD_TO 26624 /* equal to spl max size in M200 */ +#define CONFIG_SPL_PAD_TO 26624 +#define CONFIG_SPL_MAX_SIZE (26 * 1024) #define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE #define CONFIG_MMC_RAW_UBOOT_OFFSET (CONFIG_UBOOT_OFFSET / 1024 + 17) -#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR (CONFIG_MMC_RAW_UBOOT_OFFSET * 2)//0x5A //wli changed 0x20 /* 16KB offset */ +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR (CONFIG_MMC_RAW_UBOOT_OFFSET * 2) #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400 /* 512 KB */ #define CONFIG_SPL_BOARD_INIT @@ -362,8 +374,6 @@ #define CONFIG_SPL_TEXT_BASE 0x80001000 #endif /*CONFIG_SPL_NOR_SUPPORT*/ -#define CONFIG_SPL_MAX_SIZE (26 * 1024) - #define CONFIG_SPL_LZOP #if defined(CONFIG_SPL_LZOP) #define CONFIG_DECMP_BUFFER_ADRS 0x80200000 @@ -435,8 +445,8 @@ */ #define CONFIG_GPIO_SETTINGS \ - "gpio_dev=47O\0" \ - "gpio_dev_net=43O 48o 43o\0" +"gpio_dev=47O\0" \ +"gpio_dev_net=43O 48o 43o\0" #include "isvp_common.h" diff --git a/include/configs/isvp_t21.h b/include/configs/isvp_t21.h index 6dbf72f7..f113eeff 100644 --- a/include/configs/isvp_t21.h +++ b/include/configs/isvp_t21.h @@ -149,10 +149,11 @@ #endif #define DDR2_CHIP_DRIVER_OUT_STRENGTH 0 + #define DDR2_CHIP_MR0_DLL_RST #define CONFIG_DDR_PHY_IMPEDANCE 40000 -#define CONFIG_DDR_PHY_ODT_IMPEDANCE 50000 //75000 +#define CONFIG_DDR_PHY_ODT_IMPEDANCE 50000 /* 75000 */ /* #define CONFIG_DDR_PHY_IMPED_PULLUP 0xf #define CONFIG_DDR_PHY_IMPED_PULLDOWN 0xf @@ -179,7 +180,7 @@ #endif #if defined(CONFIG_SPL_SFC_NOR) || defined(CONFIG_SPL_SFC_NAND) -#define CONFIG_SPL_SFC_SUPPORT +/*#define CONFIG_SPL_SFC_SUPPORT*/ #define CONFIG_JZ_SFC #define CONFIG_SPL_VERSION 1 #if defined(CONFIG_SPL_SFC_NOR) @@ -191,11 +192,13 @@ /*#define CONFIG_SPI_QUAD*/ #endif /* defined(CONFIG_SPL_SFC_NOR) || defined(CONFIG_SPL_SFC_NAND) */ +/* #if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" #elif defined(CONFIG_SFC_NOR) #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2560k(kernel),2048k(root),-(appfs)" #endif +*/ /** * Boot command definitions. @@ -204,9 +207,11 @@ #define CONFIG_BOOTCOMMAND "mmc read 0x80600000 0x1800 0x3000; bootm 0x80600000" #endif +/* #if defined(CONFIG_SFC_NOR) #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" #endif +*/ /** * Drivers configuration. @@ -223,13 +228,15 @@ #define CONFIG_JZ_MMC_MSC0_PB 1 #endif -#if defined(CONFIG_SFC_COMMAND) /* SD card start */ -#if 1 -#define CONFIG_SFC_NOR_COMMAND /* support nor command */ +/* +#if defined(CONFIG_SFC_COMMAND) +*/ +#define CONFIG_SFC_NOR_COMMAND +/* #else -#define CONFIG_SFC_NAND_COMMAND /* support nand command */ +#define CONFIG_SFC_NAND_COMMAND #endif -#endif /* CONFIG_SFC_COMMAND */ +*/ #if defined(CONFIG_SFC_NOR_COMMAND) #define CONFIG_CMD_SF @@ -248,7 +255,7 @@ #define CONFIG_SPI_SPL_CHECK #define CONFIG_JZ_SFC_PA #if defined(CONFIG_SPI_NAND) -#define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE /*(26 * 1024)*/ +#define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE #define CONFIG_SPI_NAND_BPP (2048 + 64) /*Bytes Per Page*/ #define CONFIG_SPI_NAND_PPB (64) /*Page Per Block*/ #define CONFIG_SPL_SFC_NAND @@ -261,9 +268,9 @@ #define CONFIG_SPI_FLASH_INGENIC #define CONFIG_SPI_FLASH #define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE /*(26 * 1024)*/ -#define CONFIG_SPL_SFC_NOR +/* #define CONFIG_SPL_SFC_NOR */ #define CONFIG_SPI_DUAL -/*#define CONFIG_SPI_QUAD*/ +/* #define CONFIG_SPI_QUAD */ #endif #endif /* CONFIG_SPL_SFC_SUPPORT */ @@ -320,25 +327,36 @@ /** * Command configuration. */ -#define CONFIG_CMD_NET /* networking support */ +/* +#ifdef CONFIG_SFC_NOR +#define CONFIG_CMD_TFTPDOWNLOAD 1 +#endif +*/ +/*#define CONFIG_CMD_WATCHDOG*/ +#define CONFIG_CMD_NET +#define CONFIG_CMD_DHCP #define CONFIG_CMD_PING -#define CONFIG_CMD_BOOTD /* bootd */ -#define CONFIG_CMD_SAVEENV /* saveenv */ - -#define CONFIG_CMD_CONSOLE /* coninfo */ -#define CONFIG_CMD_ECHO /* echo arguments */ -#define CONFIG_CMD_FAT /* FAT support */ -#define CONFIG_CMD_LOADB /* loadb */ -#define CONFIG_CMD_LOADS /* loads */ -#define CONFIG_CMD_MEMORY /* md mm nm mw cp cmp crc base loop mtest */ -#define CONFIG_CMD_MISC /* Misc functions like sleep etc*/ -#define CONFIG_CMD_MMC /* MMC/SD support */ -#define CONFIG_CMD_RUN /* run command in env variable */ -#define CONFIG_CMD_SOURCE /* "source" command support */ +#define CONFIG_CMD_BOOTD +#define CONFIG_CMD_SAVEENV + +#define CONFIG_CMD_CONSOLE +#define CONFIG_CMD_ECHO +/* #define CONFIG_CMD_FAT */ +#define CONFIG_CMD_EXT2 +#define CONFIG_CMD_EXT4 +/* #define CONFIG_CMD_JFFS2 */ +#define CONFIG_CMD_LOADB +#define CONFIG_CMD_LOADS +#define CONFIG_CMD_MEMORY +#define CONFIG_CMD_MISC +#define CONFIG_CMD_MMC +#define CONFIG_CMD_RUN +#define CONFIG_CMD_SOURCE #define CONFIG_CMD_GETTIME #define CONFIG_CMDLINE_EDITING #define CONFIG_AUTO_COMPLETE -/*#define CONFIG_CMD_I2C*/ +/* #define CONFIG_CMD_I2C */ +/* #define CONFIG_CMD_FLOCK */ /************************ USB CONFIG ***************************/ #define CONFIG_CMD_USB @@ -376,12 +394,14 @@ #define CONFIG_SYS_MAXARGS 64 #define CONFIG_SYS_LONGHELP #define CONFIG_SYS_PROMPT CONFIG_SYS_BOARD "# " -#define CONFIG_SYS_CBSIZE 1024 +/* #define CONFIG_SYS_CBSIZE 1024 */ #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) +/* #define CONFIG_SYS_MONITOR_LEN (214 * 1024) #define CONFIG_SYS_MALLOC_LEN (32 * 1024 * 1024) -#define CONFIG_SYS_BOOTPARAMS_LEN (128 * 1024) +*/ +/* #define CONFIG_SYS_BOOTPARAMS_LEN (128 * 1024) */ #define CONFIG_SYS_SDRAM_BASE 0x80000000 /* cached (KSEG0) address */ #define CONFIG_SYS_SDRAM_MAX_TOP 0x84000000 /* don't run into IO space */ @@ -396,6 +416,7 @@ /** * Environment */ +/* #if defined(CONFIG_ENV_IS_IN_MMC) #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_ENV_SIZE (32 << 10) @@ -409,6 +430,7 @@ #define CONFIG_ENV_SIZE (32 << 10) #define CONFIG_ENV_OFFSET (CONFIG_SYS_NAND_BLOCK_SIZE * 5) #endif +*/ /** * SPL configuration @@ -425,9 +447,12 @@ #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/$(SOC)/u-boot-spl.lds" #endif /* CONFIG_SPL_NOR_SUPPORT */ -#define CONFIG_SPL_PAD_TO 26624 /* equal to spl max size in M200 */ +#define CONFIG_SPL_PAD_TO 26624 +#define CONFIG_SPL_MAX_SIZE (26 * 1024) -#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 86 //0x5A //wli changed 0x20 /* 16KB offset */ +#define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE +#define CONFIG_MMC_RAW_UBOOT_OFFSET (CONFIG_UBOOT_OFFSET / 1024 + 17) +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR (CONFIG_MMC_RAW_UBOOT_OFFSET * 2) #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400 /* 512 KB */ #define CONFIG_SPL_BOARD_INIT @@ -440,8 +465,6 @@ #define CONFIG_SPL_TEXT_BASE 0x80001000 #endif /*CONFIG_SPL_NOR_SUPPORT*/ -#define CONFIG_SPL_MAX_SIZE (26 * 1024) - #define CONFIG_SPL_LZOP #if defined(CONFIG_SPL_LZOP) #define CONFIG_DECMP_BUFFER_ADRS 0x80200000 @@ -459,7 +482,7 @@ #if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT -#define CONFIG_SYS_UBOOT_BASE (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_PAD_TO - 0x40) //0x40 = sizeof (image_header) +#define CONFIG_SYS_UBOOT_BASE (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_PAD_TO - 0x40) /* 0x40 = sizeof (image_header) */ #define CONFIG_SYS_OS_BASE 0 #define CONFIG_SYS_SPL_ARGS_ADDR 0 #define CONFIG_SYS_FDT_BASE 0 @@ -509,7 +532,7 @@ */ #define CONFIG_GPIO_SETTINGS \ - "" +"" #include "isvp_common.h" diff --git a/include/configs/isvp_t30.h b/include/configs/isvp_t30.h index 9f83240d..4beaeca0 100644 --- a/include/configs/isvp_t30.h +++ b/include/configs/isvp_t30.h @@ -158,7 +158,7 @@ #define DDR2_CHIP_DRIVER_OUT_STRENGTH 0 #define CONFIG_DDR_PHY_IMPEDANCE 40000 -#define CONFIG_DDR_PHY_ODT_IMPEDANCE 50000 //75000 +#define CONFIG_DDR_PHY_ODT_IMPEDANCE 50000 /* 75000 */ /* #define CONFIG_DDR_PHY_IMPED_PULLUP 0xf #define CONFIG_DDR_PHY_IMPED_PULLDOWN 0xf @@ -185,7 +185,7 @@ #endif #if defined(CONFIG_SPL_SFC_NOR) || defined(CONFIG_SPL_SFC_NAND) -#define CONFIG_SPL_SFC_SUPPORT +/*#define CONFIG_SPL_SFC_SUPPORT*/ #define CONFIG_JZ_SFC #define CONFIG_SPL_VERSION 1 #if defined(CONFIG_SPL_SFC_NOR) @@ -259,7 +259,7 @@ #define CONFIG_SPI_FLASH_INGENIC #define CONFIG_SPI_FLASH #define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE /*(26 * 1024)*/ -#define CONFIG_SPL_SFC_NOR +/*#define CONFIG_SPL_SFC_NOR*/ #define CONFIG_SPI_DUAL /*#define CONFIG_SPI_QUAD*/ #endif @@ -331,8 +331,8 @@ /*#define CONFIG_CMD_I2C*/ /************************ USB CONFIG ***************************/ +#define CONFIG_CMD_USB #if defined(CONFIG_CMD_USB) -#ifdef CONFIG_CMD_USB #define CONFIG_USB_DWC2 #define CONFIG_USB_DWC2_REG_ADDR 0x13500000 #define CONFIG_USB_HOST_ETHER diff --git a/include/configs/isvp_t31.h b/include/configs/isvp_t31.h index 3418b08d..d1f7e771 100644 --- a/include/configs/isvp_t31.h +++ b/include/configs/isvp_t31.h @@ -143,6 +143,7 @@ #endif #define CONFIG_SYS_VPLL_FREQ 1200000000 /*If VPLL is not used it must be set to 0*/ + #define SEL_SCLKA 2 #define SEL_CPU 1 #define SEL_H0 2 @@ -302,11 +303,13 @@ #define CONFIG_DDR2_M14D5121632A #define CONFIG_DDR_TYPE_DDR2 #endif + #define DDR2_CHIP_DRIVER_OUT_STRENGTH 0 + #define DDR2_CHIP_MR0_DLL_RST #define CONFIG_DDR_PHY_IMPEDANCE 40000 -#define CONFIG_DDR_PHY_ODT_IMPEDANCE 50000 //75000 +#define CONFIG_DDR_PHY_ODT_IMPEDANCE 50000 /* 75000 */ /* #define CONFIG_DDR_PHY_IMPED_PULLUP 0xf #define CONFIG_DDR_PHY_IMPED_PULLDOWN 0xf @@ -342,7 +345,7 @@ #endif #if defined(CONFIG_SPL_SFC_NOR) || defined(CONFIG_SPL_SFC_NAND) -#define CONFIG_SPL_SFC_SUPPORT +/*#define CONFIG_SPL_SFC_SUPPORT*/ #define CONFIG_JZ_SFC #define CONFIG_SPL_VERSION 1 #if defined(CONFIG_SPL_SFC_NOR) @@ -354,6 +357,7 @@ /*#define CONFIG_SPI_QUAD*/ #endif /* defined(CONFIG_SPL_SFC_NOR) || defined(CONFIG_SPL_SFC_NAND) */ +/* #if defined(CONFIG_SPL_MMC_SUPPORT) #define CONFIG_BOOTARGS BOOTARGS_COMMON " init=/linuxrc root=/dev/mmcblk0p2 rw rootdelay=1" #elif defined(CONFIG_SFC_NOR) @@ -365,6 +369,7 @@ #elif defined(CONFIG_SFC_NAND) #define CONFIG_BOOTARGS BOOTARGS_COMMON " ip=off init=/linuxrc ubi.mtd=2 root=ubi0:rootfs ubi.mtd=3 rootfstype=ubifs rw" #endif +*/ /** * Boot command definitions. @@ -373,6 +378,7 @@ #define CONFIG_BOOTCOMMAND "mmc read 0x80600000 0x1800 0x3000; bootm 0x80600000" #endif +/* #if defined(CONFIG_SFC_NOR) #if defined(CONFIG_OF_LIBFDT) #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x50000 0x270000;sf read 0x83000000 0x540000 0x10000;bootm 0x80600000 - 0x83000000" @@ -380,6 +386,7 @@ #define CONFIG_BOOTCOMMAND "sf probe;sf read 0x80600000 0x40000 0x280000; bootm 0x80600000" #endif #endif +*/ #if defined(CONFIG_SFC_NAND) #define CONFIG_BOOTCOMMAND "nand read 0x80600000 0x100000 0x800000;bootm 0x80600000" @@ -400,11 +407,15 @@ #define CONFIG_JZ_MMC_MSC0_PB 1 #endif -#if defined(CONFIG_SFC_COMMAND)/* SD card start */ -#define CONFIG_SFC_NOR_COMMAND /* support nor command */ +/* +#if defined(CONFIG_SFC_COMMAND) +*/ +#define CONFIG_SFC_NOR_COMMAND +/* #else -#define CONFIG_SFC_NAND_COMMAND /* support nand command */ -#endif /* CONFIG_SFC_COMMAND */ +#define CONFIG_SFC_NAND_COMMAND +#endif +*/ #if defined(CONFIG_SFC_NOR_COMMAND) #define CONFIG_CMD_SF @@ -414,7 +425,7 @@ #define CONFIG_SFC_NOR #define CONFIG_SPI_FLASH_INGENIC #define CONFIG_SPI_DUAL -/*#define CONFIG_SPI_QUAD*/ +/* #define CONFIG_SPI_QUAD */ #endif /* SFC */ @@ -441,22 +452,22 @@ #define CONFIG_MTD_PARTITIONS #define MTDIDS_DEFAULT "nand0=nand" #define MTDPARTS_DEFAULT "mtdparts=nand:1M(boot),8M(kernel),40M(rootfs),-(data)" -#define CONFIG_SPI_STANDARD //if the nand is QUAD mode, please annotate it. the default is one lan. +#define CONFIG_SPI_STANDARD /* if the nand is QUAD mode, please annotate it. the default is one lan. */ #if defined(CONFIG_SPL_SFC_SUPPORT) /*SFCNAND env*/ /* spi nand environment */ #define CONFIG_SYS_REDUNDAND_ENVIRONMENT -#define CONFIG_ENV_SECT_SIZE 0x20000 -#define SPI_NAND_BLK 0x20000 /*the spi nand block size */ -#define CONFIG_ENV_SIZE SPI_NAND_BLK -#define CONFIG_ENV_OFFSET 0xC0000 +/* #define CONFIG_ENV_SECT_SIZE 0x20000 */ +#define SPI_NAND_BLK 0x20000 +/* #define CONFIG_ENV_SIZE SPI_NAND_BLK */ +/* #define CONFIG_ENV_OFFSET 0xC0000 */ #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) #define CONFIG_ENV_IS_IN_SFC_NAND #endif /* MTD support */ -#define CONFIG_SYS_NAND_SELF_INIT +/* #define CONFIG_SYS_NAND_SELF_INIT */ #define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE #elif defined(CONFIG_SPL_SFC_NOR) @@ -502,34 +513,36 @@ /** * Command configuration. */ +/* #ifdef CONFIG_SFC_NOR -#define CONFIG_CMD_TFTPDOWNLOAD 1 /* tftpdownload support */ +#define CONFIG_CMD_TFTPDOWNLOAD 1 #endif -#define CONFIG_CMD_WATCHDOG /* watchdog support */ -#define CONFIG_CMD_NET /* networking support */ +*/ +#define CONFIG_CMD_WATCHDOG +#define CONFIG_CMD_NET #define CONFIG_CMD_DHCP #define CONFIG_CMD_PING -#define CONFIG_CMD_BOOTD /* bootd */ -#define CONFIG_CMD_SAVEENV /* saveenv */ +#define CONFIG_CMD_BOOTD +#define CONFIG_CMD_SAVEENV -#define CONFIG_CMD_CONSOLE /* coninfo */ -#define CONFIG_CMD_ECHO /* echo arguments */ -#define CONFIG_CMD_FAT /* FAT support */ +#define CONFIG_CMD_CONSOLE +#define CONFIG_CMD_ECHO +/* #define CONFIG_CMD_FAT */ #define CONFIG_CMD_EXT2 #define CONFIG_CMD_EXT4 -/*#define CONFIG_CMD_JFFS2*/ /* JFFS2 support */ -#define CONFIG_CMD_LOADB /* loadb */ -#define CONFIG_CMD_LOADS /* loads */ -#define CONFIG_CMD_MEMORY /* md mm nm mw cp cmp crc base loop mtest */ -#define CONFIG_CMD_MISC /* Misc functions like sleep etc*/ -#define CONFIG_CMD_MMC /* MMC/SD support */ -#define CONFIG_CMD_RUN /* run command in env variable */ -#define CONFIG_CMD_SOURCE /* "source" command support */ +/* #define CONFIG_CMD_JFFS2 */ +#define CONFIG_CMD_LOADB +#define CONFIG_CMD_LOADS +#define CONFIG_CMD_MEMORY +#define CONFIG_CMD_MISC +#define CONFIG_CMD_MMC +#define CONFIG_CMD_RUN +#define CONFIG_CMD_SOURCE #define CONFIG_CMD_GETTIME #define CONFIG_CMDLINE_EDITING #define CONFIG_AUTO_COMPLETE -/*#define CONFIG_CMD_I2C*/ -/*#define CONFIG_CMD_FLOCK*/ +/* #define CONFIG_CMD_I2C */ +/* #define CONFIG_CMD_FLOCK */ /************************ USB CONFIG ***************************/ #define CONFIG_CMD_USB @@ -567,9 +580,10 @@ #define CONFIG_SYS_MAXARGS 64 #define CONFIG_SYS_LONGHELP #define CONFIG_SYS_PROMPT CONFIG_SYS_BOARD "# " -#define CONFIG_SYS_CBSIZE 1024 +/* #define CONFIG_SYS_CBSIZE 1024 */ #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) +/* #if defined(CONFIG_SFC_NAND) || defined(CONFIG_SFC_NAND_COMMAND) #define CONFIG_SYS_MONITOR_LEN (400 * 1024) #else @@ -579,8 +593,9 @@ #define CONFIG_SYS_MONITOR_LEN (214 * 1024) #endif #endif +*/ #define CONFIG_SYS_MALLOC_LEN (32 * 1024 * 1024) -#define CONFIG_SYS_BOOTPARAMS_LEN (128 * 1024) +/* #define CONFIG_SYS_BOOTPARAMS_LEN (128 * 1024) */ #define CONFIG_SYS_SDRAM_BASE 0x80000000 /* cached (KSEG0) address */ #define CONFIG_SYS_SDRAM_MAX_TOP 0x84000000 /* don't run into IO space */ @@ -595,6 +610,7 @@ /** * Environment */ +/* #if defined(CONFIG_ENV_IS_IN_MMC) #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_ENV_SIZE (32 << 10) @@ -604,6 +620,7 @@ #define CONFIG_ENV_SIZE (1024 * 16) #define CONFIG_ENV_OFFSET (CONFIG_SYS_MONITOR_LEN + CONFIG_UBOOT_OFFSET) #endif +*/ /** * SPL configuration @@ -620,17 +637,21 @@ #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/$(SOC)/u-boot-spl.lds" #endif /* CONFIG_SPL_NOR_SUPPORT */ +/* #ifdef CONFIG_SPL_SFC_NAND -#define CONFIG_SPL_PAD_TO 27648 /* equal to spl max size in M200 */ +#define CONFIG_SPL_PAD_TO 27648 #define CONFIG_SPL_MAX_SIZE (27 * 1024) #else -#define CONFIG_SPL_PAD_TO 26624 /* equal to spl max size in M200 */ +*/ +#define CONFIG_SPL_PAD_TO 26624 #define CONFIG_SPL_MAX_SIZE (26 * 1024) +/* #endif +*/ #define CONFIG_UBOOT_OFFSET CONFIG_SPL_MAX_SIZE #define CONFIG_MMC_RAW_UBOOT_OFFSET (CONFIG_UBOOT_OFFSET / 1024 + 17) -#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR (CONFIG_MMC_RAW_UBOOT_OFFSET * 2)//0x5A //wli changed 0x20 /* 16KB offset */ +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR (CONFIG_MMC_RAW_UBOOT_OFFSET * 2) #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400 /* 512 KB */ #define CONFIG_SPL_BOARD_INIT @@ -643,8 +664,6 @@ #define CONFIG_SPL_TEXT_BASE 0x80001000 #endif /*CONFIG_SPL_NOR_SUPPORT*/ -#define CONFIG_SPL_MAX_SIZE (26 * 1024) - #define CONFIG_SPL_LZOP #if defined(CONFIG_SPL_LZOP) #define CONFIG_DECMP_BUFFER_ADRS 0x80200000 @@ -662,7 +681,7 @@ #if defined(CONFIG_SPL_NOR_SUPPORT) #define CONFIG_SPL_SERIAL_SUPPORT -#define CONFIG_SYS_UBOOT_BASE (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_PAD_TO - 0x40) //0x40 = sizeof (image_header) +#define CONFIG_SYS_UBOOT_BASE (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_PAD_TO - 0x40) /* 0x40 = sizeof (image_header) */ #define CONFIG_SYS_OS_BASE 0 #define CONFIG_SYS_SPL_ARGS_ADDR 0 #define CONFIG_SYS_FDT_BASE 0 @@ -716,8 +735,8 @@ */ #define CONFIG_GPIO_SETTINGS \ - "gpio_dev=62O\0" \ - "gpio_dev_net=61o 48o\0" +"gpio_dev=62O\0" \ +"gpio_dev_net=61o 48o\0" #include "isvp_common.h" From 17b9aa5344b600e13053944dcf60c8984c6a34af Mon Sep 17 00:00:00 2001 From: Paul Philippov Date: Sun, 7 Jan 2024 12:14:30 -0500 Subject: [PATCH 08/19] this and that --- build.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/build.sh b/build.sh index 8d3a704e..4fdf4813 100755 --- a/build.sh +++ b/build.sh @@ -21,23 +21,27 @@ declare -A cfg cfg[t10n]="isvp_t10_sfcnor" cfg[t10l]="isvp_t10_sfcnor_lite" + cfg[t20n]="isvp_t20_sfcnor" cfg[t20l]="isvp_t20_sfcnor_lite" cfg[t20x]="isvp_t20_sfcnor_ddr128M" + cfg[t21n]="isvp_t21_sfcnor" + cfg[t30n]="isvp_t30_sfcnor" cfg[t30l]="isvp_t30_sfcnor_lite" cfg[t30x]="isvp_t30_sfcnor_ddr128M" cfg[t30a]="isvp_t30a_sfcnor_ddr128M" cfg[t30a1]="isvp_t30a1_sfcnor_ddr128M" + cfg[t31n]="isvp_t31_sfcnor" cfg[t31l]="isvp_t31_sfcnor_lite" +cfg[t31lc]="isvp_t31lc_sfcnor" cfg[t31x]="isvp_t31_sfcnor_ddr128M" cfg[t31a]="isvp_t31a_sfcnor_ddr128M" cfg[t31al]="isvp_t31al_sfcnor_ddr128M" -cfg[t31lc]="isvp_t31lc_sfcnor" -OUTPUTDIR="./uboot_build" +OUTPUT_DIR="./uboot_build" # Collecting platform names and formatting output platforms="" @@ -51,22 +55,25 @@ for key in "${!cfg[@]}"; do fi done -echo -e "Building U-Boot 2013.07 on Ingenic XBurst1 for:\n$platforms" - # Start timer SECONDS=0 +#rm ${OUTPUT_DIR}/u-boot-*.bin >/dev/null 2>&1 +rm building-*.log >/dev/null 2>&1 + # Building process for soc in "${!cfg[@]}"; do echo "Building U-Boot for ${soc}" log=building-${soc}.log; :>$log make distclean >>$log 2>&1 - mkdir -p ${OUTPUTDIR} 2>&1 > /dev/null + mkdir -p ${OUTPUT_DIR} >/dev/null 2>&1 make ${cfg[$soc]} >>$log 2>&1 make -j$(nproc) >>$log 2>&1 - cp u-boot-lzo-with-spl.bin ${OUTPUTDIR}/u-boot-${soc}-gtxaspec.bin + cp u-boot-lzo-with-spl.bin ${OUTPUT_DIR}/u-boot-${soc}.bin done # End timer and report duration=$SECONDS -echo "Total build time: $(($duration / 60)) minutes and $(($duration % 60)) seconds." \ No newline at end of file +echo "Done" +echo "Total build time: $(($duration / 60)) minutes and $(($duration % 60)) seconds." +exit 0 From c2ccd1c6f65e499f67cf31eaf3dfde1495e39ce9 Mon Sep 17 00:00:00 2001 From: gtxaspec Date: Fri, 5 Jan 2024 12:09:29 -0800 Subject: [PATCH 09/19] add ircut gpio default set --- board/ingenic/isvp_t20/board.c | 2 ++ board/ingenic/isvp_t31/board.c | 2 ++ include/configs/isvp_common.h | 8 +++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/board/ingenic/isvp_t20/board.c b/board/ingenic/isvp_t20/board.c index 834dfe67..1edc51ac 100644 --- a/board/ingenic/isvp_t20/board.c +++ b/board/ingenic/isvp_t20/board.c @@ -66,6 +66,8 @@ int misc_init_r(void) handle_gpio_settings("gpio_set"); // Platform default GPIO set handle_gpio_settings("gpio_dev"); + // IRCUT default GPIO set + handle_gpio_settings("gpio_dev_ircut"); #if 0 /* TO DO */ uint8_t mac[6] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc }; diff --git a/board/ingenic/isvp_t31/board.c b/board/ingenic/isvp_t31/board.c index 26c680e0..a94cff40 100644 --- a/board/ingenic/isvp_t31/board.c +++ b/board/ingenic/isvp_t31/board.c @@ -76,6 +76,8 @@ int misc_init_r(void) handle_gpio_settings("gpio_set"); // Platform default GPIO set handle_gpio_settings("gpio_dev"); + // IRCUT default GPIO set + handle_gpio_settings("gpio_dev_ircut"); #if 0 /* TO DO */ uint8_t mac[6] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc }; diff --git a/include/configs/isvp_common.h b/include/configs/isvp_common.h index 4441756a..35561e77 100644 --- a/include/configs/isvp_common.h +++ b/include/configs/isvp_common.h @@ -148,6 +148,12 @@ "restore=n\0" \ "soc="CONFIG_SOC"\0" \ CONFIG_EXTRA_SETTINGS \ -CONFIG_GPIO_SETTINGS +CONFIG_GPIO_SETTINGS \ +CONFIG_GPIO_IRCUT_SETTINGS + +/* IRCUT Default GPIOs */ + +#define CONFIG_GPIO_IRCUT_SETTINGS \ +"gpio_dev_ircut=25o 26o 52o 53o 49o 50o\0" #endif /*__CONFIG_ISVP_COMMON__*/ From 48b6b277b42534029be2211e586f6d95db5e74d1 Mon Sep 17 00:00:00 2001 From: gtxaspec Date: Fri, 5 Jan 2024 13:50:58 -0800 Subject: [PATCH 10/19] add openipc banner to build strings --- Makefile | 2 +- board/ingenic/isvp_t20/board.c | 4 ++-- board/ingenic/isvp_t31/board.c | 6 +++--- common/spl/spl.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index c3d161b3..4f540fd0 100644 --- a/Makefile +++ b/Makefile @@ -827,7 +827,7 @@ $(VERSION_FILE): @( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \ printf '#define PLAIN_VERSION "%s%s"\n' \ "$(U_BOOT_VERSION)" "$${localvers}" ; \ - printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \ + printf '#define U_BOOT_VERSION "OpenIPC U-Boot %s%s"\n' \ "$(U_BOOT_VERSION)" "$${localvers}" ; \ ) > $@.tmp @( printf '#define CC_VERSION_STRING "%s"\n' \ diff --git a/board/ingenic/isvp_t20/board.c b/board/ingenic/isvp_t20/board.c index 1edc51ac..64fb7b42 100644 --- a/board/ingenic/isvp_t20/board.c +++ b/board/ingenic/isvp_t20/board.c @@ -62,12 +62,12 @@ int misc_init_r(void) { // Read GPIOs from ENV - // User GPIOs - handle_gpio_settings("gpio_set"); // Platform default GPIO set handle_gpio_settings("gpio_dev"); // IRCUT default GPIO set handle_gpio_settings("gpio_dev_ircut"); + // User GPIOs + handle_gpio_settings("gpio_set"); #if 0 /* TO DO */ uint8_t mac[6] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc }; diff --git a/board/ingenic/isvp_t31/board.c b/board/ingenic/isvp_t31/board.c index a94cff40..b4d558e6 100644 --- a/board/ingenic/isvp_t31/board.c +++ b/board/ingenic/isvp_t31/board.c @@ -72,12 +72,12 @@ int misc_init_r(void) { // Read GPIOs from ENV - // User GPIOs - handle_gpio_settings("gpio_set"); - // Platform default GPIO set handle_gpio_settings("gpio_dev"); // IRCUT default GPIO set handle_gpio_settings("gpio_dev_ircut"); + // User GPIOs + handle_gpio_settings("gpio_set"); + // Platform default GPIO set #if 0 /* TO DO */ uint8_t mac[6] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc }; diff --git a/common/spl/spl.c b/common/spl/spl.c index 059d21c2..f1adc730 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -277,7 +277,7 @@ void preloader_console_init(void) gd->have_console = 1; - puts("\nU-Boot SPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \ + puts("\nOpenIPC U-Boot SPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \ U_BOOT_TIME ")\n"); #ifdef CONFIG_SPL_DISPLAY_PRINT spl_display_print(); From 288dc2e1fbc57f5af796699b0c32e8e665ce2f55 Mon Sep 17 00:00:00 2001 From: gtxaspec Date: Fri, 5 Jan 2024 13:53:56 -0800 Subject: [PATCH 11/19] move gpio routines to arch board.c --- arch/mips/lib/board.c | 18 +++++++++++++++++- board/ingenic/isvp_t20/board.c | 14 -------------- board/ingenic/isvp_t31/board.c | 14 -------------- 3 files changed, 17 insertions(+), 29 deletions(-) diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c index 0b5f401e..e3415ed8 100644 --- a/arch/mips/lib/board.c +++ b/arch/mips/lib/board.c @@ -369,6 +369,12 @@ extern void board_usb_init(void); #if defined(CONFIG_MISC_INIT_R) /* miscellaneous platform dependent initialisations */ misc_init_r(); + /* Platform Default GPIO Set */ + printf("GPIO: gpio_dev \n"); + handle_gpio_settings("gpio_dev"); + /* IRCUT default GPIO set */ + printf("GPIO: gpio_dev_ircut \n"); + handle_gpio_settings("gpio_dev_ircut"); #endif #ifdef CONFIG_BITBANGMII @@ -376,8 +382,18 @@ extern void board_usb_init(void); #endif #if defined(CONFIG_CMD_NET) puts("Net: "); - eth_initialize(gd->bd); + int ret = eth_initialize(gd->bd); + if (ret == 0) { + printf("GPIO: gpio_dev_net \n"); + /* GPIOs to be set if net initialization fails */ + handle_gpio_settings("gpio_dev_net"); + } #endif + +/* User defined GPIO set */ +printf("GPIO: gpio_set \n"); +handle_gpio_settings("gpio_set"); + #ifdef CONFIG_AUTO_UPDATE printf("Autoupdate... \n"); run_command("sdupdate",0); diff --git a/board/ingenic/isvp_t20/board.c b/board/ingenic/isvp_t20/board.c index 64fb7b42..69c34068 100644 --- a/board/ingenic/isvp_t20/board.c +++ b/board/ingenic/isvp_t20/board.c @@ -60,15 +60,6 @@ void board_usb_init(void) int misc_init_r(void) { - // Read GPIOs from ENV - - // Platform default GPIO set - handle_gpio_settings("gpio_dev"); - // IRCUT default GPIO set - handle_gpio_settings("gpio_dev_ircut"); - // User GPIOs - handle_gpio_settings("gpio_set"); - #if 0 /* TO DO */ uint8_t mac[6] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc }; @@ -101,11 +92,6 @@ int board_eth_init(bd_t *bis) #endif ret += jz_net_initialize(bis); if (ret < 0){ - // If PHY doesn't exist on this device, enable MMC - - // GPIOs to be set after net initialize fails - handle_gpio_settings("gpio_dev_net"); - if(!getenv("extras")) setenv("extras", "nogmac"); } diff --git a/board/ingenic/isvp_t31/board.c b/board/ingenic/isvp_t31/board.c index b4d558e6..feb60bdf 100644 --- a/board/ingenic/isvp_t31/board.c +++ b/board/ingenic/isvp_t31/board.c @@ -70,15 +70,6 @@ void board_usb_init(void) int misc_init_r(void) { - // Read GPIOs from ENV - - handle_gpio_settings("gpio_dev"); - // IRCUT default GPIO set - handle_gpio_settings("gpio_dev_ircut"); - // User GPIOs - handle_gpio_settings("gpio_set"); - // Platform default GPIO set - #if 0 /* TO DO */ uint8_t mac[6] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc }; @@ -118,11 +109,6 @@ int board_eth_init(bd_t *bis) #endif ret += jz_net_initialize(bis); if (ret < 0){ - // If PHY doesn't exist on this device, enable MMC - - // GPIOs to be set after net initialize fails - handle_gpio_settings("gpio_dev_net"); - if(!getenv("extras")) setenv("extras", "nogmac"); } From ab4e00a43c0fe0446acbe98657af7538bbdbc168 Mon Sep 17 00:00:00 2001 From: gtxaspec Date: Fri, 5 Jan 2024 14:20:18 -0800 Subject: [PATCH 12/19] run gpio_net_set only if board_eth_init fails --- arch/mips/lib/board.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c index e3415ed8..934aefb0 100644 --- a/arch/mips/lib/board.c +++ b/arch/mips/lib/board.c @@ -382,12 +382,14 @@ extern void board_usb_init(void); #endif #if defined(CONFIG_CMD_NET) puts("Net: "); - int ret = eth_initialize(gd->bd); - if (ret == 0) { - printf("GPIO: gpio_dev_net \n"); - /* GPIOs to be set if net initialization fails */ + int ret = board_eth_init(gd->bd); + if (ret < 0) { + printf("Net: Board Net Initialization Failed\n"); + // GPIOs to be set after net initialization fails + printf("GPIO: gpio_net_set \n"); handle_gpio_settings("gpio_dev_net"); } + eth_initialize(gd->bd); #endif /* User defined GPIO set */ From ae675886d0e854efc696d9d42e9109a8e4b67cd6 Mon Sep 17 00:00:00 2001 From: gtxaspec Date: Fri, 5 Jan 2024 15:10:32 -0800 Subject: [PATCH 13/19] move common usb and wired ethernet init to arch board.c --- arch/mips/lib/board.c | 31 ++++++++++++++++++++++--------- board/ingenic/isvp_t20/board.c | 14 +------------- board/ingenic/isvp_t31/board.c | 14 +------------- 3 files changed, 24 insertions(+), 35 deletions(-) diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c index 934aefb0..f129571f 100644 --- a/arch/mips/lib/board.c +++ b/arch/mips/lib/board.c @@ -42,6 +42,10 @@ DECLARE_GLOBAL_DATA_PTR; ulong monitor_flash_len; +extern int jz_net_initialize(bd_t *bis); + +void handle_gpio_settings(const char *env_var_name); + static char *failed = "*** failed ***\n"; /* @@ -381,15 +385,24 @@ extern void board_usb_init(void); bb_miiphy_init(); #endif #if defined(CONFIG_CMD_NET) - puts("Net: "); - int ret = board_eth_init(gd->bd); - if (ret < 0) { - printf("Net: Board Net Initialization Failed\n"); - // GPIOs to be set after net initialization fails - printf("GPIO: gpio_net_set \n"); - handle_gpio_settings("gpio_dev_net"); - } - eth_initialize(gd->bd); + /*puts("Net: "); + eth_initialize(gd->bd); */ + + int ret = 0; + #ifdef CONFIG_USB_ETHER_ASIX + if (0 == strncmp(getenv("ethact"), "asx", 3)) { + run_command("usb start", 0); + } + #endif + ret += jz_net_initialize(gd->bd); + if (ret < 0){ + // GPIOs to be set after net initialization fails + printf("GPIO: gpio_net_set \n"); + handle_gpio_settings("gpio_dev_net"); + + if(!getenv("extras")) + setenv("extras", "nogmac"); + } #endif /* User defined GPIO set */ diff --git a/board/ingenic/isvp_t20/board.c b/board/ingenic/isvp_t20/board.c index 69c34068..506d3052 100644 --- a/board/ingenic/isvp_t20/board.c +++ b/board/ingenic/isvp_t20/board.c @@ -31,7 +31,6 @@ #include #include -extern int jz_net_initialize(bd_t *bis); struct cgu_clk_src cgu_clk_src[] = { {VPU, MPLL}, {MACPHY, MPLL}, @@ -84,18 +83,7 @@ int board_mmc_init(bd_t *bd) int board_eth_init(bd_t *bis) { - int ret = 0; -#ifdef CONFIG_USB_ETHER_ASIX - if (0 == strncmp(getenv("ethact"), "asx", 3)) { - run_command("usb start", 0); - } -#endif - ret += jz_net_initialize(bis); - if (ret < 0){ - if(!getenv("extras")) - setenv("extras", "nogmac"); - } - return ret; + return 0; } #ifdef CONFIG_SPL_NOR_SUPPORT diff --git a/board/ingenic/isvp_t31/board.c b/board/ingenic/isvp_t31/board.c index feb60bdf..5514a135 100644 --- a/board/ingenic/isvp_t31/board.c +++ b/board/ingenic/isvp_t31/board.c @@ -31,7 +31,6 @@ #include #include -extern int jz_net_initialize(bd_t *bis); struct cgu_clk_src cgu_clk_src[] = { {AVPU, MPLL}, {MACPHY, MPLL}, @@ -101,18 +100,7 @@ void board_nand_init(void) int board_eth_init(bd_t *bis) { - int ret = 0; -#ifdef CONFIG_USB_ETHER_ASIX - if (0 == strncmp(getenv("ethact"), "asx", 3)) { - run_command("usb start", 0); - } -#endif - ret += jz_net_initialize(bis); - if (ret < 0){ - if(!getenv("extras")) - setenv("extras", "nogmac"); - } - return ret; + return 0; } #ifdef CONFIG_SPL_NOR_SUPPORT From a3317f6f93881603a491f0b6dc2934a0c8f17b2d Mon Sep 17 00:00:00 2001 From: gtxaspec Date: Fri, 5 Jan 2024 23:53:52 -0800 Subject: [PATCH 14/19] rename gpio sets for comprehension --- arch/mips/lib/board.c | 12 ++++++------ board/ingenic/isvp_t31/board.c | 4 +++- include/configs/isvp_t20.h | 2 +- include/configs/isvp_t31.h | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c index f129571f..64085259 100644 --- a/arch/mips/lib/board.c +++ b/arch/mips/lib/board.c @@ -374,11 +374,11 @@ extern void board_usb_init(void); /* miscellaneous platform dependent initialisations */ misc_init_r(); /* Platform Default GPIO Set */ - printf("GPIO: gpio_dev \n"); - handle_gpio_settings("gpio_dev"); + printf("GPIO: gpio_default \n"); + handle_gpio_settings("gpio_default"); /* IRCUT default GPIO set */ - printf("GPIO: gpio_dev_ircut \n"); - handle_gpio_settings("gpio_dev_ircut"); + printf("GPIO: gpio_default_ircut \n"); + handle_gpio_settings("gpio_default_ircut"); #endif #ifdef CONFIG_BITBANGMII @@ -397,8 +397,8 @@ extern void board_usb_init(void); ret += jz_net_initialize(gd->bd); if (ret < 0){ // GPIOs to be set after net initialization fails - printf("GPIO: gpio_net_set \n"); - handle_gpio_settings("gpio_dev_net"); + printf("GPIO: gpio_default_net \n"); + handle_gpio_settings("gpio_default_net"); if(!getenv("extras")) setenv("extras", "nogmac"); diff --git a/board/ingenic/isvp_t31/board.c b/board/ingenic/isvp_t31/board.c index 5514a135..8e73beb0 100644 --- a/board/ingenic/isvp_t31/board.c +++ b/board/ingenic/isvp_t31/board.c @@ -45,8 +45,9 @@ struct cgu_clk_src cgu_clk_src[] = { int board_early_init_f(void) { +/* #if defined(CONFIG_T31A) || defined(CONFIG_T31AL) - /* printf("support quad\n");*/ + printf("support quad\n"); #else gpio_direction_input(25); gpio_direction_input(26); @@ -55,6 +56,7 @@ int board_early_init_f(void) gpio_disable_pull_down(26); gpio_disable_pull_up(26); #endif +*/ return 0; } diff --git a/include/configs/isvp_t20.h b/include/configs/isvp_t20.h index 56284441..da6f47f5 100644 --- a/include/configs/isvp_t20.h +++ b/include/configs/isvp_t20.h @@ -450,4 +450,4 @@ #include "isvp_common.h" -#endif /*__CONFIG_ISVP_T10_H__*/ +#endif /*__CONFIG_ISVP_T20_H__*/ diff --git a/include/configs/isvp_t31.h b/include/configs/isvp_t31.h index d1f7e771..686b86e8 100644 --- a/include/configs/isvp_t31.h +++ b/include/configs/isvp_t31.h @@ -740,4 +740,4 @@ #include "isvp_common.h" -#endif /*__CONFIG_ISVP_T10_H__*/ +#endif /*__CONFIG_ISVP_T31_H__*/ From 2b3de7d0267712cc20594e219f861e33727ceb70 Mon Sep 17 00:00:00 2001 From: gtxaspec Date: Sun, 7 Jan 2024 00:38:16 -0800 Subject: [PATCH 15/19] enable fat write for arch --- include/configs/isvp_common.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/configs/isvp_common.h b/include/configs/isvp_common.h index 35561e77..14e2d204 100644 --- a/include/configs/isvp_common.h +++ b/include/configs/isvp_common.h @@ -42,9 +42,10 @@ #define CONFIG_BOOTDELAY 1 #define CONFIG_CMD_TFTPPUT 1 #define CONFIG_CMD_FAT 1 -#define CONFIG_CMD_FS_GENERIC 1 +#define CONFIG_FAT_WRITE 1 +#define CONFIG_CMD_FS_GENERIC 1 #define CONFIG_CMD_GPIO 1 -#define CONFIG_SYS_HUSH_PARSER 1 +#define CONFIG_SYS_HUSH_PARSER 1 #define CONFIG_NETMASK 255.255.255.0 #define CONFIG_GATEWAYIP 192.168.1.1 From 85d5d61a66e4cbe87dbf00ac7378f70ff751b244 Mon Sep 17 00:00:00 2001 From: gtxaspec Date: Sun, 7 Jan 2024 00:38:42 -0800 Subject: [PATCH 16/19] sdupdate refactor part 1 --- common/cmd_sdupdate.c | 196 ++++++++++++------------------------------ 1 file changed, 53 insertions(+), 143 deletions(-) diff --git a/common/cmd_sdupdate.c b/common/cmd_sdupdate.c index 01e1160a..958e63ae 100755 --- a/common/cmd_sdupdate.c +++ b/common/cmd_sdupdate.c @@ -95,7 +95,7 @@ struct flash_layout aufl_layout[AU_MAXFILES] = { }; /* where to load files into memory */ -#define LOAD_ADDR ((unsigned char *)0x82000000) +#define LOAD_ADDR ((unsigned char *)0x80600000) /* the app is the largest image */ #define MAX_LOADSZ ausize[IDX_FW] @@ -204,8 +204,7 @@ static int au_check_header_valid(int idx, long nbytes) return 0; } -static int au_do_update(int idx, long sz) -{ +static int au_do_update(int idx, long sz) { image_header_t *hdr; unsigned long start, len; unsigned long write_len; @@ -215,15 +214,15 @@ static int au_do_update(int idx, long sz) hdr = (image_header_t *)LOAD_ADDR; - // start = aufl_layout[idx].start; - // len = aufl_layout[idx].end - aufl_layout[idx].start; - - start = ntohl(hdr->ih_load); - len = ntohl(hdr->ih_ep) - ntohl(hdr->ih_load); + // For full image, use the size of the loaded image directly + if (idx == IDX_FW) { + start = AU_FL_FW_ST; // Adjust start address if needed + len = sz; // Use the actual size of the loaded image + } else { + start = ntohl(hdr->ih_load); + len = ntohl(hdr->ih_ep) - ntohl(hdr->ih_load); + } - /* - * erase the address range. - */ printf("flash erase...\n"); rc = flash->erase(flash, start, len); if (rc) { @@ -237,16 +236,15 @@ static int au_do_update(int idx, long sz) return 1; } - /* strip the header - except for the kernel and ramdisk */ - if (hdr->ih_type == IH_TYPE_RAMDISK) { - pbuf = buf; - write_len = sizeof(*hdr) + ntohl(hdr->ih_size); + if (idx == IDX_FW) { + pbuf = buf; // For full image, use the buffer directly + write_len = len; // Use the actual size of the loaded image } else { + // For other images, strip the header and use ih_size pbuf = (buf + sizeof(*hdr)); write_len = ntohl(hdr->ih_size); } - /* copy the data from RAM to FLASH */ printf("flash write...\n"); rc = flash->write(flash, start, write_len, pbuf); if (rc) { @@ -254,153 +252,102 @@ static int au_do_update(int idx, long sz) return 1; } - /* check the dcrc of the copy */ - if (crc32(0, (unsigned char const *)(buf + sizeof(*hdr)), - ntohl(hdr->ih_size)) != ntohl(hdr->ih_dcrc)) { - printf("Image %s Bad Data Checksum After COPY\n", aufile[idx]); - return -1; - } - unmap_physmem(buf, len); - return 0; } - -/* - * If none of the update file(u-boot, kernel or rootfs) was found - * in the medium, return -1; - * If u-boot has been updated, return 1; - * Others, return 0; - */ -static int update_to_flash(void) -{ +static int update_to_flash(void) { int i = 0; long sz; - int res, cnt; + int res; int uboot_updated = 0; int image_found = 0; - /* just loop thru all the possible files */ for (i = 0; i < AU_MAXFILES; i++) { - if (LOAD_ID != -1) + if (LOAD_ID != -1) { i = LOAD_ID; - /* just read the header */ - sz = file_fat_read(aufile[i], LOAD_ADDR, - sizeof(image_header_t)); - debug("read %s sz %ld hdr %d\n", - aufile[i], sz, sizeof(image_header_t)); + } + + sz = file_fat_read(aufile[i], LOAD_ADDR, sizeof(image_header_t)); if (sz <= 0 || sz < sizeof(image_header_t)) { debug("%s not found\n", aufile[i]); - if (LOAD_ID != -1) - break; - else - continue; + continue; } image_found = 1; - if (au_check_header_valid(i, sz) < 0) { + if (i != IDX_FW && au_check_header_valid(i, sz) < 0) { debug("%s header not valid\n", aufile[i]); - if (LOAD_ID != -1) - break; - else - continue; + continue; } - sz = file_fat_read(aufile[i], LOAD_ADDR, MAX_LOADSZ); - debug("read %s sz %ld hdr %d\n", - aufile[i], sz, sizeof(image_header_t)); - if (sz <= 0 || sz <= sizeof(image_header_t)) { + sz = file_fat_read(aufile[i], LOAD_ADDR, (i != IDX_FW) ? MAX_LOADSZ : flash->size); + if (sz <= 0) { debug("%s not found\n", aufile[i]); - if (LOAD_ID != -1) - break; - else - continue; + continue; } - if (au_check_cksum_valid(i, sz) < 0) { + if (i != IDX_FW && au_check_cksum_valid(i, sz) < 0) { debug("%s checksum not valid\n", aufile[i]); - if (LOAD_ID != -1) - break; - else - continue; + continue; } - /* If u-boot had been updated, we need to - * save current env to flash */ - if (0 == strcmp((char *)AU_UBOOT, aufile[i])) + if (i == IDX_UBOOT) { uboot_updated = 1; + } - /* this is really not a good idea, but it's what the */ - /* customer wants. */ - cnt = 0; res = au_do_update(i, sz); - - if (LOAD_ID != -1) - break; + if (res != 0) { + return res; + } } - if (1 == uboot_updated) - return 1; - if (1 == image_found) - return 0; - - return -1; + return image_found ? (uboot_updated ? 1 : 0) : -1; } -/* - * This is called by board_init() after the hardware has been set up - * and is usable. Only if SPI flash initialization failed will this function - * return -1, otherwise it will return 0; - */ -int do_auto_update(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) -{ + +int do_auto_update(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { block_dev_desc_t *stor_dev; int old_ctrlc; - int j; int state = -1; long start = -1, end = 0; - if (argc == 1) - ;/*to do*/ - else if (argc == 2) { - LOAD_ID = simple_strtoul(argv[1], NULL, 16); + if (argc == 1) { + // Default behavior + } else if (argc == 2) { + LOAD_ID = simple_strtoul(argv[1], NULL, 16); if (LOAD_ID < IDX_UBOOT || LOAD_ID > AU_MAXFILES) { - printf("unsupport id!\n"); + printf("Unsupported id!\n"); return CMD_RET_USAGE; } } else if (argc == 4) { - LOAD_ID = simple_strtoul(argv[1], NULL, 16); + LOAD_ID = simple_strtoul(argv[1], NULL, 16); if (LOAD_ID < IDX_UBOOT || LOAD_ID > AU_MAXFILES) { - printf("unsupport id!\n"); + printf("Unsupported id!\n"); return CMD_RET_USAGE; } - start = simple_strtoul(argv[2], NULL, 16); - end = simple_strtoul(argv[3], NULL, 16); + start = simple_strtoul(argv[2], NULL, 16); + end = simple_strtoul(argv[3], NULL, 16); if (start >= 0 && end && end > start) { - ausize[LOAD_ID] = end - start; + ausize[LOAD_ID] = end - start; aufl_layout[LOAD_ID].start = start; aufl_layout[LOAD_ID].end = end; } else { - printf("error addr,use default\n"); + printf("Error address, use default\n"); } } else { return CMD_RET_USAGE; } - debug("device name %s!\n", "mmc"); + debug("Device name: mmc\n"); stor_dev = get_dev("mmc", 0); - if (NULL == stor_dev) { - debug("Unknow device type!\n"); + if (!stor_dev) { + debug("Unknown device type!\n"); return 0; } if (fat_register_device(stor_dev, 1) != 0) { - debug("Unable to use %s %d:%d for fatls\n", - "mmc", - au_stor_curr_dev, - 1); + debug("Unable to use mmc 1:1 for fatls\n"); return -1; } @@ -409,16 +356,8 @@ int do_auto_update(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return -1; } - /* - * make sure that we see CTRL-C - * and save the old state - */ old_ctrlc = disable_ctrlc(0); - /* - * CONFIG_SF_DEFAULT_SPEED=1000000, - * CONFIG_SF_DEFAULT_MODE=0x3 - */ flash = spi_flash_probe(0, 0, 1000000, 0x3); if (!flash) { printf("Failed to initialize SPI flash\n"); @@ -427,43 +366,14 @@ int do_auto_update(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) state = update_to_flash(); - - /* restore the old state */ disable_ctrlc(old_ctrlc); - LOAD_ID = -1; - /* - * no update file found - */ - /*if (-1 == state)*/ - /*continue;*/ - /* - * update files have been found on current medium, - * so just break here - */ - - if (state >= 0) { - if (flash->size > 8388608) { - printf("Setting partition layout for 16M flash \n"); - run_command( - "run mtdpartsnor16m; setenv bootcmd ${bootcmdnor}; saveenv", 0); - }else{ - printf("Setting partition layout for 8M flash \n"); - run_command( - "run mtdpartsnor8m; setenv bootcmd ${bootcmdnor}; saveenv", 0); - } - } - - /* - * If u-boot has been updated, it's better to save environment to flash - */ - if (1 == state) { - /*env_crc_update();*/ + if (state == 1) { saveenv(); } - return 0; + return (state == -1) ? CMD_RET_FAILURE : CMD_RET_SUCCESS; } U_BOOT_CMD( From 8ae280b340a8be15a738b8545ed5f3f252e14023 Mon Sep 17 00:00:00 2001 From: gtxaspec Date: Sun, 7 Jan 2024 01:17:43 -0800 Subject: [PATCH 17/19] check for flag on autoupdate-full --- common/cmd_sdupdate.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/common/cmd_sdupdate.c b/common/cmd_sdupdate.c index 958e63ae..810656f5 100755 --- a/common/cmd_sdupdate.c +++ b/common/cmd_sdupdate.c @@ -268,6 +268,14 @@ static int update_to_flash(void) { i = LOAD_ID; } + if (strcmp(aufile[i], AU_FW) == 0) { + // Check if .autoupdate-full.flag exists + if (file_fat_read(".autoupdate-full.flag", LOAD_ADDR, 1) >= 0) { + printf("Flag file .autoupdate-full.flag exists, skipping %s\n", AU_FW); + continue; // Skip this file + } + } + sz = file_fat_read(aufile[i], LOAD_ADDR, sizeof(image_header_t)); if (sz <= 0 || sz < sizeof(image_header_t)) { debug("%s not found\n", aufile[i]); @@ -300,6 +308,20 @@ static int update_to_flash(void) { if (res != 0) { return res; } + + if (res == 0 && strcmp(aufile[i], AU_FW) == 0) { + // Write the .autoupdate-full.flag file after successful flash + char empty_flag[1] = {0}; + if (file_fat_write(".autoupdate-full.flag", empty_flag, sizeof(empty_flag)) < 0) { + printf("Error creating flag file .autoupdate-full.flag\n"); + } else { + printf("Flag file .autoupdate-full.flag created\n"); + } + } + + if (LOAD_ID != -1) { + break; // Update only the specified file + } } return image_found ? (uboot_updated ? 1 : 0) : -1; From 01ce24bf98fbf8f8e6b07d7695f9138dabffa194 Mon Sep 17 00:00:00 2001 From: gtxaspec Date: Sun, 7 Jan 2024 01:18:23 -0800 Subject: [PATCH 18/19] rename autoupdate file extensions to .bin --- common/cmd_sdupdate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/cmd_sdupdate.c b/common/cmd_sdupdate.c index 810656f5..65929eb0 100755 --- a/common/cmd_sdupdate.c +++ b/common/cmd_sdupdate.c @@ -32,10 +32,10 @@ #endif /* AU_DEBUG */ /* possible names of files on the medium. */ -#define AU_UBOOT "autoupdate-uboot.img" -#define AU_KERNEL "autoupdate-kernel.img" -#define AU_ROOTFS "autoupdate-rootfs.img" -#define AU_FW "autoupdate-full.img" +#define AU_UBOOT "autoupdate-uboot.bin" +#define AU_KERNEL "autoupdate-kernel.bin" +#define AU_ROOTFS "autoupdate-rootfs.bin" +#define AU_FW "autoupdate-full.bin" struct flash_layout { long start; From 375c47d04bdd727f2e050c796c7d9e8f7a3bbdb4 Mon Sep 17 00:00:00 2001 From: gtxaspec Date: Sun, 7 Jan 2024 01:22:29 -0800 Subject: [PATCH 19/19] rename flag file for full image to autoupdate-full.done --- common/cmd_sdupdate.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common/cmd_sdupdate.c b/common/cmd_sdupdate.c index 65929eb0..3a7569f3 100755 --- a/common/cmd_sdupdate.c +++ b/common/cmd_sdupdate.c @@ -269,9 +269,9 @@ static int update_to_flash(void) { } if (strcmp(aufile[i], AU_FW) == 0) { - // Check if .autoupdate-full.flag exists - if (file_fat_read(".autoupdate-full.flag", LOAD_ADDR, 1) >= 0) { - printf("Flag file .autoupdate-full.flag exists, skipping %s\n", AU_FW); + // Check if .autoupdate-full.done exists + if (file_fat_read(".autoupdate-full.done", LOAD_ADDR, 1) >= 0) { + printf("Flag file .autoupdate-full.done exists, skipping %s\n", AU_FW); continue; // Skip this file } } @@ -310,12 +310,12 @@ static int update_to_flash(void) { } if (res == 0 && strcmp(aufile[i], AU_FW) == 0) { - // Write the .autoupdate-full.flag file after successful flash + // Write the .autoupdate-full.done file after successful flash char empty_flag[1] = {0}; - if (file_fat_write(".autoupdate-full.flag", empty_flag, sizeof(empty_flag)) < 0) { - printf("Error creating flag file .autoupdate-full.flag\n"); + if (file_fat_write(".autoupdate-full.done", empty_flag, sizeof(empty_flag)) < 0) { + printf("Error creating flag file .autoupdate-full.done\n"); } else { - printf("Flag file .autoupdate-full.flag created\n"); + printf("Flag file .autoupdate-full.done created\n"); } }