From 3eadafbd35aeefed73aa9519df4cc6d6b34a3cf2 Mon Sep 17 00:00:00 2001 From: Oliver O'Halloran Date: Tue, 19 Feb 2019 18:53:36 +1100 Subject: hdata/test: Fix up linux,sml-base property The linux,sml-base property stores a raw pointer into the HDAT area. When running the hdat parser tester the load address of the HDAT will change each time the tool is run so we need to sanatise the property to get consistent output. Signed-off-by: Oliver O'Halloran Signed-off-by: Stewart Smith --- hdata/test/hdata_to_dt.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hdata/test/hdata_to_dt.c b/hdata/test/hdata_to_dt.c index fd2957c..a5f152e 100644 --- a/hdata/test/hdata_to_dt.c +++ b/hdata/test/hdata_to_dt.c @@ -253,8 +253,23 @@ static void squash_blobs(struct dt_node *root) static void dump_hdata_fdt(struct dt_node *root) { + struct dt_node *n; void *fdt_blob; + /* delete some properties that hardcode pointers */ + dt_for_each_node(dt_root, n) { + struct dt_property *base; + + /* + * sml-base is a raw pointer into the HDAT area so it changes + * on each execution of hdata_to_dt. Work around this by + * zeroing it. + */ + base = __dt_find_property(n, "linux,sml-base"); + if (base) + memset(base->prop, 0, base->len); + } + fdt_blob = create_dtb(root, false); if (!fdt_blob) { -- cgit v1.1