Linux 2.6-10.rc3 8xx: debugging (over-writing) content of bd_in fo structure in the kernel booting code

Povolotsky, Alexander Alexander.Povolotsky at
Tue Jan 18 22:45:14 EST 2005

I am now suspecting that the content of my bd_info structure is set or is
handled incorrectly,
thus causing incorrect behavior of the serial driver upon kernel booting
(only 3 characters are printed correctly and the rest is the garbage - as I
reported before), 
so I am trying (for debugging purposes) to over-write the values, passed
from bd_info
during the kernel booting, by the hard-coded "correct" values.

So far I tried forcing baud, bits, parity, flow directly in in
( drivers/serial/cpm_uart/cpm_uar t_core.c ) - see below - it didn't help

Where in the kernel booting code the clock speed is handled (it also comes
from the bd_info)
 - so I could try to force set clock speed there ?

static int __init cpm_uart_console_setup(struct console *co, char *options)
        struct uart_port *port;
        struct uart_cpm_port *pinfo;
        int baud = 38400;
        int bits = 8;
        int parity = 'n';
        int flow = 'n';
        int ret;

        port =
            (struct uart_port
        pinfo = (struct uart_cpm_port *)port;

        pinfo->flags |= FLAG_CONSOLE;

        if (options) {
                uart_parse_options(options, &baud, &parity, &bits, &flow);
        } else {
                bd_t *bd = (bd_t *) __res;

                if (bd->bi_baudrate)
                        baud = bd->bi_baudrate;
                        baud = 9600;
        baud = 38400;
        parity = 'n';
        flow = 'n';
        bits = 8;
         * Setup any port IO, connect any baud rate generators,
         * etc.  This is expected to be handled by board
         * dependant code
        if (pinfo->set_lineif)

        if (IS_SMC(pinfo)) {
                pinfo->smcp->smc_smcm &= ~(SMCM_RX | SMCM_TX);
                pinfo->smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
        } else {
                pinfo->sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX);
                pinfo->sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);

        ret = cpm_uart_allocbuf(pinfo, 1);

        if (ret)
                return ret;


        if (IS_SMC(pinfo))

        uart_set_options(port, co, baud, parity, bits, flow);

        return 0;

More information about the Linuxppc-embedded mailing list