blob: c215e6b892a39a626783a49d1e3e099e2da984c3 [file] [log] [blame]
Tom Rinidec7ea02024-05-20 13:35:03 -06001/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * (C) Copyright 2022 - Analog Devices, Inc.
4 *
5 * Written and/or maintained by Timesys Corporation
6 *
7 * Contact: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
8 * Contact: Greg Malysa <greg.malysa@timesys.com>
9 */
10#ifndef ARCH_ADI_SC5XX_SPL_H
11#define ARCH_ADI_SC5XX_SPL_H
12
13#include <linux/types.h>
14
15struct adi_boot_args {
16 phys_addr_t addr;
17 u32 flags;
18 u32 cmd;
19};
20
21extern u32 bmode;
22
23/**
24 * This table stores the arguments to the rom boot function per bootmode,
25 * and it is populated per SoC in the corresponding SoC support file (sc7x, sc58x,
26 * and so on).
27 */
28extern const struct adi_boot_args adi_rom_boot_args[8];
29
30/**
31 * Struct layout for the boot config is also specific to an SoC, so you should
32 * only access it inside an SoC-specific boot hook function, which will be called
33 * from the boot rom while going from SPL to proper u-boot
34 */
35struct ADI_ROM_BOOT_CONFIG;
36int32_t adi_rom_boot_hook(struct ADI_ROM_BOOT_CONFIG *cfg, int32_t cause);
37
38typedef void (*adi_rom_boot_fn)(void *address, uint32_t flags, int32_t count,
39 void *hook, uint32_t command);
40
41extern adi_rom_boot_fn adi_rom_boot;
42
43#endif