summaryrefslogtreecommitdiff
path: root/board/freescale/mpc8641hpcn/mpc8641hpcn.c
diff options
context:
space:
mode:
authorBecky Bruce <becky.bruce@freescale.com>2008-11-07 13:46:19 -0600
committerJon Loeliger <jdl@freescale.com>2008-11-10 10:10:05 -0600
commitd52082b12c6e545705a19433a2f4142526536189 (patch)
treea536aacdde58e364de96203884dec87b5c05a59a /board/freescale/mpc8641hpcn/mpc8641hpcn.c
parent8db0400a27839f91c047dcb83f4a0f09e054a180 (diff)
downloadu-boot-imx-d52082b12c6e545705a19433a2f4142526536189.zip
u-boot-imx-d52082b12c6e545705a19433a2f4142526536189.tar.gz
u-boot-imx-d52082b12c6e545705a19433a2f4142526536189.tar.bz2
mpc8641: Try to detect old .dts files
Since we've changed the memory map of the board, be nice and add some checking to try to catch out-of-date .dts files. We do this by checking the CCSRBAR location in the .dts and comparing it to the CCSRBAR location in u-boot. If they don't match, a warning msg is printed. This isn't foolproof, but it's simple and will catch most of the cases where an out-of-date .dts is present, including all of the cases where a new u-boot is used with an old standard MPC8641 .dts file as supplied with Linux. Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Diffstat (limited to 'board/freescale/mpc8641hpcn/mpc8641hpcn.c')
-rw-r--r--board/freescale/mpc8641hpcn/mpc8641hpcn.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
index 15be0c6..285d051 100644
--- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c
+++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
@@ -254,6 +254,10 @@ extern void ft_fsl_pci_setup(void *blob, const char *pci_alias,
void
ft_board_setup(void *blob, bd_t *bd)
{
+ int off;
+ u64 *tmp;
+ u32 *addrcells;
+
ft_cpu_setup(blob, bd);
#ifdef CONFIG_PCI1
@@ -262,6 +266,29 @@ ft_board_setup(void *blob, bd_t *bd)
#ifdef CONFIG_PCI2
ft_fsl_pci_setup(blob, "pci1", &pci2_hose);
#endif
+
+ /*
+ * Warn if it looks like the device tree doesn't match u-boot.
+ * This is just an estimation, based on the location of CCSR,
+ * which is defined by the "reg" property in the soc node.
+ */
+ off = fdt_path_offset(blob, "/soc8641");
+ addrcells = (u32 *)fdt_getprop(blob, 0, "#address-cells", NULL);
+ tmp = (u64 *)fdt_getprop(blob, off, "reg", NULL);
+
+ if (tmp) {
+ u64 addr;
+ if (addrcells && (*addrcells == 2))
+ addr = *tmp;
+ else
+ addr = *(u32 *)tmp;
+
+ if (addr != CONFIG_SYS_CCSRBAR_PHYS)
+ printf("WARNING: The CCSRBAR address in your .dts "
+ "does not match the address of the CCSR "
+ "in u-boot. This means your .dts might "
+ "be old.\n");
+ }
}
#endif