リビジョン | c7f621d5d457ad9f0f5b80b1bdb5f49590bbdfb1 (tree) |
---|---|
日時 | 2016-05-22 15:10:04 |
作者 | Yoshinori Sato <ysato@user...> |
コミッター | Yoshinori Sato |
sh: generic board support - startup
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
@@ -10,6 +10,8 @@ | ||
10 | 10 | #include <asm/processor.h> |
11 | 11 | #include <asm/io.h> |
12 | 12 | |
13 | +DECLARE_GLOBAL_DATA_PTR; | |
14 | + | |
13 | 15 | #if defined(CONFIG_CONS_SCIF0) |
14 | 16 | # define CH 0 |
15 | 17 | #elif defined(CONFIG_CONS_SCIF1) |
@@ -49,3 +51,10 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | ||
49 | 51 | reset_cpu(0); |
50 | 52 | return 0; |
51 | 53 | } |
54 | + | |
55 | + return 0; | |
56 | +} | |
57 | + | |
58 | +int arch_cpu_init(void) | |
59 | +{ | |
60 | + gd->ram_size = CONFIG_SYS_SDRAM_SIZE; |
@@ -7,6 +7,7 @@ | ||
7 | 7 | |
8 | 8 | #include <asm-offsets.h> |
9 | 9 | #include <config.h> |
10 | +#include <asm-generic/global_data.h> | |
10 | 11 | |
11 | 12 | .text |
12 | 13 | .align 2 |
@@ -43,12 +44,18 @@ _init: | ||
43 | 44 | cmp/hs r5, r4 |
44 | 45 | bf 3b |
45 | 46 | |
46 | - mov.l ._gd_init, r13 /* global data */ | |
47 | - mov.l ._stack_init, r15 /* stack */ | |
47 | + mov.l ._stack_init, r15 | |
48 | + mov.l ._board_init_f_init_reserve, r0 | |
49 | + jsr @r0 | |
50 | + mov r15, r4 | |
48 | 51 | |
49 | - mov.l ._sh_generic_init, r0 | |
52 | + mov.l ._board_init_f, r0 | |
50 | 53 | jsr @r0 |
51 | - nop | |
54 | + mov ._bootflag ,r4 | |
55 | + | |
56 | + mov.l ._board_init_r, r0 | |
57 | + jsr @r0 | |
58 | + mov r13,r4 | |
52 | 59 | |
53 | 60 | loop: |
54 | 61 | bra loop |
@@ -61,5 +68,8 @@ loop: | ||
61 | 68 | ._bss_start: .long bss_start |
62 | 69 | ._bss_end: .long bss_end |
63 | 70 | ._gd_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE) |
64 | -._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16) | |
65 | -._sh_generic_init: .long sh_generic_init | |
71 | +._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - CONFIG_ENV_SIZE- 16) | |
72 | +._board_init_f: .long board_init_f | |
73 | +._board_init_r: .long board_init_r | |
74 | +._board_init_f_init_reserve: .long board_init_f_init_reserve | |
75 | +._bootflag: .long GD_FLG_SKIP_RELOC |
@@ -12,6 +12,8 @@ | ||
12 | 12 | #include <command.h> |
13 | 13 | #include <asm/processor.h> |
14 | 14 | |
15 | +DECLARE_GLOBAL_DATA_PTR; | |
16 | + | |
15 | 17 | int checkcpu(void) |
16 | 18 | { |
17 | 19 | puts("CPU: SH3\n"); |
@@ -66,3 +68,10 @@ int dcache_status(void) | ||
66 | 68 | { |
67 | 69 | return 0; |
68 | 70 | } |
71 | + | |
72 | +int arch_cpu_init(void) | |
73 | +{ | |
74 | + gd->ram_size = CONFIG_SYS_SDRAM_SIZE; | |
75 | + | |
76 | + return 0; | |
77 | +} |
@@ -10,6 +10,7 @@ | ||
10 | 10 | |
11 | 11 | #include <asm-offsets.h> |
12 | 12 | #include <config.h> |
13 | +#include <asm-generic/global_data.h> | |
13 | 14 | |
14 | 15 | .text |
15 | 16 | .align 2 |
@@ -42,13 +43,18 @@ _sh_start: | ||
42 | 43 | cmp/hs r5, r4 |
43 | 44 | bf 3b |
44 | 45 | |
45 | - mov.l ._gd_init, r13 /* global data */ | |
46 | - mov.l ._stack_init, r15 /* stack */ | |
46 | + mov.l ._stack_init, r15 | |
47 | + mov.l ._board_init_f_init_reserve, r0 | |
48 | + jsr @r0 | |
49 | + mov r15, r4 | |
47 | 50 | |
48 | - mov.l ._sh_generic_init, r0 | |
51 | + mov.l ._board_init_f, r0 | |
49 | 52 | jsr @r0 |
50 | - nop | |
53 | + mov #._bootflag, r4 | |
51 | 54 | |
55 | + mov.l ._board_init_r, r0 | |
56 | + jsr @r0 | |
57 | + mov r13,r4 | |
52 | 58 | loop: |
53 | 59 | bra loop |
54 | 60 |
@@ -60,5 +66,8 @@ loop: | ||
60 | 66 | ._bss_start: .long bss_start |
61 | 67 | ._bss_end: .long bss_end |
62 | 68 | ._gd_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE) |
63 | -._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16) | |
64 | -._sh_generic_init: .long sh_generic_init | |
69 | +._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - CONFIG_ENV_SIZE - 16) | |
70 | +._board_init_f: .long board_init_f | |
71 | +._board_init_r: .long board_init_r | |
72 | +._board_init_f_init_reserve: .long board_init_f_init_reserve | |
73 | +._bootflag: .long GD_FLG_SKIP_RELOC |
@@ -13,6 +13,8 @@ | ||
13 | 13 | #include <asm/processor.h> |
14 | 14 | #include <asm/cache.h> |
15 | 15 | |
16 | +DECLARE_GLOBAL_DATA_PTR; | |
17 | + | |
16 | 18 | int checkcpu(void) |
17 | 19 | { |
18 | 20 | #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_SERIAL_SUPPORT) |
@@ -81,3 +83,10 @@ int cpu_eth_init(bd_t *bis) | ||
81 | 83 | #endif |
82 | 84 | return 0; |
83 | 85 | } |
86 | + | |
87 | +int arch_cpu_init(void) | |
88 | +{ | |
89 | + gd->ram_size = CONFIG_SYS_SDRAM_SIZE; | |
90 | + | |
91 | + return 0; | |
92 | +} |
@@ -7,6 +7,7 @@ | ||
7 | 7 | |
8 | 8 | #include <asm-offsets.h> |
9 | 9 | #include <config.h> |
10 | +#include <asm-generic/global_data.h> | |
10 | 11 | |
11 | 12 | .text |
12 | 13 | .align 2 |
@@ -40,26 +41,19 @@ _sh_start: | ||
40 | 41 | cmp/hs r5, r4 |
41 | 42 | bf 3b |
42 | 43 | |
43 | -#ifndef CONFIG_SYS_GENERIC_BOARD | |
44 | - mov.l ._gd_init, r13 /* global data */ | |
45 | - | |
46 | - mov.l ._sh_generic_init, r0 | |
47 | - jsr @r0 | |
48 | - nop | |
49 | -#else | |
50 | 44 | mov.l ._stack_init, r15 |
51 | 45 | mov.l ._board_init_f_init_reserve, r0 |
52 | 46 | jsr @r0 |
53 | 47 | mov r15, r4 |
54 | 48 | |
49 | + mov.l ._bootflag, r4 | |
55 | 50 | mov.l ._board_init_f, r0 |
56 | 51 | jsr @r0 |
57 | - mov #0,r4 | |
52 | + nop | |
58 | 53 | |
59 | 54 | mov.l ._board_init_r, r0 |
60 | 55 | jsr @r0 |
61 | 56 | mov r13,r4 |
62 | -#endif | |
63 | 57 | loop: |
64 | 58 | bra loop |
65 | 59 | .align 2 |
@@ -71,11 +65,8 @@ loop: | ||
71 | 65 | ._reloc_dst_end: .long reloc_dst_end |
72 | 66 | ._bss_start: .long bss_start |
73 | 67 | ._bss_end: .long bss_end |
74 | -._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16) | |
75 | -#ifndef CONFIG_SYS_GENERIC_BOARD | |
76 | -._sh_generic_init: .long sh_generic_init | |
77 | -#else | |
68 | +._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - CONFIG_ENV_SIZE - 16) | |
78 | 69 | ._board_init_f: .long board_init_f |
79 | 70 | ._board_init_r: .long board_init_r |
80 | 71 | ._board_init_f_init_reserve: .long board_init_f_init_reserve |
81 | -#endif | |
72 | +._bootflag: .long GD_FLG_SKIP_RELOC |