Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/marvell Fix a bug that the irq_masks of GPIO ar...
details: https://anonhg.NetBSD.org/src/rev/6f525a73a025
branches: trunk
changeset: 781492:6f525a73a025
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Mon Sep 10 08:50:37 2012 +0000
description:
Fix a bug that the irq_masks of GPIO are incorrectly set on Marvell SoCs.
diffstat:
sys/arch/arm/marvell/mvsocgpp.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diffs (62 lines):
diff -r 5e7ad4253d43 -r 6f525a73a025 sys/arch/arm/marvell/mvsocgpp.c
--- a/sys/arch/arm/marvell/mvsocgpp.c Mon Sep 10 07:57:50 2012 +0000
+++ b/sys/arch/arm/marvell/mvsocgpp.c Mon Sep 10 08:50:37 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mvsocgpp.c,v 1.3 2011/08/13 15:38:47 jakllsch Exp $ */
+/* $NetBSD: mvsocgpp.c,v 1.4 2012/09/10 08:50:37 msaitoh Exp $ */
/*
* Copyright (c) 2008, 2010 KIYOHARA Takashi
* All rights reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mvsocgpp.c,v 1.3 2011/08/13 15:38:47 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsocgpp.c,v 1.4 2012/09/10 08:50:37 msaitoh Exp $");
#include "gpio.h"
@@ -71,6 +71,7 @@
struct mvsocgpp_pic {
struct pic_softc gpio_pic;
int group;
+ int shift;
uint32_t edge;
uint32_t level;
} *sc_pic;
@@ -183,6 +184,7 @@
aprint_normal(", intr %d\n", mva->mva_irq + j);
(sc->sc_pic + j)->group = j;
+ (sc->sc_pic + j)->shift = (j & 3) * 8;
}
#ifdef MVSOCGPP_DUMPREG
@@ -244,6 +246,7 @@
uint32_t mask;
int pin = mvsocgpp_pic->group << 3;
+ irq_mask = irq_mask << mvsocgpp_pic->shift;
MVSOCGPP_WRITE(sc, MVSOCGPP_GPIOIC(pin),
MVSOCGPP_READ(sc, MVSOCGPP_GPIOIC(pin)) & ~irq_mask);
if (irq_mask & mvsocgpp_pic->edge) {
@@ -266,6 +269,7 @@
struct mvsocgpp_pic *mvsocgpp_pic = (struct mvsocgpp_pic *)pic;
int pin = mvsocgpp_pic->group << 3;
+ irq_mask = irq_mask << mvsocgpp_pic->shift;
MVSOCGPP_WRITE(sc, MVSOCGPP_GPIOIM(pin),
MVSOCGPP_READ(sc, MVSOCGPP_GPIOIM(pin)) & ~irq_mask);
MVSOCGPP_WRITE(sc, MVSOCGPP_GPIOILM(pin),
@@ -281,9 +285,10 @@
int pin = mvsocgpp_pic->group << 3;
pending = MVSOCGPP_READ(sc, MVSOCGPP_GPIOIC(pin));
- pending &= (0xff << mvsocgpp_pic->group);
+ pending &= (0xff << mvsocgpp_pic->shift);
pending &= (MVSOCGPP_READ(sc, MVSOCGPP_GPIOIM(pin)) |
MVSOCGPP_READ(sc, MVSOCGPP_GPIOILM(pin)));
+ pending = pending >> mvsocgpp_pic->shift;
if (pending == 0)
return 0;
Home |
Main Index |
Thread Index |
Old Index