* [PATCH][MIPS][5/6]: AR7: serial hack [not found] <200803120221.25044.technoboy85@gmail.com> @ 2008-03-12 1:30 ` Matteo Croce 2008-03-12 9:31 ` Thomas Bogendoerfer 2008-03-12 11:16 ` Alan Cox 0 siblings, 2 replies; 24+ messages in thread From: Matteo Croce @ 2008-03-12 1:30 UTC (permalink / raw) To: linux-mips Cc: Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton Ugly but we need it Signed-off-by: Matteo Croce <technoboy85@gmail.com> Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Nicolas Thill <nico@openwrt.org> diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 77f7a7f..a3a271d 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -267,6 +267,13 @@ static const struct serial8250_config uart_config[] = { .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, .flags = UART_CAP_FIFO, }, + [PORT_AR7] = { + .name = "TI-AR7", + .fifo_size = 16, + .tx_loadsz = 16, + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00, + .flags = UART_CAP_FIFO | UART_CAP_AFE, + }, }; #if defined (CONFIG_SERIAL_8250_AU1X00) @@ -2455,7 +2462,11 @@ static void serial8250_console_putchar(struct uart_port *port, int ch) { struct uart_8250_port *up = (struct uart_8250_port *)port; +#ifdef CONFIG_AR7 + wait_for_xmitr(up, BOTH_EMPTY); +#else wait_for_xmitr(up, UART_LSR_THRE); +#endif serial_out(up, UART_TX, ch); } diff --git a/include/linux/serialP.h b/include/linux/serialP.h index e811a61..cf71de9 100644 --- a/include/linux/serialP.h +++ b/include/linux/serialP.h @@ -135,6 +135,10 @@ struct rs_multiport_struct { * the interrupt line _up_ instead of down, so if we register the IRQ * while the UART is in that state, we die in an IRQ storm. */ #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2) +#elif defined(CONFIG_AR7) +/* This is how it is set up by bootloader... */ +#define ALPHA_KLUDGE_MCR (UART_MCR_OUT2 | UART_MCR_OUT1 \ + | UART_MCR_RTS | UART_MCR_DTR) #else #define ALPHA_KLUDGE_MCR 0 #endif diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 289942f..869b6df 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -40,6 +40,7 @@ #define PORT_NS16550A 14 #define PORT_XSCALE 15 #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ +#define PORT_AR7 16 #define PORT_MAX_8250 16 /* max port ID */ /* ^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-12 1:30 ` [PATCH][MIPS][5/6]: AR7: serial hack Matteo Croce @ 2008-03-12 9:31 ` Thomas Bogendoerfer 2008-03-13 0:38 ` Matteo Croce 2008-03-12 11:16 ` Alan Cox 1 sibling, 1 reply; 24+ messages in thread From: Thomas Bogendoerfer @ 2008-03-12 9:31 UTC (permalink / raw) To: Matteo Croce Cc: linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton On Wed, Mar 12, 2008 at 02:30:06AM +0100, Matteo Croce wrote: > Ugly but we need it why ? I'm running AR7 uarts just like all other 16550. > #if defined (CONFIG_SERIAL_8250_AU1X00) > @@ -2455,7 +2462,11 @@ static void serial8250_console_putchar(struct uart_port *port, int ch) > { > struct uart_8250_port *up = (struct uart_8250_port *)port; > > +#ifdef CONFIG_AR7 > + wait_for_xmitr(up, BOTH_EMPTY); > +#else > wait_for_xmitr(up, UART_LSR_THRE); > +#endif > serial_out(up, UART_TX, ch); > } this doesn't make sense. Why don't you check for the port type and decide, if you need to use the AR7 way or the normal way. This will for example break 16550 uarts connected via PCI on UR8 devices. > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h > index 289942f..869b6df 100644 > --- a/include/linux/serial_core.h > +++ b/include/linux/serial_core.h > @@ -40,6 +40,7 @@ > #define PORT_NS16550A 14 > #define PORT_XSCALE 15 > #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ > +#define PORT_AR7 16 this doesn't look correct. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessary a good idea. [ RFC1925, 2.3 ] ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-12 9:31 ` Thomas Bogendoerfer @ 2008-03-13 0:38 ` Matteo Croce 2008-03-13 8:45 ` Thomas Bogendoerfer 0 siblings, 1 reply; 24+ messages in thread From: Matteo Croce @ 2008-03-13 0:38 UTC (permalink / raw) To: Thomas Bogendoerfer Cc: linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton Il Wednesday 12 March 2008 10:31:46 Thomas Bogendoerfer ha scritto: > > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h > > index 289942f..869b6df 100644 > > --- a/include/linux/serial_core.h > > +++ b/include/linux/serial_core.h > > @@ -40,6 +40,7 @@ > > #define PORT_NS16550A 14 > > #define PORT_XSCALE 15 > > #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ > > +#define PORT_AR7 16 > > this doesn't look correct. > > Thomas. > Isn't it 16? ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-13 0:38 ` Matteo Croce @ 2008-03-13 8:45 ` Thomas Bogendoerfer 2008-03-14 15:46 ` Matteo Croce 0 siblings, 1 reply; 24+ messages in thread From: Thomas Bogendoerfer @ 2008-03-13 8:45 UTC (permalink / raw) To: Matteo Croce Cc: linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton On Thu, Mar 13, 2008 at 01:38:55AM +0100, Matteo Croce wrote: > Il Wednesday 12 March 2008 10:31:46 Thomas Bogendoerfer ha scritto: > > > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h > > > index 289942f..869b6df 100644 > > > --- a/include/linux/serial_core.h > > > +++ b/include/linux/serial_core.h > > > @@ -40,6 +40,7 @@ > > > #define PORT_NS16550A 14 > > > #define PORT_XSCALE 15 > > > #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ > > > +#define PORT_AR7 16 > > > > this doesn't look correct. > > > > Thomas. > > > > Isn't it 16? PORT_RM9000 is 16, how could PORT_AR7 be 16 as well ? And the 16 for PORT_RM9000 is correct in my counting. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessary a good idea. [ RFC1925, 2.3 ] ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-13 8:45 ` Thomas Bogendoerfer @ 2008-03-14 15:46 ` Matteo Croce 2008-03-15 10:40 ` Thomas Bogendoerfer 2008-03-15 11:38 ` Alan Cox 0 siblings, 2 replies; 24+ messages in thread From: Matteo Croce @ 2008-03-14 15:46 UTC (permalink / raw) To: Thomas Bogendoerfer Cc: linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton Il Thursday 13 March 2008 09:45:26 Thomas Bogendoerfer ha scritto: > On Thu, Mar 13, 2008 at 01:38:55AM +0100, Matteo Croce wrote: > > Il Wednesday 12 March 2008 10:31:46 Thomas Bogendoerfer ha scritto: > > > > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h > > > > index 289942f..869b6df 100644 > > > > --- a/include/linux/serial_core.h > > > > +++ b/include/linux/serial_core.h > > > > @@ -40,6 +40,7 @@ > > > > #define PORT_NS16550A 14 > > > > #define PORT_XSCALE 15 > > > > #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ > > > > +#define PORT_AR7 16 > > > > > > this doesn't look correct. > > > > > > Thomas. > > > > > > > Isn't it 16? > > PORT_RM9000 is 16, how could PORT_AR7 be 16 as well ? And the 16 for > PORT_RM9000 is correct in my counting. > > Thomas. > This is a bit better diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 77f7a7f..a3a271d 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -267,6 +267,13 @@ static const struct serial8250_config uart_config[] = { .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, .flags = UART_CAP_FIFO, }, + [PORT_AR7] = { + .name = "TI-AR7", + .fifo_size = 16, + .tx_loadsz = 16, + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00, + .flags = UART_CAP_FIFO | UART_CAP_AFE, + }, }; #if defined (CONFIG_SERIAL_8250_AU1X00) @@ -2455,7 +2462,11 @@ static void serial8250_console_putchar(struct uart_port *port, int ch) { struct uart_8250_port *up = (struct uart_8250_port *)port; +#ifdef CONFIG_AR7 + wait_for_xmitr(up, BOTH_EMPTY); +#else wait_for_xmitr(up, UART_LSR_THRE); +#endif serial_out(up, UART_TX, ch); } diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 289942f..15e76c8 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -40,7 +40,8 @@ #define PORT_NS16550A 14 #define PORT_XSCALE 15 #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ -#define PORT_MAX_8250 16 /* max port ID */ +#define PORT_AR7 17 +#define PORT_MAX_8250 17 /* max port ID */ /* * ARM specific type numbers. These are not currently guaranteed ^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-14 15:46 ` Matteo Croce @ 2008-03-15 10:40 ` Thomas Bogendoerfer 2008-03-16 15:45 ` Matteo Croce 2008-03-15 11:38 ` Alan Cox 1 sibling, 1 reply; 24+ messages in thread From: Thomas Bogendoerfer @ 2008-03-15 10:40 UTC (permalink / raw) To: Matteo Croce Cc: linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton On Fri, Mar 14, 2008 at 04:46:09PM +0100, Matteo Croce wrote: > This is a bit better is it possible to try without the serial changes first ? Use uart_port[0].type = PORT_16550A; in arch/mips/ar7/platform.c. Does it work ? Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessary a good idea. [ RFC1925, 2.3 ] ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-15 10:40 ` Thomas Bogendoerfer @ 2008-03-16 15:45 ` Matteo Croce 2008-03-18 13:30 ` Thomas Bogendoerfer 2008-03-21 1:55 ` Thomas Bogendoerfer 0 siblings, 2 replies; 24+ messages in thread From: Matteo Croce @ 2008-03-16 15:45 UTC (permalink / raw) To: Thomas Bogendoerfer Cc: linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton Il Saturday 15 March 2008 11:40:09 Thomas Bogendoerfer ha scritto: > On Fri, Mar 14, 2008 at 04:46:09PM +0100, Matteo Croce wrote: > > This is a bit better > > is it possible to try without the serial changes first ? > > Use > > uart_port[0].type = PORT_16550A; > > in arch/mips/ar7/platform.c. > > Does it work ? > > Thomas. > Tried I get teh usual broken serial output: IP6 oover IPv4 tuneliing driver NET: eggistered protooll family 17 VFS: Monteed root (squahfss filesystem)reaadonly. ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-16 15:45 ` Matteo Croce @ 2008-03-18 13:30 ` Thomas Bogendoerfer 2008-03-18 13:43 ` Sergei Shtylyov 2008-03-18 14:01 ` Alan Cox 2008-03-21 1:55 ` Thomas Bogendoerfer 1 sibling, 2 replies; 24+ messages in thread From: Thomas Bogendoerfer @ 2008-03-18 13:30 UTC (permalink / raw) To: Matteo Croce Cc: linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton On Sun, Mar 16, 2008 at 04:45:06PM +0100, Matteo Croce wrote: > Il Saturday 15 March 2008 11:40:09 Thomas Bogendoerfer ha scritto: > > On Fri, Mar 14, 2008 at 04:46:09PM +0100, Matteo Croce wrote: > > > This is a bit better > > > > is it possible to try without the serial changes first ? > > > > Use > > > > uart_port[0].type = PORT_16550A; > > > > in arch/mips/ar7/platform.c. > > > > Does it work ? > > > > Tried I get teh usual broken serial output: I just checked the latest AR7/UR8 source, I have, and they don't need special hacks. This is a 2.6.10 based tree. At that time there was no serial8250_console_putchar(), console output was done via serial8250_console_write() without any helper. Before writing to the UART_TX, wait_for_xmitr() is called. And this wait_for_xmitr() does check for BOTH_EMPTY. Is there a good reason, why we don't check for BOTH_EMPTY in serial8250_console_putchar() ? To match the 2.6.10 behaviour we would need that and this would fix the AR7 case without any special handling. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessary a good idea. [ RFC1925, 2.3 ] ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-18 13:30 ` Thomas Bogendoerfer @ 2008-03-18 13:43 ` Sergei Shtylyov 2008-03-18 13:49 ` Sergei Shtylyov 2008-03-18 14:01 ` Alan Cox 1 sibling, 1 reply; 24+ messages in thread From: Sergei Shtylyov @ 2008-03-18 13:43 UTC (permalink / raw) To: Thomas Bogendoerfer Cc: Matteo Croce, linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton Hello. Thomas Bogendoerfer wrote: >>Il Saturday 15 March 2008 11:40:09 Thomas Bogendoerfer ha scritto: >>>On Fri, Mar 14, 2008 at 04:46:09PM +0100, Matteo Croce wrote: >>>>This is a bit better >>>is it possible to try without the serial changes first ? >>>Use >>> uart_port[0].type = PORT_16550A; >>>in arch/mips/ar7/platform.c. >>>Does it work ? >>Tried I get teh usual broken serial output: > I just checked the latest AR7/UR8 source, I have, and they don't need > special hacks. This is a 2.6.10 based tree. At that time there was > no serial8250_console_putchar(), console output was done via > serial8250_console_write() without any helper. Before writing to > the UART_TX, wait_for_xmitr() is called. And this wait_for_xmitr() does > check for BOTH_EMPTY. > Is there a good reason, why we don't check for BOTH_EMPTY in > serial8250_console_putchar() ? I guess transmission will be slower if you check both THRE and TSRE conditions. > To match the 2.6.10 behaviour we > would need that and this would fix the AR7 case without any > special handling. AR7 case seems to be the case of bad hardware, and so require special handling... > Thomas. WBR, Sergei ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-18 13:43 ` Sergei Shtylyov @ 2008-03-18 13:49 ` Sergei Shtylyov 0 siblings, 0 replies; 24+ messages in thread From: Sergei Shtylyov @ 2008-03-18 13:49 UTC (permalink / raw) To: Thomas Bogendoerfer Cc: Matteo Croce, linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton Hi, I wrote: >>>>> This is a bit better >>>> is it possible to try without the serial changes first ? >>>> Use >>>> uart_port[0].type = PORT_16550A; >>>> in arch/mips/ar7/platform.c. >>>> Does it work ? >>> Tried I get teh usual broken serial output: >> I just checked the latest AR7/UR8 source, I have, and they don't need >> special hacks. This is a 2.6.10 based tree. At that time there was >> no serial8250_console_putchar(), console output was done via >> serial8250_console_write() without any helper. Before writing to the >> UART_TX, wait_for_xmitr() is called. And this wait_for_xmitr() does >> check for BOTH_EMPTY. >> Is there a good reason, why we don't check for BOTH_EMPTY in >> serial8250_console_putchar() ? > I guess transmission will be slower if you check both THRE and TSRE > conditions. ... and since TX FIFO is in use, it must be even worse since you're only able to load TX FIFO in the short time slots while TX shift register is empty -- quite possibly that this condition will turn to virtually no TX FIFO as these slots my be to short. BTW, does turning off TX FIFO help? WBR, Sergei ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-18 13:30 ` Thomas Bogendoerfer 2008-03-18 13:43 ` Sergei Shtylyov @ 2008-03-18 14:01 ` Alan Cox 2008-03-18 15:28 ` Thomas Bogendoerfer 1 sibling, 1 reply; 24+ messages in thread From: Alan Cox @ 2008-03-18 14:01 UTC (permalink / raw) To: Thomas Bogendoerfer Cc: Matteo Croce, linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton > Is there a good reason, why we don't check for BOTH_EMPTY in > serial8250_console_putchar() ? To match the 2.6.10 behaviour we A very good one - we have at least 1 byte of FIFO and the serial-ethernet magic console devices also use that fifo emptying entirely to deduce when to send a new packet. > would need that and this would fix the AR7 case without any > special handling. If the AR7 is an 8250 why does it need special handling? and indeed why does serial work on it except for console - or does that fail too. ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-18 14:01 ` Alan Cox @ 2008-03-18 15:28 ` Thomas Bogendoerfer 0 siblings, 0 replies; 24+ messages in thread From: Thomas Bogendoerfer @ 2008-03-18 15:28 UTC (permalink / raw) To: Alan Cox Cc: Matteo Croce, linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton On Tue, Mar 18, 2008 at 02:01:33PM +0000, Alan Cox wrote: > > Is there a good reason, why we don't check for BOTH_EMPTY in > > serial8250_console_putchar() ? To match the 2.6.10 behaviour we > > A very good one - we have at least 1 byte of FIFO and the serial-ethernet > magic console devices also use that fifo emptying entirely to deduce when > to send a new packet. ok, now I understand. > > would need that and this would fix the AR7 case without any > > special handling. > > If the AR7 is an 8250 why does it need special handling? and indeed why > does serial work on it except for console - or does that fail too. well TI calls it a 16550A and I still wonder about the reported problems. Looks like I need to dig a little bit deeper... Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessary a good idea. [ RFC1925, 2.3 ] ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-16 15:45 ` Matteo Croce 2008-03-18 13:30 ` Thomas Bogendoerfer @ 2008-03-21 1:55 ` Thomas Bogendoerfer 2008-03-27 21:14 ` Matteo Croce 2008-03-27 21:17 ` Matteo Croce 1 sibling, 2 replies; 24+ messages in thread From: Thomas Bogendoerfer @ 2008-03-21 1:55 UTC (permalink / raw) To: Matteo Croce Cc: linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton On Sun, Mar 16, 2008 at 04:45:06PM +0100, Matteo Croce wrote: > Tried I get teh usual broken serial output: > > IP6 oover IPv4 tuneliing driver > NET: eggistered protooll family 17 > VFS: Monteed root (squahfss filesystem)reaadonly. Linux version 2.6.25-rc6-00000-g151de9e-dirty (tsbogend@solo.franken.de) (gcc version 3.3.3 (Debian 20040320)) #29 Fri Mar 21 02:40:21 CET 2008 console [early0] enabled CPU revision is: 00018448 (MIPS 4KEc) TI AR7 (Unknown), ID: 0x5700, Revision: 0x00 Determined physical RAM map: memory: 02000000 @ 14000000 (usable) Zone PFN ranges: Normal 81920 -> 90112 Movable zone start PFN for each node early_node_map[1] active PFN ranges 0: 81920 -> 90112 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128 Kernel command line: console=ttyS0,115200 Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes. Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 16 bytes Synthesized clear page handler (26 instructions). Synthesized copy page handler (46 instructions). PID hash table entries: 128 (order: 7, 512 bytes) Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) Memory: 29700k/32768k available (2075k kernel code, 3068k reserved, 466k data, 136k init, 0k highmem) Mount-cache hash table entries: 512 net_namespace: 152 bytes NET: Registered protocol family 16 SCSI subsystem initialized NET: Registered protocol family 2 Time: MIPS clocksource has been installed. IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 1024 (order: 1, 8192 bytes) TCP bind hash table entries: 1024 (order: 0, 4096 bytes) TCP: Hash tables configured (established 1024 bind 1024) TCP reno registered io scheduler noop registered io scheduler anticipatory registered (default) io scheduler deadline registered Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled serial8250: ttyS0 at MMIO 0x8610e03 (irq = 15) is a 16550A console handover: boot [early0] -> real [ttyS0] serial8250: ttyS1 at MMIO 0x8610f03 (irq = 16) is a 16550A loop: module loaded Fixed MDIO Bus: probed ar7_wdt: failed to unlock WDT disable reg ar7_wdt: failed to unlock WDT prescale reg ar7_wdt: failed to unlock WDT change reg ar7_wdt: timer margin 59 seconds (prescale 65535, change 57180, freq 62500000) TCP cubic registered NET: Registered protocol family 1 NET: Registered protocol family 17 RPC: Registered udp transport module. RPC: Registered tcp transport module. Root-NFS: No NFS server available, giving up. VFS: Unable to mount root fs via NFS, trying floppy. List of all partitions: No filesystem could mount root, tried: Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0) Rebooting in 3 seconds.. I don't see any problems with using PORT_16550A. What I'm still wondering how your kernel could work at all, since there is a missing case for setting up the TLB refill handler. Something like the patch below. And most of the AR7 device driver code will not work for big endian. The log above is from a big endian AR7 system, where I needed to disable CPMAC to get it booting that far. Thomas. diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 3a93d4c..382738c 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c @@ -307,6 +307,7 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l, case CPU_R12000: case CPU_R14000: case CPU_4KC: + case CPU_4KEC: case CPU_SB1: case CPU_SB1A: case CPU_4KSC: -- Crap can work. Given enough thrust pigs will fly, but it's not necessary a good idea. [ RFC1925, 2.3 ] ^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-21 1:55 ` Thomas Bogendoerfer @ 2008-03-27 21:14 ` Matteo Croce 2008-03-27 21:17 ` Matteo Croce 1 sibling, 0 replies; 24+ messages in thread From: Matteo Croce @ 2008-03-27 21:14 UTC (permalink / raw) To: Thomas Bogendoerfer Cc: linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton Il Friday 21 March 2008 02:55:40 Thomas Bogendoerfer ha scritto: > On Sun, Mar 16, 2008 at 04:45:06PM +0100, Matteo Croce wrote: > > Tried I get teh usual broken serial output: > > > > IP6 oover IPv4 tuneliing driver > > NET: eggistered protooll family 17 > > VFS: Monteed root (squahfss filesystem)reaadonly. > > Linux version 2.6.25-rc6-00000-g151de9e-dirty (tsbogend@solo.franken.de) > (gcc version 3.3.3 (Debian 20040320)) #29 Fri Mar 21 02:40:21 CET 2008 > console [early0] enabled > CPU revision is: 00018448 (MIPS 4KEc) > TI AR7 (Unknown), ID: 0x5700, Revision: 0x00 > Determined physical RAM map: > memory: 02000000 @ 14000000 (usable) > Zone PFN ranges: > Normal 81920 -> 90112 > Movable zone start PFN for each node > early_node_map[1] active PFN ranges > 0: 81920 -> 90112 > Built 1 zonelists in Zone order, mobility grouping on. Total pages: > 8128 > Kernel command line: console=ttyS0,115200 > Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes. > Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 16 bytes > Synthesized clear page handler (26 instructions). > Synthesized copy page handler (46 instructions). > PID hash table entries: 128 (order: 7, 512 bytes) > Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) > Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) > Memory: 29700k/32768k available (2075k kernel code, 3068k reserved, 466k > data, 136k init, 0k highmem) > Mount-cache hash table entries: 512 > net_namespace: 152 bytes > NET: Registered protocol family 16 > SCSI subsystem initialized > NET: Registered protocol family 2 > Time: MIPS clocksource has been installed. > IP route cache hash table entries: 1024 (order: 0, 4096 bytes) > TCP established hash table entries: 1024 (order: 1, 8192 bytes) > TCP bind hash table entries: 1024 (order: 0, 4096 bytes) > TCP: Hash tables configured (established 1024 bind 1024) > TCP reno registered > io scheduler noop registered > io scheduler anticipatory registered (default) > io scheduler deadline registered > Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing > disabled > serial8250: ttyS0 at MMIO 0x8610e03 (irq = 15) is a 16550A > console handover: boot [early0] -> real [ttyS0] > serial8250: ttyS1 at MMIO 0x8610f03 (irq = 16) is a 16550A > loop: module loaded > Fixed MDIO Bus: probed > ar7_wdt: failed to unlock WDT disable reg > ar7_wdt: failed to unlock WDT prescale reg > ar7_wdt: failed to unlock WDT change reg > ar7_wdt: timer margin 59 seconds (prescale 65535, change 57180, freq > 62500000) > TCP cubic registered > NET: Registered protocol family 1 > NET: Registered protocol family 17 > RPC: Registered udp transport module. > RPC: Registered tcp transport module. > Root-NFS: No NFS server available, giving up. > VFS: Unable to mount root fs via NFS, trying floppy. > List of all partitions: > No filesystem could mount root, tried: > Kernel panic - not syncing: VFS: Unable to mount root fs on > unknown-block(2,0) > Rebooting in 3 seconds.. > > I don't see any problems with using PORT_16550A. What I'm still > wondering how your kernel could work at all, since there is a > missing case for setting up the TLB refill handler. Something like > the patch below. > > And most of the AR7 device driver code will not work for big endian. > The log above is from a big endian AR7 system, where I needed > to disable CPMAC to get it booting that far. > > Thomas. > > > diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c > index 3a93d4c..382738c 100644 > --- a/arch/mips/mm/tlbex.c > +++ b/arch/mips/mm/tlbex.c > @@ -307,6 +307,7 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l, > case CPU_R12000: > case CPU_R14000: > case CPU_4KC: > + case CPU_4KEC: > case CPU_SB1: > case CPU_SB1A: > case CPU_4KSC: > > Actually we use this for 2.6.24: Index: linux-2.6.24/arch/mips/mm/tlbex.c =================================================================== --- linux-2.6.24/arch/mips/mm/tlbex.c 2007-10-10 04:31:38.000000000 +0800 +++ linux-2.6.24/arch/mips/mm/tlbex.c 2007-10-10 13:52:34.000000000 +0800 @@ -902,7 +902,6 @@ case CPU_R10000: case CPU_R12000: case CPU_R14000: - case CPU_4KC: case CPU_SB1: case CPU_SB1A: case CPU_4KSC: @@ -933,6 +932,7 @@ tlbw(p); break; + case CPU_4KC: case CPU_4KEC: case CPU_24K: case CPU_34K: ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-21 1:55 ` Thomas Bogendoerfer 2008-03-27 21:14 ` Matteo Croce @ 2008-03-27 21:17 ` Matteo Croce 1 sibling, 0 replies; 24+ messages in thread From: Matteo Croce @ 2008-03-27 21:17 UTC (permalink / raw) To: Thomas Bogendoerfer Cc: linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton Il Friday 21 March 2008 02:55:40 Thomas Bogendoerfer ha scritto: > On Sun, Mar 16, 2008 at 04:45:06PM +0100, Matteo Croce wrote: > > Tried I get teh usual broken serial output: > > > > IP6 oover IPv4 tuneliing driver > > NET: eggistered protooll family 17 > > VFS: Monteed root (squahfss filesystem)reaadonly. > > Linux version 2.6.25-rc6-00000-g151de9e-dirty (tsbogend@solo.franken.de) > (gcc version 3.3.3 (Debian 20040320)) #29 Fri Mar 21 02:40:21 CET 2008 > console [early0] enabled > CPU revision is: 00018448 (MIPS 4KEc) > TI AR7 (Unknown), ID: 0x5700, Revision: 0x00 > Determined physical RAM map: > memory: 02000000 @ 14000000 (usable) > Zone PFN ranges: > Normal 81920 -> 90112 > Movable zone start PFN for each node > early_node_map[1] active PFN ranges > 0: 81920 -> 90112 > Built 1 zonelists in Zone order, mobility grouping on. Total pages: > 8128 > Kernel command line: console=ttyS0,115200 > Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes. > Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 16 bytes > Synthesized clear page handler (26 instructions). > Synthesized copy page handler (46 instructions). > PID hash table entries: 128 (order: 7, 512 bytes) > Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) > Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) > Memory: 29700k/32768k available (2075k kernel code, 3068k reserved, 466k > data, 136k init, 0k highmem) > Mount-cache hash table entries: 512 > net_namespace: 152 bytes > NET: Registered protocol family 16 > SCSI subsystem initialized > NET: Registered protocol family 2 > Time: MIPS clocksource has been installed. > IP route cache hash table entries: 1024 (order: 0, 4096 bytes) > TCP established hash table entries: 1024 (order: 1, 8192 bytes) > TCP bind hash table entries: 1024 (order: 0, 4096 bytes) > TCP: Hash tables configured (established 1024 bind 1024) > TCP reno registered > io scheduler noop registered > io scheduler anticipatory registered (default) > io scheduler deadline registered > Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing > disabled > serial8250: ttyS0 at MMIO 0x8610e03 (irq = 15) is a 16550A > console handover: boot [early0] -> real [ttyS0] > serial8250: ttyS1 at MMIO 0x8610f03 (irq = 16) is a 16550A > loop: module loaded > Fixed MDIO Bus: probed > ar7_wdt: failed to unlock WDT disable reg > ar7_wdt: failed to unlock WDT prescale reg > ar7_wdt: failed to unlock WDT change reg > ar7_wdt: timer margin 59 seconds (prescale 65535, change 57180, freq > 62500000) > TCP cubic registered > NET: Registered protocol family 1 > NET: Registered protocol family 17 > RPC: Registered udp transport module. > RPC: Registered tcp transport module. > Root-NFS: No NFS server available, giving up. > VFS: Unable to mount root fs via NFS, trying floppy. > List of all partitions: > No filesystem could mount root, tried: > Kernel panic - not syncing: VFS: Unable to mount root fs on > unknown-block(2,0) > Rebooting in 3 seconds.. > > I don't see any problems with using PORT_16550A. What I'm still > wondering how your kernel could work at all, since there is a > missing case for setting up the TLB refill handler. Something like > the patch below. > > And most of the AR7 device driver code will not work for big endian. > The log above is from a big endian AR7 system, where I needed > to disable CPMAC to get it booting that far. > > Thomas. > > > diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c > index 3a93d4c..382738c 100644 > --- a/arch/mips/mm/tlbex.c > +++ b/arch/mips/mm/tlbex.c > @@ -307,6 +307,7 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l, > case CPU_R12000: > case CPU_R14000: > case CPU_4KC: > + case CPU_4KEC: > case CPU_SB1: > case CPU_SB1A: > case CPU_4KSC: > > Actually we use this for 2.6.24: Index: linux-2.6.24/arch/mips/mm/tlbex.c =================================================================== --- linux-2.6.24/arch/mips/mm/tlbex.c 2007-10-10 04:31:38.000000000 +0800 +++ linux-2.6.24/arch/mips/mm/tlbex.c 2007-10-10 13:52:34.000000000 +0800 @@ -902,7 +902,6 @@ case CPU_R10000: case CPU_R12000: case CPU_R14000: - case CPU_4KC: case CPU_SB1: case CPU_SB1A: case CPU_4KSC: @@ -933,6 +932,7 @@ tlbw(p); break; + case CPU_4KC: case CPU_4KEC: case CPU_24K: case CPU_34K: ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-14 15:46 ` Matteo Croce 2008-03-15 10:40 ` Thomas Bogendoerfer @ 2008-03-15 11:38 ` Alan Cox 1 sibling, 0 replies; 24+ messages in thread From: Alan Cox @ 2008-03-15 11:38 UTC (permalink / raw) To: Matteo Croce Cc: Thomas Bogendoerfer, linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton > This is a bit better NAK - especially as there has been a specific response about how to do this without ifdef hacks in core code. Alan ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-12 1:30 ` [PATCH][MIPS][5/6]: AR7: serial hack Matteo Croce 2008-03-12 9:31 ` Thomas Bogendoerfer @ 2008-03-12 11:16 ` Alan Cox 2008-03-13 0:31 ` Matteo Croce 1 sibling, 1 reply; 24+ messages in thread From: Alan Cox @ 2008-03-12 11:16 UTC (permalink / raw) To: Matteo Croce Cc: linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton On Wed, 12 Mar 2008 02:30:06 +0100 Matteo Croce <technoboy85@gmail.com> wrote: > Ugly but we need it Too ugly - NAK However please send an explanation of the problem and lets find a nicer way to do it or bury it in arch code. ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-12 11:16 ` Alan Cox @ 2008-03-13 0:31 ` Matteo Croce 2008-03-13 9:01 ` Thomas Bogendoerfer 0 siblings, 1 reply; 24+ messages in thread From: Matteo Croce @ 2008-03-13 0:31 UTC (permalink / raw) To: Alan Cox Cc: linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton Il Wednesday 12 March 2008 12:16:29 Alan Cox ha scritto: > On Wed, 12 Mar 2008 02:30:06 +0100 > Matteo Croce <technoboy85@gmail.com> wrote: > > > Ugly but we need it > > Too ugly - NAK > > However please send an explanation of the problem and lets find a nicer > way to do it or bury it in arch code. > > This is my problem: ffi_cmdset_000: DDisabling erae-ssuspend-progrm ddue to code bokeenness. cmdlinparrt partition arssing not avaiabll RedBoo ppartition parsngg not availabl NET: Rgiistered protocl family 1 NET: Regsteered protocol ammily 10 IPv6 overIPPv4 tunnelingdriiver NET: Regsteered protocolfammily 17 FS:: Mounted roo (ssquashfs filessttem) readonly. Freeing nuused kernel meorry: 120k freed I'll try to find a nicer way to fix it ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-13 0:31 ` Matteo Croce @ 2008-03-13 9:01 ` Thomas Bogendoerfer 2008-03-16 15:27 ` Matteo Croce 2008-03-16 15:49 ` Matteo Croce 0 siblings, 2 replies; 24+ messages in thread From: Thomas Bogendoerfer @ 2008-03-13 9:01 UTC (permalink / raw) To: Matteo Croce Cc: Alan Cox, linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton On Thu, Mar 13, 2008 at 01:31:54AM +0100, Matteo Croce wrote: > Il Wednesday 12 March 2008 12:16:29 Alan Cox ha scritto: > > On Wed, 12 Mar 2008 02:30:06 +0100 > > Matteo Croce <technoboy85@gmail.com> wrote: > > > > > Ugly but we need it > > > > Too ugly - NAK > > > > However please send an explanation of the problem and lets find a nicer > > way to do it or bury it in arch code. > > > > > > This is my problem: > > ffi_cmdset_000: DDisabling erae-ssuspend-progrm ddue to code bokeenness. > cmdlinparrt partition arssing not avaiabll > RedBoo ppartition parsngg not availabl > NET: Rgiistered protocl family 1 > NET: Regsteered protocol ammily 10 > IPv6 overIPPv4 tunnelingdriiver > NET: Regsteered protocolfammily 17 > FS:: Mounted roo (ssquashfs filessttem) readonly. > Freeing nuused kernel meorry: 120k freed > > I'll try to find a nicer way to fix it don't use AFE mode and treat it like a normal 16550 (PORT_16550A). You could also try to use UPIO_MEM32. That's how my console driver (different OS) works for AR7 without the hack to wait for LSR_TEMP and LSR_THRE. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessary a good idea. [ RFC1925, 2.3 ] ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-13 9:01 ` Thomas Bogendoerfer @ 2008-03-16 15:27 ` Matteo Croce 2008-03-16 15:49 ` Matteo Croce 1 sibling, 0 replies; 24+ messages in thread From: Matteo Croce @ 2008-03-16 15:27 UTC (permalink / raw) To: Thomas Bogendoerfer Cc: Alan Cox, linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton Il Thursday 13 March 2008 10:01:09 Thomas Bogendoerfer ha scritto: > On Thu, Mar 13, 2008 at 01:31:54AM +0100, Matteo Croce wrote: > > Il Wednesday 12 March 2008 12:16:29 Alan Cox ha scritto: > > > On Wed, 12 Mar 2008 02:30:06 +0100 > > > Matteo Croce <technoboy85@gmail.com> wrote: > > > > > > > Ugly but we need it > > > > > > Too ugly - NAK > > > > > > However please send an explanation of the problem and lets find a nicer > > > way to do it or bury it in arch code. > > > > > > > > > > This is my problem: > > > > ffi_cmdset_000: DDisabling erae-ssuspend-progrm ddue to code bokeenness. > > cmdlinparrt partition arssing not avaiabll > > RedBoo ppartition parsngg not availabl > > NET: Rgiistered protocl family 1 > > NET: Regsteered protocol ammily 10 > > IPv6 overIPPv4 tunnelingdriiver > > NET: Regsteered protocolfammily 17 > > FS:: Mounted roo (ssquashfs filessttem) readonly. > > Freeing nuused kernel meorry: 120k freed > > > > I'll try to find a nicer way to fix it > > don't use AFE mode and treat it like a normal 16550 (PORT_16550A). You > could also try to use UPIO_MEM32. That's how my console driver > (different OS) works for AR7 without the hack to wait for LSR_TEMP and > LSR_THRE. > > Thomas. > What about the .fcr field? PORT_16550A uses UART_FCR_R_TRIG_10 while AR7 uses UART_FCR_R_TRIG_00 ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2008-03-13 9:01 ` Thomas Bogendoerfer 2008-03-16 15:27 ` Matteo Croce @ 2008-03-16 15:49 ` Matteo Croce 1 sibling, 0 replies; 24+ messages in thread From: Matteo Croce @ 2008-03-16 15:49 UTC (permalink / raw) To: Thomas Bogendoerfer Cc: Alan Cox, linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton Il Thursday 13 March 2008 10:01:09 Thomas Bogendoerfer ha scritto: > On Thu, Mar 13, 2008 at 01:31:54AM +0100, Matteo Croce wrote: > > Il Wednesday 12 March 2008 12:16:29 Alan Cox ha scritto: > > > On Wed, 12 Mar 2008 02:30:06 +0100 > > > Matteo Croce <technoboy85@gmail.com> wrote: > > > > > > > Ugly but we need it > > > > > > Too ugly - NAK > > > > > > However please send an explanation of the problem and lets find a nicer > > > way to do it or bury it in arch code. > > > > > > > > > > This is my problem: > > > > ffi_cmdset_000: DDisabling erae-ssuspend-progrm ddue to code bokeenness. > > cmdlinparrt partition arssing not avaiabll > > RedBoo ppartition parsngg not availabl > > NET: Rgiistered protocl family 1 > > NET: Regsteered protocol ammily 10 > > IPv6 overIPPv4 tunnelingdriiver > > NET: Regsteered protocolfammily 17 > > FS:: Mounted roo (ssquashfs filessttem) readonly. > > Freeing nuused kernel meorry: 120k freed > > > > I'll try to find a nicer way to fix it > > don't use AFE mode and treat it like a normal 16550 (PORT_16550A). You > could also try to use UPIO_MEM32. That's how my console driver > (different OS) works for AR7 without the hack to wait for LSR_TEMP and > LSR_THRE. > > Thomas. > What do you mean by don't using AFE? Just removing UART_CAP_AFE from the .fcr field? I've tried but it doesn't work. I tried also UPIO_MEM32 instead of UPIO_MEM (with PORT_AR7) but it doesn't works ^ permalink raw reply [flat|nested] 24+ messages in thread
[parent not found: <200712271919.23577.technoboy85@gmail.com>]
* [PATCH][MIPS][5/6]: AR7: serial hack [not found] <200712271919.23577.technoboy85@gmail.com> @ 2007-12-27 18:27 ` Matteo Croce 2007-12-28 12:13 ` Sergei Shtylyov 0 siblings, 1 reply; 24+ messages in thread From: Matteo Croce @ 2007-12-27 18:27 UTC (permalink / raw) To: linux-mips Cc: Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton Signed-off-by: Matteo Croce <technoboy85@gmail.com> Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Nicolas Thill <nico@openwrt.org> diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index f94109c..94253b7 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -267,6 +267,13 @@ static const struct serial8250_config uart_config[] = { .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, .flags = UART_CAP_FIFO, }, + [PORT_AR7] = { + .name = "TI-AR7", + .fifo_size = 16, + .tx_loadsz = 16, + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00, + .flags = UART_CAP_FIFO | UART_CAP_AFE, + }, }; #if defined (CONFIG_SERIAL_8250_AU1X00) @@ -2453,7 +2460,11 @@ static void serial8250_console_putchar(struct uart_port *port, int ch) { struct uart_8250_port *up = (struct uart_8250_port *)port; +#ifdef CONFIG_AR7 + wait_for_xmitr(up, BOTH_EMPTY); +#else wait_for_xmitr(up, UART_LSR_THRE); +#endif serial_out(up, UART_TX, ch); } diff --git a/include/linux/serialP.h b/include/linux/serialP.h index e811a61..cf71de9 100644 --- a/include/linux/serialP.h +++ b/include/linux/serialP.h @@ -135,6 +135,10 @@ struct rs_multiport_struct { * the interrupt line _up_ instead of down, so if we register the IRQ * while the UART is in that state, we die in an IRQ storm. */ #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2) +#elif defined(CONFIG_AR7) +/* This is how it is set up by bootloader... */ +#define ALPHA_KLUDGE_MCR (UART_MCR_OUT2 | UART_MCR_OUT1 \ + | UART_MCR_RTS | UART_MCR_DTR) #else #define ALPHA_KLUDGE_MCR 0 #endif diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 9963f81..10af5a2 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -40,6 +40,7 @@ #define PORT_NS16550A 14 #define PORT_XSCALE 15 #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ +#define PORT_AR7 16 #define PORT_MAX_8250 16 /* max port ID */ /* ^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH][MIPS][5/6]: AR7: serial hack 2007-12-27 18:27 ` Matteo Croce @ 2007-12-28 12:13 ` Sergei Shtylyov 0 siblings, 0 replies; 24+ messages in thread From: Sergei Shtylyov @ 2007-12-28 12:13 UTC (permalink / raw) To: Matteo Croce Cc: linux-mips, Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton Matteo Croce wrote: > Signed-off-by: Matteo Croce <technoboy85@gmail.com> > Signed-off-by: Florian Fainelli <florian@openwrt.org> > Signed-off-by: Felix Fietkau <nbd@openwrt.org> > Signed-off-by: Nicolas Thill <nico@openwrt.org> > diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c > index f94109c..94253b7 100644 > --- a/drivers/serial/8250.c > +++ b/drivers/serial/8250.c [...] > @@ -2453,7 +2460,11 @@ static void serial8250_console_putchar(struct uart_port *port, int ch) > { > struct uart_8250_port *up = (struct uart_8250_port *)port; > > +#ifdef CONFIG_AR7 No board specific #ifdef's here please. You should use the driver's bug mechanism for this. > + wait_for_xmitr(up, BOTH_EMPTY); > +#else > wait_for_xmitr(up, UART_LSR_THRE); > +#endif > serial_out(up, UART_TX, ch); > } > > diff --git a/include/linux/serialP.h b/include/linux/serialP.h > index e811a61..cf71de9 100644 > --- a/include/linux/serialP.h > +++ b/include/linux/serialP.h > @@ -135,6 +135,10 @@ struct rs_multiport_struct { > * the interrupt line _up_ instead of down, so if we register the IRQ > * while the UART is in that state, we die in an IRQ storm. */ > #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2) > +#elif defined(CONFIG_AR7) > +/* This is how it is set up by bootloader... */ > +#define ALPHA_KLUDGE_MCR (UART_MCR_OUT2 | UART_MCR_OUT1 \ > + | UART_MCR_RTS | UART_MCR_DTR) I don't think you should load the driver with forced RTS and DTR. > #else > #define ALPHA_KLUDGE_MCR 0 > #endif > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h > index 9963f81..10af5a2 100644 > --- a/include/linux/serial_core.h > +++ b/include/linux/serial_core.h > @@ -40,6 +40,7 @@ > #define PORT_NS16550A 14 > #define PORT_XSCALE 15 > #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ > +#define PORT_AR7 16 Obviously, this should have been 16. :-) WBR, Sergei ^ permalink raw reply [flat|nested] 24+ messages in thread
[parent not found: <200710110248.33028.technoboy85@gmail.com>]
* [PATCH][MIPS][5/6] AR7: serial hack [not found] <200710110248.33028.technoboy85@gmail.com> @ 2007-10-11 0:59 ` Matteo Croce 0 siblings, 0 replies; 24+ messages in thread From: Matteo Croce @ 2007-10-11 0:59 UTC (permalink / raw) To: linux-mips Cc: Florian Fainelli, Felix Fietkau, Nicolas Thill, linux-serial, Andrew Morton Signed-off-by: Matteo Croce <technoboy85@gmail.com> Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Nicolas Thill <nico@openwrt.org> diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index f94109c..94253b7 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -267,6 +267,13 @@ static const struct serial8250_config uart_config[] = { .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, .flags = UART_CAP_FIFO, }, + [PORT_AR7] = { + .name = "TI-AR7", + .fifo_size = 16, + .tx_loadsz = 16, + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00, + .flags = UART_CAP_FIFO | UART_CAP_AFE, + }, }; #if defined (CONFIG_SERIAL_8250_AU1X00) @@ -2453,7 +2460,11 @@ static void serial8250_console_putchar(struct uart_port *port, int ch) { struct uart_8250_port *up = (struct uart_8250_port *)port; +#ifdef CONFIG_AR7 + wait_for_xmitr(up, BOTH_EMPTY); +#else wait_for_xmitr(up, UART_LSR_THRE); +#endif serial_out(up, UART_TX, ch); } diff --git a/include/linux/serialP.h b/include/linux/serialP.h index e811a61..cf71de9 100644 --- a/include/linux/serialP.h +++ b/include/linux/serialP.h @@ -135,6 +135,10 @@ struct rs_multiport_struct { * the interrupt line _up_ instead of down, so if we register the IRQ * while the UART is in that state, we die in an IRQ storm. */ #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2) +#elif defined(CONFIG_AR7) +/* This is how it is set up by bootloader... */ +#define ALPHA_KLUDGE_MCR (UART_MCR_OUT2 | UART_MCR_OUT1 \ + | UART_MCR_RTS | UART_MCR_DTR) #else #define ALPHA_KLUDGE_MCR 0 #endif diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 09d17b0..8ad2c3b 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -40,6 +40,7 @@ #define PORT_NS16550A 14 #define PORT_XSCALE 15 #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ +#define PORT_AR7 16 #define PORT_MAX_8250 16 /* max port ID */ /* ^ permalink raw reply related [flat|nested] 24+ messages in thread
end of thread, other threads:[~2008-03-27 21:17 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200803120221.25044.technoboy85@gmail.com>
2008-03-12 1:30 ` [PATCH][MIPS][5/6]: AR7: serial hack Matteo Croce
2008-03-12 9:31 ` Thomas Bogendoerfer
2008-03-13 0:38 ` Matteo Croce
2008-03-13 8:45 ` Thomas Bogendoerfer
2008-03-14 15:46 ` Matteo Croce
2008-03-15 10:40 ` Thomas Bogendoerfer
2008-03-16 15:45 ` Matteo Croce
2008-03-18 13:30 ` Thomas Bogendoerfer
2008-03-18 13:43 ` Sergei Shtylyov
2008-03-18 13:49 ` Sergei Shtylyov
2008-03-18 14:01 ` Alan Cox
2008-03-18 15:28 ` Thomas Bogendoerfer
2008-03-21 1:55 ` Thomas Bogendoerfer
2008-03-27 21:14 ` Matteo Croce
2008-03-27 21:17 ` Matteo Croce
2008-03-15 11:38 ` Alan Cox
2008-03-12 11:16 ` Alan Cox
2008-03-13 0:31 ` Matteo Croce
2008-03-13 9:01 ` Thomas Bogendoerfer
2008-03-16 15:27 ` Matteo Croce
2008-03-16 15:49 ` Matteo Croce
[not found] <200712271919.23577.technoboy85@gmail.com>
2007-12-27 18:27 ` Matteo Croce
2007-12-28 12:13 ` Sergei Shtylyov
[not found] <200710110248.33028.technoboy85@gmail.com>
2007-10-11 0:59 ` [PATCH][MIPS][5/6] " Matteo Croce
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).