supports (at most 16) - defaults to 2 if undefined.
Define IDE_8BIT_ONLY if the system implements only half of the 16-bit data
- bus (eg n8vem-mark4).
+ bus (eg n8vem-mark4). You can define IDE_IS_8BIT(iface) if you have a mix
+ of types. FIXME: we should rename IDE_8BIT_ONLY.
Define IDE_REG_INDIRECT if the IDE registers are not directly addressable on
your platform. If you do not define IDE_REG_INDIRECT then IDE registers
#define IDE_DRIVE_COUNT 2 /* at most 16 drives without adjusting IDE_DRIVE_NR_MASK */
#endif
+/* Only used when 8BIT_ONLY defined */
+#ifndef IDE_IS_8BIT
+#define IDE_IS_8BIT(x) (1)
+#endif
+
/* we use the bits in the driver_data field of blkdev_t as follows: */
#define FLAG_CACHE_DIRTY 0x40
#define FLAG_WRITE_CACHE 0x80
kprintf("IDE drive %d: ", drive);
#ifdef IDE_8BIT_ONLY
+ if (IDE_IS_8BIT(drive)) {
/* set 8-bit mode -- mostly only supported by CF cards */
- if (!devide_wait(IDE_STATUS_READY))
- goto out;
+ if (!devide_wait(IDE_STATUS_READY))
+ goto out;
- devide_writeb(ide_reg_devhead, select);
- if (!devide_wait(IDE_STATUS_READY))
- goto out;
+ devide_writeb(ide_reg_devhead, select);
+ if (!devide_wait(IDE_STATUS_READY))
+ goto out;
- devide_writeb(ide_reg_features, 0x01); /* Enable 8-bit PIO transfer mode (CFA feature set only) */
- devide_writeb(ide_reg_command, IDE_CMD_SET_FEATURES);
+ devide_writeb(ide_reg_features, 0x01); /* Enable 8-bit PIO transfer mode (CFA feature set only) */
+ devide_writeb(ide_reg_command, IDE_CMD_SET_FEATURES);
+ }
#endif
/* confirm drive has LBA support */