Home | History | Annotate | Line # | Download | only in pci
      1  1.6    martin /*	$NetBSD: pciide_sl82c105_reg.h,v 1.6 2008/04/28 20:23:55 martin Exp $	*/
      2  1.1   thorpej 
      3  1.1   thorpej /*-
      4  1.1   thorpej  * Copyright (c) 2002 The NetBSD Foundation, Inc.
      5  1.1   thorpej  * All rights reserved.
      6  1.1   thorpej  *
      7  1.1   thorpej  * This code is derived from software contributed to The NetBSD Foundation
      8  1.1   thorpej  * by Jason R. Thorpe.
      9  1.1   thorpej  *
     10  1.1   thorpej  * Redistribution and use in source and binary forms, with or without
     11  1.1   thorpej  * modification, are permitted provided that the following conditions
     12  1.1   thorpej  * are met:
     13  1.1   thorpej  * 1. Redistributions of source code must retain the above copyright
     14  1.1   thorpej  *    notice, this list of conditions and the following disclaimer.
     15  1.1   thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1   thorpej  *    notice, this list of conditions and the following disclaimer in the
     17  1.1   thorpej  *    documentation and/or other materials provided with the distribution.
     18  1.1   thorpej  *
     19  1.1   thorpej  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20  1.1   thorpej  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21  1.1   thorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22  1.1   thorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23  1.1   thorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24  1.1   thorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25  1.1   thorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26  1.1   thorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27  1.1   thorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28  1.1   thorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29  1.1   thorpej  * POSSIBILITY OF SUCH DAMAGE.
     30  1.1   thorpej  */
     31  1.1   thorpej 
     32  1.1   thorpej /*
     33  1.1   thorpej  * Register definitions for the Symphony Labs 82C105 PCI IDE
     34  1.1   thorpej  * interface.  This 82C105 is also found embedded in the Winbond
     35  1.1   thorpej  * 83C553 Southbridge.
     36  1.1   thorpej  */
     37  1.1   thorpej 
     38  1.1   thorpej /* PCI configuration space registers */
     39  1.1   thorpej 
     40  1.1   thorpej #define	SYMPH_PORT0_P	(PCI_MAPREG_START + 0x00)	/* port 0 primary */
     41  1.1   thorpej #define	SYMPH_PORT0_S	(PCI_MAPREG_START + 0x04)	/* port 0 secondary */
     42  1.1   thorpej #define	SYMPH_PORT1_P	(PCI_MAPREG_START + 0x08)	/* port 1 primary */
     43  1.1   thorpej #define	SYMPH_PORT1_S	(PCI_MAPREG_START + 0x0c)	/* port 1 secondary */
     44  1.1   thorpej #define	SYMPH_BMIDER	(PCI_MAPREG_START + 0x10)	/* bus master regs */
     45  1.1   thorpej 
     46  1.1   thorpej #define	SYMPH_IDECSR	0x40		/* IDE control/status */
     47  1.1   thorpej #define	SYMPH_P0D0CR	0x44		/* port 0 drive 0 control */
     48  1.1   thorpej #define	SYMPH_P0D1CR	0x48		/* port 0 drive 1 control */
     49  1.1   thorpej #define	SYMPH_P1D0CR	0x4c		/* port 1 drive 0 control */
     50  1.4  nisimura #define	SYMPH_P1D1CR	0x50		/* port 1 drive 1 control */
     51  1.1   thorpej 
     52  1.1   thorpej #define	IDECR_IDE_IRQB	(1U << 30)	/* IDE_IRQB signal */
     53  1.1   thorpej #define	IDECR_IDE_IRQA	(1U << 28)	/* IDE_IRQA signal */
     54  1.1   thorpej #define	IDECR_RA_SHIFT	16		/* read-ahead duration */
     55  1.1   thorpej #define	IDECR_RA_MASK	(0x7ff << IDECR_RA_SHIFT)
     56  1.4  nisimura #define	IDECR_LEGIRQ	(1U << 11)	/* don't use legacy IRQ mode */
     57  1.1   thorpej #define	IDECR_P1F16	(1U << 5)	/* port 1 fast 16 */
     58  1.1   thorpej #define	IDECR_P1EN	(1U << 4)	/* port 1 enable */
     59  1.1   thorpej #define	IDECR_P0F16	(1U << 1)	/* port 0 fast 16 */
     60  1.1   thorpej #define	IDECR_P0EN	(1U << 0)	/* port 0 enable */
     61  1.1   thorpej 
     62  1.1   thorpej #define	PxDx_USR_SHIFT	16		/* user defined bits */
     63  1.1   thorpej #define	PxDx_USR_MASK	(0xff << PxDx_USR_SHIFT)
     64  1.1   thorpej #define	PxDx_CMD_ON_SHIFT 8		/* CMD ON time */
     65  1.1   thorpej #define	PxDx_CMD_ON_MASK (0x1f << PxDx_CMD_ON_SHIFT)
     66  1.1   thorpej #define	PxDx_PWEN	(1U << 7)	/* posted write enable */
     67  1.1   thorpej #define	PxDx_RDYEN	(1U << 6)	/* IOCHRDY enable */
     68  1.1   thorpej #define	PxDx_RAEN	(1U << 5)	/* read-ahead enable */
     69  1.1   thorpej #define	PxDx_CMD_OFF_MASK (0x1f)	/* CMD OFF time */
     70  1.1   thorpej 
     71  1.1   thorpej /*
     72  1.1   thorpej  * IDE CMD ON and CMD OFF times for a 33MHz PCI bus clock.
     73  1.1   thorpej  *
     74  1.1   thorpej  * These come from Table 4-4 of the 83c553 manual.
     75  1.1   thorpej  */
     76  1.1   thorpej struct symph_cmdtime {
     77  1.1   thorpej 	int	cmd_on;		/* cmd on time */
     78  1.1   thorpej 	int	cmd_off;	/* cmd off time */
     79  1.1   thorpej };
     80  1.1   thorpej 
     81  1.2     perry static const struct symph_cmdtime symph_pio_times[]
     82  1.5     perry     __unused = {
     83  1.1   thorpej /*        programmed               actual       */
     84  1.1   thorpej 	{ 5, 13 },		/* 6, 14 */
     85  1.1   thorpej 	{ 4, 7 },		/* 5, 8 */
     86  1.1   thorpej 	{ 3, 4 },		/* 4, 5 */
     87  1.1   thorpej 	{ 2, 2 },		/* 3, 3 */
     88  1.1   thorpej 	{ 2, 0 },		/* 3, 1 */
     89  1.1   thorpej 	{ 1, 0 },		/* 2, 1 */
     90  1.1   thorpej };
     91  1.1   thorpej 
     92  1.1   thorpej static const struct symph_cmdtime symph_sw_dma_times[]
     93  1.5     perry     __unused = {
     94  1.1   thorpej /*        programmed               actual       */
     95  1.1   thorpej 	{ 15, 15 },		/* 16, 16 */
     96  1.1   thorpej };
     97  1.1   thorpej 
     98  1.1   thorpej static const struct symph_cmdtime symph_mw_dma_times[]
     99  1.5     perry      __unused = {
    100  1.1   thorpej /*        programmed               actual       */
    101  1.1   thorpej 	{ 7, 7 },		/* 8, 8 */
    102  1.1   thorpej 	{ 2, 1 },		/* 3, 2 */
    103  1.1   thorpej 	{ 2, 0 },		/* 3, 1 */
    104  1.1   thorpej 	{ 1, 0 },		/* 2, 1 */
    105  1.1   thorpej };
    106