1 | /*
|
---|
2 | * SBUS bus-specific declarations
|
---|
3 | *
|
---|
4 | * Copyright (C) 2000 Jakub Jelinek ([email protected])
|
---|
5 | *
|
---|
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
---|
7 | * of this software and associated documentation files (the "Software"), to deal
|
---|
8 | * in the Software without restriction, including without limitation the rights
|
---|
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
---|
10 | * copies of the Software, and to permit persons to whom the Software is
|
---|
11 | * furnished to do so, subject to the following conditions:
|
---|
12 | *
|
---|
13 | * The above copyright notice and this permission notice shall be included in
|
---|
14 | * all copies or substantial portions of the Software.
|
---|
15 | *
|
---|
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
---|
19 | * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
---|
20 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
22 | */
|
---|
23 | /* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.h,v 3.5 2002/12/10 02:42:35 tsi Exp $ */
|
---|
24 |
|
---|
25 | #ifndef _XF86_SBUSBUS_H
|
---|
26 | #define _XF86_SBUSBUS_H
|
---|
27 |
|
---|
28 | #include "xf86str.h"
|
---|
29 |
|
---|
30 | #define SBUS_DEVICE_BW2 0x0001
|
---|
31 | #define SBUS_DEVICE_CG2 0x0002
|
---|
32 | #define SBUS_DEVICE_CG3 0x0003
|
---|
33 | #define SBUS_DEVICE_CG4 0x0004
|
---|
34 | #define SBUS_DEVICE_CG6 0x0005
|
---|
35 | #define SBUS_DEVICE_CG8 0x0006
|
---|
36 | #define SBUS_DEVICE_CG12 0x0007
|
---|
37 | #define SBUS_DEVICE_CG14 0x0008
|
---|
38 | #define SBUS_DEVICE_LEO 0x0009
|
---|
39 | #define SBUS_DEVICE_TCX 0x000a
|
---|
40 | #define SBUS_DEVICE_FFB 0x000b
|
---|
41 | #define SBUS_DEVICE_GT 0x000c
|
---|
42 | #define SBUS_DEVICE_MGX 0x000d
|
---|
43 |
|
---|
44 | typedef struct sbus_prom_node {
|
---|
45 | int node;
|
---|
46 | /* Because of misdesigned openpromio */
|
---|
47 | int cookie[2];
|
---|
48 | } sbusPromNode, *sbusPromNodePtr;
|
---|
49 |
|
---|
50 | typedef struct sbus_device {
|
---|
51 | int devId;
|
---|
52 | int fbNum;
|
---|
53 | int fd;
|
---|
54 | int width, height;
|
---|
55 | sbusPromNode node;
|
---|
56 | char *descr;
|
---|
57 | char *device;
|
---|
58 | } sbusDevice, *sbusDevicePtr;
|
---|
59 |
|
---|
60 | extern struct sbus_devtable {
|
---|
61 | int devId;
|
---|
62 | int fbType;
|
---|
63 | char *promName;
|
---|
64 | char *descr;
|
---|
65 | } sbusDeviceTable[];
|
---|
66 |
|
---|
67 | void xf86SbusProbe(void);
|
---|
68 | extern sbusDevicePtr *xf86SbusInfo;
|
---|
69 |
|
---|
70 | int xf86MatchSbusInstances(const char *driverName, int sbusDevId,
|
---|
71 | GDevPtr *devList, int numDevs, DriverPtr drvp,
|
---|
72 | int **foundEntities);
|
---|
73 | sbusDevicePtr xf86GetSbusInfoForEntity(int entityIndex);
|
---|
74 | int xf86GetEntityForSbusInfo(sbusDevicePtr psdp);
|
---|
75 | void xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp);
|
---|
76 | pointer xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset,
|
---|
77 | unsigned long size);
|
---|
78 | void xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size);
|
---|
79 | void xf86SbusHideOsHwCursor(sbusDevicePtr psdp);
|
---|
80 | void xf86SbusSetOsHwCursorCmap(sbusDevicePtr psdp, int bg, int fg);
|
---|
81 | Bool xf86SbusHandleColormaps(ScreenPtr pScreen, sbusDevicePtr psdp);
|
---|
82 |
|
---|
83 | extern int promRootNode;
|
---|
84 |
|
---|
85 | int promGetSibling(int node);
|
---|
86 | int promGetChild(int node);
|
---|
87 | char * promGetProperty(const char *prop, int *lenp);
|
---|
88 | int promGetBool(const char *prop);
|
---|
89 |
|
---|
90 | int sparcPromInit(void);
|
---|
91 | void sparcPromClose(void);
|
---|
92 | char * sparcPromGetProperty(sbusPromNodePtr pnode, const char *prop, int *lenp);
|
---|
93 | int sparcPromGetBool(sbusPromNodePtr pnode, const char *prop);
|
---|
94 | void sparcPromAssignNodes(void);
|
---|
95 | char * sparcPromNode2Pathname(sbusPromNodePtr pnode);
|
---|
96 | int sparcPromPathname2Node(const char *pathName);
|
---|
97 |
|
---|
98 | #endif /* _XF86_SBUSBUS_H */
|
---|