2 * (C) Copyright 2007-2008 Semihalf
4 * Written by: Rafal Jaworowski <raj@semihalf.com>
6 * SPDX-License-Identifier: GPL-2.0+ BSD-2-Clause
10 #define _API_PUBLIC_H_
12 #define API_EINVAL 1 /* invalid argument(s) */
13 #define API_ENODEV 2 /* no device */
14 #define API_ENOMEM 3 /* no memory */
15 #define API_EBUSY 4 /* busy, occupied etc. */
16 #define API_EIO 5 /* I/O error */
17 #define API_ESYSC 6 /* syscall error */
19 typedef int (*scp_t)(int, int *, ...);
21 #define API_SIG_VERSION 1
22 #define API_SIG_MAGIC "UBootAPI"
23 #define API_SIG_MAGLEN 8
25 struct api_signature {
26 char magic[API_SIG_MAGLEN]; /* magic string */
27 uint16_t version; /* API version */
28 uint32_t checksum; /* checksum of this sig struct */
29 scp_t syscall; /* entry point to the API */
51 API_DISPLAY_DRAW_BITMAP,
56 #define MR_ATTR_FLASH 0x0001
57 #define MR_ATTR_DRAM 0x0002
58 #define MR_ATTR_SRAM 0x0003
67 unsigned long clk_bus;
68 unsigned long clk_cpu;
70 struct mem_region *mr;
71 int mr_no; /* number of memory regions */
74 #undef CONFIG_SYS_64BIT_LBA
75 #ifdef CONFIG_SYS_64BIT_LBA
76 typedef u_int64_t lbasize_t;
78 typedef unsigned long lbasize_t;
80 typedef unsigned long lbastart_t;
82 #define DEV_TYP_NONE 0x0000
83 #define DEV_TYP_NET 0x0001
85 #define DEV_TYP_STOR 0x0002
86 #define DT_STOR_IDE 0x0010
87 #define DT_STOR_SCSI 0x0020
88 #define DT_STOR_USB 0x0040
89 #define DT_STOR_MMC 0x0080
90 #define DT_STOR_SATA 0x0100
92 #define DEV_STA_CLOSED 0x0000 /* invalid, closed */
93 #define DEV_STA_OPEN 0x0001 /* open i.e. active */
101 lbasize_t block_count; /* no of blocks */
102 unsigned long block_size; /* size of one block */
106 unsigned char hwaddr[6];
109 #define di_stor info.storage
110 #define di_net info.net
115 #define DISPLAY_TYPE_LCD 0x0001
116 #define DISPLAY_TYPE_VIDEO 0x0002
118 struct display_info {
120 /* screen size in pixels */
123 /* screen size in rows and columns of text */
128 #endif /* _API_PUBLIC_H_ */