8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence/*
135bcc2e42a94543f11af2a4196b13552ab46d89Automatic Updater * SBUS bus-specific declarations
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews *
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater *
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence * Permission is hereby granted, free of charge, to any person obtaining a copy
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence * of this software and associated documentation files (the "Software"), to deal
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * in the Software without restriction, including without limitation the rights
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * copies of the Software, and to permit persons to whom the Software is
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * furnished to do so, subject to the following conditions:
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews *
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * The above copyright notice and this permission notice shall be included in
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * all copies or substantial portions of the Software.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews *
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
a2734fa74aecefc958622b01467398985041cec1Mark Andrews * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
a2734fa74aecefc958622b01467398985041cec1Mark Andrews * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
a2734fa74aecefc958622b01467398985041cec1Mark Andrews * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
a2734fa74aecefc958622b01467398985041cec1Mark Andrews * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
a2734fa74aecefc958622b01467398985041cec1Mark Andrews */
a2734fa74aecefc958622b01467398985041cec1Mark Andrews
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#ifndef _XF86_SBUSBUS_H
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#define _XF86_SBUSBUS_H
a2734fa74aecefc958622b01467398985041cec1Mark Andrews
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#include "xf86str.h"
a2734fa74aecefc958622b01467398985041cec1Mark Andrews
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#define SBUS_DEVICE_BW2 0x0001
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#define SBUS_DEVICE_CG2 0x0002
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#define SBUS_DEVICE_CG3 0x0003
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#define SBUS_DEVICE_CG4 0x0004
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#define SBUS_DEVICE_CG6 0x0005
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#define SBUS_DEVICE_CG8 0x0006
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#define SBUS_DEVICE_CG12 0x0007
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#define SBUS_DEVICE_CG14 0x0008
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#define SBUS_DEVICE_LEO 0x0009
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#define SBUS_DEVICE_TCX 0x000a
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#define SBUS_DEVICE_FFB 0x000b
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#define SBUS_DEVICE_GT 0x000c
a2734fa74aecefc958622b01467398985041cec1Mark Andrews#define SBUS_DEVICE_MGX 0x000d
a2734fa74aecefc958622b01467398985041cec1Mark Andrews
a2734fa74aecefc958622b01467398985041cec1Mark Andrewstypedef struct sbus_prom_node {
a2734fa74aecefc958622b01467398985041cec1Mark Andrews int node;
a2734fa74aecefc958622b01467398985041cec1Mark Andrews /* Because of misdesigned openpromio */
a2734fa74aecefc958622b01467398985041cec1Mark Andrews int cookie[2];
a2734fa74aecefc958622b01467398985041cec1Mark Andrews} sbusPromNode, *sbusPromNodePtr;
a2734fa74aecefc958622b01467398985041cec1Mark Andrews
a2734fa74aecefc958622b01467398985041cec1Mark Andrewstypedef struct sbus_device {
a2734fa74aecefc958622b01467398985041cec1Mark Andrews int devId;
135bcc2e42a94543f11af2a4196b13552ab46d89Automatic Updater int fbNum;
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein int fd;
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein int width, height;
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence sbusPromNode node;
6b7257f756eb0530cdf54df9a7fab8d51a5001c3David Lawrence char *descr;
6b7257f756eb0530cdf54df9a7fab8d51a5001c3David Lawrence char *device;
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence} sbusDevice, *sbusDevicePtr;
34e5a08809dda3276252269ebddd1616e62081a2Mark Andrews
826c281a05cb89c9c28621937dc83fa676a5b207David Lawrenceextern struct sbus_devtable {
ab7c67129234bbaa03c2529729d8da746a453a49Michael Graff int devId;
3507ae5d59e8574970bbe9246287209418d8351bDavid Lawrence int fbType;
3507ae5d59e8574970bbe9246287209418d8351bDavid Lawrence char *promName;
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence char *driverName;
34e5a08809dda3276252269ebddd1616e62081a2Mark Andrews char *descr;
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence} sbusDeviceTable[];
a823dfa6638d57d20d023910f2e98b4efe80fd16Brian Wellington
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrencevoid xf86SbusProbe(void);
a548a3c20cf520a61b7e6c6332de51bae2314e45Andreas Gustafssonextern sbusDevicePtr *xf86SbusInfo;
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence
e502b133d630bda0ee64c1e2ce6729d96750d8abMark Andrewsint xf86MatchSbusInstances(const char *driverName, int sbusDevId,
747abb4993e03b8812514e4476bff67f5248c717Evan Hunt GDevPtr *devList, int numDevs, DriverPtr drvp,
34e5a08809dda3276252269ebddd1616e62081a2Mark Andrews int **foundEntities);
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid LawrencesbusDevicePtr xf86GetSbusInfoForEntity(int entityIndex);
2c34cafc1c7c5176c3f34dc80ba889c54fdec681David Lawrenceint xf86GetEntityForSbusInfo(sbusDevicePtr psdp);
364a82f7c25b62967678027043425201a5e5171aBob Halleyvoid xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrencepointer xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset,
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence unsigned long size);
996f4a8bc34cb0203ce6a40ff82bca8bf32423ccAndreas Gustafssonvoid xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrencevoid xf86SbusHideOsHwCursor(sbusDevicePtr psdp);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrencevoid xf86SbusSetOsHwCursorCmap(sbusDevicePtr psdp, int bg, int fg);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David LawrenceBool xf86SbusHandleColormaps(ScreenPtr pScreen, sbusDevicePtr psdp);
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrenceextern int promRootNode;
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrenceint promGetSibling(int node);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrenceint promGetChild(int node);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrencechar * promGetProperty(const char *prop, int *lenp);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrenceint promGetBool(const char *prop);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrenceint sparcPromInit(void);
bb5de152900ed45191b73116a5d18dbb74a0ef92Brian Wellingtonvoid sparcPromClose(void);
bb5de152900ed45191b73116a5d18dbb74a0ef92Brian Wellingtonchar * sparcPromGetProperty(sbusPromNodePtr pnode, const char *prop, int *lenp);
bb5de152900ed45191b73116a5d18dbb74a0ef92Brian Wellingtonint sparcPromGetBool(sbusPromNodePtr pnode, const char *prop);
996f4a8bc34cb0203ce6a40ff82bca8bf32423ccAndreas Gustafssonvoid sparcPromAssignNodes(void);
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrencechar * sparcPromNode2Pathname(sbusPromNodePtr pnode);
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrenceint sparcPromPathname2Node(const char *pathName);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrencechar *sparcDriverName(void);
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence#endif /* _XF86_SBUSBUS_H */
8b7304a34c751e519ede7d00b77f1f962c0a37e4David Lawrence