mpc83xx: fix 8360 and cpu functions to update fdt being passed

..and not the global fdt. Rename local fdt vars to blob so as not to
be confused with the global var with the same three-letter name.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
This commit is contained in:
Kim Phillips 2007-07-25 19:25:22 -05:00
parent 8be404459a
commit f57ac7a7b3
3 changed files with 22 additions and 22 deletions

View File

@ -682,11 +682,11 @@ ft_board_setup(void *blob, bd_t *bd)
int nodeoffset; int nodeoffset;
int tmp[2]; int tmp[2];
nodeoffset = fdt_find_node_by_path(fdt, "/memory"); nodeoffset = fdt_find_node_by_path(blob, "/memory");
if (nodeoffset >= 0) { if (nodeoffset >= 0) {
tmp[0] = cpu_to_be32(bd->bi_memstart); tmp[0] = cpu_to_be32(bd->bi_memstart);
tmp[1] = cpu_to_be32(bd->bi_memsize); tmp[1] = cpu_to_be32(bd->bi_memsize);
fdt_setprop(fdt, nodeoffset, "reg", tmp, sizeof(tmp)); fdt_setprop(blob, nodeoffset, "reg", tmp, sizeof(tmp));
} }
#else #else
u32 *p; u32 *p;

View File

@ -310,11 +310,11 @@ ft_pci_setup(void *blob, bd_t *bd)
int err; int err;
int tmp[2]; int tmp[2];
nodeoffset = fdt_find_node_by_path(fdt, "/" OF_SOC "/pci@8500"); nodeoffset = fdt_find_node_by_path(blob, "/" OF_SOC "/pci@8500");
if (nodeoffset >= 0) { if (nodeoffset >= 0) {
tmp[0] = cpu_to_be32(hose[0].first_busno); tmp[0] = cpu_to_be32(hose[0].first_busno);
tmp[1] = cpu_to_be32(hose[0].last_busno); tmp[1] = cpu_to_be32(hose[0].last_busno);
err = fdt_setprop(fdt, nodeoffset, "bus-range", tmp, sizeof(tmp)); err = fdt_setprop(blob, nodeoffset, "bus-range", tmp, sizeof(tmp));
} }
} }
#elif defined(CONFIG_OF_FLAT_TREE) #elif defined(CONFIG_OF_FLAT_TREE)

View File

@ -331,74 +331,74 @@ void watchdog_reset (void)
/* /*
* "Setter" functions used to add/modify FDT entries. * "Setter" functions used to add/modify FDT entries.
*/ */
static int fdt_set_eth0(void *fdt, int nodeoffset, const char *name, bd_t *bd) static int fdt_set_eth0(void *blob, int nodeoffset, const char *name, bd_t *bd)
{ {
/* /*
* Fix it up if it exists, don't create it if it doesn't exist. * Fix it up if it exists, don't create it if it doesn't exist.
*/ */
if (fdt_get_property(fdt, nodeoffset, name, 0)) { if (fdt_get_property(blob, nodeoffset, name, 0)) {
return fdt_setprop(fdt, nodeoffset, name, bd->bi_enetaddr, 6); return fdt_setprop(blob, nodeoffset, name, bd->bi_enetaddr, 6);
} }
return 0; return 0;
} }
#ifdef CONFIG_HAS_ETH1 #ifdef CONFIG_HAS_ETH1
/* second onboard ethernet port */ /* second onboard ethernet port */
static int fdt_set_eth1(void *fdt, int nodeoffset, const char *name, bd_t *bd) static int fdt_set_eth1(void *blob, int nodeoffset, const char *name, bd_t *bd)
{ {
/* /*
* Fix it up if it exists, don't create it if it doesn't exist. * Fix it up if it exists, don't create it if it doesn't exist.
*/ */
if (fdt_get_property(fdt, nodeoffset, name, 0)) { if (fdt_get_property(blob, nodeoffset, name, 0)) {
return fdt_setprop(fdt, nodeoffset, name, bd->bi_enet1addr, 6); return fdt_setprop(blob, nodeoffset, name, bd->bi_enet1addr, 6);
} }
return 0; return 0;
} }
#endif #endif
#ifdef CONFIG_HAS_ETH2 #ifdef CONFIG_HAS_ETH2
/* third onboard ethernet port */ /* third onboard ethernet port */
static int fdt_set_eth2(void *fdt, int nodeoffset, const char *name, bd_t *bd) static int fdt_set_eth2(void *blob, int nodeoffset, const char *name, bd_t *bd)
{ {
/* /*
* Fix it up if it exists, don't create it if it doesn't exist. * Fix it up if it exists, don't create it if it doesn't exist.
*/ */
if (fdt_get_property(fdt, nodeoffset, name, 0)) { if (fdt_get_property(blob, nodeoffset, name, 0)) {
return fdt_setprop(fdt, nodeoffset, name, bd->bi_enet2addr, 6); return fdt_setprop(blob, nodeoffset, name, bd->bi_enet2addr, 6);
} }
return 0; return 0;
} }
#endif #endif
#ifdef CONFIG_HAS_ETH3 #ifdef CONFIG_HAS_ETH3
/* fourth onboard ethernet port */ /* fourth onboard ethernet port */
static int fdt_set_eth3(void *fdt, int nodeoffset, const char *name, bd_t *bd) static int fdt_set_eth3(void *blob, int nodeoffset, const char *name, bd_t *bd)
{ {
/* /*
* Fix it up if it exists, don't create it if it doesn't exist. * Fix it up if it exists, don't create it if it doesn't exist.
*/ */
if (fdt_get_property(fdt, nodeoffset, name, 0)) { if (fdt_get_property(blob, nodeoffset, name, 0)) {
return fdt_setprop(fdt, nodeoffset, name, bd->bi_enet3addr, 6); return fdt_setprop(blob, nodeoffset, name, bd->bi_enet3addr, 6);
} }
return 0; return 0;
} }
#endif #endif
static int fdt_set_busfreq(void *fdt, int nodeoffset, const char *name, bd_t *bd) static int fdt_set_busfreq(void *blob, int nodeoffset, const char *name, bd_t *bd)
{ {
u32 tmp; u32 tmp;
/* /*
* Create or update the property. * Create or update the property.
*/ */
tmp = cpu_to_be32(bd->bi_busfreq); tmp = cpu_to_be32(bd->bi_busfreq);
return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp)); return fdt_setprop(blob, nodeoffset, name, &tmp, sizeof(tmp));
} }
static int fdt_set_tbfreq(void *fdt, int nodeoffset, const char *name, bd_t *bd) static int fdt_set_tbfreq(void *blob, int nodeoffset, const char *name, bd_t *bd)
{ {
u32 tmp; u32 tmp;
/* /*
* Create or update the property. * Create or update the property.
*/ */
tmp = cpu_to_be32(OF_TBCLK); tmp = cpu_to_be32(OF_TBCLK);
return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp)); return fdt_setprop(blob, nodeoffset, name, &tmp, sizeof(tmp));
} }
@ -408,7 +408,7 @@ static int fdt_set_tbfreq(void *fdt, int nodeoffset, const char *name, bd_t *bd)
static const struct { static const struct {
char *node; char *node;
char *prop; char *prop;
int (*set_fn)(void *fdt, int nodeoffset, const char *name, bd_t *bd); int (*set_fn)(void *blob, int nodeoffset, const char *name, bd_t *bd);
} fixup_props[] = { } fixup_props[] = {
{ "/cpus/" OF_CPU, { "/cpus/" OF_CPU,
"timebase-frequency", "timebase-frequency",
@ -502,7 +502,7 @@ ft_cpu_setup(void *blob, bd_t *bd)
int j; int j;
for (j = 0; j < (sizeof(fixup_props) / sizeof(fixup_props[0])); j++) { for (j = 0; j < (sizeof(fixup_props) / sizeof(fixup_props[0])); j++) {
nodeoffset = fdt_find_node_by_path(fdt, fixup_props[j].node); nodeoffset = fdt_find_node_by_path(blob, fixup_props[j].node);
if (nodeoffset >= 0) { if (nodeoffset >= 0) {
err = fixup_props[j].set_fn(blob, nodeoffset, err = fixup_props[j].set_fn(blob, nodeoffset,
fixup_props[j].prop, bd); fixup_props[j].prop, bd);