sh: Set gd->malloc_base if MALLOC_F_LEN is set
PATCH 1/5 sh: Set gd->malloc_base if MALLOC_F_LEN is set
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.
--- arch/sh/lib/start.S | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/sh/lib/start.S +5 -1
@@ -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
Signature · 1 line
2.25.1
PATCH 2/5 serial: sh: Improve FIFO empty check on RX
If the SCIF is receiving data quickly enough, it may happen that the SCxSR_RDxF flag is cleared in sh_serial_getc_generic(), while the FIFO still contains data. If that happens, the serial_getc_check() reports no data in the FIFO as the flag is no longer set. Add one more check, if the SCxSR_RDxF is not set, read out the FIFO level and if there are still characters in the FIFO, permit reading them out.
--- drivers/serial/serial_sh.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/serial/serial_sh.c +4 -1
@@ -115,7 +115,10 @@ static int serial_getc_check(struct uart_port *port)handle_error (port);if (sci_in (port,SCLSR ) &SCxSR_ORER (port))handle_error (port); -return status & (SCIF_DR |SCxSR_RDxF (port)); + status &= (SCIF_DR |SCxSR_RDxF (port)); +if (status) +return status; +return scif_rxfill (port); }static int sh_serial_getc_generic (struct uart_port *port)
Signature · 1 line
2.25.1
PATCH 3/5 sh: r2dplus: Add SCIF1 to the basic DT
In reply to Marek VasutAdd 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.
--- arch/sh/dts/sh7751-r2dplus.dts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
arch/sh/dts/sh7751-r2dplus.dts +23 -0
@@ -10,6 +10,29 @@ model = "R2D"; compatible = "renesas,r2d", "renesas,sh7751"; + #address-cells = <1>; + #size-cells = <1>; + + 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 = <0xffe80000 0x1000>; + clocks = <&scif_clks>; + clock-names = "fck"; + status = "okay"; + u-boot,dm-pre-reloc; + }; + pci at fe200000 { compatible = "renesas,pci-sh7751"; device_type = "pci";
Signature · 1 line
2.25.1
PATCH 4/5 sh: r2dplus: Enable DM_SERIAL and DM_CLK
In reply to Marek VasutSwitch r2dplus to DM and DT probing for serial and clock.
--- configs/r2dplus_defconfig | 5 ++++- include/configs/r2dplus.h | 1 - 2 files changed, 4 insertions(+), 2 deletions(-)
configs/r2dplus_defconfig +4 -1
@@ -3,7 +3,6 @@ CONFIG_SYS_TEXT_BASE=0x8FE00000 CONFIG_ENV_SIZE=0x40000 CONFIG_ENV_SECT_SIZE=0x40000 CONFIG_TARGET_R2DPLUS=y -# CONFIG_SYS_MALLOC_F is not set CONFIG_BOOTDELAY=-1 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttySC0,115200"
@@ -24,6 +23,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sh7751-r2dplus" 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
@@ -31,5 +31,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
include/configs/r2dplus.h +0 -1
@@ -37,7 +37,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 */ /*
Signature · 1 line
2.25.1
PATCH 5/5 sh: r2dplus: Enable HUSH
In reply to Marek VasutEnable richer HUSH shell to make working with the board more pleasant.
--- configs/r2dplus_defconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
configs/r2dplus_defconfig +1 -2
@@ -6,8 +6,7 @@ CONFIG_TARGET_R2DPLUS=y CONFIG_BOOTDELAY=-1 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttySC0,115200" -# CONFIG_CMDLINE_EDITING is not set -# CONFIG_AUTO_COMPLETE is not set +CONFIG_HUSH_PARSER=y CONFIG_CMD_IMLS=y CONFIG_CMD_DM=y CONFIG_CMD_IDE=y
Signature · 1 line
2.25.1