mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ata: disk_ata_drive: clean up code in ata_dump_id()
@ 2022-04-26 12:34 Denis Orlov
  2022-04-29  7:16 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Orlov @ 2022-04-26 12:34 UTC (permalink / raw)
  To: barebox; +Cc: Denis Orlov

Add missing macros and fix misspellings.

Signed-off-by: Denis Orlov <denorl2009@gmail.com>
---
 drivers/ata/disk_ata_drive.c | 23 +++++++++++++----------
 include/ata_drive.h          |  5 +++++
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/ata/disk_ata_drive.c b/drivers/ata/disk_ata_drive.c
index f36e06328c..7df0879b19 100644
--- a/drivers/ata/disk_ata_drive.c
+++ b/drivers/ata/disk_ata_drive.c
@@ -80,9 +80,9 @@ static void __maybe_unused ata_dump_id(uint16_t *id)
 	ata_id_c_string(id, product, ATA_ID_PROD, sizeof(product));
 	printf("Product model number: %s\n\r", product);
 
-	/* Total sectors of device  */
+	/* Total sectors of device */
 	n_sectors = ata_id_n_sectors(id);
-	printf("Capablity: %lld sectors\n\r", n_sectors);
+	printf("Capacity: %lld sectors\n\r", n_sectors);
 
 	printf ("id[49]: capabilities = 0x%04x\n"
 		"id[53]: field valid = 0x%04x\n"
@@ -95,12 +95,14 @@ static void __maybe_unused ata_dump_id(uint16_t *id)
 		id[ATA_ID_PIO_MODES],
 		id[ATA_ID_QUEUE_DEPTH]);
 
-	printf ("id[76]: sata capablity = 0x%04x\n"
+	printf ("id[76]: sata capabilities 1 = 0x%04x\n"
+		"id[77]: sata capabilities 2 = 0x%04x\n"
 		"id[78]: sata features supported = 0x%04x\n"
-		"id[79]: sata features enable = 0x%04x\n",
-		id[76], /* FIXME */
-		id[78], /* FIXME */
-		id[79]); /* FIXME */
+		"id[79]: sata features enabled = 0x%04x\n",
+		id[ATA_ID_SATA_CAPAB_1],
+		id[ATA_ID_SATA_CAPAB_2],
+		id[ATA_ID_SATA_FEAT_SUPP],
+		id[ATA_ID_SATA_FEAT_ENABLE]);
 
 	printf ("id[80]: major version = 0x%04x\n"
 		"id[81]: minor version = 0x%04x\n"
@@ -108,12 +110,13 @@ static void __maybe_unused ata_dump_id(uint16_t *id)
 		"id[83]: command set supported 2 = 0x%04x\n"
 		"id[84]: command set extension = 0x%04x\n",
 		id[ATA_ID_MAJOR_VER],
-		id[81], /* FIXME */
+		id[ATA_ID_MINOR_VER],
 		id[ATA_ID_COMMAND_SET_1],
 		id[ATA_ID_COMMAND_SET_2],
 		id[ATA_ID_CFSSE]);
-	printf ("id[85]: command set enable 1 = 0x%04x\n"
-		"id[86]: command set enable 2 = 0x%04x\n"
+
+	printf ("id[85]: command set enabled 1 = 0x%04x\n"
+		"id[86]: command set enabled 2 = 0x%04x\n"
 		"id[87]: command set default = 0x%04x\n"
 		"id[88]: udma = 0x%04x\n"
 		"id[93]: hardware reset result = 0x%04x\n",
diff --git a/include/ata_drive.h b/include/ata_drive.h
index 6b8915c9cb..e11172ba39 100644
--- a/include/ata_drive.h
+++ b/include/ata_drive.h
@@ -67,7 +67,12 @@ enum {
 	ATA_ID_MWDMA_MODES	= 63,
 	ATA_ID_PIO_MODES	= 64,
 	ATA_ID_QUEUE_DEPTH	= 75,
+	ATA_ID_SATA_CAPAB_1	= 76,
+	ATA_ID_SATA_CAPAB_2	= 77,
+	ATA_ID_SATA_FEAT_SUPP	= 78,
+	ATA_ID_SATA_FEAT_ENABLE	= 79,
 	ATA_ID_MAJOR_VER	= 80,
+	ATA_ID_MINOR_VER	= 81,
 	ATA_ID_COMMAND_SET_1	= 82,
 	ATA_ID_COMMAND_SET_2	= 83,
 	ATA_ID_CFSSE		= 84,
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-29  7:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 12:34 [PATCH] ata: disk_ata_drive: clean up code in ata_dump_id() Denis Orlov
2022-04-29  7:16 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox