svn commit: r217036 - head/sys/arm/at91

Warner Losh imp at FreeBSD.org
Wed Jan 5 23:45:08 UTC 2011


Author: imp
Date: Wed Jan  5 23:45:07 2011
New Revision: 217036
URL: http://svn.freebsd.org/changeset/base/217036

Log:
  Remove support for SKYEYE simulator

Modified:
  head/sys/arm/at91/at91_st.c
  head/sys/arm/at91/at91rm9200.c
  head/sys/arm/at91/uart_bus_at91usart.c
  head/sys/arm/at91/uart_cpu_at91rm9200usart.c
  head/sys/arm/at91/uart_dev_at91usart.c

Modified: head/sys/arm/at91/at91_st.c
==============================================================================
--- head/sys/arm/at91/at91_st.c	Wed Jan  5 23:17:29 2011	(r217035)
+++ head/sys/arm/at91/at91_st.c	Wed Jan  5 23:45:07 2011	(r217036)
@@ -77,11 +77,7 @@ static unsigned at91st_get_timecount(str
 static struct timecounter at91st_timecounter = {
 	at91st_get_timecount, /* get_timecount */
 	NULL, /* no poll_pps */
-#ifdef SKYEYE_WORKAROUNDS
-	0xffffffffu, /* counter_mask */
-#else
 	0xfffffu, /* counter_mask */
-#endif
 	32768, /* frequency */
 	"AT91RM9200 timer", /* name */
 	1000 /* quality */
@@ -138,18 +134,10 @@ static devclass_t at91st_devclass;
 
 DRIVER_MODULE(at91_st, atmelarm, at91st_driver, at91st_devclass, 0, 0);
 
-#ifdef SKYEYE_WORKAROUNDS
-static unsigned long tot_count = 0;
-#endif
-
 static unsigned
 at91st_get_timecount(struct timecounter *tc)
 {
-#ifdef SKYEYE_WORKAROUNDS
-	return (tot_count);
-#else
 	return (st_crtr());
-#endif
 }
 
 /*
@@ -189,9 +177,6 @@ clock_intr(void *arg)
 
 	/* The interrupt is shared, so we have to make sure it's for us. */
 	if (RD4(ST_SR) & ST_SR_PITS) {
-#ifdef SKYEYE_WORKAROUNDS
-		tot_count += 32768 / hz;
-#endif
 		hardclock(TRAPF_USERMODE(fp), TRAPF_PC(fp));
 		return (FILTER_HANDLED);
 	}

Modified: head/sys/arm/at91/at91rm9200.c
==============================================================================
--- head/sys/arm/at91/at91rm9200.c	Wed Jan  5 23:17:29 2011	(r217035)
+++ head/sys/arm/at91/at91rm9200.c	Wed Jan  5 23:45:07 2011	(r217036)
@@ -121,15 +121,11 @@ static const struct cpu_devs at91_devs[]
 	DEVICE("at91_ssc",   SSC2,   2),
 	DEVICE("spi",        SPI,    0),
 
-#ifndef SKYEYE_WORKAROUNDS
 	DEVICE("uart",       DBGU,   0),
 	DEVICE("uart",       USART0, 1),
 	DEVICE("uart",       USART1, 2),
 	DEVICE("uart",       USART2, 3),
 	DEVICE("uart",       USART3, 4),
-#else
-	DEVICE("uart",       USART0, 0),
-#endif
 	DEVICE("at91_aic",   AIC,    0),
 	DEVICE("at91_mc",    MC,     0),
 	DEVICE("at91_tc",    TC0,    0),

Modified: head/sys/arm/at91/uart_bus_at91usart.c
==============================================================================
--- head/sys/arm/at91/uart_bus_at91usart.c	Wed Jan  5 23:17:29 2011	(r217035)
+++ head/sys/arm/at91/uart_bus_at91usart.c	Wed Jan  5 23:45:07 2011	(r217036)
@@ -76,11 +76,7 @@ usart_at91rm92_probe(device_t dev)
 	switch (device_get_unit(dev))
 	{
 	case 0:
-#ifdef SKYEYE_WORKAROUNDS
-		device_set_desc(dev, "USART0");
-#else
 		device_set_desc(dev, "DBGU");
-#endif
 		/*
 		 * Setting sc_sysdev makes this device a 'system device' and
 		 * indirectly makes it the system console.

Modified: head/sys/arm/at91/uart_cpu_at91rm9200usart.c
==============================================================================
--- head/sys/arm/at91/uart_cpu_at91rm9200usart.c	Wed Jan  5 23:17:29 2011	(r217035)
+++ head/sys/arm/at91/uart_cpu_at91rm9200usart.c	Wed Jan  5 23:45:07 2011	(r217036)
@@ -73,13 +73,8 @@ uart_cpu_getdev(int devtype, struct uart
 	 * XXX: Not pretty, but will work because we map the needed addresses
 	 * early.
 	 */
-#ifdef SKYEYE_WORKAROUNDS
-	di->bas.bsh = AT91RM92_BASE + AT91RM92_USART0_BASE;
-	di->baudrate = 38400;
-#else
 	di->bas.bsh = AT91RM92_BASE + AT91RM92_DBGU_BASE;
 	di->baudrate = 115200;
-#endif
 	di->bas.regshft = 0;
 	di->bas.rclk = 0;
 	di->databits = 8;

Modified: head/sys/arm/at91/uart_dev_at91usart.c
==============================================================================
--- head/sys/arm/at91/uart_dev_at91usart.c	Wed Jan  5 23:17:29 2011	(r217035)
+++ head/sys/arm/at91/uart_dev_at91usart.c	Wed Jan  5 23:45:07 2011	(r217036)
@@ -315,7 +315,6 @@ at91_usart_bus_probe(struct uart_softc *
 	return (0);
 }
 
-#ifndef SKYEYE_WORKAROUNDS
 static void
 at91_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
 {
@@ -323,15 +322,12 @@ at91_getaddr(void *arg, bus_dma_segment_
 		return;
 	*(bus_addr_t *)arg = segs[0].ds_addr;
 }
-#endif
 
 static int
 at91_usart_bus_attach(struct uart_softc *sc)
 {
-#ifndef SKYEYE_WORKAROUNDS
 	int err;
 	int i;
-#endif
 	uint32_t cr;
 	struct at91_usart_softc *atsc;
 
@@ -349,7 +345,6 @@ at91_usart_bus_attach(struct uart_softc 
 		atsc->flags |= HAS_TIMEOUT;
 	WR4(&sc->sc_bas, USART_IDR, 0xffffffff);
 
-#ifndef SKYEYE_WORKAROUNDS
 	/*
 	 * Allocate DMA tags and maps
 	 */
@@ -380,7 +375,6 @@ at91_usart_bus_attach(struct uart_softc 
 		atsc->ping = &atsc->ping_pong[0];
 		atsc->pong = &atsc->ping_pong[1];
 	}
-#endif
 
 	/*
 	 * Prime the pump with the RX buffer.  We use two 64 byte bounce
@@ -414,34 +408,25 @@ at91_usart_bus_attach(struct uart_softc 
 		WR4(&sc->sc_bas, USART_IER, USART_CSR_RXRDY);
 	}
 	WR4(&sc->sc_bas, USART_IER, USART_CSR_RXBRK);
-#ifndef SKYEYE_WORKAROUNDS
 errout:;
 	// XXX bad
 	return (err);
-#else
-	return (0);
-#endif
 }
 
 static int
 at91_usart_bus_transmit(struct uart_softc *sc)
 {
-#ifndef SKYEYE_WORKAROUNDS
 	bus_addr_t addr;
-#endif
 	struct at91_usart_softc *atsc;
 
 	atsc = (struct at91_usart_softc *)sc;
-#ifndef SKYEYE_WORKAROUNDS
 	if (bus_dmamap_load(atsc->dmatag, atsc->tx_map, sc->sc_txbuf,
 	    sc->sc_txdatasz, at91_getaddr, &addr, 0) != 0)
 		return (EAGAIN);
 	bus_dmamap_sync(atsc->dmatag, atsc->tx_map, BUS_DMASYNC_PREWRITE);
-#endif
 
 	uart_lock(sc->sc_hwmtx);
 	sc->sc_txbusy = 1;
-#ifndef SKYEYE_WORKAROUNDS
 	/*
 	 * Setup the PDC to transfer the data and interrupt us when it
 	 * is done.  We've already requested the interrupt.
@@ -451,15 +436,6 @@ at91_usart_bus_transmit(struct uart_soft
 	WR4(&sc->sc_bas, PDC_PTCR, PDC_PTCR_TXTEN);
 	WR4(&sc->sc_bas, USART_IER, USART_CSR_ENDTX);
 	uart_unlock(sc->sc_hwmtx);
-#else
-	for (int i = 0; i < sc->sc_txdatasz; i++)
-		at91_usart_putc(&sc->sc_bas, sc->sc_txbuf[i]);
-	/*
-	 * XXX: Gross hack : Skyeye doesn't raise an interrupt once the
-	 * transfer is done, so simulate it.
-	 */
-	WR4(&sc->sc_bas, USART_IER, USART_CSR_TXRDY);
-#endif
 	return (0);
 }
 static int


More information about the svn-src-all mailing list