1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3 * Copyright (c) 2019 NVIDIA Corporation. All rights reserved.
4 */
5
6 #ifndef _TEGRA_CBOOT_H_
7 #define _TEGRA_CBOOT_H_
8
9 #include <linux/errno.h>
10 #include <linux/types.h>
11 #include <net.h>
12
13 #ifdef CONFIG_ARM64
14
15 extern unsigned long cboot_boot_x0;
16
17 void cboot_save_boot_params(unsigned long x0, unsigned long x1,
18 unsigned long x2, unsigned long x3);
19 int cboot_dram_init(void);
20 int cboot_dram_init_banksize(void);
21 ulong cboot_get_usable_ram_top(ulong total_size);
22 int cboot_get_ethaddr(const void *fdt, uint8_t mac[ETH_ALEN]);
23 #else
cboot_save_boot_params(unsigned long x0,unsigned long x1,unsigned long x2,unsigned long x3)24 static inline void cboot_save_boot_params(unsigned long x0, unsigned long x1,
25 unsigned long x2, unsigned long x3)
26 {
27 }
28
cboot_dram_init(void)29 static inline int cboot_dram_init(void)
30 {
31 return -ENOSYS;
32 }
33
cboot_dram_init_banksize(void)34 static inline int cboot_dram_init_banksize(void)
35 {
36 return -ENOSYS;
37 }
38
cboot_get_usable_ram_top(ulong total_size)39 static inline ulong cboot_get_usable_ram_top(ulong total_size)
40 {
41 return 0;
42 }
43
cboot_get_ethaddr(const void * fdt,uint8_t mac[ETH_ALEN])44 static inline int cboot_get_ethaddr(const void *fdt, uint8_t mac[ETH_ALEN])
45 {
46 return -ENOSYS;
47 }
48 #endif
49
50 #endif
51