Blame view
include/ide.h
1.87 KB
83d290c56
|
1 |
/* SPDX-License-Identifier: GPL-2.0+ */ |
0f9cfa09d
|
2 3 4 |
/* * (C) Copyright 2000 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
0f9cfa09d
|
5 6 7 8 |
*/ #ifndef _IDE_H #define _IDE_H |
1a73661bc
|
9 |
#include <blk.h> |
8a10180d6
|
10 |
#define IDE_BUS(dev) (dev / (CONFIG_SYS_IDE_MAXDEVICE / CONFIG_SYS_IDE_MAXBUS)) |
0f9cfa09d
|
11 |
|
6d0f6bcf3
|
12 |
#define ATA_CURR_BASE(dev) (CONFIG_SYS_ATA_BASE_ADDR+ide_bus_offset[IDE_BUS(dev)]) |
f5b82c0f9
|
13 |
extern ulong ide_bus_offset[]; |
f98984cb1
|
14 |
|
0f9cfa09d
|
15 16 17 |
/* * Function Prototypes */ |
735dd97b1
|
18 |
void ide_init(void); |
4101f6879
|
19 |
struct blk_desc; |
145df842b
|
20 21 22 23 24 25 26 |
struct udevice; #ifdef CONFIG_BLK ulong ide_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, void *buffer); ulong ide_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, const void *buffer); #else |
4101f6879
|
27 |
ulong ide_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt, |
7c4213f6a
|
28 |
void *buffer); |
4101f6879
|
29 |
ulong ide_write(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt, |
ff8fef566
|
30 |
const void *buffer); |
145df842b
|
31 |
#endif |
0f9cfa09d
|
32 |
|
8d1165e11
|
33 34 35 |
#ifdef CONFIG_IDE_PREINIT int ide_preinit(void); #endif |
3887c3fbd
|
36 37 38 |
#if defined(CONFIG_OF_IDE_FIXUP) int ide_device_present(int dev); #endif |
0abddf82d
|
39 40 41 42 43 |
#if defined(CONFIG_IDE_AHB) unsigned char ide_read_register(int dev, unsigned int port); void ide_write_register(int dev, unsigned int port, unsigned char val); void ide_read_data(int dev, ulong *sect_buf, int words); |
c575180ba
|
44 |
void ide_write_data(int dev, const ulong *sect_buf, int words); |
0abddf82d
|
45 |
#endif |
f5b82c0f9
|
46 47 48 49 |
/* * I/O function overrides */ |
288afdc9b
|
50 51 |
unsigned char ide_inb(int dev, int port); void ide_outb(int dev, int port, unsigned char val); |
f5b82c0f9
|
52 53 54 55 56 |
void ide_input_swap_data(int dev, ulong *sect_buf, int words); void ide_input_data(int dev, ulong *sect_buf, int words); void ide_output_data(int dev, const ulong *sect_buf, int words); void ide_input_data_shorts(int dev, ushort *sect_buf, int shorts); void ide_output_data_shorts(int dev, ushort *sect_buf, int shorts); |
288afdc9b
|
57 |
void ide_led(uchar led, uchar status); |
c2240d4db
|
58 59 60 61 62 63 |
/** * board_start_ide() - Start up the board IDE interfac * * @return 0 if ok */ int board_start_ide(void); |
0f9cfa09d
|
64 |
#endif /* _IDE_H */ |