powerpc/85xx: Use fdt_node_offset_by_compat_reg for clock-frequency updates

Move to using fdt_node_offset_by_compat_reg to find the node offsets we
want to update instead of using aliases.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
Kumar Gala 2010-07-10 06:38:16 -05:00
parent 6525d51fa5
commit 1b942f7483

View File

@ -298,17 +298,17 @@ void fdt_add_enet_stashing(void *fdt)
} }
#if defined(CONFIG_SYS_DPAA_FMAN) || defined(CONFIG_SYS_DPAA_PME) #if defined(CONFIG_SYS_DPAA_FMAN) || defined(CONFIG_SYS_DPAA_PME)
static void ft_fixup_clks(void *blob, const char *alias, unsigned long freq) static void ft_fixup_clks(void *blob, const char *compat, u32 offset,
unsigned long freq)
{ {
const char *path = fdt_get_alias(blob, alias); phys_addr_t phys = offset + CONFIG_SYS_CCSRBAR_PHYS;
int off = fdt_node_offset_by_compat_reg(blob, compat, phys);
int off = fdt_path_offset(blob, path);
if (off >= 0) { if (off >= 0) {
off = fdt_setprop_cell(blob, off, "clock-frequency", freq); off = fdt_setprop_cell(blob, off, "clock-frequency", freq);
if (off > 0) if (off > 0)
printf("WARNING enable to set clock-frequency " printf("WARNING enable to set clock-frequency "
"for %s: %s\n", alias, fdt_strerror(off)); "for %s: %s\n", compat, fdt_strerror(off));
} }
} }
@ -317,14 +317,17 @@ static void ft_fixup_dpaa_clks(void *blob)
sys_info_t sysinfo; sys_info_t sysinfo;
get_sys_info(&sysinfo); get_sys_info(&sysinfo);
ft_fixup_clks(blob, "fman0", sysinfo.freqFMan[0]); ft_fixup_clks(blob, "fsl,fman", CONFIG_SYS_FSL_FM1_OFFSET,
sysinfo.freqFMan[0]);
#if (CONFIG_SYS_NUM_FMAN == 2) #if (CONFIG_SYS_NUM_FMAN == 2)
ft_fixup_clks(blob, "fman1", sysinfo.freqFMan[1]); ft_fixup_clks(blob, "fsl,fman", CONFIG_SYS_FSL_FM2_OFFSET,
sysinfo.freqFMan[1]);
#endif #endif
#ifdef CONFIG_SYS_DPAA_PME #ifdef CONFIG_SYS_DPAA_PME
ft_fixup_clks(blob, "pme", sysinfo.freqPME); do_fixup_by_compat_u32(blob, "fsl,pme",
"clock-frequency", sysinfo.freqPME, 1);
#endif #endif
} }
#else #else