2 * This file is part of the coreboot project.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
18 #include <part/fallback_boot.h>
19 #include "../lib/usbdebug_direct.c"
21 static void early_usbdebug_direct_init(void)
23 struct ehci_debug_info *dbg_info = (struct ehci_debug_info *)
24 (CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE - sizeof(struct ehci_debug_info));
26 usbdebug_direct_init(EHCI_BAR, EHCI_DEBUG_OFFSET, dbg_info);
29 void usbdebug_direct_tx_byte(unsigned char data)
31 struct ehci_debug_info *dbg_info;
33 /* "Find" dbg_info structure in Cache */
34 dbg_info = (struct ehci_debug_info *)
35 (CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE - sizeof(struct ehci_debug_info));
37 if (dbg_info->ehci_debug) {
38 dbgp_bulk_write_x(dbg_info, &data, 1);
42 void usbdebug_direct_ram_tx_byte(unsigned char data)
44 struct ehci_debug_info *dbg_info;
46 /* "Find" dbg_info structure in RAM */
47 dbg_info = (struct ehci_debug_info *)
48 ((CONFIG_RAMTOP) - sizeof(struct ehci_debug_info));
50 if (dbg_info->ehci_debug) {
51 dbgp_bulk_write_x(dbg_info, &data, 1);