usbdebug: Refactor disable logic
Output to usbdebug console needs to be disabled until hardware is
initialized and while EHCI BAR is relocated. Add separate field
ehci_info to point to back to EHCI context when hardware is ready
to transfer data.
Change-Id: If7d441b561819ab8ae23ed9f3f320f7742ed231e
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/3624
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@google.com>
diff --git a/src/include/usbdebug.h b/src/include/usbdebug.h
index 990312a..fe4ef32 100644
--- a/src/include/usbdebug.h
+++ b/src/include/usbdebug.h
@@ -49,16 +49,20 @@
u32 endpoint_in;
char buf[8];
u8 bufidx;
+ u8 status;
};
+#define DBGP_EP_VALID (1<<0)
+#define DBGP_EP_ENABLED (1<<1)
+#define DBGP_EP_STATMASK (DBGP_EP_VALID | DBGP_EP_ENABLED)
+
void enable_usbdebug(unsigned int port);
int dbgp_bulk_write_x(struct ehci_debug_info *dbg_info, const char *bytes, int size);
int dbgp_bulk_read_x(struct ehci_debug_info *dbg_info, void *data, int size);
-void set_ehci_base(unsigned ehci_base);
-void set_ehci_debug(unsigned ehci_debug);
-unsigned get_ehci_debug(void);
void set_debug_port(unsigned port);
int early_usbdebug_init(void);
+
+int dbgp_ep_is_active(struct ehci_debug_info *dbg_info);
void usbdebug_tx_byte(struct ehci_debug_info *info, unsigned char data);
void usbdebug_tx_flush(struct ehci_debug_info *info);
int usbdebug_init(unsigned ehci_bar, unsigned offset, struct ehci_debug_info *info);