Commit 27b207fd authored by wdenk's avatar wdenk

* Implement new mechanism to export U-Boot's functions to standalone

  applications: instead of using (PPC-specific) system calls we now
  use a jump table; please see doc/README.standalone for details

* Patch by Dave Westwood, 24 Jul 2003:
  added support for Unity OS (a proprietary OS)
parent 2535d602
......@@ -2,6 +2,35 @@
Changes for U-Boot 0.4.5:
======================================================================
* Implement new mechanism to export U-Boot's functions to standalone
applications: instead of using (PPC-specific) system calls we now
use a jump table; please see doc/README.standalone for details
* Patch by Dave Westwood, 24 Jul 2003:
added support for Unity OS (a proprietary OS)
* Patch by Detlev Zundel, 23 Jul 2003:
add "imls" command to print flash table of contents
* Fix cold boot detection for log buffer reset
* Return error for invalid length specifiers with "cp.X" etc.
* Fix startup problem on MIPS
* Allow for CONFIG_SPLASH_SCREEN even when no explicit
bitmap support is configured
* Patch by Bill Hargen, 18 Jul 2003:
- fix endinaness problem in cpu/mpc824x/drivers/i2c/i2c1.c
* Patch by Denis Peter, 18 Jul 2003:
- fix memory configuration for MIP405T
- fix printout of baudrate for "loadb <loadaddr> <baudrate>"
* Cleanup of TQM82xx configurations; use "official" board types
to make selection easier.
* Patch by Martin Krause, 17 Jul 2003:
add delay to get I2C working with "imm" command and s3c24x0_i2c.c
......
......@@ -80,7 +80,7 @@ LIST_8260=" \
gw8260 hymod IPHASE4539 MPC8260ADS \
MPC8266ADS PM826 ppmc8260 RPXsuper \
rsdproto sacsng sbc8260 SCM \
TQM8260 \
TQM8260_AC TQM8260_AD TQM8260_AE \
"
#########################################################################
......
......@@ -662,32 +662,48 @@ sbc8260_config: unconfig
SCM_config: unconfig
@./mkconfig $(@:_config=) ppc mpc8260 SCM siemens
TQM8255_config \
TQM8260_config \
TQM8260_L2_config \
TQM8255_266MHz_config \
TQM8260_266MHz_config \
TQM8260_L2_266MHz_config \
TQM8255_300MHz_config \
TQM8260_300MHz_config: unconfig
@ >include/config.h
@if [ "$(findstring _L2_,$@)" ] ; then \
TQM8255_AA_config \
TQM8260_AA_config \
TQM8260_AB_config \
TQM8260_AC_config \
TQM8260_AD_config \
TQM8260_AE_config \
TQM8260_AF_config \
TQM8260_AG_config \
TQM8260_AH_config \
TQM8265_AA_config: unconfig
@case "$@" in \
TQM8255_AA_config) CTYPE=MPC8255; CFREQ=300; CACHE=no; BMODE=8260;; \
TQM8260_AA_config) CTYPE=MPC8260; CFREQ=200; CACHE=no; BMODE=8260;; \
TQM8260_AB_config) CTYPE=MPC8260; CFREQ=200; CACHE=yes; BMODE=60x;; \
TQM8260_AC_config) CTYPE=MPC8260; CFREQ=200; CACHE=yes; BMODE=60x;; \
TQM8260_AD_config) CTYPE=MPC8260; CFREQ=300; CACHE=no; BMODE=60x;; \
TQM8260_AE_config) CTYPE=MPC8260; CFREQ=266; CACHE=no; BMODE=8260;; \
TQM8260_AF_config) CTYPE=MPC8260; CFREQ=300; CACHE=no; BMODE=60x;; \
TQM8260_AG_config) CTYPE=MPC8260; CFREQ=300; CACHE=no; BMODE=8260;; \
TQM8260_AH_config) CTYPE=MPC8260; CFREQ=300; CACHE=yes; BMODE=60x;; \
TQM8265_AA_config) CTYPE=MPC8265; CFREQ=300; CACHE=no; BMODE=60x;; \
esac; \
>include/config.h ; \
if [ "$${CTYPE}" != "MPC8260" ] ; then \
echo "#define CONFIG_$${CTYPE}" >>include/config.h ; \
fi; \
echo "#define CONFIG_$${CFREQ}MHz" >>include/config.h ; \
echo "... with $${CFREQ}MHz system clock" ; \
if [ "$${CACHE}" == "yes" ] ; then \
echo "#define CONFIG_L2_CACHE" >>include/config.h ; \
echo "... with L2 Cache support (60x Bus Mode)" ; \
echo "... with L2 Cache support" ; \
else \
echo "#undef CONFIG_L2_CACHE" >>include/config.h ; \
echo "... without L2 Cache support" ; \
fi; \
if [ "$${BMODE}" == "60x" ] ; then \
echo "#define CONFIG_BUSMODE_60x" >>include/config.h ; \
echo "... with 60x Bus Mode" ; \
else \
echo "#undef CONFIG_BUSMODE_60x" >>include/config.h ; \
echo "... without 60x Bus Mode" ; \
fi
@[ -z "$(findstring _266MHz,$@)" ] || \
{ echo "#define CONFIG_266MHz" >>include/config.h ; \
echo "... with 266MHz system clock" ; \
}
@[ -z "$(findstring _300MHz,$@)" ] || \
{ echo "#define CONFIG_300MHz" >>include/config.h ; \
echo "... with 300MHz system clock" ; \
}
@[ -z "$(findstring TQM8255_,$@)" ] || \
{ echo "#define CONFIG_MPC8255" >>include/config.h ; }
@./mkconfig -a TQM8260 ppc mpc8260 tqm8260
atc_config: unconfig
......
......@@ -27,7 +27,6 @@
#include <command.h>
#include <malloc.h>
#include <devices.h>
#include <syscall.h>
#include <net.h>
#include <version.h>
#include <dtt.h>
......
......@@ -173,7 +173,7 @@ void after_reloc (ulong dest_addr)
/*
* Jump to the main U-Boot board init code
*/
board_init_r(gd, dest_addr);
board_init_r((gd_t *)gd, dest_addr);
}
/* ------------------------------------------------------------------------- */
......
......@@ -142,7 +142,7 @@ void after_reloc (ulong dest_addr)
/*
* Jump to the main U-Boot board init code
*/
board_init_r (gd, dest_addr);
board_init_r ((gd_t *)gd, dest_addr);
}
/* ------------------------------------------------------------------------- */
......
......@@ -329,7 +329,7 @@ after_reloc(ulong dest_addr)
}
/* now, jump to the main U-Boot board init code */
board_init_r (gd, dest_addr);
board_init_r ((gd_t *)gd, dest_addr);
/* NOTREACHED */
}
......
......@@ -1077,7 +1077,7 @@ static int key_pressed(void)
* Returns 1 if keys pressed to start the power-on long-running tests
* Called from board_init_f().
*/
int post_hotkeys_pressed(gd_t *gd)
int post_hotkeys_pressed(void)
{
uchar kbd_data[KEYBD_DATALEN];
uchar val;
......
......@@ -105,6 +105,8 @@ unsigned long flash_init (void)
CFG_MONITOR_BASE+monitor_flash_len-1,
&flash_info[0]);
#endif
/* protect reset vector */
flash_info[0].protect[flash_info[0].sector_count-1] = 1;
size_b1 = 0 ;
flash_info[0].size = size_b0;
#if 0
......
......@@ -494,7 +494,7 @@ void mem_test_reloc(void)
}
int mem_test (unsigned long start, unsigned long ramsize, int quiet, int reloc)
int mem_test (unsigned long start, unsigned long ramsize, int quiet)
{
unsigned long errors, stage;
unsigned long startaddr, size, i;
......
......@@ -110,7 +110,7 @@ static struct pci_pip405_config_entry piix4_ide_cntrl_f1[] = {
#if !defined(CONFIG_MIP405T)
{PCI_CFG_PIIX4_IDETIM, 0x80008000, 4}, /* enable Both IDE channels */
#else
{PCI_CFG_PIIX4_IDETIM, 0x80000000, 4}, /* enable IDE channel0 */
{PCI_CFG_PIIX4_IDETIM, 0x00008000, 4}, /* enable IDE channel0 */
#endif
{ } /* end of device table */
};
......
......@@ -69,6 +69,7 @@
#include <miiphy.h>
#include "../common/common_util.h"
#include <i2c.h>
#include <rtc.h>
extern block_dev_desc_t * scsi_get_dev(int dev);
extern block_dev_desc_t * ide_get_dev(int dev);
......@@ -110,14 +111,14 @@ typedef struct {
} sdram_t;
#if defined(CONFIG_MIP405T)
const sdram_t sdram_table[] = {
{ 0x01, /* MIP405T Rev A, 64MByte -1 Board */
{ 0x0F, /* MIP405T Rev A, 64MByte -1 Board */
3, /* Case Latenty = 3 */
3, /* trp 20ns / 7.5 ns datain[27] */
3, /* trcd 20ns /7.5 ns (datain[29]) */
6, /* tras 44ns /7.5 ns (datain[30]) */
4, /* tcpt 44 - 20ns = 24ns */
3, /* Address Mode = 3 (13x9x4) */
4, /* size value (64MByte) */
2, /* Address Mode = 2 (12x9x4) */
3, /* size value (32MByte) */
0}, /* ECC disabled */
{ 0xff, /* terminator */
0xff,
......@@ -281,11 +282,6 @@ int init_sdram (void)
if((bc & 0x80)==0x80)
SDRAM_err ("U-Boot configured for a MIP405 not for a MIP405T!!!\n");
#endif
#if !defined(CONFIG_MIP405T)
/* since the ECC initialisation needs some time,
* we show that we're alive
*/
serial_puts ("\nInitializing SDRAM, Please stand by");
/* set-up the chipselect machine */
mtdcr (ebccfga, pb0cr); /* get cs0 config reg */
tmp = mfdcr (ebccfgd);
......@@ -311,7 +307,6 @@ int init_sdram (void)
mtdcr (ebccfgd, UART1_AP);
mtdcr (ebccfga, pb3cr);
mtdcr (ebccfgd, UART1_CR);
#endif
bc = in8 (PLD_BOARD_CFG_REG);
#ifdef SDRAM_DEBUG
serial_puts ("\nstart SDRAM Setup\n");
......@@ -333,6 +328,11 @@ int init_sdram (void)
write_hex (i);
serial_puts (" \n");
#endif
/* since the ECC initialisation needs some time,
* we show that we're alive
*/
if (sdram_table[i].ecc)
serial_puts ("\nInitializing SDRAM, Please stand by");
cal_val = sdram_table[i].cal - 1; /* Cas Latency */
trp_clocks = sdram_table[i].trp; /* 20ns / 7.5 ns datain[27] */
trcd_clocks = sdram_table[i].trcd; /* 20ns /7.5 ns (datain[29]) */
......@@ -559,7 +559,7 @@ void get_pcbrev_var(unsigned char *pcbrev, unsigned char *var)
unsigned char bc;
bc = in8 (PLD_BOARD_CFG_REG);
*pcbrev=(bc >> 4) & 0xf;
*var=bc & 0xf ;
*var=16-(bc & 0xf);
#endif
}
......@@ -654,8 +654,6 @@ long int initdram (int board_type)
/* ------------------------------------------------------------------------- */
extern int mem_test (unsigned long start, unsigned long ramsize,
int quiet);
static int test_dram (unsigned long ramsize)
{
......@@ -666,8 +664,15 @@ static int test_dram (unsigned long ramsize)
return (1);
}
/* used to check if the time in RTC is valid */
static unsigned long start;
static struct rtc_time tm;
int misc_init_r (void)
{
/* check, if RTC is running */
rtc_get (&tm);
start=get_timer(0);
/* if MIP405 has booted from PCI, reset CCR0[24] as described in errata PCI_18 */
if (mfdcr(strap) & PSR_ROM_LOC)
mtspr(ccr0, (mfspr(ccr0) & ~0x80));
......@@ -688,9 +693,13 @@ void print_mip405_rev (void)
}
extern void mem_test_reloc(void);
extern int mk_date (char *, struct rtc_time *);
int last_stage_init (void)
{
unsigned long stop;
struct rtc_time newtm;
unsigned char *s;
mem_test_reloc();
/* write correct LED configuration */
if (miiphy_write (0x1, 0x14, 0x2402) != 0) {
......@@ -704,6 +713,25 @@ int last_stage_init (void)
print_mip405_rev ();
show_stdio_dev ();
check_env ();
/* check if RTC time is valid */
stop=get_timer(start);
while(stop<1200) { /* we wait 1.2 sec to check if the RTC is running */
udelay(1000);
stop=get_timer(start);
}
rtc_get (&newtm);
if(tm.tm_sec==newtm.tm_sec) {
s=getenv("defaultdate");
if(!s)
mk_date ("010112001970", &newtm);
else
if(mk_date (s, &newtm)!=0) {
printf("RTC: Bad date format in defaultdate\n");
return 0;
}
rtc_reset ();
rtc_set(&newtm);
}
return 0;
}
......@@ -745,10 +773,10 @@ void print_mip405_info (void)
printf ("SER1 uses handshakes %s\n",
(ext & 0x80) ? "DTR/DSR" : "RTS/CTS");
#else
printf ("User Config Switch %d %d %d %d %d %d %d %d %d\n",
printf ("User Config Switch %d %d %d %d %d %d %d %d\n",
(ext) & 0x1, (ext >> 1) & 0x1, (ext >> 2) & 0x1,
(ext >> 3) & 0x1, (ext >> 4) & 0x1, (ext >> 5) & 0x1,
(ext >> 6) & 0x1,(ext >> 7) & 0x1,(ext >> 8) & 0x1);
(ext >> 6) & 0x1,(ext >> 7) & 0x1);
#endif
printf ("IDE Reset %s\n", (ext & 0x01) ? "asserted" : "not asserted");
printf ("IRQs:\n");
......
......@@ -112,7 +112,7 @@ void after_reloc (ulong dest_addr)
/* Jump to the main U-Boot board init code
*/
board_init_r (gd, dest_addr);
board_init_r ((gd_t *)gd, dest_addr);
}
int misc_init_r (void)
......
......@@ -42,7 +42,7 @@ COBJS = main.o altera.o bedbug.o \
cmd_reginfo.o cmd_scsi.o cmd_spi.o cmd_usb.o cmd_vfd.o \
command.o console.o devices.o dlmalloc.o docecc.o \
environment.o env_common.o \
env_flash.o env_eeprom.o env_nvram.o env_nowhere.o \
env_flash.o env_eeprom.o env_nvram.o env_nowhere.o exports.o \
flash.o fpga.o \
hush.o kgdb.o lists.o miiphybb.o miiphyutil.o \
s_record.o soft_i2c.o soft_spi.o spartan2.o \
......
......@@ -27,13 +27,15 @@
#include <common.h>
#include <command.h>
#include <net.h>
#include <syscall.h>
/* -------------------------------------------------------------------- */
int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
#if defined(CONFIG_I386)
DECLARE_GLOBAL_DATA_PTR;
#endif
ulong addr, rc;
int rcode = 0;
......@@ -50,6 +52,13 @@ int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
* pass address parameter as argv[0] (aka command name),
* and all remaining args
*/
#if defined(CONFIG_I386)
/*
* x86 does not use a dedicated register to pass the pointer
* to the global_data
*/
argv[0] = (char *)gd;
#endif
rc = ((ulong (*)(int, char *[]))addr) (--argc, &argv[1]);
if (rc != 0) rcode = 1;
......
......@@ -80,6 +80,13 @@ static void zfree(void *, void *, unsigned);
#if (CONFIG_COMMANDS & CFG_CMD_IMI)
static int image_info (unsigned long addr);
#endif
#if (CONFIG_COMMANDS & CFG_CMD_IMLS)
#include <flash.h>
extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
#endif
static void print_type (image_header_t *hdr);
#ifdef __I386__
......@@ -961,6 +968,56 @@ U_BOOT_CMD(
#endif /* CFG_CMD_IMI */
#if (CONFIG_COMMANDS & CFG_CMD_IMLS)
/*-----------------------------------------------------------------------
* List all images found in flash.
*/
int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
flash_info_t *info;
int i, j;
image_header_t *hdr;
ulong checksum;
for (i=0, info=&flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) {
if (info->flash_id == FLASH_UNKNOWN)
goto next_bank;
for (j=0; j<CFG_MAX_FLASH_SECT; ++j) {
if (!(hdr=(image_header_t *)info->start[j]) ||
(ntohl(hdr->ih_magic) != IH_MAGIC))
goto next_sector;
/* Copy header so we can blank CRC field for re-calculation */
memmove (&header, (char *)hdr, sizeof(image_header_t));
checksum = ntohl(header.ih_hcrc);
header.ih_hcrc = 0;
if (crc32 (0, (char *)&header, sizeof(image_header_t))
!= checksum)
goto next_sector;
printf ("Image at %08lX:\n", (ulong)hdr);
print_image_hdr( hdr );
putc ('\n');
next_sector:
}
next_bank:
}
return (0);
}
U_BOOT_CMD(
imls, 1, 1, do_imls,
"imls - list all images found in flash\n",
"\n"
" - Prints information about all images found at sector\n"
" boundaries in flash.\n"
);
#endif /* CFG_CMD_IMLS */
void
print_image_hdr (image_header_t *hdr)
{
......
......@@ -28,7 +28,7 @@
#include <command.h>
#include <s_record.h>
#include <net.h>
#include <syscall.h>
#include <exports.h>
#if (CONFIG_COMMANDS & CFG_CMD_LOADS)
......@@ -213,6 +213,7 @@ load_serial (ulong offset)
static int
read_record (char *buf, ulong len)
{
DECLARE_GLOBAL_DATA_PTR;
char *p;
char c;
......@@ -236,13 +237,11 @@ read_record (char *buf, ulong len)
}
/* Check for the console hangup (if any different from serial) */
#ifdef CONFIG_PPC /* we don't have syscall_tbl anywhere else */
if (syscall_tbl[SYSCALL_GETC] != serial_getc) {
if (gd->jt[XF_getc] != serial_getc) {
if (ctrlc()) {
return (-1);
}
}
#endif
}
/* line too long - truncate */
......@@ -479,7 +478,7 @@ int do_load_serial_bin (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
printf ("## Ready for binary (kermit) download "
"to 0x%08lX at %d bps...\n",
offset,
current_baudrate);
load_baudrate);
addr = load_serial_bin (offset);
if (addr == ~0) {
......
......@@ -86,8 +86,7 @@ void logbuff_init_ptrs (void)
post_word = post_word_load();
#ifdef CONFIG_POST
/* The post routines have setup the word so we can simply test it */
if (((post_word & 0xffff) == POST_POWERON) ||
((post_word & 0xffff) == POST_SLOWTEST)) {
if (post_word_load () & POST_COLDBOOT) {
logged_chars = log_size = log_start = 0;
*ext_tag = LOGBUFF_MAGIC;
}
......
......@@ -53,6 +53,8 @@ int cmd_get_data_size(char* arg, int default_size)
return 2;
case 'l':
return 4;
default:
return -1;
}
}
return default_size;
......@@ -86,9 +88,10 @@ static ulong base_address = 0;
#define DISP_LINE_LEN 16
int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
ulong addr, size, length;
ulong addr, length;
ulong i, nbytes, linebytes;
u_char *cp;
int size;
int rc = 0;
/* We use the last specified parameters, unless new ones are
......@@ -107,7 +110,8 @@ int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/* New command specified. Check for a size specification.
* Defaults to long if no or incorrect specification.
*/
size = cmd_get_data_size(argv[0], 4);
if ((size = cmd_get_data_size(argv[0], 4)) < 0)
return 1;
/* Address is specified since argc > 1
*/
......@@ -199,7 +203,8 @@ int do_mem_nm ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
ulong addr, size, writeval, count;
ulong addr, writeval, count;
int size;
if ((argc < 3) || (argc > 4)) {
printf ("Usage:\n%s\n", cmdtp->usage);
......@@ -208,7 +213,8 @@ int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/* Check for size specification.
*/
size = cmd_get_data_size(argv[0], 4);
if ((size = cmd_get_data_size(argv[0], 4)) < 1)
return 1;
/* Address is specified since argc > 1
*/
......@@ -240,7 +246,8 @@ int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
ulong size, addr1, addr2, count, ngood;
ulong addr1, addr2, count, ngood;
int size;
int rcode = 0;
if (argc != 4) {
......@@ -250,7 +257,8 @@ int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/* Check for size specification.
*/
size = cmd_get_data_size(argv[0], 4);
if ((size = cmd_get_data_size(argv[0], 4)) < 0)
return 1;
addr1 = simple_strtoul(argv[1], NULL, 16);
addr1 += base_address;
......@@ -316,7 +324,8 @@ int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
ulong addr, size, dest, count;
ulong addr, dest, count;
int size;
if (argc != 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
......@@ -325,7 +334,8 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/* Check for size specification.
*/
size = cmd_get_data_size(argv[0], 4);
if ((size = cmd_get_data_size(argv[0], 4)) < 0)
return 1;
addr = simple_strtoul(argv[1], NULL, 16);
addr += base_address;
......@@ -458,7 +468,8 @@ int do_mem_base (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
ulong addr, size, length, i, junk;
ulong addr, length, i, junk;
int size;
volatile uint *longp;
volatile ushort *shortp;
volatile u_char *cp;
......@@ -471,7 +482,8 @@ int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/* Check for a size spefication.
* Defaults to long if no or incorrect specification.
*/
size = cmd_get_data_size(argv[0], 4);
if ((size = cmd_get_data_size(argv[0], 4)) < 0)
return 1;
/* Address is always specified.
*/
......@@ -839,8 +851,8 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
static int
mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
{
ulong addr, size, i;
int nbytes;
ulong addr, i;
int nbytes, size;
extern char console_buffer[];
if (argc != 2) {
......@@ -861,7 +873,8 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
/* New command specified. Check for a size specification.
* Defaults to long if no or incorrect specification.
*/
size = cmd_get_data_size(argv[0], 4);
if ((size = cmd_get_data_size(argv[0], 4)) < 0)
return 1;
/* Address is specified since argc > 1
*/
......
......@@ -25,9 +25,7 @@
#include <stdarg.h>
#include <malloc.h>
#include <console.h>
#include <syscall.h>
void **syscall_tbl;
#include <exports.h>
#ifdef CONFIG_AMIGAONEG3SE
int console_changed = 0;
......@@ -52,6 +50,7 @@ int overwrite_console (void)
static int console_setfile (int file, device_t * dev)
{
DECLARE_GLOBAL_DATA_PTR;
int error = 0;
if (dev == NULL)
......@@ -78,13 +77,13 @@ static int console_setfile (int file, device_t * dev)
*/
switch (file) {
case stdin:
syscall_tbl[SYSCALL_GETC] = dev->getc;
syscall_tbl[SYSCALL_TSTC] = dev->tstc;
gd->jt[XF_getc] = dev->getc;
gd->jt[XF_tstc] = dev->tstc;
break;
case stdout:
syscall_tbl[SYSCALL_PUTC] = dev->putc;
syscall_tbl[SYSCALL_PUTS] = dev->puts;
syscall_tbl[SYSCALL_PRINTF] = printf;
gd->jt[XF_putc] = dev->putc;
gd->jt[XF_puts] = dev->puts;
gd->jt[XF_printf] = printf;
break;
}
break;
......@@ -394,15 +393,16 @@ device_t *search_device (int flags, char *name)
/* Called after the relocation - use desired console functions */
int console_init_r (void)
{
DECLARE_GLOBAL_DATA_PTR;
char *stdinname, *stdoutname, *stderrname;
device_t *inputdev = NULL, *outputdev = NULL, *errdev = NULL;
/* set default handlers at first */
syscall_tbl[SYSCALL_GETC] = serial_getc;
syscall_tbl[SYSCALL_TSTC] = serial_tstc;
syscall_tbl[SYSCALL_PUTC] = serial_putc;
syscall_tbl[SYSCALL_PUTS] = serial_puts;
syscall_tbl[SYSCALL_PRINTF] = serial_printf;
gd->jt[XF_getc] = serial_getc;
gd->jt[XF_tstc] = serial_tstc;
gd->jt[XF_putc] = serial_putc;
gd->jt[XF_puts] = serial_puts;
gd->jt[XF_printf] = serial_printf;
/* stdin stdout and stderr are in environment */
/* scan for it */
......
#include <common.h>
#include <exports.h>
static void dummy(void)
{
}
unsigned long get_version(void)
{
return XF_VERSION;
}
void jumptable_init (void)
{
DECLARE_GLOBAL_DATA_PTR;
int i;