All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] sh: Set gd->malloc_base if MALLOC_F_LEN is set
@ 2020-08-02 15:05 Marek Vasut
  2020-08-02 15:05 ` [PATCH 2/3] sh: r2dplus: Add SCIF1 to the basic DT Marek Vasut
  2020-08-02 15:05 ` [PATCH 3/3] sh: r2dplus: Enable DM_SERIAL and DM_CLK Marek Vasut
  0 siblings, 2 replies; 3+ messages in thread
From: Marek Vasut @ 2020-08-02 15:05 UTC (permalink / raw)
  To: u-boot

The gd->malloc_base must be set before the C runtime if the MALLOC_F_LEN
is non-zero, otherwise we hit assertion in dlmalloc.c initf_malloc(). So
set it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
 arch/sh/lib/start.S | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/sh/lib/start.S b/arch/sh/lib/start.S
index f9f26d3779..d6342a16da 100644
--- a/arch/sh/lib/start.S
+++ b/arch/sh/lib/start.S
@@ -53,7 +53,10 @@ _start:
 
 	mov.l	._gd_init, r13		/* global data */
 	mov.l	._stack_init, r15	/* stack */
-
+#if CONFIG_VAL(SYS_MALLOC_F_LEN)
+	mov.l	._gd_malloc_base, r14
+	mov.l	r15, @r14
+#endif
 	mov.l	._sh_generic_init, r0
 	jsr	@r0
 	mov     #0, r4
@@ -70,5 +73,6 @@ loop:
 ._bss_start:		.long	bss_start
 ._bss_end:		.long	bss_end
 ._gd_init:		.long	(_start - GENERATED_GBL_DATA_SIZE)
+._gd_malloc_base:	.long	(_start - GENERATED_GBL_DATA_SIZE + GD_MALLOC_BASE)
 ._stack_init:		.long	(_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16)
 ._sh_generic_init:	.long	board_init_f
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/3] sh: r2dplus: Add SCIF1 to the basic DT
  2020-08-02 15:05 [PATCH 1/3] sh: Set gd->malloc_base if MALLOC_F_LEN is set Marek Vasut
@ 2020-08-02 15:05 ` Marek Vasut
  2020-08-02 15:05 ` [PATCH 3/3] sh: r2dplus: Enable DM_SERIAL and DM_CLK Marek Vasut
  1 sibling, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2020-08-02 15:05 UTC (permalink / raw)
  To: u-boot

Add simple DT and clock bindings to r2dplus DT to permit U-Boot
to bind the SCIF driver via DT probing instead of hard-coded
config options.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
 arch/sh/dts/sh7751-r2dplus.dts | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/arch/sh/dts/sh7751-r2dplus.dts b/arch/sh/dts/sh7751-r2dplus.dts
index efaeb33e36..da0648cd62 100644
--- a/arch/sh/dts/sh7751-r2dplus.dts
+++ b/arch/sh/dts/sh7751-r2dplus.dts
@@ -10,6 +10,29 @@
 	model = "R2D";
 	compatible = "renesas,r2d", "renesas,sh7751";
 
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	aliases {
+		serial0 = &scif1;
+	};
+
+	scif_clks: scif60 {
+		#clock-cells = <0>;
+		compatible = "fixed-clock";
+		clock-frequency = <60000000>;
+		u-boot,dm-pre-reloc;
+	};
+
+	scif1: serial at ffe80000 {
+		compatible = "renesas,scif";
+		reg = <0 0xffe80000 0 0x1000>;
+		clocks = <&scif_clks>;
+		clock-names = "fck";
+		status = "okay";
+		u-boot,dm-pre-reloc;
+	};
+
 	pci at fe200000 {
 		compatible = "renesas,pci-sh7751";
 		device_type = "pci";
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 3/3] sh: r2dplus: Enable DM_SERIAL and DM_CLK
  2020-08-02 15:05 [PATCH 1/3] sh: Set gd->malloc_base if MALLOC_F_LEN is set Marek Vasut
  2020-08-02 15:05 ` [PATCH 2/3] sh: r2dplus: Add SCIF1 to the basic DT Marek Vasut
@ 2020-08-02 15:05 ` Marek Vasut
  1 sibling, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2020-08-02 15:05 UTC (permalink / raw)
  To: u-boot

Switch r2dplus to DM and DT probing for serial and clock.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
 configs/r2dplus_defconfig | 5 ++++-
 include/configs/r2dplus.h | 1 -
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/configs/r2dplus_defconfig b/configs/r2dplus_defconfig
index 53b7c2e05d..fb873a8863 100644
--- a/configs/r2dplus_defconfig
+++ b/configs/r2dplus_defconfig
@@ -4,7 +4,6 @@ CONFIG_ENV_SIZE=0x40000
 CONFIG_ENV_SECT_SIZE=0x40000
 CONFIG_DEFAULT_DEVICE_TREE="sh7751-r2dplus"
 CONFIG_TARGET_R2DPLUS=y
-# CONFIG_SYS_MALLOC_F is not set
 CONFIG_BOOTDELAY=-1
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttySC0,115200"
@@ -26,6 +25,7 @@ CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_FLASH=y
 CONFIG_ENV_ADDR=0xA0040000
 CONFIG_DM=y
+CONFIG_CLK=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_CFI=y
@@ -33,5 +33,8 @@ CONFIG_DM_ETH=y
 CONFIG_RTL8139=y
 CONFIG_PCI=y
 CONFIG_DM_PCI=y
+CONFIG_SPECIFY_CONSOLE_INDEX=y
+CONFIG_DM_SERIAL=y
+CONFIG_SERIAL_RX_BUFFER=y
 CONFIG_SCIF_CONSOLE=y
 CONFIG_USE_PRIVATE_LIBGCC=y
diff --git a/include/configs/r2dplus.h b/include/configs/r2dplus.h
index 4fdf0a5b57..61b6fb4846 100644
--- a/include/configs/r2dplus.h
+++ b/include/configs/r2dplus.h
@@ -35,7 +35,6 @@
  * SuperH Clock setting
  */
 #define CONFIG_SYS_CLK_FREQ	60000000
-#define CONFIG_SH_SCIF_CLK_FREQ CONFIG_SYS_CLK_FREQ
 #define	CONFIG_SYS_PLL_SETTLING_TIME	100/* in us */
 
 /*
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-02 15:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-02 15:05 [PATCH 1/3] sh: Set gd->malloc_base if MALLOC_F_LEN is set Marek Vasut
2020-08-02 15:05 ` [PATCH 2/3] sh: r2dplus: Add SCIF1 to the basic DT Marek Vasut
2020-08-02 15:05 ` [PATCH 3/3] sh: r2dplus: Enable DM_SERIAL and DM_CLK Marek Vasut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.