xref: /rk3399_rockchip-uboot/include/ide.h (revision eb867a76238fb38e952c37871b16d0d7fd61c95f)
10f9cfa09Swdenk /*
20f9cfa09Swdenk  * (C) Copyright 2000
30f9cfa09Swdenk  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
40f9cfa09Swdenk  *
50f9cfa09Swdenk  * See file CREDITS for list of people who contributed to this
60f9cfa09Swdenk  * project.
70f9cfa09Swdenk  *
80f9cfa09Swdenk  * This program is free software; you can redistribute it and/or
90f9cfa09Swdenk  * modify it under the terms of the GNU General Public License as
100f9cfa09Swdenk  * published by the Free Software Foundation; either version 2 of
110f9cfa09Swdenk  * the License, or (at your option) any later version.
120f9cfa09Swdenk  *
130f9cfa09Swdenk  * This program is distributed in the hope that it will be useful,
140f9cfa09Swdenk  * but WITHOUT ANY WARRANTY; without even the implied warranty of
150f9cfa09Swdenk  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
160f9cfa09Swdenk  * GNU General Public License for more details.
170f9cfa09Swdenk  *
180f9cfa09Swdenk  * You should have received a copy of the GNU General Public License
190f9cfa09Swdenk  * along with this program; if not, write to the Free Software
200f9cfa09Swdenk  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
210f9cfa09Swdenk  * MA 02111-1307 USA
220f9cfa09Swdenk  */
230f9cfa09Swdenk 
240f9cfa09Swdenk #ifndef	_IDE_H
250f9cfa09Swdenk #define _IDE_H
260f9cfa09Swdenk 
270f9cfa09Swdenk #define	IDE_BUS(dev)	(dev >> 1)
280f9cfa09Swdenk 
290f9cfa09Swdenk #ifdef CONFIG_IDE_LED
300f9cfa09Swdenk 
310f9cfa09Swdenk /*
320f9cfa09Swdenk  * LED Port
330f9cfa09Swdenk  */
340f9cfa09Swdenk #define	LED_PORT	((uchar *)(PER8_BASE + 0x3000))
350f9cfa09Swdenk #define LED_IDE1	0x01
360f9cfa09Swdenk #define LED_IDE2	0x02
370f9cfa09Swdenk #define	DEVICE_LED(d)	((d & 2) | ((d & 2) == 0)) /* depends on bit positions! */
380f9cfa09Swdenk 
390f9cfa09Swdenk #endif /* CONFIG_IDE_LED */
400f9cfa09Swdenk 
4142dfe7a1Swdenk #ifdef CFG_64BIT_LBA
42c40b2956Swdenk typedef uint64_t lbaint_t;
43c40b2956Swdenk #else
44c40b2956Swdenk typedef ulong lbaint_t;
45c40b2956Swdenk #endif
46c40b2956Swdenk 
470f9cfa09Swdenk /*
480f9cfa09Swdenk  * Function Prototypes
490f9cfa09Swdenk  */
500f9cfa09Swdenk 
510f9cfa09Swdenk void ide_init(void);
52*eb867a76SGrant Likely ulong ide_read(int device, lbaint_t blknr, ulong blkcnt, void *buffer);
53*eb867a76SGrant Likely ulong ide_write(int device, lbaint_t blknr, ulong blkcnt, void *buffer);
540f9cfa09Swdenk 
550f9cfa09Swdenk #endif /* _IDE_H */
56