diff --git a/sys/arm/sa11x0/assabet_machdep.c b/sys/arm/sa11x0/assabet_machdep.c index ce0048ade8fb..28c001971882 100644 --- a/sys/arm/sa11x0/assabet_machdep.c +++ b/sys/arm/sa11x0/assabet_machdep.c @@ -126,7 +126,7 @@ struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; extern void *_end; -int got_mmu = 0; +extern vm_offset_t sa1110_uart_vaddr; extern vm_offset_t sa1_cache_clean_addr; @@ -222,6 +222,7 @@ initarm(void *arg, void *arg2) int i = 0; uint32_t fake_preload[35]; uint32_t memsize = 32 * 1024 * 1024; + sa1110_uart_vaddr = SACOM1_VBASE; boothowto = RB_VERBOSE | RB_SINGLE; cninit(); @@ -433,7 +434,6 @@ initarm(void *arg, void *arg2) /* Enable MMU, I-cache, D-cache, write buffer. */ cpufunc_control(0x337f, 0x107d); - got_mmu = 1; arm_vector_init(ARM_VECTORS_LOW, ARM_VEC_ALL); pmap_curmaxkvaddr = freemempos + KERNEL_PT_VMDATA_NUM * 0x400000; diff --git a/sys/arm/sa11x0/uart_cpu_sa1110.c b/sys/arm/sa11x0/uart_cpu_sa1110.c index e8b548bb851c..b9b2c99f411d 100644 --- a/sys/arm/sa11x0/uart_cpu_sa1110.c +++ b/sys/arm/sa11x0/uart_cpu_sa1110.c @@ -50,15 +50,13 @@ uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) return ((b1->bsh == b2->bsh && b1->bst == b2->bst) ? 1 : 0); } -extern int got_mmu; - int uart_cpu_getdev(int devtype, struct uart_devinfo *di) { di->ops = uart_sa1110_ops; di->bas.chan = 0; di->bas.bst = &sa11x0_bs_tag; - di->bas.bsh = SACOM1_BASE; + di->bas.bsh = sa1110_uart_vaddr; di->bas.regshft = 0; di->bas.rclk = 0; di->baudrate = 9600; diff --git a/sys/arm/sa11x0/uart_dev_sa1110.c b/sys/arm/sa11x0/uart_dev_sa1110.c index 4fa99ead083f..77bc2dfc5514 100644 --- a/sys/arm/sa11x0/uart_dev_sa1110.c +++ b/sys/arm/sa11x0/uart_dev_sa1110.c @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #define DEFAULT_RCLK 3686400 -extern int got_mmu; - /* * Low-level UART interface. */ @@ -57,8 +55,6 @@ static void sa1110_putc(struct uart_bas *bas, int); static int sa1110_poll(struct uart_bas *bas); static int sa1110_getc(struct uart_bas *bas, struct mtx *mtx); -int did_mmu = 0; - extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; struct uart_ops uart_sa1110_ops = { @@ -76,23 +72,12 @@ sa1110_probe(struct uart_bas *bas) return (0); } -static void -sa1110_addr_change(struct uart_bas *bas) -{ - - bas->bsh = SACOM1_VBASE; - did_mmu = 1; -} - static void sa1110_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, int parity) { int brd; - /* XXX: sigh. */ - if (!did_mmu && got_mmu) - sa1110_addr_change(bas); if (bas->rclk == 0) bas->rclk = DEFAULT_RCLK; while (uart_getreg(bas, SACOM_SR1) & SR1_TBY); @@ -112,10 +97,6 @@ sa1110_term(struct uart_bas *bas) static void sa1110_putc(struct uart_bas *bas, int c) { - /* XXX: sigh. */ - if (!did_mmu && got_mmu) - sa1110_addr_change(bas); - while (!uart_getreg(bas, SACOM_SR1) & SR1_TNF); uart_setreg(bas, SACOM_DR, c); } @@ -123,10 +104,6 @@ sa1110_putc(struct uart_bas *bas, int c) static int sa1110_poll(struct uart_bas *bas) { - /* XXX: sigh. */ - if (!did_mmu && got_mmu) - sa1110_addr_change(bas); - if (!(uart_getreg(bas, SACOM_SR1) & SR1_RNE)) return (-1); return (uart_getreg(bas, SACOM_DR) & 0xff); @@ -136,9 +113,6 @@ static int sa1110_getc(struct uart_bas *bas, struct mtx *mtx) { int c; - /* XXX: sigh. */ - if (!did_mmu && got_mmu) - sa1110_addr_change(bas); while (!(uart_getreg(bas, SACOM_SR1) & SR1_RNE)) { u_int32_t sr0;