summaryrefslogtreecommitdiff
path: root/include/mach/rockchip/bootrom.h
blob: 96eb147ae4090e50b18e11e2996287d45c88a4e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef __MACH_ROCKCHIP_BOOTROM_H
#define __MACH_ROCKCHIP_BOOTROM_H

#include <linux/compiler.h>
#include <linux/string.h>
#include <asm/barebox-arm.h>

struct rockchip_scratch_space {
	u32 irom[16];
};

static inline void rockchip_store_bootrom_iram(ulong membase,
                                               ulong memsize,
                                               const void *iram)
{
	void *dst = (void *)__arm_mem_scratch(membase + memsize);
	memcpy(dst, iram, sizeof(struct rockchip_scratch_space));
}

static inline const struct rockchip_scratch_space *rockchip_scratch_space(void)
{
	return arm_mem_scratch_get();
}

void rockchip_parse_bootrom_iram(const void *iram);

int rockchip_bootsource_get_active_slot(void);


#endif