Skip to contentSkip to conversation

add support for rk3399 soc and evb

PATCH Superseded Kever Yang 3 participants 15 messages Jul 18, 2016 – Jul 19, 2016

Subsystems (5)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Kever Yang

author
#0 lore raw

v4 cover add support for rk3399 soc and evb

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 v4:
remove extra blank line in evb_rk3399.h,
remove unnecessary including file in rk3399_common.h, fix base on commend 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                       |    2 -
 arch/arm/dts/Makefile                  |    3 +-
 arch/arm/dts/rk3399-evb.dts            |  104 ++++
 arch/arm/dts/rk3399.dtsi               | 1028 ++++++++++++++++++++++++++++++++
 arch/arm/mach-rockchip/Kconfig         |   18 +
 arch/arm/mach-rockchip/rk3399/Kconfig  |   18 +
 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 |   40 ++
 configs/evb-rk3399_defconfig           |   33 +
 include/configs/evb_rk3399.h           |   24 +
 include/configs/rk3399_common.h        |   71 +++
 include/dt-bindings/clock/rk3399-cru.h |  746 +++++++++++++++++++++++
 15 files changed, 2179 insertions(+), 3 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 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 v4 1/4 dts: add support for Rockchip rk3399 soc

These files are from kernel upstream with some modification need by U-Boot:
- chosen with stdout-path to uart2.

---

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 acecb7c..13f990a 100644
@@ -31,7 +31,8 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \
 	rk3288-firefly.dtb \
 	rk3288-jerry.dtb \
 	rk3288-rock2-square.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 v4 1/4 dts: add support for Rockchip rk3399 soc

Quoted 12 lines · Kever Yang

These files are from kernel upstream with some modification need by U-Boot:
- chosen with stdout-path to uart2.

---

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

Quoted 8 lines
 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

Applied to u-boot-rockchip, thanks!

#3 lore raw

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

In reply to Kever Yang

Am 18.07.2016 um 10:46 schrieb Kever Yang:

Quoted 9 lines

These files are from kernel upstream with some modification need by U-Boot:
- chosen with stdout-path to uart2.

---

Changes in v4: None

Commit message not extended as requested!

Further I notice that arason is not in linux.git, so it would be good to further clarify which tree that came from or whether that is a U-Boot-local change as well.

Andreas

Quoted 2 lines

Changes in v3: None
Changes in v2: None

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)
#4 lore raw

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

Hi Kever,

Quoted 11 lines · Andreas F?rber

Am 18.07.2016 um 10:46 schrieb Kever Yang:

Quoted 9 lines

These files are from kernel upstream with some modification need by U-Boot:
- chosen with stdout-path to uart2.

---

Changes in v4: None

Quoted 7 lines

Commit message not extended as requested!

Further I notice that arason is not in linux.git, so it would be good to further clarify which tree that came from or whether that is a U-Boot-local change as well.

Andreas

Unfortunately it seems I merged these patches too soon.

For this and any other comments, please either resend the patches or send fix-up patches and I will tidy this up.

But note that I am away this week so may not get to it until I return.

Regards,
Simon

author
#5 lore raw

PATCH v4 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 v4:
remove extra blank line in evb_rk3399.h, remove unnecessary including file in rk3399_common.h, fix base on commend from Andreas,
Rebase to 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                       |  2 -
 arch/arm/mach-rockchip/Kconfig         | 18 +++++++++
 arch/arm/mach-rockchip/rk3399/Kconfig  | 18 +++++++++
 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 | 40 +++++++++++++++++++
 include/configs/evb_rk3399.h           | 24 ++++++++++++
 include/configs/rk3399_common.h        | 71 ++++++++++++++++++++++++++++++++++
 9 files changed, 193 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-rockchip/rk3399/Kconfig
 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 +0 -2
index f9fddad..fee6a1c 100644
@@ -838,8 +838,6 @@ config STM32
 
 config ARCH_ROCKCHIP
 	bool "Support Rockchip SoCs"
-	select SUPPORT_SPL
-	select SPL
 	select OF_CONTROL
 	select BLK
 	select DM
arch/arm/mach-rockchip/Kconfig +18 -0
index 12415fc..4a4b6ee 100644
@@ -9,6 +9,9 @@ config ROCKCHIP_RK3288
 	  video interfaces supporting HDMI and eDP, several DDR3 options
 	  and video codec support. Peripherals include Gigabit Ethernet,
 	  USB2 host and OTG, SDIO, I2S, UART,s, SPI, I2C and PWMs.
+	select CPU_V7
+	select SUPPORT_SPL
+	select SPL
 
 config ROCKCHIP_RK3036
 	bool "Support Rockchip RK3036"
@@ -18,7 +21,22 @@ config ROCKCHIP_RK3036
 	  including NEON and GPU, Mali-400 graphics, several DDR3 options
 	  and video codec support. Peripherals include Gigabit Ethernet,
 	  USB2 host and OTG, SDIO, I2S, UART, SPI, I2C and PWMs.
+	select CPU_V7
+	select SUPPORT_SPL
+	select SPL
+
+config ROCKCHIP_RK3399
+	bool "Support Rockchip RK3399"
+	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.
+	select ARM64
 
 source "arch/arm/mach-rockchip/rk3288/Kconfig"
 source "arch/arm/mach-rockchip/rk3036/Kconfig"
+source "arch/arm/mach-rockchip/rk3399/Kconfig"
 endif
arch/arm/mach-rockchip/rk3399/Kconfig new file +18 -0
new file mode 100644
index 0000000..d15bb40
@@ -0,0 +1,18 @@
+if ROCKCHIP_RK3399
+
+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...
+
+config SYS_SOC
+	default "rockchip"
+
+config SYS_MALLOC_F_LEN
+	default 0x0800
+
+source "board/rockchip/evb_rk3399/Kconfig"
+
+endif
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 +40 -0
new file mode 100644
index 0000000..cabdda1
@@ -0,0 +1,40 @@
+/*
+ * (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;
+
+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;
+
+int board_init(void)
+{
+	return 0;
+}
+
+int dram_init(void)
+{
+	gd->ram_size = 0x80000000;
+	return 0;
+}
include/configs/evb_rk3399.h new file +24 -0
new file mode 100644
index 0000000..988b158
@@ -0,0 +1,24 @@
+/*
+ * (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 CONFIG_SYS_WHITE_ON_BLACK
+#define CONFIG_CONSOLE_SCROLL_LINES		10
+
+#endif
include/configs/rk3399_common.h new file +71 -0

71 lines not on this page · raw message

Signature · 1 line
1.9.1
#6 lore raw

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

Quoted 32 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 v4:
remove extra blank line in evb_rk3399.h, remove unnecessary including file in rk3399_common.h, fix base on commend from Andreas,
Rebase to 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                       |  2 -
 arch/arm/mach-rockchip/Kconfig         | 18 +++++++++
 arch/arm/mach-rockchip/rk3399/Kconfig  | 18 +++++++++
 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 | 40 +++++++++++++++++++
 include/configs/evb_rk3399.h           | 24 ++++++++++++
 include/configs/rk3399_common.h        | 71 ++++++++++++++++++++++++++++++++++
Quoted 8 lines
 9 files changed, 193 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-rockchip/rk3399/Kconfig
 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
#7 lore raw

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

Quoted 42 lines · Simon Glass
Quoted 32 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 v4:
remove extra blank line in evb_rk3399.h, remove unnecessary including file in rk3399_common.h, fix base on commend from Andreas,
Rebase to 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                       |  2 -
 arch/arm/mach-rockchip/Kconfig         | 18 +++++++++
 arch/arm/mach-rockchip/rk3399/Kconfig  | 18 +++++++++
 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 | 40 +++++++++++++++++++
 include/configs/evb_rk3399.h           | 24 ++++++++++++
 include/configs/rk3399_common.h        | 71 ++++++++++++++++++++++++++++++++++
Quoted 8 lines
 9 files changed, 193 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-rockchip/rk3399/Kconfig
 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
Quoted 1 line

Added 'if SPL' conditions in ARCH_ROCKCHIP, and

Applied to u-boot-rockchip, thanks!

#8 lore raw

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

In reply to Kever Yang

Am 18.07.2016 um 10:46 schrieb Kever Yang:

Quoted 6 lines

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.

Quoted 8 lines

---

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

Most of my review comments are still unresolved...

Quoted 32 lines

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                       |  2 -
 arch/arm/mach-rockchip/Kconfig         | 18 +++++++++
 arch/arm/mach-rockchip/rk3399/Kconfig  | 18 +++++++++
 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 | 40 +++++++++++++++++++
 include/configs/evb_rk3399.h           | 24 ++++++++++++
 include/configs/rk3399_common.h        | 71 ++++++++++++++++++++++++++++++++++
 9 files changed, 193 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-rockchip/rk3399/Kconfig
 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 +0 -0
index f9fddad..fee6a1c 100644

arch/arm/Kconfig config STM32 · line 843

Quoted 8 lines
arch/arm/Kconfig +0 -2
@@ -838,8 +838,6 @@ config STM32
 
 config ARCH_ROCKCHIP
 	bool "Support Rockchip SoCs"
-	select SUPPORT_SPL
-	select SPL
 	select OF_CONTROL
 	select BLK
 	select DM

Here and below we seemed to get a merge conflict with Heiko's patch - he added ifs instead, but still they selects got added below. I don't care which way we do it, but it should be consistent please.

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_RK3288 · line 12

Quoted 9 lines
arch/arm/mach-rockchip/Kconfig +1 -0
index 12415fc..4a4b6ee 100644
@@ -9,6 +9,9 @@ config ROCKCHIP_RK3288
 	  video interfaces supporting HDMI and eDP, several DDR3 options
 	  and video codec support. Peripherals include Gigabit Ethernet,
 	  USB2 host and OTG, SDIO, I2S, UART,s, SPI, I2C and PWMs.
+	select CPU_V7

Still duplicate.

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_RK3288 · line 14

Quoted 2 lines
arch/arm/mach-rockchip/Kconfig +2 -0
+	select SUPPORT_SPL
+	select SPL

Still below help.

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_RK3036 · line 26

Quoted 10 lines
arch/arm/mach-rockchip/Kconfig +3 -0
 config ROCKCHIP_RK3036
 	bool "Support Rockchip RK3036"
@@ -18,7 +21,22 @@ config ROCKCHIP_RK3036
 	  including NEON and GPU, Mali-400 graphics, several DDR3 options
 	  and video codec support. Peripherals include Gigabit Ethernet,
 	  USB2 host and OTG, SDIO, I2S, UART, SPI, I2C and PWMs.
+	select CPU_V7
+	select SUPPORT_SPL
+	select SPL

Ditto.

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_RK3036 · line 37

Quoted 11 lines
arch/arm/mach-rockchip/Kconfig +11 -0
+
+config ROCKCHIP_RK3399
+	bool "Support Rockchip RK3399"
+	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.
+	select ARM64

Still below help.

Note that in Simon's tree this slipped below the new BROM option, it should logically be above and after RK3288.

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_RK3036 · line 40

Quoted 3 lines
arch/arm/mach-rockchip/Kconfig +0 -0
 source "arch/arm/mach-rockchip/rk3288/Kconfig"
 source "arch/arm/mach-rockchip/rk3036/Kconfig"

In Simon's tree this option accidentally got dropped in this patch!

Quoted 8 lines
arch/arm/mach-rockchip/Kconfig +1 -0
+source "arch/arm/mach-rockchip/rk3399/Kconfig"
 endif
arch/arm/mach-rockchip/rk3399/Kconfig new file +0 -0
new file mode 100644
index 0000000..d15bb40

arch/arm/mach-rockchip/rk3399/Kconfig line 8

Quoted 8 lines
arch/arm/mach-rockchip/rk3399/Kconfig new file +8 -0
@@ -0,0 +1,18 @@
+if ROCKCHIP_RK3399
+
+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...

No choice - intentional or forgotten?

Quoted 72 lines
arch/arm/mach-rockchip/rk3399/Kconfig new file +10 -0
+
+config SYS_SOC
+	default "rockchip"
+
+config SYS_MALLOC_F_LEN
+	default 0x0800
+
+source "board/rockchip/evb_rk3399/Kconfig"
+
+endif
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 +19 -0
new file mode 100644
index 0000000..cabdda1
@@ -0,0 +1,40 @@
+/*
+ * (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;
+
+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,

board/rockchip/evb_rk3399/evb-rk3399.c line 29

Quoted 10 lines
board/rockchip/evb_rk3399/evb-rk3399.c new file +10 -0
+		.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;

Still in the board instead of the SoC - compare my rk3368 patch and the in-tree, e.g., fsl implementations.

Quoted 105 lines
board/rockchip/evb_rk3399/evb-rk3399.c new file +11 -0
+
+int board_init(void)
+{
+	return 0;
+}
+
+int dram_init(void)
+{
+	gd->ram_size = 0x80000000;
+	return 0;
+}
include/configs/evb_rk3399.h new file +24 -0
new file mode 100644
index 0000000..988b158
@@ -0,0 +1,24 @@
+/*
+ * (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 CONFIG_SYS_WHITE_ON_BLACK
+#define CONFIG_CONSOLE_SCROLL_LINES		10
+
+#endif
include/configs/rk3399_common.h new file +58 -0
new file mode 100644
index 0000000..e4248c6
@@ -0,0 +1,71 @@
+/*
+ * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef __CONFIG_RK3399_COMMON_H
+#define __CONFIG_RK3399_COMMON_H
+
+#define CONFIG_SYS_CACHELINE_SIZE	64
+
+#define CONFIG_SYS_NO_FLASH
+#define CONFIG_NR_DRAM_BANKS		1
+#define CONFIG_ENV_SIZE			0x2000
+#define CONFIG_SYS_MAXARGS		16
+#define CONFIG_BAUDRATE			1500000
+#define CONFIG_SYS_MALLOC_LEN		(32 << 20)
+#define CONFIG_SYS_CBSIZE		1024
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_DISPLAY_BOARDINFO
+
+#define CONFIG_SYS_NS16550_MEM32
+
+#define CONFIG_SYS_TEXT_BASE		0x00200000
+#define CONFIG_SYS_INIT_SP_ADDR		0x00300000
+#define CONFIG_SYS_LOAD_ADDR		0x00800800
+
+#define CONFIG_SYS_BOOTM_LEN	(64 << 20)	/* 64M */
+
+/* MMC/SD IP block */
+#define CONFIG_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_SDHCI
+#define CONFIG_BOUNCE_BUFFER
+#define CONFIG_ROCKCHIP_SDHCI_MAX_FREQ	200000000
+
+#define CONFIG_FAT_WRITE
+
+/* RAW SD card / eMMC locations. */
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR	256
+#define CONFIG_SYS_SPI_U_BOOT_OFFS	(128 << 10)
+
+/* FAT sd card locations. */
+#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
+#define CONFIG_SYS_SDRAM_BASE		0
+#define CONFIG_NR_DRAM_BANKS		1
+#define SDRAM_BANK_SIZE			(2UL << 30)
+
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI
+#define CONFIG_SF_DEFAULT_SPEED 20000000
+
+#ifndef CONFIG_SPL_BUILD
+#include <config_distro_defaults.h>
+
+#define ENV_MEM_LAYOUT_SETTINGS \
+	"scriptaddr=0x00000000\0" \
+	"pxefile_addr_r=0x00100000\0" \

include/configs/rk3399_common.h line 68

Quoted 10 lines
include/configs/rk3399_common.h new file +10 -0
+	"fdt_addr_r=0x01f00000\0" \
+	"kernel_addr_r=0x02000000\0" \
+	"ramdisk_addr_r=0x04000000\0"
+
+/* First try to boot from SD (index 0), then eMMC (index 1) */
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 0) \
+	func(MMC, mmc, 1)
+
+#include <config_distro_bootcmd.h>

BOOTENV still missing.

include/configs/rk3399_common.h line 71

Quoted 3 lines
include/configs/rk3399_common.h new file +3 -0
+#endif
+
+#endif

Please go through all my previous review mails (4 for this patch alone) to see if there's more remaining issues I don't spot right now. It took me time to do the review, so no reason to let nits slip in despite a respin.

Also it would be fair to CC me on resends after I've had comments so I can re-review them - I did CC you on mine.

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
#9 lore raw

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

Hi Andreas,

Quoted 10 lines · Andreas F?rber

Am 18.07.2016 um 10:46 schrieb Kever Yang:

Quoted 9 lines

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.

---

Quoted 6 lines
Quoted 5 lines

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

Most of my review comments are still unresolved...

I will reply your comments one by one this time, I make a mistake because I didn't rebase to ToT of u-boot-rockchip, but rebase to ToT of U-Boot,
and also didn't spend enough time on Heiko's and your patch set.

Quoted 33 lines
Quoted 33 lines

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                       |  2 -
  arch/arm/mach-rockchip/Kconfig         | 18 +++++++++
  arch/arm/mach-rockchip/rk3399/Kconfig  | 18 +++++++++
  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 | 40 +++++++++++++++++++
  include/configs/evb_rk3399.h           | 24 ++++++++++++
  include/configs/rk3399_common.h        | 71 ++++++++++++++++++++++++++++++++++
  9 files changed, 193 insertions(+), 2 deletions(-)

create mode 100644 arch/arm/mach-rockchip/rk3399/Kconfig 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 +0 -0
index f9fddad..fee6a1c 100644
@@ -838,8 +838,6 @@ config STM32
 
Quoted 10 lines

arch/arm/Kconfig config STM32 · line 843

Quoted 7 lines
arch/arm/Kconfig +0 -2
  config ARCH_ROCKCHIP
  	bool "Support Rockchip SoCs"
-	select SUPPORT_SPL
-	select SPL
  	select OF_CONTROL
  	select BLK
  	select DM

Here and below we seemed to get a merge conflict with Heiko's patch - he added ifs instead, but still they selects got added below. I don't care which way we do it, but it should be consistent please.

Will using what Simon do when he apply this patch.

Quoted 11 lines

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_RK3288 · line 12

Quoted 10 lines
arch/arm/mach-rockchip/Kconfig +1 -0
index 12415fc..4a4b6ee 100644
@@ -9,6 +9,9 @@ config ROCKCHIP_RK3288
  	  video interfaces supporting HDMI and eDP, several DDR3 options
  	  and video codec support. Peripherals include Gigabit Ethernet,
  	  USB2 host and OTG, SDIO, I2S, UART,s, SPI, I2C and PWMs.
+	select CPU_V7

Still duplicate.

will fix in V5.

Quoted 4 lines

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_RK3288 · line 14

Quoted 3 lines
arch/arm/mach-rockchip/Kconfig +2 -0
+	select SUPPORT_SPL
+	select SPL

Still below help.

will fix in V5.

Quoted 12 lines

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_RK3036 · line 26

Quoted 11 lines
arch/arm/mach-rockchip/Kconfig +3 -0
  config ROCKCHIP_RK3036
  	bool "Support Rockchip RK3036"
@@ -18,7 +21,22 @@ config ROCKCHIP_RK3036
  	  including NEON and GPU, Mali-400 graphics, several DDR3 options
  	  and video codec support. Peripherals include Gigabit Ethernet,
  	  USB2 host and OTG, SDIO, I2S, UART, SPI, I2C and PWMs.
+	select CPU_V7
+	select SUPPORT_SPL
+	select SPL

Ditto.

will fix in V5.

Quoted 14 lines

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_RK3036 · line 37

Quoted 12 lines
arch/arm/mach-rockchip/Kconfig +11 -0
+
+config ROCKCHIP_RK3399
+	bool "Support Rockchip RK3399"
+	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.
+	select ARM64

Still below help.

Quoted 2 lines

Note that in Simon's tree this slipped below the new BROM option, it should logically be above and after RK3288.

will fix in V5.

Quoted 5 lines

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_RK3036 · line 40

Quoted 4 lines
arch/arm/mach-rockchip/Kconfig +0 -0
  source "arch/arm/mach-rockchip/rk3288/Kconfig"
  source "arch/arm/mach-rockchip/rk3036/Kconfig"

In Simon's tree this option accidentally got dropped in this patch!

will fix in V5.

Quoted 10 lines
Quoted 10 lines
arch/arm/mach-rockchip/Kconfig +1 -0
+source "arch/arm/mach-rockchip/rk3399/Kconfig"
  endif
arch/arm/mach-rockchip/rk3399/Kconfig new file +1 -0
new file mode 100644
index 0000000..d15bb40
@@ -0,0 +1,18 @@
+if ROCKCHIP_RK3399
Quoted 8 lines

arch/arm/mach-rockchip/rk3399/Kconfig line 8

Quoted 7 lines
arch/arm/mach-rockchip/rk3399/Kconfig new file +7 -0
+
+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...

No choice - intentional or forgotten?

Will fix in V5.
I do not understand what to do here last time, there is no choice in rk3288/rk3036.

Quoted 77 lines
Quoted 77 lines
arch/arm/mach-rockchip/rk3399/Kconfig new file +10 -0
+
+config SYS_SOC
+	default "rockchip"
+
+config SYS_MALLOC_F_LEN
+	default 0x0800
+
+source "board/rockchip/evb_rk3399/Kconfig"
+
+endif
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 +23 -0
new file mode 100644
index 0000000..cabdda1
@@ -0,0 +1,40 @@
+/*
+ * (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;
+
+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
+	}, {
Quoted 8 lines

board/rockchip/evb_rk3399/evb-rk3399.c line 29

Quoted 6 lines
board/rockchip/evb_rk3399/evb-rk3399.c new file +6 -0
+		/* List terminator */
+		0,
+	}
+};
+
+struct mm_region *mem_map = rk3399_mem_map;

Still in the board instead of the SoC - compare my rk3368 patch and the in-tree, e.g., fsl implementations.

I use hikey board implementation as reference, that's why it's here, Will add a soc file to include this table.

Quoted 109 lines
Quoted 109 lines
board/rockchip/evb_rk3399/evb-rk3399.c new file +11 -0
+
+int board_init(void)
+{
+	return 0;
+}
+
+int dram_init(void)
+{
+	gd->ram_size = 0x80000000;
+	return 0;
+}
include/configs/evb_rk3399.h new file +24 -0
new file mode 100644
index 0000000..988b158
@@ -0,0 +1,24 @@
+/*
+ * (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 CONFIG_SYS_WHITE_ON_BLACK
+#define CONFIG_CONSOLE_SCROLL_LINES		10
+
+#endif
include/configs/rk3399_common.h new file +61 -0
new file mode 100644
index 0000000..e4248c6
@@ -0,0 +1,71 @@
+/*
+ * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+
+#ifndef __CONFIG_RK3399_COMMON_H
+#define __CONFIG_RK3399_COMMON_H
+
+#define CONFIG_SYS_CACHELINE_SIZE	64
+
+#define CONFIG_SYS_NO_FLASH
+#define CONFIG_NR_DRAM_BANKS		1
+#define CONFIG_ENV_SIZE			0x2000
+#define CONFIG_SYS_MAXARGS		16
+#define CONFIG_BAUDRATE			1500000
+#define CONFIG_SYS_MALLOC_LEN		(32 << 20)
+#define CONFIG_SYS_CBSIZE		1024
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_DISPLAY_BOARDINFO
+
+#define CONFIG_SYS_NS16550_MEM32
+
+#define CONFIG_SYS_TEXT_BASE		0x00200000
+#define CONFIG_SYS_INIT_SP_ADDR		0x00300000
+#define CONFIG_SYS_LOAD_ADDR		0x00800800
+
+#define CONFIG_SYS_BOOTM_LEN	(64 << 20)	/* 64M */
+
+/* MMC/SD IP block */
+#define CONFIG_MMC
+#define CONFIG_GENERIC_MMC
+#define CONFIG_SDHCI
+#define CONFIG_BOUNCE_BUFFER
+#define CONFIG_ROCKCHIP_SDHCI_MAX_FREQ	200000000
+
+#define CONFIG_FAT_WRITE
+
+/* RAW SD card / eMMC locations. */
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR	256
+#define CONFIG_SYS_SPI_U_BOOT_OFFS	(128 << 10)
+
+/* FAT sd card locations. */
+#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
+#define CONFIG_SYS_SDRAM_BASE		0
+#define CONFIG_NR_DRAM_BANKS		1
+#define SDRAM_BANK_SIZE			(2UL << 30)
+
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI
+#define CONFIG_SF_DEFAULT_SPEED 20000000
+
+#ifndef CONFIG_SPL_BUILD
+#include <config_distro_defaults.h>
+
+#define ENV_MEM_LAYOUT_SETTINGS \
+	"scriptaddr=0x00000000\0" \
+	"pxefile_addr_r=0x00100000\0" \
+	"fdt_addr_r=0x01f00000\0" \
+	"kernel_addr_r=0x02000000\0" \
+	"ramdisk_addr_r=0x04000000\0"
Quoted 8 lines

include/configs/rk3399_common.h line 68

Quoted 7 lines
include/configs/rk3399_common.h new file +7 -0
+
+/* First try to boot from SD (index 0), then eMMC (index 1) */
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 0) \
+	func(MMC, mmc, 1)
+
+#include <config_distro_bootcmd.h>

BOOTENV still missing.

Will add BOOTENV, I didn't care about this because I haven't start my work on loading next stage image.

Quoted 10 lines

include/configs/rk3399_common.h line 71

Quoted 4 lines
include/configs/rk3399_common.h new file +3 -0
+#endif
+
+#endif

Please go through all my previous review mails (4 for this patch alone) to see if there's more remaining issues I don't spot right now. It took me time to do the review, so no reason to let nits slip in despite a respin.

Also it would be fair to CC me on resends after I've had comments so I can re-review them - I did CC you on mine.

I apologize for didn't CC you in this patchset, I do appreciate your help and review.
I think I have replay all your comments and apply most of change except that I don't accept to add "select SYS_NS16550" in Kconfig because people add "CONFIG_SYS_NS16550=y" in defconfig.

Thanks,
- Kever

Quoted 4 lines

Regards,
Andreas

author
#10 lore raw

PATCH v4 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 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
#11 lore raw

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

Quoted 8 lines · Kever Yang

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

---

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
#12 lore raw

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

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

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

---

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!

author
#13 lore raw

PATCH v4 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 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..af4e45e
@@ -0,0 +1,73 @@
+Introduction
+============
+
+RK3399 key feature 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 feature:
+* regulator: pwm regulator for CPU B/L
+* PMIC: rk808
+* debug console: UART2
+
+In order to support Arm Trust Firmware, we need to use the
+miniloader from rockchip which:
+* do DRAM init
+* load&verify ATF image
+* load&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
#14 lore raw

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

Quoted 6 lines · Kever Yang

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

---

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

Looks good, but please see nits below.

board/rockchip/evb_rk3399/README line 4

Quoted 11 lines
board/rockchip/evb_rk3399/README new file +4 -0
new file mode 100644
index 0000000..af4e45e
@@ -0,0 +1,73 @@
+Introduction
+============
+
+RK3399 key feature we might use in u-boot:

features

Quoted 7 lines
board/rockchip/evb_rk3399/README new file +7 -0
+* 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

board/rockchip/evb_rk3399/README line 21

Quoted 10 lines
board/rockchip/evb_rk3399/README new file +10 -0
+* USB: USB3.0 typc-C port *2 with dwc3 controller
+*      USB2.0 EHCI host port *2
+* Display: RGB/HDMI/DP/MIPI/EDP
+
+evb feature:
+* regulator: pwm regulator for CPU B/L
+* PMIC: rk808
+* debug console: UART2
+
+In order to support Arm Trust Firmware, we need to use the

Arm Trust Firmware (ATF)

board/rockchip/evb_rk3399/README line 24

Quoted 3 lines
board/rockchip/evb_rk3399/README new file +3 -0
+miniloader from rockchip which:
+* do DRAM init
+* load&verify ATF image

load and verify ATF image

board/rockchip/evb_rk3399/README line 25

Quoted 1 line
board/rockchip/evb_rk3399/README new file +1 -0
+* load&verify u-boot image

load and verify U-Boot image

board/rockchip/evb_rk3399/README line 27

Quoted 2 lines
board/rockchip/evb_rk3399/README new file +2 -0
+
+Here is the step by step to boot to U-boot on rk3399.

step-by-step

Please use 'U-Boot' consistently - check below also.

Quoted 47 lines
board/rockchip/evb_rk3399/README new file +46 -1
+
+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.
--
Quoted 3 lines

1.9.1

Regards,
Simon