cbfs: 64-bit cleanups

cbfs used u32 in a number of cases where uintptr_t was
correct. This change builds for both 64-bit and 32-bit
boards.

Change-Id: If42c722a8a9e8d565d3827f65ed6c2cb8e90ba60
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
Reviewed-on: http://review.coreboot.org/4037
Tested-by: build bot (Jenkins)
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-by: Aaron Durbin <adurbin@google.com>
This commit is contained in:
Ronald G. Minnich 2013-11-11 10:36:28 -08:00 committed by Ronald G. Minnich
parent 7fda0e8e61
commit ef4020957e
2 changed files with 6 additions and 5 deletions

View File

@ -200,7 +200,7 @@ void *cbmem_add(u32 id, u64 size)
cbmem_toc[0].base += size; cbmem_toc[0].base += size;
cbmem_toc[0].size -= size; cbmem_toc[0].size -= size;
return (void *)(u32)cbmem_toc[i].base; return (void *)(uintptr_t)cbmem_toc[i].base;
} }
void *cbmem_find(u32 id) void *cbmem_find(u32 id)

View File

@ -305,7 +305,7 @@ static int relocate_segment(unsigned long buffer, struct segment *seg)
static int build_self_segment_list( static int build_self_segment_list(
struct segment *head, struct segment *head,
struct lb_memory *mem, struct lb_memory *mem,
struct cbfs_payload *payload, u32 *entry) struct cbfs_payload *payload, uintptr_t *entry)
{ {
struct segment *new; struct segment *new;
struct segment *ptr; struct segment *ptr;
@ -332,7 +332,8 @@ static int build_self_segment_list(
new->s_memsz = ntohl(segment->mem_len); new->s_memsz = ntohl(segment->mem_len);
new->compression = ntohl(segment->compression); new->compression = ntohl(segment->compression);
new->s_srcaddr = (u32) ((unsigned char *)first_segment) new->s_srcaddr = (uintptr_t)
((unsigned char *)first_segment)
+ ntohl(segment->offset); + ntohl(segment->offset);
new->s_filesz = ntohl(segment->len); new->s_filesz = ntohl(segment->len);
printk(BIOS_DEBUG, " New segment dstaddr 0x%lx memsize 0x%lx srcaddr 0x%lx filesize 0x%lx\n", printk(BIOS_DEBUG, " New segment dstaddr 0x%lx memsize 0x%lx srcaddr 0x%lx filesize 0x%lx\n",
@ -504,7 +505,7 @@ static int load_self_segments(
void *selfload(struct lb_memory *mem, struct cbfs_payload *payload) void *selfload(struct lb_memory *mem, struct cbfs_payload *payload)
{ {
u32 entry=0; uintptr_t entry = 0;
struct segment head; struct segment head;
/* Preprocess the self segments */ /* Preprocess the self segments */