1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2023 Andes Technology Corporation
4 * Rick Chen, Andes Technology Corporation <rick@andestech.com>
5 */
6#include <cpu_func.h>
7#include <hang.h>
8#include <init.h>
9#include <log.h>
10#include <spl.h>
11#include <asm/global_data.h>
12#include <asm/system.h>
13
14DECLARE_GLOBAL_DATA_PTR;
15
16#if CONFIG_IS_ENABLED(RAM_SUPPORT)
17struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size)
18{
19	return (void *)(CONFIG_SPL_LOAD_FIT_ADDRESS + offset);
20}
21
22void *board_spl_fit_buffer_addr(ulong fit_size, int sectors, int bl_len)
23{
24	return spl_get_load_buffer(0, sectors * bl_len);
25}
26#endif
27