diff options
Diffstat (limited to 'arch/x86/lib')
-rw-r--r-- | arch/x86/lib/mrccache.c | 15 | ||||
-rw-r--r-- | arch/x86/lib/spl.c | 2 | ||||
-rw-r--r-- | arch/x86/lib/tpl.c | 2 |
3 files changed, 10 insertions, 9 deletions
diff --git a/arch/x86/lib/mrccache.c b/arch/x86/lib/mrccache.c index be107627b8..33bb52039b 100644 --- a/arch/x86/lib/mrccache.c +++ b/arch/x86/lib/mrccache.c @@ -17,19 +17,20 @@ DECLARE_GLOBAL_DATA_PTR; +static uint mrc_block_size(uint data_size) +{ + uint mrc_size = sizeof(struct mrc_data_container) + data_size; + + return ALIGN(mrc_size, MRC_DATA_ALIGN); +} + static struct mrc_data_container *next_mrc_block( struct mrc_data_container *cache) { /* MRC data blocks are aligned within the region */ - u32 mrc_size = sizeof(*cache) + cache->data_size; u8 *region_ptr = (u8 *)cache; - if (mrc_size & (MRC_DATA_ALIGN - 1UL)) { - mrc_size &= ~(MRC_DATA_ALIGN - 1UL); - mrc_size += MRC_DATA_ALIGN; - } - - region_ptr += mrc_size; + region_ptr += mrc_block_size(cache->data_size); return (struct mrc_data_container *)region_ptr; } diff --git a/arch/x86/lib/spl.c b/arch/x86/lib/spl.c index 2baac91383..7623fc9ada 100644 --- a/arch/x86/lib/spl.c +++ b/arch/x86/lib/spl.c @@ -113,7 +113,7 @@ void board_init_f(ulong flags) ret = x86_spl_init(); if (ret) { debug("Error %d\n", ret); - hang(); + panic("x86_spl_init fail"); } #ifdef CONFIG_TPL gd->bd = malloc(sizeof(*gd->bd)); diff --git a/arch/x86/lib/tpl.c b/arch/x86/lib/tpl.c index cfefa78045..d70f590541 100644 --- a/arch/x86/lib/tpl.c +++ b/arch/x86/lib/tpl.c @@ -55,7 +55,7 @@ void board_init_f(ulong flags) ret = x86_tpl_init(); if (ret) { debug("Error %d\n", ret); - hang(); + panic("x86_tpl_init fail"); } /* Uninit CAR and jump to board_init_f_r() */ |