リビジョン | 4b22789bdd8368068b68d41659b7440521a13246 (tree) |
---|---|
日時 | 2019-07-03 23:55:03 |
作者 | Yoshinori Sato <ysato@user...> |
コミッター | Yoshinori Sato |
h8300: fix edosk2674
@@ -887,7 +887,7 @@ LDFLAGS_u-boot += $(LDFLAGS_FINAL) | ||
887 | 887 | # Avoid 'Not enough room for program headers' error on binutils 2.28 onwards. |
888 | 888 | LDFLAGS_u-boot += $(call ld-option, --no-dynamic-linker) |
889 | 889 | |
890 | -ifeq ($(CONFIG_ARC)$(CONFIG_NIOS2)$(CONFIG_X86)$(CONFIG_XTENSA)$(CONFIG_H8300),) | |
890 | +ifeq ($(CONFIG_ARC)$(CONFIG_NIOS2)$(CONFIG_X86)$(CONFIG_XTENSA),) | |
891 | 891 | LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE) |
892 | 892 | endif |
893 | 893 |
@@ -48,6 +48,9 @@ config TIMER_BASE | ||
48 | 48 | hex |
49 | 49 | default 0xffff80 |
50 | 50 | |
51 | +config SYS_NON_RELOC | |
52 | + bool | |
53 | + | |
51 | 54 | source "board/h8300h_sim/Kconfig" |
52 | 55 | source "board/h8300s_sim/Kconfig" |
53 | 56 | source "board/ae3069/Kconfig" |
@@ -19,6 +19,7 @@ | ||
19 | 19 | |
20 | 20 | #include <config.h> |
21 | 21 | #include <version.h> |
22 | +#include <asm-offsets.h> | |
22 | 23 | |
23 | 24 | .h8300h |
24 | 25 |
@@ -60,6 +61,8 @@ _start: | ||
60 | 61 | relocate_code: |
61 | 62 | mov.l er1,er0 |
62 | 63 | sub.l er1,er1 |
64 | + mov.l #CONFIG_SYS_DRAM_BASE + CONFIG_SYS_DRAM_SIZE, er2 | |
65 | + mov.l er2,@(GD_RELOCADDR,er0) | |
63 | 66 | jmp @board_init_r |
64 | 67 | |
65 | 68 | .end |
@@ -19,6 +19,7 @@ | ||
19 | 19 | |
20 | 20 | #include <config.h> |
21 | 21 | #include <version.h> |
22 | +#include <asm-offsets.h> | |
22 | 23 | |
23 | 24 | .h8300s |
24 | 25 |
@@ -27,7 +28,7 @@ | ||
27 | 28 | .long __start |
28 | 29 | vector = 2 |
29 | 30 | .rept 126 |
30 | - .long __ram_vec + (vector * 4) | |
31 | + .long _ram_vec + (vector * 4) | |
31 | 32 | vector = vector + 1 |
32 | 33 | .endr |
33 | 34 |
@@ -56,12 +57,18 @@ _start: | ||
56 | 57 | bne 1b |
57 | 58 | |
58 | 59 | mov.l #CONFIG_SYS_TEXT_BASE,sp |
60 | + mov.l sp,er0 | |
61 | + jsr @board_init_f_alloc_reserve | |
62 | + mov.l er0,sp | |
63 | + jsr @board_init_f_init_reserve | |
64 | + sub.l er0,er0 /* boot flags */ | |
59 | 65 | jsr @board_init_f |
60 | 66 | bra . |
61 | 67 | |
62 | 68 | relocate_code: |
63 | 69 | mov.l er1,er0 |
64 | 70 | sub.l er1,er1 |
71 | + mov.l er1,@(GD_RELOC_OFF,er0) | |
65 | 72 | jmp @board_init_r |
66 | 73 | |
67 | 74 | .end |
@@ -6,7 +6,7 @@ | ||
6 | 6 | interrupt-parent = <&h8intc>; |
7 | 7 | |
8 | 8 | chosen { |
9 | - stdout-path = &sci2; | |
9 | + stdout-path = &sci0; | |
10 | 10 | }; |
11 | 11 | aliases { |
12 | 12 | serial0 = &sci0; |
@@ -18,4 +18,10 @@ config NETDEVICES | ||
18 | 18 | config DM_ETH |
19 | 19 | default y |
20 | 20 | |
21 | +config SYS_TEXT_BASE | |
22 | + default 0x00000100 | |
23 | + | |
24 | +config SYS_NON_RELOC | |
25 | + default y | |
26 | + | |
21 | 27 | endif |
@@ -9,4 +9,7 @@ config SYS_VENDOR | ||
9 | 9 | config SYS_CONFIG_NAME |
10 | 10 | default "edosk2674" |
11 | 11 | |
12 | +config SYS_TEXT_BASE | |
13 | + default 0x00b00000 | |
14 | + | |
12 | 15 | endif |
@@ -36,10 +36,17 @@ int board_init(void) | ||
36 | 36 | return 0; |
37 | 37 | } |
38 | 38 | |
39 | -void dram_init_banksize(void) | |
39 | +int dram_init(void) | |
40 | 40 | { |
41 | - DECLARE_GLOBAL_DATA_PTR; | |
42 | - gd->bd->bi_memsize = gd->ram_size = 8 * 1024 * 1024; | |
41 | + if (fdtdec_setup_mem_size_base() != 0) | |
42 | + return -EINVAL; | |
43 | + | |
44 | + return 0; | |
45 | +} | |
46 | + | |
47 | +int dram_init_banksize(void) | |
48 | +{ | |
49 | + return 0; | |
43 | 50 | } |
44 | 51 | |
45 | 52 | void led_set_state(unsigned short value) |
@@ -59,7 +59,7 @@ lowlevel_init: | ||
59 | 59 | mov.l #_start,er5 |
60 | 60 | sub.l #4b,er5 |
61 | 61 | add.l er4,er5 |
62 | - mov.l #CONFIG_SYS_TEXT_BASE,er6 | |
62 | + mov.l #_start,er6 | |
63 | 63 | mov.l #__bss_start,er4 |
64 | 64 | sub.l er6,er4 |
65 | 65 | shlr #2,er4 |
@@ -269,7 +269,7 @@ static int setup_mon_len(void) | ||
269 | 269 | gd->mon_len = (ulong)&_end - (ulong)_init; |
270 | 270 | #elif defined(CONFIG_NIOS2) || defined(CONFIG_XTENSA) |
271 | 271 | gd->mon_len = CONFIG_SYS_MONITOR_LEN; |
272 | -#elif defined(CONFIG_NDS32) || defined(CONFIG_SH) || defined(CONFIG_RISCV) | |
272 | +#elif defined(CONFIG_NDS32) || defined(CONFIG_SH) || defined(CONFIG_RISCV) || defined(CONFIG_H8300) | |
273 | 273 | gd->mon_len = (ulong)(&__bss_end) - (ulong)(&_start); |
274 | 274 | #elif defined(CONFIG_SYS_MONITOR_BASE) |
275 | 275 | /* TODO: use (ulong)&__bss_end - (ulong)&__text_start; ? */ |
@@ -126,6 +126,7 @@ static int initr_reloc_global_data(void) | ||
126 | 126 | #elif !defined(CONFIG_SANDBOX) && !defined(CONFIG_NIOS2) |
127 | 127 | monitor_flash_len = (ulong)&__init_end - gd->relocaddr; |
128 | 128 | #endif |
129 | +#if !defined(CONFIG_SYS_NON_RELOC) | |
129 | 130 | #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) |
130 | 131 | /* |
131 | 132 | * The gd->cpu pointer is set to an address in flash before relocation. |
@@ -164,7 +165,7 @@ static int initr_reloc_global_data(void) | ||
164 | 165 | |
165 | 166 | efi_runtime_relocate(gd->relocaddr, NULL); |
166 | 167 | #endif |
167 | - | |
168 | +#endif | |
168 | 169 | return 0; |
169 | 170 | } |
170 | 171 |
@@ -25,11 +25,6 @@ | ||
25 | 25 | #ifndef __EDOSK2674_H |
26 | 26 | #define __EDOSK2674_H |
27 | 27 | |
28 | -#define CONFIG_H8300 1 | |
29 | -#define CONFIG_H8300S 1 | |
30 | -#define CONFIG_CPU_H8S2678 1 | |
31 | -#define CONFIG_EDOSK2674 1 | |
32 | - | |
33 | 28 | #define CONFIG_BAUDRATE 38400 |
34 | 29 | #define CONFIG_BOOTARGS "earlyprintk=sh-sci.2,38400 console=ttySC2,38400" |
35 | 30 |
@@ -41,7 +36,6 @@ | ||
41 | 36 | #define EDOSK2674_SDRAM_BASE 0x400000 |
42 | 37 | |
43 | 38 | #define CONFIG_SYS_MONITOR_BASE 0xb00000 |
44 | -#define CONFIG_SYS_LONGHELP /* undef to save memory */ | |
45 | 39 | #define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */ |
46 | 40 | #define CONFIG_SYS_CBSIZE 256 /* Buffer size for input from the Console */ |
47 | 41 | #define CONFIG_SYS_PBSIZE 256 /* Buffer size for Console output */ |
@@ -52,24 +46,8 @@ | ||
52 | 46 | /* List of legal baudrate settings for this board */ |
53 | 47 | #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } |
54 | 48 | |
55 | -#define CONFIG_OF_LIBFDT | |
56 | 49 | #define CONFIG_LMB |
57 | 50 | |
58 | -/* SCI */ | |
59 | -#define CONFIG_SCI 1 | |
60 | -#define CONFIG_SCIF_CONSOLE 1 | |
61 | - | |
62 | -/* TIMER */ | |
63 | -#define CONFIG_TIMER_BASE 0xffffb0 /* CH0-1 */ | |
64 | - | |
65 | -/* GPIO */ | |
66 | -#define CONFIG_H8300_GPIO \ | |
67 | - {0xff,0xff,0x3f,0xff,0xf8,0x3f,0x3f,0x3f,0x00, \ | |
68 | - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70} | |
69 | -#define CONFIG_H8300_INIT_DDR \ | |
70 | - {0x00,0x00,0x3a,0x00,0x00,0x00,0x00,0x00,0x00, \ | |
71 | - 0xff,0x00,0x00,0x00,0x00,0xfe,0x0f,0x0f} | |
72 | - | |
73 | 51 | /* SDRAM */ |
74 | 52 | #define CONFIG_SYS_MEMTEST_START EDOSK2674_SDRAM_BASE + (1 * 1024 * 1024) |
75 | 53 | #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + (7 * 1024 * 1024)) |
@@ -77,15 +55,12 @@ | ||
77 | 55 | #define CONFIG_SYS_SDRAM_BASE EDOSK2674_SDRAM_BASE |
78 | 56 | #define CONFIG_SYS_SDRAM_SIZE (8 * 1024 * 1024) |
79 | 57 | |
80 | -#define CONFIG_SYS_TEXT_BASE 0xb00000 | |
81 | 58 | #define CONFIG_SYS_LOAD_ADDR 0x400000 |
82 | 59 | |
83 | 60 | #define CONFIG_SYS_MALLOC_LEN (256 * 1024) |
84 | 61 | #define CONFIG_SYS_GBL_DATA_SIZE 256 |
85 | 62 | |
86 | -#define CONFIG_ENV_SIZE (128 * 1024) | |
87 | -#define CONFIG_ENV_IS_IN_FLASH 1 | |
88 | -#define CONFIG_ENV_ADDR 0x3e0000 | |
63 | +#define CONFIG_ENV_SIZE 4096 | |
89 | 64 | |
90 | 65 | /* Board Clock */ |
91 | 66 | #define CONFIG_SYS_CLK_FREQ 33333333 |
@@ -99,11 +74,7 @@ | ||
99 | 74 | #endif |
100 | 75 | |
101 | 76 | /* Flash */ |
102 | -#define CONFIG_SYS_MAX_FLASH_BANKS 1 | |
103 | -#define CONFIG_SYS_MAX_FLASH_SECT 32 | |
104 | 77 | #define CONFIG_SYS_FLASH_BASE EDOSK2674_FLASH_BASE |
105 | -#define CONFIG_SYS_FLASH_CFI 1 | |
106 | -#define CONFIG_FLASH_CFI_DRIVER 1 | |
107 | -#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT | |
78 | + | |
108 | 79 | |
109 | 80 | #endif /* __EDOSK2674_H */ |