diff --git a/sys/arm/at91/at91_pio.c b/sys/arm/at91/at91_pio.c index 25c04711d9bb..5ba9b072151a 100644 --- a/sys/arm/at91/at91_pio.c +++ b/sys/arm/at91/at91_pio.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define __RMAN_RESOURCE_VISIBLE #include #include @@ -55,13 +56,15 @@ struct at91_pio_softc static inline uint32_t RD4(struct at91_pio_softc *sc, bus_size_t off) { - return bus_read_4(sc->mem_res, off); + return bus_space_read_4(sc->mem_res->r_bustag, sc->mem_res->r_bushandle, + off); } static inline void WR4(struct at91_pio_softc *sc, bus_size_t off, uint32_t val) { - bus_write_4(sc->mem_res, off, val); + bus_space_write_4(sc->mem_res->r_bustag, sc->mem_res->r_bushandle, off, + val); } #define AT91_PIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) diff --git a/sys/arm/at91/at91_pmc.c b/sys/arm/at91/at91_pmc.c index 317895bfea20..911d3050e17e 100644 --- a/sys/arm/at91/at91_pmc.c +++ b/sys/arm/at91/at91_pmc.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define __RMAN_RESOURCE_VISIBLE #include #include @@ -145,13 +146,15 @@ static struct at91_pmc_clock *const clock_list[] = { static inline uint32_t RD4(struct at91_pmc_softc *sc, bus_size_t off) { - return bus_read_4(sc->mem_res, off); + return bus_space_read_4(sc->mem_res->r_bustag, sc->mem_res->r_bushandle, + off); } static inline void WR4(struct at91_pmc_softc *sc, bus_size_t off, uint32_t val) { - bus_write_4(sc->mem_res, off, val); + bus_space_write_4(sc->mem_res->r_bustag, sc->mem_res->r_bushandle, + off, val); } static void diff --git a/sys/arm/at91/at91_rtc.c b/sys/arm/at91/at91_rtc.c index 4431b7ccc734..3ad46751971d 100644 --- a/sys/arm/at91/at91_rtc.c +++ b/sys/arm/at91/at91_rtc.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define __RMAN_RESOURCE_VISIBLE #include #include @@ -55,13 +56,15 @@ struct at91_rtc_softc static inline uint32_t RD4(struct at91_rtc_softc *sc, bus_size_t off) { - return bus_read_4(sc->mem_res, off); + return bus_space_read_4(sc->mem_res->r_bustag, sc->mem_res->r_bushandle, + off); } static inline void WR4(struct at91_rtc_softc *sc, bus_size_t off, uint32_t val) { - bus_write_4(sc->mem_res, off, val); + bus_space_write_4(sc->mem_res->r_bustag, sc->mem_res->r_bushandle, off, + val); } #define AT91_RTC_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) diff --git a/sys/arm/at91/at91_spi.c b/sys/arm/at91/at91_spi.c index 8d91f7dd96fa..a1ca7e215de8 100644 --- a/sys/arm/at91/at91_spi.c +++ b/sys/arm/at91/at91_spi.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define __RMAN_RESOURCE_VISIBLE #include #include @@ -60,13 +61,15 @@ struct at91_spi_softc static inline uint32_t RD4(struct at91_spi_softc *sc, bus_size_t off) { - return bus_read_4(sc->mem_res, off); + return bus_space_read_4(sc->mem_res->r_bustag, sc->mem_res->r_bushandle, + off); } static inline void WR4(struct at91_spi_softc *sc, bus_size_t off, uint32_t val) { - bus_write_4(sc->mem_res, off, val); + bus_space_write_4(sc->mem_res->r_bustag, sc->mem_res->r_bushandle, off, + val); } #define AT91_SPI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) diff --git a/sys/arm/at91/at91_st.c b/sys/arm/at91/at91_st.c index 10cccc33e87a..5816a9fc0ebc 100644 --- a/sys/arm/at91/at91_st.c +++ b/sys/arm/at91/at91_st.c @@ -143,14 +143,14 @@ at91st_get_timecount(struct timecounter *tc) static void clock_intr(void *arg) { - struct trapframe *fp = arg; + struct clockframe *fp = 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)); + hardclock(fp); } } diff --git a/sys/arm/at91/at91_twi.c b/sys/arm/at91/at91_twi.c index 65b1a8d2d3c0..5f38b441b24d 100644 --- a/sys/arm/at91/at91_twi.c +++ b/sys/arm/at91/at91_twi.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define __RMAN_RESOURCE_VISIBLE #include #include @@ -64,13 +65,15 @@ struct at91_twi_softc static inline uint32_t RD4(struct at91_twi_softc *sc, bus_size_t off) { - return bus_read_4(sc->mem_res, off); + return bus_space_read_4(sc->mem_res->r_bustag, sc->mem_res->r_bushandle, + off); } static inline void WR4(struct at91_twi_softc *sc, bus_size_t off, uint32_t val) { - bus_write_4(sc->mem_res, off, val); + bus_space_write_4(sc->mem_res->r_bustag, sc->mem_res->r_bushandle, off, + val); } #define AT91_TWI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) diff --git a/sys/arm/at91/at91rm92reg.h b/sys/arm/at91/at91rm92reg.h index 7a26339b7393..946dab376b25 100644 --- a/sys/arm/at91/at91rm92reg.h +++ b/sys/arm/at91/at91rm92reg.h @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $FreeBSD$ */ +/* $$FreeBSD$ */ #ifndef AT91RM92REG_H_ #define AT91RM92REG_H_ diff --git a/sys/arm/at91/if_ate.c b/sys/arm/at91/if_ate.c index 4320e17040ee..a6c10d779aea 100644 --- a/sys/arm/at91/if_ate.c +++ b/sys/arm/at91/if_ate.c @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define __RMAN_RESOURCE_VISIBLE #include #include #include @@ -103,13 +104,15 @@ struct ate_softc static inline uint32_t RD4(struct ate_softc *sc, bus_size_t off) { - return bus_read_4(sc->mem_res, off); + return bus_space_read_4(sc->mem_res->r_bustag, sc->mem_res->r_bushandle, + off); } static inline void WR4(struct ate_softc *sc, bus_size_t off, uint32_t val) { - bus_write_4(sc->mem_res, off, val); + bus_space_write_4(sc->mem_res->r_bustag, sc->mem_res->r_bushandle, off, + val); } #define ATE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) diff --git a/sys/arm/at91/kb920x_machdep.c b/sys/arm/at91/kb920x_machdep.c index 42ce0f8139c7..4a32c8fe3343 100644 --- a/sys/arm/at91/kb920x_machdep.c +++ b/sys/arm/at91/kb920x_machdep.c @@ -47,7 +47,7 @@ #include "opt_ddb.h" #include -__FBSDID("$FreeBSD$"); +__FBSDID("$$FreeBSD$"); #define _ARM32_BUS_DMA_PRIVATE #include diff --git a/sys/arm/at91/uart_dev_at91usart.c b/sys/arm/at91/uart_dev_at91usart.c index fc304cc91dfb..03691b781a00 100644 --- a/sys/arm/at91/uart_dev_at91usart.c +++ b/sys/arm/at91/uart_dev_at91usart.c @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include "uart_if.h" +#define uart_lock(x) mtx_lock_spin(&(x)) +#define uart_unlock(x) mtx_unlock_spin(&(x)) /* * High-level UART interface. */ @@ -80,7 +82,7 @@ static void at91_usart_init(struct uart_bas *bas, int, int, int, int); static void at91_usart_term(struct uart_bas *bas); static void at91_usart_putc(struct uart_bas *bas, int); static int at91_usart_poll(struct uart_bas *bas); -static int at91_usart_getc(struct uart_bas *bas, struct mtx *mtx); +static int at91_usart_getc(struct uart_bas *bas); extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; @@ -248,7 +250,7 @@ at91_usart_poll(struct uart_bas *bas) * Block waiting for a character. */ static int -at91_usart_getc(struct uart_bas *bas, struct mtx *mtx) +at91_usart_getc(struct uart_bas *bas) { int c; @@ -407,7 +409,7 @@ at91_usart_bus_receive(struct uart_softc *sc) { uart_lock(sc->sc_hwmtx); - uart_rx_put(sc, at91_usart_getc(&sc->sc_bas, NULL)); + uart_rx_put(sc, at91_usart_getc(&sc->sc_bas)); uart_unlock(sc->sc_hwmtx); return (0); } @@ -433,15 +435,15 @@ at91_usart_bus_ipend(struct uart_softc *sc) } uart_lock(sc->sc_hwmtx); if (csr & USART_CSR_TXRDY && sc->sc_txbusy) - ipend |= SER_INT_TXIDLE; + ipend |= UART_IPEND_TXIDLE; if (csr & USART_CSR_ENDTX && sc->sc_txbusy) - ipend |= SER_INT_TXIDLE; + ipend |= UART_IPEND_TXIDLE; if (csr & (USART_CSR_RXRDY /* | USART_CSR_ENDRX | USART_CSR_TIMEOUT */)) - ipend |= SER_INT_RXREADY; + ipend |= UART_IPEND_RXREADY; if (csr & USART_CSR_RXBRK) { unsigned int cr = USART_CR_RSTSTA; - ipend |= SER_INT_BREAK; + ipend |= UART_IPEND_BREAK; WR4(&sc->sc_bas, USART_CR, cr); } uart_unlock(sc->sc_hwmtx); @@ -470,7 +472,7 @@ at91_usart_bus_getsig(struct uart_softc *sc) sig |= SER_DSR; if (csr & USART_CSR_RI) sig |= SER_RI; - new = sig & ~SER_MASK_DELTA; + new = sig & ~UART_SIGMASK_DELTA; sc->sc_hwsig = new; uart_unlock(sc->sc_hwmtx); return (sig); diff --git a/sys/arm/conf/KB920X b/sys/arm/conf/KB920X index 0e8ee2263f85..6a9ae2cf008b 100644 --- a/sys/arm/conf/KB920X +++ b/sys/arm/conf/KB920X @@ -25,11 +25,12 @@ options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 options PHYSADDR=0x20000000 options STARTUP_PAGETABLE_ADDR=0x20800000 +options ARM32_NEW_VM_LAYOUT include "../at91/std.kb920x" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=arm9 options DDB options KDB @@ -41,12 +42,12 @@ options FFS #Berkeley Fast Filesystem #options SOFTUPDATES #Enable FFS soft updates support #options UFS_ACL #Support for access control lists #options UFS_DIRHASH #Improve performance on big directories -options MD_ROOT #MD is a potential root device -options MD_ROOT_SIZE=4096 # 3MB ram disk -options ROOTDEVNAME=\"ufs:md0\" -#options NFSCLIENT #Network Filesystem Client +#options MD_ROOT #MD is a potential root device +#options MD_ROOT_SIZE=4096 # 3MB ram disk +#options ROOTDEVNAME=\"ufs:md0\" +options NFSCLIENT #Network Filesystem Client #options NFSSERVER #Network Filesystem Server -#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_ROOT #NFS usable as /, requires NFSCLIENT #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) @@ -64,12 +65,16 @@ options NO_FFS_SNAPSHOT options NO_SWAPPING device genclock device loop +options BOOTP +options BOOTP_WIRED_TO=ate0 +options BOOTP_NFSROOT +options BOOTP_NFSV3 +options BOOTP_COMPAT device ether device nexus device uart device ate -device mii -device lxtphy +device miibus # Debugging for use in -current #options INVARIANTS #Enable calls of extra sanity checking @@ -81,3 +86,4 @@ device mem # Memory and kernel memory devices device md # device at91_twi # TWI: Two Wire Interface device at91_spi # SPI: +options COMPAT_43 diff --git a/sys/arm/conf/SKYEYE b/sys/arm/conf/SKYEYE index 8a52f94241b2..0956b479f428 100644 --- a/sys/arm/conf/SKYEYE +++ b/sys/arm/conf/SKYEYE @@ -24,6 +24,7 @@ ident KB920X options KERNPHYSADDR=0xc0000000 options KERNVIRTADDR=0xc0000000 options PHYSADDR=0xc0000000 +options ARM32_NEW_VM_LAYOUT include "../at91/std.kb920x" #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" #Default places to look for devices. @@ -86,3 +87,4 @@ options SKYEYE_WORKAROUNDS # Floppy drives +options COMPAT_43