u-boot: update rockchip to ac5a8f0

This commit is contained in:
Jonas Karlman 2018-08-21 23:37:45 +02:00
parent 46223dafc2
commit d4186711f8
16 changed files with 840 additions and 1495 deletions

View File

@ -18,8 +18,8 @@ PKG_NEED_UNPACK="$PROJECT_DIR/$PROJECT/bootloader"
case "$PROJECT" in
Rockchip)
PKG_VERSION="5ecf0ee"
PKG_SHA256="fba1d26583d446a5bbb5713fe37848e05b546d125384c2c2d2883414d61b7cad"
PKG_VERSION="ac5a8f08e811581376e731c898c21e4f79177ec2"
PKG_SHA256="e3ca0d99fef24649c75c4fe7cb0c6de069f98424a7dbf9d397f65b79b8749866"
PKG_URL="https://github.com/rockchip-linux/u-boot/archive/$PKG_VERSION.tar.gz"
PKG_PATCH_DIRS="rockchip"
PKG_DEPENDS_TARGET+=" rkbin"

View File

@ -1,65 +1,37 @@
From 85f5dd7511d2eaea04a6ba53dc60d1879060568b Mon Sep 17 00:00:00 2001
From de094e01bb6876d7025e8c1b665828f6764e2c70 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Sat, 2 Dec 2017 11:47:07 +0100
Subject: [PATCH] dont build libfdt
---
Makefile | 2 +-
scripts/Makefile.spl | 4 ++--
tools/Makefile | 4 ----
scripts/Makefile.spl | 2 +-
scripts/dtc/Makefile | 2 +-
tools/dtoc/fdt.py | 2 +-
4 files changed, 4 insertions(+), 8 deletions(-)
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 8086f3c93e..4796b488ae 100644
--- a/Makefile
+++ b/Makefile
@@ -1379,7 +1379,7 @@ $(timestamp_h): $(srctree)/Makefile FORCE
$(call filechk,timestamp.h)
checkbinman: tools
- @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools $(PYTHON) )); then \
+ @if ! ( echo 'from pylibfdt import libfdt' | ( python )); then \
echo >&2; \
echo >&2 '*** binman needs the Python libfdt library.'; \
echo >&2 '*** Either install it on your system, or try:'; \
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index b86ea76bab..ea54f9098c 100644
index e2f0741db6..9264103366 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -246,7 +246,7 @@ quiet_cmd_fdtgrep = FDTGREP $@
$(obj)/$(SPL_BIN).dtb: dts/dt.dtb $(objtree)/tools/fdtgrep FORCE
$(call if_changed,fdtgrep)
@@ -249,7 +249,7 @@ $(obj)/$(SPL_BIN)-pad.bin: $(obj)/$(SPL_BIN)
$(obj)/$(SPL_BIN).dtb: dts/dt-spl.dtb FORCE
$(call if_changed,copy)
-pythonpath = PYTHONPATH=tools
-pythonpath = PYTHONPATH=scripts/dtc/pylibfdt
+pythonpath = python
quiet_cmd_dtocc = DTOC C $@
cmd_dtocc = $(pythonpath) $(srctree)/tools/dtoc/dtoc -d $(obj)/$(SPL_BIN).dtb -o $@ platdata
@@ -370,7 +370,7 @@ ifneq ($(cmd_files),)
endif
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
index 90ef2db85c..077acd50d9 100644
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -31,4 +31,4 @@ $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
clean-files := dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h
checkdtoc: tools
- @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools $(PYTHON) )); then \
+ @if ! ( echo 'from pylibfdt import libfdt' | ( python )); then \
echo '*** dtoc needs the Python libfdt library. Either '; \
echo '*** install it on your system, or try:'; \
echo '***'; \
diff --git a/tools/Makefile b/tools/Makefile
index 8e1009bf6c..459c71ef1f 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -232,10 +232,6 @@ clean-dirs := lib common
always := $(hostprogs-y)
-# Build a libfdt Python module if swig is available
-# Use 'sudo apt-get install swig libpython-dev' to enable this
-always += $(if $(shell which swig 2> /dev/null),_libfdt.so)
-
# Generated LCD/video logo
LOGO_H = $(objtree)/include/bmp_logo.h
LOGO_DATA_H = $(objtree)/include/bmp_logo_data.h
# Added for U-Boot
-subdir-$(CONFIG_PYLIBFDT) += pylibfdt
+#subdir-$(CONFIG_PYLIBFDT) += pylibfdt
diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py
index dbc338653b..04f3c5935c 100644
--- a/tools/dtoc/fdt.py

View File

@ -0,0 +1,35 @@
From dfdfa7fb1a50c21a784a67e5f99d8714ca853c07 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Mon, 20 Aug 2018 22:55:34 +0200
Subject: [PATCH] rockchip: board: save cpuid to env
---
arch/arm/mach-rockchip/board.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c
index 233f0b6f9a..6c2021e32a 100644
--- a/arch/arm/mach-rockchip/board.c
+++ b/arch/arm/mach-rockchip/board.c
@@ -44,6 +44,7 @@ DECLARE_GLOBAL_DATA_PTR;
static int rockchip_set_serialno(void)
{
char serialno_str[VENDOR_SN_MAX];
+ char cpuid_str[CPUID_LEN * 2 + 1];
int ret = 0, i;
u8 cpuid[CPUID_LEN] = {0};
u8 low[CPUID_LEN / 2], high[CPUID_LEN / 2];
@@ -89,6 +90,13 @@ static int rockchip_set_serialno(void)
snprintf(serialno_str, sizeof(serialno_str), "%llx", serialno);
env_set("serial#", serialno_str);
+
+ memset(cpuid_str, 0, sizeof(cpuid_str));
+ for (i = 0; i < CPUID_LEN; i++) {
+ sprintf(&cpuid_str[i * 2], "%02x", cpuid[i]);
+ }
+
+ env_set("cpuid#", cpuid_str);
#ifdef CONFIG_ROCKCHIP_VENDOR_PARTITION
}
#endif

View File

@ -1,25 +0,0 @@
From 39dfedae58057500912a6f933fced3edb9376b3b Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Sun, 22 Oct 2017 12:48:24 +0200
Subject: [PATCH] rockchip: tinker: enable rockchip video driver
---
configs/tinker-rk3288_defconfig | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/configs/tinker-rk3288_defconfig b/configs/tinker-rk3288_defconfig
index 00e2d81954..62cae4f21e 100644
--- a/configs/tinker-rk3288_defconfig
+++ b/configs/tinker-rk3288_defconfig
@@ -80,6 +80,11 @@ CONFIG_G_DNL_PRODUCT_NUM=0x320a
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_SMSC95XX=y
+CONFIG_DM_VIDEO=y
+CONFIG_DISPLAY=y
+CONFIG_VIDEO_ROCKCHIP=y
+CONFIG_DISPLAY_ROCKCHIP_HDMI=y
+CONFIG_CONSOLE_SCROLL_LINES=10
CONFIG_USE_TINY_PRINTF=y
CONFIG_CMD_DHRYSTONE=y
CONFIG_ERRNO_STR=y

View File

@ -1,126 +0,0 @@
From dd6e1ab93a92e133c41a8665f6d8aca9450bdca8 Mon Sep 17 00:00:00 2001
From: Kamil Trzcinski <ayufan@ayufan.eu>
Date: Sun, 20 Aug 2017 01:52:34 +0200
Subject: [PATCH] Add rk3328-efuse support
---
arch/arm/dts/rk3328.dtsi | 25 ++++++++++++++++++++
drivers/misc/rockchip-efuse.c | 55 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 80 insertions(+)
diff --git a/arch/arm/dts/rk3328.dtsi b/arch/arm/dts/rk3328.dtsi
index 2a4c4929d7..611a0d4b21 100644
--- a/arch/arm/dts/rk3328.dtsi
+++ b/arch/arm/dts/rk3328.dtsi
@@ -342,6 +342,31 @@
};
};
+ efuse: efuse@ff260000 {
+ compatible = "rockchip,rk3328-efuse";
+ reg = <0x0 0xff260000 0x0 0x50>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ clocks = <&cru SCLK_EFUSE>;
+ clock-names = "pclk_efuse";
+ rockchip,efuse-size = <0x20>;
+
+ /* Data cells */
+ efuse_id: id@7 {
+ reg = <0x07 0x10>;
+ };
+ cpu_leakage: cpu-leakage@17 {
+ reg = <0x17 0x1>;
+ };
+ logic_leakage: logic-leakage@19 {
+ reg = <0x19 0x1>;
+ };
+ efuse_cpu_version: cpu-version@1a {
+ reg = <0x1a 0x1>;
+ bits = <3 3>;
+ };
+ };
+
saradc: saradc@ff280000 {
compatible = "rockchip,rk3328-saradc", "rockchip,saradc";
reg = <0x0 0xff280000 0x0 0x100>;
diff --git a/drivers/misc/rockchip-efuse.c b/drivers/misc/rockchip-efuse.c
index b4ad19cfe8..81b78f9b2c 100644
--- a/drivers/misc/rockchip-efuse.c
+++ b/drivers/misc/rockchip-efuse.c
@@ -16,6 +16,14 @@
#include <linux/delay.h>
#include <misc.h>
+#define RK3328_INT_CON 0x0014
+#define RK3328_INT_STATUS 0x0018
+#define RK3328_DOUT 0x0020
+#define RK3328_AUTO_CTRL 0x0024
+#define RK3328_INT_FINISH BIT(0)
+#define RK3328_AUTO_ENB BIT(0)
+#define RK3328_AUTO_RD BIT(1)
+
#define RK3399_A_SHIFT 16
#define RK3399_A_MASK 0x3ff
#define RK3399_NFUSES 32
@@ -95,6 +103,49 @@ U_BOOT_CMD(
);
#endif
+static int rockchip_rk3328_efuse_read(struct udevice *dev, int offset,
+ void *buf, int size)
+{
+ struct rockchip_efuse_platdata *plat = dev_get_platdata(dev);
+
+ unsigned int addr_start, addr_end, addr_offset;
+ u32 out_value, status;
+ u8 bytes[RK3399_NFUSES * RK3399_BYTES_PER_FUSE];
+ int i = 0;
+ u32 addr;
+
+ /* 128 Byte efuse, 96 Byte for secure, 32 Byte for non-secure */
+ offset += 96;
+
+ addr_start = offset / RK3399_BYTES_PER_FUSE;
+ addr_offset = offset % RK3399_BYTES_PER_FUSE;
+ addr_end = DIV_ROUND_UP(offset + size, RK3399_BYTES_PER_FUSE);
+
+ /* cap to the size of the efuse block */
+ if (addr_end > RK3399_NFUSES)
+ addr_end = RK3399_NFUSES;
+
+ for (addr = addr_start; addr < addr_end; addr++) {
+ writel(RK3328_AUTO_RD | RK3328_AUTO_ENB |
+ ((addr & RK3399_A_MASK) << RK3399_A_SHIFT),
+ plat->base + RK3328_AUTO_CTRL);
+ udelay(10);
+ status = readl(plat->base + RK3328_INT_STATUS);
+ if (!(status & RK3328_INT_FINISH)) {
+ return -EIO;
+ }
+ out_value = readl(plat->base + RK3328_DOUT);
+ writel(RK3328_INT_FINISH, plat->base + RK3328_INT_STATUS);
+
+ memcpy(&bytes[i], &out_value, RK3399_BYTES_PER_FUSE);
+ i += RK3399_BYTES_PER_FUSE;
+ }
+
+ memcpy(buf, bytes + addr_offset, size);
+
+ return 0;
+}
+
static int rockchip_rk3399_efuse_read(struct udevice *dev, int offset,
void *buf, int size)
{
@@ -223,6 +274,10 @@ static const struct udevice_id rockchip_efuse_ids[] = {
.compatible = "rockchip,rk322x-efuse",
.data = (ulong)&rockchip_rk3288_efuse_read,
},
+ {
+ .compatible = "rockchip,rk3328-efuse",
+ .data = (ulong)rockchip_rk3328_efuse_read,
+ },
{
.compatible = "rockchip,rk3399-efuse",
.data = (ulong)&rockchip_rk3399_efuse_read,

View File

@ -0,0 +1,48 @@
From e44f2ddac6099a0947c4182a0f4296d8df2be4a8 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Sat, 18 Aug 2018 17:26:35 +0200
Subject: [PATCH] rockchip: rk3328: add efuse support
---
arch/arm/dts/rk3328.dtsi | 14 ++++++++++++++
configs/evb-rk3328_defconfig | 2 ++
2 files changed, 16 insertions(+)
diff --git a/arch/arm/dts/rk3328.dtsi b/arch/arm/dts/rk3328.dtsi
index 94d39b1b35..35db0ccf4d 100644
--- a/arch/arm/dts/rk3328.dtsi
+++ b/arch/arm/dts/rk3328.dtsi
@@ -341,6 +341,20 @@
};
};
+ efuse: efuse@ff260000 {
+ compatible = "rockchip,rk3328-efuse";
+ reg = <0x0 0xff260000 0x0 0x80>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ clocks = <&cru SCLK_EFUSE>;
+ clock-names = "pclk_efuse";
+
+ /* Data cells */
+ cpu_id: cpu-id@7 {
+ reg = <0x07 0x10>;
+ };
+ };
+
saradc: saradc@ff280000 {
compatible = "rockchip,rk3328-saradc", "rockchip,saradc";
reg = <0x0 0xff280000 0x0 0x100>;
diff --git a/configs/evb-rk3328_defconfig b/configs/evb-rk3328_defconfig
index 79535c760d..0897a28e1d 100644
--- a/configs/evb-rk3328_defconfig
+++ b/configs/evb-rk3328_defconfig
@@ -52,6 +52,8 @@ CONFIG_SPL_CLK=y
CONFIG_ROCKCHIP_GPIO=y
CONFIG_SYS_I2C_ROCKCHIP=y
CONFIG_DM_KEY=y
+CONFIG_MISC=y
+CONFIG_ROCKCHIP_EFUSE=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_PHY=y

View File

@ -1,184 +0,0 @@
From 77349a847b0649e8ead1dba3a297607b2a674aaa Mon Sep 17 00:00:00 2001
From: Kamil Trzcinski <ayufan@ayufan.eu>
Date: Sat, 19 Aug 2017 20:38:50 +0200
Subject: [PATCH] Get serial and ethaddr from efuse
---
board/rockchip/evb_rk3328/evb-rk3328.c | 124 +++++++++++++++++++++++++++++++++
configs/evb-rk3328_defconfig | 2 +
include/configs/rk3328_common.h | 2 +
3 files changed, 128 insertions(+)
diff --git a/board/rockchip/evb_rk3328/evb-rk3328.c b/board/rockchip/evb_rk3328/evb-rk3328.c
index d6fc57cd8e..1d0f7e9c95 100644
--- a/board/rockchip/evb_rk3328/evb-rk3328.c
+++ b/board/rockchip/evb_rk3328/evb-rk3328.c
@@ -7,14 +7,20 @@
#include <common.h>
#include <asm/arch/hardware.h>
#include <asm/arch/grf_rk3328.h>
+#include <dm.h>
#include <asm/armv8/mmu.h>
#include <asm/io.h>
#include <dwc3-uboot.h>
#include <power/regulator.h>
#include <usb.h>
+#include <misc.h>
+#include <u-boot/sha256.h>
DECLARE_GLOBAL_DATA_PTR;
+#define RK3328_CPUID_OFF 0x7
+#define RK3328_CPUID_LEN 0x10
+
int board_init(void)
{
int ret;
@@ -80,3 +86,121 @@ int board_usb_cleanup(int index, enum usb_init_type init)
return 0;
}
#endif
+
+static void setup_macaddr(void)
+{
+#if CONFIG_IS_ENABLED(CMD_NET)
+ int ret;
+ const char *cpuid = env_get("cpuid#");
+ u8 hash[SHA256_SUM_LEN];
+ int size = sizeof(hash);
+ u8 mac_addr[6];
+
+ /* Only generate a MAC address, if none is set in the environment */
+ if (env_get("ethaddr"))
+ return;
+
+ if (!cpuid) {
+ debug("%s: could not retrieve 'cpuid#'\n", __func__);
+ return;
+ }
+
+ ret = hash_block("sha256", (void *)cpuid, strlen(cpuid), hash, &size);
+ if (ret) {
+ debug("%s: failed to calculate SHA256\n", __func__);
+ return;
+ }
+
+ /* Copy 6 bytes of the hash to base the MAC address on */
+ memcpy(mac_addr, hash, 6);
+
+ /* Make this a valid MAC address and set it */
+ mac_addr[0] &= 0xfe; /* clear multicast bit */
+ mac_addr[0] |= 0x02; /* set local assignment bit (IEEE802) */
+ eth_env_set_enetaddr("ethaddr", mac_addr);
+
+ /* Make a valid MAC address for eth1 */
+ mac_addr[5] += 0x20;
+ mac_addr[5] &= 0xff;
+ eth_env_set_enetaddr("eth1addr", mac_addr);
+#endif
+
+ return;
+}
+
+static void setup_serial(void)
+{
+#if CONFIG_IS_ENABLED(ROCKCHIP_EFUSE)
+ struct udevice *dev;
+ int ret, i;
+ u8 cpuid[RK3328_CPUID_LEN];
+ u8 low[RK3328_CPUID_LEN/2], high[RK3328_CPUID_LEN/2];
+ char cpuid_str[RK3328_CPUID_LEN * 2 + 1];
+ u64 serialno;
+ char serialno_str[16];
+
+ /* retrieve the device */
+ ret = uclass_get_device_by_driver(UCLASS_MISC,
+ DM_GET_DRIVER(rockchip_efuse), &dev);
+ if (ret) {
+ debug("%s: could not find efuse device\n", __func__);
+ return;
+ }
+
+ /* read the cpu_id range from the efuses */
+ ret = misc_read(dev, RK3328_CPUID_OFF, &cpuid, sizeof(cpuid));
+ if (ret) {
+ debug("%s: reading cpuid from the efuses failed\n",
+ __func__);
+ return;
+ }
+
+ memset(cpuid_str, 0, sizeof(cpuid_str));
+ for (i = 0; i < 16; i++)
+ sprintf(&cpuid_str[i * 2], "%02x", cpuid[i]);
+
+ debug("cpuid: %s\n", cpuid_str);
+
+ /*
+ * Mix the cpuid bytes using the same rules as in
+ * ${linux}/drivers/soc/rockchip/rockchip-cpuinfo.c
+ */
+ for (i = 0; i < 8; i++) {
+ low[i] = cpuid[1 + (i << 1)];
+ high[i] = cpuid[i << 1];
+ }
+
+ serialno = crc32_no_comp(0, low, 8);
+ serialno |= (u64)crc32_no_comp(serialno, high, 8) << 32;
+ snprintf(serialno_str, sizeof(serialno_str), "%llx", serialno);
+
+ env_set("cpuid#", cpuid_str);
+ env_set("serial#", serialno_str);
+#endif
+
+ return;
+}
+
+int misc_init_r(void)
+{
+ setup_serial();
+ setup_macaddr();
+
+ return 0;
+}
+
+#ifdef CONFIG_SERIAL_TAG
+void get_board_serial(struct tag_serialnr *serialnr)
+{
+ char *serial_string;
+ u64 serial = 0;
+
+ serial_string = env_get("serial#");
+
+ if (serial_string)
+ serial = simple_strtoull(serial_string, NULL, 16);
+
+ serialnr->high = (u32)(serial >> 32);
+ serialnr->low = (u32)(serial & 0xffffffff);
+}
+#endif
diff --git a/configs/evb-rk3328_defconfig b/configs/evb-rk3328_defconfig
index d4a00718c5..9107c020b7 100644
--- a/configs/evb-rk3328_defconfig
+++ b/configs/evb-rk3328_defconfig
@@ -55,6 +55,8 @@ CONFIG_SPL_CLK=y
CONFIG_ROCKCHIP_GPIO=y
CONFIG_SYS_I2C_ROCKCHIP=y
CONFIG_DM_KEY=y
+CONFIG_MISC=y
+CONFIG_ROCKCHIP_EFUSE=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_PHY=y
diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h
index b7971782b5..a2af5a7989 100644
--- a/include/configs/rk3328_common.h
+++ b/include/configs/rk3328_common.h
@@ -9,6 +9,8 @@
#include "rockchip-common.h"
+#define CONFIG_MISC_INIT_R
+
#define CONFIG_SYS_MALLOC_LEN (32 << 20)
#define CONFIG_SYS_CBSIZE 1024
#define CONFIG_SKIP_LOWLEVEL_INIT

View File

@ -0,0 +1,66 @@
From c4068865306726939489b961fd8e04f9a2a7b1ce Mon Sep 17 00:00:00 2001
From: Kamil Trzcinski <ayufan@ayufan.eu>
Date: Sat, 19 Aug 2017 20:38:50 +0200
Subject: [PATCH] rk3328-evb: get ethaddr from efuse
---
board/rockchip/evb_rk3328/evb-rk3328.c | 49 ++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/board/rockchip/evb_rk3328/evb-rk3328.c b/board/rockchip/evb_rk3328/evb-rk3328.c
index c8e7a3ad64..8829f50327 100644
--- a/board/rockchip/evb_rk3328/evb-rk3328.c
+++ b/board/rockchip/evb_rk3328/evb-rk3328.c
@@ -3,3 +3,52 @@
*
* SPDX-License-Identifier: GPL-2.0+
*/
+
+#include <common.h>
+#include <u-boot/sha256.h>
+
+static void setup_macaddr(void)
+{
+#if CONFIG_IS_ENABLED(CMD_NET)
+ int ret;
+ const char *cpuid = env_get("cpuid#");
+ u8 hash[SHA256_SUM_LEN];
+ int size = sizeof(hash);
+ u8 mac_addr[6];
+
+ /* Only generate a MAC address, if none is set in the environment */
+ if (env_get("ethaddr"))
+ return;
+
+ if (!cpuid) {
+ debug("%s: could not retrieve 'cpuid#'\n", __func__);
+ return;
+ }
+
+ ret = hash_block("sha256", (void *)cpuid, strlen(cpuid), hash, &size);
+ if (ret) {
+ debug("%s: failed to calculate SHA256\n", __func__);
+ return;
+ }
+
+ /* Copy 6 bytes of the hash to base the MAC address on */
+ memcpy(mac_addr, hash, 6);
+
+ /* Make this a valid MAC address and set it */
+ mac_addr[0] &= 0xfe; /* clear multicast bit */
+ mac_addr[0] |= 0x02; /* set local assignment bit (IEEE802) */
+ eth_env_set_enetaddr("ethaddr", mac_addr);
+
+ /* Make a valid MAC address for eth1 */
+ mac_addr[5] += 0x20;
+ mac_addr[5] &= 0xff;
+ eth_env_set_enetaddr("eth1addr", mac_addr);
+#endif
+}
+
+int rk_board_late_init(void)
+{
+ setup_macaddr();
+
+ return 0;
+}

View File

@ -1,17 +1,31 @@
From b6c47bd9f6a8965ab538f168086d4fd99fcf3066 Mon Sep 17 00:00:00 2001
From 46d72af5faa7f12a057294356eb353d38c56b5fe Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Wed, 10 Jan 2018 19:56:16 +0100
Subject: [PATCH] rk3328-evb: add sdmmc vmmc-supply
---
arch/arm/dts/rk3328-evb.dts | 1 +
1 file changed, 1 insertion(+)
arch/arm/dts/rk3328-evb.dts | 7 +++++--
arch/arm/dts/rk3328.dtsi | 10 ++++++----
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/arch/arm/dts/rk3328-evb.dts b/arch/arm/dts/rk3328-evb.dts
index 4b13a8da64..586c58659d 100644
index aafafec649..497b040f56 100644
--- a/arch/arm/dts/rk3328-evb.dts
+++ b/arch/arm/dts/rk3328-evb.dts
@@ -61,6 +61,7 @@
@@ -28,8 +28,10 @@
compatible = "regulator-fixed";
regulator-name = "vcc3v3";
gpio = <&gpio0 30 GPIO_ACTIVE_LOW>;
- regulator-always-on;
- regulator-boot-on;
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdmmc0m1_gpio>;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
};
vcc5v0_otg: vcc5v0-otg-drv {
@@ -75,6 +77,7 @@
num-slots = <1>;
pinctrl-names = "default";
pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>;
@ -19,3 +33,31 @@ index 4b13a8da64..586c58659d 100644
status = "okay";
};
diff --git a/arch/arm/dts/rk3328.dtsi b/arch/arm/dts/rk3328.dtsi
index 35db0ccf4d..231e66788d 100644
--- a/arch/arm/dts/rk3328.dtsi
+++ b/arch/arm/dts/rk3328.dtsi
@@ -481,8 +481,9 @@
compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc";
reg = <0x0 0xff500000 0x0 0x4000>;
max-frequency = <150000000>;
- clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>;
- clock-names = "biu", "ciu";
+ clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>,
+ <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>;
+ clock-names = "biu", "ciu", "ciu-drv", "ciu-sample";
fifo-depth = <0x100>;
interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";
@@ -504,8 +505,9 @@
compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc";
reg = <0x0 0xff520000 0x0 0x4000>;
max-frequency = <150000000>;
- clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>;
- clock-names = "biu", "ciu";
+ clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>,
+ <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>;
+ clock-names = "biu", "ciu", "ciu-drv", "ciu-sample";
fifo-depth = <0x100>;
interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";

View File

@ -1,38 +0,0 @@
From 0f59425a214329eda9080f186bfa82780fce75e6 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Sun, 28 Jan 2018 15:42:23 +0100
Subject: [PATCH] rk3399-evb: prefer sdcard boot
---
arch/arm/dts/rk3399-evb.dts | 2 +-
arch/arm/dts/rk3399.dtsi | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/dts/rk3399-evb.dts b/arch/arm/dts/rk3399-evb.dts
index a0ea589015..ae28bded64 100644
--- a/arch/arm/dts/rk3399-evb.dts
+++ b/arch/arm/dts/rk3399-evb.dts
@@ -17,7 +17,7 @@
chosen {
stdout-path = &uart2;
- u-boot,spl-boot-order = &sdhci, &sdmmc;
+ u-boot,spl-boot-order = &sdmmc, &sdhci;
};
vdd_center: vdd-center {
diff --git a/arch/arm/dts/rk3399.dtsi b/arch/arm/dts/rk3399.dtsi
index 68221b47f7..cfb99c9e16 100644
--- a/arch/arm/dts/rk3399.dtsi
+++ b/arch/arm/dts/rk3399.dtsi
@@ -35,8 +35,8 @@
serial2 = &uart2;
serial3 = &uart3;
serial4 = &uart4;
- mmc0 = &sdhci;
- mmc1 = &sdmmc;
+ mmc0 = &sdmmc;
+ mmc1 = &sdhci;
};
cpus {

View File

@ -0,0 +1,52 @@
From 180c7b262f17a58de6865b7b7a5df609e1449ce8 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Sun, 5 Aug 2018 20:58:54 +0200
Subject: [PATCH] rockchip: rk3288: add efuse support
---
arch/arm/dts/rk3288.dtsi | 5 ++---
configs/miqi-rk3288_defconfig | 2 ++
configs/tinker-rk3288_defconfig | 1 +
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/arm/dts/rk3288.dtsi b/arch/arm/dts/rk3288.dtsi
index 20adb0dece..8b085ee6dc 100644
--- a/arch/arm/dts/rk3288.dtsi
+++ b/arch/arm/dts/rk3288.dtsi
@@ -936,9 +936,8 @@
};
efuse: efuse@ffb40000 {
- compatible = "rockchip,rk3288-efuse";
- reg = <0xffb40000 0x10000>;
- status = "disabled";
+ compatible = "rockchip,rockchip-efuse";
+ reg = <0xffb40000 0x20>;
};
gic: interrupt-controller@ffc01000 {
diff --git a/configs/miqi-rk3288_defconfig b/configs/miqi-rk3288_defconfig
index 09d5979dff..ffbe701cfd 100644
--- a/configs/miqi-rk3288_defconfig
+++ b/configs/miqi-rk3288_defconfig
@@ -48,6 +48,8 @@ CONFIG_ROCKCHIP_GPIO=y
CONFIG_SYS_I2C_ROCKCHIP=y
CONFIG_DM_KEY=y
CONFIG_ADC_KEY=y
+CONFIG_MISC=y
+CONFIG_ROCKCHIP_EFUSE=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_DM_ETH=y
diff --git a/configs/tinker-rk3288_defconfig b/configs/tinker-rk3288_defconfig
index 3abf7c1088..0afc0a35e1 100644
--- a/configs/tinker-rk3288_defconfig
+++ b/configs/tinker-rk3288_defconfig
@@ -46,6 +46,7 @@ CONFIG_SPL_CLK=y
CONFIG_ROCKCHIP_GPIO=y
CONFIG_SYS_I2C_ROCKCHIP=y
CONFIG_MISC=y
+CONFIG_ROCKCHIP_EFUSE=y
CONFIG_I2C_EEPROM=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_ROCKCHIP=y

View File

@ -0,0 +1,73 @@
From 99854fa357a70ce160f7db78c383642c119cbad7 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Sun, 5 Aug 2018 20:58:54 +0200
Subject: [PATCH] rk3288-miqi: get ethaddr from efuse
---
board/mqmaker/miqi_rk3288/miqi-rk3288.c | 43 +++++++++++++++++++++++++
configs/miqi-rk3288_defconfig | 1 -
2 files changed, 43 insertions(+), 1 deletion(-)
diff --git a/board/mqmaker/miqi_rk3288/miqi-rk3288.c b/board/mqmaker/miqi_rk3288/miqi-rk3288.c
index 846deddb80..f719218eb6 100644
--- a/board/mqmaker/miqi_rk3288/miqi-rk3288.c
+++ b/board/mqmaker/miqi_rk3288/miqi-rk3288.c
@@ -6,3 +6,46 @@
#include <common.h>
#include <spl.h>
+#include <hash.h>
+#include <u-boot/sha256.h>
+
+static void setup_macaddr(void)
+{
+#if CONFIG_IS_ENABLED(CMD_NET)
+ int ret;
+ const char *cpuid = env_get("cpuid#");
+ u8 hash[SHA256_SUM_LEN];
+ int size = sizeof(hash);
+ u8 mac_addr[6];
+
+ /* Only generate a MAC address, if none is set in the environment */
+ if (env_get("ethaddr"))
+ return;
+
+ if (!cpuid) {
+ debug("%s: could not retrieve 'cpuid#'\n", __func__);
+ return;
+ }
+
+ ret = hash_block("sha256", (void *)cpuid, strlen(cpuid), hash, &size);
+ if (ret) {
+ debug("%s: failed to calculate SHA256\n", __func__);
+ return;
+ }
+
+ /* Copy 6 bytes of the hash to base the MAC address on */
+ memcpy(mac_addr, hash, 6);
+
+ /* Make this a valid MAC address and set it */
+ mac_addr[0] &= 0xfe; /* clear multicast bit */
+ mac_addr[0] |= 0x02; /* set local assignment bit (IEEE802) */
+ eth_env_set_enetaddr("ethaddr", mac_addr);
+#endif
+}
+
+int rk3288_board_late_init(void)
+{
+ setup_macaddr();
+
+ return 0;
+}
diff --git a/configs/miqi-rk3288_defconfig b/configs/miqi-rk3288_defconfig
index ffbe701cfd..746d8035ee 100644
--- a/configs/miqi-rk3288_defconfig
+++ b/configs/miqi-rk3288_defconfig
@@ -36,7 +36,6 @@ CONFIG_SPL_PARTITION_UUIDS=y
CONFIG_SPL_OF_CONTROL=y
CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
CONFIG_ENV_IS_IN_MMC=y
-CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_REGMAP=y
CONFIG_SPL_REGMAP=y
CONFIG_SYSCON=y

View File

@ -0,0 +1,142 @@
From ea235722e95630c3d5da5403e660a8bc20e2b8d0 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Mon, 20 Aug 2018 23:01:10 +0200
Subject: [PATCH] rk3399-evb: fixup get serial and ethaddr from efuse
---
board/rockchip/evb_rk3399/evb-rk3399.c | 80 +-------------------------
include/configs/evb_rk3399.h | 3 -
2 files changed, 2 insertions(+), 81 deletions(-)
diff --git a/board/rockchip/evb_rk3399/evb-rk3399.c b/board/rockchip/evb_rk3399/evb-rk3399.c
index b6f730852a..c0a38d5143 100644
--- a/board/rockchip/evb_rk3399/evb-rk3399.c
+++ b/board/rockchip/evb_rk3399/evb-rk3399.c
@@ -6,13 +6,12 @@
#include <common.h>
#include <dm.h>
-#include <misc.h>
#include <ram.h>
#include <dm/pinctrl.h>
#include <dm/uclass-internal.h>
-#include <asm/setup.h>
#include <asm/arch/periph.h>
#include <power/regulator.h>
+#include <hash.h>
#include <u-boot/sha256.h>
#include <usb.h>
#include <dwc3-uboot.h>
@@ -20,9 +19,6 @@
DECLARE_GLOBAL_DATA_PTR;
-#define RK3399_CPUID_OFF 0x7
-#define RK3399_CPUID_LEN 0x10
-
int rk_board_init(void)
{
struct udevice *pinctrl, *regulator;
@@ -106,87 +102,15 @@ static void setup_macaddr(void)
mac_addr[0] |= 0x02; /* set local assignment bit (IEEE802) */
eth_env_set_enetaddr("ethaddr", mac_addr);
#endif
-
- return;
}
-static void setup_serial(void)
+int rk_board_late_init(void)
{
-#if CONFIG_IS_ENABLED(ROCKCHIP_EFUSE)
- struct udevice *dev;
- int ret, i;
- u8 cpuid[RK3399_CPUID_LEN];
- u8 low[RK3399_CPUID_LEN/2], high[RK3399_CPUID_LEN/2];
- char cpuid_str[RK3399_CPUID_LEN * 2 + 1];
- u64 serialno;
- char serialno_str[16];
-
- /* retrieve the device */
- ret = uclass_get_device_by_driver(UCLASS_MISC,
- DM_GET_DRIVER(rockchip_efuse), &dev);
- if (ret) {
- debug("%s: could not find efuse device\n", __func__);
- return;
- }
-
- /* read the cpu_id range from the efuses */
- ret = misc_read(dev, RK3399_CPUID_OFF, &cpuid, sizeof(cpuid));
- if (ret) {
- debug("%s: reading cpuid from the efuses failed\n",
- __func__);
- return;
- }
-
- memset(cpuid_str, 0, sizeof(cpuid_str));
- for (i = 0; i < 16; i++)
- sprintf(&cpuid_str[i * 2], "%02x", cpuid[i]);
-
- debug("cpuid: %s\n", cpuid_str);
-
- /*
- * Mix the cpuid bytes using the same rules as in
- * ${linux}/drivers/soc/rockchip/rockchip-cpuinfo.c
- */
- for (i = 0; i < 8; i++) {
- low[i] = cpuid[1 + (i << 1)];
- high[i] = cpuid[i << 1];
- }
-
- serialno = crc32_no_comp(0, low, 8);
- serialno |= (u64)crc32_no_comp(serialno, high, 8) << 32;
- snprintf(serialno_str, sizeof(serialno_str), "%llx", serialno);
-
- env_set("cpuid#", cpuid_str);
- env_set("serial#", serialno_str);
-#endif
-
- return;
-}
-
-int misc_init_r(void)
-{
- setup_serial();
setup_macaddr();
return 0;
}
-#ifdef CONFIG_SERIAL_TAG
-void get_board_serial(struct tag_serialnr *serialnr)
-{
- char *serial_string;
- u64 serial = 0;
-
- serial_string = env_get("serial#");
-
- if (serial_string)
- serial = simple_strtoull(serial_string, NULL, 16);
-
- serialnr->high = (u32)(serial >> 32);
- serialnr->low = (u32)(serial & 0xffffffff);
-}
-#endif
-
#ifdef CONFIG_USB_DWC3
static struct dwc3_device dwc3_device_data = {
.maximum_speed = USB_SPEED_HIGH,
diff --git a/include/configs/evb_rk3399.h b/include/configs/evb_rk3399.h
index 5565c7ce53..840d63ff6d 100644
--- a/include/configs/evb_rk3399.h
+++ b/include/configs/evb_rk3399.h
@@ -18,9 +18,6 @@
#define CONFIG_SYS_MMC_ENV_DEV 0
#define SDRAM_BANK_SIZE (2UL << 30)
-#define CONFIG_MISC_INIT_R
-#define CONFIG_SERIAL_TAG
-#define CONFIG_ENV_OVERWRITE
#define CONFIG_BMP_16BPP
#define CONFIG_BMP_24BPP

View File

@ -0,0 +1,175 @@
From 37a07ad0222bb19c7fdc03d7679bae47d9875eed Mon Sep 17 00:00:00 2001
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Date: Mon, 7 May 2018 22:18:27 +0200
Subject: [PATCH] include: update log2 header from the Linux kernel
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Without the patch gcc 8 produces:
warning: ignoring attribute noreturn because it conflicts with
attribute const [-Wattributes]
int ____ilog2_NaN(void);
So let's update the include from Linux kernel v4.16.
This removes static checks of ilog2() arguments.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
(cherry picked from commit 4a8e72954e11f2c2c37ee138b88a1d9362dba4da)
---
include/linux/log2.h | 63 ++++++++++++++++++++++++++------------------
1 file changed, 37 insertions(+), 26 deletions(-)
diff --git a/include/linux/log2.h b/include/linux/log2.h
index aa1de63090..b62c07b29f 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -4,6 +4,11 @@
* Written by David Howells (dhowells@redhat.com)
*
* SPDX-License-Identifier: GPL-2.0+
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
*/
#ifndef _LINUX_LOG2_H
@@ -12,12 +17,6 @@
#include <linux/types.h>
#include <linux/bitops.h>
-/*
- * deal with unrepresentable constant logarithms
- */
-extern __attribute__((const, noreturn))
-int ____ilog2_NaN(void);
-
/*
* non-constant log of base 2 calculators
* - the arch may override these in asm/bitops.h if they can be implemented
@@ -40,19 +39,23 @@ int __ilog2_u64(u64 n)
}
#endif
-/*
- * Determine whether some value is a power of two, where zero is
+/**
+ * is_power_of_2() - check if a value is a power of two
+ * @n: the value to check
+ *
+ * Determine whether some value is a power of two, where zero is
* *not* considered a power of two.
+ * Return: true if @n is a power of 2, otherwise false.
*/
-
static inline __attribute__((const))
bool is_power_of_2(unsigned long n)
{
return (n != 0 && ((n & (n - 1)) == 0));
}
-/*
- * round up to nearest power of two
+/**
+ * __roundup_pow_of_two() - round up to nearest power of two
+ * @n: value to round up
*/
static inline __attribute__((const))
unsigned long __roundup_pow_of_two(unsigned long n)
@@ -60,8 +63,9 @@ unsigned long __roundup_pow_of_two(unsigned long n)
return 1UL << fls_long(n - 1);
}
-/*
- * round down to nearest power of two
+/**
+ * __rounddown_pow_of_two() - round down to nearest power of two
+ * @n: value to round down
*/
static inline __attribute__((const))
unsigned long __rounddown_pow_of_two(unsigned long n)
@@ -70,19 +74,19 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
}
/**
- * ilog2 - log of base 2 of 32-bit or a 64-bit unsigned value
- * @n - parameter
+ * ilog2 - log base 2 of 32-bit or a 64-bit unsigned value
+ * @n: parameter
*
* constant-capable log of base 2 calculation
* - this can be used to initialise global variables from constant data, hence
- * the massive ternary operator construction
+ * the massive ternary operator construction
*
* selects the appropriately-sized optimised version depending on sizeof(n)
*/
#define ilog2(n) \
( \
__builtin_constant_p(n) ? ( \
- (n) < 1 ? ____ilog2_NaN() : \
+ (n) < 2 ? 0 : \
(n) & (1ULL << 63) ? 63 : \
(n) & (1ULL << 62) ? 62 : \
(n) & (1ULL << 61) ? 61 : \
@@ -145,10 +149,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
(n) & (1ULL << 4) ? 4 : \
(n) & (1ULL << 3) ? 3 : \
(n) & (1ULL << 2) ? 2 : \
- (n) & (1ULL << 1) ? 1 : \
- (n) & (1ULL << 0) ? 0 : \
- ____ilog2_NaN() \
- ) : \
+ 1) : \
(sizeof(n) <= 4) ? \
__ilog2_u32(n) : \
__ilog2_u64(n) \
@@ -156,7 +157,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
/**
* roundup_pow_of_two - round the given value up to nearest power of two
- * @n - parameter
+ * @n: parameter
*
* round the given value up to the nearest power of two
* - the result is undefined when n == 0
@@ -173,7 +174,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
/**
* rounddown_pow_of_two - round the given value down to nearest power of two
- * @n - parameter
+ * @n: parameter
*
* round the given value down to the nearest power of two
* - the result is undefined when n == 0
@@ -186,6 +187,12 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
__rounddown_pow_of_two(n) \
)
+static inline __attribute_const__
+int __order_base_2(unsigned long n)
+{
+ return n > 1 ? ilog2(n - 1) + 1 : 0;
+}
+
/**
* order_base_2 - calculate the (rounded up) base 2 order of the argument
* @n: parameter
@@ -199,7 +206,11 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
* ob2(5) = 3
* ... and so on.
*/
-
-#define order_base_2(n) ilog2(roundup_pow_of_two(n))
-
+#define order_base_2(n) \
+( \
+ __builtin_constant_p(n) ? ( \
+ ((n) == 0 || (n) == 1) ? 0 : \
+ ilog2((n) - 1) + 1) : \
+ __order_base_2(n) \
+)
#endif /* _LINUX_LOG2_H */

View File

@ -0,0 +1,182 @@
From 1ba76e3eb47e865d84e42a6b5484516ef4457bf7 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Sat, 18 Aug 2018 17:27:32 +0200
Subject: [PATCH] rockchip: disable android boot and config
---
arch/arm/mach-rockchip/boot_mode.c | 2 +-
configs/evb-rk3328_defconfig | 5 ++---
configs/evb-rk3399_defconfig | 14 --------------
configs/miqi-rk3288_defconfig | 12 +-----------
configs/tinker-rk3288_defconfig | 3 ---
include/configs/rockchip-common.h | 2 --
6 files changed, 4 insertions(+), 34 deletions(-)
diff --git a/arch/arm/mach-rockchip/boot_mode.c b/arch/arm/mach-rockchip/boot_mode.c
index 8a20a3a31e..9441c49477 100644
--- a/arch/arm/mach-rockchip/boot_mode.c
+++ b/arch/arm/mach-rockchip/boot_mode.c
@@ -123,9 +123,9 @@ int setup_boot_mode(void)
int boot_mode = BOOT_MODE_NORMAL;
char env_preboot[256] = {0};
+#ifdef CONFIG_RKIMG_BOOTLOADER
devtype_num_envset();
rockchip_dnl_mode_check();
-#ifdef CONFIG_RKIMG_BOOTLOADER
boot_mode = rockchip_get_boot_mode();
#endif
switch (boot_mode) {
diff --git a/configs/evb-rk3328_defconfig b/configs/evb-rk3328_defconfig
index 0897a28e1d..85ee85741e 100644
--- a/configs/evb-rk3328_defconfig
+++ b/configs/evb-rk3328_defconfig
@@ -39,8 +39,8 @@ CONFIG_TPL_OF_CONTROL=y
CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
CONFIG_TPL_OF_PLATDATA=y
CONFIG_ENV_IS_IN_MMC=y
-CONFIG_TPL_DM=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_TPL_DM=y
CONFIG_REGMAP=y
CONFIG_SPL_REGMAP=y
CONFIG_TPL_REGMAP=y
@@ -56,12 +56,11 @@ CONFIG_MISC=y
CONFIG_ROCKCHIP_EFUSE=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_ROCKCHIP=y
-CONFIG_PHY=y
-CONFIG_PHY_ROCKCHIP_INNO_USB2=y
CONFIG_DM_ETH=y
CONFIG_ETH_DESIGNWARE=y
CONFIG_GMAC_ROCKCHIP=y
CONFIG_PHY=y
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
CONFIG_PINCTRL=y
CONFIG_DM_PMIC=y
CONFIG_PMIC_RK8XX=y
diff --git a/configs/evb-rk3399_defconfig b/configs/evb-rk3399_defconfig
index 305f0a405d..bd86db31af 100644
--- a/configs/evb-rk3399_defconfig
+++ b/configs/evb-rk3399_defconfig
@@ -5,8 +5,6 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_ROCKCHIP_RK3399=y
CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x4000
-CONFIG_RKIMG_BOOTLOADER=y
-# CONFIG_USING_KERNEL_DTB is not set
CONFIG_SPL_STACK_R_ADDR=0x80000
CONFIG_DEFAULT_DEVICE_TREE="rk3399-evb"
CONFIG_DEBUG_UART=y
@@ -14,7 +12,6 @@ CONFIG_FIT=y
CONFIG_SPL_LOAD_FIT=y
CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-rockchip/make_fit_atf.py"
# CONFIG_DISPLAY_CPUINFO is not set
-CONFIG_ANDROID_BOOTLOADER=y
CONFIG_SPL_STACK_R=y
CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000
CONFIG_SPL_ATF=y
@@ -26,9 +23,6 @@ CONFIG_FASTBOOT_FLASH_MMC_DEV=0
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_IMLS is not set
CONFIG_CMD_GPT=y
-CONFIG_CMD_LOAD_ANDROID=y
-CONFIG_CMD_BOOT_ANDROID=y
-CONFIG_CMD_BOOT_ROCKCHIP=y
CONFIG_CMD_MMC=y
CONFIG_CMD_SF=y
CONFIG_CMD_USB=y
@@ -94,13 +88,5 @@ CONFIG_USB_ETHER_ASIX88179=y
CONFIG_USB_ETHER_MCS7830=y
CONFIG_USB_ETHER_RTL8152=y
CONFIG_USB_ETHER_SMSC95XX=y
-CONFIG_DM_VIDEO=y
-CONFIG_DISPLAY=y
-CONFIG_DRM_ROCKCHIP=y
-CONFIG_DRM_ROCKCHIP_DW_MIPI_DSI=y
-CONFIG_DRM_ROCKCHIP_ANALOGIX_DP=y
-CONFIG_DRM_ROCKCHIP_LVDS=y
-CONFIG_DRM_ROCKCHIP_RGB=y
-CONFIG_LCD=y
CONFIG_USE_TINY_PRINTF=y
CONFIG_ERRNO_STR=y
diff --git a/configs/miqi-rk3288_defconfig b/configs/miqi-rk3288_defconfig
index 746d8035ee..4826581bf7 100644
--- a/configs/miqi-rk3288_defconfig
+++ b/configs/miqi-rk3288_defconfig
@@ -3,12 +3,11 @@ CONFIG_ARCH_ROCKCHIP=y
CONFIG_SYS_MALLOC_F_LEN=0x2000
CONFIG_ROCKCHIP_RK3288=y
CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
-CONFIG_RKIMG_BOOTLOADER=y
CONFIG_TARGET_MIQI_RK3288=y
CONFIG_SPL_STACK_R_ADDR=0x80000
CONFIG_DEFAULT_DEVICE_TREE="rk3288-miqi"
CONFIG_DEBUG_UART=y
-# CONFIG_SILENT_CONSOLE is not set
+# CONFIG_ANDROID_BOOT_IMAGE is not set
# CONFIG_DISPLAY_CPUINFO is not set
CONFIG_SPL_STACK_R=y
CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
@@ -16,10 +15,6 @@ CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
CONFIG_CMD_GPIO=y
CONFIG_CMD_GPT=y
CONFIG_CMD_I2C=y
-CONFIG_ANDROID_BOOT_IMAGE=y
-CONFIG_ANDROID_BOOTLOADER=y
-CONFIG_CMD_BOOT_ANDROID=y
-CONFIG_CMD_BOOT_ROCKCHIP=y
CONFIG_CMD_MMC=y
CONFIG_CMD_SF=y
CONFIG_CMD_SPI=y
@@ -79,11 +74,6 @@ CONFIG_G_DNL_PRODUCT_NUM=0x320a
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_SMSC95XX=y
-CONFIG_DM_VIDEO=y
-CONFIG_DISPLAY=y
-CONFIG_VIDEO_ROCKCHIP=y
-CONFIG_DISPLAY_ROCKCHIP_HDMI=y
-CONFIG_CONSOLE_SCROLL_LINES=10
CONFIG_USE_TINY_PRINTF=y
CONFIG_CMD_DHRYSTONE=y
CONFIG_ERRNO_STR=y
diff --git a/configs/tinker-rk3288_defconfig b/configs/tinker-rk3288_defconfig
index 0afc0a35e1..a6f8c0cb51 100644
--- a/configs/tinker-rk3288_defconfig
+++ b/configs/tinker-rk3288_defconfig
@@ -3,13 +3,11 @@ CONFIG_ARCH_ROCKCHIP=y
CONFIG_SYS_MALLOC_F_LEN=0x2000
CONFIG_ROCKCHIP_RK3288=y
CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
-CONFIG_RKIMG_BOOTLOADER=y
CONFIG_TARGET_TINKER_RK3288=y
CONFIG_SPL_STACK_R_ADDR=0x80000
CONFIG_DEFAULT_DEVICE_TREE="rk3288-tinker"
CONFIG_DEBUG_UART=y
# CONFIG_ANDROID_BOOT_IMAGE is not set
-# CONFIG_SILENT_CONSOLE is not set
CONFIG_CONSOLE_MUX=y
# CONFIG_DISPLAY_CPUINFO is not set
CONFIG_SPL_STACK_R=y
@@ -19,7 +17,6 @@ CONFIG_SPL_I2C_SUPPORT=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_GPT=y
CONFIG_CMD_I2C=y
-CONFIG_CMD_BOOT_ROCKCHIP=y
CONFIG_CMD_MMC=y
CONFIG_CMD_SF=y
CONFIG_CMD_SPI=y
diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h
index 38ff08a57f..1e8f6c344e 100644
--- a/include/configs/rockchip-common.h
+++ b/include/configs/rockchip-common.h
@@ -99,8 +99,6 @@
"fi; \0"
#define RKIMG_BOOTCOMMAND \
- "boot_android ${devtype} ${devnum};" \
- "bootrkp;" \
"run distro_bootcmd;"
#endif