File indexing completed on 2025-05-11 08:23:04
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #ifndef LIBBSP_ARM_RASPBERRYPI_VC_H
0021 #define LIBBSP_ARM_RASPBERRYPI_VC_H
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 typedef struct {
0034 uint32_t width;
0035 uint32_t height;
0036 } bcm2835_get_display_size_entries;
0037
0038 int bcm2835_mailbox_get_display_size(
0039 bcm2835_get_display_size_entries *_entries );
0040
0041 typedef enum {
0042 bcm2835_mailbox_pixel_order_bgr = 0,
0043 bcm2835_mailbox_pixel_order_rgb = 1
0044 } bcm2835_pixel_order;
0045
0046 typedef enum {
0047 bcm2835_mailbox_alpha_mode_0_opaque = 0,
0048 bcm2835_mailbox_alpha_mode_0_transparent = 1,
0049 bcm2835_mailbox_alpha_mode_ignored = 2
0050 } bcm2835_alpha_mode;
0051
0052 typedef struct {
0053 uint32_t xres;
0054 uint32_t yres;
0055 uint32_t xvirt;
0056 uint32_t yvirt;
0057 uint32_t depth;
0058 bcm2835_pixel_order pixel_order;
0059 bcm2835_alpha_mode alpha_mode;
0060 uint32_t voffset_x;
0061 uint32_t voffset_y;
0062 uint32_t overscan_left;
0063 uint32_t overscan_right;
0064 uint32_t overscan_top;
0065 uint32_t overscan_bottom;
0066 uint32_t base;
0067 size_t size;
0068 uint32_t pitch;
0069 } bcm2835_init_frame_buffer_entries;
0070
0071 int bcm2835_mailbox_init_frame_buffer(
0072 bcm2835_init_frame_buffer_entries *_entries );
0073
0074 typedef struct {
0075 uint32_t pitch;
0076 } bcm2835_get_pitch_entries;
0077
0078 int bcm2835_mailbox_get_pitch( bcm2835_get_pitch_entries *_entries );
0079
0080 typedef struct {
0081 char cmdline[ 1024 ];
0082 } bcm2835_get_cmdline_entries;
0083
0084 int bcm2835_mailbox_get_cmdline( bcm2835_get_cmdline_entries *_entries );
0085
0086 typedef enum {
0087 bcm2835_mailbox_power_udid_sd_card = 0x00000000u,
0088 bcm2835_mailbox_power_udid_uart0 = 0x00000001u,
0089 bcm2835_mailbox_power_udid_uart1 = 0x00000002u,
0090 bcm2835_mailbox_power_udid_usb_hcd = 0x00000003u,
0091 bcm2835_mailbox_power_udid_i2c0 = 0x00000004u,
0092 bcm2835_mailbox_power_udid_i2c1 = 0x00000005u,
0093 bcm2835_mailbox_power_udid_i2c2 = 0x00000006u,
0094 bcm2835_mailbox_power_udid_spi = 0x00000007u,
0095 bcm2835_mailbox_power_udid_ccp2tx = 0x00000008u,
0096 } bcm2835_power_device_id;
0097
0098 typedef struct {
0099 bcm2835_power_device_id dev_id;
0100 uint32_t state;
0101 } bcm2835_set_power_state_entries;
0102
0103 #define BCM2835_MAILBOX_SET_POWER_STATE_REQ_ON ( 1 << 0 )
0104 #define BCM2835_MAILBOX_SET_POWER_STATE_REQ_WAIT ( 1 << 1 )
0105 #define BCM2835_MAILBOX_POWER_STATE_ON ( 1 << 0 )
0106 #define BCM2835_MAILBOX_POWER_STATE_NODEV ( 1 << 1 )
0107 int bcm2835_mailbox_set_power_state( bcm2835_set_power_state_entries *_entries );
0108
0109 int bcm2835_mailbox_get_power_state( bcm2835_set_power_state_entries *_entries );
0110
0111 typedef struct {
0112 uint32_t base;
0113 size_t size;
0114 } bcm2835_get_arm_memory_entries;
0115
0116 int bcm2835_mailbox_get_arm_memory( bcm2835_get_arm_memory_entries *_entries );
0117
0118 typedef struct {
0119 uint32_t base;
0120 size_t size;
0121 } bcm2835_get_vc_memory_entries;
0122
0123 int bcm2835_mailbox_get_vc_memory( bcm2835_get_vc_memory_entries *_entries );
0124
0125 typedef struct {
0126 uint32_t fw_rev;
0127 } bcm2835_mailbox_get_fw_rev_entries;
0128
0129 int bcm2835_mailbox_get_firmware_revision(
0130 bcm2835_mailbox_get_fw_rev_entries *_entries );
0131
0132 typedef struct {
0133 uint32_t spec;
0134 } bcm2835_get_board_spec_entries;
0135
0136 int bcm2835_mailbox_get_board_model( bcm2835_get_board_spec_entries *_entries );
0137
0138 int bcm2835_mailbox_get_board_revision(
0139 bcm2835_get_board_spec_entries *_entries );
0140
0141
0142
0143
0144
0145 #define BCM2835_REVISION_IS_NEW_STYLE(revision) ((revision & (1 << 23)) != 0)
0146 #define BCM2835_REVISION_MEMORY_SIZE(revision) ((revision >> 20) & 0x7)
0147 #define BCM2835_REVISION_MANUFACTURER(revision) ((revision >> 16) & 0xf)
0148 #define BCM2835_REVISION_PROCESSOR(revision) ((revision >> 12) & 0xf)
0149 #define BCM2835_REVISION_TYPE(revision) ((revision >> 4) & 0xff)
0150 #define BCM2835_REVISION_REVISION(revision) ((revision >> 0) & 0xf)
0151
0152 typedef struct {
0153 uint64_t board_serial;
0154 } bcm2835_get_board_serial_entries;
0155
0156 int bcm2835_mailbox_get_board_serial(
0157 bcm2835_get_board_serial_entries *_entries );
0158
0159 typedef struct {
0160 uint32_t clock_id;
0161 uint32_t clock_rate;
0162 } bcm2835_get_clock_rate_entries;
0163
0164 int bcm2835_mailbox_get_clock_rate(
0165 bcm2835_get_clock_rate_entries *_entries );
0166
0167
0168 #endif