Arthur Heymans has uploaded this change for review.

View Change

[WIP]arch/arm: Allow program loading of Linux kernels

On ARM the linux kernel takes 3 arguments:
r0 = 0
r1 = machine_type (0xffffffff if using FDT)
r2 = &fdt

To allow this, a function with a different signature needs to be used
when using a FIT payload.

Change-Id: Ie0dcc26d647941de71669345911ba288341b834b
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
---
M src/arch/arm/boot.c
1 file changed, 16 insertions(+), 2 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/35409/1
diff --git a/src/arch/arm/boot.c b/src/arch/arm/boot.c
index 9d1e4cd..fd7ba68 100644
--- a/src/arch/arm/boot.c
+++ b/src/arch/arm/boot.c
@@ -11,15 +11,29 @@
* GNU General Public License for more details.
*/

+#include <cbfs.h>
#include <arch/cache.h>
#include <program_loading.h>

void arch_prog_run(struct prog *prog)
{
void (*doit)(void *);
+ void (*doit_3)(void *, void *, void *);
+ char *program_arg = prog_entry_arg(prog);

cache_sync_instructions();

- doit = prog_entry(prog);
- doit(prog_entry_arg(prog));
+ /* The Linux kernel takes 3 dword's as argument */
+ switch (prog_cbfs_type(prog)) {
+ case CBFS_TYPE_FIT: /* Flattened image tree */
+ if (CONFIG(PAYLOAD_FIT_SUPPORT)) {
+ doit_3 = prog_entry(prog);
+ doit_3((void *)program_arg, (void *)(program_arg + sizeof(void *)),
+ (void *)(program_arg + 2 * sizeof(void *)));
+ break;
+ } /* else fall-through */
+ default:
+ doit = prog_entry(prog);
+ doit((void *)program_arg);
+ }
}

To view, visit change 35409. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie0dcc26d647941de71669345911ba288341b834b
Gerrit-Change-Number: 35409
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-MessageType: newchange