return ft_set_prop(&cxt, phandle, propname, buf, buflen);
}
-static void ft_pack(void)
+static unsigned long ft_finalize(void)
{
ft_end_tree(&cxt);
-}
-
-static unsigned long ft_addr(void)
-{
return (unsigned long)cxt.bph;
}
dt_ops.finddevice = ft_finddevice;
dt_ops.getprop = ft_getprop;
dt_ops.setprop = ft_setprop;
- dt_ops.ft_pack = ft_pack;
- dt_ops.ft_addr = ft_addr;
+ dt_ops.finalize = ft_finalize;
return ft_open(&cxt, dt_blob, max_size, max_find_device,
platform_ops.realloc);
{
kernel_entry_t kentry;
char cmdline[COMMAND_LINE_SIZE];
+ unsigned long ft_addr = 0;
memset(__bss_start, 0, _end - __bss_start);
memset(&platform_ops, 0, sizeof(platform_ops));
set_cmdline(cmdline);
}
+ printf("Finalizing device tree...");
+ if (dt_ops.finalize)
+ ft_addr = dt_ops.finalize();
+ if (ft_addr)
+ printf(" flat tree at 0x%lx\n\r", ft_addr);
+ else
+ printf(" using OF tree (promptr=%p)\n\r", promptr);
+
if (console_ops.close)
console_ops.close();
kentry = (kernel_entry_t) vmlinux.addr;
- if (_dtb_end > _dtb_start) {
- dt_ops.ft_pack();
- kentry(dt_ops.ft_addr(), 0, NULL);
- }
+ if (ft_addr)
+ kentry(ft_addr, 0, NULL);
else
/* XXX initrd addr/size should be passed in properties */
kentry(initrd.addr, initrd.size, promptr);
const int buflen);
int (*setprop)(const void *phandle, const char *name,
const void *buf, const int buflen);
- void (*ft_pack)(void);
- unsigned long (*ft_addr)(void);
+ unsigned long (*finalize)(void);
};
extern struct dt_ops dt_ops;