[U-Boot-Users] Zilog Z85230 serial communication controller
"Häpe, Sebastian, HRD/AB"
sebastian.haepe at eads.com
Wed Feb 9 15:28:36 CET 2005
Hi again!
Currently I try to integrate a Zilog Z85230 serial communication controller
on a 603e-based board to work with U-Boot.
For testing reasons I wrote a little inline assembler program looking like
that:
#include <common.h>
#ifdef CFG_Z85230
#if CONFIG_CONS_INDEX == 1
#else
#error no valid console defined
#endif
int serial_init (void)
{
/* First we load the _physical_ address of the chip's cntrol
register to R3 */
__asm__ __volatile__ ("addis 3, 0, 0x0000");
__asm__ __volatile__ ("addis 3,0,0xF500");
__asm__ __volatile__ ("ori 3,3,0x00D0");
/* Load the address of the chip's data rgister to R2 */
__asm__ __volatile__ ("addis 2, 0, 0x0000");
__asm__ __volatile__ ("addis 2,0,0xF500");
__asm__ __volatile__ ("ori 2,2,0x00D8");
/* Here some configuration for the serial controller is done, use R4
*/
__asm__ __volatile__ ("li 4, 0x04");
__asm__ __volatile__ ("stb 4, 0(3)");
__asm__ __volatile__ ("li 4, 0x44");
__asm__ __volatile__ ("stb 4, 0(3)");
.
.
.
.
/* Write one character ('I') */
__asm__ __volatile__ ("addis 4, 0, 0x0000");
__asm__ __volatile__ ("li 4, 0x49");
__asm__ __volatile__ ("stb 4, 0(2)");
return(0);
}
.
.
.
When I compile this, load it into RAM and execute it, everything is fine,
MiniCom shows an 'I'.
Now I put this litte function into the file serial.c from U-Boot and compile
it.
Then I load U-Boot to Flash and run it. I'm tested before, wheather the
function is always called and it is.
When I run it, I get an error, caused by the MMU, because it cannot
translate the demanded address (it's a physical one).
Now I tried to disable the data-address-translation on the beginning of the
function and re-enable it at the end, always surrounded by an
'isync'-command. It this case, the program runs, but without any output via
the serial port.
Is it legal to disable the MMU in this context and how should I configure
U-Boot for my memory map?
I have the following memory map on my board:
0x00000000 - 0x007FEFFF SRAM
0xF5000000 - Serial Interface #1 Channel B Control
0xF5000008 - Serial Interface #1 Channel B Data
.
.
.
0xF50000D0 - Serial Interface #3 Channel A Control
0xF50000D8 - Serial Interface #3 Channel A Data
0xFF800000 - 0xFFFFFFFF Flash
Thanks for ideas or advices why this doesn't work?
Sebastian Häpe
More information about the U-Boot
mailing list