Lines Matching +full:ide +full:- +full:port
1 // SPDX-License-Identifier: GPL-2.0-only
5 #include <linux/ide.h>
9 #include <asm/ide.h>
11 #include <asm-generic/ide_iops.h>
18 static u8 ide_inb(unsigned long port) in ide_inb() argument
20 return (u8) inb(port); in ide_inb()
23 static void ide_outb(u8 val, unsigned long port) in ide_outb() argument
25 outb(val, port); in ide_outb()
32 static u8 ide_mm_inb(unsigned long port) in ide_mm_inb() argument
34 return (u8) readb((void __iomem *) port); in ide_mm_inb()
37 static void ide_mm_outb(u8 value, unsigned long port) in ide_mm_outb() argument
39 writeb(value, (void __iomem *) port); in ide_mm_outb()
44 if (hwif->host_flags & IDE_HFLAG_MMIO) in ide_exec_command()
45 writeb(cmd, (void __iomem *)hwif->io_ports.command_addr); in ide_exec_command()
47 outb(cmd, hwif->io_ports.command_addr); in ide_exec_command()
53 if (hwif->host_flags & IDE_HFLAG_MMIO) in ide_read_status()
54 return readb((void __iomem *)hwif->io_ports.status_addr); in ide_read_status()
56 return inb(hwif->io_ports.status_addr); in ide_read_status()
62 if (hwif->host_flags & IDE_HFLAG_MMIO) in ide_read_altstatus()
63 return readb((void __iomem *)hwif->io_ports.ctl_addr); in ide_read_altstatus()
65 return inb(hwif->io_ports.ctl_addr); in ide_read_altstatus()
71 if (hwif->host_flags & IDE_HFLAG_MMIO) in ide_write_devctl()
72 writeb(ctl, (void __iomem *)hwif->io_ports.ctl_addr); in ide_write_devctl()
74 outb(ctl, hwif->io_ports.ctl_addr); in ide_write_devctl()
80 ide_hwif_t *hwif = drive->hwif; in ide_dev_select()
81 u8 select = drive->select | ATA_DEVICE_OBS; in ide_dev_select()
83 if (hwif->host_flags & IDE_HFLAG_MMIO) in ide_dev_select()
84 writeb(select, (void __iomem *)hwif->io_ports.device_addr); in ide_dev_select()
86 outb(select, hwif->io_ports.device_addr); in ide_dev_select()
92 ide_hwif_t *hwif = drive->hwif; in ide_tf_load()
93 struct ide_io_ports *io_ports = &hwif->io_ports; in ide_tf_load()
94 void (*tf_outb)(u8 addr, unsigned long port); in ide_tf_load()
95 u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0; in ide_tf_load()
103 tf_outb(tf->feature, io_ports->feature_addr); in ide_tf_load()
105 tf_outb(tf->nsect, io_ports->nsect_addr); in ide_tf_load()
107 tf_outb(tf->lbal, io_ports->lbal_addr); in ide_tf_load()
109 tf_outb(tf->lbam, io_ports->lbam_addr); in ide_tf_load()
111 tf_outb(tf->lbah, io_ports->lbah_addr); in ide_tf_load()
113 tf_outb(tf->device, io_ports->device_addr); in ide_tf_load()
119 ide_hwif_t *hwif = drive->hwif; in ide_tf_read()
120 struct ide_io_ports *io_ports = &hwif->io_ports; in ide_tf_read()
121 u8 (*tf_inb)(unsigned long port); in ide_tf_read()
122 u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0; in ide_tf_read()
130 tf->error = tf_inb(io_ports->feature_addr); in ide_tf_read()
132 tf->nsect = tf_inb(io_ports->nsect_addr); in ide_tf_read()
134 tf->lbal = tf_inb(io_ports->lbal_addr); in ide_tf_read()
136 tf->lbam = tf_inb(io_ports->lbam_addr); in ide_tf_read()
138 tf->lbah = tf_inb(io_ports->lbah_addr); in ide_tf_read()
140 tf->device = tf_inb(io_ports->device_addr); in ide_tf_read()
146 * when using 32-bit I/O instructions to transfer data. We call this
151 static void ata_vlb_sync(unsigned long port) in ata_vlb_sync() argument
153 (void)inb(port); in ata_vlb_sync()
154 (void)inb(port); in ata_vlb_sync()
155 (void)inb(port); in ata_vlb_sync()
159 * This is used for most PIO data transfers *from* the IDE interface
168 ide_hwif_t *hwif = drive->hwif; in ide_input_data()
169 struct ide_io_ports *io_ports = &hwif->io_ports; in ide_input_data()
170 unsigned long data_addr = io_ports->data_addr; in ide_input_data()
172 u8 io_32bit = drive->io_32bit; in ide_input_data()
173 u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0; in ide_input_data()
180 ata_vlb_sync(io_ports->nsect_addr); in ide_input_data()
207 * This is used for most PIO data transfers *to* the IDE interface
212 ide_hwif_t *hwif = drive->hwif; in ide_output_data()
213 struct ide_io_ports *io_ports = &hwif->io_ports; in ide_output_data()
214 unsigned long data_addr = io_ports->data_addr; in ide_output_data()
216 u8 io_32bit = drive->io_32bit; in ide_output_data()
217 u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0; in ide_output_data()
224 ata_vlb_sync(io_ports->nsect_addr); in ide_output_data()