Commit 0f9cfa09df48b86ce5f8baefb3300417cc5b845b

Authored by wdenk
1 parent 78f6622a1f

Initial revision

Showing 4 changed files with 225 additions and 0 deletions Side-by-side Diff

  1 +/*
  2 + * (C) Copyright 2001
  3 + * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
  4 + *
  5 + * See file CREDITS for list of people who contributed to this
  6 + * project.
  7 + *
  8 + * This program is free software; you can redistribute it and/or
  9 + * modify it under the terms of the GNU General Public License as
  10 + * published by the Free Software Foundation; either version 2 of
  11 + * the License, or (at your option) any later version.
  12 + *
  13 + * This program is distributed in the hope that it will be useful,
  14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16 + * GNU General Public License for more details.
  17 + *
  18 + * You should have received a copy of the GNU General Public License
  19 + * along with this program; if not, write to the Free Software
  20 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21 + * MA 02111-1307 USA
  22 + *
  23 + */
  24 +
  25 +/*
  26 + * FPGA support
  27 + */
  28 +#ifndef _CMD_FPGA_H
  29 +#define _CMD_FPGA_H
  30 +
  31 +#include <common.h>
  32 +#include <command.h>
  33 +
  34 +#if defined(CONFIG_FPGA) && (CONFIG_COMMANDS & CFG_CMD_FPGA)
  35 +
  36 +#define CMD_TBL_FPGA MK_CMD_TBL_ENTRY( \
  37 + "fpga", 4, 6, 1, do_fpga, \
  38 + "fpga - loadable FPGA image support\n", \
  39 + "fpga [operation type] [device number] [image address] [image size]\n" \
  40 + "fpga operations:\n" \
  41 + "\tinfo\tlist known device information.\n" \
  42 + "\tload\tLoad device from memory buffer.\n" \
  43 + "\tdump\tLoad device to memory buffer.\n" \
  44 +),
  45 +
  46 +extern int do_fpga (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  47 +
  48 +#else
  49 +#define CMD_TBL_FPGA
  50 +#endif /* CONFIG_FPGA && CONFIG_COMMANDS & CFG_CMD_FPGA */
  51 +
  52 +#endif /* _CMD_FPGA_H */
  1 +/*
  2 + * (C) Copyright 2001
  3 + * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com
  4 + *
  5 + * See file CREDITS for list of people who contributed to this
  6 + * project.
  7 + *
  8 + * This program is free software; you can redistribute it and/or
  9 + * modify it under the terms of the GNU General Public License as
  10 + * published by the Free Software Foundation; either version 2 of
  11 + * the License, or (at your option) any later version.
  12 + *
  13 + * This program is distributed in the hope that it will be useful,
  14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16 + * GNU General Public License for more details.
  17 + *
  18 + * You should have received a copy of the GNU General Public License
  19 + * along with this program; if not, write to the Free Software
  20 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21 + * MA 02111-1307 USA
  22 + */
  23 +
  24 +/*
  25 + * MII Functions
  26 + */
  27 +#ifndef _CMD_PCI_H
  28 +#define _CMD_PCI_H
  29 +
  30 +#if (CONFIG_COMMANDS & CFG_CMD_PCI)
  31 +#define CMD_TBL_PCI MK_CMD_TBL_ENTRY( \
  32 + "pci", 3, 5, 1, do_pci, \
  33 + "pci - list and access PCI Configuraton Space\n", \
  34 + "[bus] [long]\n" \
  35 + " - short or long list of PCI devices on bus 'bus'\n" \
  36 + "pci header b.d.f\n" \
  37 + " - show header of PCI device 'bus.device.function'\n" \
  38 + "pci display[.b, .w, .l] b.d.f [address] [# of objects]\n" \
  39 + " - display PCI configuration space (CFG)\n" \
  40 + "pci next[.b, .w, .l] b.d.f address\n" \
  41 + " - modify, read and keep CFG address\n" \
  42 + "pci modify[.b, .w, .l] b.d.f address\n" \
  43 + " - modify, auto increment CFG address\n" \
  44 + "pci write[.b, .w, .l] b.d.f address value\n" \
  45 + " - write to CFG address\n" \
  46 +),
  47 +
  48 +int do_pci (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  49 +
  50 +#else
  51 +#define CMD_TBL_PCI
  52 +#endif /* CFG_CMD_PCI */
  53 +
  54 +#endif /* _CMD_PCI_H */
  1 +/*
  2 + * (C) Copyright 2000
  3 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4 + *
  5 + * See file CREDITS for list of people who contributed to this
  6 + * project.
  7 + *
  8 + * This program is free software; you can redistribute it and/or
  9 + * modify it under the terms of the GNU General Public License as
  10 + * published by the Free Software Foundation; either version 2 of
  11 + * the License, or (at your option) any later version.
  12 + *
  13 + * This program is distributed in the hope that it will be useful,
  14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16 + * GNU General Public License for more details.
  17 + *
  18 + * You should have received a copy of the GNU General Public License
  19 + * along with this program; if not, write to the Free Software
  20 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21 + * MA 02111-1307 USA
  22 + */
  23 +
  24 +#ifndef _IDE_H
  25 +#define _IDE_H
  26 +
  27 +#define IDE_BUS(dev) (dev >> 1)
  28 +
  29 +#ifdef CONFIG_IDE_LED
  30 +
  31 +/*
  32 + * LED Port
  33 + */
  34 +#define LED_PORT ((uchar *)(PER8_BASE + 0x3000))
  35 +#define LED_IDE1 0x01
  36 +#define LED_IDE2 0x02
  37 +#define DEVICE_LED(d) ((d & 2) | ((d & 2) == 0)) /* depends on bit positions! */
  38 +
  39 +#endif /* CONFIG_IDE_LED */
  40 +
  41 +/*
  42 + * Function Prototypes
  43 + */
  44 +
  45 +void ide_init (void);
  46 +ulong ide_read (int device, ulong blknr, ulong blkcnt, ulong *buffer);
  47 +ulong ide_write (int device, ulong blknr, ulong blkcnt, ulong *buffer);
  48 +
  49 +#endif /* _IDE_H */
  1 +#ifndef __KGDB_H__
  2 +#define __KGDB_H__
  3 +
  4 +#include <asm/ptrace.h>
  5 +
  6 +#define KGDBERR_BADPARAMS 1
  7 +#define KGDBERR_NOTHEXDIG 2
  8 +#define KGDBERR_MEMFAULT 3
  9 +#define KGDBERR_NOSPACE 4
  10 +#define KGDBERR_ALIGNFAULT 5
  11 +
  12 +#define KGDBDATA_MAXREGS 8
  13 +#define KGDBDATA_MAXPRIV 8
  14 +
  15 +#define KGDBEXIT_TYPEMASK 0xff
  16 +
  17 +#define KGDBEXIT_KILL 0
  18 +#define KGDBEXIT_CONTINUE 1
  19 +#define KGDBEXIT_SINGLE 2
  20 +
  21 +#define KGDBEXIT_WITHADDR 0x100
  22 +
  23 +typedef
  24 + struct {
  25 + int num;
  26 + unsigned long val;
  27 + }
  28 +kgdb_reg;
  29 +
  30 +typedef
  31 + struct {
  32 + int sigval;
  33 + int extype;
  34 + unsigned long exaddr;
  35 + int nregs;
  36 + kgdb_reg regs[KGDBDATA_MAXREGS];
  37 + unsigned long private[KGDBDATA_MAXPRIV];
  38 + }
  39 +kgdb_data;
  40 +
  41 +/* these functions are provided by the generic kgdb support */
  42 +extern void kgdb_init(void);
  43 +extern void kgdb_error(int);
  44 +extern int kgdb_output_string(const char *, unsigned int);
  45 +extern void breakpoint(void);
  46 +
  47 +/* these functions are provided by the platform specific kgdb support */
  48 +extern void kgdb_flush_cache_range(void *, void *);
  49 +extern void kgdb_flush_cache_all(void);
  50 +extern int kgdb_setjmp(long *);
  51 +extern void kgdb_longjmp(long *, int);
  52 +extern void kgdb_enter(struct pt_regs *, kgdb_data *);
  53 +extern void kgdb_exit(struct pt_regs *, kgdb_data *);
  54 +extern int kgdb_getregs(struct pt_regs *, char *, int);
  55 +extern void kgdb_putreg(struct pt_regs *, int, char *, int);
  56 +extern void kgdb_putregs(struct pt_regs *, char *, int);
  57 +extern int kgdb_trap(struct pt_regs *);
  58 +extern void kgdb_breakpoint(int argc, char *argv[]);
  59 +
  60 +/* these functions are provided by the platform serial driver */
  61 +extern void kgdb_serial_init(void);
  62 +extern int getDebugChar(void);
  63 +extern void putDebugChar(int);
  64 +extern void putDebugStr(const char *);
  65 +extern void kgdb_interruptible(int);
  66 +
  67 +/* this is referenced in the trap handler for the platform */
  68 +extern int (*debugger_exception_handler)(struct pt_regs *);
  69 +
  70 +#endif /* __KGDB_H__ */