summaryrefslogtreecommitdiffstats
path: root/tools/binman/test
diff options
context:
space:
mode:
Diffstat (limited to 'tools/binman/test')
-rw-r--r--tools/binman/test/47_spl_bss_pad.dts17
-rw-r--r--tools/binman/test/48_x86-start16-spl.dts13
-rw-r--r--tools/binman/test/49_x86_ucode_spl.dts29
-rw-r--r--tools/binman/test/50_intel_mrc.dts13
-rw-r--r--tools/binman/test/Makefile39
-rwxr-xr-xtools/binman/test/bss_databin0 -> 5020 bytes
-rw-r--r--tools/binman/test/bss_data.c18
-rw-r--r--tools/binman/test/bss_data.lds16
-rw-r--r--tools/binman/test/u_boot_no_ucode_ptr.c4
-rw-r--r--tools/binman/test/u_boot_ucode_ptr.c4
10 files changed, 145 insertions, 8 deletions
diff --git a/tools/binman/test/47_spl_bss_pad.dts b/tools/binman/test/47_spl_bss_pad.dts
new file mode 100644
index 0000000000..6bd88b83f9
--- /dev/null
+++ b/tools/binman/test/47_spl_bss_pad.dts
@@ -0,0 +1,17 @@
+/dts-v1/;
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ binman {
+ u-boot-spl {
+ };
+
+ u-boot-spl-bss-pad {
+ };
+
+ u-boot {
+ };
+ };
+};
diff --git a/tools/binman/test/48_x86-start16-spl.dts b/tools/binman/test/48_x86-start16-spl.dts
new file mode 100644
index 0000000000..e2009f15f0
--- /dev/null
+++ b/tools/binman/test/48_x86-start16-spl.dts
@@ -0,0 +1,13 @@
+/dts-v1/;
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ binman {
+ size = <16>;
+
+ x86-start16-spl {
+ };
+ };
+};
diff --git a/tools/binman/test/49_x86_ucode_spl.dts b/tools/binman/test/49_x86_ucode_spl.dts
new file mode 100644
index 0000000000..67db93ad50
--- /dev/null
+++ b/tools/binman/test/49_x86_ucode_spl.dts
@@ -0,0 +1,29 @@
+/dts-v1/;
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ binman {
+ sort-by-pos;
+ end-at-4gb;
+ size = <0x200>;
+ u-boot-spl-with-ucode-ptr {
+ };
+
+ u-boot-dtb-with-ucode {
+ };
+
+ u-boot-ucode {
+ };
+ };
+
+ microcode {
+ update@0 {
+ data = <0x12345678 0x12345679>;
+ };
+ update@1 {
+ data = <0xabcd0000 0x78235609>;
+ };
+ };
+};
diff --git a/tools/binman/test/50_intel_mrc.dts b/tools/binman/test/50_intel_mrc.dts
new file mode 100644
index 0000000000..54cd52a2b7
--- /dev/null
+++ b/tools/binman/test/50_intel_mrc.dts
@@ -0,0 +1,13 @@
+/dts-v1/;
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ binman {
+ size = <16>;
+
+ intel-mrc {
+ };
+ };
+};
diff --git a/tools/binman/test/Makefile b/tools/binman/test/Makefile
new file mode 100644
index 0000000000..217d13c666
--- /dev/null
+++ b/tools/binman/test/Makefile
@@ -0,0 +1,39 @@
+#
+# Builds test programs
+#
+# Copyright (C) 2017 Google, Inc
+# Written by Simon Glass <sjg@chromium.org>
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+CFLAGS := -march=i386 -m32 -nostdlib -I ../../../include
+
+LDS_UCODE := -T u_boot_ucode_ptr.lds
+
+TARGETS = u_boot_ucode_ptr u_boot_no_ucode_ptr bss_data
+
+all: $(TARGETS)
+
+u_boot_no_ucode_ptr: CFLAGS += $(LDS_UCODE)
+u_boot_no_ucode_ptr: u_boot_no_ucode_ptr.c
+
+u_boot_ucode_ptr: CFLAGS += $(LDS_UCODE)
+u_boot_ucode_ptr: u_boot_ucode_ptr.c
+
+bss_data: CFLAGS += bss_data.lds
+bss_data: bss_data.c
+
+clean:
+ rm -f $(TARGETS)
+
+help:
+ @echo "Makefile for binman test programs"
+ @echo
+ @echo "Intended for use on x86 hosts"
+ @echo
+ @echo "Targets:"
+ @echo
+ @echo -e "\thelp - Print help (this is it!)"
+ @echo -e "\tall - Builds test programs (default targget)"
+ @echo -e "\tclean - Delete output files"
diff --git a/tools/binman/test/bss_data b/tools/binman/test/bss_data
new file mode 100755
index 0000000000..afa28282aa
--- /dev/null
+++ b/tools/binman/test/bss_data
Binary files differ
diff --git a/tools/binman/test/bss_data.c b/tools/binman/test/bss_data.c
new file mode 100644
index 0000000000..f865a9d9f6
--- /dev/null
+++ b/tools/binman/test/bss_data.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2016 Google, Inc
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ * Simple program to create a _dt_ucode_base_size symbol which can be read
+ * by 'nm'. This is used by binman tests.
+ */
+
+int bss_data[10];
+int __bss_size = sizeof(bss_data);
+
+int main()
+{
+ bss_data[2] = 2;
+
+ return 0;
+}
diff --git a/tools/binman/test/bss_data.lds b/tools/binman/test/bss_data.lds
new file mode 100644
index 0000000000..6b2fe09d35
--- /dev/null
+++ b/tools/binman/test/bss_data.lds
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2016 Google, Inc
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
+OUTPUT_ARCH(i386)
+ENTRY(_start)
+
+SECTIONS
+{
+ . = 0xfffffdf0;
+ _start = .;
+ __bss_size = 10;
+}
diff --git a/tools/binman/test/u_boot_no_ucode_ptr.c b/tools/binman/test/u_boot_no_ucode_ptr.c
index a17bb4c6c2..c4a2b85fc9 100644
--- a/tools/binman/test/u_boot_no_ucode_ptr.c
+++ b/tools/binman/test/u_boot_no_ucode_ptr.c
@@ -5,10 +5,6 @@
*
* Simple program to create a bad _dt_ucode_base_size symbol to create an
* error when it is used. This is used by binman tests.
- *
- * Build with:
- * cc -march=i386 -m32 -o u_boot_no_ucode_ptr -T u_boot_ucode_ptr.lds \
- -nostdlib u_boot_no_ucode_ptr.c
*/
static unsigned long not__dt_ucode_base_size[2]
diff --git a/tools/binman/test/u_boot_ucode_ptr.c b/tools/binman/test/u_boot_ucode_ptr.c
index 434c9f4400..24f349fb9e 100644
--- a/tools/binman/test/u_boot_ucode_ptr.c
+++ b/tools/binman/test/u_boot_ucode_ptr.c
@@ -5,10 +5,6 @@
*
* Simple program to create a _dt_ucode_base_size symbol which can be read
* by 'nm'. This is used by binman tests.
- *
- * Build with:
- * cc -march=i386 -m32 -o u_boot_ucode_ptr -T u_boot_ucode_ptr.lds -nostdlib \
- u_boot_ucode_ptr.c
*/
static unsigned long _dt_ucode_base_size[2]