diff --git a/kernel/SyterKit/app/hello_world/main.c b/kernel/SyterKit/app/hello_world/main.c index 12fdddd983..f9563be8b0 100644 --- a/kernel/SyterKit/app/hello_world/main.c +++ b/kernel/SyterKit/app/hello_world/main.c @@ -20,7 +20,7 @@ extern uint32_t __stack_ddr_srv_end; sunxi_uart_t uart_dbg = { .base = 0x02500000, - .id = 2, + .id = 0, .gpio_tx = {GPIO_PIN(PORTH, 9), GPIO_PERIPH_MUX5}, .gpio_rx = {GPIO_PIN(PORTH, 10), GPIO_PERIPH_MUX5}, }; diff --git a/kernel/SyterKit/app/read_chip_efuse/main.c b/kernel/SyterKit/app/read_chip_efuse/main.c index 0cea1aee4e..146776c0d3 100644 --- a/kernel/SyterKit/app/read_chip_efuse/main.c +++ b/kernel/SyterKit/app/read_chip_efuse/main.c @@ -20,7 +20,7 @@ extern uint32_t __stack_ddr_srv_end; sunxi_uart_t uart_dbg = { .base = 0x02500000, - .id = 2, + .id = 0, .gpio_tx = {GPIO_PIN(PORTH, 9), GPIO_PERIPH_MUX5}, .gpio_rx = {GPIO_PIN(PORTH, 10), GPIO_PERIPH_MUX5}, }; diff --git a/kernel/SyterKit/app/read_chipsid/main.c b/kernel/SyterKit/app/read_chipsid/main.c index 420a1d86e6..1047497693 100644 --- a/kernel/SyterKit/app/read_chipsid/main.c +++ b/kernel/SyterKit/app/read_chipsid/main.c @@ -22,7 +22,7 @@ extern uint32_t __stack_ddr_srv_end; sunxi_uart_t uart_dbg = { .base = 0x02500000, - .id = 2, + .id = 0, .gpio_tx = {GPIO_PIN(PORTH, 9), GPIO_PERIPH_MUX5}, .gpio_rx = {GPIO_PIN(PORTH, 10), GPIO_PERIPH_MUX5}, }; diff --git a/kernel/SyterKit/app/syter_boot/main.c b/kernel/SyterKit/app/syter_boot/main.c index 44aac6946b..13c15f2276 100644 --- a/kernel/SyterKit/app/syter_boot/main.c +++ b/kernel/SyterKit/app/syter_boot/main.c @@ -30,7 +30,7 @@ extern uint32_t __stack_ddr_srv_start; extern uint32_t __stack_ddr_srv_end; #define CONFIG_KERNEL_FILENAME "zImage" -#define CONFIG_DTB_FILENAME "sun8i-v851s-tinyvision.dtb" +#define CONFIG_DTB_FILENAME "sunxi.dtb" #define CONFIG_SDMMC_SPEED_TEST_SIZE 1024 // (unit: 512B sectors) @@ -67,7 +67,7 @@ typedef struct sunxi_uart_t uart_dbg = { .base = 0x02500000, - .id = 2, + .id = 0, .gpio_tx = {GPIO_PIN(PORTH, 9), GPIO_PERIPH_MUX5}, .gpio_rx = {GPIO_PIN(PORTH, 10), GPIO_PERIPH_MUX5}, }; diff --git a/kernel/SyterKit/scripts/genimage.sh b/kernel/SyterKit/scripts/genimage.sh new file mode 100644 index 0000000000..acc50e73ae --- /dev/null +++ b/kernel/SyterKit/scripts/genimage.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +die() { + cat <&2 +Error: $@ + +Usage: ${0} -c GENIMAGE_CONFIG_FILE +EOF + exit 1 +} + +# Parse arguments and put into argument list of the script +opts="$(getopt -n "${0##*/}" -o c: -- "$@")" || exit $? +eval set -- "$opts" + +GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" + +while true ; do + case "$1" in + -c) + GENIMAGE_CFG="${2}"; + shift 2 ;; + --) # Discard all non-option parameters + shift 1; + break ;; + *) + die "unknown option '${1}'" ;; + esac +done + +[ -n "${GENIMAGE_CFG}" ] || die "Missing argument" + +# Pass an empty rootpath. genimage makes a full copy of the given rootpath to +# ${GENIMAGE_TMP}/root so passing TARGET_DIR would be a waste of time and disk +# space. We don't rely on genimage to build the rootfs image, just to insert a +# pre-built one in the disk image. + +trap 'rm -rf "${ROOTPATH_TMP}"' EXIT +ROOTPATH_TMP="$(mktemp -d)" +GENIMAGE_TMP="$(mktemp -d)" +rm -rf "${GENIMAGE_TMP}" + +genimage \ + --rootpath "${ROOTPATH_TMP}" \ + --tmppath "${GENIMAGE_TMP}" \ + --inputpath "${BINARIES_DIR}" \ + --outputpath "${BINARIES_DIR}" \ + --config "${GENIMAGE_CFG}" diff --git a/kernel/SyterKit/scripts/genimage_buildroot.cfg b/kernel/SyterKit/scripts/genimage_buildroot.cfg new file mode 100644 index 0000000000..e6fb6a7868 --- /dev/null +++ b/kernel/SyterKit/scripts/genimage_buildroot.cfg @@ -0,0 +1,36 @@ +image boot.vfat { + vfat { + files = { + "zImage", + "sunxi.dtb" + } + } + size = 8M +} + +image sdcard.img { + hdimage {} + + partition boot0 { + in-partition-table = "no" + image = "syter_boot_bin.elf" + offset = 8K + } + + partition boot0-gpt { + in-partition-table = "no" + image = "syter_boot_bin.elf" + offset = 128K + } + + partition kernel { + partition-type = 0xC + bootable = "true" + image = "boot.vfat" + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.img" + } +} diff --git a/kernel/SyterKit/scripts/genimage_syterboot_only.cfg b/kernel/SyterKit/scripts/genimage_syterboot_only.cfg new file mode 100644 index 0000000000..e0c038a1ee --- /dev/null +++ b/kernel/SyterKit/scripts/genimage_syterboot_only.cfg @@ -0,0 +1,15 @@ +image sdcard.img { + hdimage {} + + partition boot0 { + in-partition-table = "no" + image = "syter_boot_bin.elf" + offset = 8K + } + + partition boot0-gpt { + in-partition-table = "no" + image = "syter_boot_bin.elf" + offset = 128K + } +}