mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-02-15 04:42:02 +00:00
282 lines
8.3 KiB
Diff
282 lines
8.3 KiB
Diff
From cd6a45a41fb2c19884ac87afade87b4d53601929 Mon Sep 17 00:00:00 2001
|
|
From: Tom Rini <trini@konsulko.com>
|
|
Date: Sat, 25 Jun 2022 11:02:31 -0400
|
|
Subject: [PATCH] Convert CONFIG_USB_OHCI_NEW et al to Kconfig
|
|
|
|
This converts the following to Kconfig:
|
|
CONFIG_SYS_OHCI_SWAP_REG_ACCESS
|
|
CONFIG_SYS_USB_OHCI_CPU_INIT
|
|
CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS
|
|
CONFIG_SYS_USB_OHCI_SLOT_NAME
|
|
CONFIG_USB_ATMEL
|
|
CONFIG_USB_ATMEL_CLK_SEL_PLLB
|
|
CONFIG_USB_ATMEL_CLK_SEL_UPLL
|
|
CONFIG_USB_OHCI_LPC32XX
|
|
CONFIG_USB_OHCI_NEW
|
|
|
|
Signed-off-by: Tom Rini <trini@konsulko.com>
|
|
---
|
|
|
|
diff --git a/configs/evb-rk3328_defconfig b/configs/evb-rk3328_defconfig
|
|
index 4d6d235cb125..c81437300c74 100644
|
|
--- a/configs/evb-rk3328_defconfig
|
|
+++ b/configs/evb-rk3328_defconfig
|
|
@@ -99,6 +99,7 @@ CONFIG_USB_EHCI_HCD=y
|
|
CONFIG_USB_EHCI_GENERIC=y
|
|
CONFIG_USB_OHCI_HCD=y
|
|
CONFIG_USB_OHCI_GENERIC=y
|
|
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
|
|
CONFIG_USB_DWC2=y
|
|
CONFIG_USB_DWC3=y
|
|
# CONFIG_USB_DWC3_GADGET is not set
|
|
diff --git a/configs/nanopi-r2s-rk3328_defconfig b/configs/nanopi-r2s-rk3328_defconfig
|
|
index 41793ca7e486..15c2e1698c20 100644
|
|
--- a/configs/nanopi-r2s-rk3328_defconfig
|
|
+++ b/configs/nanopi-r2s-rk3328_defconfig
|
|
@@ -102,6 +102,7 @@ CONFIG_USB_EHCI_HCD=y
|
|
CONFIG_USB_EHCI_GENERIC=y
|
|
CONFIG_USB_OHCI_HCD=y
|
|
CONFIG_USB_OHCI_GENERIC=y
|
|
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
|
|
CONFIG_USB_DWC2=y
|
|
CONFIG_USB_DWC3=y
|
|
# CONFIG_USB_DWC3_GADGET is not set
|
|
diff --git a/configs/roc-cc-rk3328_defconfig b/configs/roc-cc-rk3328_defconfig
|
|
index ab25abc1a031..43b90c7879b7 100644
|
|
--- a/configs/roc-cc-rk3328_defconfig
|
|
+++ b/configs/roc-cc-rk3328_defconfig
|
|
@@ -108,6 +108,7 @@ CONFIG_USB_EHCI_HCD=y
|
|
CONFIG_USB_EHCI_GENERIC=y
|
|
CONFIG_USB_OHCI_HCD=y
|
|
CONFIG_USB_OHCI_GENERIC=y
|
|
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
|
|
CONFIG_USB_DWC2=y
|
|
CONFIG_USB_DWC3=y
|
|
# CONFIG_USB_DWC3_GADGET is not set
|
|
diff --git a/configs/rock-pi-e-rk3328_defconfig b/configs/rock-pi-e-rk3328_defconfig
|
|
index 1d51a267b93a..7d95e171f7f4 100644
|
|
--- a/configs/rock-pi-e-rk3328_defconfig
|
|
+++ b/configs/rock-pi-e-rk3328_defconfig
|
|
@@ -109,6 +109,7 @@ CONFIG_USB_EHCI_HCD=y
|
|
CONFIG_USB_EHCI_GENERIC=y
|
|
CONFIG_USB_OHCI_HCD=y
|
|
CONFIG_USB_OHCI_GENERIC=y
|
|
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
|
|
CONFIG_USB_DWC2=y
|
|
CONFIG_USB_DWC3=y
|
|
# CONFIG_USB_DWC3_GADGET is not set
|
|
diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig
|
|
index 640fe558d414..bc333a5e2a6a 100644
|
|
--- a/configs/rock64-rk3328_defconfig
|
|
+++ b/configs/rock64-rk3328_defconfig
|
|
@@ -106,6 +106,7 @@ CONFIG_USB_EHCI_HCD=y
|
|
CONFIG_USB_EHCI_GENERIC=y
|
|
CONFIG_USB_OHCI_HCD=y
|
|
CONFIG_USB_OHCI_GENERIC=y
|
|
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=1
|
|
CONFIG_USB_DWC2=y
|
|
CONFIG_USB_DWC3=y
|
|
# CONFIG_USB_DWC3_GADGET is not set
|
|
diff --git a/configs/rock960-rk3399_defconfig b/configs/rock960-rk3399_defconfig
|
|
index 78e50dbfbcb7..bb5b2143691d 100644
|
|
--- a/configs/rock960-rk3399_defconfig
|
|
+++ b/configs/rock960-rk3399_defconfig
|
|
@@ -74,6 +74,7 @@ CONFIG_USB_EHCI_HCD=y
|
|
CONFIG_USB_EHCI_GENERIC=y
|
|
CONFIG_USB_OHCI_HCD=y
|
|
CONFIG_USB_OHCI_GENERIC=y
|
|
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
|
|
CONFIG_USB_DWC3=y
|
|
CONFIG_USB_KEYBOARD=y
|
|
CONFIG_USB_HOST_ETHER=y
|
|
diff --git a/configs/rockpro64-rk3399_defconfig b/configs/rockpro64-rk3399_defconfig
|
|
index 4d2a5b32e31c..ef28fe6a937a 100644
|
|
--- a/configs/rockpro64-rk3399_defconfig
|
|
+++ b/configs/rockpro64-rk3399_defconfig
|
|
@@ -87,6 +87,7 @@ CONFIG_USB_EHCI_HCD=y
|
|
CONFIG_USB_EHCI_GENERIC=y
|
|
CONFIG_USB_OHCI_HCD=y
|
|
CONFIG_USB_OHCI_GENERIC=y
|
|
+CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
|
|
CONFIG_USB_DWC3=y
|
|
CONFIG_USB_DWC3_GENERIC=y
|
|
CONFIG_USB_KEYBOARD=y
|
|
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
|
|
index 0b82c2fdaf71..31ae9f74e7ac 100644
|
|
--- a/drivers/usb/host/Kconfig
|
|
+++ b/drivers/usb/host/Kconfig
|
|
@@ -297,10 +297,17 @@ config USB_EHCI_TXFIFO_THRESH
|
|
Enables support for the on-chip EHCI controller on FSL chips.
|
|
endif # USB_EHCI_HCD
|
|
|
|
+config USB_OHCI_NEW
|
|
+ bool
|
|
+
|
|
+config SYS_USB_OHCI_CPU_INIT
|
|
+ bool
|
|
+
|
|
config USB_OHCI_HCD
|
|
bool "OHCI HCD (USB 1.1) support"
|
|
depends on DM && OF_CONTROL
|
|
select USB_HOST
|
|
+ select USB_OHCI_NEW
|
|
---help---
|
|
The Open Host Controller Interface (OHCI) is a standard for accessing
|
|
USB 1.1 host controller hardware. It does more in hardware than Intel's
|
|
@@ -332,6 +339,19 @@ config USB_OHCI_DA8XX
|
|
|
|
endif # USB_OHCI_HCD
|
|
|
|
+config SYS_USB_OHCI_SLOT_NAME
|
|
+ string "Display name for the OHCI controller"
|
|
+ depends on USB_OHCI_NEW && !DM_USB
|
|
+
|
|
+config SYS_USB_OHCI_MAX_ROOT_PORTS
|
|
+ int "Maximal number of ports of the root hub"
|
|
+ depends on USB_OHCI_NEW
|
|
+ default 1 if ARCH_SUNXI
|
|
+
|
|
+config SYS_OHCI_SWAP_REG_ACCESS
|
|
+ bool "Perform byte swapping on OHCI controller register accesses"
|
|
+ depends on USB_OHCI_NEW
|
|
+
|
|
config USB_UHCI_HCD
|
|
bool "UHCI HCD (most Intel and VIA) support"
|
|
select USB_HOST
|
|
@@ -381,3 +401,27 @@ config USB_R8A66597_HCD
|
|
---help---
|
|
This enables support for the on-chip Renesas R8A66597 USB 2.0
|
|
controller, present in various RZ and SH SoCs.
|
|
+
|
|
+config USB_ATMEL
|
|
+ bool "AT91 OHCI USB support"
|
|
+ depends on ARCH_AT91
|
|
+ select SYS_USB_OHCI_CPU_INIT
|
|
+ select USB_OHCI_NEW
|
|
+
|
|
+choice
|
|
+ prompt "Clock for OHCI"
|
|
+ depends on USB_ATMEL
|
|
+
|
|
+config USB_ATMEL_CLK_SEL_PLLB
|
|
+ bool "PLLB"
|
|
+
|
|
+config USB_ATMEL_CLK_SEL_UPLL
|
|
+ bool "UPLL"
|
|
+
|
|
+endchoice
|
|
+
|
|
+config USB_OHCI_LPC32XX
|
|
+ bool "LPC32xx USB OHCI support"
|
|
+ depends on ARCH_LPC32XX
|
|
+ select SYS_USB_OHCI_CPU_INIT
|
|
+ select USB_OHCI_NEW
|
|
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
|
|
index 8ceabaf45c1b..9b955c1bd678 100644
|
|
--- a/drivers/usb/host/ohci-at91.c
|
|
+++ b/drivers/usb/host/ohci-at91.c
|
|
@@ -5,9 +5,6 @@
|
|
*/
|
|
|
|
#include <common.h>
|
|
-
|
|
-#if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT)
|
|
-
|
|
#include <asm/arch/clk.h>
|
|
|
|
int usb_cpu_init(void)
|
|
@@ -65,5 +62,3 @@ int usb_cpu_init_fail(void)
|
|
{
|
|
return usb_cpu_stop();
|
|
}
|
|
-
|
|
-#endif /* defined(CONFIG_USB_OHCI) && defined(CONFIG_SYS_USB_OHCI_CPU_INIT) */
|
|
diff --git a/drivers/usb/host/ohci-generic.c b/drivers/usb/host/ohci-generic.c
|
|
index 163f0ef17b11..5d23058aaf6a 100644
|
|
--- a/drivers/usb/host/ohci-generic.c
|
|
+++ b/drivers/usb/host/ohci-generic.c
|
|
@@ -14,10 +14,6 @@
|
|
#include <reset.h>
|
|
#include "ohci.h"
|
|
|
|
-#if !defined(CONFIG_USB_OHCI_NEW)
|
|
-# error "Generic OHCI driver requires CONFIG_USB_OHCI_NEW"
|
|
-#endif
|
|
-
|
|
struct generic_ohci {
|
|
ohci_t ohci;
|
|
struct clk *clocks; /* clock list */
|
|
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
|
|
index a38cd25eb85f..7699f2e6b15a 100644
|
|
--- a/drivers/usb/host/ohci.h
|
|
+++ b/drivers/usb/host/ohci.h
|
|
@@ -151,7 +151,7 @@ struct ohci_hcca {
|
|
* Maximum number of root hub ports.
|
|
*/
|
|
#ifndef CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS
|
|
-# error "CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS undefined!"
|
|
+#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
|
|
#endif
|
|
|
|
/*
|
|
diff --git a/include/configs/evb_rk3399.h b/include/configs/evb_rk3399.h
|
|
index 492b7b4df128..b7e850370b31 100644
|
|
--- a/include/configs/evb_rk3399.h
|
|
+++ b/include/configs/evb_rk3399.h
|
|
@@ -15,7 +15,4 @@
|
|
|
|
#define SDRAM_BANK_SIZE (2UL << 30)
|
|
|
|
-#define CONFIG_USB_OHCI_NEW
|
|
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
|
|
-
|
|
#endif
|
|
diff --git a/include/configs/gru.h b/include/configs/gru.h
|
|
index b1084bb21d4d..be2dc79968c0 100644
|
|
--- a/include/configs/gru.h
|
|
+++ b/include/configs/gru.h
|
|
@@ -13,7 +13,4 @@
|
|
|
|
#include <configs/rk3399_common.h>
|
|
|
|
-#define CONFIG_USB_OHCI_NEW
|
|
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
|
|
-
|
|
#endif
|
|
diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h
|
|
index 90183579202d..165b78ff3309 100644
|
|
--- a/include/configs/rk3328_common.h
|
|
+++ b/include/configs/rk3328_common.h
|
|
@@ -30,8 +30,4 @@
|
|
"partitions=" PARTS_DEFAULT \
|
|
BOOTENV
|
|
|
|
-/* rockchip ohci host driver */
|
|
-#define CONFIG_USB_OHCI_NEW
|
|
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
|
|
-
|
|
#endif
|
|
diff --git a/include/configs/rock960_rk3399.h b/include/configs/rock960_rk3399.h
|
|
index 2edad710284f..6099d2fa55a6 100644
|
|
--- a/include/configs/rock960_rk3399.h
|
|
+++ b/include/configs/rock960_rk3399.h
|
|
@@ -14,7 +14,4 @@
|
|
#include <configs/rk3399_common.h>
|
|
|
|
#define SDRAM_BANK_SIZE (2UL << 30)
|
|
-
|
|
-#define CONFIG_USB_OHCI_NEW
|
|
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
|
|
#endif
|
|
diff --git a/include/configs/rockpro64_rk3399.h b/include/configs/rockpro64_rk3399.h
|
|
index 903e9df527c1..9195b9b99e41 100644
|
|
--- a/include/configs/rockpro64_rk3399.h
|
|
+++ b/include/configs/rockpro64_rk3399.h
|
|
@@ -14,7 +14,4 @@
|
|
#include <configs/rk3399_common.h>
|
|
|
|
#define SDRAM_BANK_SIZE (2UL << 30)
|
|
-
|
|
-#define CONFIG_USB_OHCI_NEW
|
|
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
|
|
#endif
|