newconfig is no more.
[coreboot.git] / src / pc80 / usbdebug_direct_serial.c
1 /*
2  * This file is part of the coreboot project.
3  *
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.
7  *
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.
12  *
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
16  */
17
18 #include <part/fallback_boot.h>
19 #include "../lib/usbdebug_direct.c"
20
21 static void early_usbdebug_direct_init(void)
22 {
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));
25
26         usbdebug_direct_init(EHCI_BAR, EHCI_DEBUG_OFFSET, dbg_info);
27 }
28
29 void usbdebug_direct_tx_byte(unsigned char data)
30 {
31         struct ehci_debug_info *dbg_info;
32
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));
36
37         if (dbg_info->ehci_debug) {
38                 dbgp_bulk_write_x(dbg_info, &data, 1);
39         }
40 }
41
42 void usbdebug_direct_ram_tx_byte(unsigned char data)
43 {
44         struct ehci_debug_info *dbg_info;
45
46         /* "Find" dbg_info structure in RAM */
47         dbg_info = (struct ehci_debug_info *)
48             ((CONFIG_RAMTOP) - sizeof(struct ehci_debug_info));
49
50         if (dbg_info->ehci_debug) {
51                 dbgp_bulk_write_x(dbg_info, &data, 1);
52         }
53 }