* UART misbehaves under Linkstation/KuroBoxHG @ 2007-08-08 14:09 Oncaphillis 2007-08-08 20:30 ` Guennadi Liakhovetski 0 siblings, 1 reply; 9+ messages in thread From: Oncaphillis @ 2007-08-08 14:09 UTC (permalink / raw) To: linux-kernel Greetings, I'm trying to compile a 2.6.2x kernel on a Linkstation/KuroBox HG/ppc following instructions given under http://www.kurobox.com/mwiki/index.php/Kurobox_support_in_stock_2.6_kernels and get weired settings and errors from the serial device (UART 16550A). Under the 2.4.17 kernel provided by the Kurobox manufacturer it gets IRQS in the range of 137/138 under 2.6.22 for the linkstation it gets IRQS 17/18 and the serial device behaves fishy communication errors "to much work in IRQ 16" stty -F /dev/ttyS0 sometimes tells me "unable to perform all requested operations" setserial tells me the port for /dev/ttyS0 is 0x000 (?) while cat /proc/tty/driver/serial reports the proper mmio 0x80004500 This holds true for 2.6.20 and 2.6.22.1 Any suggestions ? Thanks for listening. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: UART misbehaves under Linkstation/KuroBoxHG 2007-08-08 14:09 UART misbehaves under Linkstation/KuroBoxHG Oncaphillis @ 2007-08-08 20:30 ` Guennadi Liakhovetski 2007-08-08 21:13 ` Oncaphillis 0 siblings, 1 reply; 9+ messages in thread From: Guennadi Liakhovetski @ 2007-08-08 20:30 UTC (permalink / raw) To: Oncaphillis; +Cc: linux-kernel On Wed, 8 Aug 2007, Oncaphillis wrote: > Greetings, > > I'm trying to compile a 2.6.2x kernel on a Linkstation/KuroBox HG/ppc > following instructions given under > http://www.kurobox.com/mwiki/index.php/Kurobox_support_in_stock_2.6_kernels Wow, congratulations! Not too many endevour into this land, and even fewer succeed:-) You'd probably be better off asking this on linuxppc-dev, but anyway... > and get weired settings and errors from the serial device (UART 16550A). > > Under the 2.4.17 kernel provided by the Kurobox manufacturer it gets IRQS in > the range of 137/138 under 2.6.22 for the linkstation it gets IRQS 17/18 and > the serial device behaves fishy That interrupt numbers are different as under 2.4 is correct, however, I get 16 and 17 for ttyS0 and ttyS1 on a kuroboxHG, are you sure you're getting 17 and 18? > communication errors > > "to much work in IRQ 16" And here you get IRQ 16, which indeed should be ttyS0. And ttyS0 is connected to the power-management microcontroller (AVR). Wait, what userspace are you running? Have you swapped ttyS0 and ttyS1 everywhere? in /etc/inittab for example? Besides, if you are running any vendor provided (or community) tools to handle the AVR - they use ttyS1 by default, as it was under 2.4 ans under "traditional" 2.6, whereas the 2.6 mainline kernel for kurobox/linkstation uses the traditional for these CPUs port numbering. I think this is your problem. Some user-space programme(s) are accessing wrong tty. Thanks Guennadi --- Guennadi Liakhovetski ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: UART misbehaves under Linkstation/KuroBoxHG 2007-08-08 20:30 ` Guennadi Liakhovetski @ 2007-08-08 21:13 ` Oncaphillis 2007-08-08 21:40 ` Guennadi Liakhovetski 0 siblings, 1 reply; 9+ messages in thread From: Oncaphillis @ 2007-08-08 21:13 UTC (permalink / raw) To: Guennadi Liakhovetski; +Cc: linux-kernel Guennadi Liakhovetski wrote: > On Wed, 8 Aug 2007, Oncaphillis wrote: > >> Greetings, >> >> I'm trying to compile a 2.6.2x kernel on a Linkstation/KuroBox HG/ppc >> following instructions given under >> http://www.kurobox.com/mwiki/index.php/Kurobox_support_in_stock_2.6_kernels > > Wow, congratulations! Not too many endevour into this land, and even fewer > succeed:-) You'd probably be better off asking this on linuxppc-dev, but > anyway... > Thank you very much indeed. I'm kind of proud too that I dared to enter this dark realm without bricking the system (at least up until now). And thanks for the tip. I'll give it a try. >> and get weired settings and errors from the serial device (UART 16550A). >> >> Under the 2.4.17 kernel provided by the Kurobox manufacturer it gets IRQS in >> the range of 137/138 under 2.6.22 for the linkstation it gets IRQS 17/18 and >> the serial device behaves fishy > > That interrupt numbers are different as under 2.4 is correct, however, I > get 16 and 17 for ttyS0 and ttyS1 on a kuroboxHG, are you sure you're > getting 17 and 18? > Absolutely right (bad bad typo, have to control my trembling fingers) It's 16/17. So that's ok ? No misconfiguration ? And that setserial tells me the port is 0x000 ? I thought the dts file which comes with the linkstation kernel describes the ports and IRQs but poking there didn't change anything. It seems like the kernel is ignoring the serial settings in the dts-file (which I do not realy understand) all together. >> communication errors >> >> "to much work in IRQ 16" > > And here you get IRQ 16, which indeed should be ttyS0. And ttyS0 is > connected to the power-management microcontroller (AVR). Wait, what > userspace are you running? Have you swapped ttyS0 and ttyS1 everywhere? in > /etc/inittab for example? Besides, if you are running any vendor provided > (or community) tools to handle the AVR - they use ttyS1 by default, as it > was under 2.4 ans under "traditional" 2.6, whereas the 2.6 mainline kernel > for kurobox/linkstation uses the traditional for these CPUs port > numbering. I think this is your problem. Some user-space programme(s) are > accessing wrong tty. I started with a debian distro http://www.kurobox.com/mwiki/index.php/Debian_sylver Hmm I tried my very best to eliminate this everywhere. Actually I resurrected the ARV00 device by creating a soft link to a ttySx with during bootup within the udev filesystem. <snip> if [ ! -e /dev/AVR00 ];then cat /proc/tty/driver/serial | grep 80004500 | grep -q 0: && AVR=/dev/ttyS0 || AVR=/dev/ttyS1 echo "Making AVR00 link to "$AVR; ln -s $AVR /dev/AVR00 fi; </snip> Stole the trick from the avr_evtd startup script... Thanks a 10^6 for the tips... Oncaphillis > > Thanks > Guennadi > --- > Guennadi Liakhovetski > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: UART misbehaves under Linkstation/KuroBoxHG 2007-08-08 21:13 ` Oncaphillis @ 2007-08-08 21:40 ` Guennadi Liakhovetski 2007-08-08 22:04 ` Oncaphillis 0 siblings, 1 reply; 9+ messages in thread From: Guennadi Liakhovetski @ 2007-08-08 21:40 UTC (permalink / raw) To: Oncaphillis; +Cc: linux-kernel On Wed, 8 Aug 2007, Oncaphillis wrote: > So that's ok ? No misconfiguration ? And that setserial tells > me the port is 0x000 ? Yes, everything looks ok, don't know why, setserial reports 0 here too, but it doesn't cause me any (visible) problems. > I thought the dts file which > comes with the linkstation kernel describes the ports and IRQs > but poking there didn't change anything. It seems like the kernel > is ignoring the serial settings in the dts-file (which I do not > realy understand) all together. Believe me, it doesn't ignore them:-) Don't know what exactly you were poking at there, but it should be quite easy to break it by changing clocks / address / irq... > I started with a debian distro > http://www.kurobox.com/mwiki/index.php/Debian_sylver > > Hmm I tried my very best to eliminate this everywhere. Actually I > resurrected the ARV00 device by creating a soft link to a ttySx > with during bootup within the udev filesystem. > > <snip> > if [ ! -e /dev/AVR00 ];then > cat /proc/tty/driver/serial | grep 80004500 | grep -q 0: > && AVR=/dev/ttyS0 || AVR=/dev/ttyS1 > echo "Making AVR00 link to "$AVR; > ln -s $AVR /dev/AVR00 > fi; > </snip> > > Stole the trick from the avr_evtd startup script... Well, just do "ls -l /dev/AVR00", then "lsof /dev/ttyS0". In principle, as mentioned elsewhere before, you don't need any daemons on linkstation/kurobox now for "basic" operation, i.e., the kernel disables the watchdog on startup, and properly sends reboot and power-off commands to the AVR itself without any userspace support. So, at least for a test, you could stop all those daemons. You need them though if you want to use the buttons to power down / reboot / whatever, do other fancy things with the AVR... Another possible reason why, for example, your stty misbehaves, maybe it is somehow broken in that distro? I am just using etch and things work pretty well. Thanks Guennadi --- Guennadi Liakhovetski ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: UART misbehaves under Linkstation/KuroBoxHG 2007-08-08 21:40 ` Guennadi Liakhovetski @ 2007-08-08 22:04 ` Oncaphillis 2007-08-08 22:47 ` Guennadi Liakhovetski 0 siblings, 1 reply; 9+ messages in thread From: Oncaphillis @ 2007-08-08 22:04 UTC (permalink / raw) To: Guennadi Liakhovetski; +Cc: linux-kernel Guennadi Liakhovetski wrote: > On Wed, 8 Aug 2007, Oncaphillis wrote: > >> So that's ok ? No misconfiguration ? And that setserial tells >> me the port is 0x000 ? > > Yes, everything looks ok, don't know why, setserial reports 0 here too, > but it doesn't cause me any (visible) problems. > >> I thought the dts file which >> comes with the linkstation kernel describes the ports and IRQs >> but poking there didn't change anything. It seems like the kernel >> is ignoring the serial settings in the dts-file (which I do not >> realy understand) all together. > > Believe me, it doesn't ignore them:-) Don't know what exactly you were > poking at there, but it should be quite easy to break it by changing > clocks / address / irq... > >> I started with a debian distro >> http://www.kurobox.com/mwiki/index.php/Debian_sylver >> >> Hmm I tried my very best to eliminate this everywhere. Actually I >> resurrected the ARV00 device by creating a soft link to a ttySx >> with during bootup within the udev filesystem. >> >> <snip> >> if [ ! -e /dev/AVR00 ];then >> cat /proc/tty/driver/serial | grep 80004500 | grep -q 0: >> && AVR=/dev/ttyS0 || AVR=/dev/ttyS1 >> echo "Making AVR00 link to "$AVR; >> ln -s $AVR /dev/AVR00 >> fi; >> </snip> >> >> Stole the trick from the avr_evtd startup script... > > Well, just do "ls -l /dev/AVR00", then "lsof /dev/ttyS0". > Oh.... that's something I should have thought about (shaking my head) I hope I found the the misconfigured part. I didn't look at /etc/inittab. It opens a getty on /dev/ttyS0. That might do the trick. Have to recompile my kernel right now with standard config to check this out. > In principle, as mentioned elsewhere before, you don't need any daemons on > linkstation/kurobox now for "basic" operation, i.e., the kernel disables > the watchdog on startup, and properly sends reboot and power-off commands > to the AVR itself without any userspace support. So, at least for a test, > you could stop all those daemons. You need them though if you want to use > the buttons to power down / reboot / whatever, do other fancy things with > the AVR... Well ... it doesn't seem to need the daemons but at least the kuro_boot script or something similar has to be executed once sending the right init strings to the AVR or your system reboots after a few minutes at least on my box. > Another possible reason why, for example, your stty misbehaves, maybe it > is somehow broken in that distro? I am just using etch and things work > pretty well. > > Thanks > Guennadi > --- > Guennadi Liakhovetski ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: UART misbehaves under Linkstation/KuroBoxHG 2007-08-08 22:04 ` Oncaphillis @ 2007-08-08 22:47 ` Guennadi Liakhovetski 2007-08-08 22:54 ` Oncaphillis 2007-08-09 0:04 ` Oncaphillis 0 siblings, 2 replies; 9+ messages in thread From: Guennadi Liakhovetski @ 2007-08-08 22:47 UTC (permalink / raw) To: Oncaphillis; +Cc: linux-kernel On Thu, 9 Aug 2007, Oncaphillis wrote: > > I hope I found the the misconfigured part. I didn't look > at /etc/inittab. It opens a getty on /dev/ttyS0. That > might do the trick. Have to recompile my kernel right now with > standard config to check this out. Hm, for that you don't have to recompile the kernel... unless you modified it before, of course. Just change your inittab and reboot. > Well ... it doesn't seem to need the daemons but at least > the kuro_boot script or something similar has to be executed > once sending the right init strings to the AVR or your system > reboots after a few minutes at least on my box. No, shouldn't be needed either. You should get a string in dmesg like "linkstation: disarming the AVR watchdog:", and the watchdog should be off. Just take the original .dts, unmodified kernel sources and close enough to original (arch/powerpc/configs/linkstation_defconfig) .config and it should work. Thanks Guennadi --- Guennadi Liakhovetski ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: UART misbehaves under Linkstation/KuroBoxHG 2007-08-08 22:47 ` Guennadi Liakhovetski @ 2007-08-08 22:54 ` Oncaphillis 2007-08-09 0:04 ` Oncaphillis 1 sibling, 0 replies; 9+ messages in thread From: Oncaphillis @ 2007-08-08 22:54 UTC (permalink / raw) To: Guennadi Liakhovetski; +Cc: linux-kernel Guennadi Liakhovetski wrote: > On Thu, 9 Aug 2007, Oncaphillis wrote: >> I hope I found the the misconfigured part. I didn't look >> at /etc/inittab. It opens a getty on /dev/ttyS0. That >> might do the trick. Have to recompile my kernel right now with >> standard config to check this out. > > Hm, for that you don't have to recompile the kernel... unless you modified > it before, of course. Just change your inittab and reboot. Oh I know... I just played around with the kernel config to solve the problem and ended up with a kernel that didn't boot at all.. > >> Well ... it doesn't seem to need the daemons but at least >> the kuro_boot script or something similar has to be executed >> once sending the right init strings to the AVR or your system >> reboots after a few minutes at least on my box. > > No, shouldn't be needed either. You should get a string in dmesg like > "linkstation: disarming the AVR watchdog:", and the watchdog should be > off. Just take the original .dts, unmodified kernel sources and close > enough to original (arch/powerpc/configs/linkstation_defconfig) .config > and it should work. > Thanks again... > Thanks > Guennadi > --- > Guennadi Liakhovetski > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: UART misbehaves under Linkstation/KuroBoxHG 2007-08-08 22:47 ` Guennadi Liakhovetski 2007-08-08 22:54 ` Oncaphillis @ 2007-08-09 0:04 ` Oncaphillis 2007-08-09 6:09 ` Guennadi Liakhovetski 1 sibling, 1 reply; 9+ messages in thread From: Oncaphillis @ 2007-08-09 0:04 UTC (permalink / raw) To: Guennadi Liakhovetski; +Cc: linux-kernel Removing the getty from initd did the trick. And you're right AVR is disabled by the kernel found the code in ./arch/powerpc/platforms/embedded6xx/ls_uart.c Tkank you Guennadi Liakhovetski wrote: > On Thu, 9 Aug 2007, Oncaphillis wrote: >> I hope I found the the misconfigured part. I didn't look >> at /etc/inittab. It opens a getty on /dev/ttyS0. That >> might do the trick. Have to recompile my kernel right now with >> standard config to check this out. > > Hm, for that you don't have to recompile the kernel... unless you modified > it before, of course. Just change your inittab and reboot. > >> Well ... it doesn't seem to need the daemons but at least >> the kuro_boot script or something similar has to be executed >> once sending the right init strings to the AVR or your system >> reboots after a few minutes at least on my box. > > No, shouldn't be needed either. You should get a string in dmesg like > "linkstation: disarming the AVR watchdog:", and the watchdog should be > off. Just take the original .dts, unmodified kernel sources and close > enough to original (arch/powerpc/configs/linkstation_defconfig) .config > and it should work. > > Thanks > Guennadi > --- > Guennadi Liakhovetski > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: UART misbehaves under Linkstation/KuroBoxHG 2007-08-09 0:04 ` Oncaphillis @ 2007-08-09 6:09 ` Guennadi Liakhovetski 0 siblings, 0 replies; 9+ messages in thread From: Guennadi Liakhovetski @ 2007-08-09 6:09 UTC (permalink / raw) To: Oncaphillis; +Cc: linux-kernel On Thu, 9 Aug 2007, Oncaphillis wrote: > Removing the getty from initd did the trick. > > And you're right AVR is disabled by the kernel > found the code in ./arch/powerpc/platforms/embedded6xx/ls_uart.c Good. For the future, with any (kernel / userspace / software / hardware / weather / ...) linkstation/kurobox related questions you are welcome to use LinkStation_General@yahoogroups.com or the #linkstationwiki channel on irc.freenode.net, or the forums on the http://linkstationwiki.net/. Good luck Guennadi --- Guennadi Liakhovetski ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-08-09 6:10 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-08-08 14:09 UART misbehaves under Linkstation/KuroBoxHG Oncaphillis 2007-08-08 20:30 ` Guennadi Liakhovetski 2007-08-08 21:13 ` Oncaphillis 2007-08-08 21:40 ` Guennadi Liakhovetski 2007-08-08 22:04 ` Oncaphillis 2007-08-08 22:47 ` Guennadi Liakhovetski 2007-08-08 22:54 ` Oncaphillis 2007-08-09 0:04 ` Oncaphillis 2007-08-09 6:09 ` Guennadi Liakhovetski
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox