1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup raspberrypi_vc |
---|
5 | * |
---|
6 | * @brief video core support. |
---|
7 | * |
---|
8 | */ |
---|
9 | |
---|
10 | /* |
---|
11 | * Copyright (c) 2015 Yang Qiao |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * |
---|
16 | * http://www.rtems.org/license/LICENSE |
---|
17 | * |
---|
18 | */ |
---|
19 | |
---|
20 | #ifndef LIBBSP_ARM_RASPBERRYPI_VC_H |
---|
21 | #define LIBBSP_ARM_RASPBERRYPI_VC_H |
---|
22 | |
---|
23 | /** |
---|
24 | * @defgroup raspberrypi_vc Register Definitions |
---|
25 | * |
---|
26 | * @ingroup RTEMSBSPsARMRaspberryPi |
---|
27 | * |
---|
28 | * @brief Register Definitions |
---|
29 | * |
---|
30 | * @{ |
---|
31 | */ |
---|
32 | |
---|
33 | typedef struct { |
---|
34 | uint32_t width; |
---|
35 | uint32_t height; |
---|
36 | } bcm2835_get_display_size_entries; |
---|
37 | |
---|
38 | int bcm2835_mailbox_get_display_size( |
---|
39 | bcm2835_get_display_size_entries *_entries ); |
---|
40 | |
---|
41 | typedef enum { |
---|
42 | bcm2835_mailbox_pixel_order_bgr = 0, |
---|
43 | bcm2835_mailbox_pixel_order_rgb = 1 |
---|
44 | } bcm2835_pixel_order; |
---|
45 | |
---|
46 | typedef enum { |
---|
47 | bcm2835_mailbox_alpha_mode_0_opaque = 0, |
---|
48 | bcm2835_mailbox_alpha_mode_0_transparent = 1, |
---|
49 | bcm2835_mailbox_alpha_mode_ignored = 2 |
---|
50 | } bcm2835_alpha_mode; |
---|
51 | |
---|
52 | typedef struct { |
---|
53 | uint32_t xres; |
---|
54 | uint32_t yres; |
---|
55 | uint32_t xvirt; |
---|
56 | uint32_t yvirt; |
---|
57 | uint32_t depth; |
---|
58 | bcm2835_pixel_order pixel_order; |
---|
59 | bcm2835_alpha_mode alpha_mode; |
---|
60 | uint32_t voffset_x; |
---|
61 | uint32_t voffset_y; |
---|
62 | uint32_t overscan_left; |
---|
63 | uint32_t overscan_right; |
---|
64 | uint32_t overscan_top; |
---|
65 | uint32_t overscan_bottom; |
---|
66 | uint32_t base; |
---|
67 | size_t size; |
---|
68 | uint32_t pitch; |
---|
69 | } bcm2835_init_frame_buffer_entries; |
---|
70 | |
---|
71 | int bcm2835_mailbox_init_frame_buffer( |
---|
72 | bcm2835_init_frame_buffer_entries *_entries ); |
---|
73 | |
---|
74 | typedef struct { |
---|
75 | uint32_t pitch; |
---|
76 | } bcm2835_get_pitch_entries; |
---|
77 | |
---|
78 | int bcm2835_mailbox_get_pitch( bcm2835_get_pitch_entries *_entries ); |
---|
79 | |
---|
80 | typedef struct { |
---|
81 | char cmdline[ 1024 ]; |
---|
82 | } bcm2835_get_cmdline_entries; |
---|
83 | |
---|
84 | int bcm2835_mailbox_get_cmdline( bcm2835_get_cmdline_entries *_entries ); |
---|
85 | |
---|
86 | typedef enum { |
---|
87 | bcm2835_mailbox_power_udid_sd_card = 0x00000000u, |
---|
88 | bcm2835_mailbox_power_udid_uart0 = 0x00000001u, |
---|
89 | bcm2835_mailbox_power_udid_uart1 = 0x00000002u, |
---|
90 | bcm2835_mailbox_power_udid_usb_hcd = 0x00000003u, |
---|
91 | bcm2835_mailbox_power_udid_i2c0 = 0x00000004u, |
---|
92 | bcm2835_mailbox_power_udid_i2c1 = 0x00000005u, |
---|
93 | bcm2835_mailbox_power_udid_i2c2 = 0x00000006u, |
---|
94 | bcm2835_mailbox_power_udid_spi = 0x00000007u, |
---|
95 | bcm2835_mailbox_power_udid_ccp2tx = 0x00000008u, |
---|
96 | } bcm2835_power_device_id; |
---|
97 | |
---|
98 | typedef struct { |
---|
99 | bcm2835_power_device_id dev_id; |
---|
100 | uint32_t state; |
---|
101 | } bcm2835_set_power_state_entries; |
---|
102 | |
---|
103 | #define BCM2835_MAILBOX_SET_POWER_STATE_REQ_ON ( 1 << 0 ) |
---|
104 | #define BCM2835_MAILBOX_SET_POWER_STATE_REQ_WAIT ( 1 << 1 ) |
---|
105 | #define BCM2835_MAILBOX_POWER_STATE_ON ( 1 << 0 ) |
---|
106 | #define BCM2835_MAILBOX_POWER_STATE_NODEV ( 1 << 1 ) |
---|
107 | int bcm2835_mailbox_set_power_state( bcm2835_set_power_state_entries *_entries ); |
---|
108 | |
---|
109 | int bcm2835_mailbox_get_power_state( bcm2835_set_power_state_entries *_entries ); |
---|
110 | |
---|
111 | typedef struct { |
---|
112 | uint32_t base; |
---|
113 | size_t size; |
---|
114 | } bcm2835_get_arm_memory_entries; |
---|
115 | |
---|
116 | int bcm2835_mailbox_get_arm_memory( bcm2835_get_arm_memory_entries *_entries ); |
---|
117 | |
---|
118 | typedef struct { |
---|
119 | uint32_t base; |
---|
120 | size_t size; |
---|
121 | } bcm2835_get_vc_memory_entries; |
---|
122 | |
---|
123 | int bcm2835_mailbox_get_vc_memory( bcm2835_get_vc_memory_entries *_entries ); |
---|
124 | |
---|
125 | typedef struct { |
---|
126 | uint32_t fw_rev; |
---|
127 | } bcm2835_mailbox_get_fw_rev_entries; |
---|
128 | |
---|
129 | int bcm2835_mailbox_get_firmware_revision( |
---|
130 | bcm2835_mailbox_get_fw_rev_entries *_entries ); |
---|
131 | |
---|
132 | typedef struct { |
---|
133 | uint32_t spec; |
---|
134 | } bcm2835_get_board_spec_entries; |
---|
135 | |
---|
136 | int bcm2835_mailbox_get_board_model( bcm2835_get_board_spec_entries *_entries ); |
---|
137 | |
---|
138 | int bcm2835_mailbox_get_board_revision( |
---|
139 | bcm2835_get_board_spec_entries *_entries ); |
---|
140 | |
---|
141 | typedef struct { |
---|
142 | uint64_t board_serial; |
---|
143 | } bcm2835_get_board_serial_entries; |
---|
144 | |
---|
145 | int bcm2835_mailbox_get_board_serial( |
---|
146 | bcm2835_get_board_serial_entries *_entries ); |
---|
147 | |
---|
148 | typedef struct { |
---|
149 | uint32_t clock_id; |
---|
150 | uint32_t clock_rate; |
---|
151 | } bcm2835_get_clock_rate_entries; |
---|
152 | |
---|
153 | int bcm2835_mailbox_get_clock_rate( |
---|
154 | bcm2835_get_clock_rate_entries *_entries ); |
---|
155 | /** @} */ |
---|
156 | |
---|
157 | #endif /* LIBBSP_ARM_RASPBERRYPI_VC_H */ |
---|