Topic: Application UART
By finding the schematic http://files.chumby.com/hackerboard/falconwing_chb3.pdf for the v1 hacker board I finally found the pins the RX and TX pins are connected to. So the next step was to try make and make it work. Off course I can't get it to work I'm not really a die hard kernel guru, so most of my changes are just by looking at the code and changing what looks right to me
My steps so far:
Downloaded the kernel and found the part where the appuart is configured. A little digging let me to /linux-2.6.28.mx233/arch/arm/mach-stmp3xxx/stmp378x.c
Changed the appuart_pins_1 to the following:
struct pin_desc appuart_pins_1[] = {
{ PINID_GPMI_D14, PIN_FUN2, PIN_4MA, PIN_1_8V, 0, },
{ PINID_GPMI_D15, PIN_FUN2, PIN_4MA, PIN_1_8V, 0, },
};
Can I just leave out the CTR and RTS pins?
and changed appuart_pins to:
struct pin_group appuart_pins[] = {
[0] = {
.pins = appuart_pins_1,
.nr_pins = ARRAY_SIZE(appuart_pins_1),
},
};
Removed appuart_pins_0 because they look like AUART1 and I want to use AUART2.
In /linux-2.6.28.mx233/arch/arm/mach-stmp3xxx/stmp378x_devb.c I uncommented the following:
static struct platform_device *devices[] = {
*snip*
&stmp3xxx_appuart,
*snip*
So it compiles, and update my chumby, run "modprobe stmp-app" and I see the following line in dmesg:
[ 154.530000] stmp37xx-appuart.0: ttySP0 at MMIO 0xf006c000 (irq = 24) is a stmp37xx-appuart.0
Success? I hooked up a "Oscilloscope" (an Arduino running a analogread and GUI showing a graph) and send some data to the device:
while [ 1 ]; do echo -n "U" > /dev/ttySP0; done
No luck So after some head scratching I check the Mux setting for the GPIO14&15 pins:
chumby-:/ # regutil -r HW_PINCTRL_MUXSEL0
Value at 0x80018100: 0xffffffff
Hmm thats wrong, should be 0x5fffffff right? So I change it:
regutil -w HW_PINCTRL_MUXSEL0_CLR=0xa0000000
Setting 0x80018108: 0x5fffffff -> 0x5fffffff ok
And still no luck. And that is where I am now Anybody any insights? Maybe the chumby ppl already have a fixed kernel? (x-ing fingers) I'm probably doing it completely wrong