[U-Boot] [PATCH] board: mediatek: Add pumpkin board support

Fabien Parent fparent at baylibre.com
Mon May 13 14:02:29 UTC 2019


The pumpkin board is made by Gossamer Engineering and is using
a MediaTek SoC. The board currently comes in two available version:
MT8516 SoC and MT8167 SoC.
The board provides the following IOs: eMMC, NAND, SD card, USB type-A,
Ethernet, Wi-Fi, Bluetooth, Audio (jack out, 2 PDM port, 1 analog in),
serial over USB, and an expansion header.

Additionally there is a HDMI port, DSI port, and camera port only
on the MT8167 version of the board.

The board can be powered by battery and/or via a USB Type-C port and
is using a PMIC MT6392.

The eMMC and NAND are sharing pins and cannot be used together.

This commit is adding the basic boot support for the Pumpkin MT8516
board on the eMMC.

Signed-off-by: Fabien Parent <fparent at baylibre.com>
---
 arch/arm/dts/Makefile              |   3 +-
 arch/arm/dts/mt8516-pumpkin.dts    | 110 +++++++++++++++++++++++++++++
 arch/arm/mach-mediatek/Kconfig     |   1 +
 board/mediatek/pumpkin/Kconfig     |  13 ++++
 board/mediatek/pumpkin/MAINTAINERS |   6 ++
 board/mediatek/pumpkin/Makefile    |   3 +
 board/mediatek/pumpkin/pumpkin.c   |  14 ++++
 configs/pumpkin_defconfig          |  64 +++++++++++++++++
 include/configs/pumpkin.h          |  58 +++++++++++++++
 9 files changed, 271 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/mt8516-pumpkin.dts
 create mode 100644 board/mediatek/pumpkin/Kconfig
 create mode 100644 board/mediatek/pumpkin/MAINTAINERS
 create mode 100644 board/mediatek/pumpkin/Makefile
 create mode 100644 board/mediatek/pumpkin/pumpkin.c
 create mode 100644 configs/pumpkin_defconfig
 create mode 100644 include/configs/pumpkin.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 83058c4452..7b48e5e142 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -752,7 +752,8 @@ dtb-$(CONFIG_SOC_K3_AM6) += k3-am654-base-board.dtb k3-am654-r5-base-board.dtb
 
 dtb-$(CONFIG_ARCH_MEDIATEK) += \
 	mt7623n-bananapi-bpi-r2.dtb \
-	mt7629-rfb.dtb
+	mt7629-rfb.dtb \
+	mt8516-pumpkin.dtb
 
 dtb-$(CONFIG_TARGET_GE_BX50V3) += imx6q-bx50v3.dtb
 dtb-$(CONFIG_TARGET_MX53PPD) += imx53-ppd.dtb
diff --git a/arch/arm/dts/mt8516-pumpkin.dts b/arch/arm/dts/mt8516-pumpkin.dts
new file mode 100644
index 0000000000..cd43c1f5e3
--- /dev/null
+++ b/arch/arm/dts/mt8516-pumpkin.dts
@@ -0,0 +1,110 @@
+// SPDX-License-Identifier: GPL-2.0 OR MIT
+/*
+ * Copyright (C) 2019 BayLibre SAS.
+ * Author: Fabien Parent <fparent at baylibre.com>
+ */
+
+/dts-v1/;
+
+#include <config.h>
+#include "mt8516.dtsi"
+
+/ {
+	model = "Pumpkin MT8516";
+
+	chosen {
+		stdout-path = &uart0;
+	};
+
+	memory at 40000000 {
+		device_type = "memory";
+		reg = <0x40000000 0x20000000>;
+	};
+
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+
+		/* 128 KiB reserved for ARM Trusted Firmware (BL31) */
+		bl31_secmon_reserved: secmon at 43000000 {
+			no-map;
+			reg = <0 0x43000000 0 0x20000>;
+		};
+	};
+
+	reg_1p8v: regulator-1p8v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_3p3v: regulator-3p3v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+};
+
+&mmc0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_pins_default>;
+	bus-width = <4>;
+	max-frequency = <200000000>;
+	cap-mmc-highspeed;
+	mmc-hs200-1_8v;
+	cap-mmc-hw-reset;
+	vmmc-supply = <&reg_3p3v>;
+	vqmmc-supply = <&reg_1p8v>;
+	non-removable;
+	status = "okay";
+};
+
+&pinctrl {
+	mmc0_pins_default: mmc0default {
+		mux {
+			function = "msdc";
+			groups =  "msdc0";
+		};
+
+		conf-cmd-data {
+			pins = "MSDC0_CMD", "MSDC0_DAT0", "MSDC0_DAT1",
+			       "MSDC0_DAT2", "MSDC0_DAT3", "MSDC0_DAT4",
+			       "MSDC0_DAT5", "MSDC0_DAT6", "MSDC0_DAT7";
+			input-enable;
+			bias-pull-up;
+		};
+
+		conf-clk {
+			pins = "MSDC0_CLK";
+			bias-pull-down;
+		};
+
+		conf-rst {
+			pins = "MSDC0_RSTB";
+			bias-pull-up;
+		};
+	};
+
+	uart0_pins: uart0 {
+		mux {
+			function = "uart";
+			groups = "uart0_0_rxd_txd";
+		};
+	};
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pins>;
+	status = "okay";
+};
+
+&watchdog {
+	status = "okay";
+};
diff --git a/arch/arm/mach-mediatek/Kconfig b/arch/arm/mach-mediatek/Kconfig
index b5e91d4a7d..a7d594f48a 100644
--- a/arch/arm/mach-mediatek/Kconfig
+++ b/arch/arm/mach-mediatek/Kconfig
@@ -45,5 +45,6 @@ endchoice
 
 source "board/mediatek/mt7623/Kconfig"
 source "board/mediatek/mt7629/Kconfig"
+source "board/mediatek/pumpkin/Kconfig"
 
 endif
diff --git a/board/mediatek/pumpkin/Kconfig b/board/mediatek/pumpkin/Kconfig
new file mode 100644
index 0000000000..fb81fa8906
--- /dev/null
+++ b/board/mediatek/pumpkin/Kconfig
@@ -0,0 +1,13 @@
+if TARGET_MT8516
+
+config SYS_BOARD
+	default "pumpkin"
+
+config SYS_CONFIG_NAME
+	default "pumpkin"
+
+config MTK_BROM_HEADER_INFO
+	string
+	default "media=nor"
+
+endif
diff --git a/board/mediatek/pumpkin/MAINTAINERS b/board/mediatek/pumpkin/MAINTAINERS
new file mode 100644
index 0000000000..16beadc027
--- /dev/null
+++ b/board/mediatek/pumpkin/MAINTAINERS
@@ -0,0 +1,6 @@
+Pumpkin
+M:	Fabien Parent <fparent at baylibre.com>
+S:	Maintained
+F:	board/mediatek/pumpkin
+F:	include/configs/pumpkin.h
+F:	configs/pumpkin_defconfig
diff --git a/board/mediatek/pumpkin/Makefile b/board/mediatek/pumpkin/Makefile
new file mode 100644
index 0000000000..75fce4a393
--- /dev/null
+++ b/board/mediatek/pumpkin/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier:	GPL-2.0
+
+obj-y += pumpkin.o
diff --git a/board/mediatek/pumpkin/pumpkin.c b/board/mediatek/pumpkin/pumpkin.c
new file mode 100644
index 0000000000..c20e91c9e6
--- /dev/null
+++ b/board/mediatek/pumpkin/pumpkin.c
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019 BayLibre SAS
+ */
+
+#include <common.h>
+#include <dm.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_init(void)
+{
+	return 0;
+}
diff --git a/configs/pumpkin_defconfig b/configs/pumpkin_defconfig
new file mode 100644
index 0000000000..06e2b8f5b9
--- /dev/null
+++ b/configs/pumpkin_defconfig
@@ -0,0 +1,64 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_SYS_TEXT_BASE=0x4C000000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_TARGET_MT8516=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_DEBUG_UART_BASE=0x11005000
+CONFIG_DEBUG_UART_CLOCK=26000000
+# CONFIG_PSCI_RESET is not set
+CONFIG_DEBUG_UART=y
+CONFIG_FIT=y
+# CONFIG_FIT_ENABLE_SHA256_SUPPORT is not set
+# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
+CONFIG_DEFAULT_FDT_FILE="mt8516-pumpkin"
+# 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_BOOTI 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_ENV_EXISTS is not set
+# CONFIG_CMD_CRC32 is not set
+# CONFIG_CMD_MEMORY is not set
+# CONFIG_CMD_FLASH is not set
+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_SOURCE is not set
+# CONFIG_CMD_SETEXPR is not set
+# CONFIG_CMD_BLOCK_CACHE is not set
+# CONFIG_CMD_MISC is not set
+CONFIG_DEFAULT_DEVICE_TREE="mt8516-pumpkin"
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+# CONFIG_NET is not set
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_CLK=y
+CONFIG_DM_GPIO=y
+# CONFIG_INPUT is not set
+CONFIG_DM_MMC=y
+# CONFIG_MMC_QUIRKS is not set
+CONFIG_MMC_MTK=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_MT8516=y
+CONFIG_RAM=y
+CONFIG_BAUDRATE=921600
+CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART_MTK=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
+CONFIG_MTK_SERIAL=y
+CONFIG_WDT=y
+CONFIG_WDT_MTK=y
+# CONFIG_EFI_LOADER is not set
diff --git a/include/configs/pumpkin.h b/include/configs/pumpkin.h
new file mode 100644
index 0000000000..b81e587983
--- /dev/null
+++ b/include/configs/pumpkin.h
@@ -0,0 +1,58 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Configuration for Pumpkin board
+ *
+ * Copyright (C) 2019 BayLibre, SAS
+ * Author: Fabien Parent <fparent at baylibre.com
+ */
+
+#ifndef __PUMPKIN_H
+#define __PUMPKIN_H
+
+#include <linux/sizes.h>
+
+#define CONFIG_ENV_SIZE			SZ_4K
+#define CONFIG_SYS_LOAD_ADDR		CONFIG_SYS_TEXT_BASE
+#define CONFIG_SYS_MALLOC_LEN		SZ_4M
+
+#define CONFIG_CPU_ARMV8
+#define COUNTER_FREQUENCY		13000000
+
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE	-4
+#define CONFIG_SYS_NS16550_MEM32
+#define CONFIG_SYS_NS16550_COM1		0x11005000
+#define CONFIG_SYS_NS16550_CLK		26000000
+
+#define CONFIG_SYS_UBOOT_START		CONFIG_SYS_TEXT_BASE
+#define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_TEXT_BASE + SZ_2M - \
+						 GENERATED_GBL_DATA_SIZE)
+
+#define CONFIG_SYS_BOOTM_LEN		SZ_64M
+
+/* Environment settings */
+#include <config_distro_bootcmd.h>
+
+#define MMCBOOT \
+	"mmcdev=0\0" \
+	"kernel_partition=2\0" \
+	"rootfs_partition=3\0" \
+	"mmc_discover_partition=" \
+		"part start mmc ${mmcdev} ${kernel_partition} kernel_part_addr;" \
+		"part size mmc ${mmcdev} ${kernel_partition} kernel_part_size;\0" \
+	"mmcboot=" \
+		"mmc dev ${mmcdev};" \
+		"run mmc_discover_partition;" \
+		"mmc read ${kerneladdr} ${kernel_part_addr} ${kernel_part_size};" \
+		"setenv bootargs ${bootargs} root=/dev/mmcblk${mmcdev}p${rootfs_partition} rootwait; " \
+		"bootm ${kerneladdr}; \0"
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"kerneladdr=0x4A000000\0" \
+	"bootargs= " \
+		"console=tty0 console=ttyS0,921600n1 " \
+		"earlycon=uart8250,mmio32,0x11005000\0 " \
+	MMCBOOT \
+	"bootcmd=run mmcboot;\0"
+
+#endif
-- 
2.20.1



More information about the U-Boot mailing list