public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] dwc_ahsata: return failure for MX6 if not IMX6Q
@ 2014-05-06  5:22 Tim Harvey
  2014-05-06  8:17 ` Stefano Babic
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Tim Harvey @ 2014-05-06  5:22 UTC (permalink / raw)
  To: u-boot

The IMX6QUAD/DUAL have SATA, but the IMX6SOLO/DL do not. Return an error
indicating no such port instead of attempting a memory access that results
in a data abort and reset. This dynamic detection is necessary for bootloaders
that support multiple variants of the IMX6 SoC.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 drivers/block/dwc_ahsata.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/block/dwc_ahsata.c b/drivers/block/dwc_ahsata.c
index 3569214..638a585 100644
--- a/drivers/block/dwc_ahsata.c
+++ b/drivers/block/dwc_ahsata.c
@@ -17,6 +17,7 @@
 #include <asm/io.h>
 #include <linux/bitops.h>
 #include <asm/arch/clock.h>
+#include <asm/arch/sys_proto.h>
 #include "dwc_ahsata.h"
 
 struct sata_port_regs {
@@ -558,6 +559,12 @@ int init_sata(int dev)
 	u32 linkmap;
 	struct ahci_probe_ent *probe_ent = NULL;
 
+#if defined(CONFIG_MX6)
+	if (!is_cpu_type(MXC_CPU_MX6Q)) {
+		printf("No device detected!\n");
+		return 1;
+	}
+#endif
 	if (dev < 0 || dev > (CONFIG_SYS_SATA_MAX_DEVICE - 1)) {
 		printf("The sata index %d is out of ranges\n\r", dev);
 		return -1;
-- 
1.8.3.2

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

end of thread, other threads:[~2014-06-06  8:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-06  5:22 [U-Boot] [PATCH] dwc_ahsata: return failure for MX6 if not IMX6Q Tim Harvey
2014-05-06  8:17 ` Stefano Babic
2014-05-06 19:55 ` Troy Kisky
2014-05-07  3:55   ` Tim Harvey
2014-05-08  5:23 ` [U-Boot] [PATCH v2] dwc_ahsata: return failure for MX6 if not IMX6Q/IMX6D Tim Harvey
2014-06-05 10:46   ` Tim Harvey
2014-06-06  8:18   ` Stefano Babic
2014-05-08  5:24 ` [U-Boot] [PATCH] imx: sata: return failure " Tim Harvey
2014-06-05 10:44   ` Tim Harvey
2014-06-05 10:53     ` Stefano Babic
2014-06-06  8:18     ` Stefano Babic

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