* [U-Boot] [PATCH 0/9] sh: Convert generic board
@ 2016-05-19 12:26 Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 1/9] board_f: Add relocate_code stub Yoshinori Sato
` (10 more replies)
0 siblings, 11 replies; 17+ messages in thread
From: Yoshinori Sato @ 2016-05-19 12:26 UTC (permalink / raw)
To: u-boot
Hello.
This patch series convert generic board for SH.
Tested on r2dplus target.
Yoshinori Sato (9):
board_f: Add relocate_code stub
board_f: Add SH specific timer_init
board_f: if SKIP_RELOC is ture, return from board_init_f
board_f: Add SH specific mon_len
sh: Add missing symbol for generic board
sh: Remove arch specific board.c
sh: generic board support - startup
sh: generic board support - header
sh: generic board support - Kconfig
arch/Kconfig | 2 +
arch/sh/cpu/sh2/cpu.c | 9 +++
arch/sh/cpu/sh2/start.S | 22 +++--
arch/sh/cpu/sh3/cpu.c | 9 +++
arch/sh/cpu/sh3/start.S | 21 +++--
arch/sh/cpu/sh4/cpu.c | 9 +++
arch/sh/cpu/sh4/start.S | 23 ++++--
arch/sh/cpu/u-boot.lds | 1 +
arch/sh/include/asm/u-boot.h | 11 +--
arch/sh/lib/Makefile | 1 -
arch/sh/lib/board.c | 189 -------------------------------------------
common/board_f.c | 12 ++-
12 files changed, 86 insertions(+), 223 deletions(-)
delete mode 100644 arch/sh/lib/board.c
--
2.7.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 1/9] board_f: Add relocate_code stub
2016-05-19 12:26 [U-Boot] [PATCH 0/9] sh: Convert generic board Yoshinori Sato
@ 2016-05-19 12:26 ` Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 2/9] board_f: Add SH specific timer_init Yoshinori Sato
` (9 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Yoshinori Sato @ 2016-05-19 12:26 UTC (permalink / raw)
To: u-boot
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
common/board_f.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/common/board_f.c b/common/board_f.c
index 109025a..bf768d1 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -826,6 +826,11 @@ __weak int arch_cpu_init_dm(void)
return 0;
}
+__weak void relocate_code(ulong sp, gd_t *new_gd, ulong reloc)
+{
+ for(;;);
+}
+
static init_fnc_t init_sequence_f[] = {
#ifdef CONFIG_SANDBOX
setup_ram_buf,
--
2.7.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 2/9] board_f: Add SH specific timer_init
2016-05-19 12:26 [U-Boot] [PATCH 0/9] sh: Convert generic board Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 1/9] board_f: Add relocate_code stub Yoshinori Sato
@ 2016-05-19 12:26 ` Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 3/9] board_f: if SKIP_RELOC is ture, return from board_init_f Yoshinori Sato
` (8 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Yoshinori Sato @ 2016-05-19 12:26 UTC (permalink / raw)
To: u-boot
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
common/board_f.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/board_f.c b/common/board_f.c
index bf768d1..fcc69b8 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -870,7 +870,7 @@ static init_fnc_t init_sequence_f[] = {
#endif
#if defined(CONFIG_ARM) || defined(CONFIG_MIPS) || \
defined(CONFIG_BLACKFIN) || defined(CONFIG_NDS32) || \
- defined(CONFIG_SPARC)
+ defined(CONFIG_SPARC) || defined(CONFIG_SH)
timer_init, /* initialize timer */
#endif
#ifdef CONFIG_SYS_ALLOC_DPRAM
--
2.7.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 3/9] board_f: if SKIP_RELOC is ture, return from board_init_f
2016-05-19 12:26 [U-Boot] [PATCH 0/9] sh: Convert generic board Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 1/9] board_f: Add relocate_code stub Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 2/9] board_f: Add SH specific timer_init Yoshinori Sato
@ 2016-05-19 12:26 ` Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 4/9] board_f: Add SH specific mon_len Yoshinori Sato
` (7 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Yoshinori Sato @ 2016-05-19 12:26 UTC (permalink / raw)
To: u-boot
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
common/board_f.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/common/board_f.c b/common/board_f.c
index fcc69b8..e1122e3 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -1067,7 +1067,8 @@ void board_init_f(ulong boot_flags)
#if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX) && \
!defined(CONFIG_EFI_APP)
/* NOTREACHED - jump_to_copy() does not return */
- hang();
+ if (!(gd->flags & GD_FLG_SKIP_RELOC))
+ hang();
#endif
}
--
2.7.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 4/9] board_f: Add SH specific mon_len
2016-05-19 12:26 [U-Boot] [PATCH 0/9] sh: Convert generic board Yoshinori Sato
` (2 preceding siblings ...)
2016-05-19 12:26 ` [U-Boot] [PATCH 3/9] board_f: if SKIP_RELOC is ture, return from board_init_f Yoshinori Sato
@ 2016-05-19 12:26 ` Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 5/9] sh: Add missing symbol for generic board Yoshinori Sato
` (6 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Yoshinori Sato @ 2016-05-19 12:26 UTC (permalink / raw)
To: u-boot
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
common/board_f.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/board_f.c b/common/board_f.c
index e1122e3..f31f2de 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -270,7 +270,7 @@ static int setup_mon_len(void)
gd->mon_len = (ulong)&__bss_end - (ulong)_start;
#elif defined(CONFIG_SANDBOX) || defined(CONFIG_EFI_APP)
gd->mon_len = (ulong)&_end - (ulong)_init;
-#elif defined(CONFIG_BLACKFIN) || defined(CONFIG_NIOS2)
+#elif defined(CONFIG_BLACKFIN) || defined(CONFIG_NIOS2) || defined(CONFIG_SH)
gd->mon_len = CONFIG_SYS_MONITOR_LEN;
#elif defined(CONFIG_NDS32)
gd->mon_len = (ulong)(&__bss_end) - (ulong)(&_start);
--
2.7.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 5/9] sh: Add missing symbol for generic board
2016-05-19 12:26 [U-Boot] [PATCH 0/9] sh: Convert generic board Yoshinori Sato
` (3 preceding siblings ...)
2016-05-19 12:26 ` [U-Boot] [PATCH 4/9] board_f: Add SH specific mon_len Yoshinori Sato
@ 2016-05-19 12:26 ` Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 6/9] sh: Remove arch specific board.c Yoshinori Sato
` (5 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Yoshinori Sato @ 2016-05-19 12:26 UTC (permalink / raw)
To: u-boot
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
arch/sh/cpu/u-boot.lds | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/sh/cpu/u-boot.lds b/arch/sh/cpu/u-boot.lds
index 30c7a9d..4e8b718 100644
--- a/arch/sh/cpu/u-boot.lds
+++ b/arch/sh/cpu/u-boot.lds
@@ -80,4 +80,5 @@ SECTIONS
PROVIDE (bss_end = .);
PROVIDE (__bss_end = .);
+ PROVIDE (__init_end = .);
}
--
2.7.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 6/9] sh: Remove arch specific board.c
2016-05-19 12:26 [U-Boot] [PATCH 0/9] sh: Convert generic board Yoshinori Sato
` (4 preceding siblings ...)
2016-05-19 12:26 ` [U-Boot] [PATCH 5/9] sh: Add missing symbol for generic board Yoshinori Sato
@ 2016-05-19 12:26 ` Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 7/9] sh: generic board support - startup Yoshinori Sato
` (4 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Yoshinori Sato @ 2016-05-19 12:26 UTC (permalink / raw)
To: u-boot
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
arch/sh/lib/Makefile | 1 -
arch/sh/lib/board.c | 189 ---------------------------------------------------
2 files changed, 190 deletions(-)
delete mode 100644 arch/sh/lib/board.c
diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile
index f7ae4f8..c5cf89f 100644
--- a/arch/sh/lib/Makefile
+++ b/arch/sh/lib/Makefile
@@ -6,7 +6,6 @@
#
-obj-y += board.o
obj-$(CONFIG_CMD_BOOTM) += bootm.o
ifeq ($(CONFIG_CPU_SH2),y)
obj-y += time_sh2.o
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
deleted file mode 100644
index 69cdca3..0000000
--- a/arch/sh/lib/board.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (C) 2007, 2008, 2010
- * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#include <common.h>
-#include <command.h>
-#include <console.h>
-#include <malloc.h>
-#include <stdio_dev.h>
-#include <version.h>
-#include <watchdog.h>
-#include <net.h>
-#include <mmc.h>
-#include <environment.h>
-
-#ifdef CONFIG_BITBANGMII
-#include <miiphy.h>
-#endif
-
-DECLARE_GLOBAL_DATA_PTR;
-
-extern int cpu_init(void);
-extern int board_init(void);
-extern int dram_init(void);
-extern int timer_init(void);
-
-unsigned long monitor_flash_len = CONFIG_SYS_MONITOR_LEN;
-
-#ifndef CONFIG_SYS_NO_FLASH
-static int sh_flash_init(void)
-{
- gd->bd->bi_flashsize = flash_init();
-
- if (gd->bd->bi_flashsize >= (1024 * 1024))
- printf("Flash: %ldMB\n", gd->bd->bi_flashsize / (1024*1024));
- else
- printf("Flash: %ldKB\n", gd->bd->bi_flashsize / 1024);
-
- return 0;
-}
-#endif /* CONFIG_SYS_NO_FLASH */
-
-#if defined(CONFIG_CMD_NAND)
-# include <nand.h>
-# define INIT_FUNC_NAND_INIT nand_init,
-#else
-# define INIT_FUNC_NAND_INIT
-#endif /* CONFIG_CMD_NAND */
-
-#if defined(CONFIG_WATCHDOG)
-extern int watchdog_init(void);
-extern int watchdog_disable(void);
-# undef INIT_FUNC_WATCHDOG_INIT
-# define INIT_FUNC_WATCHDOG_INIT watchdog_init,
-# define WATCHDOG_DISABLE watchdog_disable
-#else
-# define INIT_FUNC_WATCHDOG_INIT
-# define WATCHDOG_DISABLE
-#endif /* CONFIG_WATCHDOG */
-
-#if defined(CONFIG_CMD_IDE)
-# include <ide.h>
-# define INIT_FUNC_IDE_INIT ide_init,
-#else
-# define INIT_FUNC_IDE_INIT
-#endif /* CONFIG_CMD_IDE */
-
-#if defined(CONFIG_PCI)
-#include <pci.h>
-static int sh_pci_init(void)
-{
- pci_init();
- return 0;
-}
-# define INIT_FUNC_PCI_INIT sh_pci_init,
-#else
-# define INIT_FUNC_PCI_INIT
-#endif /* CONFIG_PCI */
-
-static int sh_mem_env_init(void)
-{
- mem_malloc_init(CONFIG_SYS_TEXT_BASE - GENERATED_GBL_DATA_SIZE -
- CONFIG_SYS_MALLOC_LEN, CONFIG_SYS_MALLOC_LEN - 16);
- env_relocate();
- jumptable_init();
- return 0;
-}
-
-#if defined(CONFIG_CMD_MMC)
-static int sh_mmc_init(void)
-{
- puts("MMC: ");
- mmc_initialize(gd->bd);
- return 0;
-}
-#endif
-
-typedef int (init_fnc_t) (void);
-
-init_fnc_t *init_sequence[] =
-{
- cpu_init, /* basic cpu dependent setup */
- board_init, /* basic board dependent setup */
- interrupt_init, /* set up exceptions */
- env_init, /* event init */
- serial_init, /* SCIF init */
- INIT_FUNC_WATCHDOG_INIT /* watchdog init */
- console_init_f,
- display_options,
- checkcpu,
- checkboard, /* Check support board */
- dram_init, /* SDRAM init */
- timer_init, /* SuperH Timer (TCNT0 only) init */
- sh_mem_env_init,
-#ifndef CONFIG_SYS_NO_FLASH
- sh_flash_init, /* Flash memory init*/
-#endif
- INIT_FUNC_NAND_INIT/* Flash memory (NAND) init */
- INIT_FUNC_PCI_INIT /* PCI init */
- stdio_init,
- console_init_r,
- interrupt_init,
-#ifdef CONFIG_BOARD_LATE_INIT
- board_late_init,
-#endif
-#if defined(CONFIG_CMD_MMC)
- sh_mmc_init,
-#endif
- NULL /* Terminate this list */
-};
-
-void sh_generic_init(void)
-{
- bd_t *bd;
- init_fnc_t **init_fnc_ptr;
-
- memset(gd, 0, GENERATED_GBL_DATA_SIZE);
-
- gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
-
- gd->bd = (bd_t *)(gd + 1); /* At end of global data */
- gd->baudrate = CONFIG_BAUDRATE;
-
- gd->cpu_clk = CONFIG_SYS_CLK_FREQ;
-
- bd = gd->bd;
- bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
- bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
-#ifndef CONFIG_SYS_NO_FLASH
- bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
-#endif
-#if defined(CONFIG_SYS_SRAM_BASE) && defined(CONFIG_SYS_SRAM_SIZE)
- bd->bi_sramstart = CONFIG_SYS_SRAM_BASE;
- bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE;
-#endif
-
- for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
- WATCHDOG_RESET();
- if ((*init_fnc_ptr) () != 0)
- hang();
- }
-
-#ifdef CONFIG_WATCHDOG
- /* disable watchdog if environment is set */
- {
- char *s = getenv("watchdog");
- if (s != NULL)
- if (strncmp(s, "off", 3) == 0)
- WATCHDOG_DISABLE();
- }
-#endif /* CONFIG_WATCHDOG*/
-
-
-#ifdef CONFIG_BITBANGMII
- bb_miiphy_init();
-#endif
-#if defined(CONFIG_CMD_NET)
- puts("Net: ");
- eth_initialize();
-#endif /* CONFIG_CMD_NET */
-
- while (1) {
- WATCHDOG_RESET();
- main_loop();
- }
-}
--
2.7.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 7/9] sh: generic board support - startup
2016-05-19 12:26 [U-Boot] [PATCH 0/9] sh: Convert generic board Yoshinori Sato
` (5 preceding siblings ...)
2016-05-19 12:26 ` [U-Boot] [PATCH 6/9] sh: Remove arch specific board.c Yoshinori Sato
@ 2016-05-19 12:26 ` Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 8/9] sh: generic board support - header Yoshinori Sato
` (3 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Yoshinori Sato @ 2016-05-19 12:26 UTC (permalink / raw)
To: u-boot
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
arch/sh/cpu/sh2/cpu.c | 9 +++++++++
arch/sh/cpu/sh2/start.S | 22 ++++++++++++++++------
arch/sh/cpu/sh3/cpu.c | 9 +++++++++
arch/sh/cpu/sh3/start.S | 21 +++++++++++++++------
arch/sh/cpu/sh4/cpu.c | 9 +++++++++
arch/sh/cpu/sh4/start.S | 23 +++++++++++++++--------
6 files changed, 73 insertions(+), 20 deletions(-)
diff --git a/arch/sh/cpu/sh2/cpu.c b/arch/sh/cpu/sh2/cpu.c
index a2f856f..8119893 100644
--- a/arch/sh/cpu/sh2/cpu.c
+++ b/arch/sh/cpu/sh2/cpu.c
@@ -10,6 +10,8 @@
#include <asm/processor.h>
#include <asm/io.h>
+DECLARE_GLOBAL_DATA_PTR;
+
#define STBCR4 0xFFFE040C
#define cmt_clock_enable() do {\
writeb(readb(STBCR4) & ~0x04, STBCR4);\
@@ -83,3 +85,10 @@ int dcache_status(void)
{
return 0;
}
+
+int arch_cpu_init(void)
+{
+ gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+
+ return 0;
+}
diff --git a/arch/sh/cpu/sh2/start.S b/arch/sh/cpu/sh2/start.S
index ebf731a..0ee771c 100644
--- a/arch/sh/cpu/sh2/start.S
+++ b/arch/sh/cpu/sh2/start.S
@@ -7,6 +7,7 @@
#include <asm-offsets.h>
#include <config.h>
+#include <asm-generic/global_data.h>
.text
.align 2
@@ -43,12 +44,18 @@ _init:
cmp/hs r5, r4
bf 3b
- mov.l ._gd_init, r13 /* global data */
- mov.l ._stack_init, r15 /* stack */
+ mov.l ._stack_init, r15
+ mov.l ._board_init_f_init_reserve, r0
+ jsr @r0
+ mov r15, r4
- mov.l ._sh_generic_init, r0
+ mov.l ._board_init_f, r0
jsr @r0
- nop
+ mov ._bootflag ,r4
+
+ mov.l ._board_init_r, r0
+ jsr @r0
+ mov r13,r4
loop:
bra loop
@@ -61,5 +68,8 @@ loop:
._bss_start: .long bss_start
._bss_end: .long bss_end
._gd_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE)
-._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16)
-._sh_generic_init: .long sh_generic_init
+._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - CONFIG_ENV_SIZE- 16)
+._board_init_f: .long board_init_f
+._board_init_r: .long board_init_r
+._board_init_f_init_reserve: .long board_init_f_init_reserve
+._bootflag: .long GD_FLG_SKIP_RELOC
diff --git a/arch/sh/cpu/sh3/cpu.c b/arch/sh/cpu/sh3/cpu.c
index ea0006a..85cb6a3 100644
--- a/arch/sh/cpu/sh3/cpu.c
+++ b/arch/sh/cpu/sh3/cpu.c
@@ -12,6 +12,8 @@
#include <command.h>
#include <asm/processor.h>
+DECLARE_GLOBAL_DATA_PTR;
+
int checkcpu(void)
{
puts("CPU: SH3\n");
@@ -66,3 +68,10 @@ int dcache_status(void)
{
return 0;
}
+
+int arch_cpu_init(void)
+{
+ gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+
+ return 0;
+}
diff --git a/arch/sh/cpu/sh3/start.S b/arch/sh/cpu/sh3/start.S
index 7a934e2..a1633a7 100644
--- a/arch/sh/cpu/sh3/start.S
+++ b/arch/sh/cpu/sh3/start.S
@@ -10,6 +10,7 @@
#include <asm-offsets.h>
#include <config.h>
+#include <asm-generic/global_data.h>
.text
.align 2
@@ -42,13 +43,18 @@ _sh_start:
cmp/hs r5, r4
bf 3b
- mov.l ._gd_init, r13 /* global data */
- mov.l ._stack_init, r15 /* stack */
+ mov.l ._stack_init, r15
+ mov.l ._board_init_f_init_reserve, r0
+ jsr @r0
+ mov r15, r4
- mov.l ._sh_generic_init, r0
+ mov.l ._board_init_f, r0
jsr @r0
- nop
+ mov #._bootflag, r4
+ mov.l ._board_init_r, r0
+ jsr @r0
+ mov r13,r4
loop:
bra loop
@@ -60,5 +66,8 @@ loop:
._bss_start: .long bss_start
._bss_end: .long bss_end
._gd_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE)
-._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16)
-._sh_generic_init: .long sh_generic_init
+._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - CONFIG_ENV_SIZE - 16)
+._board_init_f: .long board_init_f
+._board_init_r: .long board_init_r
+._board_init_f_init_reserve: .long board_init_f_init_reserve
+._bootflag: .long GD_FLG_SKIP_RELOC
diff --git a/arch/sh/cpu/sh4/cpu.c b/arch/sh/cpu/sh4/cpu.c
index e8ee0a4..fea8e59 100644
--- a/arch/sh/cpu/sh4/cpu.c
+++ b/arch/sh/cpu/sh4/cpu.c
@@ -11,6 +11,8 @@
#include <asm/processor.h>
#include <asm/cache.h>
+DECLARE_GLOBAL_DATA_PTR;
+
int checkcpu(void)
{
puts("CPU: SH4\n");
@@ -75,3 +77,10 @@ int cpu_eth_init(bd_t *bis)
#endif
return 0;
}
+
+int arch_cpu_init(void)
+{
+ gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+
+ return 0;
+}
diff --git a/arch/sh/cpu/sh4/start.S b/arch/sh/cpu/sh4/start.S
index 21644b5..52f960c 100644
--- a/arch/sh/cpu/sh4/start.S
+++ b/arch/sh/cpu/sh4/start.S
@@ -7,6 +7,7 @@
#include <asm-offsets.h>
#include <config.h>
+#include <asm-generic/global_data.h>
.text
.align 2
@@ -39,16 +40,20 @@ _sh_start:
cmp/hs r5, r4
bf 3b
- mov.l ._gd_init, r13 /* global data */
- mov.l ._stack_init, r15 /* stack */
+ mov.l ._stack_init, r15
+ mov.l ._board_init_f_init_reserve, r0
+ jsr @r0
+ mov r15, r4
- mov.l ._sh_generic_init, r0
+ mov.l ._board_init_f, r0
jsr @r0
- nop
+ mov.l ._bootflag, r4
+ mov.l ._board_init_r, r0
+ jsr @r0
+ mov r13,r4
loop:
bra loop
-
.align 2
._lowlevel_init: .long (lowlevel_init - (100b + 4))
@@ -56,6 +61,8 @@ loop:
._reloc_dst_end: .long reloc_dst_end
._bss_start: .long bss_start
._bss_end: .long bss_end
-._gd_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE)
-._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16)
-._sh_generic_init: .long sh_generic_init
+._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - CONFIG_ENV_SIZE - 16)
+._board_init_f: .long board_init_f
+._board_init_r: .long board_init_r
+._board_init_f_init_reserve: .long board_init_f_init_reserve
+._bootflag: .long GD_FLG_SKIP_RELOC
--
2.7.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 8/9] sh: generic board support - header
2016-05-19 12:26 [U-Boot] [PATCH 0/9] sh: Convert generic board Yoshinori Sato
` (6 preceding siblings ...)
2016-05-19 12:26 ` [U-Boot] [PATCH 7/9] sh: generic board support - startup Yoshinori Sato
@ 2016-05-19 12:26 ` Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 9/9] sh: generic board support - Kconfig Yoshinori Sato
` (2 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Yoshinori Sato @ 2016-05-19 12:26 UTC (permalink / raw)
To: u-boot
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
arch/sh/include/asm/u-boot.h | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/arch/sh/include/asm/u-boot.h b/arch/sh/include/asm/u-boot.h
index ea37c24..9e578a6 100644
--- a/arch/sh/include/asm/u-boot.h
+++ b/arch/sh/include/asm/u-boot.h
@@ -12,16 +12,7 @@
#ifndef __ASM_SH_U_BOOT_H_
#define __ASM_SH_U_BOOT_H_
-typedef struct bd_info {
- unsigned long bi_memstart; /* start of DRAM memory */
- phys_size_t bi_memsize; /* size of DRAM memory in bytes */
- unsigned long bi_flashstart; /* start of FLASH memory */
- unsigned long bi_flashsize; /* size of FLASH memory */
- unsigned long bi_flashoffset; /* reserved area for startup monitor */
- unsigned long bi_sramstart; /* start of SRAM memory */
- unsigned long bi_sramsize; /* size of SRAM memory */
- unsigned long bi_boot_params; /* where this board expects params */
-} bd_t;
+#include <asm-generic/u-boot.h>
/* For image.h:image_check_target_arch() */
#define IH_ARCH_DEFAULT IH_ARCH_SH
--
2.7.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 9/9] sh: generic board support - Kconfig
2016-05-19 12:26 [U-Boot] [PATCH 0/9] sh: Convert generic board Yoshinori Sato
` (7 preceding siblings ...)
2016-05-19 12:26 ` [U-Boot] [PATCH 8/9] sh: generic board support - header Yoshinori Sato
@ 2016-05-19 12:26 ` Yoshinori Sato
2016-05-21 1:28 ` [U-Boot] [PATCH 0/9] sh: Convert generic board Tom Rini
2016-06-07 0:14 ` Nobuhiro Iwamatsu
10 siblings, 0 replies; 17+ messages in thread
From: Yoshinori Sato @ 2016-05-19 12:26 UTC (permalink / raw)
To: u-boot
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
arch/Kconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/Kconfig b/arch/Kconfig
index ec12013..291e1dc 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -96,6 +96,8 @@ config SANDBOX
config SH
bool "SuperH architecture"
select HAVE_PRIVATE_LIBGCC
+ select HAVE_GENERIC_BOARD
+ select SYS_GENERIC_BOARD
config SPARC
bool "SPARC architecture"
--
2.7.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 0/9] sh: Convert generic board
2016-05-19 12:26 [U-Boot] [PATCH 0/9] sh: Convert generic board Yoshinori Sato
` (8 preceding siblings ...)
2016-05-19 12:26 ` [U-Boot] [PATCH 9/9] sh: generic board support - Kconfig Yoshinori Sato
@ 2016-05-21 1:28 ` Tom Rini
2016-05-22 5:26 ` Yoshinori Sato
2016-06-07 0:14 ` Nobuhiro Iwamatsu
10 siblings, 1 reply; 17+ messages in thread
From: Tom Rini @ 2016-05-21 1:28 UTC (permalink / raw)
To: u-boot
On Thu, May 19, 2016 at 09:26:46PM +0900, Yoshinori Sato wrote:
> Hello.
> This patch series convert generic board for SH.
> Tested on r2dplus target.
Since I believe you said before this was QEMU, how did you start it off?
Thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160520/8a22e141/attachment.sig>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 0/9] sh: Convert generic board
2016-05-21 1:28 ` [U-Boot] [PATCH 0/9] sh: Convert generic board Tom Rini
@ 2016-05-22 5:26 ` Yoshinori Sato
2016-05-22 13:10 ` Tom Rini
2016-06-07 6:46 ` Simon Glass
0 siblings, 2 replies; 17+ messages in thread
From: Yoshinori Sato @ 2016-05-22 5:26 UTC (permalink / raw)
To: u-boot
On Sat, 21 May 2016 10:28:42 +0900,
Tom Rini wrote:
>
> [1 <text/plain; us-ascii (quoted-printable)>]
> On Thu, May 19, 2016 at 09:26:46PM +0900, Yoshinori Sato wrote:
>
> > Hello.
> > This patch series convert generic board for SH.
> > Tested on r2dplus target.
>
> Since I believe you said before this was QEMU, how did you start it off?
> Thanks!
>
Yes.
I tested comannd bellow
$ qemu-system-sh4 -M r2d -kernel u-boot.bin -serial null -serial vc
You can see banner for serial1 console (crtl - alt - 3).
Thanks.
> --
> Tom
> [2 Digital signature <application/pgp-signature (7bit)>]
> No public key for 87F9F635D31D7652 created at 2016-05-21T10:28:42+0900 using RSA
--
Yoshinori Sato
<ysato@users.sourceforge.jp>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 0/9] sh: Convert generic board
2016-05-22 5:26 ` Yoshinori Sato
@ 2016-05-22 13:10 ` Tom Rini
2016-06-07 6:46 ` Simon Glass
1 sibling, 0 replies; 17+ messages in thread
From: Tom Rini @ 2016-05-22 13:10 UTC (permalink / raw)
To: u-boot
On Sun, May 22, 2016 at 02:26:28PM +0900, Yoshinori Sato wrote:
> On Sat, 21 May 2016 10:28:42 +0900,
> Tom Rini wrote:
> >
> > [1 <text/plain; us-ascii (quoted-printable)>]
> > On Thu, May 19, 2016 at 09:26:46PM +0900, Yoshinori Sato wrote:
> >
> > > Hello.
> > > This patch series convert generic board for SH.
> > > Tested on r2dplus target.
> >
> > Since I believe you said before this was QEMU, how did you start it off?
> > Thanks!
> >
>
> Yes.
> I tested comannd bellow
> $ qemu-system-sh4 -M r2d -kernel u-boot.bin -serial null -serial vc
>
> You can see banner for serial1 console (crtl - alt - 3).
OK, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160522/fcf57a6e/attachment.sig>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 0/9] sh: Convert generic board
2016-05-19 12:26 [U-Boot] [PATCH 0/9] sh: Convert generic board Yoshinori Sato
` (9 preceding siblings ...)
2016-05-21 1:28 ` [U-Boot] [PATCH 0/9] sh: Convert generic board Tom Rini
@ 2016-06-07 0:14 ` Nobuhiro Iwamatsu
2016-06-07 0:21 ` Nobuhiro Iwamatsu
10 siblings, 1 reply; 17+ messages in thread
From: Nobuhiro Iwamatsu @ 2016-06-07 0:14 UTC (permalink / raw)
To: u-boot
Hi,
Sorry, my reply was too late. And thanks for your work.
2016-05-19 21:26 GMT+09:00 Yoshinori Sato <ysato@users.sourceforge.jp>:
> Hello.
> This patch series convert generic board for SH.
> Tested on r2dplus target.
>
> Yoshinori Sato (9):
> board_f: Add relocate_code stub
Please add more infomation to commit log.
This patch contains the fixes that are referenced by other architectures.
> board_f: Add SH specific timer_init
> board_f: if SKIP_RELOC is ture, return from board_init_f
> board_f: Add SH specific mon_len
> sh: Add missing symbol for generic board
> sh: Remove arch specific board.c
> sh: generic board support - startup
> sh: generic board support - header
> sh: generic board support - Kconfig
Best regards,
Nobuhiro
--
Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6
^ permalink raw reply [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 0/9] sh: Convert generic board
2016-06-07 0:14 ` Nobuhiro Iwamatsu
@ 2016-06-07 0:21 ` Nobuhiro Iwamatsu
2016-06-07 6:44 ` Yoshinori Sato
0 siblings, 1 reply; 17+ messages in thread
From: Nobuhiro Iwamatsu @ 2016-06-07 0:21 UTC (permalink / raw)
To: u-boot
Hi, again.
Same fixes and you had already been taken up by Simon.
I'm sorry to reply and confirmation slow.
Best regards,
Nobuhiro
2016-06-07 9:14 GMT+09:00 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>:
> Hi,
>
> Sorry, my reply was too late. And thanks for your work.
>
>
>
> 2016-05-19 21:26 GMT+09:00 Yoshinori Sato <ysato@users.sourceforge.jp>:
>> Hello.
>> This patch series convert generic board for SH.
>> Tested on r2dplus target.
>>
>> Yoshinori Sato (9):
>> board_f: Add relocate_code stub
>
> Please add more infomation to commit log.
> This patch contains the fixes that are referenced by other architectures.
>
>> board_f: Add SH specific timer_init
>> board_f: if SKIP_RELOC is ture, return from board_init_f
>> board_f: Add SH specific mon_len
>> sh: Add missing symbol for generic board
>> sh: Remove arch specific board.c
>> sh: generic board support - startup
>> sh: generic board support - header
>> sh: generic board support - Kconfig
>
> Best regards,
> Nobuhiro
>
> --
> Nobuhiro Iwamatsu
> iwamatsu at {nigauri.org / debian.org}
> GPG ID: 40AD1FA6
--
Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6
^ permalink raw reply [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 0/9] sh: Convert generic board
2016-06-07 0:21 ` Nobuhiro Iwamatsu
@ 2016-06-07 6:44 ` Yoshinori Sato
0 siblings, 0 replies; 17+ messages in thread
From: Yoshinori Sato @ 2016-06-07 6:44 UTC (permalink / raw)
To: u-boot
On Tue, 07 Jun 2016 09:21:38 +0900,
Nobuhiro Iwamatsu wrote:
>
> Hi, again.
>
> Same fixes and you had already been taken up by Simon.
> I'm sorry to reply and confirmation slow.
>
> Best regards,
> Nobuhiro
OK.
I'll sent V2.
>
> 2016-06-07 9:14 GMT+09:00 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>:
> > Hi,
> >
> > Sorry, my reply was too late. And thanks for your work.
> >
> >
> >
> > 2016-05-19 21:26 GMT+09:00 Yoshinori Sato <ysato@users.sourceforge.jp>:
> >> Hello.
> >> This patch series convert generic board for SH.
> >> Tested on r2dplus target.
> >>
> >> Yoshinori Sato (9):
> >> board_f: Add relocate_code stub
> >
> > Please add more infomation to commit log.
> > This patch contains the fixes that are referenced by other architectures.
> >
> >> board_f: Add SH specific timer_init
> >> board_f: if SKIP_RELOC is ture, return from board_init_f
> >> board_f: Add SH specific mon_len
> >> sh: Add missing symbol for generic board
> >> sh: Remove arch specific board.c
> >> sh: generic board support - startup
> >> sh: generic board support - header
> >> sh: generic board support - Kconfig
> >
> > Best regards,
> > Nobuhiro
> >
> > --
> > Nobuhiro Iwamatsu
> > iwamatsu at {nigauri.org / debian.org}
> > GPG ID: 40AD1FA6
>
>
>
> --
> Nobuhiro Iwamatsu
> iwamatsu at {nigauri.org / debian.org}
> GPG ID: 40AD1FA6
--
Yoshinori Sato
<ysato@users.sourceforge.jp>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [U-Boot] [PATCH 0/9] sh: Convert generic board
2016-05-22 5:26 ` Yoshinori Sato
2016-05-22 13:10 ` Tom Rini
@ 2016-06-07 6:46 ` Simon Glass
1 sibling, 0 replies; 17+ messages in thread
From: Simon Glass @ 2016-06-07 6:46 UTC (permalink / raw)
To: u-boot
Hi,
On 21 May 2016 at 22:26, Yoshinori Sato <ysato@users.sourceforge.jp> wrote:
> On Sat, 21 May 2016 10:28:42 +0900,
> Tom Rini wrote:
>>
>> [1 <text/plain; us-ascii (quoted-printable)>]
>> On Thu, May 19, 2016 at 09:26:46PM +0900, Yoshinori Sato wrote:
>>
>> > Hello.
>> > This patch series convert generic board for SH.
>> > Tested on r2dplus target.
>>
>> Since I believe you said before this was QEMU, how did you start it off?
>> Thanks!
>>
>
> Yes.
> I tested comannd bellow
> $ qemu-system-sh4 -M r2d -kernel u-boot.bin -serial null -serial vc
Please can you add a README.sh showing how to do this? It would be
good to have the instructions in the source tree for future reference.
>
> You can see banner for serial1 console (crtl - alt - 3).
>
> Thanks.
>
Regards,
SImon
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2016-06-07 6:46 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-19 12:26 [U-Boot] [PATCH 0/9] sh: Convert generic board Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 1/9] board_f: Add relocate_code stub Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 2/9] board_f: Add SH specific timer_init Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 3/9] board_f: if SKIP_RELOC is ture, return from board_init_f Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 4/9] board_f: Add SH specific mon_len Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 5/9] sh: Add missing symbol for generic board Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 6/9] sh: Remove arch specific board.c Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 7/9] sh: generic board support - startup Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 8/9] sh: generic board support - header Yoshinori Sato
2016-05-19 12:26 ` [U-Boot] [PATCH 9/9] sh: generic board support - Kconfig Yoshinori Sato
2016-05-21 1:28 ` [U-Boot] [PATCH 0/9] sh: Convert generic board Tom Rini
2016-05-22 5:26 ` Yoshinori Sato
2016-05-22 13:10 ` Tom Rini
2016-06-07 6:46 ` Simon Glass
2016-06-07 0:14 ` Nobuhiro Iwamatsu
2016-06-07 0:21 ` Nobuhiro Iwamatsu
2016-06-07 6:44 ` Yoshinori Sato
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox