1 /* SPDX-License-Identifier: GPL-2.0+ OR BSD-2-Clause */
3 * (C) Copyright 2007-2008 Semihalf
5 * Written by: Rafal Jaworowski <raj@semihalf.com>
11 #include <linux/types.h>
13 #define API_EINVAL 1 /* invalid argument(s) */
14 #define API_ENODEV 2 /* no device */
15 #define API_ENOMEM 3 /* no memory */
16 #define API_EBUSY 4 /* busy, occupied etc. */
17 #define API_EIO 5 /* I/O error */
18 #define API_ESYSC 6 /* syscall error */
20 typedef int (*scp_t)(int, int *, ...);
22 #define API_SIG_VERSION 1
23 #define API_SIG_MAGIC "UBootAPI"
24 #define API_SIG_MAGLEN 8
26 struct api_signature {
27 char magic[API_SIG_MAGLEN]; /* magic string */
28 uint16_t version; /* API version */
29 uint32_t checksum; /* checksum of this sig struct */
30 scp_t syscall; /* entry point to the API */
52 API_DISPLAY_DRAW_BITMAP,
57 #define MR_ATTR_FLASH 0x0001
58 #define MR_ATTR_DRAM 0x0002
59 #define MR_ATTR_SRAM 0x0003
68 unsigned long clk_bus;
69 unsigned long clk_cpu;
71 struct mem_region *mr;
72 int mr_no; /* number of memory regions */
76 * FIXME: Previously this code was:
78 * #undef CONFIG_SYS_64BIT_LBA
79 * #ifdef CONFIG_SYS_64BIT_LBA
80 * typedef u_int64_t lbasize_t;
82 * typedef unsigned long lbasize_t;
85 * But we cannot just undefine CONFIG_SYS_64BIT_LBA, because then in
86 * api/api_storage.c the type signature of lbaint_t will be different if
87 * CONFIG_SYS_64BIT_LBA is enabled for the board, which can result in various
89 * So simply define lbasize_t as an unsigned long, since this was what was done
90 * anyway for at least 13 years, but don't undefine CONFIG_SYS_64BIT_LBA.
92 typedef unsigned long lbasize_t;
94 typedef unsigned long lbastart_t;
96 #define DEV_TYP_NONE 0x0000
97 #define DEV_TYP_NET 0x0001
99 #define DEV_TYP_STOR 0x0002
100 #define DT_STOR_IDE 0x0010
101 #define DT_STOR_SCSI 0x0020
102 #define DT_STOR_USB 0x0040
103 #define DT_STOR_MMC 0x0080
104 #define DT_STOR_SATA 0x0100
106 #define DEV_STA_CLOSED 0x0000 /* invalid, closed */
107 #define DEV_STA_OPEN 0x0001 /* open i.e. active */
115 lbasize_t block_count; /* no of blocks */
116 unsigned long block_size; /* size of one block */
120 unsigned char hwaddr[6];
123 #define di_stor info.storage
124 #define di_net info.net
129 #define DISPLAY_TYPE_LCD 0x0001
130 #define DISPLAY_TYPE_VIDEO 0x0002
132 struct display_info {
134 /* screen size in pixels */
137 /* screen size in rows and columns of text */
142 #endif /* _API_PUBLIC_H_ */