RTEMS 7.0-rc1
Loading...
Searching...
No Matches
vc.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0+-with-RTEMS-exception */
2
12/*
13 * Copyright (c) 2015 Yang Qiao
14 *
15 * The license and distribution terms for this file may be
16 * found in the file LICENSE in this distribution or at
17 *
18 * http://www.rtems.org/license/LICENSE
19 *
20 */
21
22#ifndef LIBBSP_ARM_RASPBERRYPI_VC_H
23#define LIBBSP_ARM_RASPBERRYPI_VC_H
24
35typedef struct {
36 uint32_t width;
37 uint32_t height;
39
40int bcm2835_mailbox_get_display_size(
42
43typedef enum {
44 bcm2835_mailbox_pixel_order_bgr = 0,
45 bcm2835_mailbox_pixel_order_rgb = 1
46} bcm2835_pixel_order;
47
48typedef enum {
49 bcm2835_mailbox_alpha_mode_0_opaque = 0,
50 bcm2835_mailbox_alpha_mode_0_transparent = 1,
51 bcm2835_mailbox_alpha_mode_ignored = 2
52} bcm2835_alpha_mode;
53
54typedef struct {
55 uint32_t xres;
56 uint32_t yres;
57 uint32_t xvirt;
58 uint32_t yvirt;
59 uint32_t depth;
60 bcm2835_pixel_order pixel_order;
61 bcm2835_alpha_mode alpha_mode;
62 uint32_t voffset_x;
63 uint32_t voffset_y;
64 uint32_t overscan_left;
65 uint32_t overscan_right;
66 uint32_t overscan_top;
67 uint32_t overscan_bottom;
68 uint32_t base;
69 size_t size;
70 uint32_t pitch;
72
73int bcm2835_mailbox_init_frame_buffer(
75
76typedef struct {
77 uint32_t pitch;
79
80int bcm2835_mailbox_get_pitch( bcm2835_get_pitch_entries *_entries );
81
82typedef struct {
83 char cmdline[ 1024 ];
85
86int bcm2835_mailbox_get_cmdline( bcm2835_get_cmdline_entries *_entries );
87
88typedef enum {
89 bcm2835_mailbox_power_udid_sd_card = 0x00000000u,
90 bcm2835_mailbox_power_udid_uart0 = 0x00000001u,
91 bcm2835_mailbox_power_udid_uart1 = 0x00000002u,
92 bcm2835_mailbox_power_udid_usb_hcd = 0x00000003u,
93 bcm2835_mailbox_power_udid_i2c0 = 0x00000004u,
94 bcm2835_mailbox_power_udid_i2c1 = 0x00000005u,
95 bcm2835_mailbox_power_udid_i2c2 = 0x00000006u,
96 bcm2835_mailbox_power_udid_spi = 0x00000007u,
97 bcm2835_mailbox_power_udid_ccp2tx = 0x00000008u,
98} bcm2835_power_device_id;
99
100typedef struct {
101 bcm2835_power_device_id dev_id;
102 uint32_t state;
104
105#define BCM2835_MAILBOX_SET_POWER_STATE_REQ_ON ( 1 << 0 )
106#define BCM2835_MAILBOX_SET_POWER_STATE_REQ_WAIT ( 1 << 1 )
107#define BCM2835_MAILBOX_POWER_STATE_ON ( 1 << 0 )
108#define BCM2835_MAILBOX_POWER_STATE_NODEV ( 1 << 1 )
109int bcm2835_mailbox_set_power_state( bcm2835_set_power_state_entries *_entries );
110
111int bcm2835_mailbox_get_power_state( bcm2835_set_power_state_entries *_entries );
112
113typedef struct {
114 uint32_t base;
115 size_t size;
117
118int bcm2835_mailbox_get_arm_memory( bcm2835_get_arm_memory_entries *_entries );
119
120typedef struct {
121 uint32_t base;
122 size_t size;
124
125int bcm2835_mailbox_get_vc_memory( bcm2835_get_vc_memory_entries *_entries );
126
127typedef struct {
128 uint32_t fw_rev;
130
131int bcm2835_mailbox_get_firmware_revision(
133
134typedef struct {
135 uint32_t spec;
137
138int bcm2835_mailbox_get_board_model( bcm2835_get_board_spec_entries *_entries );
139
140int bcm2835_mailbox_get_board_revision(
142
143/*
144 * See the official documentation for the format of the revision codes:
145 * https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
146 */
147#define BCM2835_REVISION_IS_NEW_STYLE(revision) ((revision & (1 << 23)) != 0)
148#define BCM2835_REVISION_MEMORY_SIZE(revision) ((revision >> 20) & 0x7)
149#define BCM2835_REVISION_MANUFACTURER(revision) ((revision >> 16) & 0xf)
150#define BCM2835_REVISION_PROCESSOR(revision) ((revision >> 12) & 0xf)
151#define BCM2835_REVISION_TYPE(revision) ((revision >> 4) & 0xff)
152#define BCM2835_REVISION_REVISION(revision) ((revision >> 0) & 0xf)
153
154typedef struct {
155 uint64_t board_serial;
157
158int bcm2835_mailbox_get_board_serial(
160
161typedef struct {
162 uint32_t clock_id;
163 uint32_t clock_rate;
165
166int bcm2835_mailbox_get_clock_rate(
170#endif /* LIBBSP_ARM_RASPBERRYPI_VC_H */
Definition: vc.h:113
Definition: vc.h:134
Definition: vc.h:161
Definition: vc.h:82
Definition: vc.h:76
Definition: vc.h:120