diff options
author | Simon Glass <sjg@chromium.org> | 2016-11-25 20:15:53 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-12-20 08:09:55 +1300 |
commit | e0ff85513858246e5378e4e3676ef6128452c4f6 (patch) | |
tree | 8265f67f1246bf73f351a785ea27bfc305384f7e /tools/binman/test | |
parent | 4f44304b0bd881f79252c7b7d2fb796e31ca3b0a (diff) |
binman: Add support for building x86 ROMs
The structure of x86 ROMs is pretty complex. There are various binary blobs
to place in the image. Microcode requires special handling so that it is
available to very early code and can be used without any memory whatsoever.
Add support for the various entry types that are currently needed, along
with some tests.
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'tools/binman/test')
-rw-r--r-- | tools/binman/test/27_pack_4gb_no_size.dts | 18 | ||||
-rw-r--r-- | tools/binman/test/28_pack_4gb_outside.dts | 19 | ||||
-rw-r--r-- | tools/binman/test/29_x86-rom.dts | 19 | ||||
-rw-r--r-- | tools/binman/test/30_x86-rom-me-no-desc.dts | 15 | ||||
-rw-r--r-- | tools/binman/test/31_x86-rom-me.dts | 18 | ||||
-rw-r--r-- | tools/binman/test/32_intel-vga.dts | 13 | ||||
-rw-r--r-- | tools/binman/test/33_x86-start16.dts | 13 | ||||
-rw-r--r-- | tools/binman/test/34_x86_ucode.dts | 29 | ||||
-rw-r--r-- | tools/binman/test/35_x86_single_ucode.dts | 26 | ||||
-rw-r--r-- | tools/binman/test/descriptor.bin | bin | 0 -> 4096 bytes | |||
-rwxr-xr-x | tools/binman/test/u_boot_ucode_ptr | bin | 0 -> 4175 bytes | |||
-rw-r--r-- | tools/binman/test/u_boot_ucode_ptr.c | 15 | ||||
-rw-r--r-- | tools/binman/test/u_boot_ucode_ptr.lds | 18 |
13 files changed, 203 insertions, 0 deletions
diff --git a/tools/binman/test/27_pack_4gb_no_size.dts b/tools/binman/test/27_pack_4gb_no_size.dts new file mode 100644 index 0000000000..e0b6519e75 --- /dev/null +++ b/tools/binman/test/27_pack_4gb_no_size.dts @@ -0,0 +1,18 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + sort-by-pos; + end-at-4gb; + u-boot { + pos = <0xfffffff0>; + }; + + u-boot-spl { + pos = <0xfffffff7>; + }; + }; +}; diff --git a/tools/binman/test/28_pack_4gb_outside.dts b/tools/binman/test/28_pack_4gb_outside.dts new file mode 100644 index 0000000000..ff468c7d41 --- /dev/null +++ b/tools/binman/test/28_pack_4gb_outside.dts @@ -0,0 +1,19 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + sort-by-pos; + end-at-4gb; + size = <16>; + u-boot { + pos = <0>; + }; + + u-boot-spl { + pos = <0xfffffff7>; + }; + }; +}; diff --git a/tools/binman/test/29_x86-rom.dts b/tools/binman/test/29_x86-rom.dts new file mode 100644 index 0000000000..075ede36ab --- /dev/null +++ b/tools/binman/test/29_x86-rom.dts @@ -0,0 +1,19 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + sort-by-pos; + end-at-4gb; + size = <16>; + u-boot { + pos = <0xfffffff0>; + }; + + u-boot-spl { + pos = <0xfffffff7>; + }; + }; +}; diff --git a/tools/binman/test/30_x86-rom-me-no-desc.dts b/tools/binman/test/30_x86-rom-me-no-desc.dts new file mode 100644 index 0000000000..4578f660ac --- /dev/null +++ b/tools/binman/test/30_x86-rom-me-no-desc.dts @@ -0,0 +1,15 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + sort-by-pos; + end-at-4gb; + size = <16>; + intel-me { + pos-unset; + }; + }; +}; diff --git a/tools/binman/test/31_x86-rom-me.dts b/tools/binman/test/31_x86-rom-me.dts new file mode 100644 index 0000000000..b484ab31cf --- /dev/null +++ b/tools/binman/test/31_x86-rom-me.dts @@ -0,0 +1,18 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + sort-by-pos; + end-at-4gb; + size = <0x800000>; + intel-descriptor { + }; + + intel-me { + pos-unset; + }; + }; +}; diff --git a/tools/binman/test/32_intel-vga.dts b/tools/binman/test/32_intel-vga.dts new file mode 100644 index 0000000000..1790833238 --- /dev/null +++ b/tools/binman/test/32_intel-vga.dts @@ -0,0 +1,13 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + size = <16>; + + intel-vga { + }; + }; +}; diff --git a/tools/binman/test/33_x86-start16.dts b/tools/binman/test/33_x86-start16.dts new file mode 100644 index 0000000000..2e279dee9d --- /dev/null +++ b/tools/binman/test/33_x86-start16.dts @@ -0,0 +1,13 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + size = <16>; + + x86-start16 { + }; + }; +}; diff --git a/tools/binman/test/34_x86_ucode.dts b/tools/binman/test/34_x86_ucode.dts new file mode 100644 index 0000000000..64a6c2c3d5 --- /dev/null +++ b/tools/binman/test/34_x86_ucode.dts @@ -0,0 +1,29 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + sort-by-pos; + end-at-4gb; + size = <0x200>; + u-boot-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/35_x86_single_ucode.dts b/tools/binman/test/35_x86_single_ucode.dts new file mode 100644 index 0000000000..973e97f864 --- /dev/null +++ b/tools/binman/test/35_x86_single_ucode.dts @@ -0,0 +1,26 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + sort-by-pos; + end-at-4gb; + size = <0x200>; + u-boot-with-ucode-ptr { + }; + + u-boot-dtb-with-ucode { + }; + + u-boot-ucode { + }; + }; + + microcode { + update@0 { + data = <0x12345678 0x12345679>; + }; + }; +}; diff --git a/tools/binman/test/descriptor.bin b/tools/binman/test/descriptor.bin Binary files differnew file mode 100644 index 0000000000..3d549436c2 --- /dev/null +++ b/tools/binman/test/descriptor.bin diff --git a/tools/binman/test/u_boot_ucode_ptr b/tools/binman/test/u_boot_ucode_ptr Binary files differnew file mode 100755 index 0000000000..dbfb184cec --- /dev/null +++ b/tools/binman/test/u_boot_ucode_ptr diff --git a/tools/binman/test/u_boot_ucode_ptr.c b/tools/binman/test/u_boot_ucode_ptr.c new file mode 100644 index 0000000000..434c9f4400 --- /dev/null +++ b/tools/binman/test/u_boot_ucode_ptr.c @@ -0,0 +1,15 @@ +/* + * 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. + * + * 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] + __attribute__((section(".ucode"))) = {1, 2}; diff --git a/tools/binman/test/u_boot_ucode_ptr.lds b/tools/binman/test/u_boot_ucode_ptr.lds new file mode 100644 index 0000000000..167debfe34 --- /dev/null +++ b/tools/binman/test/u_boot_ucode_ptr.lds @@ -0,0 +1,18 @@ +/* + * 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 = .; + .ucode : { + *(.ucode) + } +} |