Re: qi: use \r\n in serial console?

2011-06-24 Thread Harald Koenig
On Jun 24, Timo Juhani Lindfors wrote:

 so clearly Qi and Linux are sending different line endings.
 
 Can somebody else with a debug board confirm?

in your linux console, run stty -a and in this output look for onlcr or 
-onlcr !

for my (non-openmoko) linux this gives

stty -a | grep onlcr
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 
vt0 ff0
^

where the man page explains

   * [-]onlcr
  translate newline to carriage return-newline


that's why a single \n results on \r\n on a real terminal, this is 
standard unix termial behaviour for the last decades.
and it's standard unix that you can change this settings -- just try

stty -onlcr


so yes, \r\n *is* the correct output at the more physical layer...


have fun,

Harald
-- 
I hope to die  ___   _
before I *have* to use Microsoft Word.,   0--,|/OOO\
Donald E. Knuth, 02-Oct-2001 in Tuebingen._/  /  /OOO\
\  \/OOO\
  \ O|//
   \/\/\/\/\/\/\/\/\/
Harald Koenig   //  / \\  \
koe...@tat.physik.uni-tuebingen.de ^   ^

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: qi: use \r\n in serial console?

2011-06-24 Thread Timo Juhani Lindfors
Harald Koenig koe...@tat.physik.uni-tuebingen.de writes:
* [-]onlcr
   translate newline to carriage return-newline

Yep.


 that's why a single \n results on \r\n on a real terminal,

Indeed.

 so yes, \r\n *is* the correct output at the more physical layer...

So, does the Qi patch look sane?


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


qi: use \r\n in serial console?

2011-06-23 Thread Timo Juhani Lindfors
Hi,

if I use picocom -b 115200 /dev/ttyUSB0 to see the boot messages of Qi
and kernel I see that the Qi lines are terminated with \n while Linux
uses \r\n [1].

Are you using something else than picocom or avoiding the problem in
some other way? If not, should it be fairly safe to add

diff --git a/src/cpu/s3c2442/gta02.c b/src/cpu/s3c2442/gta02.c
index 13be2ac..6dc1208 100644
--- a/src/cpu/s3c2442/gta02.c
+++ b/src/cpu/s3c2442/gta02.c
@@ -458,6 +458,8 @@ const struct board_variant const *
get_board_variant_gta02(void)
 
 static __attribute__ (( section (.steppingstone) )) void
 putc_gta02(char c)
 {
+   if (c == '\n')
+   serial_putc_s3c24xx(GTA02_DEBUG_UART, '\r');
serial_putc_s3c24xx(GTA02_DEBUG_UART, c);
 }

or is there some trouble to be expected?

best regards,
Timo Lindfors


[1] Example output:




Qi Bootloader s3c2442  wallwart debian_20100105-1~unrelease0 

 2011-06-06T08:29:17+  Copyright (C) 2008 Openmoko, 
Inc.



 Detected: Freerunner / GTA02, A6 PCB


 Battery condition reasonable

Trying kernel: SD Card EXT2 P1 Kernel
 Card Type: SD 
2.0 SDHC / Mfr: 0x02, OEM TM / SA08G, rev 0.6 / s/n: 576236754 / date: 
12/2010


SDHC size: 7592 MiB


   Partition: 1 start +52 512-byte blocks, size 16 MiB
 EXT2 open: boot/noboot-GTA02 Open failed
 
EXT2 open: boot/append-GTA02 OK

EXT2 open: boot/uImage-GTA02.bin OK

   
Found: 3f4c7e4fa3d937a8


 Size: 1726 KiB


   EXT2 open: boot/uImage-GTA02.bin 
OK
  ** skipping 
   Read failed
  bad magic 66346537


Trying kernel: SD Card EXT2 P2 Kernel

 Partition: 2 start +33072 512-byte blocks, 
size 3867 MiB


 EXT2 open: boot/noboot-GTA02 Open failed
EXT2 open: boot/append-GTA02 OK
   EXT2 open: boot/uImage-GTA02.bin 
OK

  Found: Debian FreeRunner Kernel

Size: 2148 KiB

  EXT2 
open: boot/uImage-GTA02.bin OK


   Cmdline: loglevel=4 console=tty0 
console=ttySAC2,115200 init=/sbin/init ro  
mtdparts=physmap-flash:-(nor);neo1973-nand:0x0004(qi),0x0004(depr-ub-env),0x0080(kernel),0x000a(depr),0x0004(identity-ext2),0x0f6a(rootfs)
  g_ether.dev_addr=00:1F:11:01:62:8A g_ether.host_addr=00:1F:11:01:62:8B  
root=/dev/mmcblk0p2 rootdelay=1 rootdelay=1  c8008080, irq 35
[

Re: qi: use \r\n in serial console?

2011-06-23 Thread Fox Mulder
Am 23.06.2011 14:15, schrieb Timo Juhani Lindfors:
 Hi,
 
 if I use picocom -b 115200 /dev/ttyUSB0 to see the boot messages of Qi
 and kernel I see that the Qi lines are terminated with \n while Linux
 uses \r\n [1].
I don't know picocom but Linux normally uses \n while windows uses \r\n.
So if qi only use \n it is corrrect for linux.

Ciao,
 Rainer

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community