mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 15:37:23 +00:00
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:
parent
6525d51fa5
commit
1b942f7483
1 changed files with 11 additions and 8 deletions
|
@ -298,17 +298,17 @@ void fdt_add_enet_stashing(void *fdt)
|
|||
}
|
||||
|
||||
#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);
|
||||
|
||||
int off = fdt_path_offset(blob, path);
|
||||
phys_addr_t phys = offset + CONFIG_SYS_CCSRBAR_PHYS;
|
||||
int off = fdt_node_offset_by_compat_reg(blob, compat, phys);
|
||||
|
||||
if (off >= 0) {
|
||||
off = fdt_setprop_cell(blob, off, "clock-frequency", freq);
|
||||
if (off > 0)
|
||||
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;
|
||||
|
||||
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)
|
||||
ft_fixup_clks(blob, "fman1", sysinfo.freqFMan[1]);
|
||||
ft_fixup_clks(blob, "fsl,fman", CONFIG_SYS_FSL_FM2_OFFSET,
|
||||
sysinfo.freqFMan[1]);
|
||||
#endif
|
||||
|
||||
#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
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue