github.com/usbarmory/tamago@v0.0.0-20240508072735-8612bbe1e454/soc/bcm2835/messages.go (about)

     1  // BCM2835 SoC Mailbox support
     2  // https://github.com/usbarmory/tamago
     3  //
     4  // Copyright (c) the bcm2835 package authors
     5  //
     6  // Use of this source code is governed by the license
     7  // that can be found in the LICENSE file.
     8  
     9  package bcm2835
    10  
    11  // Channels (see <https://github.com/raspberrypi/firmware/wiki/Mailboxes>)
    12  const (
    13  	VC_CH_POWERMGMT            = 0
    14  	VC_CH_FRAMEBUFFER          = 1
    15  	VC_CH_VIRTUALUART          = 2
    16  	VC_CH_VCHIQ                = 3
    17  	VC_CH_LEDS                 = 4
    18  	VC_CH_BUTTONS              = 5
    19  	VC_CH_TOUCHSCREEN          = 6
    20  	VC_CH_PROPERTYTAGS_A_TO_VC = 8
    21  	VC_CH_PROPERTYTAGS_VC_TO_A = 9
    22  )
    23  
    24  // Tags (see <https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface>)
    25  //
    26  // For fixed length messages, message lengths are provided as the larger of the request
    27  // or response size, since response overwrites the request buffer and caller is
    28  // responsible for allocation.
    29  const (
    30  	VC_FIRMWARE_GET_REV     = 0x00000001
    31  	VC_FIRMWARE_GET_REV_LEN = 4
    32  
    33  	VC_BOARD_GET_MODEL     = 0x00010001
    34  	VC_BOARD_GET_MODEL_LEN = 4
    35  
    36  	VC_BOARD_GET_REV     = 0x00010002
    37  	VC_BOARD_GET_REV_LEN = 4
    38  
    39  	VC_BOARD_GET_MAC     = 0x00010003
    40  	VC_BOARD_GET_MAC_LEN = 6
    41  
    42  	VC_BOARD_GET_SERIAL     = 0x00010004
    43  	VC_BOARD_GET_SERIAL_LEN = 8
    44  
    45  	VC_BOARD_GET_ARM_MEMORY     = 0x00010005
    46  	VC_BOARD_GET_ARM_MEMORY_LEN = 8
    47  
    48  	VC_BOARD_GET_VC_MEMORY     = 0x00010006
    49  	VC_BOARD_GET_VC_MEMORY_LEN = 8
    50  
    51  	VC_BOARD_GET_CLOCKS = 0x00010007
    52  
    53  	VC_CFG_GET_CMDLINE = 0x00050001
    54  
    55  	VC_RES_GET_DMACHANNELS     = 0x00060001
    56  	VC_RES_GET_DMACHANNELS_LEN = 4
    57  
    58  	VC_POWER_GET_STATE     = 0x00020001
    59  	VC_POWER_GET_STATE_LEN = 8
    60  
    61  	VC_POWER_GET_TIMING     = 0x00020002
    62  	VC_POWER_GET_TIMING_LEN = 8
    63  
    64  	VC_POWER_SET_STATE     = 0x00028001
    65  	VC_POWER_SET_STATE_LEN = 8
    66  
    67  	VC_CLOCK_GET_STATE     = 0x00030001
    68  	VC_CLOCK_GET_STATE_LEN = 8
    69  
    70  	VC_CLOCK_SET_STATE     = 0x00038001
    71  	VC_CLOCK_SET_STATE_LEN = 8
    72  
    73  	VC_CLOCK_GET_RATE     = 0x00030002
    74  	VC_CLOCK_GET_RATE_LEN = 8
    75  
    76  	VC_CLOCK_SET_RATE     = 0x00038002
    77  	VC_CLOCK_SET_RATE_LEN = 12
    78  
    79  	VC_CLOCK_GET_MAX_RATE     = 0x00030004
    80  	VC_CLOCK_GET_MAX_RATE_LEN = 8
    81  
    82  	VC_CLOCK_GET_MIN_RATE     = 0x00030007
    83  	VC_CLOCK_GET_MIN_RATE_LEN = 8
    84  
    85  	VC_CLOCK_GET_TURBO     = 0x00030009
    86  	VC_CLOCK_GET_TURBO_LEN = 8
    87  
    88  	VC_CLOCK_SET_TURBO     = 0x00038009
    89  	VC_CLOCK_SET_TURBO_LEN = 8
    90  
    91  	VC_VOLT_GET     = 0x00030003
    92  	VC_VOLT_GET_LEN = 8
    93  
    94  	VC_VOLT_SET     = 0x00038003
    95  	VC_VOLT_SET_LEN = 8
    96  
    97  	VC_VOLT_GET_MAX     = 0x00030005
    98  	VC_VOLT_GET_MAX_LEN = 8
    99  
   100  	VC_VOLT_GET_MIN     = 0x00030008
   101  	VC_VOLT_GET_MIN_LEN = 8
   102  
   103  	VC_TEMP_GET     = 0x00030006
   104  	VC_TEMP_GET_LEN = 8
   105  
   106  	VC_TEMP_GET_MAX     = 0x0003000a
   107  	VC_TEMP_GET_MAX_LEN = 8
   108  
   109  	VC_MEM_ALLOCATE     = 0x0003000c
   110  	VC_MEM_ALLOCATE_LEN = 12
   111  
   112  	VC_MEM_LOCK     = 0x0003000d
   113  	VC_MEM_LOCK_LEN = 4
   114  
   115  	VC_MEM_UNLOCK     = 0x0003000e
   116  	VC_MEM_UNLOCK_LEN = 4
   117  
   118  	VC_MEM_RELEASE     = 0x0003000f
   119  	VC_MEM_RELEASE_LEN = 4
   120  
   121  	VC_MEM_EXEC     = 0x00030010
   122  	VC_MEM_EXEC_LEN = 28
   123  
   124  	VC_MEM_GET_DISPMANX_HANDLE     = 0x00030014
   125  	VC_MEM_GET_DISPMANX_HANDLE_LEN = 8
   126  
   127  	VC_MEM_GET_EDID_BLOCK     = 0x00030020
   128  	VC_MEM_GET_EDID_BLOCK_LEN = 136
   129  
   130  	VC_FB_ALLOC_BUFFER     = 0x00040001
   131  	VC_FB_ALLOC_BUFFER_LEN = 8
   132  
   133  	VC_FB_RELEASE_BUFFER     = 0x00048001
   134  	VC_FB_RELEASE_BUFFER_LEN = 0
   135  
   136  	VC_FB_BLANK_SCREEN     = 0x00040002
   137  	VC_FB_BLANK_SCREEN_LEN = 0
   138  
   139  	VC_FB_GET_PHYSICAL_SIZE     = 0x00040003
   140  	VC_FB_GET_PHYSICAL_SIZE_LEN = 8
   141  
   142  	VC_FB_TEST_PHYSICAL_SIZE     = 0x00044003
   143  	VC_FB_TEST_PHYSICAL_SIZE_LEN = 8
   144  
   145  	VC_FB_SET_PHYSICAL_SIZE     = 0x00048003
   146  	VC_FB_SET_PHYSICAL_SIZE_LEN = 8
   147  
   148  	VC_FB_GET_VIRTUAL_SIZE     = 0x00040004
   149  	VC_FB_GET_VIRTUAL_SIZE_LEN = 8
   150  
   151  	VC_FB_TEST_VIRTUAL_SIZE     = 0x00044004
   152  	VC_FB_TEST_VIRTUAL_SIZE_LEN = 8
   153  
   154  	VC_FB_SET_VIRTUAL_SIZE     = 0x00048004
   155  	VC_FB_SET_VIRTUAL_SIZE_LEN = 8
   156  
   157  	VC_FB_GET_DEPTH     = 0x00040005
   158  	VC_FB_GET_DEPTH_LEN = 4
   159  
   160  	VC_FB_TEST_DEPTH     = 0x00044005
   161  	VC_FB_TEST_DEPTH_LEN = 4
   162  
   163  	VC_FB_SET_DEPTH     = 0x00048005
   164  	VC_FB_SET_DEPTH_LEN = 4
   165  
   166  	VC_FB_GET_PIXEL_ORDER     = 0x00040006
   167  	VC_FB_GET_PIXEL_ORDER_LEN = 4
   168  
   169  	VC_FB_TEST_PIXEL_ORDER     = 0x00044006
   170  	VC_FB_TEST_PIXEL_ORDER_LEN = 4
   171  
   172  	VC_FB_SET_PIXEL_ORDER     = 0x00048006
   173  	VC_FB_SET_PIXEL_ORDER_LEN = 4
   174  
   175  	VC_FB_GET_ALPHA_MODE     = 0x00040007
   176  	VC_FB_GET_ALPHA_MODE_LEN = 4
   177  
   178  	VC_FB_TEST_ALPHA_MODE     = 0x00044007
   179  	VC_FB_TEST_ALPHA_MODE_LEN = 4
   180  
   181  	VC_FB_SET_ALPHA_MODE     = 0x00048007
   182  	VC_FB_SET_ALPHA_MODE_LEN = 4
   183  
   184  	VC_FB_GET_PITCH     = 0x00040008
   185  	VC_FB_GET_PITCH_LEN = 4
   186  
   187  	VC_FB_GET_VIRTUAL_OFFSET     = 0x00040009
   188  	VC_FB_GET_VIRTUAL_OFFSET_LEN = 8
   189  
   190  	VC_FB_TEST_VIRTUAL_OFFSET     = 0x00044009
   191  	VC_FB_TEST_VIRTUAL_OFFSET_LEN = 8
   192  
   193  	VC_FB_SET_VIRTUAL_OFFSET     = 0x00048009
   194  	VC_FB_SET_VIRTUAL_OFFSET_LEN = 8
   195  
   196  	VC_FB_GET_OVERSCAN     = 0x0004000a
   197  	VC_FB_GET_OVERSCAN_LEN = 16
   198  
   199  	VC_FB_TEST_OVERSCAN     = 0x0004400a
   200  	VC_FB_TEST_OVERSCAN_LEN = 16
   201  
   202  	VC_FB_SET_OVERSCAN     = 0x0004800a
   203  	VC_FB_SET_OVERSCAN_LEN = 16
   204  
   205  	VC_FB_GET_PALETTE     = 0x0004000b
   206  	VC_FB_GET_PALETTE_LEN = 1024
   207  
   208  	VC_FB_TEST_PALETTE = 0x0004400b
   209  
   210  	VC_FB_SET_PALETTE = 0x0004800b
   211  
   212  	VC_FB_SET_CURSOR_INFO     = 0x00008010
   213  	VC_FB_SET_CURSOR_INFO_LEN = 24
   214  
   215  	VC_FB_SET_CURSOR_STATE     = 0x00008011
   216  	VC_FB_SET_CURSOR_STATE_LEN = 16
   217  )