summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2007-05-24 16:15:20 +0000
committersam <sam@FreeBSD.org>2007-05-24 16:15:20 +0000
commit7a7c4c420ac6495993c6dea2894beb191ea443fe (patch)
tree5d4df3406a9d3b66a39a1ecefc97bf6f795cc860 /sys/arm
parentcb62c2558846e312b5bb0fb7bd3b9afcb72a884a (diff)
downloadFreeBSD-src-7a7c4c420ac6495993c6dea2894beb191ea443fe.zip
FreeBSD-src-7a7c4c420ac6495993c6dea2894beb191ea443fe.tar.gz
Fix interrupt setup; rev 1.3 switched the irq to GPIO_TYPE_ACT_LOW
but this does not work on avila boards; special case them to use GPIO_TYPE_EDG_RISING. MFC after: 3 weeks Submitted by: jhay
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/xscale/ixp425/avila_ata.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/arm/xscale/ixp425/avila_ata.c b/sys/arm/xscale/ixp425/avila_ata.c
index f3cf480..c03231d 100644
--- a/sys/arm/xscale/ixp425/avila_ata.c
+++ b/sys/arm/xscale/ixp425/avila_ata.c
@@ -120,17 +120,14 @@ ata_avila_attach(device_t dev)
{
struct ata_avila_softc *sc = device_get_softc(dev);
struct ixp425_softc *sa = device_get_softc(device_get_parent(dev));
- u_int32_t alt_t_off, board_type, ide_gpin, ide_irq;
+ u_int32_t alt_t_off, ide_gpin, ide_gptype, ide_irq;
- board_type = 0;
sc->sc_dev = dev;
/* NB: borrow from parent */
sc->sc_iot = sa->sc_iot;
sc->sc_exp_ioh = sa->sc_exp_ioh;
- if (EXP_BUS_READ_4(sc, EXP_TIMING_CS2_OFFSET) != 0)
- board_type = 1; /* Avila board */
-
- if (board_type == 1) {
+ if (EXP_BUS_READ_4(sc, EXP_TIMING_CS2_OFFSET) != 0) {
+ /* Avila board */
if (bus_space_map(sc->sc_iot, IXP425_EXP_BUS_CS1_HWBASE,
IXP425_EXP_BUS_CS1_SIZE, 0, &sc->sc_ioh))
panic("%s: unable to map Expansion Bus CS1 window",
@@ -140,10 +137,12 @@ ata_avila_attach(device_t dev)
panic("%s: unable to map Expansion Bus CS2 window",
__func__);
ide_gpin = AVILA_IDE_GPIN;
+ ide_gptype = GPIO_TYPE(ide_gpin, GPIO_TYPE_EDG_RISING);
ide_irq = AVILA_IDE_IRQ;
sc->sc_16bit_off = EXP_TIMING_CS1_OFFSET;
alt_t_off = EXP_TIMING_CS2_OFFSET;
} else {
+ /* Pronghorn */
if (bus_space_map(sc->sc_iot, IXP425_EXP_BUS_CS3_HWBASE,
IXP425_EXP_BUS_CS3_SIZE, 0, &sc->sc_ioh))
panic("%s: unable to map Expansion Bus CS3 window",
@@ -153,6 +152,7 @@ ata_avila_attach(device_t dev)
panic("%s: unable to map Expansion Bus CS4 window",
__func__);
ide_gpin = PRONGHORN_IDE_GPIN;
+ ide_gptype = GPIO_TYPE(ide_gpin, GPIO_TYPE_ACT_HIGH);
ide_irq = PRONGHORN_IDE_IRQ;
sc->sc_16bit_off = EXP_TIMING_CS3_OFFSET;
alt_t_off = EXP_TIMING_CS4_OFFSET;
@@ -187,11 +187,10 @@ ata_avila_attach(device_t dev)
GPIO_CONF_WRITE_4(sa, IXP425_GPIO_GPOER,
GPIO_CONF_READ_4(sa, IXP425_GPIO_GPOER) | (1<<ide_gpin));
- /* interrupt is active high */
+ /* set interrupt type */
GPIO_CONF_WRITE_4(sa, GPIO_TYPE_REG(ide_gpin),
- (GPIO_CONF_READ_4(sa, GPIO_TYPE_REG(ide_gpin)) &
- ~GPIO_TYPE(ide_gpin, GPIO_TYPE_MASK)) |
- GPIO_TYPE(ide_gpin, GPIO_TYPE_ACT_HIGH));
+ (GPIO_CONF_READ_4(sa, GPIO_TYPE_REG(ide_gpin)) &~
+ GPIO_TYPE(ide_gpin, GPIO_TYPE_MASK)) | ide_gptype);
/* clear ISR */
GPIO_CONF_WRITE_4(sa, IXP425_GPIO_GPISR, (1<<ide_gpin));
OpenPOWER on IntegriCloud