void *of_start = NULL;
phys_addr_t start, size, usable;
char *fdt_high;
+ phys_addr_t addr;
phys_addr_t low;
phys_size_t mapsize;
ulong of_len = 0;
fdt_high = env_get("fdt_high");
if (fdt_high) {
ulong desired_addr = hextoul(fdt_high, NULL);
- ulong addr;
if (desired_addr == ~0UL) {
/* All ones means use fdt in place */
* At least part of this DRAM bank is usable, try
* using it for LMB allocation.
*/
- of_start = map_sysmem((ulong)lmb_alloc_base(lmb,
- of_len, 0x1000, usable), of_len);
+ addr = lmb_alloc_base(lmb, of_len, 0x1000, usable);
+ of_start = map_sysmem(addr, of_len);
/* Allocation succeeded, use this block. */
if (of_start != NULL)
break;