2005-10-28 20:53:37 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 1996 Paul Mackerras.
|
|
|
|
* Copyright (C) 2000 Dan Malek.
|
|
|
|
* Quick hack of Paul's code to make XMON work on 8xx processors. Lots
|
|
|
|
* of assumptions, like the SMC1 is used, it has been initialized by the
|
|
|
|
* loader at some point, and we can just stuff and suck bytes.
|
|
|
|
* We rely upon the 8xx uart driver to support us, as the interface
|
|
|
|
* changes between boot up and operational phases of the kernel.
|
|
|
|
*/
|
|
|
|
#include <linux/string.h>
|
|
|
|
#include <asm/machdep.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/page.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <asm/8xx_immap.h>
|
|
|
|
#include <asm/mpc8xx.h>
|
|
|
|
#include <asm/commproc.h>
|
2005-11-08 19:55:08 +08:00
|
|
|
#include "nonstdio.h"
|
2005-10-28 20:53:37 +08:00
|
|
|
|
|
|
|
extern int xmon_8xx_write(char *str, int nb);
|
|
|
|
extern int xmon_8xx_read_poll(void);
|
|
|
|
extern int xmon_8xx_read_char(void);
|
|
|
|
|
2005-11-08 19:55:08 +08:00
|
|
|
void xmon_map_scc(void)
|
2005-10-28 20:53:37 +08:00
|
|
|
{
|
|
|
|
cpmp = (cpm8xx_t *)&(((immap_t *)IMAP_ADDR)->im_cpm);
|
|
|
|
}
|
|
|
|
|
|
|
|
void xmon_init_scc(void);
|
|
|
|
|
2005-11-08 19:55:08 +08:00
|
|
|
int xmon_write(void *ptr, int nb)
|
2005-10-28 20:53:37 +08:00
|
|
|
{
|
|
|
|
return(xmon_8xx_write(ptr, nb));
|
|
|
|
}
|
|
|
|
|
2005-11-08 19:55:08 +08:00
|
|
|
int xmon_readchar(void)
|
2005-10-28 20:53:37 +08:00
|
|
|
{
|
2005-11-08 19:55:08 +08:00
|
|
|
return xmon_8xx_read_char();
|
2005-10-28 20:53:37 +08:00
|
|
|
}
|
|
|
|
|
2005-11-08 19:55:08 +08:00
|
|
|
int xmon_read_poll(void)
|
2005-10-28 20:53:37 +08:00
|
|
|
{
|
|
|
|
return(xmon_8xx_read_poll());
|
|
|
|
}
|