blob: a7ab21fd27a9a94f55a0d2ab9cb3e67f16ea0d4f [file] [log] [blame]
Stefan Reinauerbb01f602009-07-21 21:20:45 +00001/*
2 * This file is part of the coreboot project.
3 *
Uwe Hermann06694a82010-09-23 18:16:46 +00004 * Copyright (C) 2007 AMD
5 * Written by Yinghai Lu <yinghai.lu@amd.com> for AMD.
6 *
Stefan Reinauerbb01f602009-07-21 21:20:45 +00007 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
19 */
20
Stefan Reinauer56394482010-05-25 16:02:28 +000021#ifndef USBDEBUG_H
22#define USBDEBUG_H
Yinghai Lud57241f2007-02-28 11:17:02 +000023
Myles Watson127e9762010-08-04 19:29:11 +000024#include <ehci.h>
25
Yinghai Lud57241f2007-02-28 11:17:02 +000026struct ehci_debug_info {
27 void *ehci_caps;
28 void *ehci_regs;
29 void *ehci_debug;
Stefan Reinauer16ce01b2011-01-28 08:05:54 +000030 u32 devnum;
31 u32 endpoint_out;
32 u32 endpoint_in;
Yinghai Lud57241f2007-02-28 11:17:02 +000033};
Stefan Reinauerbb01f602009-07-21 21:20:45 +000034
Sven Schnelle20fc6312011-10-30 09:57:35 +010035#ifndef __ROMCC__
36void enable_usbdebug(unsigned int port);
Stefan Reinauer7e16bf32009-04-21 23:05:13 +000037int dbgp_bulk_write_x(struct ehci_debug_info *dbg_info, const char *bytes, int size);
38int dbgp_bulk_read_x(struct ehci_debug_info *dbg_info, void *data, int size);
39void set_ehci_base(unsigned ehci_base);
Stefan Reinauer16ce01b2011-01-28 08:05:54 +000040void set_ehci_debug(unsigned ehci_debug);
Stefan Reinauer7e16bf32009-04-21 23:05:13 +000041unsigned get_ehci_debug(void);
42void set_debug_port(unsigned port);
Stefan Reinauer16ce01b2011-01-28 08:05:54 +000043int early_usbdebug_init(void);
Myles Watson127e9762010-08-04 19:29:11 +000044void usbdebug_tx_byte(unsigned char data);
Sven Schnelle20fc6312011-10-30 09:57:35 +010045int usbdebug_init(unsigned ehci_bar, unsigned offset, struct ehci_debug_info *info);
46#endif
Yinghai Lud57241f2007-02-28 11:17:02 +000047#endif