2 * This file is part of the coreboot project.
4 * Copyright (C) 2007 AMD
5 * Written by Yinghai Lu <yinghai.lu@amd.com> for AMD.
7 * 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.
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.
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
21 #include "../lib/usbdebug.c"
25 void early_usbdebug_init(void)
27 struct ehci_debug_info *dbg_info = (struct ehci_debug_info *)
28 (CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE - sizeof(struct ehci_debug_info));
30 usbdebug_init(CONFIG_EHCI_BAR, CONFIG_EHCI_DEBUG_OFFSET, dbg_info);
33 void usbdebug_tx_byte(unsigned char data)
35 struct ehci_debug_info *dbg_info;
37 /* "Find" dbg_info structure in Cache */
38 dbg_info = (struct ehci_debug_info *)
39 (CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE - sizeof(struct ehci_debug_info));
41 if (dbg_info->ehci_debug) {
42 dbgp_bulk_write_x(dbg_info, (char*)&data, 1);
46 void usbdebug_ram_tx_byte(unsigned char data)
48 struct ehci_debug_info *dbg_info;
50 /* "Find" dbg_info structure in RAM */
51 dbg_info = (struct ehci_debug_info *)
52 ((CONFIG_RAMTOP) - sizeof(struct ehci_debug_info));
54 if (dbg_info->ehci_debug) {
55 dbgp_bulk_write_x(dbg_info, (char*)&data, 1);