Home | History | Annotate | Line # | Download | only in rpi
vcprop.h revision 1.2.4.6
      1  1.2.4.4       tls /*	$NetBSD: vcprop.h,v 1.2.4.6 2017/12/03 11:36:06 jdolecek Exp $	*/
      2  1.2.4.2       tls 
      3  1.2.4.2       tls /*-
      4  1.2.4.2       tls  * Copyright (c) 2012 The NetBSD Foundation, Inc.
      5  1.2.4.2       tls  * All rights reserved.
      6  1.2.4.2       tls  *
      7  1.2.4.2       tls  * This code is derived from software contributed to The NetBSD Foundation
      8  1.2.4.2       tls  * by Nick Hudson
      9  1.2.4.2       tls  *
     10  1.2.4.2       tls  * Redistribution and use in source and binary forms, with or without
     11  1.2.4.2       tls  * modification, are permitted provided that the following conditions
     12  1.2.4.2       tls  * are met:
     13  1.2.4.2       tls  * 1. Redistributions of source code must retain the above copyright
     14  1.2.4.2       tls  *    notice, this list of conditions and the following disclaimer.
     15  1.2.4.2       tls  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.2.4.2       tls  *    notice, this list of conditions and the following disclaimer in the
     17  1.2.4.2       tls  *    documentation and/or other materials provided with the distribution.
     18  1.2.4.2       tls  *
     19  1.2.4.2       tls  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20  1.2.4.2       tls  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21  1.2.4.2       tls  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22  1.2.4.2       tls  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23  1.2.4.2       tls  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24  1.2.4.2       tls  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25  1.2.4.2       tls  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26  1.2.4.2       tls  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27  1.2.4.2       tls  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28  1.2.4.2       tls  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29  1.2.4.2       tls  * POSSIBILITY OF SUCH DAMAGE.
     30  1.2.4.2       tls  */
     31  1.2.4.2       tls 
     32  1.2.4.2       tls /*
     33  1.2.4.2       tls  * Mailbox property interface
     34  1.2.4.2       tls  */
     35  1.2.4.2       tls 
     36  1.2.4.2       tls #ifndef	_EVBARM_RPI_VCPROP_H_
     37  1.2.4.2       tls #define	_EVBARM_RPI_VCPROP_H_
     38  1.2.4.2       tls 
     39  1.2.4.5       tls #include "opt_vcprop.h"
     40  1.2.4.5       tls 
     41  1.2.4.2       tls struct vcprop_tag {
     42  1.2.4.2       tls 	uint32_t vpt_tag;
     43  1.2.4.2       tls #define	VCPROPTAG_NULL			0x00000000
     44  1.2.4.2       tls #define	VCPROPTAG_GET_FIRMWAREREV	0x00000001
     45  1.2.4.2       tls #define	VCPROPTAG_GET_BOARDMODEL	0x00010001
     46  1.2.4.2       tls #define	VCPROPTAG_GET_BOARDREVISION	0x00010002
     47  1.2.4.2       tls #define	VCPROPTAG_GET_MACADDRESS	0x00010003
     48  1.2.4.2       tls #define	VCPROPTAG_GET_BOARDSERIAL	0x00010004
     49  1.2.4.2       tls #define	VCPROPTAG_GET_ARMMEMORY		0x00010005
     50  1.2.4.2       tls #define	VCPROPTAG_GET_VCMEMORY		0x00010006
     51  1.2.4.2       tls #define	VCPROPTAG_GET_CLOCKS		0x00010007
     52  1.2.4.2       tls 
     53  1.2.4.3       tls #define VCPROPTAG_GET_POWERSTATE	0x00020001
     54  1.2.4.3       tls #define VCPROPTAG_GET_POWERTIMING	0x00020002
     55  1.2.4.3       tls #define VCPROPTAG_SET_POWERSTATE	0x00028001
     56  1.2.4.3       tls 
     57  1.2.4.2       tls #define	VCPROPTAG_GET_CLOCKSTATE	0x00030001
     58  1.2.4.2       tls #define	VCPROPTAG_SET_CLOCKSTATE	0x00038001
     59  1.2.4.2       tls #define	VCPROPTAG_GET_CLOCKRATE		0x00030002
     60  1.2.4.2       tls #define	VCPROPTAG_SET_CLOCKRATE		0x00038002
     61  1.2.4.3       tls #define	VCPROPTAG_GET_MIN_CLOCKRATE	0x00030007
     62  1.2.4.3       tls #define	VCPROPTAG_GET_MAX_CLOCKRATE	0x00030004
     63  1.2.4.6  jdolecek #define	VCPROPTAG_GET_TURBO		0x00030009
     64  1.2.4.6  jdolecek #define	VCPROPTAG_SET_TURBO		0x00038009
     65  1.2.4.3       tls 
     66  1.2.4.3       tls #define VCPROPTAG_GET_VOLTAGE		0x00030003
     67  1.2.4.3       tls #define VCPROPTAG_SET_VOLTAGE		0x00038003
     68  1.2.4.3       tls #define VCPROPTAG_GET_MIN_VOLTAGE	0x00030008
     69  1.2.4.3       tls #define VCPROPTAG_GET_MAX_VOLTAGE	0x00030005
     70  1.2.4.3       tls 
     71  1.2.4.3       tls #define VCPROPTAG_GET_TEMPERATURE	0x00030006
     72  1.2.4.3       tls #define VCPROPTAG_GET_MAX_TEMPERATURE	0x0003000a
     73  1.2.4.3       tls 
     74  1.2.4.2       tls #define	VCPROPTAG_GET_CMDLINE		0x00050001
     75  1.2.4.2       tls #define	VCPROPTAG_GET_DMACHAN		0x00060001
     76  1.2.4.3       tls 
     77  1.2.4.3       tls #define	VCPROPTAG_ALLOCATE_BUFFER	0x00040001
     78  1.2.4.3       tls #define	VCPROPTAG_BLANK_SCREEN		0x00040002
     79  1.2.4.3       tls #define	VCPROPTAG_GET_FB_RES		0x00040003
     80  1.2.4.3       tls #define	VCPROPTAG_SET_FB_RES		0x00048003
     81  1.2.4.3       tls #define	VCPROPTAG_GET_FB_VRES		0x00040004
     82  1.2.4.3       tls #define	VCPROPTAG_SET_FB_VRES		0x00048004
     83  1.2.4.3       tls #define	VCPROPTAG_GET_FB_DEPTH		0x00040005
     84  1.2.4.3       tls #define	VCPROPTAG_SET_FB_DEPTH		0x00048005
     85  1.2.4.3       tls #define	VCPROPTAG_GET_FB_PIXEL_ORDER	0x00040006
     86  1.2.4.3       tls #define	VCPROPTAG_SET_FB_PIXEL_ORDER	0x00048006
     87  1.2.4.3       tls #define	VCPROPTAG_GET_FB_ALPHA_MODE	0x00040007
     88  1.2.4.3       tls #define	VCPROPTAG_SET_FB_ALPHA_MODE	0x00048007
     89  1.2.4.3       tls #define	VCPROPTAG_GET_FB_PITCH		0x00040008
     90  1.2.4.3       tls 
     91  1.2.4.3       tls #define	VCPROPTAG_GET_EDID_BLOCK	0x00030020
     92  1.2.4.3       tls 
     93  1.2.4.6  jdolecek #define	VCPROPTAG_ALLOCMEM		0x0003000c
     94  1.2.4.6  jdolecek #define	VCPROPTAG_LOCKMEM		0x0003000d
     95  1.2.4.6  jdolecek #define	VCPROPTAG_UNLOCKMEM		0x0003000e
     96  1.2.4.6  jdolecek #define	VCPROPTAG_RELEASEMEM		0x0003000f
     97  1.2.4.6  jdolecek #define	VCPROPTAG_EXECUTE_CODE		0x00030010
     98  1.2.4.6  jdolecek #define	VCPROPTAG_EXECUTE_QPU		0x00030011
     99  1.2.4.6  jdolecek #define	VCPROPTAG_SET_ENABLE_QPU	0x00030012
    100  1.2.4.6  jdolecek #define	VCPROPTAG_GET_DISPMANX_HANDLE	0x00030014
    101  1.2.4.6  jdolecek 
    102  1.2.4.6  jdolecek #define	VCPROPTAG_SET_CURSOR_INFO	0x00008010
    103  1.2.4.6  jdolecek #define	VCPROPTAG_SET_CURSOR_STATE	0x00008011
    104  1.2.4.3       tls 
    105  1.2.4.2       tls 	uint32_t vpt_len;
    106  1.2.4.2       tls 	uint32_t vpt_rcode;
    107  1.2.4.2       tls #define	VCPROPTAG_REQUEST	(0U << 31)
    108  1.2.4.2       tls #define	VCPROPTAG_RESPONSE	(1U << 31)
    109  1.2.4.2       tls 
    110  1.2.4.2       tls };
    111  1.2.4.2       tls 
    112  1.2.4.2       tls #define VCPROPTAG_LEN(x) (sizeof((x)) - sizeof(struct vcprop_tag))
    113  1.2.4.2       tls 
    114  1.2.4.2       tls struct vcprop_memory {
    115  1.2.4.2       tls 	uint32_t base;
    116  1.2.4.2       tls 	uint32_t size;
    117  1.2.4.2       tls };
    118  1.2.4.2       tls 
    119  1.2.4.2       tls #define	VCPROP_MAXMEMBLOCKS 4
    120  1.2.4.2       tls struct vcprop_tag_memory {
    121  1.2.4.2       tls 	struct vcprop_tag tag;
    122  1.2.4.2       tls 	struct vcprop_memory mem[VCPROP_MAXMEMBLOCKS];
    123  1.2.4.2       tls };
    124  1.2.4.2       tls 
    125  1.2.4.2       tls struct vcprop_tag_fwrev {
    126  1.2.4.2       tls 	struct vcprop_tag tag;
    127  1.2.4.2       tls 	uint32_t rev;
    128  1.2.4.2       tls };
    129  1.2.4.2       tls 
    130  1.2.4.2       tls struct vcprop_tag_boardmodel {
    131  1.2.4.2       tls 	struct vcprop_tag tag;
    132  1.2.4.2       tls 	uint32_t model;
    133  1.2.4.2       tls } ;
    134  1.2.4.2       tls 
    135  1.2.4.2       tls struct vcprop_tag_boardrev {
    136  1.2.4.2       tls 	struct vcprop_tag tag;
    137  1.2.4.2       tls 	uint32_t rev;
    138  1.2.4.2       tls } ;
    139  1.2.4.2       tls 
    140  1.2.4.6  jdolecek #define	VCPROP_REV_PCBREV	__BITS(3,0)
    141  1.2.4.6  jdolecek #define	VCPROP_REV_MODEL	__BITS(11,4)
    142  1.2.4.6  jdolecek #define	 RPI_MODEL_A		0
    143  1.2.4.6  jdolecek #define	 RPI_MODEL_B		1
    144  1.2.4.6  jdolecek #define	 RPI_MODEL_A_PLUS	2
    145  1.2.4.6  jdolecek #define	 RPI_MODEL_B_PLUS	3
    146  1.2.4.6  jdolecek #define	 RPI_MODEL_B_PI2	4
    147  1.2.4.6  jdolecek #define	 RPI_MODEL_ALPHA	5
    148  1.2.4.6  jdolecek #define	 RPI_MODEL_COMPUTE	6
    149  1.2.4.6  jdolecek #define	 RPI_MODEL_ZERO		7
    150  1.2.4.6  jdolecek #define	 RPI_MODEL_B_PI3	8
    151  1.2.4.6  jdolecek #define	 RPI_MODEL_COMPUTE_PI3	9
    152  1.2.4.6  jdolecek #define	 RPI_MODEL_ZERO_W	10
    153  1.2.4.6  jdolecek #define	VCPROP_REV_PROCESSOR	__BITS(15,12)
    154  1.2.4.6  jdolecek #define	 RPI_PROCESSOR_BCM2835	0
    155  1.2.4.6  jdolecek #define	 RPI_PROCESSOR_BCM2836	1
    156  1.2.4.6  jdolecek #define	 RPI_PROCESSOR_BCM2837	2
    157  1.2.4.6  jdolecek #define	VCPROP_REV_MANUF	__BITS(19,16)
    158  1.2.4.6  jdolecek #define	VCPROP_REV_MEMSIZE	__BITS(22,20)
    159  1.2.4.6  jdolecek #define	VCPROP_REV_ENCFLAG	__BIT(23)
    160  1.2.4.6  jdolecek #define	VCPROP_REV_WARRANTY	__BITS(25,24)
    161  1.2.4.6  jdolecek 
    162  1.2.4.2       tls struct vcprop_tag_macaddr {
    163  1.2.4.2       tls 	struct vcprop_tag tag;
    164  1.2.4.2       tls 	uint64_t addr;
    165  1.2.4.4       tls } __packed;
    166  1.2.4.2       tls 
    167  1.2.4.2       tls struct vcprop_tag_boardserial {
    168  1.2.4.2       tls 	struct vcprop_tag tag;
    169  1.2.4.2       tls 	uint64_t sn;
    170  1.2.4.4       tls } __packed;
    171  1.2.4.2       tls 
    172  1.2.4.2       tls #define	VCPROP_CLK_EMMC		1
    173  1.2.4.2       tls #define	VCPROP_CLK_UART		2
    174  1.2.4.2       tls #define	VCPROP_CLK_ARM		3
    175  1.2.4.2       tls #define	VCPROP_CLK_CORE		4
    176  1.2.4.2       tls #define	VCPROP_CLK_V3D		5
    177  1.2.4.2       tls #define	VCPROP_CLK_H264		6
    178  1.2.4.2       tls #define	VCPROP_CLK_ISP		7
    179  1.2.4.2       tls #define	VCPROP_CLK_SDRAM	8
    180  1.2.4.2       tls #define	VCPROP_CLK_PIXEL	9
    181  1.2.4.2       tls #define	VCPROP_CLK_PWM		10
    182  1.2.4.2       tls 
    183  1.2.4.2       tls struct vcprop_clock {
    184  1.2.4.2       tls 	uint32_t pclk;
    185  1.2.4.2       tls 	uint32_t cclk;
    186  1.2.4.2       tls };
    187  1.2.4.2       tls 
    188  1.2.4.2       tls #define	VCPROP_MAXCLOCKS 16
    189  1.2.4.2       tls struct vcprop_tag_clock {
    190  1.2.4.2       tls 	struct vcprop_tag tag;
    191  1.2.4.2       tls 	struct vcprop_clock clk[VCPROP_MAXCLOCKS];
    192  1.2.4.2       tls };
    193  1.2.4.2       tls 
    194  1.2.4.5       tls #ifndef	VCPROP_MAXCMDLINE
    195  1.2.4.5       tls #define	VCPROP_MAXCMDLINE 1024
    196  1.2.4.5       tls #endif
    197  1.2.4.2       tls struct vcprop_tag_cmdline {
    198  1.2.4.2       tls 	struct vcprop_tag tag;
    199  1.2.4.2       tls 	uint8_t cmdline[VCPROP_MAXCMDLINE];
    200  1.2.4.2       tls };
    201  1.2.4.2       tls 
    202  1.2.4.2       tls struct vcprop_tag_dmachan {
    203  1.2.4.2       tls 	struct vcprop_tag tag;
    204  1.2.4.2       tls 	uint32_t mask;
    205  1.2.4.2       tls };
    206  1.2.4.2       tls 
    207  1.2.4.2       tls struct vcprop_tag_clockstate {
    208  1.2.4.2       tls 	struct vcprop_tag tag;
    209  1.2.4.2       tls 	uint32_t id;
    210  1.2.4.2       tls 	uint32_t state;
    211  1.2.4.2       tls };
    212  1.2.4.2       tls 
    213  1.2.4.2       tls struct vcprop_tag_clockrate {
    214  1.2.4.2       tls 	struct vcprop_tag tag;
    215  1.2.4.2       tls 	uint32_t id;
    216  1.2.4.2       tls 	uint32_t rate;
    217  1.2.4.6  jdolecek 	uint32_t noturbo;
    218  1.2.4.2       tls };
    219  1.2.4.2       tls 
    220  1.2.4.3       tls #define VCPROP_VOLTAGE_CORE	1
    221  1.2.4.3       tls #define VCPROP_VOLTAGE_SDRAM_C	2
    222  1.2.4.3       tls #define VCPROP_VOLTAGE_SDRAM_P	3
    223  1.2.4.3       tls #define VCPROP_VOLTAGE_SDRAM_I	4
    224  1.2.4.3       tls 
    225  1.2.4.3       tls struct vcprop_tag_voltage {
    226  1.2.4.3       tls 	struct vcprop_tag tag;
    227  1.2.4.3       tls 	uint32_t id;
    228  1.2.4.3       tls 	uint32_t value;
    229  1.2.4.3       tls };
    230  1.2.4.3       tls 
    231  1.2.4.3       tls #define VCPROP_TEMP_SOC		0
    232  1.2.4.3       tls 
    233  1.2.4.3       tls struct vcprop_tag_temperature {
    234  1.2.4.3       tls 	struct vcprop_tag tag;
    235  1.2.4.3       tls 	uint32_t id;
    236  1.2.4.3       tls 	uint32_t value;
    237  1.2.4.3       tls };
    238  1.2.4.3       tls 
    239  1.2.4.3       tls #define	VCPROP_POWER_SDCARD	0
    240  1.2.4.3       tls #define	VCPROP_POWER_UART0	1
    241  1.2.4.3       tls #define	VCPROP_POWER_UART1	2
    242  1.2.4.3       tls #define	VCPROP_POWER_USB	3
    243  1.2.4.3       tls #define	VCPROP_POWER_I2C0	4
    244  1.2.4.3       tls #define	VCPROP_POWER_I2C1	5
    245  1.2.4.3       tls #define	VCPROP_POWER_I2C2	6
    246  1.2.4.3       tls #define	VCPROP_POWER_SPI	7
    247  1.2.4.3       tls #define	VCPROP_POWER_CCP2TX	8
    248  1.2.4.3       tls 
    249  1.2.4.3       tls struct vcprop_tag_powertiming {
    250  1.2.4.3       tls 	struct vcprop_tag tag;
    251  1.2.4.3       tls 	uint32_t id;
    252  1.2.4.3       tls 	uint32_t waitusec;
    253  1.2.4.3       tls };
    254  1.2.4.3       tls 
    255  1.2.4.3       tls struct vcprop_tag_powerstate {
    256  1.2.4.3       tls 	struct vcprop_tag tag;
    257  1.2.4.3       tls 	uint32_t id;
    258  1.2.4.3       tls 	uint32_t state;
    259  1.2.4.3       tls };
    260  1.2.4.3       tls 
    261  1.2.4.3       tls struct vcprop_tag_allocbuf {
    262  1.2.4.3       tls 	struct vcprop_tag tag;
    263  1.2.4.3       tls 	uint32_t address;	/* alignment for request */
    264  1.2.4.3       tls 	uint32_t size;
    265  1.2.4.3       tls };
    266  1.2.4.3       tls 
    267  1.2.4.3       tls #define VCPROP_BLANK_OFF	0
    268  1.2.4.3       tls #define VCPROP_BLANK_ON		1
    269  1.2.4.3       tls 
    270  1.2.4.3       tls struct vcprop_tag_blankscreen {
    271  1.2.4.3       tls 	struct vcprop_tag tag;
    272  1.2.4.3       tls 	uint32_t state;
    273  1.2.4.3       tls };
    274  1.2.4.3       tls 
    275  1.2.4.3       tls struct vcprop_tag_fbres {
    276  1.2.4.3       tls 	struct vcprop_tag tag;
    277  1.2.4.3       tls 	uint32_t width;
    278  1.2.4.3       tls 	uint32_t height;
    279  1.2.4.3       tls };
    280  1.2.4.3       tls 
    281  1.2.4.3       tls struct vcprop_tag_fbdepth {
    282  1.2.4.3       tls 	struct vcprop_tag tag;
    283  1.2.4.3       tls 	uint32_t bpp;
    284  1.2.4.3       tls };
    285  1.2.4.3       tls 
    286  1.2.4.3       tls #define VCPROP_PIXEL_BGR	0
    287  1.2.4.3       tls #define VCPROP_PIXEL_RGB	1
    288  1.2.4.3       tls 
    289  1.2.4.3       tls struct vcprop_tag_fbpixelorder {
    290  1.2.4.3       tls 	struct vcprop_tag tag;
    291  1.2.4.3       tls 	uint32_t state;
    292  1.2.4.3       tls };
    293  1.2.4.3       tls 
    294  1.2.4.3       tls struct vcprop_tag_fbpitch {
    295  1.2.4.3       tls 	struct vcprop_tag tag;
    296  1.2.4.3       tls 	uint32_t linebytes;
    297  1.2.4.3       tls };
    298  1.2.4.3       tls 
    299  1.2.4.3       tls #define VCPROP_ALPHA_ENABLED	0
    300  1.2.4.3       tls #define VCPROP_ALPHA_REVERSED	1
    301  1.2.4.3       tls #define VCPROP_ALPHA_IGNORED	2
    302  1.2.4.3       tls 
    303  1.2.4.3       tls struct vcprop_tag_fbalpha {
    304  1.2.4.3       tls 	struct vcprop_tag tag;
    305  1.2.4.3       tls 	uint32_t state;
    306  1.2.4.3       tls };
    307  1.2.4.3       tls 
    308  1.2.4.3       tls struct vcprop_tag_edidblock {
    309  1.2.4.3       tls 	struct vcprop_tag tag;
    310  1.2.4.3       tls 	uint32_t blockno;
    311  1.2.4.3       tls 	uint32_t status;
    312  1.2.4.3       tls 	uint8_t data[128];
    313  1.2.4.3       tls };
    314  1.2.4.3       tls 
    315  1.2.4.6  jdolecek struct vcprop_tag_cursorinfo {
    316  1.2.4.6  jdolecek 	struct vcprop_tag tag;
    317  1.2.4.6  jdolecek 	uint32_t width;
    318  1.2.4.6  jdolecek 	uint32_t height;
    319  1.2.4.6  jdolecek 	uint32_t format;
    320  1.2.4.6  jdolecek 	uint32_t pixels;	/* bus address in VC memory */
    321  1.2.4.6  jdolecek 	uint32_t hotspot_x;
    322  1.2.4.6  jdolecek 	uint32_t hotspot_y;
    323  1.2.4.6  jdolecek };
    324  1.2.4.6  jdolecek 
    325  1.2.4.6  jdolecek struct vcprop_tag_cursorstate {
    326  1.2.4.6  jdolecek 	struct vcprop_tag tag;
    327  1.2.4.6  jdolecek 	uint32_t enable;	/* 1 - visible */
    328  1.2.4.6  jdolecek 	uint32_t x;
    329  1.2.4.6  jdolecek 	uint32_t y;
    330  1.2.4.6  jdolecek 	uint32_t flags;		/* 0 - display coord. 1 - fb coord. */
    331  1.2.4.6  jdolecek };
    332  1.2.4.6  jdolecek 
    333  1.2.4.6  jdolecek struct vcprop_tag_allocmem {
    334  1.2.4.6  jdolecek 	struct vcprop_tag tag;
    335  1.2.4.6  jdolecek 	uint32_t size;	/* handle returned here */
    336  1.2.4.6  jdolecek 	uint32_t align;
    337  1.2.4.6  jdolecek 	uint32_t flags;
    338  1.2.4.6  jdolecek /*
    339  1.2.4.6  jdolecek  * flag definitions from
    340  1.2.4.6  jdolecek  * https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface
    341  1.2.4.6  jdolecek  */
    342  1.2.4.6  jdolecek #define MEM_FLAG_DISCARDABLE	(1 << 0) /* can be resized to 0 at any time. Use for cached data */
    343  1.2.4.6  jdolecek #define MEM_FLAG_NORMAL		(0 << 2) /* normal allocating alias. Don't use from ARM */
    344  1.2.4.6  jdolecek #define MEM_FLAG_DIRECT		(1 << 2) /* 0xC alias uncached */
    345  1.2.4.6  jdolecek #define MEM_FLAG_COHERENT	(2 << 2) /* 0x8 alias. Non-allocating in L2 but coherent */
    346  1.2.4.6  jdolecek #define MEM_FLAG_L1_NONALLOCATING (MEM_FLAG_DIRECT | MEM_FLAG_COHERENT) /* Allocating in L2 */
    347  1.2.4.6  jdolecek #define MEM_FLAG_ZERO		(1 << 4)  /* initialise buffer to all zeros */
    348  1.2.4.6  jdolecek #define MEM_FLAG_NO_INIT	(1 << 5) /* don't initialise (default is initialise to all ones */
    349  1.2.4.6  jdolecek #define MEM_FLAG_HINT_PERMALOCK	(1 << 6) /* Likely to be locked for long periods of time. */
    350  1.2.4.6  jdolecek };
    351  1.2.4.6  jdolecek 
    352  1.2.4.6  jdolecek /* also for unlock and release */
    353  1.2.4.6  jdolecek struct vcprop_tag_lockmem {
    354  1.2.4.6  jdolecek 	struct vcprop_tag tag;
    355  1.2.4.6  jdolecek 	uint32_t handle;	/* bus address returned here */
    356  1.2.4.6  jdolecek };
    357  1.2.4.6  jdolecek 
    358  1.2.4.2       tls struct vcprop_buffer_hdr {
    359  1.2.4.2       tls 	uint32_t vpb_len;
    360  1.2.4.2       tls 	uint32_t vpb_rcode;
    361  1.2.4.2       tls #define	VCPROP_PROCESS_REQUEST 0
    362  1.2.4.2       tls #define VCPROP_REQ_SUCCESS	(1U << 31)
    363  1.2.4.2       tls #define VCPROP_REQ_EPARSE	(1U << 0)
    364  1.2.4.2       tls };
    365  1.2.4.2       tls 
    366  1.2.4.2       tls static inline bool
    367  1.2.4.2       tls vcprop_buffer_success_p(struct vcprop_buffer_hdr *vpbh)
    368  1.2.4.2       tls {
    369  1.2.4.2       tls 
    370  1.2.4.2       tls 	return (vpbh->vpb_rcode & VCPROP_REQ_SUCCESS);
    371  1.2.4.2       tls }
    372  1.2.4.2       tls 
    373  1.2.4.2       tls static inline bool
    374  1.2.4.2       tls vcprop_tag_success_p(struct vcprop_tag *vpbt)
    375  1.2.4.2       tls {
    376  1.2.4.2       tls 
    377  1.2.4.2       tls 	return (vpbt->vpt_rcode & VCPROPTAG_RESPONSE);
    378  1.2.4.2       tls }
    379  1.2.4.2       tls 
    380  1.2.4.2       tls static inline size_t
    381  1.2.4.2       tls vcprop_tag_resplen(struct vcprop_tag *vpbt)
    382  1.2.4.2       tls {
    383  1.2.4.2       tls 
    384  1.2.4.2       tls 	return (vpbt->vpt_rcode & ~VCPROPTAG_RESPONSE);
    385  1.2.4.2       tls }
    386  1.2.4.2       tls 
    387  1.2.4.2       tls #endif	/* _EVBARM_RPI_VCPROP_H_ */
    388  1.2.4.6  jdolecek 
    389  1.2.4.6  jdolecek uint32_t rpi_alloc_mem(uint32_t, uint32_t, uint32_t);
    390  1.2.4.6  jdolecek bus_addr_t rpi_lock_mem(uint32_t);
    391  1.2.4.6  jdolecek int rpi_unlock_mem(uint32_t);
    392  1.2.4.6  jdolecek int rpi_release_mem(uint32_t);
    393  1.2.4.6  jdolecek 
    394  1.2.4.6  jdolecek int rpi_fb_set_video(int);
    395  1.2.4.6  jdolecek 
    396  1.2.4.6  jdolecek int rpi_fb_movecursor(int, int, int);
    397  1.2.4.6  jdolecek int rpi_fb_initcursor(bus_addr_t, int, int);
    398