public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
* RE: Linux 2.6-10.rc3  8xx: debugging (over-writing)  content of b d_in fo structure  in the kernel booting code
@ 2005-01-18 15:01 Povolotsky, Alexander
  0 siblings, 0 replies; 6+ messages in thread
From: Povolotsky, Alexander @ 2005-01-18 15:01 UTC (permalink / raw)
  To: 'linuxppc-embedded@ozlabs•org'

Hi,

my "custom" bd_info structure (passed from my custom bootloader) looks as
following:

typedef struct bd_info {
        unsigned long   bi_memstart;    /* start of DRAM memory */
        unsigned long   bi_memsize;     /* size  of DRAM memory in bytes */
        unsigned long   bi_flashstart;  /* start of FLASH memory */
        unsigned long   bi_flashsize;   /* size  of FLASH memory */
        unsigned long   bi_flashoffset; /* reserved area for startup monitor
*/
        unsigned long   bi_sramstart;   /* start of SRAM memory */
        unsigned long   bi_sramsize;    /* size  of SRAM memory */
        unsigned long   bi_immr_base;   /* base of IMMR register */
        unsigned long   bi_bootflags;   /* boot / reboot flag (for LynxOS)
*/
        unsigned long   bi_ip_addr;     /* IP Address */
        unsigned char   bi_enetaddr[6]; /* Ethernet adress */
        unsigned short  bi_ethspeed;    /* Ethernet speed in Mbps */
        unsigned long   bi_intfreq;     /* Internal Freq, in MHz */
        unsigned long   bi_busfreq;     /* Bus Freq, in MHz */
        unsigned long   bi_baudrate;    /* Console Baudrate */
        unsigned char   bi_run_bank;    /* Running Bank */

} bd_t;

My embed_config(bd_t **bdp) function (in
arch/ppc/boot/simple/embed_config.c)
does the following (using above structure) :

 bd->bi_baudrate = 38400; /* changed from 115200 for debug - Alex */
 bd->bi_memstart = 0;
 bd->bi_memsize = (32 * 1024 * 1024);
 bd->bi_intfreq = 50000000;
 bd->bi_busfreq = 50000000;

Then we have, as Hans noted to me, the cpm_setbrg() function
 (in arch/ppc/8xx_io/commproc.c):

/* Set a baud rate generator.  This needs lots of work.  There are
 * four BRGs, any of which can be wired to any channel.
 * The internal baud rate clock is the system clock divided by 16.
 * This assumes the baudrate is 16x oversampled by the uart.
 */
#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)
{
        volatile uint   *bp;

        /* This is good enough to get SMCs running.....
        */
        bp = (uint *)&cpmp->cp_brgc1;
        bp += brg;
        /* The BRG has a 12-bit counter.  For really slow baud rates (or
         * really fast processors), we may have to further divide by 16.
         */
        if (((BRG_UART_CLK / rate) - 1) < 4096)
                *bp = (((BRG_UART_CLK / rate) - 1) << 1) | CPM_BRG_EN;
        else
                *bp = (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) |
                                                CPM_BRG_EN | CPM_BRG_DIV16;
}

So what could go wrong here in terms of setting the baudrate for the serial
uart 
(which "presumably" causes printing 3 good characters and then garbage
during kernel booting) ?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Linux 2.6-10.rc3  8xx: debugging (over-writing)  content of b d_in fo structure  in the kernel booting code
@ 2005-01-18 15:24 Povolotsky, Alexander
  0 siblings, 0 replies; 6+ messages in thread
From: Povolotsky, Alexander @ 2005-01-18 15:24 UTC (permalink / raw)
  To: 'Mark Chambers'; +Cc: linuxppc-embedded

Sorry - no hardware instruments, support (and skills ;-) ) here ...
anything else to try software-wise (no JTAG debugging is available either) ?

-----Original Message-----
From: Mark Chambers [mailto:markc@mail•com]
Sent: Tuesday, January 18, 2005 10:23 AM
To: Povolotsky, Alexander; 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


>
> So what could go wrong here in terms of setting the baudrate for the
serial
> uart
> (which "presumably" causes printing 3 good characters and then garbage
> during kernel booting) ?
>

If you can get your hands on an oscilloscope and look at the TxD from your
board, you can get an exact measurement of your baudrate and make sure
you are on the right track. (Baudrate = 1/shortest-high-or-low-time)

Mark Chambers

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Linux 2.6-10.rc3  8xx: debugging (over-writing)  content of b d_in fo structure  in the kernel booting code
@ 2005-01-18 15:45 Povolotsky, Alexander
  2005-01-18 18:11 ` John W. Linville
  0 siblings, 1 reply; 6+ messages in thread
From: Povolotsky, Alexander @ 2005-01-18 15:45 UTC (permalink / raw)
  To: 'Mark Chambers'; +Cc: 'linuxppc-embedded@ozlabs•org'

Hi Mark,

Forgot to mention - this board boots (and works) well with Linux 2.4.26 with
the
same bootloader structure 
and
same embed_config(bd_t **bdp) function (in
arch/ppc/boot/simple/embed_config.c))

as listed before

Regards,
Alex

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Linux 2.6-10.rc3 8xx: debugging (over-writing) content of b d_in fo structure in the kernel booting code
  2005-01-18 15:45 Linux 2.6-10.rc3 8xx: debugging (over-writing) content of b d_in fo structure in the kernel booting code Povolotsky, Alexander
@ 2005-01-18 18:11 ` John W. Linville
  0 siblings, 0 replies; 6+ messages in thread
From: John W. Linville @ 2005-01-18 18:11 UTC (permalink / raw)
  To: Povolotsky, Alexander; +Cc: 'linuxppc-embedded@ozlabs•org'

On Tue, Jan 18, 2005 at 10:45:53AM -0500, Povolotsky, Alexander wrote:

> Forgot to mention - this board boots (and works) well with Linux 2.4.26 with

Aren't there still generic problems w/ 8xx and 2.6.x?
-- 
John W. Linville
linville@tuxdriver•com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Linux 2.6-10.rc3  8xx: debugging (over-writing)  content of b d_in fo structure  in the kernel booting code
@ 2005-01-18 18:18 Povolotsky, Alexander
  0 siblings, 0 replies; 6+ messages in thread
From: Povolotsky, Alexander @ 2005-01-18 18:18 UTC (permalink / raw)
  To: 'John W. Linville'
  Cc: 'Steven Blakeslee',
	'linuxppc-embedded@ozlabs•org'

>Aren't there still generic problems w/ 8xx and 2.6.x?

Allegedly - yes (with memory initialization) but ...
both Tom Rini and Steve Blakeslee both were able to boot their 
RPXLite Variant of 8xx on 2.6.10-rc3 (the one I am using)

-----Original Message-----
From: John W. Linville [mailto:linville@tuxdriver•com]
Sent: Tuesday, January 18, 2005 1:11 PM
To: Povolotsky, Alexander
Cc: 'Mark Chambers'; 'linuxppc-embedded@ozlabs•org'
Subject: Re: Linux 2.6-10.rc3 8xx: debugging (over-writing) content of b
d_in fo structure in the kernel booting code


On Tue, Jan 18, 2005 at 10:45:53AM -0500, Povolotsky, Alexander wrote:

> Forgot to mention - this board boots (and works) well with Linux 2.4.26
with

Aren't there still generic problems w/ 8xx and 2.6.x?
-- 
John W. Linville
linville@tuxdriver•com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Linux 2.6-10.rc3  8xx: debugging (over-writing)  content of b d_in fo structure  in the kernel booting code
@ 2005-01-18 18:52 Povolotsky, Alexander
  0 siblings, 0 replies; 6+ messages in thread
From: Povolotsky, Alexander @ 2005-01-18 18:52 UTC (permalink / raw)
  To: 'John W. Linville'
  Cc: 'Steven Blakeslee',
	'linuxppc-embedded@ozlabs•org'

The "one, I am using" from my previous e-mail relates to 2.6.10-rc3
My processor is MPC880.
-----Original Message-----
From: Povolotsky, Alexander 
Sent: Tuesday, January 18, 2005 1:19 PM
To: 'John W. Linville'
Cc: 'Mark Chambers'; 'linuxppc-embedded@ozlabs•org'; 'Tom Rini'; 'Steven
Blakeslee'
Subject: RE: Linux 2.6.10-rc3 8xx: debugging (over-writing) content of b
d_in fo structure in the kernel booting code

>Aren't there still generic problems w/ 8xx and 2.6.x?

Allegedly - yes (with memory initialization) but ...
both Tom Rini and Steve Blakeslee were able to boot their 
RPXLite Variant of 8xx on 2.6.10-rc3 (the one I am using)

-----Original Message-----
From: John W. Linville [mailto:linville@tuxdriver•com]
Sent: Tuesday, January 18, 2005 1:11 PM
To: Povolotsky, Alexander
Cc: 'Mark Chambers'; 'linuxppc-embedded@ozlabs•org'
Subject: Re: Linux 2.6.10-rc3 8xx: debugging (over-writing) content of b
d_in fo structure in the kernel booting code


On Tue, Jan 18, 2005 at 10:45:53AM -0500, Povolotsky, Alexander wrote:

> Forgot to mention - this board boots (and works) well with Linux 2.4.26 

Aren't there still generic problems w/ 8xx and 2.6.x?
-- 
John W. Linville
linville@tuxdriver•com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-01-18 18:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-18 15:45 Linux 2.6-10.rc3 8xx: debugging (over-writing) content of b d_in fo structure in the kernel booting code Povolotsky, Alexander
2005-01-18 18:11 ` John W. Linville
  -- strict thread matches above, loose matches on Subject: below --
2005-01-18 18:52 Povolotsky, Alexander
2005-01-18 18:18 Povolotsky, Alexander
2005-01-18 15:24 Povolotsky, Alexander
2005-01-18 15:01 Povolotsky, Alexander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox