Commit 0cdf37ba095df033bc2fdb2b1bbc2372a0af4284

Authored by Wolfgang Denk

Merge branch 'master' of /home/wd/git/u-boot/custodians

* 'master' of /home/wd/git/u-boot/custodians:
  Blackfin: bfin_sdh: drop dos part hardcode
  Blackfin: move gd/bd to bss by default
  Blackfin: gd_t: relocate volatile markings

Showing 4 changed files Side-by-side Diff

arch/blackfin/include/asm/config.h
... ... @@ -109,14 +109,8 @@
109 109 #ifndef CONFIG_SYS_MALLOC_BASE
110 110 # define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - CONFIG_SYS_MALLOC_LEN)
111 111 #endif
112   -#ifndef CONFIG_SYS_GBL_DATA_ADDR
113   -# define CONFIG_SYS_GBL_DATA_ADDR (CONFIG_SYS_MALLOC_BASE - GENERATED_GBL_DATA_SIZE)
114   -#endif
115   -#ifndef CONFIG_SYS_BD_INFO_ADDR
116   -# define CONFIG_SYS_BD_INFO_ADDR (CONFIG_SYS_GBL_DATA_ADDR - GENERATED_BD_INFO_SIZE)
117   -#endif
118 112 #ifndef CONFIG_STACKBASE
119   -# define CONFIG_STACKBASE (CONFIG_SYS_BD_INFO_ADDR - 4)
  113 +# define CONFIG_STACKBASE (CONFIG_SYS_MALLOC_BASE - 4)
120 114 #endif
121 115 #ifndef CONFIG_SYS_MEMTEST_START
122 116 # define CONFIG_SYS_MEMTEST_START 0
arch/blackfin/include/asm/global_data.h
... ... @@ -73,7 +73,7 @@
73 73 #define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
74 74 #define GD_FLG_ENV_READY 0x00080 /* Environment imported into hash table */
75 75  
76   -#define DECLARE_GLOBAL_DATA_PTR register gd_t * volatile gd asm ("P3")
  76 +#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("P3")
77 77  
78 78 #endif
arch/blackfin/lib/board.c
... ... @@ -181,6 +181,46 @@
181 181 }
182 182 }
183 183  
  184 +static int global_board_data_init(void)
  185 +{
  186 +#ifndef CONFIG_SYS_GBL_DATA_ADDR
  187 +# define CONFIG_SYS_GBL_DATA_ADDR 0
  188 +#endif
  189 +#ifndef CONFIG_SYS_BD_INFO_ADDR
  190 +# define CONFIG_SYS_BD_INFO_ADDR 0
  191 +#endif
  192 +
  193 + bd_t *bd;
  194 +
  195 + if (CONFIG_SYS_GBL_DATA_ADDR) {
  196 + gd = (gd_t *) (CONFIG_SYS_GBL_DATA_ADDR);
  197 + memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);
  198 + } else {
  199 + static gd_t _bfin_gd;
  200 + gd = &_bfin_gd;
  201 + }
  202 +
  203 + if (CONFIG_SYS_BD_INFO_ADDR) {
  204 + bd = (bd_t *) (CONFIG_SYS_BD_INFO_ADDR);
  205 + memset(bd, 0, GENERATED_BD_INFO_SIZE);
  206 + } else {
  207 + static bd_t _bfin_bd;
  208 + bd = &_bfin_bd;
  209 + }
  210 + gd->bd = bd;
  211 +
  212 + bd->bi_r_version = version_string;
  213 + bd->bi_cpu = MK_STR(CONFIG_BFIN_CPU);
  214 + bd->bi_board_name = BFIN_BOARD_NAME;
  215 + bd->bi_vco = get_vco();
  216 + bd->bi_cclk = get_cclk();
  217 + bd->bi_sclk = get_sclk();
  218 + bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
  219 + bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
  220 +
  221 + return 0;
  222 +}
  223 +
184 224 /*
185 225 * All attempts to come up with a "common" initialization sequence
186 226 * that works for all boards and architectures failed: some of the
... ... @@ -201,7 +241,6 @@
201 241  
202 242 void board_init_f(ulong bootflag)
203 243 {
204   - bd_t *bd;
205 244 char buf[32];
206 245  
207 246 #ifdef CONFIG_BOARD_EARLY_INIT_F
208 247  
209 248  
... ... @@ -234,22 +273,9 @@
234 273 hang();
235 274 #endif
236 275 serial_early_puts("Init global data\n");
237   - gd = (gd_t *) (CONFIG_SYS_GBL_DATA_ADDR);
238   - memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);
239 276  
240   - bd = (bd_t *) (CONFIG_SYS_BD_INFO_ADDR);
241   - gd->bd = bd;
242   - memset((void *)bd, 0, GENERATED_BD_INFO_SIZE);
  277 + global_board_data_init();
243 278  
244   - bd->bi_r_version = version_string;
245   - bd->bi_cpu = MK_STR(CONFIG_BFIN_CPU);
246   - bd->bi_board_name = BFIN_BOARD_NAME;
247   - bd->bi_vco = get_vco();
248   - bd->bi_cclk = get_cclk();
249   - bd->bi_sclk = get_sclk();
250   - bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
251   - bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
252   -
253 279 /* Initialize */
254 280 serial_early_puts("IRQ init\n");
255 281 irq_init();
... ... @@ -276,7 +302,7 @@
276 302  
277 303 if (CONFIG_MEM_SIZE) {
278 304 printf("RAM: ");
279   - print_size(bd->bi_memsize, "\n");
  305 + print_size(gd->bd->bi_memsize, "\n");
280 306 }
281 307  
282 308 #if defined(CONFIG_POST)
drivers/mmc/bfin_sdh.c
... ... @@ -256,7 +256,6 @@
256 256 mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
257 257 mmc->f_max = get_sclk();
258 258 mmc->f_min = mmc->f_max >> 9;
259   - mmc->block_dev.part_type = PART_TYPE_DOS;
260 259  
261 260 mmc->b_max = 0;
262 261