Skip to content

Commit

Permalink
Merge branch 'themactep-mtdtest2'
Browse files Browse the repository at this point in the history
  • Loading branch information
gtxaspec committed Jan 8, 2024
2 parents 232a792 + 375c47d commit 46bdb70
Show file tree
Hide file tree
Showing 15 changed files with 747 additions and 585 deletions.
14 changes: 7 additions & 7 deletions boards.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
21 changes: 14 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand All @@ -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."
echo "Done"
echo "Total build time: $(($duration / 60)) minutes and $(($duration % 60)) seconds."
exit 0
27 changes: 14 additions & 13 deletions common/cmd_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[])
Expand All @@ -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;
}

Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion include/configs/bootes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/configs/box.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/configs/columba.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/configs/hercules.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
135 changes: 80 additions & 55 deletions include/configs/isvp_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 %d\n", bootdelay
#define CONFIG_AUTOBOOT_STOP_STR "\x3"

#define CONFIG_SYS_LONGHELP
Expand Down Expand Up @@ -61,75 +60,101 @@

#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}"
/**
* 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))
#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) \${extras}"
"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 \
CONFIG_GPIO_IRCUT_SETTINGS
"baseaddr=0x80600000\0" \
"panic_timeout=10\0" \
"serialport=ttyS1\0" \
"restore=n\0" \
"soc="CONFIG_SOC"\0" \
CONFIG_EXTRA_SETTINGS \
CONFIG_GPIO_SETTINGS \
CONFIG_GPIO_IRCUT_SETTINGS

/*
IRCUT Default GPIOs:
*/
/* IRCUT Default GPIOs */

#define CONFIG_GPIO_IRCUT_SETTINGS \
"gpio_default_ircut=25o 26o 52o 53o 49o 50o\0"
"gpio_dev_ircut=25o 26o 52o 53o 49o 50o\0"

#endif /*__CONFIG_ISVP_COMMON__*/
Loading

0 comments on commit 46bdb70

Please sign in to comment.