Path: blob/master/arch/m68k/include/asm/amigayle.h
10820 views
/*1** asm-m68k/amigayle.h -- This header defines the registers of the gayle chip2** found on the Amiga 12003** This information was found by disassembling card.resource,4** so the definitions may not be 100% correct5** anyone has an official doc ?6**7** Copyright 1997 by Alain Malek8**9** This file is subject to the terms and conditions of the GNU General Public10** License. See the file COPYING in the main directory of this archive11** for more details.12**13** Created: 11/28/97 by Alain Malek14*/1516#ifndef _M68K_AMIGAYLE_H_17#define _M68K_AMIGAYLE_H_1819#include <linux/types.h>20#include <asm/amigahw.h>2122/* memory layout */2324#define GAYLE_RAM (0x600000+zTwoBase)25#define GAYLE_RAMSIZE (0x400000)26#define GAYLE_ATTRIBUTE (0xa00000+zTwoBase)27#define GAYLE_ATTRIBUTESIZE (0x020000)28#define GAYLE_IO (0xa20000+zTwoBase) /* 16bit and even 8bit registers */29#define GAYLE_IOSIZE (0x010000)30#define GAYLE_IO_8BITODD (0xa30000+zTwoBase) /* odd 8bit registers */3132/* offset for accessing odd IO registers */33#define GAYLE_ODD (GAYLE_IO_8BITODD-GAYLE_IO-1)3435/* GAYLE registers */3637struct GAYLE {38u_char cardstatus;39u_char pad0[0x1000-1];4041u_char intreq;42u_char pad1[0x1000-1];4344u_char inten;45u_char pad2[0x1000-1];4647u_char config;48u_char pad3[0x1000-1];49};5051#define GAYLE_ADDRESS (0xda8000) /* gayle main registers base address */5253#define GAYLE_RESET (0xa40000) /* write 0x00 to start reset,54read 1 byte to stop reset */5556#define gayle (*(volatile struct GAYLE *)(zTwoBase+GAYLE_ADDRESS))57#define gayle_reset (*(volatile u_char *)(zTwoBase+GAYLE_RESET))5859#define gayle_attribute ((volatile u_char *)(GAYLE_ATTRIBUTE))6061#if 062#define gayle_inb(a) readb( GAYLE_IO+(a)+(((a)&1)*GAYLE_ODD) )63#define gayle_outb(v,a) writeb( v, GAYLE_IO+(a)+(((a)&1)*GAYLE_ODD) )6465#define gayle_inw(a) readw( GAYLE_IO+(a) )66#define gayle_outw(v,a) writew( v, GAYLE_IO+(a) )67#endif6869/* GAYLE_CARDSTATUS bit def */7071#define GAYLE_CS_CCDET 0x40 /* credit card detect */72#define GAYLE_CS_BVD1 0x20 /* battery voltage detect 1 */73#define GAYLE_CS_SC 0x20 /* credit card status change */74#define GAYLE_CS_BVD2 0x10 /* battery voltage detect 2 */75#define GAYLE_CS_DA 0x10 /* digital audio */76#define GAYLE_CS_WR 0x08 /* write enable (1 == enabled) */77#define GAYLE_CS_BSY 0x04 /* credit card busy */78#define GAYLE_CS_IRQ 0x04 /* interrupt request */7980/* GAYLE_IRQ bit def */8182#define GAYLE_IRQ_IDE 0x8083#define GAYLE_IRQ_CCDET 0x4084#define GAYLE_IRQ_BVD1 0x2085#define GAYLE_IRQ_SC 0x2086#define GAYLE_IRQ_BVD2 0x1087#define GAYLE_IRQ_DA 0x1088#define GAYLE_IRQ_WR 0x0889#define GAYLE_IRQ_BSY 0x0490#define GAYLE_IRQ_IRQ 0x0491#define GAYLE_IRQ_IDEACK1 0x0292#define GAYLE_IRQ_IDEACK0 0x019394/* GAYLE_CONFIG bit def95(bit 0-1 for program voltage, bit 2-3 for access speed */9697#define GAYLE_CFG_0V 0x0098#define GAYLE_CFG_5V 0x0199#define GAYLE_CFG_12V 0x02100101#define GAYLE_CFG_100NS 0x08102#define GAYLE_CFG_150NS 0x04103#define GAYLE_CFG_250NS 0x00104#define GAYLE_CFG_720NS 0x0c105106struct gayle_ide_platform_data {107unsigned long base;108unsigned long irqport;109int explicit_ack; /* A1200 IDE needs explicit ack */110};111112#endif /* asm-m68k/amigayle.h */113114115