Path: blob/master/arch/m32r/boot/compressed/m32r_sio.c
10818 views
/*1* arch/m32r/boot/compressed/m32r_sio.c2*3* 2003-02-12: Takeo Takahashi4* 2006-11-30: OPSPUT support by Kazuhiro Inaoka5*6*/78#include <asm/processor.h>910static void putc(char c);1112static int puts(const char *s)13{14char c;15while ((c = *s++)) putc(c);16return 0;17}1819#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_OPSPUT)20#include <asm/m32r.h>21#include <asm/io.h>2223#define USE_FPGA_MAP 02425#if USE_FPGA_MAP26/*27* fpga configuration program uses MMU, and define map as same as28* M32104 uT-Engine board.29*/30#define BOOT_SIO0STS (volatile unsigned short *)(0x02c00000 + 0x20006)31#define BOOT_SIO0TXB (volatile unsigned short *)(0x02c00000 + 0x2000c)32#else33#undef PLD_BASE34#if defined(CONFIG_PLAT_OPSPUT)35#define PLD_BASE 0x1cc0000036#else37#define PLD_BASE 0xa4c0000038#endif39#define BOOT_SIO0STS PLD_ESIO0STS40#define BOOT_SIO0TXB PLD_ESIO0TXB41#endif4243static void putc(char c)44{45while ((*BOOT_SIO0STS & 0x3) != 0x3)46cpu_relax();47if (c == '\n') {48*BOOT_SIO0TXB = '\r';49while ((*BOOT_SIO0STS & 0x3) != 0x3)50cpu_relax();51}52*BOOT_SIO0TXB = c;53}54#else /* !(CONFIG_PLAT_M32700UT) */55#if defined(CONFIG_PLAT_MAPPI2)56#define SIO0STS (volatile unsigned short *)(0xa0efd000 + 14)57#define SIO0TXB (volatile unsigned short *)(0xa0efd000 + 30)58#else59#define SIO0STS (volatile unsigned short *)(0x00efd000 + 14)60#define SIO0TXB (volatile unsigned short *)(0x00efd000 + 30)61#endif6263static void putc(char c)64{65while ((*SIO0STS & 0x1) == 0)66cpu_relax();67if (c == '\n') {68*SIO0TXB = '\r';69while ((*SIO0STS & 0x1) == 0)70cpu_relax();71}72*SIO0TXB = c;73}74#endif757677