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