[U-Boot] [PATCH 1/3] rockchip: add u-boot specific dts for rk3368 based boards

Device drivers like debug serial, dmc should be enabled before relocation, so add u-boot.dtsi files to contain devices that should be marked as dm-pre-reloc.
Signed-off-by: Andy Yan andy.yan@rock-chips.com ---
arch/arm/dts/rk3368-geekbox-u-boot.dtsi | 35 +++++++++++++++++++++++++++++++++ arch/arm/dts/rk3368-px5-evb-u-boot.dtsi | 35 +++++++++++++++++++++++++++++++++ arch/arm/dts/rk3368-sheep-u-boot.dtsi | 35 +++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 arch/arm/dts/rk3368-geekbox-u-boot.dtsi create mode 100644 arch/arm/dts/rk3368-px5-evb-u-boot.dtsi create mode 100644 arch/arm/dts/rk3368-sheep-u-boot.dtsi
diff --git a/arch/arm/dts/rk3368-geekbox-u-boot.dtsi b/arch/arm/dts/rk3368-geekbox-u-boot.dtsi new file mode 100644 index 0000000..7cf4a36 --- /dev/null +++ b/arch/arm/dts/rk3368-geekbox-u-boot.dtsi @@ -0,0 +1,35 @@ +/* + * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH + * + * SPDX-License-Identifier: GPL-2.0+ X11 + */ + +&pinctrl { + u-boot,dm-pre-reloc; +}; + +&service_msch { + u-boot,dm-pre-reloc; +}; + +&dmc { + u-boot,dm-pre-reloc; + status = "okay"; +}; + +&pmugrf { + u-boot,dm-pre-reloc; +}; + +&cru { + u-boot,dm-pre-reloc; +}; + +&grf { + u-boot,dm-pre-reloc; +}; + +&uart2 { + u-boot,dm-pre-reloc; +}; + diff --git a/arch/arm/dts/rk3368-px5-evb-u-boot.dtsi b/arch/arm/dts/rk3368-px5-evb-u-boot.dtsi new file mode 100644 index 0000000..633dfe1 --- /dev/null +++ b/arch/arm/dts/rk3368-px5-evb-u-boot.dtsi @@ -0,0 +1,35 @@ +/* + * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH + * + * SPDX-License-Identifier: GPL-2.0+ X11 + */ + +&pinctrl { + u-boot,dm-pre-reloc; +}; + +&service_msch { + u-boot,dm-pre-reloc; +}; + +&dmc { + u-boot,dm-pre-reloc; + status = "okay"; +}; + +&pmugrf { + u-boot,dm-pre-reloc; +}; + +&cru { + u-boot,dm-pre-reloc; +}; + +&grf { + u-boot,dm-pre-reloc; +}; + +&uart4 { + u-boot,dm-pre-reloc; +}; + diff --git a/arch/arm/dts/rk3368-sheep-u-boot.dtsi b/arch/arm/dts/rk3368-sheep-u-boot.dtsi new file mode 100644 index 0000000..7cf4a36 --- /dev/null +++ b/arch/arm/dts/rk3368-sheep-u-boot.dtsi @@ -0,0 +1,35 @@ +/* + * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH + * + * SPDX-License-Identifier: GPL-2.0+ X11 + */ + +&pinctrl { + u-boot,dm-pre-reloc; +}; + +&service_msch { + u-boot,dm-pre-reloc; +}; + +&dmc { + u-boot,dm-pre-reloc; + status = "okay"; +}; + +&pmugrf { + u-boot,dm-pre-reloc; +}; + +&cru { + u-boot,dm-pre-reloc; +}; + +&grf { + u-boot,dm-pre-reloc; +}; + +&uart2 { + u-boot,dm-pre-reloc; +}; +

The default 1kb pre-reloc malloc pool is not enough for dm core to enable the dm-pre-reloc device drivers.
Signed-off-by: Andy Yan andy.yan@rock-chips.com ---
configs/evb-px5_defconfig | 1 + configs/geekbox_defconfig | 1 + configs/sheep-rk3368_defconfig | 1 + 3 files changed, 3 insertions(+)
diff --git a/configs/evb-px5_defconfig b/configs/evb-px5_defconfig index dae5094..72e492f 100644 --- a/configs/evb-px5_defconfig +++ b/configs/evb-px5_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y +CONFIG_SYS_MALLOC_F_LEN=0x1000 CONFIG_ROCKCHIP_RK3368=y CONFIG_TARGET_EVB_PX5=y CONFIG_DEFAULT_DEVICE_TREE="rk3368-px5-evb" diff --git a/configs/geekbox_defconfig b/configs/geekbox_defconfig index a1944b4..0fd89d2 100644 --- a/configs/geekbox_defconfig +++ b/configs/geekbox_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y +CONFIG_SYS_MALLOC_F_LEN=0x1000 CONFIG_ROCKCHIP_RK3368=y CONFIG_TARGET_GEEKBOX=y CONFIG_DEFAULT_DEVICE_TREE="rk3368-geekbox" diff --git a/configs/sheep-rk3368_defconfig b/configs/sheep-rk3368_defconfig index be00fad..da6b93a 100644 --- a/configs/sheep-rk3368_defconfig +++ b/configs/sheep-rk3368_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y +CONFIG_SYS_MALLOC_F_LEN=0x1000 CONFIG_ROCKCHIP_RK3368=y CONFIG_DEFAULT_DEVICE_TREE="rk3368-sheep" CONFIG_DEBUG_UART=y

On 02 Aug 2017, at 15:10, Andy Yan andy.yan@rock-chips.com wrote:
The default 1kb pre-reloc malloc pool is not enough for dm core to enable the dm-pre-reloc device drivers.
Signed-off-by: Andy Yan andy.yan@rock-chips.com —
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
See comment below.
configs/evb-px5_defconfig | 1 + configs/geekbox_defconfig | 1 + configs/sheep-rk3368_defconfig | 1 + 3 files changed, 3 insertions(+)
diff --git a/configs/evb-px5_defconfig b/configs/evb-px5_defconfig index dae5094..72e492f 100644 --- a/configs/evb-px5_defconfig +++ b/configs/evb-px5_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y +CONFIG_SYS_MALLOC_F_LEN=0x1000
We even increased this to 0x2000 for TPL/SPL on the lion-board (i.e. RK3368-uQ7). Should we just make 0x2000 the default for RK3368 (in Kconfig) and reduce the noise in defconfig?
CONFIG_ROCKCHIP_RK3368=y CONFIG_TARGET_EVB_PX5=y CONFIG_DEFAULT_DEVICE_TREE="rk3368-px5-evb" diff --git a/configs/geekbox_defconfig b/configs/geekbox_defconfig index a1944b4..0fd89d2 100644 --- a/configs/geekbox_defconfig +++ b/configs/geekbox_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y +CONFIG_SYS_MALLOC_F_LEN=0x1000 CONFIG_ROCKCHIP_RK3368=y CONFIG_TARGET_GEEKBOX=y CONFIG_DEFAULT_DEVICE_TREE="rk3368-geekbox" diff --git a/configs/sheep-rk3368_defconfig b/configs/sheep-rk3368_defconfig index be00fad..da6b93a 100644 --- a/configs/sheep-rk3368_defconfig +++ b/configs/sheep-rk3368_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y +CONFIG_SYS_MALLOC_F_LEN=0x1000 CONFIG_ROCKCHIP_RK3368=y CONFIG_DEFAULT_DEVICE_TREE="rk3368-sheep" CONFIG_DEBUG_UART=y -- 2.7.4

Am 02.08.2017 um 15:25 schrieb Dr. Philipp Tomsich:
On 02 Aug 2017, at 15:10, Andy Yan andy.yan@rock-chips.com wrote:
The default 1kb pre-reloc malloc pool is not enough for dm core to enable the dm-pre-reloc device drivers.
Signed-off-by: Andy Yan andy.yan@rock-chips.com —
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
See comment below.
configs/evb-px5_defconfig | 1 + configs/geekbox_defconfig | 1 + configs/sheep-rk3368_defconfig | 1 + 3 files changed, 3 insertions(+)
diff --git a/configs/evb-px5_defconfig b/configs/evb-px5_defconfig index dae5094..72e492f 100644 --- a/configs/evb-px5_defconfig +++ b/configs/evb-px5_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y +CONFIG_SYS_MALLOC_F_LEN=0x1000
We even increased this to 0x2000 for TPL/SPL on the lion-board (i.e. RK3368-uQ7). Should we just make 0x2000 the default for RK3368 (in Kconfig) and reduce the noise in defconfig?
Is there any downside to it? If not, I'd say yes.
Regards, Andreas

Hi Philipp:
On 2017年08月02日 21:25, Dr. Philipp Tomsich wrote:
On 02 Aug 2017, at 15:10, Andy Yan andy.yan@rock-chips.com wrote:
The default 1kb pre-reloc malloc pool is not enough for dm core to enable the dm-pre-reloc device drivers.
Signed-off-by: Andy Yan andy.yan@rock-chips.com —
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
See comment below.
configs/evb-px5_defconfig | 1 + configs/geekbox_defconfig | 1 + configs/sheep-rk3368_defconfig | 1 + 3 files changed, 3 insertions(+)
diff --git a/configs/evb-px5_defconfig b/configs/evb-px5_defconfig index dae5094..72e492f 100644 --- a/configs/evb-px5_defconfig +++ b/configs/evb-px5_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y +CONFIG_SYS_MALLOC_F_LEN=0x1000
We even increased this to 0x2000 for TPL/SPL on the lion-board (i.e. RK3368-uQ7). Should we just make 0x2000 the default for RK3368 (in Kconfig) and reduce the noise in defconfig?
I have no problem with it.
CONFIG_ROCKCHIP_RK3368=y CONFIG_TARGET_EVB_PX5=y CONFIG_DEFAULT_DEVICE_TREE="rk3368-px5-evb" diff --git a/configs/geekbox_defconfig b/configs/geekbox_defconfig index a1944b4..0fd89d2 100644 --- a/configs/geekbox_defconfig +++ b/configs/geekbox_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y +CONFIG_SYS_MALLOC_F_LEN=0x1000 CONFIG_ROCKCHIP_RK3368=y CONFIG_TARGET_GEEKBOX=y CONFIG_DEFAULT_DEVICE_TREE="rk3368-geekbox" diff --git a/configs/sheep-rk3368_defconfig b/configs/sheep-rk3368_defconfig index be00fad..da6b93a 100644 --- a/configs/sheep-rk3368_defconfig +++ b/configs/sheep-rk3368_defconfig @@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y +CONFIG_SYS_MALLOC_F_LEN=0x1000 CONFIG_ROCKCHIP_RK3368=y CONFIG_DEFAULT_DEVICE_TREE="rk3368-sheep" CONFIG_DEBUG_UART=y -- 2.7.4

The default 1kb pre-reloc malloc pool is not enough for dm core to enable the dm-pre-reloc device drivers.
Signed-off-by: Andy Yan andy.yan@rock-chips.com Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
configs/evb-px5_defconfig | 1 + configs/geekbox_defconfig | 1 + configs/sheep-rk3368_defconfig | 1 + 3 files changed, 3 insertions(+)
Applied to u-boot-rockchip, thanks!

As the debug uart is marked as dm-pre-reloc, the pinctrl driver will handle the correct iomux setting.
Signed-off-by: Andy Yan andy.yan@rock-chips.com ---
board/rockchip/evb_px5/evb-px5.c | 24 ------------------------ 1 file changed, 24 deletions(-)
diff --git a/board/rockchip/evb_px5/evb-px5.c b/board/rockchip/evb_px5/evb-px5.c index 6dca1fc..6a47642 100644 --- a/board/rockchip/evb_px5/evb-px5.c +++ b/board/rockchip/evb_px5/evb-px5.c @@ -4,30 +4,6 @@ * SPDX-License-Identifier: GPL-2.0+ */ #include <common.h> -#include <asm/io.h> -#include <fdtdec.h> -#include <asm/arch/clock.h> -#include <asm/arch/grf_rk3368.h> - -DECLARE_GLOBAL_DATA_PTR; - -int mach_cpu_init(void) -{ - struct rk3368_pmu_grf *pmugrf; - int node; - - node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, "rockchip,rk3368-pmugrf"); - pmugrf = (struct rk3368_pmu_grf *)fdtdec_get_addr(gd->fdt_blob, node, "reg"); - - rk_clrsetreg(&pmugrf->gpio0d_iomux, - GPIO0D0_MASK | GPIO0D1_MASK | - GPIO0D2_MASK | GPIO0D3_MASK, - GPIO0D0_GPIO << GPIO0D0_SHIFT | - GPIO0D1_GPIO << GPIO0D1_SHIFT | - GPIO0D2_UART4_SOUT << GPIO0D2_SHIFT | - GPIO0D3_UART4_SIN << GPIO0D3_SHIFT); - return 0; -}
int board_init(void) {

On 02 Aug 2017, at 15:10, Andy Yan andy.yan@rock-chips.com wrote:
As the debug uart is marked as dm-pre-reloc, the pinctrl driver will handle the correct iomux setting.
Signed-off-by: Andy Yan andy.yan@rock-chips.com —
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

On 2 August 2017 at 07:10, Andy Yan andy.yan@rock-chips.com wrote:
As the debug uart is marked as dm-pre-reloc, the pinctrl driver will handle the correct iomux setting.
Signed-off-by: Andy Yan andy.yan@rock-chips.com
board/rockchip/evb_px5/evb-px5.c | 24 ------------------------ 1 file changed, 24 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

As the debug uart is marked as dm-pre-reloc, the pinctrl driver will handle the correct iomux setting.
Signed-off-by: Andy Yan andy.yan@rock-chips.com Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Simon Glass sjg@chromium.org
board/rockchip/evb_px5/evb-px5.c | 24 ------------------------ 1 file changed, 24 deletions(-)
Applied to u-boot-rockchip, thanks!

Device drivers like debug serial, dmc should be enabled before relocation, so add u-boot.dtsi files to contain devices that should be marked as dm-pre-reloc.
Signed-off-by: Andy Yan andy.yan@rock-chips.com
arch/arm/dts/rk3368-geekbox-u-boot.dtsi | 35 +++++++++++++++++++++++++++++++++ arch/arm/dts/rk3368-px5-evb-u-boot.dtsi | 35 +++++++++++++++++++++++++++++++++ arch/arm/dts/rk3368-sheep-u-boot.dtsi | 35 +++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 arch/arm/dts/rk3368-geekbox-u-boot.dtsi create mode 100644 arch/arm/dts/rk3368-px5-evb-u-boot.dtsi create mode 100644 arch/arm/dts/rk3368-sheep-u-boot.dtsi
Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

Device drivers like debug serial, dmc should be enabled before relocation, so add u-boot.dtsi files to contain devices that should be marked as dm-pre-reloc.
Signed-off-by: Andy Yan andy.yan@rock-chips.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
arch/arm/dts/rk3368-geekbox-u-boot.dtsi | 35 +++++++++++++++++++++++++++++++++ arch/arm/dts/rk3368-px5-evb-u-boot.dtsi | 35 +++++++++++++++++++++++++++++++++ arch/arm/dts/rk3368-sheep-u-boot.dtsi | 35 +++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 arch/arm/dts/rk3368-geekbox-u-boot.dtsi create mode 100644 arch/arm/dts/rk3368-px5-evb-u-boot.dtsi create mode 100644 arch/arm/dts/rk3368-sheep-u-boot.dtsi
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

On 2 August 2017 at 07:08, Andy Yan andy.yan@rock-chips.com wrote:
Device drivers like debug serial, dmc should be enabled before relocation, so add u-boot.dtsi files to contain devices that should be marked as dm-pre-reloc.
Signed-off-by: Andy Yan andy.yan@rock-chips.com
arch/arm/dts/rk3368-geekbox-u-boot.dtsi | 35 +++++++++++++++++++++++++++++++++ arch/arm/dts/rk3368-px5-evb-u-boot.dtsi | 35 +++++++++++++++++++++++++++++++++ arch/arm/dts/rk3368-sheep-u-boot.dtsi | 35 +++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 arch/arm/dts/rk3368-geekbox-u-boot.dtsi create mode 100644 arch/arm/dts/rk3368-px5-evb-u-boot.dtsi create mode 100644 arch/arm/dts/rk3368-sheep-u-boot.dtsi
Reviewed-by: Simon Glass sjg@chromium.org

Device drivers like debug serial, dmc should be enabled before relocation, so add u-boot.dtsi files to contain devices that should be marked as dm-pre-reloc.
Signed-off-by: Andy Yan andy.yan@rock-chips.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Simon Glass sjg@chromium.org
arch/arm/dts/rk3368-geekbox-u-boot.dtsi | 35 +++++++++++++++++++++++++++++++++ arch/arm/dts/rk3368-px5-evb-u-boot.dtsi | 35 +++++++++++++++++++++++++++++++++ arch/arm/dts/rk3368-sheep-u-boot.dtsi | 35 +++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 arch/arm/dts/rk3368-geekbox-u-boot.dtsi create mode 100644 arch/arm/dts/rk3368-px5-evb-u-boot.dtsi create mode 100644 arch/arm/dts/rk3368-sheep-u-boot.dtsi
Applied to u-boot-rockchip, thanks!
participants (5)
-
Andreas Färber
-
Andy Yan
-
Dr. Philipp Tomsich
-
Philipp Tomsich
-
Simon Glass