aboutsummaryrefslogtreecommitdiffstats
path: root/roms/u-boot/tools/libfdt
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/u-boot/tools/libfdt
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/u-boot/tools/libfdt')
-rw-r--r--roms/u-boot/tools/libfdt/fdt.c2
-rw-r--r--roms/u-boot/tools/libfdt/fdt_addresses.c2
-rw-r--r--roms/u-boot/tools/libfdt/fdt_empty_tree.c2
-rw-r--r--roms/u-boot/tools/libfdt/fdt_overlay.c2
-rw-r--r--roms/u-boot/tools/libfdt/fdt_ro.c2
-rw-r--r--roms/u-boot/tools/libfdt/fdt_rw.c36
-rw-r--r--roms/u-boot/tools/libfdt/fdt_strerror.c2
-rw-r--r--roms/u-boot/tools/libfdt/fdt_sw.c2
-rw-r--r--roms/u-boot/tools/libfdt/fdt_wip.c2
9 files changed, 52 insertions, 0 deletions
diff --git a/roms/u-boot/tools/libfdt/fdt.c b/roms/u-boot/tools/libfdt/fdt.c
new file mode 100644
index 000000000..8ba809192
--- /dev/null
+++ b/roms/u-boot/tools/libfdt/fdt.c
@@ -0,0 +1,2 @@
+#include "fdt_host.h"
+#include "../scripts/dtc/libfdt/fdt.c"
diff --git a/roms/u-boot/tools/libfdt/fdt_addresses.c b/roms/u-boot/tools/libfdt/fdt_addresses.c
new file mode 100644
index 000000000..242a2c083
--- /dev/null
+++ b/roms/u-boot/tools/libfdt/fdt_addresses.c
@@ -0,0 +1,2 @@
+#include "fdt_host.h"
+#include "../scripts/dtc/libfdt/fdt_addresses.c"
diff --git a/roms/u-boot/tools/libfdt/fdt_empty_tree.c b/roms/u-boot/tools/libfdt/fdt_empty_tree.c
new file mode 100644
index 000000000..9ccbb1f94
--- /dev/null
+++ b/roms/u-boot/tools/libfdt/fdt_empty_tree.c
@@ -0,0 +1,2 @@
+#include "fdt_host.h"
+#include "../scripts/dtc/libfdt/fdt_empty_tree.c"
diff --git a/roms/u-boot/tools/libfdt/fdt_overlay.c b/roms/u-boot/tools/libfdt/fdt_overlay.c
new file mode 100644
index 000000000..801ec374b
--- /dev/null
+++ b/roms/u-boot/tools/libfdt/fdt_overlay.c
@@ -0,0 +1,2 @@
+#include "fdt_host.h"
+#include "../scripts/dtc/libfdt/fdt_overlay.c"
diff --git a/roms/u-boot/tools/libfdt/fdt_ro.c b/roms/u-boot/tools/libfdt/fdt_ro.c
new file mode 100644
index 000000000..8a9735a48
--- /dev/null
+++ b/roms/u-boot/tools/libfdt/fdt_ro.c
@@ -0,0 +1,2 @@
+#include "fdt_host.h"
+#include "../scripts/dtc/libfdt/fdt_ro.c"
diff --git a/roms/u-boot/tools/libfdt/fdt_rw.c b/roms/u-boot/tools/libfdt/fdt_rw.c
new file mode 100644
index 000000000..7189f0142
--- /dev/null
+++ b/roms/u-boot/tools/libfdt/fdt_rw.c
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0+ BSD-2-Clause */
+#include "fdt_host.h"
+#include "../../scripts/dtc/libfdt/fdt_rw.c"
+
+int fdt_remove_unused_strings(const void *old, void *new)
+{
+ const struct fdt_property *old_prop;
+ struct fdt_property *new_prop;
+ int size = fdt_totalsize(old);
+ int next_offset, offset;
+ const char *str;
+ int ret;
+ int tag = FDT_PROP;
+ int allocated;
+
+ /* Make a copy and remove the strings */
+ memcpy(new, old, size);
+ fdt_set_size_dt_strings(new, 0);
+
+ /* Add every property name back into the new string table */
+ for (offset = 0; tag != FDT_END; offset = next_offset) {
+ tag = fdt_next_tag(old, offset, &next_offset);
+ if (tag != FDT_PROP)
+ continue;
+ old_prop = fdt_get_property_by_offset(old, offset, NULL);
+ new_prop = (struct fdt_property *)(unsigned long)
+ fdt_get_property_by_offset(new, offset, NULL);
+ str = fdt_string(old, fdt32_to_cpu(old_prop->nameoff));
+ ret = fdt_find_add_string_(new, str, &allocated);
+ if (ret < 0)
+ return ret;
+ new_prop->nameoff = cpu_to_fdt32(ret);
+ }
+
+ return 0;
+}
diff --git a/roms/u-boot/tools/libfdt/fdt_strerror.c b/roms/u-boot/tools/libfdt/fdt_strerror.c
new file mode 100644
index 000000000..d7ed70bea
--- /dev/null
+++ b/roms/u-boot/tools/libfdt/fdt_strerror.c
@@ -0,0 +1,2 @@
+#include "fdt_host.h"
+#include "../scripts/dtc/libfdt/fdt_strerror.c"
diff --git a/roms/u-boot/tools/libfdt/fdt_sw.c b/roms/u-boot/tools/libfdt/fdt_sw.c
new file mode 100644
index 000000000..ed6b32757
--- /dev/null
+++ b/roms/u-boot/tools/libfdt/fdt_sw.c
@@ -0,0 +1,2 @@
+#include "fdt_host.h"
+#include "../scripts/dtc/libfdt/fdt_sw.c"
diff --git a/roms/u-boot/tools/libfdt/fdt_wip.c b/roms/u-boot/tools/libfdt/fdt_wip.c
new file mode 100644
index 000000000..bad73ed9e
--- /dev/null
+++ b/roms/u-boot/tools/libfdt/fdt_wip.c
@@ -0,0 +1,2 @@
+#include "fdt_host.h"
+#include "../scripts/dtc/libfdt/fdt_wip.c"