1 #ifndef __LUNAIX_DEVICE_NUM_H
2 #define __LUNAIX_DEVICE_NUM_H
5 Device metadata field (device_def::meta)
8 | interface | function |
10 Where the interface identify how the device is connected with the processor
11 Lunaix identify the following values:
13 NON: device do not have hardware interfacing
15 SOC: device conntected through some System-on-Chip interconnect bus
16 for example, southbridge on x86 platform, AMBA for ARM's series.
18 PCI: device connected through the peripheral component interconnect bus
21 USB: device connected through the universal serial bus (USB)
23 SPI: device connected through the serial peripheral interface (SPI)
25 I2C: device connected through the IIC protocol
27 The function defines the functionality that the device is designated to
28 serve. Lunaix identify the following values:
30 PSEDUO: a pseudo device which does not backed by any hardware. (e.g.
33 CHAR: a character device, which support read/write and dealing with
34 characters. Backed hardware might exist.
36 SERIAL: a serial interface which talks
38 STORAGE: a device that is used for storage of data
40 INPUT: a device that accept external input.
42 TIME: a device that provides time related services, for example, timing
45 BUSIF: a device that is the interface or HBAs for accessing interconnect
48 TTY: a device which can be called as teletypewriter, system can use such
49 device for output into external environment
52 #define DEV_META(if_, function) (((if_) & 0xffff) << 16) | ((function) & 0xffff)
53 #define DEV_IF(meta) ((meta) >> 16)
54 #define DEV_FN(meta) (((meta) & 0xffff))
63 #define DEVFN_PSEUDO 0x0
64 #define DEVFN_CHAR 0x1
65 #define DEVFN_STORAGE 0x4
66 #define DEVFN_INPUT 0x5
67 #define DEVFN_TIME 0x6
68 #define DEVFN_BUSIF 0x7
71 #define DEV_BUILTIN 0x0
72 #define DEV_X86LEGACY 0x1
78 #define DEV_SERIAL 0x7
81 #endif /* __LUNAIX_DEVICE_NUM_H */