diff options
Diffstat (limited to 'roms/u-boot/board/mediatek')
36 files changed, 440 insertions, 0 deletions
diff --git a/roms/u-boot/board/mediatek/mt7620/Kconfig b/roms/u-boot/board/mediatek/mt7620/Kconfig new file mode 100644 index 000000000..b9137adcc --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7620/Kconfig @@ -0,0 +1,12 @@ +if BOARD_MT7620_RFB || BOARD_MT7620_MT7530_RFB + +config SYS_BOARD + default "mt7620" + +config SYS_VENDOR + default "mediatek" + +config SYS_CONFIG_NAME + default "mt7620" + +endif diff --git a/roms/u-boot/board/mediatek/mt7620/MAINTAINERS b/roms/u-boot/board/mediatek/mt7620/MAINTAINERS new file mode 100644 index 000000000..05db777ce --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7620/MAINTAINERS @@ -0,0 +1,9 @@ +MT7620_RFB BOARD +M: Weijie Gao <weijie.gao@mediatek.com> +S: Maintained +F: board/mediatek/mt7620 +F: include/configs/mt7620.h +F: configs/mt7620_rfb_defconfig +F: configs/mt7620_mt7530_rfb_defconfig +F: arch/mips/dts/mediatek,mt7620-rfb.dts +F: arch/mips/dts/mediatek,mt7620-mt7530-rfb.dts diff --git a/roms/u-boot/board/mediatek/mt7620/Makefile b/roms/u-boot/board/mediatek/mt7620/Makefile new file mode 100644 index 000000000..db129c5ab --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7620/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-y += board.o diff --git a/roms/u-boot/board/mediatek/mt7620/board.c b/roms/u-boot/board/mediatek/mt7620/board.c new file mode 100644 index 000000000..119b8fc9e --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7620/board.c @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2020 MediaTek Inc. All Rights Reserved. + * + * Author: Weijie Gao <weijie.gao@mediatek.com> + */ diff --git a/roms/u-boot/board/mediatek/mt7622/Kconfig b/roms/u-boot/board/mediatek/mt7622/Kconfig new file mode 100644 index 000000000..d0abdc0a6 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7622/Kconfig @@ -0,0 +1,17 @@ +if TARGET_MT7622 + +config SYS_BOARD + default "mt7622" + +config SYS_CONFIG_NAME + default "mt7622" + +config MTK_BROM_HEADER_INFO + string + default "lk=1" + +config MTK_BROM_HEADER_INFO + string + default "media=nor" + +endif diff --git a/roms/u-boot/board/mediatek/mt7622/MAINTAINERS b/roms/u-boot/board/mediatek/mt7622/MAINTAINERS new file mode 100644 index 000000000..a3e0e75ca --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7622/MAINTAINERS @@ -0,0 +1,6 @@ +MT7622 +M: Sam Shih <sam.shih@mediatek.com> +S: Maintained +F: board/mediatek/mt7622 +F: include/configs/mt7622.h +F: configs/mt7622_rfb_defconfig diff --git a/roms/u-boot/board/mediatek/mt7622/Makefile b/roms/u-boot/board/mediatek/mt7622/Makefile new file mode 100644 index 000000000..2c54d86ff --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7622/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-y += mt7622_rfb.o + diff --git a/roms/u-boot/board/mediatek/mt7622/mt7622_rfb.c b/roms/u-boot/board/mediatek/mt7622/mt7622_rfb.c new file mode 100644 index 000000000..0504d6177 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7622/mt7622_rfb.c @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 MediaTek Inc. + * Author: Sam Shih <sam.shih@mediatek.com> + */ + +#include <common.h> +#include <config.h> +#include <env.h> +#include <init.h> +#include <asm/global_data.h> + +DECLARE_GLOBAL_DATA_PTR; + +int board_init(void) +{ + gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; + return 0; +} + +int board_late_init(void) +{ + gd->env_valid = 1; //to load environment variable from persistent store + env_relocate(); + return 0; +} diff --git a/roms/u-boot/board/mediatek/mt7623/Kconfig b/roms/u-boot/board/mediatek/mt7623/Kconfig new file mode 100644 index 000000000..a8c670e71 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7623/Kconfig @@ -0,0 +1,13 @@ +if TARGET_MT7623 + +config SYS_BOARD + default "mt7623" + +config SYS_CONFIG_NAME + default "mt7623" + +config MTK_BROM_HEADER_INFO + string + default "lk=1" + +endif diff --git a/roms/u-boot/board/mediatek/mt7623/MAINTAINERS b/roms/u-boot/board/mediatek/mt7623/MAINTAINERS new file mode 100644 index 000000000..1a8d796bd --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7623/MAINTAINERS @@ -0,0 +1,14 @@ +MT7623 +M: Ryder Lee <ryder.lee@mediatek.com> +M: Weijie Gao <weijie.gao@mediatek.com> +S: Maintained +F: board/mediatek/mt7623 +F: include/configs/mt7623.h +F: configs/mt7623n_bpir2_defconfig + +UNIELEC U7623 +M: Ryder Lee <ryder.lee@mediatek.com> +M: David Woodhouse <dwmw2@infradead.org> +S: Maintained +F: arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts +F: configs/mt7623a_unielec_u7623_02_defconfig diff --git a/roms/u-boot/board/mediatek/mt7623/Makefile b/roms/u-boot/board/mediatek/mt7623/Makefile new file mode 100644 index 000000000..2b42071c4 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7623/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-y += mt7623_rfb.o diff --git a/roms/u-boot/board/mediatek/mt7623/mt7623_rfb.c b/roms/u-boot/board/mediatek/mt7623/mt7623_rfb.c new file mode 100644 index 000000000..755e87908 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7623/mt7623_rfb.c @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 MediaTek Inc. + */ + +#include <common.h> +#include <mmc.h> +#include <asm/global_data.h> + +DECLARE_GLOBAL_DATA_PTR; + +int board_init(void) +{ + /* address of boot parameters */ + gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; + + return 0; +} + +#ifdef CONFIG_MMC +int mmc_get_boot_dev(void) +{ + int g_mmc_devid = -1; + char *uflag = (char *)0x81DFFFF0; + + if (!find_mmc_device(1)) + return 0; + + if (strncmp(uflag,"eMMC",4)==0) { + g_mmc_devid = 0; + printf("Boot From Emmc(id:%d)\n\n", g_mmc_devid); + } else { + g_mmc_devid = 1; + printf("Boot From SD(id:%d)\n\n", g_mmc_devid); + } + return g_mmc_devid; +} + +int mmc_get_env_dev(void) +{ + return mmc_get_boot_dev(); +} +#endif diff --git a/roms/u-boot/board/mediatek/mt7628/Kconfig b/roms/u-boot/board/mediatek/mt7628/Kconfig new file mode 100644 index 000000000..d6b6f9d63 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7628/Kconfig @@ -0,0 +1,12 @@ +if BOARD_MT7628_RFB + +config SYS_BOARD + default "mt7628" + +config SYS_VENDOR + default "mediatek" + +config SYS_CONFIG_NAME + default "mt7628" + +endif diff --git a/roms/u-boot/board/mediatek/mt7628/MAINTAINERS b/roms/u-boot/board/mediatek/mt7628/MAINTAINERS new file mode 100644 index 000000000..032fd0e2f --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7628/MAINTAINERS @@ -0,0 +1,7 @@ +MT7628_RFB BOARD +M: Weijie Gao <weijie.gao@mediatek.com> +S: Maintained +F: board/mediatek/mt7628 +F: include/configs/mt7628.h +F: configs/mt7628_rfb_defconfig +F: arch/mips/dts/mediatek,mt7628-rfb.dts diff --git a/roms/u-boot/board/mediatek/mt7628/Makefile b/roms/u-boot/board/mediatek/mt7628/Makefile new file mode 100644 index 000000000..db129c5ab --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7628/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-y += board.o diff --git a/roms/u-boot/board/mediatek/mt7628/board.c b/roms/u-boot/board/mediatek/mt7628/board.c new file mode 100644 index 000000000..f837a06fb --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7628/board.c @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2020 MediaTek Inc. All Rights Reserved. + * + * Author: Weijie Gao <weijie.gao@mediatek.com> + */ + +#include <common.h> diff --git a/roms/u-boot/board/mediatek/mt7629/Kconfig b/roms/u-boot/board/mediatek/mt7629/Kconfig new file mode 100644 index 000000000..6055164b5 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7629/Kconfig @@ -0,0 +1,17 @@ +if TARGET_MT7629 + +config SYS_BOARD + default "mt7629" + +config SYS_CONFIG_NAME + default "mt7629" + +config MTK_SPL_PAD_SIZE + hex + default 0x10000 + +config MTK_BROM_HEADER_INFO + string + default "media=nor" + +endif diff --git a/roms/u-boot/board/mediatek/mt7629/MAINTAINERS b/roms/u-boot/board/mediatek/mt7629/MAINTAINERS new file mode 100644 index 000000000..424f11516 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7629/MAINTAINERS @@ -0,0 +1,7 @@ +MT7629 +M: Ryder Lee <ryder.lee@mediatek.com> +M: Weijie Gao <weijie.gao@mediatek.com> +S: Maintained +F: board/mediatek/mt7629 +F: include/configs/mt7629.h +F: configs/mt7629_rfb_defconfig diff --git a/roms/u-boot/board/mediatek/mt7629/Makefile b/roms/u-boot/board/mediatek/mt7629/Makefile new file mode 100644 index 000000000..83ccbba8c --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7629/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-y += mt7629_rfb.o diff --git a/roms/u-boot/board/mediatek/mt7629/mt7629_rfb.c b/roms/u-boot/board/mediatek/mt7629/mt7629_rfb.c new file mode 100644 index 000000000..d1bca6d62 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt7629/mt7629_rfb.c @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 MediaTek Inc. + */ + +#include <common.h> +#include <asm/global_data.h> + +DECLARE_GLOBAL_DATA_PTR; + +int board_init(void) +{ + /* address of boot parameters */ + gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; + + return 0; +} diff --git a/roms/u-boot/board/mediatek/mt8183/Kconfig b/roms/u-boot/board/mediatek/mt8183/Kconfig new file mode 100644 index 000000000..b75c3b8d8 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8183/Kconfig @@ -0,0 +1,13 @@ +if TARGET_MT8183 + +config SYS_BOARD + default "mt8183" + +config SYS_CONFIG_NAME + default "mt8183" + +config MTK_BROM_HEADER_INFO + string + default "media=emmc" + +endif diff --git a/roms/u-boot/board/mediatek/mt8183/MAINTAINERS b/roms/u-boot/board/mediatek/mt8183/MAINTAINERS new file mode 100644 index 000000000..a49995e1b --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8183/MAINTAINERS @@ -0,0 +1,6 @@ +MT8183 Pumpkin +M: Fabien Parent <fparent@baylibre.com> +S: Maintained +F: board/mediatek/mt8183 +F: include/configs/mt8183.h +F: configs/mt8183_pumpkin_defconfig diff --git a/roms/u-boot/board/mediatek/mt8183/Makefile b/roms/u-boot/board/mediatek/mt8183/Makefile new file mode 100644 index 000000000..90b5b7232 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8183/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-y += mt8183_pumpkin.o diff --git a/roms/u-boot/board/mediatek/mt8183/mt8183_pumpkin.c b/roms/u-boot/board/mediatek/mt8183/mt8183_pumpkin.c new file mode 100644 index 000000000..db613ebdc --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8183/mt8183_pumpkin.c @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2020 BayLibre SAS + * Author: Fabien Parent <fparent@baylibre.com> + */ + +#include <common.h> +#include <dm.h> +#include <net.h> + +int board_init(void) +{ + struct udevice *dev; + int ret; + + if (CONFIG_IS_ENABLED(USB_GADGET)) { + ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC, 0, &dev); + if (ret) { + pr_err("%s: Cannot find USB device\n", __func__); + return ret; + } + } + + if (CONFIG_IS_ENABLED(USB_ETHER)) + usb_ether_init(); + + return 0; +} diff --git a/roms/u-boot/board/mediatek/mt8512/Kconfig b/roms/u-boot/board/mediatek/mt8512/Kconfig new file mode 100644 index 000000000..87bd1fbe6 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8512/Kconfig @@ -0,0 +1,14 @@ +if TARGET_MT8512 + +config SYS_BOARD + default "mt8512" + +config SYS_CONFIG_NAME + default "mt8512" + + +config MTK_BROM_HEADER_INFO + string + default "media=nor" + +endif diff --git a/roms/u-boot/board/mediatek/mt8512/MAINTAINERS b/roms/u-boot/board/mediatek/mt8512/MAINTAINERS new file mode 100644 index 000000000..966b1a749 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8512/MAINTAINERS @@ -0,0 +1,6 @@ +MT8512 +M: Mingming lee <mingming.lee@mediatek.com> +S: Maintained +F: board/mediatek/mt8512 +F: include/configs/mt8512.h +F: configs/mt8512_bm1_emmc_defconfig diff --git a/roms/u-boot/board/mediatek/mt8512/Makefile b/roms/u-boot/board/mediatek/mt8512/Makefile new file mode 100644 index 000000000..c1f596b39 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8512/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-y += mt8512.o diff --git a/roms/u-boot/board/mediatek/mt8512/mt8512.c b/roms/u-boot/board/mediatek/mt8512/mt8512.c new file mode 100644 index 000000000..ac3adb801 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8512/mt8512.c @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2019 MediaTek Inc. + */ + +#include <common.h> +#include <dm.h> +#include <log.h> +#include <wdt.h> +#include <asm/global_data.h> + +DECLARE_GLOBAL_DATA_PTR; + +int board_init(void) +{ + /* address of boot parameters */ + gd->bd->bi_boot_params = gd->ram_base + 0x100; + + debug("gd->fdt_blob is %p\n", gd->fdt_blob); + return 0; +} diff --git a/roms/u-boot/board/mediatek/mt8516/Kconfig b/roms/u-boot/board/mediatek/mt8516/Kconfig new file mode 100644 index 000000000..a87d3872f --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8516/Kconfig @@ -0,0 +1,13 @@ +if TARGET_MT8516 + +config SYS_BOARD + default "mt8516" + +config SYS_CONFIG_NAME + default "mt8516" + +config MTK_BROM_HEADER_INFO + string + default "media=emmc" + +endif diff --git a/roms/u-boot/board/mediatek/mt8516/MAINTAINERS b/roms/u-boot/board/mediatek/mt8516/MAINTAINERS new file mode 100644 index 000000000..2f0d8f646 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8516/MAINTAINERS @@ -0,0 +1,6 @@ +MT8516 Pumpkin +M: Fabien Parent <fparent@baylibre.com> +S: Maintained +F: board/mediatek/mt8516 +F: include/configs/mt8516.h +F: configs/mt8516_pumpkin_defconfig diff --git a/roms/u-boot/board/mediatek/mt8516/Makefile b/roms/u-boot/board/mediatek/mt8516/Makefile new file mode 100644 index 000000000..1d4815d13 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8516/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-y += mt8516_pumpkin.o diff --git a/roms/u-boot/board/mediatek/mt8516/mt8516_pumpkin.c b/roms/u-boot/board/mediatek/mt8516/mt8516_pumpkin.c new file mode 100644 index 000000000..42f3863b9 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8516/mt8516_pumpkin.c @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2019 BayLibre SAS + */ + +#include <common.h> +#include <dm.h> +#include <net.h> + +int board_init(void) +{ + return 0; +} + +int board_late_init(void) +{ + struct udevice *dev; + int ret; + + if (CONFIG_IS_ENABLED(USB_GADGET)) { + ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC, 0, &dev); + if (ret) { + pr_err("%s: Cannot find USB device\n", __func__); + return ret; + } + } + + if (CONFIG_IS_ENABLED(USB_ETHER)) + usb_ether_init(); + + return 0; +} diff --git a/roms/u-boot/board/mediatek/mt8518/Kconfig b/roms/u-boot/board/mediatek/mt8518/Kconfig new file mode 100644 index 000000000..1971c4d8c --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8518/Kconfig @@ -0,0 +1,14 @@ +if TARGET_MT8518 + +config SYS_BOARD + default "mt8518" + +config SYS_CONFIG_NAME + default "mt8518" + + +config MTK_BROM_HEADER_INFO + string + default "media=nor" + +endif diff --git a/roms/u-boot/board/mediatek/mt8518/MAINTAINERS b/roms/u-boot/board/mediatek/mt8518/MAINTAINERS new file mode 100644 index 000000000..c9151947a --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8518/MAINTAINERS @@ -0,0 +1,6 @@ +MT8518 +M: Mingming lee <mingming.lee@mediatek.com> +S: Maintained +F: board/mediatek/mt8518 +F: include/configs/mt8518.h +F: configs/mt8518_ap1_emmc_defconfig diff --git a/roms/u-boot/board/mediatek/mt8518/Makefile b/roms/u-boot/board/mediatek/mt8518/Makefile new file mode 100644 index 000000000..0884b32c5 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8518/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-y += mt8518_ap1.o diff --git a/roms/u-boot/board/mediatek/mt8518/mt8518_ap1.c b/roms/u-boot/board/mediatek/mt8518/mt8518_ap1.c new file mode 100644 index 000000000..fce5de676 --- /dev/null +++ b/roms/u-boot/board/mediatek/mt8518/mt8518_ap1.c @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2019 MediaTek Inc. + */ + +#include <common.h> +#include <dm.h> +#include <init.h> +#include <log.h> +#include <asm/global_data.h> + +DECLARE_GLOBAL_DATA_PTR; + +int board_init(void) +{ + /* address of boot parameters */ + gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; + + debug("gd->fdt_blob is %p\n", gd->fdt_blob); + return 0; +} + +int board_late_init(void) +{ +#ifdef CONFIG_USB_GADGET + struct udevice *dev; + int ret; +#endif + +#ifdef CONFIG_USB_GADGET + ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC, 0, &dev); + if (ret) { + pr_err("%s: Cannot find USB device\n", __func__); + return ret; + } +#endif + + return 0; +} |