linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Hans Schillstrom <hans.schillstrom@pwav.com>
To: "Povolotsky, Alexander" <Alexander.Povolotsky@marconi.com>
Cc: "'linuxppc-embedded@ozlabs.org'" <linuxppc-embedded@ozlabs.org>
Subject: Re: Linux 2.6-10.rc3  8xx: debugging (over-writing)  content of bd_in fo structure  in the kernel booting code
Date: Tue, 18 Jan 2005 13:20:10 +0100	[thread overview]
Message-ID: <1106050810.7900.311.camel@hawk.allgon.net> (raw)
In-Reply-To: <313680C9A886D511A06000204840E1CF0A6474FB@whq-msgusr-02.pit.comms.marconi.com>

Hi Alex,
On Tue, 2005-01-18 at 12:45, Povolotsky, Alexander wrote:
> 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
> cpm_uart_console_setup()
> ( 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 ?

Have a look into ppc/8xx_io/commproc.c
There you have the baudrate dependency - "bi_intfreq"

#define BRG_INT_CLK		(((bd_t *)__res)->bi_intfreq)
#define BRG_UART_CLK		(BRG_INT_CLK/16)
#define BRG_UART_CLK_DIV16	(BRG_UART_CLK/16)

void
cpm_setbrg(uint brg, uint rate)
{
 ...

/Hans

> 
> Thanks,
> Alex
> ****************************************************************
> 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
> *)&cpm_uart_ports[cpm_uart_port_map[co->index]];
>         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;
>                 else
>                         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)
>                 pinfo->set_lineif(pinfo);
> 
>         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;
> 
>         cpm_uart_initbd(pinfo);
> 
>         if (IS_SMC(pinfo))
>                 cpm_uart_init_smc(pinfo);
>         else
>                 cpm_uart_init_scc(pinfo);
> 
>         uart_set_options(port, co, baud, parity, bits, flow);
> 
>         return 0;
> }
> 

  reply	other threads:[~2005-01-18 12:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-18 11:45 Linux 2.6-10.rc3 8xx: debugging (over-writing) content of bd_in fo structure in the kernel booting code Povolotsky, Alexander
2005-01-18 12:20 ` Hans Schillstrom [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-01-18 15:01 Linux 2.6-10.rc3 8xx: debugging (over-writing) content of b d_in " Povolotsky, Alexander
2005-01-18 15:23 ` Linux 2.6-10.rc3 8xx: debugging (over-writing) content of bd_in " Mark Chambers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1106050810.7900.311.camel@hawk.allgon.net \
    --to=hans.schillstrom@pwav.com \
    --cc=Alexander.Povolotsky@marconi.com \
    --cc=linuxppc-embedded@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).