Skip to contentSkip to conversation

add support for rk3399 soc and evb

PATCH New Kever Yang 3 participants 13 messages Jul 19, 2016 – Aug 8, 2016

Subsystems (5)
lore
Share & tools
lore

Kever Yang

author
#0 lore raw

v5 cover add support for rk3399 soc and evb

Hi Simon,

Sorry for didn't apply all the changes for comments from Andreas in V4, I rebase this patchset on u-boot-rockchip.git master branch and reset to below commit:
f278234 rockchip: update fastboot usage

Please help to rebase my patches, you should be able to apply these patches directly.

This patchset add support for rk3399 with ATF based on Rockchip miniloader as secondary bootloader instead of U-Boot SPL.

Rockchip miniloader init the DRAM and load the ATF and U-Boot to runing address, and then jump to ATF, the ATF do some init and switch to EL2/EL1 mode before jump to next loader which is U-Boot here.

Pls reference board/rockchip/evb_rk3399/README to setup the board.

Will migrate to SPL once its ready for ATF.

This patch set is based on below patch:
"board: move all the rockchip board in one folder"

This patch set has been test on rk3399 evb board.

In this version, I split the mmc driver in seperate thread, because when I enable the full-model for mmc driver, Seems bug happen in blk layer, will descript detail in mmc patch.

Changes in v5:
- add file source and detail changes for U-Boot
- Rebase to u-boot-rockchip.git;
- fixes base on comments from Andreas;
- fix for comments from Simon, correct some typo;

Changes in v4:
- remove extra blank line in evb_rk3399.h,
- remove unnecessary including file in rk3399_common.h,
- fixes base on comments from Andreas,
- Rebase on U-Boot ToT.
- move config CONFIG_SYS_NS16550 from chip common to defconfig

Changes in v3:
- Rebase on patch from Andreas:
- [PATCH] rockchip: Exclude rk_timer for ARM64
- [PATCH] rockchip: Clean up CPU selection

Changes in v2:
- fix description error on board Kconfig
- fix a binary path error

Kever Yang (4):
dts: add support for Rockchip rk3399 soc
ARM64: rockchip: add support for rk3399 SoC based evb
config: add config file for evb-rk3399
ARM64: evb-rk3399: add a README for this board setup

 arch/arm/Kconfig                       |    6 +-
 arch/arm/dts/Makefile                  |    3 +-
 arch/arm/dts/rk3399-evb.dts            |  104 ++++
 arch/arm/dts/rk3399.dtsi               | 1028 ++++++++++++++++++++++++++++++++
 arch/arm/mach-rockchip/Kconfig         |   16 +
 arch/arm/mach-rockchip/Makefile        |    1 +
 arch/arm/mach-rockchip/rk3399/Kconfig  |   23 +
 arch/arm/mach-rockchip/rk3399/Makefile |    7 +
 arch/arm/mach-rockchip/rk3399/rk3399.c |   28 +
 board/rockchip/evb_rk3399/Kconfig      |   15 +
 board/rockchip/evb_rk3399/MAINTAINERS  |    0
 board/rockchip/evb_rk3399/Makefile     |    7 +
 board/rockchip/evb_rk3399/README       |   73 +++
 board/rockchip/evb_rk3399/evb-rk3399.c |   26 +
 configs/evb-rk3399_defconfig           |   33 +
 include/configs/evb_rk3399.h           |   26 +
 include/configs/rk3399_common.h        |   73 +++
 include/dt-bindings/clock/rk3399-cru.h |  746 +++++++++++++++++++++++
 18 files changed, 2210 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/dts/rk3399-evb.dts
 create mode 100644 arch/arm/dts/rk3399.dtsi
 create mode 100644 arch/arm/mach-rockchip/rk3399/Kconfig
 create mode 100644 arch/arm/mach-rockchip/rk3399/Makefile
 create mode 100644 arch/arm/mach-rockchip/rk3399/rk3399.c
 create mode 100644 board/rockchip/evb_rk3399/Kconfig
 create mode 100644 board/rockchip/evb_rk3399/MAINTAINERS
 create mode 100644 board/rockchip/evb_rk3399/Makefile
 create mode 100644 board/rockchip/evb_rk3399/README
 create mode 100644 board/rockchip/evb_rk3399/evb-rk3399.c
 create mode 100644 configs/evb-rk3399_defconfig
 create mode 100644 include/configs/evb_rk3399.h
 create mode 100644 include/configs/rk3399_common.h
 create mode 100644 include/dt-bindings/clock/rk3399-cru.h
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v5 1/4 dts: add support for Rockchip rk3399 soc

These files are from kernel upstream:
"649a371 Add linux-next specific files for 20160616" with some modification need by U-Boot:
- chosen with stdout-path to uart2.
- add clock-frequency for uart2

---

Changes in v5:
- add file source and detail changes for U-Boot

Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/dts/Makefile                  |    3 +-
 arch/arm/dts/rk3399-evb.dts            |  104 ++++
 arch/arm/dts/rk3399.dtsi               | 1028 ++++++++++++++++++++++++++++++++
 include/dt-bindings/clock/rk3399-cru.h |  746 +++++++++++++++++++++++
 4 files changed, 1880 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/rk3399-evb.dts
 create mode 100644 arch/arm/dts/rk3399.dtsi
 create mode 100644 include/dt-bindings/clock/rk3399-cru.h
arch/arm/dts/Makefile +2 -1
index 73e334e..974fbfb 100644
@@ -32,7 +32,8 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \
 	rk3288-jerry.dtb \
 	rk3288-rock2-square.dtb \
 	rk3288-evb.dtb \
-	rk3036-sdk.dtb
+	rk3036-sdk.dtb \
+	rk3399-evb.dtb
 dtb-$(CONFIG_ARCH_MESON) += \
 	meson-gxbb-odroidc2.dtb
 dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
arch/arm/dts/rk3399-evb.dts new file +104 -0

104 lines not on this page · raw message

arch/arm/dts/rk3399.dtsi new file +1028 -0

1,028 lines not on this page · raw message

include/dt-bindings/clock/rk3399-cru.h new file +746 -0

746 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

PATCH v5 1/4 dts: add support for Rockchip rk3399 soc

Am 19.07.2016 um 15:16 schrieb Kever Yang:

Quoted 8 lines

These files are from kernel upstream:
"649a371 Add linux-next specific files for 20160616" with some modification need by U-Boot:
- chosen with stdout-path to uart2.
- add clock-frequency for uart2

Quoted 8 lines

---

Changes in v5:
- add file source and detail changes for U-Boot

Changes in v4: None
Changes in v3: None
Changes in v2: None

One comment below...

arch/arm/dts/Makefile dtb-$(CONFIG_ARCH_ROCKCHIP) += \ · line 35

Quoted 10 lines
arch/arm/dts/Makefile +1 -1
index 73e334e..974fbfb 100644
@@ -32,7 +32,8 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \
 	rk3288-jerry.dtb \
 	rk3288-rock2-square.dtb \
 	rk3288-evb.dtb \
-	rk3036-sdk.dtb
+	rk3036-sdk.dtb \

We should sort rk3036 before rk3288. Can be done as follow-up before I add rk3368.

arch/arm/dts/Makefile dtb-$(CONFIG_ARCH_ROCKCHIP) += \ · line 39

Quoted 4 lines
arch/arm/dts/Makefile +1 -0
+	rk3399-evb.dtb
 dtb-$(CONFIG_ARCH_MESON) += \
 	meson-gxbb-odroidc2.dtb
 dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \

Regards,
Andreas

Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
author
#3 lore raw

PATCH v5 2/4 ARM64: rockchip: add support for rk3399 SoC based evb

In reply to Kever Yang

RK3399 is a SoC from Rockchip with dual-core Cortex-A72 and quad-core Cortex-A53 CPU. It supports two USB3.0 type-C ports and two USB2.0 EHCI ports. Other interfaces are very much like RK3288, the DRAM are 32bit width address and support address from 0 to 4GB-128MB range.

---

Changes in v5:
- Rebase to u-boot-rockchip.git;
- fixes base on comments from Andreas;

Changes in v4:
- remove extra blank line in evb_rk3399.h,
- remove unnecessary including file in rk3399_common.h,
- fixes base on comments from Andreas,
- Rebase on U-Boot ToT.

Changes in v3:
- Rebase on patch from Andreas:
- [PATCH] rockchip: Exclude rk_timer for ARM64
- [PATCH] rockchip: Clean up CPU selection

Changes in v2:
- fix description error on board Kconfig

 arch/arm/Kconfig                       |  6 +--
 arch/arm/mach-rockchip/Kconfig         | 16 ++++++++
 arch/arm/mach-rockchip/Makefile        |  1 +
 arch/arm/mach-rockchip/rk3399/Kconfig  | 23 +++++++++++
 arch/arm/mach-rockchip/rk3399/Makefile |  7 ++++
 arch/arm/mach-rockchip/rk3399/rk3399.c | 28 +++++++++++++
 board/rockchip/evb_rk3399/Kconfig      | 15 +++++++
 board/rockchip/evb_rk3399/MAINTAINERS  |  0
 board/rockchip/evb_rk3399/Makefile     |  7 ++++
 board/rockchip/evb_rk3399/evb-rk3399.c | 26 ++++++++++++
 include/configs/evb_rk3399.h           | 26 ++++++++++++
 include/configs/rk3399_common.h        | 73 ++++++++++++++++++++++++++++++++++
 12 files changed, 224 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/mach-rockchip/rk3399/Kconfig
 create mode 100644 arch/arm/mach-rockchip/rk3399/Makefile
 create mode 100644 arch/arm/mach-rockchip/rk3399/rk3399.c
 create mode 100644 board/rockchip/evb_rk3399/Kconfig
 create mode 100644 board/rockchip/evb_rk3399/MAINTAINERS
 create mode 100644 board/rockchip/evb_rk3399/Makefile
 create mode 100644 board/rockchip/evb_rk3399/evb-rk3399.c
 create mode 100644 include/configs/evb_rk3399.h
 create mode 100644 include/configs/rk3399_common.h
arch/arm/Kconfig +2 -4
index f9fddad..aeac5f3 100644
@@ -838,14 +838,12 @@ config STM32
 
 config ARCH_ROCKCHIP
 	bool "Support Rockchip SoCs"
-	select SUPPORT_SPL
-	select SPL
 	select OF_CONTROL
 	select BLK
 	select DM
-	select SPL_DM
+	select SPL_DM if SPL
 	select SYS_MALLOC_F
-	select SPL_SYS_MALLOC_SIMPLE
+	select SPL_SYS_MALLOC_SIMPLE if SPL
 	select DM_GPIO
 	select DM_I2C
 	select DM_MMC
arch/arm/mach-rockchip/Kconfig +16 -0
index a3faafe..1aac3c8 100644
@@ -3,6 +3,8 @@ if ARCH_ROCKCHIP
 config ROCKCHIP_RK3036
 	bool "Support Rockchip RK3036"
 	select CPU_V7
+	select SUPPORT_SPL
+	select SPL
 	help
 	  The Rockchip RK3036 is a ARM-based SoC with a dual-core Cortex-A7
 	  including NEON and GPU, Mali-400 graphics, several DDR3 options
@@ -12,6 +14,8 @@ config ROCKCHIP_RK3036
 config ROCKCHIP_RK3288
 	bool "Support Rockchip RK3288"
 	select CPU_V7
+	select SUPPORT_SPL
+	select SPL
 	help
 	  The Rockchip RK3288 is a ARM-based SoC with a quad-core Cortex-A17
 	  including NEON and GPU, 1MB L2 cache, Mali-T7 graphics, two
@@ -19,6 +23,17 @@ config ROCKCHIP_RK3288
 	  and video codec support. Peripherals include Gigabit Ethernet,
 	  USB2 host and OTG, SDIO, I2S, UART,s, SPI, I2C and PWMs.
 
+config ROCKCHIP_RK3399
+	bool "Support Rockchip RK3399"
+	select ARM64
+	help
+	  The Rockchip RK3399 is a ARM-based SoC with a dual-core Cortex-A72
+	  and quad-core Cortex-A53.
+	  including NEON and GPU, 1MB L2 cache, Mali-T7 graphics, two
+	  video interfaces supporting HDMI and eDP, several DDR3 options
+	  and video codec support. Peripherals include Gigabit Ethernet,
+	  USB2 host and OTG, SDIO, I2S, UARTs, SPI, I2C and PWMs.
+
 config ROCKCHIP_SPL_BACK_TO_BROM
 	bool "SPL returns to bootrom"
 	default y if ROCKCHIP_RK3036
@@ -29,4 +44,5 @@ config ROCKCHIP_SPL_BACK_TO_BROM
 
 source "arch/arm/mach-rockchip/rk3036/Kconfig"
 source "arch/arm/mach-rockchip/rk3288/Kconfig"
+source "arch/arm/mach-rockchip/rk3399/Kconfig"
 endif
arch/arm/mach-rockchip/Makefile +1 -0
index 722b582..157d42f 100644
@@ -16,3 +16,4 @@ obj-y += rk_timer.o
 endif
 obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036/
 obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288/
+obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399/
arch/arm/mach-rockchip/rk3399/Kconfig new file +23 -0
new file mode 100644
index 0000000..83bd04a
@@ -0,0 +1,23 @@
+if ROCKCHIP_RK3399
+
+choice
+	prompt "RK3399 board select"
+
+config TARGET_EVB_RK3399
+	bool "RK3399 evaluation board"
+	help
+	  RK3399evb is a evaluation board for Rockchp rk3399,
+	  with full function and phisical connectors support like type-C ports,
+	  usb2.0 host ports, LVDS, JTAG, MAC, SDcard, HDMI, USB-2-serial...
+
+endchoice
+
+config SYS_SOC
+	default "rockchip"
+
+config SYS_MALLOC_F_LEN
+	default 0x0800
+
+source "board/rockchip/evb_rk3399/Kconfig"
+
+endif
arch/arm/mach-rockchip/rk3399/Makefile new file +7 -0
new file mode 100644
index 0000000..3f219ac
@@ -0,0 +1,7 @@
+#
+# (C) Copyright 2016 Rockchip Electronics Co., Ltd
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y += rk3399.o
arch/arm/mach-rockchip/rk3399/rk3399.c new file +28 -0
new file mode 100644
index 0000000..cf5b4f3
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016 Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/armv8/mmu.h>
+
+static struct mm_region rk3399_mem_map[] = {
+	{
+		.base = 0x0UL,
+		.size = 0x80000000UL,
+		.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+			 PTE_BLOCK_INNER_SHARE
+	}, {
+		.base = 0xf0000000UL,
+		.size = 0x10000000UL,
+		.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+			 PTE_BLOCK_NON_SHARE |
+			 PTE_BLOCK_PXN | PTE_BLOCK_UXN
+	}, {
+		/* List terminator */
+		0,
+	}
+};
+
+struct mm_region *mem_map = rk3399_mem_map;
board/rockchip/evb_rk3399/Kconfig new file +15 -0
new file mode 100644
index 0000000..412b81c
@@ -0,0 +1,15 @@
+if TARGET_EVB_RK3399
+
+config SYS_BOARD
+	default "evb_rk3399"
+
+config SYS_VENDOR
+	default "rockchip"
+
+config SYS_CONFIG_NAME
+	default "evb_rk3399"
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+	def_bool y
+
+endif
board/rockchip/evb_rk3399/MAINTAINERS new file +0 -0
new file mode 100644
index 0000000..e69de29
board/rockchip/evb_rk3399/Makefile new file +7 -0
new file mode 100644
index 0000000..aaa51c2
@@ -0,0 +1,7 @@
+#
+# (C) Copyright 2016 Rockchip Electronics Co., Ltd
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y	+= evb-rk3399.o
board/rockchip/evb_rk3399/evb-rk3399.c new file +26 -0
new file mode 100644
index 0000000..dffacd0
@@ -0,0 +1,26 @@
+/*
+ * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+#include <common.h>
+#include <asm/armv8/mmu.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_init(void)
+{
+	return 0;
+}
+
+int dram_init(void)
+{
+	gd->ram_size = 0x80000000;
+	return 0;
+}
+
+void dram_init_banksize(void)
+{
+	gd->bd->bi_dram[0].start = 0;
+	gd->bd->bi_dram[0].size = 0x80000000;
+}
include/configs/evb_rk3399.h new file +26 -0
new file mode 100644
index 0000000..047850a
@@ -0,0 +1,26 @@
+/*
+ * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef __EVB_RK3399_H
+#define __EVB_RK3399_H
+
+#include <configs/rk3399_common.h>
+
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV 0
+/*
+ * SPL @ 32k for ~36k
+ * ENV @ 96k
+ * u-boot @ 128K
+ */
+#define CONFIG_ENV_OFFSET (96 * 1024)
+
+#define SDRAM_BANK_SIZE			(2UL << 30)
+
+#define CONFIG_SYS_WHITE_ON_BLACK
+#define CONFIG_CONSOLE_SCROLL_LINES		10
+
+#endif
include/configs/rk3399_common.h new file +73 -0

73 lines not on this page · raw message

Signature · 1 line
1.9.1
#4 lore raw

PATCH v5 2/4 ARM64: rockchip: add support for rk3399 SoC based evb

Quoted 41 lines · Kever Yang

RK3399 is a SoC from Rockchip with dual-core Cortex-A72 and quad-core Cortex-A53 CPU. It supports two USB3.0 type-C ports and two USB2.0 EHCI ports. Other interfaces are very much like RK3288, the DRAM are 32bit width address and support address from 0 to 4GB-128MB range.

---

Changes in v5:
- Rebase to u-boot-rockchip.git;
- fixes base on comments from Andreas;

Changes in v4:
- remove extra blank line in evb_rk3399.h,
- remove unnecessary including file in rk3399_common.h,
- fixes base on comments from Andreas,
- Rebase on U-Boot ToT.

Changes in v3:
- Rebase on patch from Andreas:
- [PATCH] rockchip: Exclude rk_timer for ARM64
- [PATCH] rockchip: Clean up CPU selection

Changes in v2:
- fix description error on board Kconfig

 arch/arm/Kconfig                       |  6 +--
 arch/arm/mach-rockchip/Kconfig         | 16 ++++++++
 arch/arm/mach-rockchip/Makefile        |  1 +
 arch/arm/mach-rockchip/rk3399/Kconfig  | 23 +++++++++++
 arch/arm/mach-rockchip/rk3399/Makefile |  7 ++++
 arch/arm/mach-rockchip/rk3399/rk3399.c | 28 +++++++++++++
 board/rockchip/evb_rk3399/Kconfig      | 15 +++++++
 board/rockchip/evb_rk3399/MAINTAINERS  |  0
 board/rockchip/evb_rk3399/Makefile     |  7 ++++
 board/rockchip/evb_rk3399/evb-rk3399.c | 26 ++++++++++++
 include/configs/evb_rk3399.h           | 26 ++++++++++++
 include/configs/rk3399_common.h        | 73 ++++++++++++++++++++++++++++++++++
 12 files changed, 224 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/mach-rockchip/rk3399/Kconfig
Quoted 8 lines
 create mode 100644 arch/arm/mach-rockchip/rk3399/Makefile
 create mode 100644 arch/arm/mach-rockchip/rk3399/rk3399.c
 create mode 100644 board/rockchip/evb_rk3399/Kconfig
 create mode 100644 board/rockchip/evb_rk3399/MAINTAINERS
 create mode 100644 board/rockchip/evb_rk3399/Makefile
 create mode 100644 board/rockchip/evb_rk3399/evb-rk3399.c
 create mode 100644 include/configs/evb_rk3399.h
 create mode 100644 include/configs/rk3399_common.h

Andreas please sing out if there are more comments.

author
#5 lore raw

PATCH v5 3/4 config: add config file for evb-rk3399

In reply to Kever Yang

This patch add basic config option for evb-rk3399 board.

---

Changes in v5: None
Changes in v4:
- move config CONFIG_SYS_NS16550 from chip common to defconfig

Changes in v3: None
Changes in v2: None

 configs/evb-rk3399_defconfig | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 configs/evb-rk3399_defconfig
configs/evb-rk3399_defconfig new file +33 -0
new file mode 100644
index 0000000..3f9b47e
@@ -0,0 +1,33 @@
+CONFIG_ARM=y
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_ROCKCHIP_RK3399=y
+CONFIG_TARGET_EVB_RK3399=y
+CONFIG_DEFAULT_DEVICE_TREE="rk3399-evb"
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_BOOTZ=y
+# CONFIG_CMD_IMLS is not set
+CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_TIME=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_CLK=y
+CONFIG_FIT=y
+CONFIG_SYSRESET=y
+CONFIG_DM_MMC=y
+CONFIG_ROCKCHIP_SDHCI=y
+CONFIG_PINCTRL=y
+CONFIG_RAM=y
+CONFIG_SYS_NS16550=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_BASE=0xFF1A0000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_USE_TINY_PRINTF=y
+CONFIG_ERRNO_STR=y
Signature · 1 line
1.9.1
#6 lore raw

PATCH v5 3/4 config: add config file for evb-rk3399

Quoted 9 lines · Kever Yang

This patch add basic config option for evb-rk3399 board.

---

Changes in v5: None
Changes in v4:
- move config CONFIG_SYS_NS16550 from chip common to defconfig

Quoted 6 lines

Changes in v3: None
Changes in v2: None

 configs/evb-rk3399_defconfig | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 configs/evb-rk3399_defconfig
#7 lore raw

PATCH v5 3/4 config: add config file for evb-rk3399

Quoted 10 lines · Simon Glass
Quoted 9 lines · Kever Yang

This patch add basic config option for evb-rk3399 board.

---

Changes in v5: None
Changes in v4:
- move config CONFIG_SYS_NS16550 from chip common to defconfig

Quoted 8 lines
Quoted 6 lines

Changes in v3: None
Changes in v2: None

 configs/evb-rk3399_defconfig | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 configs/evb-rk3399_defconfig

Applied to u-boot-rockchip, thanks!

I'd like to get the rockchip tree back into shape, since I made some merge errors, so I'm apply this series again (dropping v4).

If there are future comments, please send a follow-up patch. Depending on the timing I may be able to fix it up. I plan to send a pull request to mainline early next week.

The rk3368 stuff needs a rebase and resend unfortunately. It is safer than my trying to merge.

- Simon

author
#8 lore raw

PATCH v5 4/4 ARM64: evb-rk3399: add a README for this board setup

In reply to Kever Yang

Add a README to guide people flash the ATF and U-Boot with Rockchip tools to bring up to board.

---

Changes in v5:
- fix for comments from Simon, correct some typo;

Changes in v4: None
Changes in v3: None
Changes in v2:
- fix a binary path error

 board/rockchip/evb_rk3399/README | 73 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 board/rockchip/evb_rk3399/README
board/rockchip/evb_rk3399/README new file +73 -0
new file mode 100644
index 0000000..fb8bb19
@@ -0,0 +1,73 @@
+Introduction
+============
+
+RK3399 key features we might use in U-Boot:
+* CPU: ARMv8 64bit Big-Little architecture,
+*      Big: dual-core Cortex-A72
+*      Little: quad-core Cortex-A53
+* IRAM: 200KB
+* DRAM: 4GB-128MB dual-channel
+* eMMC: support eMMC 5.0/5.1, suport HS400, HS200, DDR50
+* SD/MMC: support SD 3.0, MMC 4.51
+* USB: USB3.0 typc-C port *2 with dwc3 controller
+*      USB2.0 EHCI host port *2
+* Display: RGB/HDMI/DP/MIPI/EDP
+
+evb key features:
+* regulator: pwm regulator for CPU B/L
+* PMIC: rk808
+* debug console: UART2
+
+In order to support Arm Trust Firmware(ATF), we need to use the
+miniloader from rockchip which:
+* do DRAM init
+* load and verify ATF image
+* load and verify U-Boot image
+
+Here is the step-by-step to boot to U-Boot on rk3399.
+
+Get the Source and prebuild binary
+==================================
+
+  > mkdir ~/evb_rk3399
+  > cd ~/evb_rk3399
+  > git clone https://github.com/ARM-software/arm-trusted-firmware.git
+  > git clone https://github.com/rockchip-linux/rkbin
+  > git clone https://github.com/rockchip-linux/rkflashtool
+
+Compile the ATF
+===============
+
+  > cd arm-trusted-firmware
+  > make realclean
+  > make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 bl31
+
+Compile the U-Boot
+==================
+
+  > cd ../u-boot
+  > make CROSS_COMPILE=aarch64-linux-gnu- evb-rk3399_defconfig all
+
+Compile the rkflashtool
+=======================
+
+  > cd ../rkflashtool
+  > make
+
+Package the image for miniloader
+================================
+  > cd ..
+  > cp arm-trusted-firmware/build/rk3399/release/bl31.bin rkbin/rk33
+  > ./rkbin/tools/trust_merger rkbin/tools/RK3399TRUST.ini
+  > ./rkbin/tools/loaderimage --pack --uboot u-boot/u-boot-dtb.bin uboot.img
+  > mkdir image
+  > mv trust.img ./image/
+  > mv uboot.img ./image/rk3399evb-uboot.bin
+
+Flash the image
+===============
+Power on(or reset with RESET KEY) with MASKROM KEY preesed, and then:
+
+  > ./rkflashtool/rkflashloader rk3399evb
+
+You should be able to get U-Boot log message in console/UART2 now.
Signature · 1 line
1.9.1
#9 lore raw

PATCH v5 4/4 ARM64: evb-rk3399: add a README for this board setup

Quoted 9 lines · Kever Yang

Add a README to guide people flash the ATF and U-Boot with Rockchip tools to bring up to board.

---

Changes in v5:
- fix for comments from Simon, correct some typo;

Quoted 8 lines

Changes in v4: None
Changes in v3: None
Changes in v2:
- fix a binary path error

 board/rockchip/evb_rk3399/README | 73 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 board/rockchip/evb_rk3399/README
#10 lore raw

PATCH v5 4/4 ARM64: evb-rk3399: add a README for this board setup

Quoted 15 lines · Simon Glass
Quoted 14 lines · Kever Yang

Add a README to guide people flash the ATF and U-Boot with Rockchip tools to bring up to board.

---

Changes in v5:
- fix for comments from Simon, correct some typo;

Changes in v4: None
Changes in v3: None
Changes in v2:
- fix a binary path error

Quoted 5 lines
Quoted 3 lines
 board/rockchip/evb_rk3399/README | 73 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 board/rockchip/evb_rk3399/README

Applied to u-boot-rockchip, thanks!

#11 lore raw

v5 cover add support for rk3399 soc and evb

In reply to Kever Yang

Am 19.07.2016 um 15:16 schrieb Kever Yang:

Quoted 64 lines

Hi Simon,

Sorry for didn't apply all the changes for comments from Andreas in V4, I rebase this patchset on u-boot-rockchip.git master branch and reset to below commit:
f278234 rockchip: update fastboot usage

Please help to rebase my patches, you should be able to apply these patches directly.

This patchset add support for rk3399 with ATF based on Rockchip miniloader as secondary bootloader instead of U-Boot SPL.

Rockchip miniloader init the DRAM and load the ATF and U-Boot to runing address, and then jump to ATF, the ATF do some init and switch to EL2/EL1 mode before jump to next loader which is U-Boot here.

Pls reference board/rockchip/evb_rk3399/README to setup the board.

Will migrate to SPL once its ready for ATF.

This patch set is based on below patch:
"board: move all the rockchip board in one folder"

This patch set has been test on rk3399 evb board.

In this version, I split the mmc driver in seperate thread, because when I enable the full-model for mmc driver, Seems bug happen in blk layer, will descript detail in mmc patch.

Changes in v5:
- add file source and detail changes for U-Boot
- Rebase to u-boot-rockchip.git;
- fixes base on comments from Andreas;
- fix for comments from Simon, correct some typo;

Changes in v4:
- remove extra blank line in evb_rk3399.h,
- remove unnecessary including file in rk3399_common.h,
- fixes base on comments from Andreas,
- Rebase on U-Boot ToT.
- move config CONFIG_SYS_NS16550 from chip common to defconfig

Changes in v3:
- Rebase on patch from Andreas:
- [PATCH] rockchip: Exclude rk_timer for ARM64
- [PATCH] rockchip: Clean up CPU selection

Changes in v2:
- fix description error on board Kconfig
- fix a binary path error

Kever Yang (4):
dts: add support for Rockchip rk3399 soc
ARM64: rockchip: add support for rk3399 SoC based evb
config: add config file for evb-rk3399
ARM64: evb-rk3399: add a README for this board setup

Quoted 11 lines
 arch/arm/Kconfig                       |    6 +-
 arch/arm/dts/Makefile                  |    3 +-
 arch/arm/dts/rk3399-evb.dts            |  104 ++++
 arch/arm/dts/rk3399.dtsi               | 1028 ++++++++++++++++++++++++++++++++
 arch/arm/mach-rockchip/Kconfig         |   16 +
 arch/arm/mach-rockchip/Makefile        |    1 +
 arch/arm/mach-rockchip/rk3399/Kconfig  |   23 +
 arch/arm/mach-rockchip/rk3399/Makefile |    7 +
 arch/arm/mach-rockchip/rk3399/rk3399.c |   28 +
 board/rockchip/evb_rk3399/Kconfig      |   15 +
 board/rockchip/evb_rk3399/MAINTAINERS  |    0

Was this intentionally merged with an empty MAINTAINERS file?

Andreas

Quoted 23 lines
 board/rockchip/evb_rk3399/Makefile     |    7 +
 board/rockchip/evb_rk3399/README       |   73 +++
 board/rockchip/evb_rk3399/evb-rk3399.c |   26 +
 configs/evb-rk3399_defconfig           |   33 +
 include/configs/evb_rk3399.h           |   26 +
 include/configs/rk3399_common.h        |   73 +++
 include/dt-bindings/clock/rk3399-cru.h |  746 +++++++++++++++++++++++
 18 files changed, 2210 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/dts/rk3399-evb.dts
 create mode 100644 arch/arm/dts/rk3399.dtsi
 create mode 100644 arch/arm/mach-rockchip/rk3399/Kconfig
 create mode 100644 arch/arm/mach-rockchip/rk3399/Makefile
 create mode 100644 arch/arm/mach-rockchip/rk3399/rk3399.c
 create mode 100644 board/rockchip/evb_rk3399/Kconfig
 create mode 100644 board/rockchip/evb_rk3399/MAINTAINERS
 create mode 100644 board/rockchip/evb_rk3399/Makefile
 create mode 100644 board/rockchip/evb_rk3399/README
 create mode 100644 board/rockchip/evb_rk3399/evb-rk3399.c
 create mode 100644 configs/evb-rk3399_defconfig
 create mode 100644 include/configs/evb_rk3399.h
 create mode 100644 include/configs/rk3399_common.h
 create mode 100644 include/dt-bindings/clock/rk3399-cru.h
Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
#12 lore raw

v5 cover add support for rk3399 soc and evb

Hi Andreas,

Quoted 77 lines · Andreas F?rber

Am 19.07.2016 um 15:16 schrieb Kever Yang:

Quoted 64 lines

Hi Simon,

Sorry for didn't apply all the changes for comments from Andreas in V4, I rebase this patchset on u-boot-rockchip.git master branch and reset to below commit:
f278234 rockchip: update fastboot usage

Please help to rebase my patches, you should be able to apply these patches directly.

This patchset add support for rk3399 with ATF based on Rockchip miniloader as secondary bootloader instead of U-Boot SPL.

Rockchip miniloader init the DRAM and load the ATF and U-Boot to runing address, and then jump to ATF, the ATF do some init and switch to EL2/EL1 mode before jump to next loader which is U-Boot here.

Pls reference board/rockchip/evb_rk3399/README to setup the board.

Will migrate to SPL once its ready for ATF.

This patch set is based on below patch:
"board: move all the rockchip board in one folder"

This patch set has been test on rk3399 evb board.

In this version, I split the mmc driver in seperate thread, because when I enable the full-model for mmc driver, Seems bug happen in blk layer, will descript detail in mmc patch.

Changes in v5:
- add file source and detail changes for U-Boot
- Rebase to u-boot-rockchip.git;
- fixes base on comments from Andreas;
- fix for comments from Simon, correct some typo;

Changes in v4:
- remove extra blank line in evb_rk3399.h,
- remove unnecessary including file in rk3399_common.h,
- fixes base on comments from Andreas,
- Rebase on U-Boot ToT.
- move config CONFIG_SYS_NS16550 from chip common to defconfig

Changes in v3:
- Rebase on patch from Andreas:
- [PATCH] rockchip: Exclude rk_timer for ARM64
- [PATCH] rockchip: Clean up CPU selection

Changes in v2:
- fix description error on board Kconfig
- fix a binary path error

Kever Yang (4):
dts: add support for Rockchip rk3399 soc
ARM64: rockchip: add support for rk3399 SoC based evb
config: add config file for evb-rk3399
ARM64: evb-rk3399: add a README for this board setup

Quoted 11 lines
 arch/arm/Kconfig                       |    6 +-
 arch/arm/dts/Makefile                  |    3 +-
 arch/arm/dts/rk3399-evb.dts            |  104 ++++
 arch/arm/dts/rk3399.dtsi               | 1028 ++++++++++++++++++++++++++++++++
 arch/arm/mach-rockchip/Kconfig         |   16 +
 arch/arm/mach-rockchip/Makefile        |    1 +
 arch/arm/mach-rockchip/rk3399/Kconfig  |   23 +
 arch/arm/mach-rockchip/rk3399/Makefile |    7 +
 arch/arm/mach-rockchip/rk3399/rk3399.c |   28 +
 board/rockchip/evb_rk3399/Kconfig      |   15 +
 board/rockchip/evb_rk3399/MAINTAINERS  |    0
Quoted 1 line

Was this intentionally merged with an empty MAINTAINERS file?

Well they are nice to have.

Kever can you please add a MAINTAINERS file?

We seem to be heading in the wrong direction here though:

$ ./tools/genboardscfg.py
/tmp/tmpP5gJ26:33: warning: overriding the value of USB. Old value:
"y", new value: "y".
/tmp/tmpP5gJ26:34: warning: overriding the value of USB_GADGET. Old
value: "y", new value: "y".
WARNING: no status info for 'ds414'
WARNING: no maintainers for 'ds414'
WARNING: no status info for 'conga-qeval20-qa3-e3845-internal-uart'
WARNING: no maintainers for 'conga-qeval20-qa3-e3845-internal-uart'
WARNING: no status info for 'am57xx_hs_evm'
WARNING: no maintainers for 'am57xx_hs_evm'
WARNING: no status info for 'p2771-0000-a02'
WARNING: no maintainers for 'p2771-0000-a02'
WARNING: no status info for 'malta64'
WARNING: no maintainers for 'malta64'
WARNING: no status info for 'strider_con_dp'
WARNING: no maintainers for 'strider_con_dp'
WARNING: no status info for 'evb-rk3399'
WARNING: no maintainers for 'evb-rk3399'
WARNING: no status info for 'p2771-0000-b00'
WARNING: no maintainers for 'p2771-0000-b00'
WARNING: no status info for 'espresso7420'
WARNING: no maintainers for 'espresso7420'
WARNING: no status info for 'strider_cpu_dp'
WARNING: no maintainers for 'strider_cpu_dp'
WARNING: no status info for 'malta64el'
WARNING: no maintainers for 'malta64el'
Quoted 28 lines

Andreas

Quoted 14 lines
 board/rockchip/evb_rk3399/Makefile     |    7 +
 board/rockchip/evb_rk3399/README       |   73 +++
 board/rockchip/evb_rk3399/evb-rk3399.c |   26 +
 configs/evb-rk3399_defconfig           |   33 +
 include/configs/evb_rk3399.h           |   26 +
 include/configs/rk3399_common.h        |   73 +++
 include/dt-bindings/clock/rk3399-cru.h |  746 +++++++++++++++++++++++
 18 files changed, 2210 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/dts/rk3399-evb.dts
 create mode 100644 arch/arm/dts/rk3399.dtsi
 create mode 100644 arch/arm/mach-rockchip/rk3399/Kconfig
 create mode 100644 arch/arm/mach-rockchip/rk3399/Makefile
 create mode 100644 arch/arm/mach-rockchip/rk3399/rk3399.c
 create mode 100644 board/rockchip/evb_rk3399/Kconfig
Quoted 9 lines
 create mode 100644 board/rockchip/evb_rk3399/MAINTAINERS
 create mode 100644 board/rockchip/evb_rk3399/Makefile
 create mode 100644 board/rockchip/evb_rk3399/README
 create mode 100644 board/rockchip/evb_rk3399/evb-rk3399.c
 create mode 100644 configs/evb-rk3399_defconfig
 create mode 100644 include/configs/evb_rk3399.h
 create mode 100644 include/configs/rk3399_common.h
 create mode 100644 include/dt-bindings/clock/rk3399-cru.h
Quoted 4 lines

--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton HRB 21284 (AG N?rnberg)

Regards,
SImon