diff options
| author | Tom Rini <[email protected]> | 2023-04-27 16:33:58 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-04-27 16:33:58 -0400 |
| commit | b197f1f05dee730e173a0756cb1a5f2be5d3ba5b (patch) | |
| tree | 1a6497490d05e29ed05e14a94e7fdbfb31b35b6a /include | |
| parent | caf0a88d9f317aecada0cece5d7f9df371058805 (diff) | |
| parent | 22a7ae3675899985964eaec418474ab525975c0e (diff) | |
Merge branch '2023-04-27-IDE-code-cleanups'
To quote the author:
This code was converted to driver model a long time again but it was a
pretty rough conversion. It introduced a few minor bugs, e.g. the device
capacity is incorrect and some flags are lost (such as lba48).
This series tidies up the code and fixes these bugs. This involves quite
a bit of refactoring, so it is done one patch at a time for easier
review.
Diffstat (limited to 'include')
| -rw-r--r-- | include/blk.h | 5 | ||||
| -rw-r--r-- | include/ide.h | 48 |
2 files changed, 8 insertions, 45 deletions
diff --git a/include/blk.h b/include/blk.h index 1db203c1bab..2c9c7985a88 100644 --- a/include/blk.h +++ b/include/blk.h @@ -62,10 +62,9 @@ struct blk_desc { unsigned char hwpart; /* HW partition, e.g. for eMMC */ unsigned char type; /* device type */ unsigned char removable; /* removable device */ -#ifdef CONFIG_LBA48 /* device can use 48bit addr (ATA/ATAPI v7) */ - unsigned char lba48; -#endif + bool lba48; + unsigned char atapi; /* Use ATAPI protocol */ lbaint_t lba; /* number of blocks */ unsigned long blksz; /* block size */ int log2blksz; /* for convenience: log2(blksz) */ diff --git a/include/ide.h b/include/ide.h index 426cef4e39e..2c25e74ede0 100644 --- a/include/ide.h +++ b/include/ide.h @@ -11,50 +11,14 @@ #define IDE_BUS(dev) (dev / (CONFIG_SYS_IDE_MAXDEVICE / CONFIG_SYS_IDE_MAXBUS)) -#define ATA_CURR_BASE(dev) (CONFIG_SYS_ATA_BASE_ADDR+ide_bus_offset[IDE_BUS(dev)]) -extern ulong ide_bus_offset[]; - -/* - * Function Prototypes - */ - -void ide_init(void); -struct blk_desc; -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 -ulong ide_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt, - void *buffer); -ulong ide_write(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt, - const void *buffer); -#endif - -#if defined(CONFIG_OF_IDE_FIXUP) -int ide_device_present(int dev); -#endif - -/* - * I/O function overrides - */ -unsigned char ide_inb(int dev, int port); -void ide_outb(int dev, int port, unsigned char val); -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); - -void ide_led(uchar led, uchar status); - /** - * board_start_ide() - Start up the board IDE interfac + * ide_set_reset() - Assert or de-assert reset for the IDE device + * + * This is provided by boards which need to reset the device through another + * means, e.g. a GPIO. * - * Return: 0 if ok + * @idereset: 1 to assert reset, 0 to de-assert it */ -int board_start_ide(void); +void ide_set_reset(int idereset); #endif /* _IDE_H */ |
