[U-Boot] [PATCH v4 07/19] rockchip: rk3066: add mk808 board files
=?UTF-8?q?Pawe=C5=82=20Jarosz?=
paweljarosz3691 at gmail.com
Thu Aug 17 13:13:26 UTC 2017
mk808 is a tv stick with two usb ports, micro sd card slot, hdmi and
nand onboard.
Signed-off-by: Paweł Jarosz <paweljarosz3691 at gmail.com>
Acked-by: Simon Glass <sjg at chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich at theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich at theobroma-systems.com>
---
Changes since v1:
- added nand support
- dropped spl of-platdata
Changes since v2:
- fixed dfu ram config
Changes since v3:
- none
arch/arm/dts/Makefile | 1 +
arch/arm/dts/rk3066a-mk808.dts | 189 ++++++++++++++++++++++++++++
board/rikomagic/mk808_rk3066/Kconfig | 15 +++
board/rikomagic/mk808_rk3066/MAINTAINERS | 6 +
board/rikomagic/mk808_rk3066/Makefile | 7 ++
board/rikomagic/mk808_rk3066/mk808_rk3066.c | 10 ++
configs/mk808_defconfig | 114 +++++++++++++++++
include/configs/mk808_rk3066.h | 61 +++++++++
8 files changed, 403 insertions(+)
create mode 100644 arch/arm/dts/rk3066a-mk808.dts
create mode 100644 board/rikomagic/mk808_rk3066/Kconfig
create mode 100644 board/rikomagic/mk808_rk3066/MAINTAINERS
create mode 100644 board/rikomagic/mk808_rk3066/Makefile
create mode 100644 board/rikomagic/mk808_rk3066/mk808_rk3066.c
create mode 100644 configs/mk808_defconfig
create mode 100644 include/configs/mk808_rk3066.h
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 2cbdb17..fd4bb4f 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -29,6 +29,7 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
dtb-$(CONFIG_EXYNOS7420) += exynos7420-espresso7420.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += \
rk3036-sdk.dtb \
+ rk3066a-mk808.dtb \
rk3188-radxarock.dtb \
rk3288-evb.dtb \
rk3288-fennec.dtb \
diff --git a/arch/arm/dts/rk3066a-mk808.dts b/arch/arm/dts/rk3066a-mk808.dts
new file mode 100644
index 0000000..0a452d7
--- /dev/null
+++ b/arch/arm/dts/rk3066a-mk808.dts
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2017 Paweł Jarosz <paweljarosz3691 at gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+ or X11
+ */
+
+/dts-v1/;
+#include "rk3066a.dtsi"
+
+/ {
+ model = "Rikomagic MK808";
+ compatible = "rikomagic,mk808", "rockchip,rk3066a";
+
+ chosen {
+ stdout-path = "serial2:115200n8";
+ };
+
+ memory at 60000000 {
+ reg = <0x60000000 0x40000000>;
+ device_type = "memory";
+ };
+
+ gpio-leds {
+ compatible = "gpio-leds";
+
+ blue {
+ label = "mk808:blue:power";
+ gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
+ default-state = "off";
+ linux,default-trigger = "default-on";
+ };
+ };
+
+ vcc_io: vcc-io {
+ compatible = "regulator-fixed";
+ regulator-name = "vcc_io";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ vcc_host: usb-host-regulator {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ gpio = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+ pinctrl-0 = <&host_drv>;
+ pinctrl-names = "default";
+ regulator-always-on;
+ regulator-name = "host-pwr";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ startup-delay-us = <100000>;
+ vin-supply = <&vcc_io>;
+ };
+
+ vcc_otg: usb-otg-regulator {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ gpio = <&gpio0 5 GPIO_ACTIVE_HIGH>;
+ pinctrl-0 = <&otg_drv>;
+ pinctrl-names = "default";
+ regulator-always-on;
+ regulator-name = "vcc_otg";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ startup-delay-us = <100000>;
+ vin-supply = <&vcc_io>;
+ };
+
+ vcc_sd: sdmmc-regulator {
+ compatible = "regulator-fixed";
+ gpio = <&gpio3 7 GPIO_ACTIVE_LOW>;
+ pinctrl-0 = <&sdmmc_pwr>;
+ pinctrl-names = "default";
+ regulator-name = "vcc_sd";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ startup-delay-us = <100000>;
+ vin-supply = <&vcc_io>;
+ };
+
+ vcc_wifi: sdio-regulator {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ gpio = <&gpio3 24 GPIO_ACTIVE_HIGH>;
+ pinctrl-0 = <&wifi_pwr>;
+ pinctrl-names = "default";
+ regulator-name = "vcc_wifi";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ startup-delay-us = <100000>;
+ vin-supply = <&vcc_io>;
+ };
+};
+
+&dmc {
+ compatible = "rockchip,rk3066-dmc", "syscon";
+ rockchip,pctl-timing = <0x12c 0xc8 0x1f4 0x1e 0x4e 0x4 0x69 0x6
+ 0x3 0x0 0x6 0x5 0xc 0x10 0x6 0x4
+ 0x4 0x5 0x4 0x200 0x3 0xa 0x40 0x0
+ 0x1 0x5 0x5 0x3 0xc 0x1e 0x100 0x0
+ 0x4 0x0>;
+ rockchip,phy-timing = <0x208c6690 0x690878 0x10022a00
+ 0x220 0x40 0x0 0x0>;
+ rockchip,sdram-params = <0x24716310 0 2 300000000 3 9 0>;
+};
+
+&mmc0 {
+ bus-width = <4>;
+ cap-mmc-highspeed;
+ cap-sd-highspeed;
+ num-slots = <1>;
+ vmmc-supply = <&vcc_sd>;
+ status = "okay";
+};
+
+&mmc1 {
+ bus-width = <4>;
+ disable-wp;
+ non-removable;
+ num-slots = <1>;
+ pinctrl-0 = <&sd1_clk &sd1_cmd &sd1_bus4>;
+ pinctrl-names = "default";
+ vmmc-supply = <&vcc_wifi>;
+ status = "okay";
+};
+
+&nandc {
+ u-boot,dm-spl;
+ status = "okay";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ nand at 0 {
+ u-boot,dm-spl;
+ reg = <0>;
+ nand-ecc-mode = "hw_syndrome";
+ nand-ecc-strength = <40>;
+ nand-ecc-step-size = <1024>;
+ rockchip,protect-bootrom-blocks;
+ };
+};
+
+&pinctrl {
+ usb-host {
+ host_drv: host-drv {
+ rockchip,pins = <RK_GPIO0 6 RK_FUNC_GPIO &pcfg_pull_default>;
+ };
+ };
+
+ usb-otg {
+ otg_drv: otg-drv {
+ rockchip,pins = <RK_GPIO0 5 RK_FUNC_GPIO &pcfg_pull_default>;
+ };
+ };
+
+ sdmmc {
+ sdmmc_pwr: sdmmc-pwr {
+ rockchip,pins = <RK_GPIO3 7 RK_FUNC_GPIO &pcfg_pull_default>;
+ };
+ };
+
+ sdio {
+ wifi_pwr: wifi-pwr {
+ rockchip,pins = <RK_GPIO3 24 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+};
+
+&uart2 {
+ status = "okay";
+ u-boot,dm-pre-reloc;
+};
+
+&usb_host {
+ status = "okay";
+};
+
+&usb_otg {
+ u-boot,dm-spl;
+ status = "okay";
+};
+
+&usbphy {
+ status = "okay";
+};
+
+&wdt {
+ status = "okay";
+};
diff --git a/board/rikomagic/mk808_rk3066/Kconfig b/board/rikomagic/mk808_rk3066/Kconfig
new file mode 100644
index 0000000..0da0a17
--- /dev/null
+++ b/board/rikomagic/mk808_rk3066/Kconfig
@@ -0,0 +1,15 @@
+if TARGET_MK808_RK3066
+
+config SYS_BOARD
+ default "mk808_rk3066"
+
+config SYS_VENDOR
+ default "rikomagic"
+
+config SYS_CONFIG_NAME
+ default "mk808_rk3066"
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+ def_bool y
+
+endif
diff --git a/board/rikomagic/mk808_rk3066/MAINTAINERS b/board/rikomagic/mk808_rk3066/MAINTAINERS
new file mode 100644
index 0000000..65b5cbd
--- /dev/null
+++ b/board/rikomagic/mk808_rk3066/MAINTAINERS
@@ -0,0 +1,6 @@
+MK808
+M: Paweł Jarosz <paweljarosz3691 at gmail.com>
+S: Maintained
+F: include/configs/mk808_rk3066.h
+F: configs/mk808-rk3066_defconfig
+F: board/rikomagic/mk808_rk3066
diff --git a/board/rikomagic/mk808_rk3066/Makefile b/board/rikomagic/mk808_rk3066/Makefile
new file mode 100644
index 0000000..ef5ba56
--- /dev/null
+++ b/board/rikomagic/mk808_rk3066/Makefile
@@ -0,0 +1,7 @@
+#
+# Copyright (c) 2017 Paweł‚ Jarosz <paweljarosz3691 at gmail.com>
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y += mk808_rk3066.o
diff --git a/board/rikomagic/mk808_rk3066/mk808_rk3066.c b/board/rikomagic/mk808_rk3066/mk808_rk3066.c
new file mode 100644
index 0000000..e5d66fe
--- /dev/null
+++ b/board/rikomagic/mk808_rk3066/mk808_rk3066.c
@@ -0,0 +1,10 @@
+/*
+ * (C) Copyright 2017 Paweł Jarosz <paweljarosz3691 at gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
diff --git a/configs/mk808_defconfig b/configs/mk808_defconfig
new file mode 100644
index 0000000..ab67e4f
--- /dev/null
+++ b/configs/mk808_defconfig
@@ -0,0 +1,114 @@
+CONFIG_ARM=y
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_ROCKCHIP_RK3066=y
+CONFIG_TARGET_MK808_RK3066=y
+CONFIG_DEFAULT_DEVICE_TREE="rk3066a-mk808"
+CONFIG_CMD_REGULATOR=y
+CONFIG_CLK=y
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_RAM=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_USE_PRIVATE_LIBGCC=y
+CONFIG_CMD_DHRYSTONE=y
+CONFIG_ERRNO_STR=y
+CONFIG_SYS_NS16550=y
+CONFIG_BOOTDELAY=1
+CONFIG_CONSOLE_MUX=y
+CONFIG_DISPLAY_BOARDINFO=y
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_CMD_BOOTZ=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_CACHE=y
+CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_SYSRESET=y
+CONFIG_CMD_MMC=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_DM_MMC=y
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_EFI_PARTITION is not set
+CONFIG_CMD_BOOTEFI is not set
+CONFIG_CMD_BOOTEFI_HELLO_COMPILE is not set
+CONFIG_EFI_LOADER is not set
+CONFIG_CMD_GPIO=y
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_GENERIC=y
+CONFIG_PINCTRL_ROCKCHIP_RK3066=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_BASE=0x20064000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_STORAGE=y
+CONFIG_CMD_USB=y
+CONFIG_USB_DWC2=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_GADGET_DWC2_OTG=y
+CONFIG_USB_GADGET_DWC2_OTG_PHY=y
+CONFIG_USB_GADGET_VBUS_DRAW=500
+CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_G_DNL_MANUFACTURER="Rockchip"
+CONFIG_G_DNL_VENDOR_NUM=0x2207
+CONFIG_G_DNL_PRODUCT_NUM=0x300a
+CONFIG_BOARD_LATE_INIT=y
+CONFIG_MTD_DEVICE=y
+CONFIG_NAND_ROCKCHIP=y
+CONFIG_CMD_NAND=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_NAND=y
+CONFIG_DFU_NAND=y
+CONFIG_USB_FUNCTION_DFU=y
+CONFIG_DFU_RAM=y
+CONFIG_CMD_DFU=y
+CONFIG_SPL_BLK=y
+CONFIG_SPL_CLK=y
+CONFIG_SPL_DFU_RAM=y
+CONFIG_SPL_DFU_SUPPORT=y
+CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_SPL_ENV_SUPPORT=y
+CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SPL_NAND_SUPPORT=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_SPL_PINCTRL=y
+CONFIG_SPL_RAM=y
+CONFIG_SPL_RAM_SUPPORT=y
+CONFIG_SPL_REGMAP=y
+CONFIG_SPL_STACK_R=y
+CONFIG_SPL_STACK_R_ADDR=0x70000000
+CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x200000
+CONFIG_SPL_SYSCON=y
+CONFIG_SPL_TINY_MEMSET=y
+CONFIG_SPL_USB_GADGET_SUPPORT=y
+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+# CONFIG_SPL_USE_ARCH_MEMCPY is not set
+# CONFIG_SPL_USE_ARCH_MEMSET is not set
+# CONFIG_SPL_SIMPLE_BUS is not set
+# CONFIG_SPL_PINCTRL_FULL is not set
+# CONFIG_SPL_EFI_PARTITION is not set
+# CONFIG_SPL_BOARD_INIT is not set
+# CONFIG_SPL_DOS_PARTITION is not set
+# CONFIG_SPL_EXT_SUPPORT is not set
+# CONFIG_SPL_LIBDISK_SUPPORT is not set
+# CONFIG_SPL_MMC_SUPPORT is not set
+CONFIG_TPL_BOOTROM_SUPPORT=y
+CONFIG_TPL_CLK=y
+CONFIG_TPL_DM=y
+CONFIG_TPL_DM_SERIAL=y
+# CONFIG_TPL_DRIVERS_MISC_SUPPORT is not set
+CONFIG_TPL_OF_CONTROL=y
+CONFIG_TPL_OF_PLATDATA=y
+CONFIG_TPL_RAM=y
+CONFIG_TPL_REGMAP=y
+CONFIG_TPL_ROCKCHIP_BACK_TO_BROM=y
+CONFIG_TPL_SERIAL_SUPPORT=y
+CONFIG_TPL_SYSCON=y
+CONFIG_TPL_TINY_MEMSET=y
diff --git a/include/configs/mk808_rk3066.h b/include/configs/mk808_rk3066.h
new file mode 100644
index 0000000..d6b1fc8
--- /dev/null
+++ b/include/configs/mk808_rk3066.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2017 Paweł Jarosz <paweljarosz3691 at gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+/*
+ * Using bootrom layout for rockchip-idb* and spl*. Size is nand erase size.
+ */
+#define MTDPARTS_DEFAULT \
+ "mtdparts=rockchip-nand.0:" \
+ "4M(idb)," \
+ "4M(idb.backup)," \
+ "4M(spl)," \
+ "4M(spl.backup1)," \
+ "4M(spl.backup2)," \
+ "4M(spl.backup3)," \
+ "4M(spl.backup4)," \
+ "4M(u-boot)," \
+ "4M(u-boot.backup)," \
+ "4M(u-boot-env)," \
+ "4M(u-boot-env.backup)," \
+ "16M(kernel)," \
+ "32M(initrd)," \
+ "-(rootfs)"
+
+#define DFU_ALT_INFO_NAND \
+ "idb raw 0x0 0x400000;" \
+ "idb.backup raw 0x400000 0x400000;" \
+ "spl raw 0x800000 0x400000;" \
+ "spl.backup1 raw 0xC00000 0x400000;" \
+ "spl.backup2 raw 0x1000000 0x400000;" \
+ "spl.backup3 raw 0x1400000 0x400000;" \
+ "spl.backup4 raw 0x1800000 0x400000;" \
+ "u-boot raw 0x1C00000 0x400000;" \
+ "u-boot.backup raw 0x2000000 0x400000;" \
+ "u-boot-env raw 0x2400000 0x400000;" \
+ "u-boot-env.backup raw 0x2800000 0x400000;" \
+ "kernel raw 0x2C00000 0x1000000;" \
+ "initrd raw 0x3C00000 0x2000000"
+
+#define DFU_ALT_INFO_RAM \
+ "tpl.bin ram 0x10080C00 0x10000;" \
+ "spl.bin ram 0x60000000 0x40000;" \
+ "u-boot.bin ram 0x60408000 0x80000"
+
+#define ROCKCHIP_DEVICE_SETTINGS \
+ "mtdparts=" MTDPARTS_DEFAULT "\0" \
+ "dfu_alt_info=" DFU_ALT_INFO_NAND "\0" \
+ "dfu_alt_info_ram=" DFU_ALT_INFO_RAM "\0"
+
+#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_4M
+#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x01c00000
+#define CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND 0x02000000
+
+#include <configs/rk3066_common.h>
+
+#endif
+
--
2.7.4
More information about the U-Boot
mailing list