mainboard: Add AMD unionstation RDK support
[coreboot.git] / src / console / usbdebug_console.c
index 2e71cc3ea3da9d522cde87fffaa6f29b2b4f8a12..a624b9dd21f409fd76f94a993ec9c2cf99020b24 100644 (file)
@@ -1,6 +1,9 @@
 /*
  * This file is part of the coreboot project.
  *
+ * Copyright (C) 2007 AMD
+ * Written by Yinghai Lu <yinghai.lu@amd.com> for AMD.
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2 of the License.
@@ -29,39 +32,31 @@ void set_ehci_base(unsigned ehci_base)
        if (!dbg_info.ehci_debug)
                return;
 
-       diff = dbg_info.ehci_caps - ehci_base;
+       diff = (unsigned)dbg_info.ehci_caps - ehci_base;
        dbg_info.ehci_regs -= diff;
        dbg_info.ehci_debug -= diff;
-       dbg_info.ehci_caps = ehci_base;
+       dbg_info.ehci_caps = (void*)ehci_base;
 }
 
 void set_ehci_debug(unsigned ehci_debug)
 {
-       dbg_info.ehci_debug = ehci_debug;
+       dbg_info.ehci_debug = (void*)ehci_debug;
 }
 
 unsigned get_ehci_debug(void)
 {
-       return dbg_info.ehci_debug;
+       return (unsigned)dbg_info.ehci_debug;
 }
 
 static void dbgp_init(void)
 {
-       struct ehci_debug_info *dbg_infox;
-
-       /* At this point, all we have to do is copy the fixed address
-        * debug_info data structure to our version defined above. */
-
-       dbg_infox = (struct ehci_debug_info *)
-               ((CONFIG_RAMTOP) - sizeof(struct ehci_debug_info));
-
-       memcpy(&dbg_info, dbg_infox, sizeof(struct ehci_debug_info));
+       usbdebug_init(CONFIG_EHCI_BAR, CONFIG_EHCI_DEBUG_OFFSET, &dbg_info);
 }
 
 static void dbgp_tx_byte(unsigned char data)
 {
        if (dbg_info.ehci_debug)
-               dbgp_bulk_write_x(&dbg_info, &data, 1);
+               dbgp_bulk_write_x(&dbg_info, (char*)&data, 1);
 }
 
 static unsigned char dbgp_rx_byte(void)
@@ -76,7 +71,7 @@ static unsigned char dbgp_rx_byte(void)
 
 static int dbgp_tst_byte(void)
 {
-       return dbg_info.ehci_debug;
+       return (int)dbg_info.ehci_debug;
 }
 
 static const struct console_driver usbdebug_direct_console __console = {