xref: /OK3568_Linux_fs/u-boot/api/README (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunU-Boot machine/arch independent API for external apps
2*4882a593Smuzhiyun=====================================================
3*4882a593Smuzhiyun
4*4882a593Smuzhiyun1.  Main assumptions
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun  - there is a single entry point (syscall) to the API
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun  - per current design the syscall is a C-callable function in the U-Boot
9*4882a593Smuzhiyun    text, which might evolve into a real syscall using machine exception trap
10*4882a593Smuzhiyun    once this initial version proves functional
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun  - the consumer app is responsible for producing appropriate context (call
13*4882a593Smuzhiyun    number and arguments)
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun  - upon entry, the syscall dispatches the call to other (existing) U-Boot
16*4882a593Smuzhiyun    functional areas like networking or storage operations
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun  - consumer application will recognize the API is available by searching
19*4882a593Smuzhiyun    a specified (assumed by convention) range of address space for the
20*4882a593Smuzhiyun    signature
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun  - the U-Boot integral part of the API is meant to be thin and non-intrusive,
23*4882a593Smuzhiyun    leaving as much processing as possible on the consumer application side,
24*4882a593Smuzhiyun    for example it doesn't keep states, but relies on hints from the app and
25*4882a593Smuzhiyun    so on
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun  - optional (CONFIG_API)
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun2. Calls
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun  - console related (getc, putc, tstc etc.)
33*4882a593Smuzhiyun  - system (reset, platform info)
34*4882a593Smuzhiyun  - time (delay, current)
35*4882a593Smuzhiyun  - env vars (enumerate all, get, set)
36*4882a593Smuzhiyun  - devices (enumerate all, open, close, read, write); currently two classes
37*4882a593Smuzhiyun    of devices are recognized and supported: network and storage (ide, scsi,
38*4882a593Smuzhiyun    usb etc.)
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun3. Structure overview
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun  - core API, integral part of U-Boot, mandatory
44*4882a593Smuzhiyun    - implements the single entry point (mimics UNIX syscall)
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun  - glue
47*4882a593Smuzhiyun    - entry point at the consumer side, allows to make syscall, mandatory
48*4882a593Smuzhiyun      part
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun    - helper conveniency wrappers so that consumer app does not have to use
51*4882a593Smuzhiyun      the syscall directly, but in a more friendly manner (a la libc calls),
52*4882a593Smuzhiyun      optional part
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun  - consumer application
55*4882a593Smuzhiyun    - calls directly, or leverages the provided glue mid-layer
56