1 /*
2 * Copyright 2020 The Hafnium Authors.
3 *
4 * Use of this source code is governed by a BSD-style
5 * license that can be found in the LICENSE file or at
6 * https://opensource.org/licenses/BSD-3-Clause.
7 */
8
9 #include "hf/plat/boot_flow.h"
10 #include "hf/std.h"
11
12 /* Set by arch-specific boot-time hook. */
13 uintreg_t plat_boot_flow_fdt_addr;
14
15 /**
16 * Returns the physical address of SPMC manifest FDT blob. This was passed to
17 * SPMC cold boot entry by the SPMD.
18 */
plat_boot_flow_get_fdt_addr(void)19 paddr_t plat_boot_flow_get_fdt_addr(void)
20 {
21 return pa_init((uintpaddr_t)plat_boot_flow_fdt_addr);
22 }
23
24 /**
25 * The value returned by this function is not meaningful in context of the SPMC
26 * as there is no primary VM.
27 */
plat_boot_flow_get_kernel_arg(void)28 uintreg_t plat_boot_flow_get_kernel_arg(void)
29 {
30 return 0;
31 }
32
33 /**
34 * The value returned by this function is not meaningful in context of the SPMC
35 * as there is no initrd. Initrd begin and end values are cleared such that the
36 * check done in one_time_init (initrd_begin is non null) is false, hinting a
37 * ramdisk is not present.
38 */
plat_boot_flow_get_initrd_range(const struct fdt * fdt,paddr_t * begin,paddr_t * end)39 bool plat_boot_flow_get_initrd_range(const struct fdt *fdt, paddr_t *begin,
40 paddr_t *end)
41 {
42 (void)fdt;
43
44 *begin = pa_init(0);
45 *end = pa_init(0);
46
47 return true;
48 }
49
50 /**
51 * This wrapper is unused in context of the SPMC.
52 */
plat_boot_flow_update(struct mm_stage1_locked stage1_locked,const struct manifest * manifest,struct boot_params_update * update,struct memiter * cpio,struct mpool * ppool)53 bool plat_boot_flow_update(struct mm_stage1_locked stage1_locked,
54 const struct manifest *manifest,
55 struct boot_params_update *update,
56 struct memiter *cpio, struct mpool *ppool)
57 {
58 (void)stage1_locked;
59 (void)manifest;
60 (void)update;
61 (void)cpio;
62 (void)ppool;
63
64 return true;
65 }
66