mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-13 16:31:09 +00:00
4eba86820f
Refreshed all patches. Fixes: - CVE-2019-14896 - CVE-2019-14897 Remove upstreamed: - 023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch Altered patches: - 102-MIPS-BCM63XX-move-code-touching-the-USB-private-regi.patch - 105-MIPS-BCM63XX-add-support-for-the-on-chip-OHCI-contro.patch - 106-MIPS-BCM63XX-register-OHCI-controller-if-board-enabl.patch - 108-MIPS-BCM63XX-add-support-for-the-on-chip-EHCI-contro.patch - 207-MIPS-BCM63XX-move-device-registration-code-into-its-.patch - 350-MIPS-BCM63XX-support-settings-num-usbh-ports.patch - 356-MIPS-BCM63XX-move-fallback-sprom-support-into-its-ow.patch - 390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch - 391-MIPS-BCM63XX-do-not-register-uart.patch - 392-MIPS-BCM63XX-remove-leds-and-buttons.patch - 416-BCM63XX-add-a-fixup-for-ath9k-devices.patch - 422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch - Compile-tested on: brcm63xx, cns3xxx Runtime-tested on: cns3xxx Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
152 lines
5.0 KiB
Diff
152 lines
5.0 KiB
Diff
From ac9b0b574d54be28b300bf99ffe092a2c589484f Mon Sep 17 00:00:00 2001
|
|
From: Florian Fainelli <florian@openwrt.org>
|
|
Date: Mon, 28 Jan 2013 20:06:21 +0100
|
|
Subject: [PATCH 03/11] MIPS: BCM63XX: move code touching the USB private
|
|
register
|
|
|
|
This patch moves the code touching the USB private register in the
|
|
bcm63xx USB gadget driver to arch/mips/bcm63xx/usb-common.c in
|
|
preparation for adding support for OHCI and EHCI host controllers which
|
|
will also touch the USB private register.
|
|
|
|
Signed-off-by: Florian Fainelli <florian@openwrt.org>
|
|
---
|
|
arch/mips/bcm63xx/Makefile | 2 +-
|
|
arch/mips/bcm63xx/usb-common.c | 53 ++++++++++++++++++++
|
|
.../include/asm/mach-bcm63xx/bcm63xx_usb_priv.h | 9 ++++
|
|
drivers/usb/gadget/bcm63xx_udc.c | 27 ++--------
|
|
4 files changed, 67 insertions(+), 24 deletions(-)
|
|
create mode 100644 arch/mips/bcm63xx/usb-common.c
|
|
create mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_usb_priv.h
|
|
|
|
--- a/arch/mips/bcm63xx/Makefile
|
|
+++ b/arch/mips/bcm63xx/Makefile
|
|
@@ -2,7 +2,7 @@
|
|
obj-y += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \
|
|
setup.o timer.o dev-enet.o dev-flash.o dev-pcmcia.o \
|
|
dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o dev-wdt.o \
|
|
- dev-usb-usbd.o
|
|
+ dev-usb-usbd.o usb-common.o
|
|
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
|
|
|
obj-y += boards/
|
|
--- /dev/null
|
|
+++ b/arch/mips/bcm63xx/usb-common.c
|
|
@@ -0,0 +1,53 @@
|
|
+/*
|
|
+ * Broadcom BCM63xx common USB device configuration code
|
|
+ *
|
|
+ * 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) 2012 Kevin Cernekee <cernekee@gmail.com>
|
|
+ * Copyright (C) 2012 Broadcom Corporation
|
|
+ *
|
|
+ */
|
|
+#include <linux/export.h>
|
|
+
|
|
+#include <bcm63xx_cpu.h>
|
|
+#include <bcm63xx_regs.h>
|
|
+#include <bcm63xx_io.h>
|
|
+#include <bcm63xx_usb_priv.h>
|
|
+
|
|
+void bcm63xx_usb_priv_select_phy_mode(u32 portmask, bool is_device)
|
|
+{
|
|
+ u32 val;
|
|
+
|
|
+ val = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_UTMI_CTL_6368_REG);
|
|
+ if (is_device) {
|
|
+ val |= (portmask << USBH_PRIV_UTMI_CTL_HOSTB_SHIFT);
|
|
+ val |= (portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
|
|
+ } else {
|
|
+ val &= ~(portmask << USBH_PRIV_UTMI_CTL_HOSTB_SHIFT);
|
|
+ val &= ~(portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
|
|
+ }
|
|
+ bcm_rset_writel(RSET_USBH_PRIV, val, USBH_PRIV_UTMI_CTL_6368_REG);
|
|
+
|
|
+ val = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6368_REG);
|
|
+ if (is_device)
|
|
+ val |= USBH_PRIV_SWAP_USBD_MASK;
|
|
+ else
|
|
+ val &= ~USBH_PRIV_SWAP_USBD_MASK;
|
|
+ bcm_rset_writel(RSET_USBH_PRIV, val, USBH_PRIV_SWAP_6368_REG);
|
|
+}
|
|
+EXPORT_SYMBOL(bcm63xx_usb_priv_select_phy_mode);
|
|
+
|
|
+void bcm63xx_usb_priv_select_pullup(u32 portmask, bool is_on)
|
|
+{
|
|
+ u32 val;
|
|
+
|
|
+ val = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_UTMI_CTL_6368_REG);
|
|
+ if (is_on)
|
|
+ val &= ~(portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
|
|
+ else
|
|
+ val |= (portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
|
|
+ bcm_rset_writel(RSET_USBH_PRIV, val, USBH_PRIV_UTMI_CTL_6368_REG);
|
|
+}
|
|
+EXPORT_SYMBOL(bcm63xx_usb_priv_select_pullup);
|
|
--- /dev/null
|
|
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_usb_priv.h
|
|
@@ -0,0 +1,9 @@
|
|
+#ifndef BCM63XX_USB_PRIV_H_
|
|
+#define BCM63XX_USB_PRIV_H_
|
|
+
|
|
+#include <linux/types.h>
|
|
+
|
|
+void bcm63xx_usb_priv_select_phy_mode(u32 portmask, bool is_device);
|
|
+void bcm63xx_usb_priv_select_pullup(u32 portmask, bool is_on);
|
|
+
|
|
+#endif /* BCM63XX_USB_PRIV_H_ */
|
|
--- a/drivers/usb/gadget/udc/bcm63xx_udc.c
|
|
+++ b/drivers/usb/gadget/udc/bcm63xx_udc.c
|
|
@@ -39,6 +39,7 @@
|
|
#include <bcm63xx_dev_usb_usbd.h>
|
|
#include <bcm63xx_io.h>
|
|
#include <bcm63xx_regs.h>
|
|
+#include <bcm63xx_usb_priv.h>
|
|
|
|
#define DRV_MODULE_NAME "bcm63xx_udc"
|
|
|
|
@@ -887,22 +888,7 @@ static void bcm63xx_select_phy_mode(stru
|
|
bcm_gpio_writel(val, GPIO_PINMUX_OTHR_REG);
|
|
}
|
|
|
|
- val = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_UTMI_CTL_6368_REG);
|
|
- if (is_device) {
|
|
- val |= (portmask << USBH_PRIV_UTMI_CTL_HOSTB_SHIFT);
|
|
- val |= (portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
|
|
- } else {
|
|
- val &= ~(portmask << USBH_PRIV_UTMI_CTL_HOSTB_SHIFT);
|
|
- val &= ~(portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
|
|
- }
|
|
- bcm_rset_writel(RSET_USBH_PRIV, val, USBH_PRIV_UTMI_CTL_6368_REG);
|
|
-
|
|
- val = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6368_REG);
|
|
- if (is_device)
|
|
- val |= USBH_PRIV_SWAP_USBD_MASK;
|
|
- else
|
|
- val &= ~USBH_PRIV_SWAP_USBD_MASK;
|
|
- bcm_rset_writel(RSET_USBH_PRIV, val, USBH_PRIV_SWAP_6368_REG);
|
|
+ bcm63xx_usb_priv_select_phy_mode(portmask, is_device);
|
|
}
|
|
|
|
/**
|
|
@@ -916,14 +902,9 @@ static void bcm63xx_select_phy_mode(stru
|
|
*/
|
|
static void bcm63xx_select_pullup(struct bcm63xx_udc *udc, bool is_on)
|
|
{
|
|
- u32 val, portmask = BIT(udc->pd->port_no);
|
|
+ u32 portmask = BIT(udc->pd->port_no);
|
|
|
|
- val = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_UTMI_CTL_6368_REG);
|
|
- if (is_on)
|
|
- val &= ~(portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
|
|
- else
|
|
- val |= (portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
|
|
- bcm_rset_writel(RSET_USBH_PRIV, val, USBH_PRIV_UTMI_CTL_6368_REG);
|
|
+ bcm63xx_usb_priv_select_pullup(portmask, is_on);
|
|
}
|
|
|
|
/**
|