1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  */
6 
7 #ifndef _HRT_HIVE_TYPES_H
8 #define _HRT_HIVE_TYPES_H
9 
10 #include "version.h"
11 
12 /* boolean data type */
13 typedef unsigned int hive_bool;
14 #define hive_false 0
15 #define hive_true  1
16 
17 typedef signed char          hive_int8;
18 typedef short                hive_int16;
19 typedef int                  hive_int32;
20 typedef long long            hive_int64;
21 
22 typedef unsigned char        hive_uint8;
23 typedef unsigned short       hive_uint16;
24 typedef unsigned int         hive_uint32;
25 typedef unsigned long long   hive_uint64;
26 
27 #define HRT_DATA_WIDTH	  32
28 #define HRT_ADDRESS_WIDTH 64
29 #define HRT_DATA_BYTES    (HRT_DATA_WIDTH / 8)
30 #define HRT_ADDRESS_BYTES (HRT_ADDRESS_WIDTH / 8)
31 #define SIZEOF_HRT_REG    (HRT_DATA_WIDTH >> 3)
32 
33 typedef hive_uint32 hrt_data;
34 typedef hive_uint64 hrt_address;
35 
36 /* use 64 bit addresses in simulation, where possible */
37 typedef hive_uint64  hive_sim_address;
38 
39 /* below is for csim, not for hrt, rename and move this elsewhere */
40 
41 typedef unsigned int hive_uint;
42 typedef hive_uint32  hive_address;
43 typedef hive_address hive_slave_address;
44 typedef hive_address hive_mem_address;
45 
46 /* MMIO devices */
47 typedef hive_uint    hive_mmio_id;
48 typedef hive_mmio_id hive_slave_id;
49 typedef hive_mmio_id hive_port_id;
50 typedef hive_mmio_id hive_master_id;
51 typedef hive_mmio_id hive_mem_id;
52 typedef hive_mmio_id hive_dev_id;
53 typedef hive_mmio_id hive_fifo_id;
54 
55 typedef hive_uint      hive_hier_id;
56 typedef hive_hier_id   hive_device_id;
57 typedef hive_device_id hive_proc_id;
58 typedef hive_device_id hive_cell_id;
59 typedef hive_device_id hive_host_id;
60 typedef hive_device_id hive_bus_id;
61 typedef hive_device_id hive_bridge_id;
62 typedef hive_device_id hive_fifo_adapter_id;
63 typedef hive_device_id hive_custom_device_id;
64 
65 typedef hive_uint hive_slot_id;
66 typedef hive_uint hive_fu_id;
67 typedef hive_uint hive_reg_file_id;
68 typedef hive_uint hive_reg_id;
69 
70 /* Streaming devices */
71 typedef hive_uint hive_outport_id;
72 typedef hive_uint hive_inport_id;
73 
74 typedef hive_uint hive_msink_id;
75 
76 /* HRT specific */
77 typedef char *hive_program;
78 typedef char *hive_function;
79 
80 #endif /* _HRT_HIVE_TYPES_H */
81