Lines Matching +full:pm +full:- +full:bus
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 1998 - 2008 Søren Schmidt <sos@FreeBSD.org>
33 #include <sys/bus.h>
43 #include <machine/bus.h>
45 #include <dev/ata/ata-all.h>
66 if ((error & ATA_SE_PHY_CHANGED) && (ch->pm_level == 0)) { in ata_sata_phy_check_events()
77 taskqueue_enqueue(taskqueue_thread, &ch->conntask); in ata_sata_phy_check_events()
85 if (ch->hw.pm_read != NULL) in ata_sata_scr_read()
86 return (ch->hw.pm_read(ch->dev, port, reg, val)); in ata_sata_scr_read()
87 if (ch->r_io[reg].res) { in ata_sata_scr_read()
91 return (-1); in ata_sata_scr_read()
98 if (ch->hw.pm_write != NULL) in ata_sata_scr_write()
99 return (ch->hw.pm_write(ch->dev, port, reg, val)); in ata_sata_scr_write()
100 if (ch->r_io[reg].res) { in ata_sata_scr_write()
104 return (-1); in ata_sata_scr_write()
130 device_printf(ch->dev, "SATA connect timeout status=%08x\n", in ata_sata_connect()
133 device_printf(ch->dev, "p%d: SATA connect timeout status=%08x\n", in ata_sata_connect()
137 device_printf(ch->dev, "SATA connect time=%dms status=%08x\n", in ata_sata_connect()
140 device_printf(ch->dev, "p%d: SATA connect time=%dms status=%08x\n", in ata_sata_connect()
158 sata_rev = ch->user[port < 0 ? 0 : port].revision; in ata_sata_phy_reset()
167 ATA_SC_DET_IDLE | ((ch->pm_level > 0) ? 0 : in ata_sata_phy_reset()
202 ATA_SC_DET_IDLE | val1 | ((ch->pm_level > 0) ? 0 : in ata_sata_phy_reset()
238 if (ch->r_io[ATA_SSTATUS].res) in ata_sata_getrev()
247 if (request->flags & ATA_R_ATAPI) { in ata_request2fis_h2d()
249 fis[1] = 0x80 | (request->unit & 0x0f); in ata_request2fis_h2d()
251 if (request->flags & (ATA_R_READ | ATA_R_WRITE)) in ata_request2fis_h2d()
254 fis[5] = request->transfersize; in ata_request2fis_h2d()
255 fis[6] = request->transfersize >> 8; in ata_request2fis_h2d()
263 fis[1] = 0x80 | (request->unit & 0x0f); in ata_request2fis_h2d()
264 fis[2] = request->u.ata.command; in ata_request2fis_h2d()
265 fis[3] = request->u.ata.feature; in ata_request2fis_h2d()
266 fis[4] = request->u.ata.lba; in ata_request2fis_h2d()
267 fis[5] = request->u.ata.lba >> 8; in ata_request2fis_h2d()
268 fis[6] = request->u.ata.lba >> 16; in ata_request2fis_h2d()
270 if (!(request->flags & ATA_R_48BIT)) in ata_request2fis_h2d()
271 fis[7] |= (ATA_D_IBM | (request->u.ata.lba >> 24 & 0x0f)); in ata_request2fis_h2d()
272 fis[8] = request->u.ata.lba >> 24; in ata_request2fis_h2d()
273 fis[9] = request->u.ata.lba >> 32; in ata_request2fis_h2d()
274 fis[10] = request->u.ata.lba >> 40; in ata_request2fis_h2d()
275 fis[11] = request->u.ata.feature >> 8; in ata_request2fis_h2d()
276 fis[12] = request->u.ata.count; in ata_request2fis_h2d()
277 fis[13] = request->u.ata.count >> 8; in ata_request2fis_h2d()
291 /* get PM vendor & product data */ in ata_pm_identify()
292 if (ch->hw.pm_read(dev, ATA_PM, 0, &pm_chipid)) { in ata_pm_identify()
293 device_printf(dev, "error getting PM vendor data\n"); in ata_pm_identify()
297 /* get PM revision data */ in ata_pm_identify()
298 if (ch->hw.pm_read(dev, ATA_PM, 1, &pm_revision)) { in ata_pm_identify()
299 device_printf(dev, "error getting PM revision data\n"); in ata_pm_identify()
303 /* get number of HW ports on the PM */ in ata_pm_identify()
304 if (ch->hw.pm_read(dev, ATA_PM, 2, &pm_ports)) { in ata_pm_identify()
305 device_printf(dev, "error getting PM port info\n"); in ata_pm_identify()
313 /* This PM declares 6 ports, while only 5 of them are real. in ata_pm_identify()
322 /* This PM declares 7 ports, while only 5 of them are real. in ata_pm_identify()
351 signature = ch->hw.softreset(dev, port); in ata_pm_identify()
359 ch->devices |= (ATA_ATA_MASTER << port); in ata_pm_identify()
362 ch->devices |= (ATA_ATAPI_MASTER << port); in ata_pm_identify()