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