1 #ifndef __LUNAIX_DEVICE_NUM_H
2 #define __LUNAIX_DEVICE_NUM_H
4 #include <lunaix/types.h>
7 Device metadata field (device_def::meta)
10 | interface | function |
12 Where the interface identify how the device is connected with the processor
13 Lunaix identify the following values:
15 NON: device do not have hardware interfacing
17 SOC: device conntected through some System-on-Chip interconnect bus
18 for example, southbridge on x86 platform, AMBA for ARM's series.
20 PCI: device connected through the peripheral component interconnect bus
23 USB: device connected through the universal serial bus (USB)
25 SPI: device connected through the serial peripheral interface (SPI)
27 I2C: device connected through the IIC protocol
29 FMW: device is a system board firmware
31 The function defines the functionality that the device is designated to
32 serve. Lunaix identify the following values:
34 PSEDUO: a pseudo device which does not backed by any hardware. (e.g.
37 CHAR: a character device, which support read/write and dealing with
38 characters. Backed hardware might exist.
40 SERIAL: a serial interface which talks
42 STORAGE: a device that is used for storage of data
44 INPUT: a device that accept external input.
46 TIME: a device that provides time related services, for example, timing
49 BUSIF: a device that is the interface or HBAs for accessing interconnect
52 TTY: a device which can be called as teletypewriter, system can use such
53 device for output into external environment
55 CFG: device that provide configuration service to the system or other
61 #define DEV_FNGRP(if_, function) \
62 (((if_) & 0xffff) << 16) | ((function) & 0xffff)
63 #define DEV_UNIQUE(devkind, variant) \
64 (((devkind) & 0xffff) << 16) | ((variant) & 0xffff)
65 #define DEV_KIND_FROM(unique) ((unique) >> 16)
66 #define DEV_VAR_FROM(unique) ((unique) & 0xffff)
68 #define DEV_IF(fngrp) ((fngrp) >> 16)
69 #define DEV_FN(fngrp) (((fngrp) & 0xffff))
79 #define DEVFN_PSEUDO 0x0
80 #define DEVFN_CHAR 0x1
81 #define DEVFN_STORAGE 0x4
82 #define DEVFN_INPUT 0x5
83 #define DEVFN_TIME 0x6
84 #define DEVFN_BUSIF 0x7
86 #define DEVFN_DISP 0x9
90 #define DEV_BUILTIN_NULL 0
91 #define DEV_BUILTIN_ZERO 1
92 #define DEV_BUILTIN_KMSG 2
100 #define DEV_UART16550 7
103 #define DEV_TIMER_APIC 0
104 #define DEV_TIMER_HEPT 1
128 #endif /* __LUNAIX_DEVICE_NUM_H */