diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2014-12-17 15:50:49 +0800 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-12-18 17:26:08 -0700 |
commit | 255fd5caa5dda7f1028843753562eff58f3855bc (patch) | |
tree | dd181fea0f51800ad68cbbf768e125f143eabb7f /arch/x86/cpu/queensbay/tnc_dram.c | |
parent | 5dad97ed61507d96b2f791980f51ee3497a75867 (diff) | |
download | u-boot-imx-255fd5caa5dda7f1028843753562eff58f3855bc.zip u-boot-imx-255fd5caa5dda7f1028843753562eff58f3855bc.tar.gz u-boot-imx-255fd5caa5dda7f1028843753562eff58f3855bc.tar.bz2 |
x86: Clean up the FSP support codes
This is the follow-on patch to clean up the FSP support codes:
- Remove the _t suffix on the structures defines
- Use __packed for structure defines
- Use U-Boot's assert()
- Use standard bool true/false
- Remove read_unaligned64()
- Use memcmp() in the compare_guid()
- Remove the cast in the memset() call
- Replace some magic numbers with macros
- Use panic() when no valid FSP image header is found
- Change some FSP utility routines to use an fsp_ prefix
- Add comment blocks for asm_continuation and fsp_init_done
- Remove some casts in find_fsp_header()
- Change HOB access macros to static inline routines
- Add comments to mention find_fsp_header() may be called in a
stackless environment
- Add comments to mention init(¶ms) in fsp_init() cannot
be removed
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/cpu/queensbay/tnc_dram.c')
-rw-r--r-- | arch/x86/cpu/queensbay/tnc_dram.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/x86/cpu/queensbay/tnc_dram.c b/arch/x86/cpu/queensbay/tnc_dram.c index dbc1710..8e97c9b 100644 --- a/arch/x86/cpu/queensbay/tnc_dram.c +++ b/arch/x86/cpu/queensbay/tnc_dram.c @@ -14,17 +14,17 @@ DECLARE_GLOBAL_DATA_PTR; int dram_init(void) { phys_size_t ram_size = 0; - union hob_pointers_t hob; + union hob_pointers hob; hob.raw = gd->arch.hob_list; - while (!END_OF_HOB(hob)) { - if (hob.hdr->type == HOB_TYPE_RES_DESC) { + while (!end_of_hob(hob)) { + if (get_hob_type(hob) == HOB_TYPE_RES_DESC) { if (hob.res_desc->type == RES_SYS_MEM || hob.res_desc->type == RES_MEM_RESERVED) { ram_size += hob.res_desc->len; } } - hob.raw = GET_NEXT_HOB(hob); + hob.raw = get_next_hob(hob); } gd->ram_size = ram_size; @@ -49,19 +49,19 @@ void dram_init_banksize(void) */ ulong board_get_usable_ram_top(ulong total_size) { - return get_usable_lowmem_top(gd->arch.hob_list); + return fsp_get_usable_lowmem_top(gd->arch.hob_list); } unsigned install_e820_map(unsigned max_entries, struct e820entry *entries) { unsigned num_entries = 0; - union hob_pointers_t hob; + union hob_pointers hob; hob.raw = gd->arch.hob_list; - while (!END_OF_HOB(hob)) { - if (hob.hdr->type == HOB_TYPE_RES_DESC) { + while (!end_of_hob(hob)) { + if (get_hob_type(hob) == HOB_TYPE_RES_DESC) { entries[num_entries].addr = hob.res_desc->phys_start; entries[num_entries].size = hob.res_desc->len; @@ -70,7 +70,7 @@ unsigned install_e820_map(unsigned max_entries, struct e820entry *entries) else if (hob.res_desc->type == RES_MEM_RESERVED) entries[num_entries].type = E820_RESERVED; } - hob.raw = GET_NEXT_HOB(hob); + hob.raw = get_next_hob(hob); num_entries++; } |