Hello,
I have some solution, but i had no time for post... sorry:
Regarding the #1, UART redirection i finally have done by modifying the file 'mcf.c'.
Basically is need to 'force' to use the UART2 when the system is starting up:
First is need to configure the GPIO pins for this UART, because on this uP UART2 is not the default
function; I have done like this:
static void mcf_config_port(struct uart_port *port, int flags)
{
port->type = PORT_MCF;
printk("MK36->mcf_config_port( line= %d )\n", port->line );
if( port->line == 2 )
{
MCF_GPIO_PAR_TIMER = ( 0 | MCF_GPIO_PAR_TIMER_PAR_TIN2(1) | MCF_GPIO_PAR_TIMER_PAR_TIN3(1) );
MCF_GPIO_PDDR_UART = ( 0 | MCF_GPIO_PDDR_UART_PDDR_UART6 );
}
/* Clear mask, so no surprise interrupts. */
writeb(0, port->membase + MCFUART_UIMR);
if (request_irq(port->irq, mcf_interrupt, IRQF_DISABLED, "UART", port))
printk(KERN_ERR "MCF: unable to attach ColdFire UART %d "
"interrupt vector=%d\n", port->line, port->irq);
}
Then force the UART channel:
static int __init mcf_console_setup(struct console *co, char *options)
{
struct uart_port *port;
int baud = CONFIG_SERIAL_MCF_BAUDRATE;
int bits = 8;
int parity = 'n';
int flow = 'n';
if ((co->index >= 0) && (co->index <= MCF_MAXPORTS))
co->index = 0;
co->index = 2;
port = &mcf_ports[co->index].port;
if (port->membase == 0)
return -ENODEV;
printk("mcf_console_setup( port= %d )\n", co->index ); //To see it on startup...
if (options)
uart_parse_options(options, &baud, &parity, &bits, &flow);
return uart_set_options(port, co, baud, parity, bits, flow);
}
Also check on 'linux/arch/m68knommu/platform/537x/config.c' the interrupts are properly set for UART2.
I think that's all, but note that this is working on "ltib-cf_nommu-20081215" not on "ltib-m537xevb-20071109". The new release is set by default to use "mcf.c" driver, while the previous one is set by default to "mfcserial.c".
Regarding the #2:
There is no posible combination ( i have not found ) to do this by setting the startup order.
Because a strange problem i have on the current distribution ( see http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&message.id=6925#M6925 ) i have found a good way to setup the board without scripts; put it on inittab !!!
This is my inittab file:
console::sysinit:/bin/mount -n -t proc proc /proc
console::sysinit:/bin/mount -n -t sysfs sys /sys
console::sysinit:/sbin/ifconfig eth0 xxx.xxx.xxx.xxx
console::sysinit:/bin/mount -a
::respawn:-/bin/sh
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/rc.d/rcS stop
::restart:/sbin/init
Also note that mount -a Is using 'fstab' config where i can mount a network unit via CIFS, very useful on a board without samba or ftp server support!!! ( hey yaffs2* on a 2k block NAND!!! )
fstab lines:
//xxx.xxx.xxx.xxx/PROGRAMS /debug cifs rw,username=xxxx,password=xxxx 0 0
/dev/mtdblock1 /newdir/nand1 yaffs defaults 0 0
/dev/mtdblock2 /newdir/nand2 yaffs defaults 0 0
yaffs2*: Is need to patch 'yaffs_ObjectHeader' struct on 'ysffs_guts.h' by adding a dummy WORD:
typedef struct {
...
/* isShrink applies to object headers written when we shrink the file (ie resize) */
__u32 isShrink;
__u16 dummy; <------ DUMMY WORD!!!
} yaffs_ObjectHeader;
I have found it on a forum but don't remember where....
Regarding the #3:
Really is no need to use libusb at all. But note that on 'ltib-m537xevb-20071109' USB system simply does not work.
I suggest to upgrade to "ltib-cf_nommu-20081215" ,under this distribution USB is working fine
( well.. i only have tested with some USB mouse, and some flash pen ).
BUT:
ltib-cf_nommu-20081215, under some unknown conditions, CAN NOT EXECUTE SCRIPTS???????
I already have posted this question at:
http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&message.id=6925#M6925.
I hope this can help some one!
BR;
Oscar Sanz.