public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] strange problem on lib_mips/board.c after relocate code
@ 2005-11-17  3:49 zhuzhenhua
  2005-11-18 12:02 ` Matthias Fuchs
  0 siblings, 1 reply; 2+ messages in thread
From: zhuzhenhua @ 2005-11-17  3:49 UTC (permalink / raw)
  To: u-boot

after relcate code and jump into board_init_r()

1.if i use printf to output string, it never put, but serial_puts is
ok, and printf in board_init_f is ok.

2. and also in board_init_r(), the serial_puts sometimes put
correctly, sometimes not.
and in board_init_f, it's fine for every time.

as flollow is my serial.c functions


int serial_init (void)
{
	volatile u32 *uart0_config = (volatile u32*)(UART0_ADDR + UART0_CTL);

	/* Set parity, stop bits and word length to 8N1 */
	
	*uart0_config = UART0_CONFIG_VAL;
	// serial_setbrg();   /*in our fpga board, baurate is fixed at 57600 */

	return 0;
}


void serial_setbrg (void)
{
	volatile u32 *uart0_clk = (volatile u32*)(ACTIONS_CMUHOSC_ADDR +
UART0_CLK_CON);

	/* Set uart0_clk_con  */
	*uart0_clk = (((CORE_CLK_HZ/(CONFIG_BAUDRATE * 8))&0x0000FFFF) |
(UART0_50DIV_SEL&0x00070000) | (UART0_CLK_EN&0x00080000));

}

void serial_putc (const char c)
{
	volatile u32 *uart0_stat = (volatile u32*)(UART0_ADDR + UART0_STAT);
	volatile u32 *uart0_txdata = (volatile u32*)(UART0_ADDR + UART0_TXDATA);

	if (c == '\n') serial_putc ('\r');

	/* Wait for fifo to shift out some bytes */
	while((*uart0_stat&UART0_STAT_TXFULL));  // the tx full bit means the
fifo is full
	*uart0_txdata = (u32)c;
}

void serial_puts (const char *s)
{
	while (*s)
	{
		serial_putc (*s++);
	}
}

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

* [U-Boot-Users] strange problem on lib_mips/board.c after relocate code
  2005-11-17  3:49 [U-Boot-Users] strange problem on lib_mips/board.c after relocate code zhuzhenhua
@ 2005-11-18 12:02 ` Matthias Fuchs
  0 siblings, 0 replies; 2+ messages in thread
From: Matthias Fuchs @ 2005-11-18 12:02 UTC (permalink / raw)
  To: u-boot

Hi zhuzhenhua,

this seems to be a RAM related issue. Are you sure that you SDRAM (?)- 
interface is ok and correctly setup? I had a similiar problem on a 
PowerPC board.

BTW: zhuzhenhua, it's a friendly gesture to finish a posting with at 
least your name. So others can address you personally.

Regards
Matthias

zhuzhenhua wrote:
> after relcate code and jump into board_init_r()
> 
> 1.if i use printf to output string, it never put, but serial_puts is
> ok, and printf in board_init_f is ok.
> 
> 2. and also in board_init_r(), the serial_puts sometimes put
> correctly, sometimes not.
> and in board_init_f, it's fine for every time.

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

end of thread, other threads:[~2005-11-18 12:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-17  3:49 [U-Boot-Users] strange problem on lib_mips/board.c after relocate code zhuzhenhua
2005-11-18 12:02 ` Matthias Fuchs

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