blob: 4c17b0486ad5b7f69bcf79560da162e2df86957d [file] [log] [blame]
Paul Mackerrasf78541d2005-10-28 22:53:37 +10001/*
2 * Copyright (C) 1996 Paul Mackerras.
3 * Copyright (C) 2000 Dan Malek.
4 * Quick hack of Paul's code to make XMON work on 8xx processors. Lots
5 * of assumptions, like the SMC1 is used, it has been initialized by the
6 * loader at some point, and we can just stuff and suck bytes.
7 * We rely upon the 8xx uart driver to support us, as the interface
8 * changes between boot up and operational phases of the kernel.
9 */
10#include <linux/string.h>
11#include <asm/machdep.h>
12#include <asm/io.h>
13#include <asm/page.h>
14#include <linux/kernel.h>
15#include <asm/8xx_immap.h>
16#include <asm/mpc8xx.h>
17#include <asm/commproc.h>
Paul Mackerrasfca5dcd2005-11-08 22:55:08 +110018#include "nonstdio.h"
Paul Mackerrasf78541d2005-10-28 22:53:37 +100019
Paul Mackerrasf78541d2005-10-28 22:53:37 +100020extern int xmon_8xx_write(char *str, int nb);
21extern int xmon_8xx_read_poll(void);
22extern int xmon_8xx_read_char(void);
Paul Mackerrasf78541d2005-10-28 22:53:37 +100023
Paul Mackerrasfca5dcd2005-11-08 22:55:08 +110024void xmon_map_scc(void)
Paul Mackerrasf78541d2005-10-28 22:53:37 +100025{
Paul Mackerrasf78541d2005-10-28 22:53:37 +100026 cpmp = (cpm8xx_t *)&(((immap_t *)IMAP_ADDR)->im_cpm);
Paul Mackerrasf78541d2005-10-28 22:53:37 +100027}
28
Paul Mackerrasf78541d2005-10-28 22:53:37 +100029void xmon_init_scc(void);
30
Paul Mackerrasfca5dcd2005-11-08 22:55:08 +110031int xmon_write(void *ptr, int nb)
Paul Mackerrasf78541d2005-10-28 22:53:37 +100032{
Paul Mackerrasf78541d2005-10-28 22:53:37 +100033 return(xmon_8xx_write(ptr, nb));
34}
35
Paul Mackerrasfca5dcd2005-11-08 22:55:08 +110036int xmon_readchar(void)
Paul Mackerrasf78541d2005-10-28 22:53:37 +100037{
Paul Mackerrasfca5dcd2005-11-08 22:55:08 +110038 return xmon_8xx_read_char();
Paul Mackerrasf78541d2005-10-28 22:53:37 +100039}
40
Paul Mackerrasfca5dcd2005-11-08 22:55:08 +110041int xmon_read_poll(void)
Paul Mackerrasf78541d2005-10-28 22:53:37 +100042{
43 return(xmon_8xx_read_poll());
44}