Tobias Diedrich (ranma+coreboot(a)tdiedrich.de) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18353
-gerrit
commit be651ab1f5db2d21dafc11cae83568a11056ec0e
Author: Tobias Diedrich <ranma+openocd(a)tdiedrich.de>
Date: Sun Feb 12 22:58:37 2017 +0100
southbridge/intel/bd82x6x: Use correct EHCI address for USBDEBUG
The bd82x6x hardcoded EHCI bar adresses (0xe8000[04]00) don't match the
CONFIG_EHCI_BAR default of 0xfef00000.
This copies the defines from southbridge/intel/lynxpoint/early_usb.c
so that the early EHCI bar setup is using CONFIG_EHCI_BAR and
CONFIG_USBDEBUG_HCD_INDEX to determine the correct bar addresses.
Change-Id: I6ee6089c9e5f3bc5f457eae47c18c2473fa42571
Signed-off-by: Tobias Diedrich <ranma+coreboot(a)tdiedrich.de>
---
src/southbridge/intel/bd82x6x/early_usb_mrc.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/southbridge/intel/bd82x6x/early_usb_mrc.c b/src/southbridge/intel/bd82x6x/early_usb_mrc.c
index 8fac3c7..5c2b696 100644
--- a/src/southbridge/intel/bd82x6x/early_usb_mrc.c
+++ b/src/southbridge/intel/bd82x6x/early_usb_mrc.c
@@ -20,8 +20,16 @@
#include <device/pci_def.h>
#include "pch.h"
-#define PCH_EHCI1_TEMP_BAR0 0xe8000000
-#define PCH_EHCI2_TEMP_BAR0 0xe8000400
+/* HCD_INDEX==2 selects 0:1a.0 (PCH_EHCI2), any other index
+ * selects 0:1d.0 (PCH_EHCI1) for usbdebug use.
+ */
+#if CONFIG_USBDEBUG_HCD_INDEX != 2
+#define PCH_EHCI1_TEMP_BAR0 CONFIG_EHCI_BAR
+#define PCH_EHCI2_TEMP_BAR0 (PCH_EHCI1_TEMP_BAR0 + 0x400)
+#else
+#define PCH_EHCI2_TEMP_BAR0 CONFIG_EHCI_BAR
+#define PCH_EHCI1_TEMP_BAR0 (PCH_EHCI2_TEMP_BAR0 + 0x400)
+#endif
/*
* Setup USB controller MMIO BAR to prevent the
Mathias Krause (minipli(a)googlemail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18336
-gerrit
commit 2dadc1faa0563da5978d84233847de998b34e890
Author: Mathias Krause <minipli(a)googlemail.com>
Date: Sat Feb 11 22:47:04 2017 +0100
libpayload: x86/head - implement argc/argv handling
Implement the argc/argv passing as described in coreboot’s payload API:
http://www.coreboot.org/Payload_API
While at it, give the code some love by not needlessly trashing register
values.
Change-Id: Ib830f2c67b631b7216843203cefd55d9bb780d83
Signed-off-by: Mathias Krause <minipli(a)googlemail.com>
---
payloads/libpayload/arch/x86/head.S | 40 ++++++++++++++++++++-----------------
1 file changed, 22 insertions(+), 18 deletions(-)
diff --git a/payloads/libpayload/arch/x86/head.S b/payloads/libpayload/arch/x86/head.S
index fa9bb73..698df43 100644
--- a/payloads/libpayload/arch/x86/head.S
+++ b/payloads/libpayload/arch/x86/head.S
@@ -28,7 +28,7 @@
*/
.code32
- .global _entry, _leave
+ .global _entry
.text
.align 4
@@ -55,6 +55,11 @@ mb_header:
.long _end
.long _init
+#define CB_MAGIC_VALUE 0x12345678
+#define CB_MAGIC 0x04
+#define CB_ARGV 0x08
+#define CB_ARGC 0x10
+
/*
* This function saves off the previous stack and switches us to our
* own execution environment.
@@ -63,34 +68,33 @@ _init:
/* No interrupts, please. */
cli
- /* There is a bunch of stuff missing here to take arguments on the stack
- * See http://www.coreboot.org/Payload_API and exec.S.
- */
- /* Store current stack pointer. */
- movl %esp, %esi
-
/* Store EAX and EBX */
- movl %eax,loader_eax
- movl %ebx,loader_ebx
+ movl %eax, loader_eax
+ movl %ebx, loader_ebx
- /* Setup new stack. */
- movl $_stack, %ebx
+ /* Copy argv[] and argc as demanded by the Payload API,
+ * see http://www.coreboot.org/Payload_API and exec.S.
+ */
+ cmpl $CB_MAGIC_VALUE, CB_MAGIC(%esp)
+ jne 1f
- movl %ebx, %esp
+ movl CB_ARGV(%esp), %eax
+ movl %eax, main_argv
- /* Save old stack pointer. */
- pushl %esi
+ movl CB_ARGC(%esp), %eax
+ movl %eax, main_argc
+1:
+ /* Store current stack pointer and set up new stack. */
+ movl %esp, _stack
+ movl $(_stack - 4), %esp
/* Let's rock. */
call start_main
/* %eax has the return value - pass it on unmolested */
_leave:
- /* Get old stack pointer. */
- popl %ebx
-
/* Restore old stack. */
- movl %ebx, %esp
+ movl 4(%esp), %esp
/* Return to the original context. */
ret
Mathias Krause (minipli(a)googlemail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18335
-gerrit
commit c5eae917bbd2305b369e2d084d33fa1d72c408b1
Author: Mathias Krause <minipli(a)googlemail.com>
Date: Sat Feb 11 21:02:08 2017 +0100
libpayload: x86/exec - simplify and robustify the code
Simplify the code by directly using the arguments on the stack as base
pointer relative memory references, instead of loading them into
intermediate registers first.
Make it more robust by preserving all callee safed registers mandated by
the C calling convention (and only those), namely EBP, EBX, ESI and EDI.
Don't assume anything about the register state when the called function
returns -- beside the segment registers and the stack pointer to be
still the same as before the call.
Change-Id: I383d6ccefc5b3d5cca37a1c9b638c231bbc48aa8
Signed-off-by: Mathias Krause <minipli(a)googlemail.com>
---
payloads/libpayload/arch/x86/exec.S | 59 +++++++++++++------------------------
1 file changed, 20 insertions(+), 39 deletions(-)
diff --git a/payloads/libpayload/arch/x86/exec.S b/payloads/libpayload/arch/x86/exec.S
index 54c83f6..f5cb0e3 100644
--- a/payloads/libpayload/arch/x86/exec.S
+++ b/payloads/libpayload/arch/x86/exec.S
@@ -37,67 +37,48 @@
.text
.global i386_do_exec
- .type i386_do_exec,@function
+ .type i386_do_exec,@function
i386_do_exec:
pushl %ebp
movl %esp, %ebp
- pushl %eax
-
- /* Put the run address in %eax */
- movl 8(%ebp), %eax
-
- /* Save off the rest of the registers */
+ /* Save the remaining callee preserved registers */
+ pushl %ebx
pushl %esi
- pushl %ecx
- pushl %ebp
+ pushl %edi
/* Push argc and argv on to the stack.
*
* We need to put a dummy value inbetween, as argc should be at offset
* 0x10, according to the payload API.
*/
-
- movl 12(%ebp), %esi
- movl 16(%ebp), %ecx
-
- pushl %esi
+ pushl 12(%ebp)
pushl $0
- pushl %ecx
+ pushl 16(%ebp)
- /* Move a "magic" number on the stack - the other
- * payload will use this as a clue that the argc
- * and argv are sane
+ /* Push a "magic" number on the stack - the other payload will use this
+ * as a clue that the argc and argv values on the stack are sane.
*/
-
- movl $0x12345678, %ecx
- pushl %ecx
+ pushl $0x12345678
/* Jump to the code */
- call *%eax
-
+ call *8(%ebp)
/* %eax has the return value */
- /* Skip over the argc/argv stuff still on the stack */
- addl $12, %esp
+ /* Skip over the argc/argv stuff still on the stack.
+ * Don't assume %ebp is sane, here. Restore it from the stack.
+ */
+ addl $0x10, %esp
- /* Get back %ebp */
+ /* Restore the saved registers */
+ popl %edi
+ popl %esi
+ popl %ebx
popl %ebp
- /* Get the pointer to the return value
- * and save the return value in it
- */
-
- movl 20(%ebp), %ecx
+ /* Get pointer to return value and save the return value in it. */
+ movl 16(%esp), %ecx
movl %eax, (%ecx)
- /* Get the rest of the saved registers */
- popl %ecx
- popl %esi
- popl %eax
-
- /* Restore the stack pointer */
- movl %ebp,%esp
- popl %ebp
ret
Mathias Krause (minipli(a)googlemail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18334
-gerrit
commit fee9a47058beafa7568e3fc2f3457cefc0f7280d
Author: Mathias Krause <minipli(a)googlemail.com>
Date: Tue Feb 7 19:03:29 2017 +0100
libpayload: x86/main - propagate return value of main()
According to coreboot’s payload API [1], the called payload should be
able to return a value via %eax. Support this by changing the prototype
of start_main() and pass on the return value of main() to the caller
instead of discarding it.
[1] https://www.coreboot.org/Payload_API
Change-Id: I8442faea19cc8e04487092f8e61aa4e5cba3ba76
Signed-off-by: Mathias Krause <minipli(a)googlemail.com>
---
payloads/libpayload/arch/x86/main.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/payloads/libpayload/arch/x86/main.c b/payloads/libpayload/arch/x86/main.c
index fbd4dc4..f9a5e2c 100644
--- a/payloads/libpayload/arch/x86/main.c
+++ b/payloads/libpayload/arch/x86/main.c
@@ -42,8 +42,8 @@ char *main_argv[MAX_ARGC_COUNT];
* This is our C entry function - set up the system
* and jump into the payload entry point.
*/
-void start_main(void);
-void start_main(void)
+int start_main(void);
+int start_main(void)
{
extern int main(int argc, char **argv);
@@ -67,10 +67,9 @@ void start_main(void)
* In the future we may care about the return value.
*/
- (void) main(main_argc, (main_argc != 0) ? main_argv : NULL);
-
/*
- * Returning here will go to the _leave function to return
+ * Returning from main() will go to the _leave function to return
* us to the original context.
*/
+ return main(main_argc, (main_argc != 0) ? main_argv : NULL);
}
Mathias Krause (minipli(a)googlemail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18333
-gerrit
commit 15f17273ea9a768fc2f8c7455d7019ec69cc04f2
Author: Mathias Krause <minipli(a)googlemail.com>
Date: Sat Feb 11 22:34:46 2017 +0100
libpayload: x86/exec - fix argc/argv value passing
According to coreboot’s payload API [1] the argc value should be passed
at stack offset 0x10, so we need to push a dummy value to comply to the
API.
[1] https://www.coreboot.org/Payload_API
Change-Id: Id20424185a5bf7e4d94de1886a2cece3f3968371
Signed-off-by: Mathias Krause <minipli(a)googlemail.com>
---
payloads/libpayload/arch/x86/exec.S | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/payloads/libpayload/arch/x86/exec.S b/payloads/libpayload/arch/x86/exec.S
index 7d89cc0..54c83f6 100644
--- a/payloads/libpayload/arch/x86/exec.S
+++ b/payloads/libpayload/arch/x86/exec.S
@@ -53,12 +53,17 @@ i386_do_exec:
pushl %ecx
pushl %ebp
- /* Push the argc and argv pointers on to the stack */
+ /* Push argc and argv on to the stack.
+ *
+ * We need to put a dummy value inbetween, as argc should be at offset
+ * 0x10, according to the payload API.
+ */
movl 12(%ebp), %esi
movl 16(%ebp), %ecx
pushl %esi
+ pushl $0
pushl %ecx
/* Move a "magic" number on the stack - the other
Mathias Krause (minipli(a)googlemail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18332
-gerrit
commit 7b805290b5dd894edda4885adbf0d263f1857fab
Author: Mathias Krause <minipli(a)googlemail.com>
Date: Tue Feb 7 19:47:16 2017 +0100
libpayload: x86/exec - fix return value passing
The pointer to write the return value to is in %ecx, not %eax. Writing
to (%eax) leads to memory corruptions as %eax holds the return value,
e.g. would write zero to address zero for a "successful" returning
payload.
Change-Id: I82df27ae89a9e3d25f479ebdda2b50ea57565459
Signed-off-by: Mathias Krause <minipli(a)googlemail.com>
---
payloads/libpayload/arch/x86/exec.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/payloads/libpayload/arch/x86/exec.S b/payloads/libpayload/arch/x86/exec.S
index c7595e9..7d89cc0 100644
--- a/payloads/libpayload/arch/x86/exec.S
+++ b/payloads/libpayload/arch/x86/exec.S
@@ -85,7 +85,7 @@ i386_do_exec:
*/
movl 20(%ebp), %ecx
- movl %eax, (%eax)
+ movl %eax, (%ecx)
/* Get the rest of the saved registers */
popl %ecx
Mathias Krause (minipli(a)googlemail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18331
-gerrit
commit 77d616f8f586024333ae9c6db22c085878bec979
Author: Mathias Krause <minipli(a)googlemail.com>
Date: Tue Feb 7 18:59:27 2017 +0100
libpayload: x86/exec - fix libpayload API magic value
According to coreboot’s payload API [1] the magic value passed to the
payload should be 0x12345678, not 12345678. Fix that.
[1] https://www.coreboot.org/Payload_API
Change-Id: I10a7f7b1a4aec100416c5e7e4ba7f8add10ef5c5
Signed-off-by: Mathias Krause <minipli(a)googlemail.com>
---
payloads/libpayload/arch/x86/exec.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/payloads/libpayload/arch/x86/exec.S b/payloads/libpayload/arch/x86/exec.S
index b632a55..c7595e9 100644
--- a/payloads/libpayload/arch/x86/exec.S
+++ b/payloads/libpayload/arch/x86/exec.S
@@ -66,7 +66,7 @@ i386_do_exec:
* and argv are sane
*/
- movl $12345678, %ecx
+ movl $0x12345678, %ecx
pushl %ecx
/* Jump to the code */
Denis 'GNUtoo' Carikli (GNUtoo(a)no-log.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18352
-gerrit
commit f52f4ac1f8dd5b2db641caf72cab0c5d0c857e2e
Author: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org>
Date: Wed Sep 14 14:41:36 2016 +0200
payloads/external/GRUB2: Add "git revision" to the GRUB2 version menu
This change is based on the following commit:
3aa91dc payloads/seabios: Add "git revision" to the SeaBIOS version menu
Change-Id: I9987e3673e70b5cb20173d1ddff6060f42a5374a
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo(a)no-log.org>
---
payloads/external/GRUB2/Kconfig | 16 ++++++++++++++++
payloads/external/GRUB2/Makefile | 2 ++
payloads/external/Makefile.inc | 2 ++
3 files changed, 20 insertions(+)
diff --git a/payloads/external/GRUB2/Kconfig b/payloads/external/GRUB2/Kconfig
index c9f07d5..656f7c9 100644
--- a/payloads/external/GRUB2/Kconfig
+++ b/payloads/external/GRUB2/Kconfig
@@ -9,8 +9,24 @@ config GRUB2_MASTER
help
Newest GRUB2 version
+config GRUB2_REVISION
+ bool "git revision"
+ help
+ Select this option if you have a specific commit or branch
+ that you want to use as the revision from which to
+ build GRUB2.
+
+ You will be able to specify the name of a branch or a commit id
+ later.
endchoice
+config GRUB2_REVISION_ID
+ string "Insert a commit's SHA-1 or a branch name"
+ depends on GRUB2_REVISION
+ default "origin/master"
+ help
+ The commit's SHA-1 or branch name of the revision to use.
+
config GRUB2_EXTRA_MODULES
string "Extra modules to include in GRUB image"
help
diff --git a/payloads/external/GRUB2/Makefile b/payloads/external/GRUB2/Makefile
index c257f0e..018cdad 100644
--- a/payloads/external/GRUB2/Makefile
+++ b/payloads/external/GRUB2/Makefile
@@ -1,5 +1,7 @@
TAG-$(CONFIG_GRUB2_MASTER)=
+TAG-$(CONFIG_GRUB2_REVISION)=$(CONFIG_GRUB2_REVISION_ID)
NAME-$(CONFIG_GRUB2_MASTER)=HEAD
+NAME-$(CONFIG_GRUB2_REVISION)=$(CONFIG_GRUB2_REVISION_ID)
project_git_repo=git://git.sv.gnu.org/grub.git
project_dir=grub2
diff --git a/payloads/external/Makefile.inc b/payloads/external/Makefile.inc
index 1c0d38c..921c840 100644
--- a/payloads/external/Makefile.inc
+++ b/payloads/external/Makefile.inc
@@ -134,6 +134,8 @@ grub2:
CC="$(CC_x86_32)" LD="$(LD_x86_32)" OBJDUMP="$(OBJDUMP_x86_32)" \
OBJCOPY="$(OBJCOPY_x86_32)" STRIP="$(STRIP_x86_32)" \
CONFIG_GRUB2_MASTER=$(CONFIG_GRUB2_MASTER) \
+ CONFIG_GRUB2_REVISION=$(CONFIG_GRUB2_REVISION) \
+ CONFIG_GRUB2_REVISION_ID=$(CONFIG_GRUB2_REVISION_ID) \
CONFIG_GRUB2_EXTRA_MODULES=$(CONFIG_GRUB2_EXTRA_MODULES)
payloads/external/GRUB2/grub2/build/default_payload.elf: grub2