Skip to contentSkip to conversation

LEON SPARC V8 processor support for linux-2.6.10

PATCH In review Jiri Gaisler 4 participants 6 messages Jan 4, 2005 – Jan 9, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 7/7 LEON SPARC V8 processor support for linux-2.6.10

Leon2 serial+ethermac driver:

[7/7] diff2.6.10_driver_serial.diff: diff for drivers/serial

drivers/serial/Kconfig renamed from linux-2.6.10/drivers/serial/Kconfig +13 -0
diff -Naur ../linux-2.6.10/drivers/serial/Kconfig linux-2.6.10/drivers/serial/Kconfig
@@ -779,4 +779,17 @@
 	  If you use an M3T-M32700UT or an OPSPUT platform,
 	  please say Y.
 
+config SERIAL_LEON
+	tristate "Leon SoC serial support"
+	depends on LEON
+	help
+	  UArt driver for the Leon Soc (www.gaisler.com)
+
+config SERIAL_LEON_CONSOLE
+	bool "Leon serial console"
+	depends on LEON && SERIAL_LEON
+	select SERIAL_CORE_CONSOLE
+	help
+	  Running a console on Leon uart
+
 endmenu
drivers/serial/Makefile renamed from linux-2.6.10/drivers/serial/Makefile +3 -0
diff -Naur ../linux-2.6.10/drivers/serial/Makefile linux-2.6.10/drivers/serial/Makefile
@@ -29,6 +29,9 @@
 obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o
 obj-$(CONFIG_SERIAL_SUNSU) += sunsu.o
 obj-$(CONFIG_SERIAL_SUNSAB) += sunsab.o
+ifneq ($(CONFIG_LEON_3),y)
+obj-$(CONFIG_SERIAL_LEON) += leon.o
+endif
 obj-$(CONFIG_SERIAL_MUX) += mux.o
 obj-$(CONFIG_SERIAL_68328) += 68328serial.o
 obj-$(CONFIG_SERIAL_68360) += 68360serial.o
drivers/serial/leon.c renamed from linux-2.6.10/drivers/serial/leon.c +648 -0

648 lines not on this page · raw message

#1 lore raw

Is there no way to do this:

drivers/serial/Makefile line 34

Quoted 3 lines
drivers/serial/Makefile renamed from linux-2.6.10/drivers/serial/Makefile +3 -0
+ifneq ($(CONFIG_LEON_3),y)
+obj-$(CONFIG_SERIAL_LEON) += leon.o
+endif

by using dependencies in Kconfig rather than adding conditionals to the Makefile? Does it work to make SERIAL_LEON depend on LEON && !LEON_3?

- R.

#2 lore raw
In reply to Jiri Gaisler

drivers/serial/leon.c line 116

Quoted 6 lines · Jiri Gaisler
drivers/serial/leon.c renamed from linux-2.6.10/drivers/serial/leon.c +6 -0
+            if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
+			tty->flip.work.func((void *)tty);
+			if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
+				printk(KERN_WARNING "TTY_DONT_FLIP set\n");
+				return;
+			}

This code is broken. Please copy the fixes from the other drivers/serial/*.c files as you've copied a bug from the reference code. There are some other small cleanups in the base code that are worth adding too in particular removing direct (ab)use of tty->flip. because that will be changing some time in the future (when I finish debugging the tty layer mess)

#3 lore raw

Leon2 serial+ethermac driver, updated.

[7/7] diff2.6.10_driver_serial.diff: diff for drivers/serial

Quoted 20 lines · Alan Cox

Review

Quoted 6 lines · Jiri Gaisler
(quoted diff) +6 -0
+            if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
+			tty->flip.work.func((void *)tty);
+			if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
+				printk(KERN_WARNING "TTY_DONT_FLIP set\n");
+				return;
+			}

This code is broken. Please copy the fixes from the other drivers/serial/*.c files as you've copied a bug from the reference code. There are some other small cleanups in the base code that are worth adding too in particular removing direct (ab)use of tty->flip. because that will be changing some time in the future (when I finish debugging the tty layer mess)

.

Signature · 4 lines
--------------------------------------------------------------------------
Gaisler Research, 1:a Långgatan 19, 413 27 Goteborg, Sweden, +46-317758650
fax: +46-31421407 email: [email protected], home page: www.gaisler.com
--------------------------------------------------------------------------
drivers/serial/Kconfig renamed from linux-2.6.10/drivers/serial/Kconfig +13 -0
diff -Naur ../linux-2.6.10/drivers/serial/Kconfig linux-2.6.10/drivers/serial/Kconfig
@@ -779,4 +779,17 @@
 	  If you use an M3T-M32700UT or an OPSPUT platform,
 	  please say Y.
 
+config SERIAL_LEON
+	tristate "Leon SoC serial support"
+	depends on LEON && !LEON_3
+	help
+	  UArt driver for the Leon Soc (www.gaisler.com)
+
+config SERIAL_LEON_CONSOLE
+	bool "Leon serial console"
+	depends on LEON && SERIAL_LEON
+	select SERIAL_CORE_CONSOLE
+	help
+	  Running a console on Leon uart
+
 endmenu
drivers/serial/Makefile renamed from linux-2.6.10/drivers/serial/Makefile +1 -0
diff -Naur ../linux-2.6.10/drivers/serial/Makefile linux-2.6.10/drivers/serial/Makefile
@@ -29,6 +29,7 @@
 obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o
 obj-$(CONFIG_SERIAL_SUNSU) += sunsu.o
 obj-$(CONFIG_SERIAL_SUNSAB) += sunsab.o
+obj-$(CONFIG_SERIAL_LEON) += leon.o
 obj-$(CONFIG_SERIAL_MUX) += mux.o
 obj-$(CONFIG_SERIAL_68328) += 68328serial.o
 obj-$(CONFIG_SERIAL_68360) += 68360serial.o
drivers/serial/leon.c renamed from linux-2.6.10/drivers/serial/leon.c +650 -0

650 lines not on this page · raw message

#4 lore raw
Quoted 1 line · Jiri Gaisler

Leon2 serial+ethermac driver, updated.

Looks good to me. Fixes the serial code back up to current and removes the problem code.

#5 lore raw
In reply to Jiri Gaisler

drivers/serial/leon.c line 216

Quoted 6 lines · Jiri Gaisler
drivers/serial/leon.c renamed from linux-2.6.10/drivers/serial/leon.c +6 -0
+static irqreturn_t leonuart_int(int irq, void *dev_id, struct pt_regs *regs)
+{
+	struct uart_port *port = dev_id;
+	unsigned int status;
+
+	spin_lock(port ->lock);

I think that should be

	spin_lock(&port->lock);

[...]

drivers/serial/leon.c line 229

Quoted 1 line
drivers/serial/leon.c renamed from linux-2.6.10/drivers/serial/leon.c +1 -0
+	spin_unlock(port ->lock);

and

	spin_unlock(&port->lock);

Review

Quoted 2 lines
(quoted diff) +2 -0
+	return IRQ_HANDLED;
+}

Regards,
Clemens