45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * SBUS bus-specific declarations
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Permission is hereby granted, free of charge, to any person obtaining a copy
45e9809aff7304721fddb95654901b32195c9c7avboxsync * of this software and associated documentation files (the "Software"), to deal
45e9809aff7304721fddb95654901b32195c9c7avboxsync * in the Software without restriction, including without limitation the rights
45e9809aff7304721fddb95654901b32195c9c7avboxsync * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
45e9809aff7304721fddb95654901b32195c9c7avboxsync * copies of the Software, and to permit persons to whom the Software is
45e9809aff7304721fddb95654901b32195c9c7avboxsync * furnished to do so, subject to the following conditions:
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * The above copyright notice and this permission notice shall be included in
45e9809aff7304721fddb95654901b32195c9c7avboxsync * all copies or substantial portions of the Software.
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45e9809aff7304721fddb95654901b32195c9c7avboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
45e9809aff7304721fddb95654901b32195c9c7avboxsync * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
45e9809aff7304721fddb95654901b32195c9c7avboxsync * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
45e9809aff7304721fddb95654901b32195c9c7avboxsync * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef _XF86_SBUSBUS_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define _XF86_SBUSBUS_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "xf86str.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SBUS_DEVICE_BW2 0x0001
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SBUS_DEVICE_CG2 0x0002
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SBUS_DEVICE_CG3 0x0003
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SBUS_DEVICE_CG4 0x0004
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SBUS_DEVICE_CG6 0x0005
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SBUS_DEVICE_CG8 0x0006
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SBUS_DEVICE_CG12 0x0007
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SBUS_DEVICE_CG14 0x0008
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SBUS_DEVICE_LEO 0x0009
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SBUS_DEVICE_TCX 0x000a
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SBUS_DEVICE_FFB 0x000b
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SBUS_DEVICE_GT 0x000c
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define SBUS_DEVICE_MGX 0x000d
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct sbus_prom_node {
45e9809aff7304721fddb95654901b32195c9c7avboxsync int node;
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* Because of misdesigned openpromio */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int cookie[2];
45e9809aff7304721fddb95654901b32195c9c7avboxsync} sbusPromNode, *sbusPromNodePtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct sbus_device {
45e9809aff7304721fddb95654901b32195c9c7avboxsync int devId;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int fbNum;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int fd;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int width, height;
45e9809aff7304721fddb95654901b32195c9c7avboxsync sbusPromNode node;
45e9809aff7304721fddb95654901b32195c9c7avboxsync char *descr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync char *device;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} sbusDevice, *sbusDevicePtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern struct sbus_devtable {
45e9809aff7304721fddb95654901b32195c9c7avboxsync int devId;
45e9809aff7304721fddb95654901b32195c9c7avboxsync int fbType;
45e9809aff7304721fddb95654901b32195c9c7avboxsync char *promName;
45e9809aff7304721fddb95654901b32195c9c7avboxsync char *descr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} sbusDeviceTable[];
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid xf86SbusProbe(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern sbusDevicePtr *xf86SbusInfo;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncint xf86MatchSbusInstances(const char *driverName, int sbusDevId,
45e9809aff7304721fddb95654901b32195c9c7avboxsync GDevPtr *devList, int numDevs, DriverPtr drvp,
45e9809aff7304721fddb95654901b32195c9c7avboxsync int **foundEntities);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncsbusDevicePtr xf86GetSbusInfoForEntity(int entityIndex);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncint xf86GetEntityForSbusInfo(sbusDevicePtr psdp);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncpointer xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned long size);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid xf86SbusHideOsHwCursor(sbusDevicePtr psdp);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid xf86SbusSetOsHwCursorCmap(sbusDevicePtr psdp, int bg, int fg);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncBool xf86SbusHandleColormaps(ScreenPtr pScreen, sbusDevicePtr psdp);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern int promRootNode;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncint promGetSibling(int node);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncint promGetChild(int node);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncchar * promGetProperty(const char *prop, int *lenp);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncint promGetBool(const char *prop);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncint sparcPromInit(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid sparcPromClose(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncchar * sparcPromGetProperty(sbusPromNodePtr pnode, const char *prop, int *lenp);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncint sparcPromGetBool(sbusPromNodePtr pnode, const char *prop);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncvoid sparcPromAssignNodes(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncchar * sparcPromNode2Pathname(sbusPromNodePtr pnode);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncint sparcPromPathname2Node(const char *pathName);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* _XF86_SBUSBUS_H */