summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2016-07-14 12:28:14 (GMT)
committerRomain Perier <romain.perier@collabora.com>2017-07-13 08:05:41 (GMT)
commita7cef2a5e50c8d795304989e7331826aeda149b6 (patch)
treebd4407d854c268770a4e76725006c1b8c6d1aebc
parent6341dd72eaae5b576b425fe7b885f11aedcdc1e4 (diff)
downloadu-boot-rockchip-a7cef2a5e50c8d795304989e7331826aeda149b6.tar.gz
u-boot-rockchip-a7cef2a5e50c8d795304989e7331826aeda149b6.tar.xz
hacks to make Radxa Rock work with usb ethernet and usb storage
Signed-off-by: Romain Perier <romain.perier@collabora.com>
-rw-r--r--configs/rock_defconfig12
-rw-r--r--drivers/usb/host/dwc2.c4
-rw-r--r--include/configs/rock.h47
3 files changed, 61 insertions, 2 deletions
diff --git a/configs/rock_defconfig b/configs/rock_defconfig
index 5d9b63b..81a28f6 100644
--- a/configs/rock_defconfig
+++ b/configs/rock_defconfig
@@ -50,3 +50,15 @@ CONFIG_SYSRESET=y
CONFIG_SPL_TINY_MEMSET=y
CONFIG_CMD_DHRYSTONE=y
CONFIG_ERRNO_STR=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_CMD_USB=y
+CONFIG_USB_DWC2=y
+CONFIG_USB_HOST_ETHER=y
+CONFIG_USB_ETHER_ASIX=y
+CONFIG_CMD_NET=y
+CONFIG_BOOTP_SUBNETMASK=y
+CONFIG_BOOTP_GATEWAY=y
+CONFIG_FIT=y
+CONFIG_SPL_FIT=y
+CONFIG_FIT_VERBOSE=y
diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index 64c42ac..746c891 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -267,10 +267,10 @@ static void dwc_otg_core_host_init(struct udevice *dev,
clrsetbits_le32(&regs->hc_regs[i].hcchar,
DWC2_HCCHAR_EPDIR,
DWC2_HCCHAR_CHEN | DWC2_HCCHAR_CHDIS);
- ret = wait_for_bit(__func__, &regs->hc_regs[i].hcchar,
+/* ret = wait_for_bit(__func__, &regs->hc_regs[i].hcchar,
DWC2_HCCHAR_CHEN, false, 1000, false);
if (ret)
- printf("%s: Timeout!\n", __func__);
+ printf("%s: Timeout!\n", __func__);*/
}
/* Turn on the vbus power. */
diff --git a/include/configs/rock.h b/include/configs/rock.h
index de5291c..05642da 100644
--- a/include/configs/rock.h
+++ b/include/configs/rock.h
@@ -10,6 +10,8 @@
#define ROCKCHIP_DEVICE_SETTINGS
#include <configs/rk3188_common.h>
+#define CONFIG_SYS_DCACHE_OFF
+
#define CONFIG_ENV_IS_IN_MMC
#define CONFIG_SYS_MMC_ENV_DEV 0
@@ -27,4 +29,49 @@
#define CONFIG_ENV_OFFSET (96 * 1024)
#endif
+#ifndef CONFIG_SPL_BUILD
+
+#undef CONFIG_BOOTARGS
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "fdt_high=0x7fffffff\0" \
+ "initrd_high=0x7fffffff\0" \
+ "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+ "fdt_addr_r=0x60790000\0" \
+ "bootargs=earlyprintk console=ttyS2,115200n8 root=/dev/nfs nfsroot=10.42.0.1:/home/srv/nfs-debian,tcp,vers=4 nfsrootdebug rw ip=dhcp\0" \
+
+#endif
+
+/* USB */
+#define CONFIG_USB_DWC2
+#define CONFIG_USB_HOST_ETHER /* Enable USB Ethernet adapters */
+
+#define CONFIG_USB_ETHER_ASIX
+
+#define CONFIG_BOOTP_SUBNETMASK
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+#define CONFIG_BOOTP_BOOTPATH
+
+/* Enable atags */
+#define CONFIG_SYS_BOOTPARAMS_LEN (64*1024)
+#define CONFIG_INITRD_TAG
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_CMDLINE_TAG
+
+
+/*#define CONFIG_IPADDR 10.0.0.2 (replace with your value)
+*/
+#define CONFIG_SERVERIP 192.168.140.1
+#define CONFIG_BOOTFILE "hstuebner/rock.vmlinuz"
+
+#undef CONFIG_BOOTCOMMAND
+#define CONFIG_BOOTCOMMAND \
+ "regulator dev host-pwr; " \
+ "regulator enable; " \
+ "usb start; " \
+ "ext4load usb 0:1 $loadaddr /zImage;" \
+ "ext4load usb 0:1 $fdt_addr_r /rk3188-radxarock.dtb;" \
+ "bootz ${loadaddr} - ${fdt_addr_r}; " \
+
#endif