summaryrefslogtreecommitdiffstats
path: root/meta-sota-minnowboard/recipes-bsp
diff options
context:
space:
mode:
Diffstat (limited to 'meta-sota-minnowboard/recipes-bsp')
-rw-r--r--meta-sota-minnowboard/recipes-bsp/intel-fsp/intel-fsp-native.bb17
-rw-r--r--meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch138
-rw-r--r--meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2015.07.bb35
3 files changed, 190 insertions, 0 deletions
diff --git a/meta-sota-minnowboard/recipes-bsp/intel-fsp/intel-fsp-native.bb b/meta-sota-minnowboard/recipes-bsp/intel-fsp/intel-fsp-native.bb
new file mode 100644
index 0000000..6f87ffb
--- /dev/null
+++ b/meta-sota-minnowboard/recipes-bsp/intel-fsp/intel-fsp-native.bb
@@ -0,0 +1,17 @@
1S = "${WORKDIR}/git"
2
3LICENSE = "IntelFSPRULAC"
4LIC_FILES_CHKSUM = "file://${S}/FspKitProductionRULACLicense.pdf;md5=37802f528bc83ad078606e5932e93e02"
5
6SRC_URI = "git://github.com/IntelFsp/FSP.git;branch=BayTrail"
7SRCREV="187409120bcba0ccc3fb514deb3bb923e9723c0c"
8
9inherit native
10
11FILES_${PN} = "${datadir}/IntelFsp/BayTrailFSP.fd"
12
13do_install() {
14 install -d ${D}${datadir}/IntelFsp
15 install -m 0644 ${S}/BayTrailFspBinPkg/FspBin/BayTrailFSP.fd ${D}${datadir}/IntelFsp/BayTrailFSP.fd
16 install -m 0644 ${S}/BayTrailFspBinPkg/Vbios/Vga.dat ${D}${datadir}/IntelFsp/Vga.dat
17}
diff --git a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch
new file mode 100644
index 0000000..7540b74
--- /dev/null
+++ b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch
@@ -0,0 +1,138 @@
1From ab0d7e270d89f6eb99582197d2d58bf60c9c3d26 Mon Sep 17 00:00:00 2001
2From: Anton Gerasimov <anton@advancedtelematic.com>
3Date: Thu, 15 Sep 2016 16:49:32 +0200
4Subject: [PATCH 2/2] Replace wraps with built-in code to remove dependency on
5 multilib
6
7---
8 arch/x86/config.mk | 2 --
9 arch/x86/lib/gcc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++---------
10 2 files changed, 87 insertions(+), 19 deletions(-)
11
12diff --git a/arch/x86/config.mk b/arch/x86/config.mk
13index 999143e..139576e 100644
14--- a/arch/x86/config.mk
15+++ b/arch/x86/config.mk
16@@ -22,5 +22,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden
17 PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions -m elf_i386
18
19 LDFLAGS_FINAL += --gc-sections -pie
20-LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3
21-LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3
22diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c
23index 497ad75..c321b11 100644
24--- a/arch/x86/lib/gcc.c
25+++ b/arch/x86/lib/gcc.c
26@@ -19,22 +19,92 @@
27
28 #ifdef __GNUC__
29
30-/*
31- * GCC's libgcc handling is quite broken. While the libgcc functions
32- * are always regparm(0) the code that calls them uses whatever the
33- * compiler call specifies. Therefore we need a wrapper around those
34- * functions. See gcc bug PR41055 for more information.
35- */
36-#define WRAP_LIBGCC_CALL(type, name) \
37- type __normal_##name(type a, type b) __attribute__((regparm(0))); \
38- type __wrap_##name(type a, type b); \
39- type __attribute__((no_instrument_function)) \
40- __wrap_##name(type a, type b) \
41- { return __normal_##name(a, b); }
42-
43-WRAP_LIBGCC_CALL(long long, __divdi3)
44-WRAP_LIBGCC_CALL(unsigned long long, __udivdi3)
45-WRAP_LIBGCC_CALL(long long, __moddi3)
46-WRAP_LIBGCC_CALL(unsigned long long, __umoddi3)
47+#include <stdint.h>
48+#include <stddef.h>
49+
50+uint64_t __udivmoddi4 ( uint64_t num,
51+ uint64_t den,
52+ uint64_t *rem_p )
53+{
54+ uint64_t quot = 0, qbit = 1;
55+
56+ if ( den == 0 ) {
57+ return 1/((unsigned)den); /* Intentional divide by zero, without
58+ triggering a compiler warning which
59+ would abort the build */
60+ }
61+
62+ /* Left-justify denominator and count shift */
63+ while ( (int64_t)den >= 0 ) {
64+ den <<= 1;
65+ qbit <<= 1;
66+ }
67+
68+ while ( qbit ) {
69+ if ( den <= num ) {
70+ num -= den;
71+ quot += qbit;
72+ }
73+ den >>= 1;
74+ qbit >>= 1;
75+ }
76+
77+ if ( rem_p )
78+ *rem_p = num;
79+
80+ return quot;
81+}
82+uint64_t __udivdi3( uint64_t num, uint64_t den )
83+{
84+ return __udivmoddi4(num, den, NULL);
85+}
86+
87+uint64_t __umoddi3 ( uint64_t num, uint64_t den )
88+{
89+ uint64_t v;
90+
91+ (void) __udivmoddi4(num, den, &v);
92+ return v;
93+}
94+
95+int64_t __divmoddi4 ( int64_t num,
96+ int64_t den,
97+ int64_t* rem_p )
98+{
99+ int minus = 0;
100+ int64_t v;
101+
102+ if ( num < 0 ) {
103+ num = -num;
104+ minus = 1;
105+ }
106+ if ( den < 0 ) {
107+ den = -den;
108+ minus ^= 1;
109+ }
110+
111+ v = __udivmoddi4(num, den, (uint64_t *)rem_p);
112+ if ( minus ) {
113+ v = -v;
114+ if ( rem_p )
115+ *rem_p = -(*rem_p);
116+ }
117+
118+ return v;
119+}
120+
121+
122+int64_t __moddi3 (int64_t num, int64_t den)
123+{
124+ int64_t v;
125+
126+ (void) __divmoddi4(num, den, &v);
127+ return v;
128+}
129+
130+int64_t __divdi3(int64_t num, int64_t den)
131+{
132+ return __divmoddi4(num, den, NULL);
133+}
134
135 #endif
136--
1372.9.3
138
diff --git a/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2015.07.bb b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2015.07.bb
new file mode 100644
index 0000000..28b9369
--- /dev/null
+++ b/meta-sota-minnowboard/recipes-bsp/u-boot/u-boot-ota_2015.07.bb
@@ -0,0 +1,35 @@
1include recipes-bsp/u-boot/u-boot.inc
2DEPENDS += "dtc-native intel-fsp-native"
3
4LICENSE = "GPLv2+"
5LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95"
6
7# This revision corresponds to the tag "v2015.07"
8# We use the revision in order to avoid having to fetch it from the
9# repo during parse
10SRCREV = "baba2f57e8f4ed3fa67fe213d22da0de5e00f204"
11
12SRC_URI += "file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \
13 http://firmware.intel.com/sites/default/files/2014-WW42.4-MinnowBoardMax.73-64-bit.bin_Release.zip \
14 "
15
16# Hashes for 2014-WW42.4-MinnowBoardMax.73-64-bit.bin_Release.zip
17SRC_URI[md5sum] = "1a4256c64a0d846b81d2adf7ce07cce5"
18SRC_URI[sha256sum] = "883b1399b89e8e13033367e911a1e69423dffa9a6c4b5d306fc070d9ed7412b7"
19
20PV = "v2015.07+git${SRCPV}"
21
22EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline BUILD_ROM=y"
23
24UBOOT_SUFFIX = "rom"
25
26do_configure_prepend() {
27 make ${UBOOT_MACHINE}
28 make tools
29 ./tools/ifdtool -x ${WORKDIR}/MNW2MAX1.X64.0073.R02.1409160934.bin
30 cp flashregion_0_flashdescriptor.bin ./board/intel/minnowmax/descriptor.bin
31 cp flashregion_2_intel_me.bin ./board/intel/minnowmax/me.bin
32 cp ${STAGING_DIR_NATIVE}/${datadir}/IntelFsp/BayTrailFSP.fd ./board/intel/minnowmax/fsp.bin
33 cp ${STAGING_DIR_NATIVE}/${datadir}/IntelFsp/Vga.dat ./board/intel/minnowmax/vga.bin
34}
35