Commit 15ff24b14220b98637c95684268994c5cec95995

Authored by Silvano di Ninno
Committed by Ye Li
1 parent 11c9620cd6

TEE-329-1: OP-TEE: Allow ATF to pass boot arg to u-boot

u-boot currently needs information from ATF to know if
OP-TEE os has been loaded.
this information is transmitted via bootargs.
this patch enables saving those bootargs into a structure.

Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
(cherry picked from commit 697cfe9dbdc079b68d8b5685b728a7283c837607)

Showing 3 changed files with 35 additions and 1 deletions Side-by-side Diff

arch/arm/include/asm/arch-imx8/sys_proto.h
... ... @@ -19,5 +19,6 @@
19 19 int print_bootinfo(void);
20 20 int init_otg_power(void);
21 21 void power_off_pd_devices(const char* permanent_on_devices[], int size);
  22 +extern unsigned long rom_pointer[];
22 23 enum boot_device get_boot_device(void);
arch/arm/mach-imx/imx8/Makefile
... ... @@ -3,7 +3,7 @@
3 3 #
4 4 # SPDX-License-Identifier: GPL-2.0+
5 5 #
6   -
  6 +obj-y += lowlevel_init.o
7 7 obj-y += cpu.o
8 8 obj-y += clock.o
9 9 obj-y += fsl_mu_hal.o
arch/arm/mach-imx/imx8/lowlevel_init.S
  1 +/*
  2 + * Copyright 2017 NXP
  3 + *
  4 + * SPDX-License-Identifier: GPL-2.0+
  5 + */
  6 +
  7 +#include <config.h>
  8 +
  9 +.align 8
  10 +.global rom_pointer
  11 +rom_pointer:
  12 + .space 32
  13 +
  14 +/*
  15 + * Routine: save_boot_params (called after reset from start.S)
  16 + */
  17 +
  18 +.global save_boot_params
  19 +save_boot_params:
  20 + /* The firmware provided ATAG/FDT address can be found in r2/x0 */
  21 + adr x0, rom_pointer
  22 + stp x1, x2, [x0], #16
  23 + stp x3, x4, [x0], #16
  24 +
  25 + /* Returns */
  26 + b save_boot_params_ret
  27 +
  28 +.global restore_boot_params
  29 +restore_boot_params:
  30 + adr x0, rom_pointer
  31 + ldp x1, x2, [x0], #16
  32 + ldp x3, x4, [x0], #16
  33 + ret