mips/usb: Add Octeon xHCI USB support
Subsystems (3)
cover mips/usb: Add Octeon xHCI USB support
This patchset adds xHCI USB support for MIPS Octeon. After the xHCI code has been fixed to support mapped addresses (virt != phys), this patchset now adds the missing code pieces to enable USB support on Octeon. This is mainly the USB glue code for Octeon and the MIPS platform specific changes (cache fixes, platform specific swapping based on address areas, DT & defcopnfig changes).
Thanks,
Stefan
Stefan Roese (8):
usb: xhci: xhci-dwc3.c: Use dev_remap_addr() instead of dev_get_addr()
usb: xhci: xhci_bulk_tx: Don't "BUG" when comparing addresses on
Octeon
usb: xhci: octeon: Add DWC3 glue layer for Octeon
mips: octeon: cpu.c: Add table for selective swapping
mips: octeon: Add mangle-port.h
mips: octeon: cache.c: Flush all pending writes in
flush_dcache_range()
mips: octeon: Add USB DT nodes
mips: octeon: octeon_ebb7304_defconfig: Enable USB support
arch/mips/dts/mrvl,cn73xx.dtsi | 58 +++ arch/mips/dts/mrvl,octeon-ebb7304.dts | 22 ++ arch/mips/mach-octeon/cache.c | 12 +- arch/mips/mach-octeon/cpu.c | 21 ++ arch/mips/mach-octeon/include/mangle-port.h | 58 +++ configs/octeon_ebb7304_defconfig | 17 + drivers/usb/host/Kconfig | 9 + drivers/usb/host/Makefile | 1 + drivers/usb/host/dwc3-octeon-glue.c | 396 ++++++++++++++++++++ drivers/usb/host/xhci-dwc3.c | 2 +- drivers/usb/host/xhci-ring.c | 7 +- 11 files changed, 594 insertions(+), 9 deletions(-) create mode 100644 arch/mips/mach-octeon/include/mangle-port.h create mode 100644 drivers/usb/host/dwc3-octeon-glue.c
Signature · 1 line
2.28.0
PATCH 1/8 usb: xhci: xhci-dwc3.c: Use dev_remap_addr() instead of dev_get_addr()
On MIPS platforms, mapping of the base address is needed. This patch switches from dev_get_addr() to dev_remap_addr() to get the mapped base address of the xHCI controller.
---
drivers/usb/host/xhci-dwc3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-dwc3.c +1 -1
@@ -122,7 +122,7 @@ static int xhci_dwc3_probe(struct udevice *dev)u32 reg;int ret; - hccr = (struct xhci_hccr *)((uintptr_t )dev_read_addr (dev)); + hccr = (struct xhci_hccr *)((uintptr_t )dev_remap_addr (dev)); hcor = (struct xhci_hcor *)((uintptr_t )hccr +HC_LENGTH (xhci_readl (&(hccr)->cr_capbase)));
Signature · 1 line
2.28.0
PATCH 2/8 usb: xhci: xhci_bulk_tx: Don't "BUG" when comparing addresses on Octeon
In reply to Stefan RoeseOcteon uses mapped addresses for virtual and physical memory. Its not that easy to calculate the resulting addresses here. So lets remove this BUG_ON() for Octeon in xhci_bulk_tx().
---
drivers/usb/host/xhci-ring.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/usb/host/xhci-ring.c +5 -2
@@ -726,8 +726,11 @@ int xhci_bulk_tx(struct usb_device *udev, unsigned long pipe,BUG_ON (TRB_TO_SLOT_ID (field) != slot_id);BUG_ON (TRB_TO_EP_INDEX (field) != ep_index); -BUG_ON (*(void **)(uintptr_t )le64_to_cpu (event->trans_event.buffer) - - buffer > (size_t )length); +if (!IS_ENABLED (CONFIG_ARCH_OCTEON )) { +BUG_ON (*(void **)(uintptr_t )le64_to_cpu ( + event->trans_event.buffer) - buffer > + (size_t )length); + }record_transfer_result (udev, event, length);xhci_acknowledge_event (ctrl);
Signature · 1 line
2.28.0
PATCH 2/8 usb: xhci: xhci_bulk_tx: Don't "BUG" when comparing addresses on Octeon
Am Montag, den 17.08.2020, 15:06 +0200 schrieb Stefan Roese:
Quoted 17 lines
Octeon uses mapped addresses for virtual and physical memory. Its not that easy to calculate the resulting addresses here. So lets remove this
BUG_ON()for Octeon inxhci_bulk_tx().Signed-off-by Stefan Roese <[email protected]>Cc Bin Meng <[email protected]>Cc Marek Vasut <[email protected]>---
drivers/usb/host/xhci-ring.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/usb/host/xhci-ring.c +0
-0
drivers/usb/host/xhci-ring.c int xhci_bulk_tx(struct usb_device *udev, unsigned long pipe, · line 733
Quoted 10 lines
drivers/usb/host/xhci-ring.c +5
-2@@ -726,8 +726,11 @@ int xhci_bulk_tx(struct usb_device *udev, unsigned long pipe,BUG_ON (TRB_TO_SLOT_ID (field) != slot_id);BUG_ON (TRB_TO_EP_INDEX (field) != ep_index); -BUG_ON (*(void **)(uintptr_t )le64_to_cpu (event->trans_event.buffer) - - buffer > (size_t )length); +if (!IS_ENABLED (CONFIG_ARCH_OCTEON )) { +BUG_ON (*(void **)(uintptr_t )le64_to_cpu ( + event->trans_event.buffer) - buffer > + (size_t )length); + }
why not remove the check? Or add at least a generic Kconfig option for special handling on archs with memory remapping. Arch or SoC specific config options in generic code are bad ;)
Quoted 3 lines
drivers/usb/host/xhci-ring.c +0
-0record_transfer_result (udev, event, length);xhci_acknowledge_event (ctrl);
Signature · 1 line
- Daniel
PATCH 2/8 usb: xhci: xhci_bulk_tx: Don't "BUG" when comparing addresses on Octeon
Quoted 19 lines · Daniel Schwierzeck
Am Montag, den 17.08.2020, 15:06 +0200 schrieb Stefan Roese:
Quoted 18 lines
Octeon uses mapped addresses for virtual and physical memory. Its not that easy to calculate the resulting addresses here. So lets remove this
BUG_ON()for Octeon inxhci_bulk_tx().Signed-off-by Stefan Roese <[email protected]>Cc Bin Meng <[email protected]>Cc Marek Vasut <[email protected]>---
drivers/usb/host/xhci-ring.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/usb/host/xhci-ring.c +0
-0@@ -726,8 +726,11 @@ int xhci_bulk_tx(struct usb_device *udev, unsigned long pipe,
Quoted 13 lines
drivers/usb/host/xhci-ring.c int xhci_bulk_tx(struct usb_device *udev, unsigned long pipe, · line 733
Quoted 9 lines
drivers/usb/host/xhci-ring.c +5
-2BUG_ON (TRB_TO_SLOT_ID (field) != slot_id);BUG_ON (TRB_TO_EP_INDEX (field) != ep_index); -BUG_ON (*(void **)(uintptr_t )le64_to_cpu (event->trans_event.buffer) - - buffer > (size_t )length); +if (!IS_ENABLED (CONFIG_ARCH_OCTEON )) { +BUG_ON (*(void **)(uintptr_t )le64_to_cpu ( + event->trans_event.buffer) - buffer > + (size_t )length); + }why not remove the check? Or add at least a generic
Kconfigoption for special handling on archs with memory remapping. Arch or SoC specific config options in generic code are bad ;)
Yes, I agree. I was also thinking about removing this check completely. I'm not 100% sure, but I think that some (most?) of these BUG_ON() macros have been removed from the Linux kernel.
To not make too many changes, I'll change this patch in the next version to just remove this one BUG_ON().
Thanks,
Stefan
PATCH 3/8 usb: xhci: octeon: Add DWC3 glue layer for Octeon
In reply to Stefan RoeseThis patch adds the glue layer for the MIPS Octeon SoCs. Its ported mainly from the Linux code.
---
drivers/usb/host/Kconfig | 9 + drivers/usb/host/Makefile | 1 + drivers/usb/host/dwc3-octeon-glue.c | 396 ++++++++++++++++++++++++++++ 3 files changed, 406 insertions(+) create mode 100644 drivers/usb/host/dwc3-octeon-glue.c
drivers/usb/host/Kconfig +9 -0
@@ -46,6 +46,15 @@ config USB_XHCI_MVEBU SoCs, which includes Armada8K, Armada3700 and other Armada family SoCs. +config USB_XHCI_OCTEON + bool "Support for Marvell Octeon family on-chip xHCI USB controller" + depends on ARCH_OCTEON + default y + help + Enables support for the on-chip xHCI controller on Marvell Octeon + family SoCs. This is a driver for the dwc3 to provide the glue logic + to configure the controller. + config USB_XHCI_PCI bool "Support for PCI-based xHCI USB controller" depends on DM_USB
drivers/usb/host/Makefile +1 -0
@@ -56,6 +56,7 @@ obj-$(CONFIG_USB_XHCI_OMAP) += xhci-omap.o obj-$(CONFIG_USB_XHCI_PCI) += xhci-pci.o obj-$(CONFIG_USB_XHCI_RCAR) += xhci-rcar.o obj-$(CONFIG_USB_XHCI_STI) += dwc3-sti-glue.o +obj-$(CONFIG_USB_XHCI_OCTEON) += dwc3-octeon-glue.o # designware obj-$(CONFIG_USB_DWC2) += dwc2.o
drivers/usb/host/dwc3-octeon-glue.c new file +396 -0
396 lines not on this page · raw message
Signature · 1 line
2.28.0
PATCH 4/8 mips: octeon: cpu.c: Add table for selective swapping
In reply to Stefan RoeseImport octeon_should_swizzle_table[] which is needed for the area specific swapping. It will be used by the platform specific mangle-port.h header.
Imported from Linux v5.7.
---
arch/mips/mach-octeon/cpu.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
arch/mips/mach-octeon/cpu.c +21 -0
@@ -13,6 +13,27 @@DECLARE_GLOBAL_DATA_PTR ; +/* +* TRUE for devices having registers with little-endian byte +* order, FALSE for registers with native-endian byte order. +* PCI mandates little-endian, USB and SATA are configurable, +* but we chose little-endian for these. +* +* This table will be referened in the Octeon platform specific +* mangle-port.h header. +*/ +const bool octeon_should_swizzle_table[256 ] = { + [0x00 ] = true,/* bootbus/CF */ + [0x1b ] = true,/* PCI mmio window */ + [0x1c ] = true,/* PCI mmio window */ + [0x1d ] = true,/* PCI mmio window */ + [0x1e ] = true,/* PCI mmio window */ + [0x68 ] = true,/* OCTEON III USB */ + [0x69 ] = true,/* OCTEON III USB */ + [0x6c ] = true,/* OCTEON III SATA */ + [0x6f ] = true,/* OCTEON II USB */ +}; +static int get_clocks (void ) {const u64 ref_clock =PLL_REF_CLK ;
Signature · 1 line
2.28.0
PATCH 5/8 mips: octeon: Add mangle-port.h
In reply to Stefan RoeseImport platform specific mangle-port.h header, allowing a area specific swapping, which is needed on Octeon for USB & PCI areas.
Imported from Linux v5.7.
---
arch/mips/mach-octeon/include/mangle-port.h | 58 +++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 arch/mips/mach-octeon/include/mangle-port.h
arch/mips/mach-octeon/include/mangle-port.h new file +58 -0
@@ -0,0 +1,58 @@ +/* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +* +* Copyright (C) 2003, 2004 Ralf Baechle +*/ +#ifndef __ASM_MACH_GENERIC_MANGLE_PORT_H +#define __ASM_MACH_GENERIC_MANGLE_PORT_H + +#include <asm/byteorder.h> + +#ifdef __BIG_ENDIAN + +static inline bool __should_swizzle_bits (volatile void *a) +{ +extern const bool octeon_should_swizzle_table[]; +u64 did = ((u64 )(uintptr_t )a >>40 ) &0xff ; + +return octeon_should_swizzle_table[did]; +} + +# define __swizzle_addr_b (port) (port) +# define __swizzle_addr_w (port) (port) +# define __swizzle_addr_l (port) (port) +# define __swizzle_addr_q (port) (port) + +#else /* __LITTLE_ENDIAN */ + +#define __should_swizzle_bits (a) false + +static inline bool __should_swizzle_addr (u64 p) +{ +/* boot bus? */ +return ((p >>40 ) &0xff ) ==0 ; +} + +# define __swizzle_addr_b (port) \ + (__should_swizzle_addr(port) ? (port) ^ 7 : (port)) +# define __swizzle_addr_w (port) \ + (__should_swizzle_addr(port) ? (port) ^ 6 : (port)) +# define __swizzle_addr_l (port) \ + (__should_swizzle_addr(port) ? (port) ^ 4 : (port)) +# define __swizzle_addr_q (port) (port) + +#endif /* __BIG_ENDIAN */ + + +# define ioswabb (a, x) (x) +# define __mem_ioswabb (a, x) (x) +# define ioswabw (a, x) (__should_swizzle_bits(a) ? le16_to_cpu(x) : x) +# define __mem_ioswabw (a, x) (x) +# define ioswabl (a, x) (__should_swizzle_bits(a) ? le32_to_cpu(x) : x) +# define __mem_ioswabl (a, x) (x) +# define ioswabq (a, x) (__should_swizzle_bits(a) ? le64_to_cpu(x) : x) +# define __mem_ioswabq (a, x) (x) + +#endif /* __ASM_MACH_GENERIC_MANGLE_PORT_H */
Signature · 1 line
2.28.0
PATCH 5/8 mips: octeon: Add mangle-port.h
Am Montag, den 17.08.2020, 15:06 +0200 schrieb Stefan Roese:
Quoted 18 lines
Import platform specific
mangle-port.hheader, allowing a area specific swapping, which is needed on Octeon for USB & PCI areas.Imported from Linux v5.7.
Signed-off-by Stefan Roese <[email protected]>---
arch/mips/mach-octeon/include/mangle-port.h | 58 +++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 arch/mips/mach-octeon/include/mangle-port.harch/mips/mach-octeon/include/mangle-port.h new file +0
-0
arch/mips/mach-octeon/include/mangle-port.h line 7
Quoted 7 lines
arch/mips/mach-octeon/include/mangle-port.h new file +7
-0@@ -0,0 +1,58 @@ +/* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive +* for more details. +* +* Copyright (C) 2003, 2004 Ralf Baechle +*/
when importing headers from Linux, please remove the license text and just keep copyrights and optionally additonal info text. At the top insert the SPDX identifier, e.g.
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (C) 2003, 2004 Ralf Baechle
*/
Quoted 51 lines
arch/mips/mach-octeon/include/mangle-port.h new file +51
-0+#ifndef __ASM_MACH_GENERIC_MANGLE_PORT_H +#define __ASM_MACH_GENERIC_MANGLE_PORT_H + +#include <asm/byteorder.h> + +#ifdef __BIG_ENDIAN + +static inline bool __should_swizzle_bits (volatile void *a) +{ +extern const bool octeon_should_swizzle_table[]; +u64 did = ((u64 )(uintptr_t )a >>40 ) &0xff ; + +return octeon_should_swizzle_table[did]; +} + +# define __swizzle_addr_b (port) (port) +# define __swizzle_addr_w (port) (port) +# define __swizzle_addr_l (port) (port) +# define __swizzle_addr_q (port) (port) + +#else /* __LITTLE_ENDIAN */ + +#define __should_swizzle_bits (a) false + +static inline bool __should_swizzle_addr (u64 p) +{ +/* boot bus? */ +return ((p >>40 ) &0xff ) ==0 ; +} + +# define __swizzle_addr_b (port) \ + (__should_swizzle_addr(port) ? (port) ^ 7 : (port)) +# define __swizzle_addr_w (port) \ + (__should_swizzle_addr(port) ? (port) ^ 6 : (port)) +# define __swizzle_addr_l (port) \ + (__should_swizzle_addr(port) ? (port) ^ 4 : (port)) +# define __swizzle_addr_q (port) (port) + +#endif /* __BIG_ENDIAN */ + + +# define ioswabb (a, x) (x) +# define __mem_ioswabb (a, x) (x) +# define ioswabw (a, x) (__should_swizzle_bits(a) ? le16_to_cpu(x) : x) +# define __mem_ioswabw (a, x) (x) +# define ioswabl (a, x) (__should_swizzle_bits(a) ? le32_to_cpu(x) : x) +# define __mem_ioswabl (a, x) (x) +# define ioswabq (a, x) (__should_swizzle_bits(a) ? le64_to_cpu(x) : x) +# define __mem_ioswabq (a, x) (x) + +#endif /* __ASM_MACH_GENERIC_MANGLE_PORT_H */
Signature · 1 line
- Daniel
PATCH 5/8 mips: octeon: Add mangle-port.h
Quoted 22 lines · Daniel Schwierzeck
Am Montag, den 17.08.2020, 15:06 +0200 schrieb Stefan Roese:
Quoted 21 lines
Import platform specific
mangle-port.hheader, allowing a area specific swapping, which is needed on Octeon for USB & PCI areas.Imported from Linux v5.7.
Signed-off-by Stefan Roese <[email protected]>---
arch/mips/mach-octeon/include/mangle-port.h | 58 +++++++++++++++++++++ 1 file changed, 58 insertions(+)create mode 100644
arch/mips/mach-octeon/include/mangle-port.harch/mips/mach-octeon/include/mangle-port.h new file +3
-0@@ -0,0 +1,58 @@ +/* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file "COPYING" in the main directory of this archive
Quoted 8 lines
arch/mips/mach-octeon/include/mangle-port.h line 7
Quoted 4 lines
arch/mips/mach-octeon/include/mangle-port.h new file +4
-0+* for more details. +* +* Copyright (C) 2003, 2004 Ralf Baechle +*/ when importing headers from Linux, please remove the license text and just keep copyrights and optionally additonal info text. At the top insert the SPDX identifier, e.g.
Okay. Will change in next version.
Thanks,
Stefan
Quoted 49 lines
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (C) 2003, 2004 Ralf Baechle
*/Quoted 43 lines
arch/mips/mach-octeon/include/mangle-port.h new file +43
-0+#ifndef __ASM_MACH_GENERIC_MANGLE_PORT_H +#define __ASM_MACH_GENERIC_MANGLE_PORT_H + +#include <asm/byteorder.h> + +#ifdef __BIG_ENDIAN + +static inline bool __should_swizzle_bits (volatile void *a) +{ +extern const bool octeon_should_swizzle_table[]; +u64 did = ((u64 )(uintptr_t )a >>40 ) &0xff ; + +return octeon_should_swizzle_table[did]; +} + +# define __swizzle_addr_b (port) (port) +# define __swizzle_addr_w (port) (port) +# define __swizzle_addr_l (port) (port) +# define __swizzle_addr_q (port) (port) + +#else /* __LITTLE_ENDIAN */ + +#define __should_swizzle_bits (a) false + +static inline bool __should_swizzle_addr (u64 p) +{ +/* boot bus? */ +return ((p >>40 ) &0xff ) ==0 ; +} + +# define __swizzle_addr_b (port) \ + (__should_swizzle_addr(port) ? (port) ^ 7 : (port)) +# define __swizzle_addr_w (port) \ + (__should_swizzle_addr(port) ? (port) ^ 6 : (port)) +# define __swizzle_addr_l (port) \ + (__should_swizzle_addr(port) ? (port) ^ 4 : (port)) +# define __swizzle_addr_q (port) (port) + +#endif /* __BIG_ENDIAN */ + + +# define ioswabb (a, x) (x) +# define __mem_ioswabb (a, x) (x)
Quoted 8 lines
arch/mips/mach-octeon/include/mangle-port.h line 58
Quoted 8 lines
arch/mips/mach-octeon/include/mangle-port.h new file +8
-0+# define ioswabw (a, x) (__should_swizzle_bits(a) ? le16_to_cpu(x) : x) +# define __mem_ioswabw (a, x) (x) +# define ioswabl (a, x) (__should_swizzle_bits(a) ? le32_to_cpu(x) : x) +# define __mem_ioswabl (a, x) (x) +# define ioswabq (a, x) (__should_swizzle_bits(a) ? le64_to_cpu(x) : x) +# define __mem_ioswabq (a, x) (x) + +#endif /* __ASM_MACH_GENERIC_MANGLE_PORT_H */
Viele Gr??e,
Stefan
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
PATCH 6/8 mips: octeon: cache.c: Flush all pending writes in flush_dcache_range()
In reply to Stefan RoeseAs noticed while working on the USB xHCI support, Octeon needs to flush all pending writes so that the values are present in the memory. Add this "syncw" instruction (twice) to flush_dcache_range().
---
arch/mips/mach-octeon/cache.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/mips/mach-octeon/cache.c +6 -6
@@ -5,14 +5,13 @@#include <cpu_func.h> -/* -* The Octeon platform is cache coherent and cache flushes and invalidates -* are not needed. Define some platform specific empty flush_foo() -* functions here to overwrite the _weak common function as a no-op. -* This effectively disables all cache operations. -*/ +/* Octeon memory write barrier */ +#define CVMX_SYNCW asm volatile ("syncw\nsyncw\n" : : : "memory") +void flush_dcache_range (ulong start_addr,ulong stop) { +/* Flush all pending writes */ +CVMX_SYNCW ; }void flush_cache (ulong start_addr,ulong size)
@@ -21,4 +20,5 @@ void flush_cache(ulong start_addr, ulong size)void invalidate_dcache_range (ulong start_addr,ulong stop) { +/* Don't need to do anything for OCTEON */ }
Signature · 1 line
2.28.0
PATCH 7/8 mips: octeon: Add USB DT nodes
In reply to Stefan RoeseAdd the USB device tree nodes to the Octeon dts/dtsi files.
---
arch/mips/dts/mrvl,cn73xx.dtsi | 58 +++++++++++++++++++++++++++ arch/mips/dts/mrvl,octeon-ebb7304.dts | 22 ++++++++++ 2 files changed, 80 insertions(+)
arch/mips/dts/mrvl,cn73xx.dtsi +58 -0
@@ -143,5 +143,63 @@ spi-max-frequency = <25000000>; clocks = <&clk OCTEON_CLK_IO>; }; + + /* USB 0 */ + usb0: uctl at 1180068000000 { + compatible = "cavium,octeon-7130-usb-uctl"; + reg = <0x11800 0x68000000 0x0 0x100>; + ranges; /* Direct mapping */ + #address-cells = <2>; + #size-cells = <2>; + /* Only 100MHz allowed */ + refclk-frequency = <100000000>; + /* Only "dlmc_ref_clk0" is supported for 73xx */ + refclk-type-ss = "dlmc_ref_clk0"; + /* Only "dlmc_ref_clk0" is supported for 73xx */ + refclk-type-hs = "dlmc_ref_clk0"; + + /* Power is specified by three parts: + * 1) GPIO handle (must be &gpio) + * 2) GPIO pin number + * 3) Active high (0) or active low (1) + */ + xhci at 1680000000000 { + compatible = "cavium,octeon-7130-xhci","synopsys,dwc3","snps,dwc3"; + reg = <0x16800 0x00000000 0x10 0x0>; + interrupts = <0x68080 4>; /* UAHC_IMAN, level */ + maximum-speed = "super-speed"; + dr_mode = "host"; + snps,dis_u3_susphy_quirk; + snps,dis_u2_susphy_quirk; + snps,dis_enblslpm_quirk; + }; + }; + + /* USB 1 */ + usb1: uctl at 1180069000000 { + compatible = "cavium,octeon-7130-usb-uctl"; + reg = <0x11800 0x69000000 0x0 0x100>; + ranges; /* Direct mapping */ + #address-cells = <2>; + #size-cells = <2>; + /* 50MHz, 100MHz and 125MHz allowed */ + refclk-frequency = <100000000>; + /* Either "dlmc_ref_clk0" or "dlmc_ref_clk0" */ + refclk-type-ss = "dlmc_ref_clk0"; + /* Either "dlmc_ref_clk0" "dlmc_ref_clk1" or "pll_ref_clk" */ + refclk-type-hs = "dlmc_ref_clk0"; + + /* Power is specified by three parts: + * 1) GPIO handle (must be &gpio) + * 2) GPIO pin number + * 3) Active high (0) or active low (1) + */ + xhci at 1690000000000 { + compatible = "cavium,octeon-7130-xhci","synopsys,dwc3","snps,dwc3"; + reg = <0x16900 0x00000000 0x10 0x0>; + interrupts = <0x69080 4>; /* UAHC_IMAN, level */ + dr_mode = "host"; + }; + }; }; };
arch/mips/dts/mrvl,octeon-ebb7304.dts +22 -0
@@ -113,3 +113,25 @@ reg = <0>; }; }; + +/* USB 0 */ +&usb0 { + status = "okay"; + /* Power is specified by three parts: + * 1) GPIO handle (must be &gpio) + * 2) GPIO pin number + * 3) Active high (0) or active low (1) + */ + power = <&gpio 20 0>; +}; + +/* USB 1 */ +&usb1 { + status = "okay"; + /* Power is specified by three parts: + * 1) GPIO handle (must be &gpio) + * 2) GPIO pin number + * 3) Active high (0) or active low (1) + */ + power = <&gpio 21 0>; +};
Signature · 1 line
2.28.0
PATCH 8/8 mips: octeon: octeon_ebb7304_defconfig: Enable USB support
In reply to Stefan RoeseThis patch enables USB support with some helpful commands, like fs support.
---
configs/octeon_ebb7304_defconfig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
configs/octeon_ebb7304_defconfig +17 -0
@@ -15,12 +15,19 @@ CONFIG_HUSH_PARSER=y CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MTD=y +CONFIG_CMD_PART=y CONFIG_CMD_PCI=y +CONFIG_CMD_USB=y CONFIG_CMD_DHCP=y CONFIG_CMD_PING=y CONFIG_CMD_TIME=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +# CONFIG_DOS_PARTITION is not set CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0x1FBFE000 +CONFIG_BLK=y CONFIG_CLK=y # CONFIG_INPUT is not set CONFIG_MTD=y
@@ -48,4 +55,14 @@ CONFIG_SPI=y CONFIG_OCTEON_SPI=y CONFIG_SYSRESET=y CONFIG_SYSRESET_OCTEON=y +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_DWC3=y +CONFIG_USB_HOST_ETHER=y +CONFIG_USB_ETHER_ASIX=y +CONFIG_USB_ETHER_ASIX88179=y +CONFIG_USB_ETHER_MCS7830=y +CONFIG_USB_ETHER_RTL8152=y +CONFIG_USB_ETHER_SMSC95XX=y CONFIG_HEXDUMP=y
Signature · 1 line
2.28.0
PATCH 8/8 mips: octeon: octeon_ebb7304_defconfig: Enable USB support
Am Montag, den 17.08.2020, 15:06 +0200 schrieb Stefan Roese:
Quoted 38 lines
This patch enables USB support with some helpful commands, like fs support.
Signed-off-by Stefan Roese <[email protected]>---
configs/octeon_ebb7304_defconfig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)configs/octeon_ebb7304_defconfig +7
-0@@ -15,12 +15,19 @@ CONFIG_HUSH_PARSER=y CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MTD=y +CONFIG_CMD_PART=y CONFIG_CMD_PCI=y +CONFIG_CMD_USB=y CONFIG_CMD_DHCP=y CONFIG_CMD_PING=y CONFIG_CMD_TIME=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +# CONFIG_DOS_PARTITION is not set CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0x1FBFE000 +CONFIG_BLK=y CONFIG_CLK=y # CONFIG_INPUT is not set CONFIG_MTD=y@@ -48,4 +55,14 @@ CONFIG_SPI=y CONFIG_OCTEON_SPI=y CONFIG_SYSRESET=y CONFIG_SYSRESET_OCTEON=y
configs/octeon_ebb7304_defconfig CONFIG_SPI=y · line 67
Quoted 10 lines
configs/octeon_ebb7304_defconfig +10
-0+CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_DWC3=y +CONFIG_USB_HOST_ETHER=y +CONFIG_USB_ETHER_ASIX=y +CONFIG_USB_ETHER_ASIX88179=y +CONFIG_USB_ETHER_MCS7830=y +CONFIG_USB_ETHER_RTL8152=y +CONFIG_USB_ETHER_SMSC95XX=y
is it intentional to enable all USB ethernet drivers?
Quoted 1 line
configs/octeon_ebb7304_defconfig +0
-0CONFIG_HEXDUMP=y
Signature · 1 line
- Daniel
PATCH 8/8 mips: octeon: octeon_ebb7304_defconfig: Enable USB support
Quoted 43 lines · Daniel Schwierzeck
Am Montag, den 17.08.2020, 15:06 +0200 schrieb Stefan Roese:
Quoted 42 lines
This patch enables USB support with some helpful commands, like fs support.
Signed-off-by Stefan Roese <[email protected]>---
configs/octeon_ebb7304_defconfig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)configs/octeon_ebb7304_defconfig +11
-0@@ -15,12 +15,19 @@ CONFIG_HUSH_PARSER=y CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MTD=y +CONFIG_CMD_PART=y CONFIG_CMD_PCI=y +CONFIG_CMD_USB=y CONFIG_CMD_DHCP=y CONFIG_CMD_PING=y CONFIG_CMD_TIME=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +# CONFIG_DOS_PARTITION is not set CONFIG_ENV_IS_IN_FLASH=y CONFIG_ENV_ADDR=0x1FBFE000 +CONFIG_BLK=y CONFIG_CLK=y # CONFIG_INPUT is not set CONFIG_MTD=y@@ -48,4 +55,14 @@ CONFIG_SPI=y CONFIG_OCTEON_SPI=y CONFIG_SYSRESET=y CONFIG_SYSRESET_OCTEON=y +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_DWC3=y
Quoted 8 lines
configs/octeon_ebb7304_defconfig CONFIG_SPI=y · line 67
Quoted 6 lines
configs/octeon_ebb7304_defconfig +6
-0+CONFIG_USB_HOST_ETHER=y +CONFIG_USB_ETHER_ASIX=y +CONFIG_USB_ETHER_ASIX88179=y +CONFIG_USB_ETHER_MCS7830=y +CONFIG_USB_ETHER_RTL8152=y +CONFIG_USB_ETHER_SMSC95XX=yis it intentional to enable all USB ethernet drivers?
Yes. As we currently don't have support for the integrated ethernet controller(s), I wanted to give the user as many choices of supported USB ethernet adapters as possible.
Thanks,
Stefan