Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jan 2009 06:20:56 +0000 (UTC)
From:      Oleksandr Tymoshenko <gonzo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r187516 - projects/mips/sys/mips/atheros
Message-ID:  <200901210620.n0L6Ku5P068518@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gonzo
Date: Wed Jan 21 06:20:56 2009
New Revision: 187516
URL: http://svn.freebsd.org/changeset/base/187516

Log:
  - Use new register naming convention
  - Properly initialize bus_space tags for uart

Modified:
  projects/mips/sys/mips/atheros/uart_cpu_ar71xx.c

Modified: projects/mips/sys/mips/atheros/uart_cpu_ar71xx.c
==============================================================================
--- projects/mips/sys/mips/atheros/uart_cpu_ar71xx.c	Wed Jan 21 06:17:01 2009	(r187515)
+++ projects/mips/sys/mips/atheros/uart_cpu_ar71xx.c	Wed Jan 21 06:20:56 2009	(r187516)
@@ -54,7 +54,7 @@ uart_cpu_getdev(int devtype, struct uart
 {
 	di->ops = uart_getops(&uart_ns8250_class);
 	di->bas.chan = 0;
-	di->bas.bst = 0;
+	di->bas.bst = MIPS_BUS_SPACE_MEM;
 	di->bas.regshft = 2;
 	/* TODO: calculate proper AHB freq using PLL registers */
 	di->bas.rclk = 85000000;
@@ -63,9 +63,16 @@ uart_cpu_getdev(int devtype, struct uart
 	di->stopbits = 1;
 	di->parity = UART_PARITY_NONE;
 
-	/* Bad MIPS, no IO for MIPS */
-	uart_bus_space_io = 0;
-	uart_bus_space_mem = MIPS_PHYS_TO_KSEG1(ATH_UART_ADDR) + 3;
-	di->bas.bsh = MIPS_PHYS_TO_KSEG1(ATH_UART_ADDR) + 3;
+	/* TODO: check if uart_bus_space_io mandatory to set */
+	uart_bus_space_io = MIPS_BUS_SPACE_IO;
+	uart_bus_space_mem = MIPS_BUS_SPACE_MEM;
+	/* 
+	 * FIXME:
+	 * 3 is to compensate big endian, uart operates 
+	 * with bus_space_read_1/bus_space_write_1 and hence gets 
+	 * highest byte instead of lowest one. Actual fix will involve
+	 * MIPS bus_space fixing.
+	 */
+	di->bas.bsh = MIPS_PHYS_TO_KSEG1(AR71XX_UART_ADDR) + 3;
 	return (0);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901210620.n0L6Ku5P068518>