Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/marvell TWSI controller on Armada XP is a bit differ...
details: https://anonhg.NetBSD.org/src/rev/559379486998
branches: trunk
changeset: 786550:559379486998
user: rkujawa <rkujawa%NetBSD.org@localhost>
date: Wed May 01 12:25:31 2013 +0000
description:
TWSI controller on Armada XP is a bit different. Support that.
Obtained from Marvell, Semihalf.
diffstat:
sys/dev/marvell/gttwsi.c | 19 ++++++++++++++++---
sys/dev/marvell/gttwsireg.h | 7 ++++++-
2 files changed, 22 insertions(+), 4 deletions(-)
diffs (91 lines):
diff -r 4ccdb800d352 -r 559379486998 sys/dev/marvell/gttwsi.c
--- a/sys/dev/marvell/gttwsi.c Wed May 01 12:23:24 2013 +0000
+++ b/sys/dev/marvell/gttwsi.c Wed May 01 12:25:31 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gttwsi.c,v 1.6 2012/07/21 04:21:14 kiyohara Exp $ */
+/* $NetBSD: gttwsi.c,v 1.7 2013/05/01 12:25:31 rkujawa Exp $ */
/*
* Copyright (c) 2008 Eiji Kawauchi.
* All rights reserved.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gttwsi.c,v 1.6 2012/07/21 04:21:14 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gttwsi.c,v 1.7 2013/05/01 12:25:31 rkujawa Exp $");
#include "locators.h"
#include <sys/param.h>
@@ -86,6 +86,8 @@
#include <dev/marvell/marvellvar.h>
#include <dev/marvell/gttwsireg.h>
+#include "opt_mvsoc.h"
+
struct gttwsi_softc {
device_t sc_dev;
bus_space_tag_t sc_bust;
@@ -341,8 +343,13 @@
error = gttwsi_wait(sc, CONTROL_ACK, STAT_MRRD_AT, flags);
if (!error)
*valp = RREG(sc, TWSI_DATA);
- if (flags & I2C_F_LAST)
+ if (flags & I2C_F_LAST) {
+#if defined(ARMADAXP)
+ error = gttwsi_send_stop(sc, flags);
+#else
WREG(sc, TWSI_CONTROL, 0);
+#endif
+ }
return error;
}
@@ -352,6 +359,10 @@
struct gttwsi_softc *sc = v;
WREG(sc, TWSI_DATA, val);
+#if defined(ARMADAXP)
+ if (flags & I2C_F_LAST)
+ gttwsi_send_stop(sc, flags);
+#endif
return gttwsi_wait(sc, 0, STAT_MTDB_AR, flags);
}
@@ -391,6 +402,7 @@
return EIO;
}
+#ifndef ARMADAXP
if (flags & I2C_F_STOP)
switch (expect) {
case STAT_SCT:
@@ -401,6 +413,7 @@
default:
error = gttwsi_send_stop(sc, flags);
}
+#endif
return error;
}
diff -r 4ccdb800d352 -r 559379486998 sys/dev/marvell/gttwsireg.h
--- a/sys/dev/marvell/gttwsireg.h Wed May 01 12:23:24 2013 +0000
+++ b/sys/dev/marvell/gttwsireg.h Wed May 01 12:25:31 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gttwsireg.h,v 1.2 2012/07/21 04:23:16 kiyohara Exp $ */
+/* $NetBSD: gttwsireg.h,v 1.3 2013/05/01 12:25:31 rkujawa Exp $ */
/*
* Copyright (c) 2008 Eiji Kawauchi.
@@ -74,7 +74,12 @@
#define TWSI_RETRY_COUNT 1000 /* retry loop count */
#define TWSI_RETRY_DELAY 1 /* retry delay */
#define TWSI_STAT_DELAY 1 /* poll status delay */
+#ifdef ARMADAXP
+#define TWSI_READ_DELAY 15 /* read delay */
+#define TWSI_WRITE_DELAY 15 /* write delay */
+#else
#define TWSI_READ_DELAY 2 /* read delay */
#define TWSI_WRITE_DELAY 2 /* write delay */
+#endif /* ARMADAXP */
#endif /* _GTTWSIREG_H_ */
Home |
Main Index |
Thread Index |
Old Index