提交 0cdf37ba 编写于 作者: W 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
...@@ -109,14 +109,8 @@ ...@@ -109,14 +109,8 @@
#ifndef CONFIG_SYS_MALLOC_BASE #ifndef CONFIG_SYS_MALLOC_BASE
# define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - CONFIG_SYS_MALLOC_LEN) # define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - CONFIG_SYS_MALLOC_LEN)
#endif #endif
#ifndef CONFIG_SYS_GBL_DATA_ADDR
# define CONFIG_SYS_GBL_DATA_ADDR (CONFIG_SYS_MALLOC_BASE - GENERATED_GBL_DATA_SIZE)
#endif
#ifndef CONFIG_SYS_BD_INFO_ADDR
# define CONFIG_SYS_BD_INFO_ADDR (CONFIG_SYS_GBL_DATA_ADDR - GENERATED_BD_INFO_SIZE)
#endif
#ifndef CONFIG_STACKBASE #ifndef CONFIG_STACKBASE
# define CONFIG_STACKBASE (CONFIG_SYS_BD_INFO_ADDR - 4) # define CONFIG_STACKBASE (CONFIG_SYS_MALLOC_BASE - 4)
#endif #endif
#ifndef CONFIG_SYS_MEMTEST_START #ifndef CONFIG_SYS_MEMTEST_START
# define CONFIG_SYS_MEMTEST_START 0 # define CONFIG_SYS_MEMTEST_START 0
......
...@@ -73,6 +73,6 @@ typedef struct global_data { ...@@ -73,6 +73,6 @@ typedef struct global_data {
#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */ #define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#define GD_FLG_ENV_READY 0x00080 /* Environment imported into hash table */ #define GD_FLG_ENV_READY 0x00080 /* Environment imported into hash table */
#define DECLARE_GLOBAL_DATA_PTR register gd_t * volatile gd asm ("P3") #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("P3")
#endif #endif
...@@ -181,6 +181,46 @@ void init_cplbtables(void) ...@@ -181,6 +181,46 @@ void init_cplbtables(void)
} }
} }
static int global_board_data_init(void)
{
#ifndef CONFIG_SYS_GBL_DATA_ADDR
# define CONFIG_SYS_GBL_DATA_ADDR 0
#endif
#ifndef CONFIG_SYS_BD_INFO_ADDR
# define CONFIG_SYS_BD_INFO_ADDR 0
#endif
bd_t *bd;
if (CONFIG_SYS_GBL_DATA_ADDR) {
gd = (gd_t *) (CONFIG_SYS_GBL_DATA_ADDR);
memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);
} else {
static gd_t _bfin_gd;
gd = &_bfin_gd;
}
if (CONFIG_SYS_BD_INFO_ADDR) {
bd = (bd_t *) (CONFIG_SYS_BD_INFO_ADDR);
memset(bd, 0, GENERATED_BD_INFO_SIZE);
} else {
static bd_t _bfin_bd;
bd = &_bfin_bd;
}
gd->bd = bd;
bd->bi_r_version = version_string;
bd->bi_cpu = MK_STR(CONFIG_BFIN_CPU);
bd->bi_board_name = BFIN_BOARD_NAME;
bd->bi_vco = get_vco();
bd->bi_cclk = get_cclk();
bd->bi_sclk = get_sclk();
bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
return 0;
}
/* /*
* All attempts to come up with a "common" initialization sequence * All attempts to come up with a "common" initialization sequence
* that works for all boards and architectures failed: some of the * that works for all boards and architectures failed: some of the
...@@ -201,7 +241,6 @@ extern int timer_init(void); ...@@ -201,7 +241,6 @@ extern int timer_init(void);
void board_init_f(ulong bootflag) void board_init_f(ulong bootflag)
{ {
bd_t *bd;
char buf[32]; char buf[32];
#ifdef CONFIG_BOARD_EARLY_INIT_F #ifdef CONFIG_BOARD_EARLY_INIT_F
...@@ -234,21 +273,8 @@ void board_init_f(ulong bootflag) ...@@ -234,21 +273,8 @@ void board_init_f(ulong bootflag)
hang(); hang();
#endif #endif
serial_early_puts("Init global data\n"); serial_early_puts("Init global data\n");
gd = (gd_t *) (CONFIG_SYS_GBL_DATA_ADDR);
memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);
bd = (bd_t *) (CONFIG_SYS_BD_INFO_ADDR);
gd->bd = bd;
memset((void *)bd, 0, GENERATED_BD_INFO_SIZE);
bd->bi_r_version = version_string; global_board_data_init();
bd->bi_cpu = MK_STR(CONFIG_BFIN_CPU);
bd->bi_board_name = BFIN_BOARD_NAME;
bd->bi_vco = get_vco();
bd->bi_cclk = get_cclk();
bd->bi_sclk = get_sclk();
bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
bd->bi_memsize = CONFIG_SYS_MAX_RAM_SIZE;
/* Initialize */ /* Initialize */
serial_early_puts("IRQ init\n"); serial_early_puts("IRQ init\n");
...@@ -276,7 +302,7 @@ void board_init_f(ulong bootflag) ...@@ -276,7 +302,7 @@ void board_init_f(ulong bootflag)
if (CONFIG_MEM_SIZE) { if (CONFIG_MEM_SIZE) {
printf("RAM: "); printf("RAM: ");
print_size(bd->bi_memsize, "\n"); print_size(gd->bd->bi_memsize, "\n");
} }
#if defined(CONFIG_POST) #if defined(CONFIG_POST)
......
...@@ -256,7 +256,6 @@ int bfin_mmc_init(bd_t *bis) ...@@ -256,7 +256,6 @@ int bfin_mmc_init(bd_t *bis)
mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34; mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
mmc->f_max = get_sclk(); mmc->f_max = get_sclk();
mmc->f_min = mmc->f_max >> 9; mmc->f_min = mmc->f_max >> 9;
mmc->block_dev.part_type = PART_TYPE_DOS;
mmc->b_max = 0; mmc->b_max = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册