Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42253
b: refs/heads/master
c: 35af89e
h: refs/heads/master
i:
  42251: 3cc56a9
v: v3
  • Loading branch information
David Gibson authored and Paul Mackerras committed Dec 4, 2006
1 parent e2ed69d commit c434368
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f79e083c2fab601a1c382282344f5a251557dbac
refs/heads/master: 35af89eb491a0741005e474626053266e6e635b7
9 changes: 2 additions & 7 deletions trunk/arch/powerpc/boot/flatdevtree_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,9 @@ static int ft_setprop(const void *phandle, const char *propname,
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;
}

Expand All @@ -48,8 +44,7 @@ int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device)
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);
Expand Down
15 changes: 11 additions & 4 deletions trunk/arch/powerpc/boot/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
{
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));
Expand Down Expand Up @@ -328,14 +329,20 @@ void start(unsigned long a1, unsigned long a2, void *promptr, void *sp)
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);
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/powerpc/boot/ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ struct dt_ops {
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;

Expand Down

0 comments on commit c434368

Please sign in to comment.