diff --git a/configs/mt8365_evk_defconfig b/configs/mt8365_evk_defconfig new file mode 100644 index 0000000000000000000000000000000000000000..3d129661da0213d730a98692caab8e93811e8877 --- /dev/null +++ b/configs/mt8365_evk_defconfig @@ -0,0 +1,83 @@ +CONFIG_ARM=y +CONFIG_SYS_CONFIG_NAME="mediatek_genio" +CONFIG_POSITION_INDEPENDENT=y +CONFIG_ARCH_MEDIATEK=y +CONFIG_SYS_MALLOC_F_LEN=0x4000 +CONFIG_NR_DRAM_BANKS=1 +CONFIG_ENV_SIZE=0x1000 +CONFIG_ENV_OFFSET=0x0 +CONFIG_DM_GPIO=y +CONFIG_DEFAULT_DEVICE_TREE="mt8365-evk" +CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_TARGET_MT8365=y +CONFIG_DEBUG_UART_BASE=0x11002000 +CONFIG_DEBUG_UART_CLOCK=26000000 +CONFIG_IDENT_STRING="i350_evk" +# CONFIG_PSCI_RESET is not set +CONFIG_SYS_LOAD_ADDR=0x4c000000 +CONFIG_DEBUG_UART=y +# CONFIG_ANDROID_BOOT_IMAGE is not set +CONFIG_FIT=y +# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set +CONFIG_USE_BOOTCOMMAND=y +CONFIG_BOOTCOMMAND="run distro_bootcmd; mmcdev=0; run force_mmc_boot" +CONFIG_DEFAULT_FDT_FILE="mt8365-evk" +# CONFIG_DISPLAY_BOARDINFO is not set +CONFIG_HUSH_PARSER=y +# CONFIG_CMD_BDI is not set +# CONFIG_CMD_CONSOLE is not set +# CONFIG_CMD_BOOTD is not set +# CONFIG_CMD_ELF is not set +# CONFIG_CMD_GO is not set +# CONFIG_CMD_IMI is not set +# CONFIG_CMD_XIMG is not set +# CONFIG_CMD_EXPORTENV is not set +# CONFIG_CMD_IMPORTENV is not set +# CONFIG_CMD_EDITENV is not set +# CONFIG_CMD_CRC32 is not set +# CONFIG_CMD_MEMORY is not set +CONFIG_CMD_CLK=y +CONFIG_CMD_GPT=y +# CONFIG_RANDOM_UUID is not set +# CONFIG_CMD_LOADB is not set +# CONFIG_CMD_LOADS is not set +CONFIG_CMD_MMC=y +CONFIG_CMD_PART=y +# CONFIG_CMD_ITEST is not set +# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_DHCP=y +# CONFIG_CMD_BLOCK_CACHE is not set +CONFIG_CMD_SYSBOOT=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +# CONFIG_DOS_PARTITION is not set +CONFIG_ENV_IS_IN_MMC=y +CONFIG_SYS_MMC_ENV_PART=2 +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +CONFIG_DEVRES=y +CONFIG_CLK=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0x4d000000 +CONFIG_FASTBOOT_BUF_SIZE=0x8000000 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=0 +CONFIG_FASTBOOT_MMC_BOOT_SUPPORT=y +# CONFIG_INPUT is not set +# CONFIG_MMC_QUIRKS is not set +CONFIG_MMC_MTK=y +CONFIG_PHY=y +CONFIG_PHY_MTK_TPHY=y +CONFIG_BAUDRATE=921600 +CONFIG_DM_SERIAL=y +CONFIG_DEBUG_UART_ANNOUNCE=y +CONFIG_MTK_SERIAL=y +CONFIG_USB=y +CONFIG_DM_USB_GADGET=y +CONFIG_USB_MTU3=y +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_VENDOR_NUM=0x0e8d +CONFIG_USB_GADGET_PRODUCT_NUM=0x201c +CONFIG_USB_ETHER=y +CONFIG_WDT=y +CONFIG_WDT_MTK=y diff --git a/configs/mt8365_evk_spl_da_defconfig b/configs/mt8365_evk_spl_da_defconfig new file mode 100644 index 0000000000000000000000000000000000000000..cedde84f78219ff64b94d4a4d0d4b904d0da9c58 --- /dev/null +++ b/configs/mt8365_evk_spl_da_defconfig @@ -0,0 +1,91 @@ +CONFIG_ARM=y +CONFIG_SYS_CONFIG_NAME="mediatek_genio" +CONFIG_COUNTER_FREQUENCY=13000000 +CONFIG_POSITION_INDEPENDENT=y +CONFIG_ARCH_MEDIATEK=y +CONFIG_TEXT_BASE=0x4c000000 +CONFIG_DM_GPIO=y +CONFIG_DEFAULT_DEVICE_TREE="mt8365-evk" +CONFIG_SPL_TEXT_BASE=0x40000000 +CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_TARGET_MT8365=y +CONFIG_SPL_MMC=y +CONFIG_SPL_SERIAL=y +CONFIG_SPL=y +CONFIG_IDENT_STRING="i350_evk" +# CONFIG_PSCI_RESET is not set +CONFIG_SYS_LOAD_ADDR=0x4c000000 +CONFIG_LTO=y +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_DEFAULT_FDT_FILE="mt8365-evk" +CONFIG_SILENT_CONSOLE=y +CONFIG_SPL_MAX_SIZE=0x20800 +CONFIG_SPL_HAS_BSS_LINKER_SECTION=y +CONFIG_SPL_BSS_START_ADDR=0x40020800 +CONFIG_SPL_NO_BSS_LIMIT=y +CONFIG_SPL_BOARD_INIT=y +CONFIG_SYS_SPL_MALLOC=y +CONFIG_HAS_CUSTOM_SPL_MALLOC_START=y +CONFIG_CUSTOM_SYS_SPL_MALLOC_ADDR=0x5c000000 +CONFIG_SYS_SPL_MALLOC_SIZE=0x9000000 +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y +CONFIG_SPL_ENV_SUPPORT=y +CONFIG_SPL_MMC_WRITE=y +CONFIG_SPL_WATCHDOG=y +CONFIG_CMD_GPT=y +# CONFIG_NET is not set +CONFIG_DM_ALLOW_MULTIPLE_DRIVERS=y +CONFIG_REGMAP=y +CONFIG_SYSCON=y +CONFIG_DEVRES=y +CONFIG_CLK=y +CONFIG_SPL_CLK=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0x65000000 +CONFIG_FASTBOOT_BUF_SIZE=0x15000000 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=0 +CONFIG_FASTBOOT_MMC_BOOT_SUPPORT=y +CONFIG_FASTBOOT_MMC_USER_SUPPORT=y +CONFIG_SPL_FASTBOOT=y +CONFIG_SPL_FASTBOOT_FLASH_MMC=y +CONFIG_SPL_FASTBOOT_MMC_BOOT_SUPPORT=y +CONFIG_SPL_FASTBOOT_MMC_USER_SUPPORT=y +CONFIG_DM_I2C=y +CONFIG_SYS_I2C_MT65XX=y +# CONFIG_INPUT is not set +CONFIG_MISC=y +CONFIG_FS_LOADER=y +CONFIG_SPL_FS_LOADER=y +# CONFIG_MMC_QUIRKS is not set +CONFIG_SUPPORT_EMMC_BOOT=y +CONFIG_MMC_MTK=y +CONFIG_PHY=y +CONFIG_SPL_PHY=y +CONFIG_PHY_MTK_TPHY=y +CONFIG_PINCTRL=y +CONFIG_PINCONF=y +CONFIG_PINCTRL_MT8365=y +CONFIG_POWER_DOMAIN=y +CONFIG_MTK_POWER_DOMAIN=y +CONFIG_DM_PMIC=y +CONFIG_MTK_PMIC_WRAP=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_MT6357=y +CONFIG_BAUDRATE=921600 +CONFIG_DM_SERIAL=y +CONFIG_MTK_SERIAL=y +CONFIG_USB=y +CONFIG_DM_USB_GADGET=y +CONFIG_SPL_DM_USB_GADGET=y +CONFIG_USB_MTU3=y +CONFIG_USB_GADGET=y +CONFIG_SPL_USB_GADGET=y +CONFIG_USB_GADGET_VENDOR_NUM=0x0e8d +CONFIG_USB_GADGET_PRODUCT_NUM=0x201c +CONFIG_WDT=y +CONFIG_WDT_MTK=y +# CONFIG_SPL_USE_TINY_PRINTF is not set +CONFIG_SPL_GZIP=y +CONFIG_ERRNO_STR=y +# CONFIG_EFI_LOADER is not set diff --git a/configs/mt8365_evk_spl_defconfig b/configs/mt8365_evk_spl_defconfig new file mode 100644 index 0000000000000000000000000000000000000000..cc057eb3d4d1aca2eab301da90452b23866245f2 --- /dev/null +++ b/configs/mt8365_evk_spl_defconfig @@ -0,0 +1,76 @@ +CONFIG_ARM=y +CONFIG_SYS_CONFIG_NAME="mediatek_genio" +CONFIG_COUNTER_FREQUENCY=13000000 +CONFIG_POSITION_INDEPENDENT=y +CONFIG_ARCH_MEDIATEK=y +CONFIG_TEXT_BASE=0x4c000000 +CONFIG_DM_GPIO=y +CONFIG_DEFAULT_DEVICE_TREE="mt8365-evk" +CONFIG_SPL_TEXT_BASE=0x40000000 +CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_TARGET_MT8365=y +CONFIG_SPL_MMC=y +CONFIG_SPL_SERIAL=y +CONFIG_SPL=y +CONFIG_IDENT_STRING="i350_evk" +# CONFIG_PSCI_RESET is not set +CONFIG_SYS_LOAD_ADDR=0x4c000000 +CONFIG_LTO=y +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_FIT=y +CONFIG_SPL_LOAD_FIT=y +CONFIG_SPL_LOAD_FIT_FULL=y +CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y +CONFIG_DEFAULT_FDT_FILE="mt8365-evk" +CONFIG_SILENT_CONSOLE=y +CONFIG_SPL_MAX_SIZE=0x20800 +CONFIG_SPL_HAS_BSS_LINKER_SECTION=y +CONFIG_SPL_BSS_START_ADDR=0x40020800 +CONFIG_SPL_NO_BSS_LIMIT=y +CONFIG_SYS_SPL_MALLOC=y +CONFIG_HAS_CUSTOM_SPL_MALLOC_START=y +CONFIG_CUSTOM_SYS_SPL_MALLOC_ADDR=0x5c000000 +CONFIG_SYS_SPL_MALLOC_SIZE=0x9000000 +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y +CONFIG_SPL_ENV_SUPPORT=y +CONFIG_SPL_MMC_WRITE=y +CONFIG_SPL_POWER=y +CONFIG_SPL_WATCHDOG=y +CONFIG_SPL_ATF=y +CONFIG_CMD_GPT=y +# CONFIG_NET is not set +CONFIG_DM_ALLOW_MULTIPLE_DRIVERS=y +CONFIG_REGMAP=y +CONFIG_SYSCON=y +CONFIG_DEVRES=y +CONFIG_CLK=y +CONFIG_SPL_CLK=y +CONFIG_DM_I2C=y +CONFIG_SYS_I2C_MT65XX=y +# CONFIG_INPUT is not set +CONFIG_MISC=y +CONFIG_FS_LOADER=y +CONFIG_SPL_FS_LOADER=y +# CONFIG_MMC_QUIRKS is not set +CONFIG_MMC_MTK=y +CONFIG_PHY=y +CONFIG_SPL_PHY=y +CONFIG_PHY_MTK_TPHY=y +CONFIG_PINCTRL=y +CONFIG_PINCONF=y +CONFIG_PINCTRL_MT8365=y +CONFIG_POWER_DOMAIN=y +CONFIG_MTK_POWER_DOMAIN=y +CONFIG_DM_PMIC=y +CONFIG_MTK_PMIC_WRAP=y +CONFIG_DM_REGULATOR=y +CONFIG_SPL_DM_REGULATOR=y +CONFIG_DM_REGULATOR_MT6357=y +CONFIG_BAUDRATE=921600 +CONFIG_DM_SERIAL=y +CONFIG_MTK_SERIAL=y +CONFIG_WDT=y +CONFIG_WDT_MTK=y +CONFIG_SPL_GZIP=y +CONFIG_ERRNO_STR=y +# CONFIG_EFI_LOADER is not set diff --git a/include/configs/mediatek_genio.h b/include/configs/mediatek_genio.h new file mode 100644 index 0000000000000000000000000000000000000000..dd648281e5b9cdf47ecce7278c6a154a7daf4167 --- /dev/null +++ b/include/configs/mediatek_genio.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Configuration for Mediatek Android based boards + * + * Copyright (C) 2024 BayLibre, SAS + * Author: Vitor Sato Eschholz <vsatoes@baylibre.com> + */ + +#ifndef __MEDIATEK_GENIO_H +#define __MEDIATEK_GENIO_H + +#ifdef CONFIG_TARGET_MT8365 +#include <configs/mt8365.h> +#endif + +#ifndef CONFIG_SPL +#define READ_KERNEL_MMC \ + "part start mmc ${mmcdev} kernel kernel_part_addr; " \ + "part size mmc ${mmcdev} kernel kernel_part_size; " \ + "mmc read ${kernel_addr_r} ${kernel_part_addr} ${kernel_part_size}; " + +#define FORCE_MMC_BOOT \ + "bootm ${kernel_addr_r}${boot_conf}" + +#ifdef CFG_EXTRA_ENV_SETTINGS +#undef CFG_EXTRA_ENV_SETTINGS +#endif +#define CFG_EXTRA_ENV_SETTINGS \ + "scriptaddr=0x40000000\0" \ + "fdt_addr_r=0x44000000\0" \ + "fdtoverlay_addr_r=0x44c00000\0" \ + "kernel_addr_r=0x45000000\0" \ + "ramdisk_addr_r=0x46000000\0" \ + "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ + "boot_conf=#conf-mediatek_" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ + "force_mmc_boot=" READ_KERNEL_MMC \ + "setenv bootargs \"${bootargs} root=PARTLABEL=rootfs rootwait \" ; " \ + FORCE_MMC_BOOT "\0" \ + BOOTENV +#endif + +#endif diff --git a/include/configs/mt8365.h b/include/configs/mt8365.h index 1a5aabf1b641656929643f9b1b34e63e01044c12..ba573c0f9b1ec2424054ec627835f04f19e729f0 100644 --- a/include/configs/mt8365.h +++ b/include/configs/mt8365.h @@ -20,6 +20,7 @@ #define CFG_SYS_NS16550_CLK 26000000 /* Environment settings */ +#ifndef CONFIG_SPL #include <config_distro_bootcmd.h> #define BOOT_TARGET_DEVICES(func) \ @@ -35,5 +36,6 @@ BOOTENV #define CONFIG_SETUP_MEMORY_TAGS - #endif + +#endif //__MT8365_H