Date: Sat, 18 Apr 2009 15:14:49 GMT From: Ulf Lilleengen <lulf@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 160784 for review Message-ID: <200904181514.n3IFEnU3041184@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=160784 Change 160784 by lulf@lulf_carrot on 2009/04/18 15:13:54 - s/atmel/ATMEL on macros - Move non-at91 specific headers out. Affected files ... .. //depot/projects/avr32/src/sys/arm/at91/at91_mci.c#3 delete .. //depot/projects/avr32/src/sys/arm/at91/at91_mcireg.h#2 delete .. //depot/projects/avr32/src/sys/arm/at91/at91_pdcreg.h#2 delete .. //depot/projects/avr32/src/sys/dev/mmc/atmel_mci.c#4 edit .. //depot/projects/avr32/src/sys/dev/mmc/atmel_mcireg.h#1 add .. //depot/projects/avr32/src/sys/dev/mmc/atmel_pdcreg.h#1 add Differences ... ==== //depot/projects/avr32/src/sys/dev/mmc/atmel_mci.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/atmel/at91_mci.c,v 1.13 2009/01/21 17:39:11 imp Exp $"); +__FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> @@ -53,10 +53,8 @@ #include <machine/resource.h> #include <machine/frame.h> #include <machine/intr.h> -#include <arm/at91/at91rm92reg.h> -#include <arm/at91/at91_mcireg.h> -#include <arm/at91/at91var.h> -#include <arm/at91/at91_pdcreg.h> +#include <dev/mmc/atmel_mcireg.h> +#include <dev/mmc/atmel_pdcreg.h> #include <dev/mmc/bridge.h> #include <dev/mmc/mmcreg.h> #include <dev/mmc/mmcbrvar.h> @@ -110,14 +108,14 @@ static int atmel_mci_activate(device_t dev); static void atmel_mci_deactivate(device_t dev); -#define atmel_MCI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) -#define atmel_MCI_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define atmel_MCI_LOCK_INIT(_sc) \ +#define ATMEL_MCI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define ATMEL_MCI_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define ATMEL_MCI_LOCK_INIT(_sc) \ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ "mci", MTX_DEF) -#define atmel_MCI_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define atmel_MCI_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define atmel_MCI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +#define ATMEL_MCI_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define ATMEL_MCI_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define ATMEL_MCI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); static void atmel_mci_pdc_disable(struct atmel_mci_softc *sc) @@ -175,7 +173,7 @@ if (err) goto out; - atmel_MCI_LOCK_INIT(sc); + ATMEL_MCI_LOCK_INIT(sc); /* * Allocate DMA tags and maps @@ -198,7 +196,7 @@ err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, atmel_mci_intr, sc, &sc->intrhand); if (err) { - atmel_MCI_LOCK_DESTROY(sc); + ATMEL_MCI_LOCK_DESTROY(sc); goto out; } mci_clockfreq = devclk_get_rate(dev); @@ -347,10 +345,10 @@ if (!data) { // The no data case is fairly simple atmel_mci_pdc_disable(sc); - printf("CMDR %x ARGR %x\n", cmdr, cmd->arg); + //avr32_debug("CMDR %x ARGR %x\n", cmdr, cmd->arg); WR4(sc, MCI_ARGR, cmd->arg); WR4(sc, MCI_CMDR, cmdr); - WR4(sc, MCI_IER, 0xffffffff); //MCI_SR_ERROR | MCI_SR_CMDRDY); + WR4(sc, MCI_IER, MCI_SR_ERROR | MCI_SR_CMDRDY); return; } if (data->flags & MMC_DATA_READ) @@ -451,18 +449,18 @@ { struct atmel_mci_softc *sc = device_get_softc(brdev); - atmel_MCI_LOCK(sc); + ATMEL_MCI_LOCK(sc); // XXX do we want to be able to queue up multiple commands? // XXX sounds like a good idea, but all protocols are sync, so // XXX maybe the idea is naive... if (sc->req != NULL) { - atmel_MCI_UNLOCK(sc); + ATMEL_MCI_UNLOCK(sc); return EBUSY; } sc->req = req; sc->flags = 0; atmel_mci_start(sc); - atmel_MCI_UNLOCK(sc); + ATMEL_MCI_UNLOCK(sc); return (0); } @@ -478,11 +476,11 @@ struct atmel_mci_softc *sc = device_get_softc(brdev); int err = 0; - atmel_MCI_LOCK(sc); + ATMEL_MCI_LOCK(sc); while (sc->bus_busy) msleep(sc, &sc->sc_mtx, PZERO, "mciah", hz / 5); sc->bus_busy++; - atmel_MCI_UNLOCK(sc); + ATMEL_MCI_UNLOCK(sc); return (err); } @@ -491,10 +489,10 @@ { struct atmel_mci_softc *sc = device_get_softc(brdev); - atmel_MCI_LOCK(sc); + ATMEL_MCI_LOCK(sc); sc->bus_busy--; wakeup(sc); - atmel_MCI_UNLOCK(sc); + ATMEL_MCI_UNLOCK(sc); return (0); } @@ -539,7 +537,7 @@ int i, done = 0; struct mmc_command *cmd; - atmel_MCI_LOCK(sc); + ATMEL_MCI_LOCK(sc); sr = RD4(sc, MCI_SR) & RD4(sc, MCI_IMR); // printf("i 0x%x\n", sr); cmd = sc->curcmd; @@ -612,7 +610,7 @@ } atmel_mci_start(sc); } - atmel_MCI_UNLOCK(sc); + ATMEL_MCI_UNLOCK(sc); } static int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904181514.n3IFEnU3041184>