add debug messages. might should be reverted

Change-Id: Ibdb8b635b22e3ce7cc6c901e6f3cc604173307e9
This commit is contained in:
Alexander Couzens 2017-10-26 01:44:45 +02:00
parent 4b63de1125
commit 9a66544dc7
7 changed files with 26 additions and 3 deletions

View File

@ -123,21 +123,27 @@ static void do_car_migrate_variables(void)
void *migrated_base;
size_t car_size = car_data_size();
printk(BIOS_ERR, "Migrating...\n");
/* Check if already migrated. */
if (car_migrated)
if (car_migrated) {
printk(BIOS_ERR, "Migrating already done\n");
return;
}
migrated_base = cbmem_add(CBMEM_ID_CAR_GLOBALS, car_size);
printk(BIOS_ERR, "base: %p", migrated_base);
if (migrated_base == NULL) {
printk(BIOS_ERR, "Could not migrate CAR data!\n");
return;
}
printk(BIOS_ERR, "base: %p _car_relocatable_data_start %p car_size %lu", migrated_base, _car_relocatable_data_start, car_size);
memcpy(migrated_base, _car_relocatable_data_start, car_size);
/* Mark that the data has been moved. */
car_migrated = ~0;
printk(BIOS_ERR, "Migrating... done\n");
}
static void car_migrate_variables(int is_recovery)

View File

@ -102,10 +102,12 @@ static void switch_to_postram_cache(int unused)
* backing mdev with postram cache. This prevents the mdev backing from
* being overwritten if spi_flash was not accessed before dram was up.
*/
printk(BIOS_ERR, "postram cache\n");
boot_device_init();
if (_preram_cbfs_cache != _postram_cbfs_cache)
mmap_helper_device_init(&mdev, _postram_cbfs_cache,
_postram_cbfs_cache_size);
printk(BIOS_ERR, "postram cache end\n");
}
ROMSTAGE_CBMEM_INIT_HOOK(switch_to_postram_cache);

View File

@ -662,16 +662,21 @@ static void migrate_ehci_debug(int is_recovery)
{
struct ehci_debug_info *dbg_info_cbmem;
int rv;
printk(BIOS_ERR, "migrate ehci debug\n");
if (ENV_ROMSTAGE) {
/* Move state from CAR to CBMEM. */
struct ehci_debug_info *dbg_info = dbgp_ehci_info();
dbg_info_cbmem = cbmem_add(CBMEM_ID_EHCI_DEBUG,
sizeof(*dbg_info));
if (dbg_info_cbmem == NULL)
printk(BIOS_ERR, "migrate ehci debug 1\n");
if (dbg_info_cbmem == NULL) {
printk(BIOS_ERR, "migrate ehci debug 2\n");
return;
}
memcpy(dbg_info_cbmem, dbg_info, sizeof(*dbg_info));
car_set_var(glob_dbg_info_p, dbg_info_cbmem);
printk(BIOS_ERR, "migrate ehci debug 3\n");
return;
}

View File

@ -176,6 +176,7 @@ static void copy_console_buffer(struct cbmem_console *src_cons_p)
static void cbmemc_reinit(int is_recovery)
{
printk(BIOS_ERR, "cbmemc_reinit\n");
const size_t size = CONFIG_CONSOLE_CBMEM_BUFFER_SIZE;
/* If CBMEM entry already existed, old contents are not altered. */
struct cbmem_console *cbmem_cons_p = cbmem_add(CBMEM_ID_CONSOLE, size);
@ -183,6 +184,7 @@ static void cbmemc_reinit(int is_recovery)
init_console_ptr(cbmem_cons_p, size);
copy_console_buffer(previous_cons_p);
printk(BIOS_ERR, "cbmemc_reinit done\n");
}
ROMSTAGE_CBMEM_INIT_HOOK(cbmemc_reinit)
RAMSTAGE_CBMEM_INIT_HOOK(cbmemc_reinit)

View File

@ -118,10 +118,12 @@ void stage_cache_load_stage(int stage_id, struct prog *stage)
static void stage_cache_setup(int is_recovery)
{
printk(BIOS_ERR, "stage cache setup\n");
if (is_recovery)
stage_cache_recover();
else
stage_cache_create_empty();
printk(BIOS_ERR, "stage cache setup done\n");
}
ROMSTAGE_CBMEM_INIT_HOOK(stage_cache_setup)

View File

@ -215,13 +215,16 @@ void timestamp_init(uint64_t base)
static void timestamp_sync_cache_to_cbmem(int is_recovery)
{
printk(BIOS_ERR, "timestamp sync\n");
uint32_t i;
struct timestamp_cache *ts_cache;
struct timestamp_table *ts_cache_table;
struct timestamp_table *ts_cbmem_table = NULL;
if (!timestamp_should_run())
if (!timestamp_should_run()) {
printk(BIOS_ERR, "timestamp sync no run\n");
return;
}
ts_cache = timestamp_cache_get();
@ -298,6 +301,7 @@ static void timestamp_sync_cache_to_cbmem(int is_recovery)
/* Cache no longer required. */
ts_cache_table->num_entries = 0;
ts_cache->cache_state = TIMESTAMP_CACHE_NOT_NEEDED;
printk(BIOS_ERR, "timestamp sync done\n");
}
void timestamp_rescale_table(uint16_t N, uint16_t M)

View File

@ -45,6 +45,7 @@ static void migrate_power_state(int is_recovery)
{
struct chipset_power_state *ps_cbmem;
struct chipset_power_state *ps_car;
printk(BIOS_ERR, "migrate power state\n");
ps_car = car_get_var_ptr(&power_state);
ps_cbmem = cbmem_add(CBMEM_ID_POWER_STATE, sizeof(*ps_cbmem));
@ -54,6 +55,7 @@ static void migrate_power_state(int is_recovery)
return;
}
memcpy(ps_cbmem, ps_car, sizeof(*ps_cbmem));
printk(BIOS_ERR, "migrate power state done\n");
}
ROMSTAGE_CBMEM_INIT_HOOK(migrate_power_state)