Gru: add usb initial support
authorLiangfeng Wu <wulf@rock-chips.com>
Tue, 24 May 2016 11:35:46 +0000 (19:35 +0800)
committerchrome-bot <chrome-bot@chromium.org>
Fri, 27 May 2016 03:37:33 +0000 (20:37 -0700)
Gru can boot from USB2.0 host1 or both USB3.0
interfaces on rockchip rk3399 platform.

BRANCH=none
BUG=chrome-os-partner:52684
TEST=boot from USB

Change-Id: I649acc11d6821f3646f950ca387257b37a07f90e
Signed-off-by: Liangfeng Wu <wulf@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/346826
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
src/board/gru/board.c

index 680048d..081c944 100644 (file)
@@ -22,6 +22,7 @@
 #include "boot/fit.h"
 #include "config.h"
 #include "drivers/bus/spi/rockchip.h"
+#include "drivers/bus/usb/usb.h"
 #include "drivers/ec/cros/spi.h"
 #include "drivers/flash/spi.h"
 #include "drivers/flash/spi.h"
@@ -76,6 +77,24 @@ static int board_setup(void)
        list_insert_after(&sd_card->mmc.ctrlr.list_node,
                          &removable_block_dev_controllers);
 
+       /* Support USB20_HOST1 in firmware and USB20_HOST0 not needed. */
+       /* USB2.0-EHCI*/
+       UsbHostController *uhst1_ehci = new_usb_hc(EHCI, 0xfe3c0000);
+
+       list_insert_after(&uhst1_ehci->list_node, &usb_host_controllers);
+
+       /* USB2.0-OHCI */
+       UsbHostController *uhst1_ohci = new_usb_hc(OHCI, 0xfe3e0000);
+
+       list_insert_after(&uhst1_ohci->list_node, &usb_host_controllers);
+
+       /* Support both USB3.0 XHCI controllers in firmware. */
+       UsbHostController *uhst0_xhci = new_usb_hc(XHCI, 0xfe800000);
+       UsbHostController *uhst1_xhci = new_usb_hc(XHCI, 0xfe900000);
+
+       list_insert_after(&uhst0_xhci->list_node, &usb_host_controllers);
+       list_insert_after(&uhst1_xhci->list_node, &usb_host_controllers);
+
        return 0;
 }