summaryrefslogtreecommitdiff
path: root/cpu/ppc4xx/fdt.c
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2007-10-23 11:31:05 +0200
committerStefan Roese <sr@denx.de>2007-10-31 21:20:51 +0100
commitf10493c6d77a1e07a6c2ff4d772937a5e7359d6a (patch)
tree8fe61beee476893114183f23a17304ef486679c7 /cpu/ppc4xx/fdt.c
parent353f2688b4e0fc7b969bc70a02be4b40bf0dd124 (diff)
downloadu-boot-imx-f10493c6d77a1e07a6c2ff4d772937a5e7359d6a.zip
u-boot-imx-f10493c6d77a1e07a6c2ff4d772937a5e7359d6a.tar.gz
u-boot-imx-f10493c6d77a1e07a6c2ff4d772937a5e7359d6a.tar.bz2
ppc4xx: Correct UART input clock calculation and passing to fdt
We now use a value in the gd (global data) structure for the UART input frequency, since the PPC4xx_SYS_INFO struct is always rewritten completely in get_sys_info(). Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'cpu/ppc4xx/fdt.c')
-rw-r--r--cpu/ppc4xx/fdt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cpu/ppc4xx/fdt.c b/cpu/ppc4xx/fdt.c
index bf97c2a..dcedbbb 100644
--- a/cpu/ppc4xx/fdt.c
+++ b/cpu/ppc4xx/fdt.c
@@ -36,6 +36,8 @@
#include <libfdt.h>
#include <libfdt_env.h>
+DECLARE_GLOBAL_DATA_PTR;
+
static void do_fixup(void *fdt, const char *node, const char *prop,
const void *val, int len, int create)
{
@@ -44,7 +46,7 @@ static void do_fixup(void *fdt, const char *node, const char *prop,
debug("Updating property '%s/%s' = ", node, prop);
for (i = 0; i < len; i++)
debug(" %.2x", *(u8*)(val+i));
- debug("\n");
+ debug("(%d)\n", *(u32 *)val);
#endif
int rc = fdt_find_and_setprop(fdt, node, prop, val, len, create);
if (rc)
@@ -83,9 +85,9 @@ static void do_fixup_uart(void *fdt, int offset, int i, bd_t *bd)
get_sys_info(&sys_info);
- debug("Updating node UART%d\n", i);
+ debug("Updating node UART%d: clock-frequency=%d\n", i, gd->uart_clk);
- val = cpu_to_fdt32(sys_info.freqUART);
+ val = cpu_to_fdt32(gd->uart_clk);
rc = fdt_setprop(fdt, offset, "clock-frequency", &val, 4);
if (rc)
printf("Unable to update node UART, err=%s\n", fdt_strerror(rc));