Module Name:    src
Committed By:   matt
Date:           Thu Apr  3 17:12:15 UTC 2014

Modified Files:
        src/sys/arch/arm/omap: omap5_ahcisata.c

Log Message:
Enable sata port


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/omap/omap5_ahcisata.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/omap/omap5_ahcisata.c
diff -u src/sys/arch/arm/omap/omap5_ahcisata.c:1.1 src/sys/arch/arm/omap/omap5_ahcisata.c:1.2
--- src/sys/arch/arm/omap/omap5_ahcisata.c:1.1	Sat Jun 15 21:55:09 2013
+++ src/sys/arch/arm/omap/omap5_ahcisata.c	Thu Apr  3 17:12:15 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: omap5_ahcisata.c,v 1.1 2013/06/15 21:55:09 matt Exp $ */
+/* $NetBSD: omap5_ahcisata.c,v 1.2 2014/04/03 17:12:15 matt Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: omap5_ahcisata.c,v 1.1 2013/06/15 21:55:09 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap5_ahcisata.c,v 1.2 2014/04/03 17:12:15 matt Exp $");
 
 #include "locators.h"
 
@@ -83,6 +83,21 @@ omap5_ahcisata_attach(device_t parent, d
 	aprint_naive("\n");
 	aprint_normal(": OMAP AHCI controller\n");
 
+#ifdef OMAP5
+	{
+		bus_space_handle_t ioh;
+		rv = bus_space_map(obio->obio_iot,
+		    OMAP5_CM_L3INIT_SATA_CLKCTRL, 4, 0, &ioh);
+		KASSERT(rv == 0);
+		uint32_t v = bus_space_read_4(obio->obio_iot, ioh, 0);
+		v &= ~OMAP5_CM_L3INIT_MODE;
+		v |= OMAP5_CM_L3INIT_ENABLE;
+		bus_space_write_4(obio->obio_iot, ioh, 0, v);
+		bus_space_unmap(obio->obio_iot, ioh, 4);
+	}
+#endif
+
+	sc->sc_ahci_ports = 1;
 	sc->sc_dmat = obio->obio_dmat;
 	sc->sc_ahcit = obio->obio_iot;
 	sc->sc_ahcis = obio->obio_size;

Reply via email to