mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-06-06 02:40:18 +00:00
arm-bsp/linux: introducing corstone1000 FVP machine
This commit enables Linux kernel v5.10 for corstone1000-fvp machine. Change-Id: I882902bba273355428af06c29796358e17f9b379 Signed-off-by: Arpita S.K <Arpita.S.K@arm.com> Signed-off-by: Satish Kumar <satish.kumar01@arm.com> Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com> Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com> Signed-off-by: Rui Miguel Silva <rui.silva@arm.com> Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
committed by
Jon Mason
parent
1597b866f8
commit
a933940df2
@@ -0,0 +1,9 @@
|
||||
#@TYPE: Machine
|
||||
#@NAME: corstone1000-fvp machine
|
||||
#@DESCRIPTION: Machine configuration for Corstone1000 64-bit FVP
|
||||
|
||||
require conf/machine/include/corstone1000.inc
|
||||
|
||||
TFA_TARGET_PLATFORM = "fvp"
|
||||
|
||||
TFM_PLATFORM_IS_FVP = "TRUE"
|
||||
@@ -0,0 +1,24 @@
|
||||
require conf/machine/include/arm/armv8a/tune-cortexa35.inc
|
||||
|
||||
MACHINEOVERRIDES =. "corstone1000:"
|
||||
|
||||
# Linux kernel
|
||||
PREFERRED_PROVIDER_virtual/kernel:forcevariable = "linux-yocto"
|
||||
PREFERRED_VERSION_linux-yocto = "5.10%"
|
||||
KERNEL_IMAGETYPE = "Image"
|
||||
|
||||
INITRAMFS_IMAGE_BUNDLE ?= "1"
|
||||
|
||||
#telling the build system which image is responsible of the generation of the initramfs rootfs
|
||||
INITRAMFS_IMAGE = "corstone1000-initramfs-image"
|
||||
|
||||
# enable this feature for kernel debugging
|
||||
# MACHINE_FEATURES += "corstone1000_kernel_debug"
|
||||
|
||||
# login terminal serial port settings
|
||||
SERIAL_CONSOLES ?= "115200;ttyAMA0"
|
||||
|
||||
# making sure EXTRA_IMAGEDEPENDS will be used while creating the image
|
||||
WKS_FILE_DEPENDS:append = " ${EXTRA_IMAGEDEPENDS}"
|
||||
|
||||
WKS_FILE ?= "corstone1000-image.corstone1000.wks"
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
define KMACHINE corstone1000
|
||||
define KTYPE standard
|
||||
define KARCH arm64
|
||||
|
||||
kconf hardware corstone1000/base.cfg
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
CONFIG_LOCALVERSION="-yocto-standard"
|
||||
# CONFIG_LOCALVERSION_AUTO is not set
|
||||
CONFIG_LOG_BUF_SHIFT=12
|
||||
# CONFIG_UTS_NS is not set
|
||||
# CONFIG_PID_NS is not set
|
||||
# CONFIG_NET_NS is not set
|
||||
# CONFIG_BLK_DEV_BSG is not set
|
||||
CONFIG_ARM64=y
|
||||
CONFIG_THUMB2_KERNEL=y
|
||||
CONFIG_ZBOOT_ROM_TEXT=0x0
|
||||
CONFIG_ZBOOT_ROM_BSS=0x0
|
||||
CONFIG_VFP=y
|
||||
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
# CONFIG_IPV6 is not set
|
||||
# CONFIG_WIRELESS is not set
|
||||
CONFIG_DEVTMPFS=y
|
||||
CONFIG_TMPFS=y
|
||||
# CONFIG_WLAN is not set
|
||||
# CONFIG_SERIO_SERPORT is not set
|
||||
CONFIG_SERIAL_AMBA_PL011=y
|
||||
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
|
||||
CONFIG_RTC_CLASS=y
|
||||
CONFIG_RTC_DRV_PL031=y
|
||||
CONFIG_MAILBOX=y
|
||||
# CONFIG_CRYPTO_HW is not set
|
||||
+191
@@ -0,0 +1,191 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.14.9]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From abfabc8ae3bd625f57fa35d25f2435bb6465a3b1 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Thu, 13 May 2021 09:47:09 +0100
|
||||
Subject: [PATCH 01/23] usb: isp1760: fix strict typechecking
|
||||
|
||||
There are a lot of pre-existing typechecking warnings around the
|
||||
access and assign of elements of ptd structure of __dw type.
|
||||
|
||||
sparse: warning: invalid assignment: |=
|
||||
sparse: left side has type restricted __dw
|
||||
sparse: right side has type unsigned int
|
||||
|
||||
or
|
||||
|
||||
warning: restricted __dw degrades to integer
|
||||
|
||||
or
|
||||
|
||||
sparse: warning: incorrect type in assignment (different base types)
|
||||
sparse: expected restricted __dw [usertype] dw4
|
||||
sparse: got unsigned int [assigned] [usertype] usof
|
||||
|
||||
To handle this, annotate conversions along the {TO,FROM}_DW* macros
|
||||
and some assignments and function arguments.
|
||||
|
||||
This clean up completely all sparse warnings for this driver.
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210513084717.2487366-2-rui.silva@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-hcd.c | 92 ++++++++++++++++---------------
|
||||
1 file changed, 47 insertions(+), 45 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
index 33ae656c4b68..0e0a4b01c710 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-hcd.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
@@ -66,44 +66,46 @@ struct ptd {
|
||||
#define ATL_PTD_OFFSET 0x0c00
|
||||
#define PAYLOAD_OFFSET 0x1000
|
||||
|
||||
-
|
||||
-/* ATL */
|
||||
-/* DW0 */
|
||||
-#define DW0_VALID_BIT 1
|
||||
-#define FROM_DW0_VALID(x) ((x) & 0x01)
|
||||
-#define TO_DW0_LENGTH(x) (((u32) x) << 3)
|
||||
-#define TO_DW0_MAXPACKET(x) (((u32) x) << 18)
|
||||
-#define TO_DW0_MULTI(x) (((u32) x) << 29)
|
||||
-#define TO_DW0_ENDPOINT(x) (((u32) x) << 31)
|
||||
+#define TO_DW(x) ((__force __dw)x)
|
||||
+#define TO_U32(x) ((__force u32)x)
|
||||
+
|
||||
+ /* ATL */
|
||||
+ /* DW0 */
|
||||
+#define DW0_VALID_BIT TO_DW(1)
|
||||
+#define FROM_DW0_VALID(x) (TO_U32(x) & 0x01)
|
||||
+#define TO_DW0_LENGTH(x) TO_DW((((u32)x) << 3))
|
||||
+#define TO_DW0_MAXPACKET(x) TO_DW((((u32)x) << 18))
|
||||
+#define TO_DW0_MULTI(x) TO_DW((((u32)x) << 29))
|
||||
+#define TO_DW0_ENDPOINT(x) TO_DW((((u32)x) << 31))
|
||||
/* DW1 */
|
||||
-#define TO_DW1_DEVICE_ADDR(x) (((u32) x) << 3)
|
||||
-#define TO_DW1_PID_TOKEN(x) (((u32) x) << 10)
|
||||
-#define DW1_TRANS_BULK ((u32) 2 << 12)
|
||||
-#define DW1_TRANS_INT ((u32) 3 << 12)
|
||||
-#define DW1_TRANS_SPLIT ((u32) 1 << 14)
|
||||
-#define DW1_SE_USB_LOSPEED ((u32) 2 << 16)
|
||||
-#define TO_DW1_PORT_NUM(x) (((u32) x) << 18)
|
||||
-#define TO_DW1_HUB_NUM(x) (((u32) x) << 25)
|
||||
+#define TO_DW1_DEVICE_ADDR(x) TO_DW((((u32)x) << 3))
|
||||
+#define TO_DW1_PID_TOKEN(x) TO_DW((((u32)x) << 10))
|
||||
+#define DW1_TRANS_BULK TO_DW(((u32)2 << 12))
|
||||
+#define DW1_TRANS_INT TO_DW(((u32)3 << 12))
|
||||
+#define DW1_TRANS_SPLIT TO_DW(((u32)1 << 14))
|
||||
+#define DW1_SE_USB_LOSPEED TO_DW(((u32)2 << 16))
|
||||
+#define TO_DW1_PORT_NUM(x) TO_DW((((u32)x) << 18))
|
||||
+#define TO_DW1_HUB_NUM(x) TO_DW((((u32)x) << 25))
|
||||
/* DW2 */
|
||||
-#define TO_DW2_DATA_START_ADDR(x) (((u32) x) << 8)
|
||||
-#define TO_DW2_RL(x) ((x) << 25)
|
||||
-#define FROM_DW2_RL(x) (((x) >> 25) & 0xf)
|
||||
+#define TO_DW2_DATA_START_ADDR(x) TO_DW((((u32)x) << 8))
|
||||
+#define TO_DW2_RL(x) TO_DW(((x) << 25))
|
||||
+#define FROM_DW2_RL(x) ((TO_U32(x) >> 25) & 0xf)
|
||||
/* DW3 */
|
||||
-#define FROM_DW3_NRBYTESTRANSFERRED(x) ((x) & 0x7fff)
|
||||
-#define FROM_DW3_SCS_NRBYTESTRANSFERRED(x) ((x) & 0x07ff)
|
||||
-#define TO_DW3_NAKCOUNT(x) ((x) << 19)
|
||||
-#define FROM_DW3_NAKCOUNT(x) (((x) >> 19) & 0xf)
|
||||
-#define TO_DW3_CERR(x) ((x) << 23)
|
||||
-#define FROM_DW3_CERR(x) (((x) >> 23) & 0x3)
|
||||
-#define TO_DW3_DATA_TOGGLE(x) ((x) << 25)
|
||||
-#define FROM_DW3_DATA_TOGGLE(x) (((x) >> 25) & 0x1)
|
||||
-#define TO_DW3_PING(x) ((x) << 26)
|
||||
-#define FROM_DW3_PING(x) (((x) >> 26) & 0x1)
|
||||
-#define DW3_ERROR_BIT (1 << 28)
|
||||
-#define DW3_BABBLE_BIT (1 << 29)
|
||||
-#define DW3_HALT_BIT (1 << 30)
|
||||
-#define DW3_ACTIVE_BIT (1 << 31)
|
||||
-#define FROM_DW3_ACTIVE(x) (((x) >> 31) & 0x01)
|
||||
+#define FROM_DW3_NRBYTESTRANSFERRED(x) TO_U32((x) & 0x7fff)
|
||||
+#define FROM_DW3_SCS_NRBYTESTRANSFERRED(x) TO_U32((x) & 0x07ff)
|
||||
+#define TO_DW3_NAKCOUNT(x) TO_DW(((x) << 19))
|
||||
+#define FROM_DW3_NAKCOUNT(x) ((TO_U32(x) >> 19) & 0xf)
|
||||
+#define TO_DW3_CERR(x) TO_DW(((x) << 23))
|
||||
+#define FROM_DW3_CERR(x) ((TO_U32(x) >> 23) & 0x3)
|
||||
+#define TO_DW3_DATA_TOGGLE(x) TO_DW(((x) << 25))
|
||||
+#define FROM_DW3_DATA_TOGGLE(x) ((TO_U32(x) >> 25) & 0x1)
|
||||
+#define TO_DW3_PING(x) TO_DW(((x) << 26))
|
||||
+#define FROM_DW3_PING(x) ((TO_U32(x) >> 26) & 0x1)
|
||||
+#define DW3_ERROR_BIT TO_DW((1 << 28))
|
||||
+#define DW3_BABBLE_BIT TO_DW((1 << 29))
|
||||
+#define DW3_HALT_BIT TO_DW((1 << 30))
|
||||
+#define DW3_ACTIVE_BIT TO_DW((1 << 31))
|
||||
+#define FROM_DW3_ACTIVE(x) ((TO_U32(x) >> 31) & 0x01)
|
||||
|
||||
#define INT_UNDERRUN (1 << 2)
|
||||
#define INT_BABBLE (1 << 1)
|
||||
@@ -292,12 +294,12 @@ static void ptd_write(void __iomem *base, u32 ptd_offset, u32 slot,
|
||||
struct ptd *ptd)
|
||||
{
|
||||
mem_writes8(base, ptd_offset + slot*sizeof(*ptd) + sizeof(ptd->dw0),
|
||||
- &ptd->dw1, 7*sizeof(ptd->dw1));
|
||||
+ (__force u32 *)&ptd->dw1, 7 * sizeof(ptd->dw1));
|
||||
/* Make sure dw0 gets written last (after other dw's and after payload)
|
||||
since it contains the enable bit */
|
||||
wmb();
|
||||
- mem_writes8(base, ptd_offset + slot*sizeof(*ptd), &ptd->dw0,
|
||||
- sizeof(ptd->dw0));
|
||||
+ mem_writes8(base, ptd_offset + slot * sizeof(*ptd),
|
||||
+ (__force u32 *)&ptd->dw0, sizeof(ptd->dw0));
|
||||
}
|
||||
|
||||
|
||||
@@ -553,7 +555,7 @@ static void create_ptd_atl(struct isp1760_qh *qh,
|
||||
ptd->dw0 |= TO_DW0_ENDPOINT(usb_pipeendpoint(qtd->urb->pipe));
|
||||
|
||||
/* DW1 */
|
||||
- ptd->dw1 = usb_pipeendpoint(qtd->urb->pipe) >> 1;
|
||||
+ ptd->dw1 = TO_DW((usb_pipeendpoint(qtd->urb->pipe) >> 1));
|
||||
ptd->dw1 |= TO_DW1_DEVICE_ADDR(usb_pipedevice(qtd->urb->pipe));
|
||||
ptd->dw1 |= TO_DW1_PID_TOKEN(qtd->packet_type);
|
||||
|
||||
@@ -575,7 +577,7 @@ static void create_ptd_atl(struct isp1760_qh *qh,
|
||||
/* SE bit for Split INT transfers */
|
||||
if (usb_pipeint(qtd->urb->pipe) &&
|
||||
(qtd->urb->dev->speed == USB_SPEED_LOW))
|
||||
- ptd->dw1 |= 2 << 16;
|
||||
+ ptd->dw1 |= DW1_SE_USB_LOSPEED;
|
||||
|
||||
rl = 0;
|
||||
nak = 0;
|
||||
@@ -647,14 +649,14 @@ static void transform_add_int(struct isp1760_qh *qh,
|
||||
* that number come from? 0xff seems to work fine...
|
||||
*/
|
||||
/* ptd->dw5 = 0x1c; */
|
||||
- ptd->dw5 = 0xff; /* Execute Complete Split on any uFrame */
|
||||
+ ptd->dw5 = TO_DW(0xff); /* Execute Complete Split on any uFrame */
|
||||
}
|
||||
|
||||
period = period >> 1;/* Ensure equal or shorter period than requested */
|
||||
period &= 0xf8; /* Mask off too large values and lowest unused 3 bits */
|
||||
|
||||
- ptd->dw2 |= period;
|
||||
- ptd->dw4 = usof;
|
||||
+ ptd->dw2 |= TO_DW(period);
|
||||
+ ptd->dw4 = TO_DW(usof);
|
||||
}
|
||||
|
||||
static void create_ptd_int(struct isp1760_qh *qh,
|
||||
@@ -977,10 +979,10 @@ static void schedule_ptds(struct usb_hcd *hcd)
|
||||
static int check_int_transfer(struct usb_hcd *hcd, struct ptd *ptd,
|
||||
struct urb *urb)
|
||||
{
|
||||
- __dw dw4;
|
||||
+ u32 dw4;
|
||||
int i;
|
||||
|
||||
- dw4 = ptd->dw4;
|
||||
+ dw4 = TO_U32(ptd->dw4);
|
||||
dw4 >>= 8;
|
||||
|
||||
/* FIXME: ISP1761 datasheet does not say what to do with these. Do we
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+2333
File diff suppressed because it is too large
Load Diff
+64
@@ -0,0 +1,64 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.14.9]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From 03e28d5233d50fb2a27fa02d032e77974d03eb2b Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Thu, 13 May 2021 09:47:11 +0100
|
||||
Subject: [PATCH 03/23] usb: isp1760: use relaxed primitives
|
||||
|
||||
Use io relaxed access memory primitives to satisfy strict type
|
||||
checking (__force).
|
||||
|
||||
This will fix some existing sparse warnings:
|
||||
sparse: warning: cast to restricted __le32
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210513084717.2487366-4-rui.silva@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-hcd.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
index 20d142140574..2cc0555e029d 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-hcd.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
@@ -246,7 +246,7 @@ static void bank_reads8(void __iomem *src_base, u32 src_offset, u32 bank_addr,
|
||||
|
||||
if (src_offset < PAYLOAD_OFFSET) {
|
||||
while (bytes >= 4) {
|
||||
- *dst = le32_to_cpu(__raw_readl(src));
|
||||
+ *dst = readl_relaxed(src);
|
||||
bytes -= 4;
|
||||
src++;
|
||||
dst++;
|
||||
@@ -267,7 +267,7 @@ static void bank_reads8(void __iomem *src_base, u32 src_offset, u32 bank_addr,
|
||||
* allocated.
|
||||
*/
|
||||
if (src_offset < PAYLOAD_OFFSET)
|
||||
- val = le32_to_cpu(__raw_readl(src));
|
||||
+ val = readl_relaxed(src);
|
||||
else
|
||||
val = __raw_readl(src);
|
||||
|
||||
@@ -301,7 +301,7 @@ static void mem_writes8(void __iomem *dst_base, u32 dst_offset,
|
||||
|
||||
if (dst_offset < PAYLOAD_OFFSET) {
|
||||
while (bytes >= 4) {
|
||||
- __raw_writel(cpu_to_le32(*src), dst);
|
||||
+ writel_relaxed(*src, dst);
|
||||
bytes -= 4;
|
||||
src++;
|
||||
dst++;
|
||||
@@ -322,7 +322,7 @@ static void mem_writes8(void __iomem *dst_base, u32 dst_offset,
|
||||
*/
|
||||
|
||||
if (dst_offset < PAYLOAD_OFFSET)
|
||||
- __raw_writel(cpu_to_le32(*src), dst);
|
||||
+ writel_relaxed(*src, dst);
|
||||
else
|
||||
__raw_writel(*src, dst);
|
||||
}
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.14.9]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From f9a88370e6751c68a8f0d1c3f23100ca20596249 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Thu, 13 May 2021 09:47:12 +0100
|
||||
Subject: [PATCH 04/23] usb: isp1760: remove platform data struct and code
|
||||
|
||||
Since the removal of the Blackfin port with:
|
||||
commit 4ba66a976072 ("arch: remove blackfin port")
|
||||
|
||||
No one is using or referencing this header and platform data struct.
|
||||
Remove them.
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210513084717.2487366-5-rui.silva@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-if.c | 20 +++-----------------
|
||||
1 file changed, 3 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-if.c b/drivers/usb/isp1760/isp1760-if.c
|
||||
index abfba9f5ec23..fb6701608cd8 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-if.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-if.c
|
||||
@@ -16,7 +16,6 @@
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/slab.h>
|
||||
-#include <linux/usb/isp1760.h>
|
||||
#include <linux/usb/hcd.h>
|
||||
|
||||
#include "isp1760-core.h"
|
||||
@@ -225,22 +224,9 @@ static int isp1760_plat_probe(struct platform_device *pdev)
|
||||
|
||||
if (of_property_read_bool(dp, "dreq-polarity"))
|
||||
devflags |= ISP1760_FLAG_DREQ_POL_HIGH;
|
||||
- } else if (dev_get_platdata(&pdev->dev)) {
|
||||
- struct isp1760_platform_data *pdata =
|
||||
- dev_get_platdata(&pdev->dev);
|
||||
-
|
||||
- if (pdata->is_isp1761)
|
||||
- devflags |= ISP1760_FLAG_ISP1761;
|
||||
- if (pdata->bus_width_16)
|
||||
- devflags |= ISP1760_FLAG_BUS_WIDTH_16;
|
||||
- if (pdata->port1_otg)
|
||||
- devflags |= ISP1760_FLAG_OTG_EN;
|
||||
- if (pdata->analog_oc)
|
||||
- devflags |= ISP1760_FLAG_ANALOG_OC;
|
||||
- if (pdata->dack_polarity_high)
|
||||
- devflags |= ISP1760_FLAG_DACK_POL_HIGH;
|
||||
- if (pdata->dreq_polarity_high)
|
||||
- devflags |= ISP1760_FLAG_DREQ_POL_HIGH;
|
||||
+ } else {
|
||||
+ pr_err("isp1760: no platform data\n");
|
||||
+ return -ENXIO;
|
||||
}
|
||||
|
||||
ret = isp1760_register(mem_res, irq_res->start, irqflags, &pdev->dev,
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+304
@@ -0,0 +1,304 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.14.9]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From a74f639c5b5618e2c9f311c93bc3e7405de8ca85 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Thu, 13 May 2021 09:47:13 +0100
|
||||
Subject: [PATCH 05/23] usb: isp1760: hcd: refactor mempool config and setup
|
||||
|
||||
In preparation to support other family member IP, which may have
|
||||
different memory layout. Drop macros and setup a configuration
|
||||
struct.
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210513084717.2487366-6-rui.silva@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-core.c | 21 ++++++++
|
||||
drivers/usb/isp1760/isp1760-hcd.c | 83 ++++++++++++++++++++----------
|
||||
drivers/usb/isp1760/isp1760-hcd.h | 37 ++++++-------
|
||||
3 files changed, 92 insertions(+), 49 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-core.c b/drivers/usb/isp1760/isp1760-core.c
|
||||
index c79ba98df9f9..35a7667e411c 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-core.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-core.c
|
||||
@@ -101,6 +101,25 @@ void isp1760_set_pullup(struct isp1760_device *isp, bool enable)
|
||||
isp1760_field_set(udc->fields, HW_DP_PULLUP_CLEAR);
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * 60kb divided in:
|
||||
+ * - 32 blocks @ 256 bytes
|
||||
+ * - 20 blocks @ 1024 bytes
|
||||
+ * - 4 blocks @ 8192 bytes
|
||||
+ */
|
||||
+static const struct isp1760_memory_layout isp176x_memory_conf = {
|
||||
+ .blocks[0] = 32,
|
||||
+ .blocks_size[0] = 256,
|
||||
+ .blocks[1] = 20,
|
||||
+ .blocks_size[1] = 1024,
|
||||
+ .blocks[2] = 4,
|
||||
+ .blocks_size[2] = 8192,
|
||||
+
|
||||
+ .ptd_num = 32,
|
||||
+ .payload_blocks = 32 + 20 + 4,
|
||||
+ .payload_area_size = 0xf000,
|
||||
+};
|
||||
+
|
||||
static const struct regmap_range isp176x_hc_volatile_ranges[] = {
|
||||
regmap_reg_range(ISP176x_HC_USBCMD, ISP176x_HC_ATL_PTD_LASTPTD),
|
||||
regmap_reg_range(ISP176x_HC_BUFFER_STATUS, ISP176x_HC_MEMORY),
|
||||
@@ -302,6 +321,8 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
|
||||
udc->fields[i] = f;
|
||||
}
|
||||
|
||||
+ hcd->memory_layout = &isp176x_memory_conf;
|
||||
+
|
||||
isp1760_init_core(isp);
|
||||
|
||||
if (IS_ENABLED(CONFIG_USB_ISP1760_HCD) && !usb_disabled()) {
|
||||
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
index 2cc0555e029d..a65f5f917ebe 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-hcd.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
@@ -358,39 +358,29 @@ static void ptd_write(void __iomem *base, u32 ptd_offset, u32 slot,
|
||||
/* memory management of the 60kb on the chip from 0x1000 to 0xffff */
|
||||
static void init_memory(struct isp1760_hcd *priv)
|
||||
{
|
||||
- int i, curr;
|
||||
+ const struct isp1760_memory_layout *mem = priv->memory_layout;
|
||||
+ int i, j, curr;
|
||||
u32 payload_addr;
|
||||
|
||||
payload_addr = PAYLOAD_OFFSET;
|
||||
- for (i = 0; i < BLOCK_1_NUM; i++) {
|
||||
- priv->memory_pool[i].start = payload_addr;
|
||||
- priv->memory_pool[i].size = BLOCK_1_SIZE;
|
||||
- priv->memory_pool[i].free = 1;
|
||||
- payload_addr += priv->memory_pool[i].size;
|
||||
- }
|
||||
-
|
||||
- curr = i;
|
||||
- for (i = 0; i < BLOCK_2_NUM; i++) {
|
||||
- priv->memory_pool[curr + i].start = payload_addr;
|
||||
- priv->memory_pool[curr + i].size = BLOCK_2_SIZE;
|
||||
- priv->memory_pool[curr + i].free = 1;
|
||||
- payload_addr += priv->memory_pool[curr + i].size;
|
||||
- }
|
||||
|
||||
- curr = i;
|
||||
- for (i = 0; i < BLOCK_3_NUM; i++) {
|
||||
- priv->memory_pool[curr + i].start = payload_addr;
|
||||
- priv->memory_pool[curr + i].size = BLOCK_3_SIZE;
|
||||
- priv->memory_pool[curr + i].free = 1;
|
||||
- payload_addr += priv->memory_pool[curr + i].size;
|
||||
+ for (i = 0, curr = 0; i < ARRAY_SIZE(mem->blocks); i++) {
|
||||
+ for (j = 0; j < mem->blocks[i]; j++, curr++) {
|
||||
+ priv->memory_pool[curr + j].start = payload_addr;
|
||||
+ priv->memory_pool[curr + j].size = mem->blocks_size[i];
|
||||
+ priv->memory_pool[curr + j].free = 1;
|
||||
+ payload_addr += priv->memory_pool[curr + j].size;
|
||||
+ }
|
||||
}
|
||||
|
||||
- WARN_ON(payload_addr - priv->memory_pool[0].start > PAYLOAD_AREA_SIZE);
|
||||
+ WARN_ON(payload_addr - priv->memory_pool[0].start >
|
||||
+ mem->payload_area_size);
|
||||
}
|
||||
|
||||
static void alloc_mem(struct usb_hcd *hcd, struct isp1760_qtd *qtd)
|
||||
{
|
||||
struct isp1760_hcd *priv = hcd_to_priv(hcd);
|
||||
+ const struct isp1760_memory_layout *mem = priv->memory_layout;
|
||||
int i;
|
||||
|
||||
WARN_ON(qtd->payload_addr);
|
||||
@@ -398,7 +388,7 @@ static void alloc_mem(struct usb_hcd *hcd, struct isp1760_qtd *qtd)
|
||||
if (!qtd->length)
|
||||
return;
|
||||
|
||||
- for (i = 0; i < BLOCKS; i++) {
|
||||
+ for (i = 0; i < mem->payload_blocks; i++) {
|
||||
if (priv->memory_pool[i].size >= qtd->length &&
|
||||
priv->memory_pool[i].free) {
|
||||
priv->memory_pool[i].free = 0;
|
||||
@@ -411,12 +401,13 @@ static void alloc_mem(struct usb_hcd *hcd, struct isp1760_qtd *qtd)
|
||||
static void free_mem(struct usb_hcd *hcd, struct isp1760_qtd *qtd)
|
||||
{
|
||||
struct isp1760_hcd *priv = hcd_to_priv(hcd);
|
||||
+ const struct isp1760_memory_layout *mem = priv->memory_layout;
|
||||
int i;
|
||||
|
||||
if (!qtd->payload_addr)
|
||||
return;
|
||||
|
||||
- for (i = 0; i < BLOCKS; i++) {
|
||||
+ for (i = 0; i < mem->payload_blocks; i++) {
|
||||
if (priv->memory_pool[i].start == qtd->payload_addr) {
|
||||
WARN_ON(priv->memory_pool[i].free);
|
||||
priv->memory_pool[i].free = 1;
|
||||
@@ -1407,8 +1398,6 @@ static int qtd_fill(struct isp1760_qtd *qtd, void *databuffer, size_t len)
|
||||
{
|
||||
qtd->data_buffer = databuffer;
|
||||
|
||||
- if (len > MAX_PAYLOAD_SIZE)
|
||||
- len = MAX_PAYLOAD_SIZE;
|
||||
qtd->length = len;
|
||||
|
||||
return qtd->length;
|
||||
@@ -1432,6 +1421,8 @@ static void qtd_list_free(struct list_head *qtd_list)
|
||||
static void packetize_urb(struct usb_hcd *hcd,
|
||||
struct urb *urb, struct list_head *head, gfp_t flags)
|
||||
{
|
||||
+ struct isp1760_hcd *priv = hcd_to_priv(hcd);
|
||||
+ const struct isp1760_memory_layout *mem = priv->memory_layout;
|
||||
struct isp1760_qtd *qtd;
|
||||
void *buf;
|
||||
int len, maxpacketsize;
|
||||
@@ -1484,6 +1475,10 @@ static void packetize_urb(struct usb_hcd *hcd,
|
||||
qtd = qtd_alloc(flags, urb, packet_type);
|
||||
if (!qtd)
|
||||
goto cleanup;
|
||||
+
|
||||
+ if (len > mem->blocks_size[ISP176x_BLOCK_NUM - 1])
|
||||
+ len = mem->blocks_size[ISP176x_BLOCK_NUM - 1];
|
||||
+
|
||||
this_qtd_len = qtd_fill(qtd, buf, len);
|
||||
list_add_tail(&qtd->qtd_list, head);
|
||||
|
||||
@@ -2212,6 +2207,7 @@ int isp1760_hcd_register(struct isp1760_hcd *priv, struct resource *mem,
|
||||
int irq, unsigned long irqflags,
|
||||
struct device *dev)
|
||||
{
|
||||
+ const struct isp1760_memory_layout *mem_layout = priv->memory_layout;
|
||||
struct usb_hcd *hcd;
|
||||
int ret;
|
||||
|
||||
@@ -2223,6 +2219,28 @@ int isp1760_hcd_register(struct isp1760_hcd *priv, struct resource *mem,
|
||||
|
||||
priv->hcd = hcd;
|
||||
|
||||
+ priv->memory_pool = kcalloc(mem_layout->payload_blocks,
|
||||
+ sizeof(struct isp1760_memory_chunk),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!priv->memory_pool) {
|
||||
+ ret = -ENOMEM;
|
||||
+ goto put_hcd;
|
||||
+ }
|
||||
+
|
||||
+ priv->atl_slots = kcalloc(mem_layout->ptd_num,
|
||||
+ sizeof(struct isp1760_slotinfo), GFP_KERNEL);
|
||||
+ if (!priv->atl_slots) {
|
||||
+ ret = -ENOMEM;
|
||||
+ goto free_mem_pool;
|
||||
+ }
|
||||
+
|
||||
+ priv->int_slots = kcalloc(mem_layout->ptd_num,
|
||||
+ sizeof(struct isp1760_slotinfo), GFP_KERNEL);
|
||||
+ if (!priv->int_slots) {
|
||||
+ ret = -ENOMEM;
|
||||
+ goto free_atl_slots;
|
||||
+ }
|
||||
+
|
||||
init_memory(priv);
|
||||
|
||||
hcd->irq = irq;
|
||||
@@ -2234,13 +2252,19 @@ int isp1760_hcd_register(struct isp1760_hcd *priv, struct resource *mem,
|
||||
|
||||
ret = usb_add_hcd(hcd, irq, irqflags);
|
||||
if (ret)
|
||||
- goto error;
|
||||
+ goto free_int_slots;
|
||||
|
||||
device_wakeup_enable(hcd->self.controller);
|
||||
|
||||
return 0;
|
||||
|
||||
-error:
|
||||
+free_int_slots:
|
||||
+ kfree(priv->int_slots);
|
||||
+free_atl_slots:
|
||||
+ kfree(priv->atl_slots);
|
||||
+free_mem_pool:
|
||||
+ kfree(priv->memory_pool);
|
||||
+put_hcd:
|
||||
usb_put_hcd(hcd);
|
||||
return ret;
|
||||
}
|
||||
@@ -2252,4 +2276,7 @@ void isp1760_hcd_unregister(struct isp1760_hcd *priv)
|
||||
|
||||
usb_remove_hcd(priv->hcd);
|
||||
usb_put_hcd(priv->hcd);
|
||||
+ kfree(priv->atl_slots);
|
||||
+ kfree(priv->int_slots);
|
||||
+ kfree(priv->memory_pool);
|
||||
}
|
||||
diff --git a/drivers/usb/isp1760/isp1760-hcd.h b/drivers/usb/isp1760/isp1760-hcd.h
|
||||
index 34e1899e52c4..9d2427ce3f1a 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-hcd.h
|
||||
+++ b/drivers/usb/isp1760/isp1760-hcd.h
|
||||
@@ -12,24 +12,6 @@ struct isp1760_qtd;
|
||||
struct resource;
|
||||
struct usb_hcd;
|
||||
|
||||
-/*
|
||||
- * 60kb divided in:
|
||||
- * - 32 blocks @ 256 bytes
|
||||
- * - 20 blocks @ 1024 bytes
|
||||
- * - 4 blocks @ 8192 bytes
|
||||
- */
|
||||
-
|
||||
-#define BLOCK_1_NUM 32
|
||||
-#define BLOCK_2_NUM 20
|
||||
-#define BLOCK_3_NUM 4
|
||||
-
|
||||
-#define BLOCK_1_SIZE 256
|
||||
-#define BLOCK_2_SIZE 1024
|
||||
-#define BLOCK_3_SIZE 8192
|
||||
-#define BLOCKS (BLOCK_1_NUM + BLOCK_2_NUM + BLOCK_3_NUM)
|
||||
-#define MAX_PAYLOAD_SIZE BLOCK_3_SIZE
|
||||
-#define PAYLOAD_AREA_SIZE 0xf000
|
||||
-
|
||||
struct isp1760_slotinfo {
|
||||
struct isp1760_qh *qh;
|
||||
struct isp1760_qtd *qtd;
|
||||
@@ -37,6 +19,17 @@ struct isp1760_slotinfo {
|
||||
};
|
||||
|
||||
/* chip memory management */
|
||||
+#define ISP176x_BLOCK_NUM 3
|
||||
+
|
||||
+struct isp1760_memory_layout {
|
||||
+ unsigned int blocks[ISP176x_BLOCK_NUM];
|
||||
+ unsigned int blocks_size[ISP176x_BLOCK_NUM];
|
||||
+
|
||||
+ unsigned int ptd_num;
|
||||
+ unsigned int payload_blocks;
|
||||
+ unsigned int payload_area_size;
|
||||
+};
|
||||
+
|
||||
struct isp1760_memory_chunk {
|
||||
unsigned int start;
|
||||
unsigned int size;
|
||||
@@ -58,12 +51,14 @@ struct isp1760_hcd {
|
||||
struct regmap *regs;
|
||||
struct regmap_field *fields[HC_FIELD_MAX];
|
||||
|
||||
+ const struct isp1760_memory_layout *memory_layout;
|
||||
+
|
||||
spinlock_t lock;
|
||||
- struct isp1760_slotinfo atl_slots[32];
|
||||
+ struct isp1760_slotinfo *atl_slots;
|
||||
int atl_done_map;
|
||||
- struct isp1760_slotinfo int_slots[32];
|
||||
+ struct isp1760_slotinfo *int_slots;
|
||||
int int_done_map;
|
||||
- struct isp1760_memory_chunk memory_pool[BLOCKS];
|
||||
+ struct isp1760_memory_chunk *memory_pool;
|
||||
struct list_head qh_list[QH_END];
|
||||
|
||||
/* periodic schedule support */
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.14.9]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From 3eb96e04be9918afa54b64fac943de86a9798bda Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Thu, 13 May 2021 09:47:14 +0100
|
||||
Subject: [PATCH 06/23] usb: isp1760: use dr_mode binding
|
||||
|
||||
There is already a binding to describe the dual role mode (dr_mode),
|
||||
use that instead of defining a new one (port1-otg).
|
||||
|
||||
Update driver code and devicetree files that use that port1-otg
|
||||
binding.
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210513084717.2487366-7-rui.silva@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-core.c | 3 +--
|
||||
drivers/usb/isp1760/isp1760-core.h | 2 +-
|
||||
drivers/usb/isp1760/isp1760-if.c | 5 +++--
|
||||
3 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-core.c b/drivers/usb/isp1760/isp1760-core.c
|
||||
index 35a7667e411c..0aeeb12d3bfe 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-core.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-core.c
|
||||
@@ -73,10 +73,9 @@ static void isp1760_init_core(struct isp1760_device *isp)
|
||||
* on ISP1761.
|
||||
*
|
||||
* TODO: Really support OTG. For now we configure port 1 in device mode
|
||||
- * when OTG is requested.
|
||||
*/
|
||||
if ((isp->devflags & ISP1760_FLAG_ISP1761) &&
|
||||
- (isp->devflags & ISP1760_FLAG_OTG_EN)) {
|
||||
+ (isp->devflags & ISP1760_FLAG_PERIPHERAL_EN)) {
|
||||
isp1760_field_set(hcd->fields, HW_DM_PULLDOWN);
|
||||
isp1760_field_set(hcd->fields, HW_DP_PULLDOWN);
|
||||
isp1760_field_set(hcd->fields, HW_OTG_DISABLE);
|
||||
diff --git a/drivers/usb/isp1760/isp1760-core.h b/drivers/usb/isp1760/isp1760-core.h
|
||||
index 8fec6395f19f..7a6755d68d41 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-core.h
|
||||
+++ b/drivers/usb/isp1760/isp1760-core.h
|
||||
@@ -28,7 +28,7 @@ struct gpio_desc;
|
||||
* a sane default configuration.
|
||||
*/
|
||||
#define ISP1760_FLAG_BUS_WIDTH_16 0x00000002 /* 16-bit data bus width */
|
||||
-#define ISP1760_FLAG_OTG_EN 0x00000004 /* Port 1 supports OTG */
|
||||
+#define ISP1760_FLAG_PERIPHERAL_EN 0x00000004 /* Port 1 supports Peripheral mode*/
|
||||
#define ISP1760_FLAG_ANALOG_OC 0x00000008 /* Analog overcurrent */
|
||||
#define ISP1760_FLAG_DACK_POL_HIGH 0x00000010 /* DACK active high */
|
||||
#define ISP1760_FLAG_DREQ_POL_HIGH 0x00000020 /* DREQ active high */
|
||||
diff --git a/drivers/usb/isp1760/isp1760-if.c b/drivers/usb/isp1760/isp1760-if.c
|
||||
index fb6701608cd8..cb3e4d782315 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-if.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-if.c
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/usb/hcd.h>
|
||||
+#include <linux/usb/otg.h>
|
||||
|
||||
#include "isp1760-core.h"
|
||||
#include "isp1760-regs.h"
|
||||
@@ -213,8 +214,8 @@ static int isp1760_plat_probe(struct platform_device *pdev)
|
||||
if (bus_width == 16)
|
||||
devflags |= ISP1760_FLAG_BUS_WIDTH_16;
|
||||
|
||||
- if (of_property_read_bool(dp, "port1-otg"))
|
||||
- devflags |= ISP1760_FLAG_OTG_EN;
|
||||
+ if (usb_get_dr_mode(&pdev->dev) == USB_DR_MODE_PERIPHERAL)
|
||||
+ devflags |= ISP1760_FLAG_PERIPHERAL_EN;
|
||||
|
||||
if (of_property_read_bool(dp, "analog-oc"))
|
||||
devflags |= ISP1760_FLAG_ANALOG_OC;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+1894
File diff suppressed because it is too large
Load Diff
+99
@@ -0,0 +1,99 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.14.9]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From e7a990e00cb13ce66d4008e3b77e8507be0c2e27 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Thu, 13 May 2021 09:47:16 +0100
|
||||
Subject: [PATCH 8/9] dt-bindings: usb: nxp,isp1760: add bindings
|
||||
|
||||
The nxp,isp1760 driver is old in the tree, but did not had a bindings
|
||||
entry, since I am extend it to support isp1763 in the same family, use
|
||||
this to add a proper yaml bindings file.
|
||||
|
||||
Reviewed-by: Rob Herring <robh@kernel.org>
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210513084717.2487366-9-rui.silva@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
.../devicetree/bindings/usb/nxp,isp1760.yaml | 69 +++++++++++++++++++
|
||||
1 file changed, 69 insertions(+)
|
||||
create mode 100644 Documentation/devicetree/bindings/usb/nxp,isp1760.yaml
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/usb/nxp,isp1760.yaml b/Documentation/devicetree/bindings/usb/nxp,isp1760.yaml
|
||||
new file mode 100644
|
||||
index 000000000000..a88f99adfe8e
|
||||
--- /dev/null
|
||||
+++ b/Documentation/devicetree/bindings/usb/nxp,isp1760.yaml
|
||||
@@ -0,0 +1,69 @@
|
||||
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
+%YAML 1.2
|
||||
+---
|
||||
+$id: http://devicetree.org/schemas/usb/nxp,isp1760.yaml#
|
||||
+$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
+
|
||||
+title: NXP ISP1760 family controller bindings
|
||||
+
|
||||
+maintainers:
|
||||
+ - Sebastian Siewior <bigeasy@linutronix.de>
|
||||
+ - Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
||||
+
|
||||
+description: |
|
||||
+ NXP ISP1760 family, which includes ISP1760/1761/1763 devicetree controller
|
||||
+ bindings
|
||||
+
|
||||
+properties:
|
||||
+ compatible:
|
||||
+ enum:
|
||||
+ - nxp,usb-isp1760
|
||||
+ - nxp,usb-isp1761
|
||||
+ - nxp,usb-isp1763
|
||||
+ reg:
|
||||
+ maxItems: 1
|
||||
+
|
||||
+ interrupts:
|
||||
+ minItems: 1
|
||||
+ maxItems: 2
|
||||
+ items:
|
||||
+ - description: Host controller interrupt
|
||||
+ - description: Device controller interrupt in isp1761
|
||||
+
|
||||
+ interrupt-names:
|
||||
+ minItems: 1
|
||||
+ maxItems: 2
|
||||
+ items:
|
||||
+ - const: host
|
||||
+ - const: peripheral
|
||||
+
|
||||
+ bus-width:
|
||||
+ description:
|
||||
+ Number of data lines.
|
||||
+ enum: [8, 16, 32]
|
||||
+ default: 32
|
||||
+
|
||||
+ dr_mode:
|
||||
+ enum:
|
||||
+ - host
|
||||
+ - peripheral
|
||||
+
|
||||
+required:
|
||||
+ - compatible
|
||||
+ - reg
|
||||
+ - interrupts
|
||||
+
|
||||
+additionalProperties: false
|
||||
+
|
||||
+examples:
|
||||
+ - |
|
||||
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
+ usb@40200000 {
|
||||
+ compatible = "nxp,usb-isp1763";
|
||||
+ reg = <0x40200000 0x100000>;
|
||||
+ interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ bus-width = <16>;
|
||||
+ dr_mode = "host";
|
||||
+ };
|
||||
+
|
||||
+...
|
||||
--
|
||||
2.32.0
|
||||
|
||||
+303
@@ -0,0 +1,303 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.14.9]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From d369c9187c1897ce5339716354ce47b2c2f67352 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Thu, 13 May 2021 09:47:17 +0100
|
||||
Subject: [PATCH 08/23] usb: isp1763: add peripheral mode
|
||||
|
||||
Besides the already host mode support add peripheral mode support for
|
||||
the isp1763 IP from the isp1760 family.
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210513084717.2487366-10-rui.silva@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-core.c | 25 +++++++++++------
|
||||
drivers/usb/isp1760/isp1760-regs.h | 42 ++++++++++++++++++++++++++++
|
||||
drivers/usb/isp1760/isp1760-udc.c | 45 ++++++++++++++++++++++--------
|
||||
drivers/usb/isp1760/isp1760-udc.h | 1 +
|
||||
4 files changed, 94 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-core.c b/drivers/usb/isp1760/isp1760-core.c
|
||||
index 1d847f13abab..ff07e2890692 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-core.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-core.c
|
||||
@@ -83,7 +83,8 @@ static int isp1760_init_core(struct isp1760_device *isp)
|
||||
*
|
||||
* TODO: Really support OTG. For now we configure port 1 in device mode
|
||||
*/
|
||||
- if ((isp->devflags & ISP1760_FLAG_ISP1761) &&
|
||||
+ if (((isp->devflags & ISP1760_FLAG_ISP1761) ||
|
||||
+ (isp->devflags & ISP1760_FLAG_ISP1763)) &&
|
||||
(isp->devflags & ISP1760_FLAG_PERIPHERAL_EN)) {
|
||||
isp1760_field_set(hcd->fields, HW_DM_PULLDOWN);
|
||||
isp1760_field_set(hcd->fields, HW_DP_PULLDOWN);
|
||||
@@ -470,13 +471,15 @@ static const struct regmap_config isp1763_dc_regmap_conf = {
|
||||
int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
|
||||
struct device *dev, unsigned int devflags)
|
||||
{
|
||||
- bool udc_disabled = !(devflags & ISP1760_FLAG_ISP1761);
|
||||
const struct regmap_config *hc_regmap;
|
||||
const struct reg_field *hc_reg_fields;
|
||||
+ const struct regmap_config *dc_regmap;
|
||||
+ const struct reg_field *dc_reg_fields;
|
||||
struct isp1760_device *isp;
|
||||
struct isp1760_hcd *hcd;
|
||||
struct isp1760_udc *udc;
|
||||
struct regmap_field *f;
|
||||
+ bool udc_enabled;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
@@ -484,8 +487,11 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
|
||||
* If neither the HCD not the UDC is enabled return an error, as no
|
||||
* device would be registered.
|
||||
*/
|
||||
+ udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
|
||||
+ (devflags & ISP1760_FLAG_ISP1761));
|
||||
+
|
||||
if ((!IS_ENABLED(CONFIG_USB_ISP1760_HCD) || usb_disabled()) &&
|
||||
- (!IS_ENABLED(CONFIG_USB_ISP1761_UDC) || udc_disabled))
|
||||
+ (!IS_ENABLED(CONFIG_USB_ISP1761_UDC) || !udc_enabled))
|
||||
return -ENODEV;
|
||||
|
||||
isp = devm_kzalloc(dev, sizeof(*isp), GFP_KERNEL);
|
||||
@@ -498,6 +504,7 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
|
||||
udc = &isp->udc;
|
||||
|
||||
hcd->is_isp1763 = !!(devflags & ISP1760_FLAG_ISP1763);
|
||||
+ udc->is_isp1763 = !!(devflags & ISP1760_FLAG_ISP1763);
|
||||
|
||||
if (!hcd->is_isp1763 && (devflags & ISP1760_FLAG_BUS_WIDTH_8)) {
|
||||
dev_err(dev, "isp1760/61 do not support data width 8\n");
|
||||
@@ -507,9 +514,13 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
|
||||
if (hcd->is_isp1763) {
|
||||
hc_regmap = &isp1763_hc_regmap_conf;
|
||||
hc_reg_fields = &isp1763_hc_reg_fields[0];
|
||||
+ dc_regmap = &isp1763_dc_regmap_conf;
|
||||
+ dc_reg_fields = &isp1763_dc_reg_fields[0];
|
||||
} else {
|
||||
hc_regmap = &isp1760_hc_regmap_conf;
|
||||
hc_reg_fields = &isp1760_hc_reg_fields[0];
|
||||
+ dc_regmap = &isp1761_dc_regmap_conf;
|
||||
+ dc_reg_fields = &isp1761_dc_reg_fields[0];
|
||||
}
|
||||
|
||||
isp->rst_gpio = devm_gpiod_get_optional(dev, NULL, GPIOD_OUT_HIGH);
|
||||
@@ -532,14 +543,12 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
|
||||
hcd->fields[i] = f;
|
||||
}
|
||||
|
||||
- udc->regs = devm_regmap_init_mmio(dev, hcd->base,
|
||||
- &isp1761_dc_regmap_conf);
|
||||
+ udc->regs = devm_regmap_init_mmio(dev, hcd->base, dc_regmap);
|
||||
if (IS_ERR(udc->regs))
|
||||
return PTR_ERR(udc->regs);
|
||||
|
||||
for (i = 0; i < DC_FIELD_MAX; i++) {
|
||||
- f = devm_regmap_field_alloc(dev, udc->regs,
|
||||
- isp1761_dc_reg_fields[i]);
|
||||
+ f = devm_regmap_field_alloc(dev, udc->regs, dc_reg_fields[i]);
|
||||
if (IS_ERR(f))
|
||||
return PTR_ERR(f);
|
||||
|
||||
@@ -562,7 +571,7 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
|
||||
return ret;
|
||||
}
|
||||
|
||||
- if (IS_ENABLED(CONFIG_USB_ISP1761_UDC) && !udc_disabled) {
|
||||
+ if (IS_ENABLED(CONFIG_USB_ISP1761_UDC) && udc_enabled) {
|
||||
ret = isp1760_udc_register(isp, irq, irqflags);
|
||||
if (ret < 0) {
|
||||
isp1760_hcd_unregister(hcd);
|
||||
diff --git a/drivers/usb/isp1760/isp1760-regs.h b/drivers/usb/isp1760/isp1760-regs.h
|
||||
index 4f632cbbbd1f..94ea60c20b2a 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-regs.h
|
||||
+++ b/drivers/usb/isp1760/isp1760-regs.h
|
||||
@@ -243,8 +243,50 @@ enum isp176x_device_controller_fields {
|
||||
DC_EPENABLE, DC_ENDPTYP,
|
||||
/* DC_FRAMENUM */
|
||||
DC_FRAMENUM, DC_UFRAMENUM,
|
||||
+ /* DC_CHIP_ID */
|
||||
+ DC_CHIP_ID_HIGH, DC_CHIP_ID_LOW,
|
||||
+ /* DC_SCRATCH */
|
||||
+ DC_SCRATCH,
|
||||
/* Last element */
|
||||
DC_FIELD_MAX,
|
||||
};
|
||||
|
||||
+/* ISP1763 */
|
||||
+/* Initialization Registers */
|
||||
+#define ISP1763_DC_ADDRESS 0x00
|
||||
+#define ISP1763_DC_MODE 0x0c
|
||||
+#define ISP1763_DC_INTCONF 0x10
|
||||
+#define ISP1763_DC_INTENABLE 0x14
|
||||
+
|
||||
+/* Data Flow Registers */
|
||||
+#define ISP1763_DC_EPMAXPKTSZ 0x04
|
||||
+#define ISP1763_DC_EPTYPE 0x08
|
||||
+
|
||||
+#define ISP1763_DC_BUFLEN 0x1c
|
||||
+#define ISP1763_DC_BUFSTAT 0x1e
|
||||
+#define ISP1763_DC_DATAPORT 0x20
|
||||
+
|
||||
+#define ISP1763_DC_CTRLFUNC 0x28
|
||||
+#define ISP1763_DC_EPINDEX 0x2c
|
||||
+
|
||||
+/* DMA Registers */
|
||||
+#define ISP1763_DC_DMACMD 0x30
|
||||
+#define ISP1763_DC_DMATXCOUNT 0x34
|
||||
+#define ISP1763_DC_DMACONF 0x38
|
||||
+#define ISP1763_DC_DMAHW 0x3c
|
||||
+#define ISP1763_DC_DMAINTREASON 0x50
|
||||
+#define ISP1763_DC_DMAINTEN 0x54
|
||||
+#define ISP1763_DC_DMAEP 0x58
|
||||
+#define ISP1763_DC_DMABURSTCOUNT 0x64
|
||||
+
|
||||
+/* General Registers */
|
||||
+#define ISP1763_DC_INTERRUPT 0x18
|
||||
+#define ISP1763_DC_CHIPID_LOW 0x70
|
||||
+#define ISP1763_DC_CHIPID_HIGH 0x72
|
||||
+#define ISP1763_DC_FRAMENUM 0x74
|
||||
+#define ISP1763_DC_SCRATCH 0x78
|
||||
+#define ISP1763_DC_UNLOCKDEV 0x7c
|
||||
+#define ISP1763_DC_INTPULSEWIDTH 0x80
|
||||
+#define ISP1763_DC_TESTMODE 0x84
|
||||
+
|
||||
#endif
|
||||
diff --git a/drivers/usb/isp1760/isp1760-udc.c b/drivers/usb/isp1760/isp1760-udc.c
|
||||
index 30efc9d32506..3e05e3605435 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-udc.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-udc.c
|
||||
@@ -1151,6 +1151,10 @@ static void isp1760_udc_disconnect(struct isp1760_udc *udc)
|
||||
|
||||
static void isp1760_udc_init_hw(struct isp1760_udc *udc)
|
||||
{
|
||||
+ u32 intconf = udc->is_isp1763 ? ISP1763_DC_INTCONF : ISP176x_DC_INTCONF;
|
||||
+ u32 intena = udc->is_isp1763 ? ISP1763_DC_INTENABLE :
|
||||
+ ISP176x_DC_INTENABLE;
|
||||
+
|
||||
/*
|
||||
* The device controller currently shares its interrupt with the host
|
||||
* controller, the DC_IRQ polarity and signaling mode are ignored. Set
|
||||
@@ -1160,11 +1164,11 @@ static void isp1760_udc_init_hw(struct isp1760_udc *udc)
|
||||
* ACK tokens only (and NYET for the out pipe). The default
|
||||
* configuration also generates an interrupt on the first NACK token.
|
||||
*/
|
||||
- isp1760_reg_write(udc->regs, ISP176x_DC_INTCONF,
|
||||
+ isp1760_reg_write(udc->regs, intconf,
|
||||
ISP176x_DC_CDBGMOD_ACK | ISP176x_DC_DDBGMODIN_ACK |
|
||||
ISP176x_DC_DDBGMODOUT_ACK);
|
||||
|
||||
- isp1760_reg_write(udc->regs, ISP176x_DC_INTENABLE, DC_IEPRXTX(7) |
|
||||
+ isp1760_reg_write(udc->regs, intena, DC_IEPRXTX(7) |
|
||||
DC_IEPRXTX(6) | DC_IEPRXTX(5) | DC_IEPRXTX(4) |
|
||||
DC_IEPRXTX(3) | DC_IEPRXTX(2) | DC_IEPRXTX(1) |
|
||||
DC_IEPRXTX(0) | ISP176x_DC_IEP0SETUP |
|
||||
@@ -1304,13 +1308,14 @@ static int isp1760_udc_start(struct usb_gadget *gadget,
|
||||
static int isp1760_udc_stop(struct usb_gadget *gadget)
|
||||
{
|
||||
struct isp1760_udc *udc = gadget_to_udc(gadget);
|
||||
+ u32 mode_reg = udc->is_isp1763 ? ISP1763_DC_MODE : ISP176x_DC_MODE;
|
||||
unsigned long flags;
|
||||
|
||||
dev_dbg(udc->isp->dev, "%s\n", __func__);
|
||||
|
||||
del_timer_sync(&udc->vbus_timer);
|
||||
|
||||
- isp1760_reg_write(udc->regs, ISP176x_DC_MODE, 0);
|
||||
+ isp1760_reg_write(udc->regs, mode_reg, 0);
|
||||
|
||||
spin_lock_irqsave(&udc->lock, flags);
|
||||
udc->driver = NULL;
|
||||
@@ -1332,15 +1337,30 @@ static const struct usb_gadget_ops isp1760_udc_ops = {
|
||||
* Interrupt Handling
|
||||
*/
|
||||
|
||||
+static u32 isp1760_udc_irq_get_status(struct isp1760_udc *udc)
|
||||
+{
|
||||
+ u32 status;
|
||||
+
|
||||
+ if (udc->is_isp1763) {
|
||||
+ status = isp1760_reg_read(udc->regs, ISP1763_DC_INTERRUPT)
|
||||
+ & isp1760_reg_read(udc->regs, ISP1763_DC_INTENABLE);
|
||||
+ isp1760_reg_write(udc->regs, ISP1763_DC_INTERRUPT, status);
|
||||
+ } else {
|
||||
+ status = isp1760_reg_read(udc->regs, ISP176x_DC_INTERRUPT)
|
||||
+ & isp1760_reg_read(udc->regs, ISP176x_DC_INTENABLE);
|
||||
+ isp1760_reg_write(udc->regs, ISP176x_DC_INTERRUPT, status);
|
||||
+ }
|
||||
+
|
||||
+ return status;
|
||||
+}
|
||||
+
|
||||
static irqreturn_t isp1760_udc_irq(int irq, void *dev)
|
||||
{
|
||||
struct isp1760_udc *udc = dev;
|
||||
unsigned int i;
|
||||
u32 status;
|
||||
|
||||
- status = isp1760_reg_read(udc->regs, ISP176x_DC_INTERRUPT)
|
||||
- & isp1760_reg_read(udc->regs, ISP176x_DC_INTENABLE);
|
||||
- isp1760_reg_write(udc->regs, ISP176x_DC_INTERRUPT, status);
|
||||
+ status = isp1760_udc_irq_get_status(udc);
|
||||
|
||||
if (status & DC_IEVBUS) {
|
||||
dev_dbg(udc->isp->dev, "%s(VBUS)\n", __func__);
|
||||
@@ -1475,6 +1495,7 @@ static void isp1760_udc_init_eps(struct isp1760_udc *udc)
|
||||
|
||||
static int isp1760_udc_init(struct isp1760_udc *udc)
|
||||
{
|
||||
+ u32 mode_reg = udc->is_isp1763 ? ISP1763_DC_MODE : ISP176x_DC_MODE;
|
||||
u16 scratch;
|
||||
u32 chipid;
|
||||
|
||||
@@ -1484,9 +1505,10 @@ static int isp1760_udc_init(struct isp1760_udc *udc)
|
||||
* register, and reading the scratch register value back. The chip ID
|
||||
* and scratch register contents must match the expected values.
|
||||
*/
|
||||
- isp1760_reg_write(udc->regs, ISP176x_DC_SCRATCH, 0xbabe);
|
||||
- chipid = isp1760_reg_read(udc->regs, ISP176x_DC_CHIPID);
|
||||
- scratch = isp1760_reg_read(udc->regs, ISP176x_DC_SCRATCH);
|
||||
+ isp1760_udc_write(udc, DC_SCRATCH, 0xbabe);
|
||||
+ chipid = isp1760_udc_read(udc, DC_CHIP_ID_HIGH) << 16;
|
||||
+ chipid |= isp1760_udc_read(udc, DC_CHIP_ID_LOW);
|
||||
+ scratch = isp1760_udc_read(udc, DC_SCRATCH);
|
||||
|
||||
if (scratch != 0xbabe) {
|
||||
dev_err(udc->isp->dev,
|
||||
@@ -1495,7 +1517,8 @@ static int isp1760_udc_init(struct isp1760_udc *udc)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
- if (chipid != 0x00011582 && chipid != 0x00158210) {
|
||||
+ if (chipid != 0x00011582 && chipid != 0x00158210 &&
|
||||
+ chipid != 0x00176320) {
|
||||
dev_err(udc->isp->dev, "udc: invalid chip ID 0x%08x\n", chipid);
|
||||
return -ENODEV;
|
||||
}
|
||||
@@ -1503,7 +1526,7 @@ static int isp1760_udc_init(struct isp1760_udc *udc)
|
||||
/* Reset the device controller. */
|
||||
isp1760_udc_set(udc, DC_SFRESET);
|
||||
usleep_range(10000, 11000);
|
||||
- isp1760_reg_write(udc->regs, ISP176x_DC_MODE, 0);
|
||||
+ isp1760_reg_write(udc->regs, mode_reg, 0);
|
||||
usleep_range(10000, 11000);
|
||||
|
||||
return 0;
|
||||
diff --git a/drivers/usb/isp1760/isp1760-udc.h b/drivers/usb/isp1760/isp1760-udc.h
|
||||
index f2ab5929cc9f..22044e86bc0e 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-udc.h
|
||||
+++ b/drivers/usb/isp1760/isp1760-udc.h
|
||||
@@ -84,6 +84,7 @@ struct isp1760_udc {
|
||||
u16 ep0_length;
|
||||
|
||||
bool connected;
|
||||
+ bool is_isp1763;
|
||||
|
||||
unsigned int devstatus;
|
||||
};
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.15]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From 8268acfe1cc967dbe9fbb05b5f07a19675a81cff Mon Sep 17 00:00:00 2001
|
||||
From: Lee Jones <lee.jones@linaro.org>
|
||||
Date: Wed, 26 May 2021 14:00:19 +0100
|
||||
Subject: [PATCH 09/23] usb: isp1760: isp1760-udc: Provide missing description
|
||||
for 'udc' param
|
||||
|
||||
Fixes the following W=1 kernel build warning(s):
|
||||
|
||||
drivers/usb/isp1760/isp1760-udc.c:150: warning: Function parameter or member 'udc' not described in 'isp1760_udc_select_ep'
|
||||
|
||||
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
Cc: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
||||
Cc: linux-usb@vger.kernel.org
|
||||
Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Signed-off-by: Lee Jones <lee.jones@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210526130037.856068-7-lee.jones@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-udc.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-udc.c b/drivers/usb/isp1760/isp1760-udc.c
|
||||
index 3e05e3605435..a78da59d6417 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-udc.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-udc.c
|
||||
@@ -137,6 +137,7 @@ static void __isp1760_udc_select_ep(struct isp1760_udc *udc,
|
||||
/**
|
||||
* isp1760_udc_select_ep - Select an endpoint for register access
|
||||
* @ep: The endpoint
|
||||
+ * @udc: Reference to the device controller
|
||||
*
|
||||
* The ISP1761 endpoint registers are banked. This function selects the target
|
||||
* endpoint for banked register access. The selection remains valid until the
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.15]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From 5f4dee73a4bc25a7781a5406b49439bc640981c2 Mon Sep 17 00:00:00 2001
|
||||
From: Tong Tiangen <tongtiangen@huawei.com>
|
||||
Date: Fri, 11 Jun 2021 09:40:55 +0800
|
||||
Subject: [PATCH 10/23] usb: isp1760: Fix meaningless check in isp1763_run()
|
||||
|
||||
Remove attribution to retval before check, which make it completely
|
||||
meaningless, and does't check what it was supposed: the return
|
||||
value of the timed function to set up configuration flag.
|
||||
|
||||
Fixes: 60d789f3bfbb ("usb: isp1760: add support for isp1763")
|
||||
Tested-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>
|
||||
Link: https://lore.kernel.org/r/20210611014055.68551-1-tongtiangen@huawei.com
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-hcd.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
index 016a54ea76f4..27168b4a4ef2 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-hcd.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
@@ -1648,7 +1648,6 @@ static int isp1763_run(struct usb_hcd *hcd)
|
||||
down_write(&ehci_cf_port_reset_rwsem);
|
||||
retval = isp1760_hcd_set_and_wait(hcd, FLAG_CF, 250 * 1000);
|
||||
up_write(&ehci_cf_port_reset_rwsem);
|
||||
- retval = 0;
|
||||
if (retval)
|
||||
return retval;
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.15]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From 7de14c88272c05d86fce83a5cead36832ce3a424 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Tue, 27 Jul 2021 11:05:14 +0100
|
||||
Subject: [PATCH 11/23] usb: isp1760: remove debug message as error
|
||||
|
||||
Remove debug message leftover from the boot error buffer.
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210727100516.4190681-2-rui.silva@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-hcd.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
index 27168b4a4ef2..a745c4c2b773 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-hcd.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
@@ -733,7 +733,6 @@ static int isp1760_hc_setup(struct usb_hcd *hcd)
|
||||
|
||||
/* Change bus pattern */
|
||||
scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
|
||||
- dev_err(hcd->self.controller, "Scratch test 0x%08x\n", scratch);
|
||||
scratch = isp1760_hcd_read(hcd, HC_SCRATCH);
|
||||
if (scratch != pattern) {
|
||||
dev_err(hcd->self.controller, "Scratch test failed. 0x%08x\n", scratch);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.14.9]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From 41f673183862a183d4ea0522c045fabfbd1b28c8 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Tue, 27 Jul 2021 11:05:15 +0100
|
||||
Subject: [PATCH 12/23] usb: isp1760: do not sleep in field register poll
|
||||
|
||||
When polling for a setup or clear of a register field we were sleeping
|
||||
in atomic context but using a very tight sleep interval.
|
||||
|
||||
Since the use cases for this poll mechanism are only in setup and
|
||||
stop paths, and in practice this poll is not used most of the times
|
||||
but needs to be there to comply to hardware setup times, remove the
|
||||
sleep time and make the poll loop tighter.
|
||||
|
||||
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210727100516.4190681-3-rui.silva@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-hcd.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
index a745c4c2b773..a018394d54f8 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-hcd.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
@@ -250,7 +250,7 @@ static int isp1760_hcd_set_and_wait(struct usb_hcd *hcd, u32 field,
|
||||
isp1760_hcd_set(hcd, field);
|
||||
|
||||
return regmap_field_read_poll_timeout(priv->fields[field], val,
|
||||
- val, 10, timeout_us);
|
||||
+ val, 0, timeout_us);
|
||||
}
|
||||
|
||||
static int isp1760_hcd_set_and_wait_swap(struct usb_hcd *hcd, u32 field,
|
||||
@@ -262,7 +262,7 @@ static int isp1760_hcd_set_and_wait_swap(struct usb_hcd *hcd, u32 field,
|
||||
isp1760_hcd_set(hcd, field);
|
||||
|
||||
return regmap_field_read_poll_timeout(priv->fields[field], val,
|
||||
- !val, 10, timeout_us);
|
||||
+ !val, 0, timeout_us);
|
||||
}
|
||||
|
||||
static int isp1760_hcd_clear_and_wait(struct usb_hcd *hcd, u32 field,
|
||||
@@ -274,7 +274,7 @@ static int isp1760_hcd_clear_and_wait(struct usb_hcd *hcd, u32 field,
|
||||
isp1760_hcd_clear(hcd, field);
|
||||
|
||||
return regmap_field_read_poll_timeout(priv->fields[field], val,
|
||||
- !val, 10, timeout_us);
|
||||
+ !val, 0, timeout_us);
|
||||
}
|
||||
|
||||
static bool isp1760_hcd_is_set(struct usb_hcd *hcd, u32 field)
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.15]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From cbbdb3fe0d974d655c87c3e6ba2990d5496b9f82 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Tue, 27 Jul 2021 11:05:16 +0100
|
||||
Subject: [PATCH 13/23] usb: isp1760: rework cache initialization error
|
||||
handling
|
||||
|
||||
If we fail to create qtd cache we were not destroying the
|
||||
urb_listitem, rework the error handling logic to cope with that.
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210727100516.4190681-4-rui.silva@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-hcd.c | 16 +++++++++++-----
|
||||
1 file changed, 11 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
index a018394d54f8..825be736be33 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-hcd.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
@@ -2527,17 +2527,23 @@ int __init isp1760_init_kmem_once(void)
|
||||
SLAB_MEM_SPREAD, NULL);
|
||||
|
||||
if (!qtd_cachep)
|
||||
- return -ENOMEM;
|
||||
+ goto destroy_urb_listitem;
|
||||
|
||||
qh_cachep = kmem_cache_create("isp1760_qh", sizeof(struct isp1760_qh),
|
||||
0, SLAB_TEMPORARY | SLAB_MEM_SPREAD, NULL);
|
||||
|
||||
- if (!qh_cachep) {
|
||||
- kmem_cache_destroy(qtd_cachep);
|
||||
- return -ENOMEM;
|
||||
- }
|
||||
+ if (!qh_cachep)
|
||||
+ goto destroy_qtd;
|
||||
|
||||
return 0;
|
||||
+
|
||||
+destroy_qtd:
|
||||
+ kmem_cache_destroy(qtd_cachep);
|
||||
+
|
||||
+destroy_urb_listitem:
|
||||
+ kmem_cache_destroy(urb_listitem_cachep);
|
||||
+
|
||||
+ return -ENOMEM;
|
||||
}
|
||||
|
||||
void isp1760_deinit_kmem_cache(void)
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.15]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From 8472896f39cfab2d8fec9ca746070aaf02609169 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Thu, 19 Aug 2021 19:09:25 +0100
|
||||
Subject: [PATCH 14/23] usb: isp1760: ignore return value for bus change
|
||||
pattern
|
||||
|
||||
We do not care about the return value of that read between the
|
||||
scratch register write and read, we really just want to make sure that
|
||||
the pattern in the bus get changed to make sure we are testing
|
||||
correctly the scratch pattern.
|
||||
|
||||
Clang-analyzer complains about the never read scratch variable:
|
||||
>> drivers/usb/isp1760/isp1760-hcd.c:735:2: warning: Value stored to 'scratch' is never read [clang-analyzer-deadcode.DeadStores]
|
||||
scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
|
||||
|
||||
Just ignore the return value of that CHIP_ID_HIGH read, add more
|
||||
information to the comment above why we are doing this. And as at it,
|
||||
just do a small format change in the error message bellow.
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210819180929.1327349-2-rui.silva@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-hcd.c | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
index 825be736be33..2a21fe5aa7a8 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-hcd.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
@@ -731,11 +731,15 @@ static int isp1760_hc_setup(struct usb_hcd *hcd)
|
||||
|
||||
isp1760_hcd_write(hcd, HC_SCRATCH, pattern);
|
||||
|
||||
- /* Change bus pattern */
|
||||
- scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
|
||||
+ /*
|
||||
+ * we do not care about the read value here we just want to
|
||||
+ * change bus pattern.
|
||||
+ */
|
||||
+ isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH);
|
||||
scratch = isp1760_hcd_read(hcd, HC_SCRATCH);
|
||||
if (scratch != pattern) {
|
||||
- dev_err(hcd->self.controller, "Scratch test failed. 0x%08x\n", scratch);
|
||||
+ dev_err(hcd->self.controller, "Scratch test failed. 0x%08x\n",
|
||||
+ scratch);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.15]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From 8e58b7710d6634ed46ae26fedb8459f84f08fd51 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Thu, 19 Aug 2021 19:09:26 +0100
|
||||
Subject: [PATCH 15/23] usb: isp1760: check maxpacketsize before using it
|
||||
|
||||
When checking if we need one more packet on a bulk pipe we may, even
|
||||
though not probable at all, get there with a zero maxpacketsize.
|
||||
In that case for sure no packet, no even a one more, will be
|
||||
allocated.
|
||||
|
||||
This will clean the clang-analyzer warning:
|
||||
drivers/usb/isp1760/isp1760-hcd.c:1856:38: warning: Division by zero [clang-analyzer-core.DivideZero]
|
||||
&& !(urb->transfer_buffer_length %
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210819180929.1327349-3-rui.silva@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-hcd.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
index 2a21fe5aa7a8..5c947a1eae49 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-hcd.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
@@ -1854,7 +1854,7 @@ static void packetize_urb(struct usb_hcd *hcd,
|
||||
packet_type = OUT_PID;
|
||||
else
|
||||
packet_type = IN_PID;
|
||||
- } else if (usb_pipebulk(urb->pipe)
|
||||
+ } else if (usb_pipebulk(urb->pipe) && maxpacketsize
|
||||
&& (urb->transfer_flags & URB_ZERO_PACKET)
|
||||
&& !(urb->transfer_buffer_length %
|
||||
maxpacketsize)) {
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.15]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From 5e4cd1b6556302fe6a457e525c256cbef3563543 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Thu, 19 Aug 2021 19:09:27 +0100
|
||||
Subject: [PATCH 16/23] usb: isp1760: do not reset retval
|
||||
|
||||
We do not really need to reset retval before get used bellow.
|
||||
This will avoid the clang-analyzer warning:
|
||||
|
||||
drivers/usb/isp1760/isp1760-hcd.c:1919:2: warning: Value stored to 'retval' is never read [clang-analyzer-deadcode.DeadStores]
|
||||
retval = 0;
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210819180929.1327349-4-rui.silva@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-hcd.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
index 5c947a1eae49..aed2714ce0cf 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-hcd.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
@@ -1919,7 +1919,6 @@ static int isp1760_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
|
||||
if (list_empty(&new_qtds))
|
||||
return -ENOMEM;
|
||||
|
||||
- retval = 0;
|
||||
spin_lock_irqsave(&priv->lock, spinflags);
|
||||
|
||||
if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.15]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From 7d1d3882fd9da1ee42fe3ad3a5ffd41fb8204380 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Thu, 19 Aug 2021 19:09:28 +0100
|
||||
Subject: [PATCH 17/23] usb: isp1760: do not shift in uninitialized slot
|
||||
|
||||
Even though it is not expected, and would trigger a WARN_ON, killing a
|
||||
transfer in a uninitialized slot this sequence is warned by clang
|
||||
analyzer, twice:
|
||||
|
||||
drivers/usb/isp1760/isp1760-hcd.c:1976:18: warning: The result of the left shift is undefined because the right operand is negative [clang-analyzer-core.UndefinedBinaryOperatorResult]
|
||||
skip_map |= (1 << qh->slot);
|
||||
drivers/usb/isp1760/isp1760-hcd.c:1983:18: warning: The result of the left shift is undefined because the right operand is negative [clang-analyzer-core.UndefinedBinaryOperatorResult]
|
||||
skip_map |= (1 << qh->slot);
|
||||
|
||||
Only set skip map if slot is active.
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210819180929.1327349-5-rui.silva@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-hcd.c | 18 +++++++++++-------
|
||||
1 file changed, 11 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
index aed2714ce0cf..bf8ab3fe2e5a 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-hcd.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
@@ -1974,16 +1974,20 @@ static void kill_transfer(struct usb_hcd *hcd, struct urb *urb,
|
||||
/* We need to forcefully reclaim the slot since some transfers never
|
||||
return, e.g. interrupt transfers and NAKed bulk transfers. */
|
||||
if (usb_pipecontrol(urb->pipe) || usb_pipebulk(urb->pipe)) {
|
||||
- skip_map = isp1760_hcd_read(hcd, HC_ATL_PTD_SKIPMAP);
|
||||
- skip_map |= (1 << qh->slot);
|
||||
- isp1760_hcd_write(hcd, HC_ATL_PTD_SKIPMAP, skip_map);
|
||||
- ndelay(100);
|
||||
+ if (qh->slot != -1) {
|
||||
+ skip_map = isp1760_hcd_read(hcd, HC_ATL_PTD_SKIPMAP);
|
||||
+ skip_map |= (1 << qh->slot);
|
||||
+ isp1760_hcd_write(hcd, HC_ATL_PTD_SKIPMAP, skip_map);
|
||||
+ ndelay(100);
|
||||
+ }
|
||||
priv->atl_slots[qh->slot].qh = NULL;
|
||||
priv->atl_slots[qh->slot].qtd = NULL;
|
||||
} else {
|
||||
- skip_map = isp1760_hcd_read(hcd, HC_INT_PTD_SKIPMAP);
|
||||
- skip_map |= (1 << qh->slot);
|
||||
- isp1760_hcd_write(hcd, HC_INT_PTD_SKIPMAP, skip_map);
|
||||
+ if (qh->slot != -1) {
|
||||
+ skip_map = isp1760_hcd_read(hcd, HC_INT_PTD_SKIPMAP);
|
||||
+ skip_map |= (1 << qh->slot);
|
||||
+ isp1760_hcd_write(hcd, HC_INT_PTD_SKIPMAP, skip_map);
|
||||
+ }
|
||||
priv->int_slots[qh->slot].qh = NULL;
|
||||
priv->int_slots[qh->slot].qtd = NULL;
|
||||
}
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.15]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From de940244e8987a76d73fb2b0057ecd494cbfeefd Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Thu, 19 Aug 2021 19:09:29 +0100
|
||||
Subject: [PATCH 18/23] usb: isp1760: clean never read udc_enabled warning
|
||||
|
||||
When CONFIG_USB_ISP1761_UDC is not enabled the udc_enabled variable is
|
||||
never used since it is short circuited before in the logic operations.
|
||||
|
||||
This would trigger the following warning by clang analyzer:
|
||||
|
||||
drivers/usb/isp1760/isp1760-core.c:490:2: warning: Value stored to 'udc_enabled' is never read [clang-analyzer-deadcode.DeadStores]
|
||||
udc_enabled = ((devflags & ISP1760_FLAG_ISP1763) ||
|
||||
^
|
||||
drivers/usb/isp1760/isp1760-core.c:490:2: note: Value stored to 'udc_enabled' is never read
|
||||
|
||||
Just swap the other of the operands in the logic operations.
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Link: https://lore.kernel.org/r/20210819180929.1327349-6-rui.silva@linaro.org
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-core.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-core.c b/drivers/usb/isp1760/isp1760-core.c
|
||||
index ff07e2890692..cb70f9d63cdd 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-core.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-core.c
|
||||
@@ -491,7 +491,7 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
|
||||
(devflags & ISP1760_FLAG_ISP1761));
|
||||
|
||||
if ((!IS_ENABLED(CONFIG_USB_ISP1760_HCD) || usb_disabled()) &&
|
||||
- (!IS_ENABLED(CONFIG_USB_ISP1761_UDC) || !udc_enabled))
|
||||
+ (!udc_enabled || !IS_ENABLED(CONFIG_USB_ISP1761_UDC)))
|
||||
return -ENODEV;
|
||||
|
||||
isp = devm_kzalloc(dev, sizeof(*isp), GFP_KERNEL);
|
||||
@@ -571,7 +571,7 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
|
||||
return ret;
|
||||
}
|
||||
|
||||
- if (IS_ENABLED(CONFIG_USB_ISP1761_UDC) && udc_enabled) {
|
||||
+ if (udc_enabled && IS_ENABLED(CONFIG_USB_ISP1761_UDC)) {
|
||||
ret = isp1760_udc_register(isp, irq, irqflags);
|
||||
if (ret < 0) {
|
||||
isp1760_hcd_unregister(hcd);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.14.9]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From d36713c344e0c963178e417911d2cd867597d2f0 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Fri, 27 Aug 2021 01:27:40 +0100
|
||||
Subject: [PATCH 19/23] usb: isp1760: fix memory pool initialization
|
||||
|
||||
The loops to setup the memory pool were skipping some
|
||||
blocks, that was not visible on the ISP1763 because it has
|
||||
fewer blocks than the ISP1761. But won testing on that IP
|
||||
from the family that would be an issue.
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-hcd.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
index bf8ab3fe2e5a..b3a55c5d2155 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-hcd.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
@@ -588,8 +588,8 @@ static void init_memory(struct isp1760_hcd *priv)
|
||||
|
||||
payload_addr = PAYLOAD_OFFSET;
|
||||
|
||||
- for (i = 0, curr = 0; i < ARRAY_SIZE(mem->blocks); i++) {
|
||||
- for (j = 0; j < mem->blocks[i]; j++, curr++) {
|
||||
+ for (i = 0, curr = 0; i < ARRAY_SIZE(mem->blocks); i++, curr += j) {
|
||||
+ for (j = 0; j < mem->blocks[i]; j++) {
|
||||
priv->memory_pool[curr + j].start = payload_addr;
|
||||
priv->memory_pool[curr + j].size = mem->blocks_size[i];
|
||||
priv->memory_pool[curr + j].free = 1;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.14.9]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From fc22c0fb49d7858b3c7b8bd2a8e041263280e230 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Wed, 25 Aug 2021 00:10:02 +0100
|
||||
Subject: [PATCH 20/23] usb: isp1760: fix qtd fill length
|
||||
|
||||
When trying to send bulks bigger than the biggest block size
|
||||
we need to split them over several qtd. Fix this limiting the
|
||||
maximum qtd size to largest block size.
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-hcd.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
index b3a55c5d2155..fba21122bb00 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-hcd.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
@@ -1829,9 +1829,11 @@ static void packetize_urb(struct usb_hcd *hcd,
|
||||
goto cleanup;
|
||||
|
||||
if (len > mem->blocks_size[ISP176x_BLOCK_NUM - 1])
|
||||
- len = mem->blocks_size[ISP176x_BLOCK_NUM - 1];
|
||||
+ this_qtd_len = mem->blocks_size[ISP176x_BLOCK_NUM - 1];
|
||||
+ else
|
||||
+ this_qtd_len = len;
|
||||
|
||||
- this_qtd_len = qtd_fill(qtd, buf, len);
|
||||
+ this_qtd_len = qtd_fill(qtd, buf, this_qtd_len);
|
||||
list_add_tail(&qtd->qtd_list, head);
|
||||
|
||||
len -= this_qtd_len;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.14.9]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From a5dca0d8c66fb40ef372b596cbcfad45112fa050 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Tue, 24 Aug 2021 09:37:27 +0100
|
||||
Subject: [PATCH 21/23] usb: isp1760: write to status and address register
|
||||
|
||||
We were already writing directly the port status register to
|
||||
trigger changes in isp1763. The same is needed in other IP
|
||||
from the family, including also to setup the read address
|
||||
before reading from device.
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-hcd.c | 23 +++++++++++------------
|
||||
1 file changed, 11 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
index fba21122bb00..79d571f1429b 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-hcd.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-hcd.c
|
||||
@@ -182,7 +182,7 @@ struct urb_listitem {
|
||||
struct urb *urb;
|
||||
};
|
||||
|
||||
-static const u32 isp1763_hc_portsc1_fields[] = {
|
||||
+static const u32 isp176x_hc_portsc1_fields[] = {
|
||||
[PORT_OWNER] = BIT(13),
|
||||
[PORT_POWER] = BIT(12),
|
||||
[PORT_LSTATUS] = BIT(10),
|
||||
@@ -205,27 +205,28 @@ static u32 isp1760_hcd_read(struct usb_hcd *hcd, u32 field)
|
||||
}
|
||||
|
||||
/*
|
||||
- * We need, in isp1763, to write directly the values to the portsc1
|
||||
+ * We need, in isp176x, to write directly the values to the portsc1
|
||||
* register so it will make the other values to trigger.
|
||||
*/
|
||||
static void isp1760_hcd_portsc1_set_clear(struct isp1760_hcd *priv, u32 field,
|
||||
u32 val)
|
||||
{
|
||||
- u32 bit = isp1763_hc_portsc1_fields[field];
|
||||
- u32 port_status = readl(priv->base + ISP1763_HC_PORTSC1);
|
||||
+ u32 bit = isp176x_hc_portsc1_fields[field];
|
||||
+ u16 portsc1_reg = priv->is_isp1763 ? ISP1763_HC_PORTSC1 :
|
||||
+ ISP176x_HC_PORTSC1;
|
||||
+ u32 port_status = readl(priv->base + portsc1_reg);
|
||||
|
||||
if (val)
|
||||
- writel(port_status | bit, priv->base + ISP1763_HC_PORTSC1);
|
||||
+ writel(port_status | bit, priv->base + portsc1_reg);
|
||||
else
|
||||
- writel(port_status & ~bit, priv->base + ISP1763_HC_PORTSC1);
|
||||
+ writel(port_status & ~bit, priv->base + portsc1_reg);
|
||||
}
|
||||
|
||||
static void isp1760_hcd_write(struct usb_hcd *hcd, u32 field, u32 val)
|
||||
{
|
||||
struct isp1760_hcd *priv = hcd_to_priv(hcd);
|
||||
|
||||
- if (unlikely(priv->is_isp1763 &&
|
||||
- (field >= PORT_OWNER && field <= PORT_CONNECT)))
|
||||
+ if (unlikely((field >= PORT_OWNER && field <= PORT_CONNECT)))
|
||||
return isp1760_hcd_portsc1_set_clear(priv, field, val);
|
||||
|
||||
isp1760_field_write(priv->fields, field, val);
|
||||
@@ -367,8 +368,7 @@ static void isp1760_mem_read(struct usb_hcd *hcd, u32 src_offset, void *dst,
|
||||
{
|
||||
struct isp1760_hcd *priv = hcd_to_priv(hcd);
|
||||
|
||||
- isp1760_hcd_write(hcd, MEM_BANK_SEL, ISP_BANK_0);
|
||||
- isp1760_hcd_write(hcd, MEM_START_ADDR, src_offset);
|
||||
+ isp1760_reg_write(priv->regs, ISP176x_HC_MEMORY, src_offset);
|
||||
ndelay(100);
|
||||
|
||||
bank_reads8(priv->base, src_offset, ISP_BANK_0, dst, bytes);
|
||||
@@ -496,8 +496,7 @@ static void isp1760_ptd_read(struct usb_hcd *hcd, u32 ptd_offset, u32 slot,
|
||||
u16 src_offset = ptd_offset + slot * sizeof(*ptd);
|
||||
struct isp1760_hcd *priv = hcd_to_priv(hcd);
|
||||
|
||||
- isp1760_hcd_write(hcd, MEM_BANK_SEL, ISP_BANK_0);
|
||||
- isp1760_hcd_write(hcd, MEM_START_ADDR, src_offset);
|
||||
+ isp1760_reg_write(priv->regs, ISP176x_HC_MEMORY, src_offset);
|
||||
ndelay(90);
|
||||
|
||||
bank_reads8(priv->base, src_offset, ISP_BANK_0, (void *)ptd,
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.14.9]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From 8f238acb1dada56dc6898a6ce2551feed0e6e8c2 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Wed, 25 Aug 2021 00:36:55 +0100
|
||||
Subject: [PATCH 22/23] usb: isp1760: use the right irq status bit
|
||||
|
||||
Instead of using the fields enum values to check interrupts
|
||||
trigged, use the correct bit values.
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-udc.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-udc.c b/drivers/usb/isp1760/isp1760-udc.c
|
||||
index a78da59d6417..5cafd23345ca 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-udc.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-udc.c
|
||||
@@ -1363,7 +1363,7 @@ static irqreturn_t isp1760_udc_irq(int irq, void *dev)
|
||||
|
||||
status = isp1760_udc_irq_get_status(udc);
|
||||
|
||||
- if (status & DC_IEVBUS) {
|
||||
+ if (status & ISP176x_DC_IEVBUS) {
|
||||
dev_dbg(udc->isp->dev, "%s(VBUS)\n", __func__);
|
||||
/* The VBUS interrupt is only triggered when VBUS appears. */
|
||||
spin_lock(&udc->lock);
|
||||
@@ -1371,7 +1371,7 @@ static irqreturn_t isp1760_udc_irq(int irq, void *dev)
|
||||
spin_unlock(&udc->lock);
|
||||
}
|
||||
|
||||
- if (status & DC_IEBRST) {
|
||||
+ if (status & ISP176x_DC_IEBRST) {
|
||||
dev_dbg(udc->isp->dev, "%s(BRST)\n", __func__);
|
||||
|
||||
isp1760_udc_reset(udc);
|
||||
@@ -1391,18 +1391,18 @@ static irqreturn_t isp1760_udc_irq(int irq, void *dev)
|
||||
}
|
||||
}
|
||||
|
||||
- if (status & DC_IEP0SETUP) {
|
||||
+ if (status & ISP176x_DC_IEP0SETUP) {
|
||||
dev_dbg(udc->isp->dev, "%s(EP0SETUP)\n", __func__);
|
||||
|
||||
isp1760_ep0_setup(udc);
|
||||
}
|
||||
|
||||
- if (status & DC_IERESM) {
|
||||
+ if (status & ISP176x_DC_IERESM) {
|
||||
dev_dbg(udc->isp->dev, "%s(RESM)\n", __func__);
|
||||
isp1760_udc_resume(udc);
|
||||
}
|
||||
|
||||
- if (status & DC_IESUSP) {
|
||||
+ if (status & ISP176x_DC_IESUSP) {
|
||||
dev_dbg(udc->isp->dev, "%s(SUSP)\n", __func__);
|
||||
|
||||
spin_lock(&udc->lock);
|
||||
@@ -1413,7 +1413,7 @@ static irqreturn_t isp1760_udc_irq(int irq, void *dev)
|
||||
spin_unlock(&udc->lock);
|
||||
}
|
||||
|
||||
- if (status & DC_IEHS_STA) {
|
||||
+ if (status & ISP176x_DC_IEHS_STA) {
|
||||
dev_dbg(udc->isp->dev, "%s(HS_STA)\n", __func__);
|
||||
udc->gadget.speed = USB_SPEED_HIGH;
|
||||
}
|
||||
--
|
||||
2.33.0
|
||||
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
Upstream-Status: Accepted [merged with kernel 5.14.9]
|
||||
Signed-off-by: Arpita S.K <arpita.s.k@arm.com>
|
||||
|
||||
From 6ccc598ff04d7f7babcbf194b5a0913119abb702 Mon Sep 17 00:00:00 2001
|
||||
From: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
Date: Fri, 27 Aug 2021 08:22:26 +0100
|
||||
Subject: [PATCH 23/23] usb: isp1760: otg control register access
|
||||
|
||||
The set/clear of the otg control values is done writing to
|
||||
two different 16bit registers, however we setup the regmap
|
||||
width for isp1760/61 to 32bit value bits.
|
||||
|
||||
So, just access the clear register address (0x376)as the high
|
||||
part of the otg control register set (0x374), and write the
|
||||
values in one go to make sure they get clear/set.
|
||||
|
||||
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
|
||||
---
|
||||
drivers/usb/isp1760/isp1760-core.c | 50 ++++++++++++++++--------------
|
||||
drivers/usb/isp1760/isp1760-regs.h | 16 ++++++++++
|
||||
2 files changed, 42 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/isp1760/isp1760-core.c b/drivers/usb/isp1760/isp1760-core.c
|
||||
index cb70f9d63cdd..d1d9a7d5da17 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-core.c
|
||||
+++ b/drivers/usb/isp1760/isp1760-core.c
|
||||
@@ -30,6 +30,7 @@ static int isp1760_init_core(struct isp1760_device *isp)
|
||||
{
|
||||
struct isp1760_hcd *hcd = &isp->hcd;
|
||||
struct isp1760_udc *udc = &isp->udc;
|
||||
+ u32 otg_ctrl;
|
||||
|
||||
/* Low-level chip reset */
|
||||
if (isp->rst_gpio) {
|
||||
@@ -83,16 +84,17 @@ static int isp1760_init_core(struct isp1760_device *isp)
|
||||
*
|
||||
* TODO: Really support OTG. For now we configure port 1 in device mode
|
||||
*/
|
||||
- if (((isp->devflags & ISP1760_FLAG_ISP1761) ||
|
||||
- (isp->devflags & ISP1760_FLAG_ISP1763)) &&
|
||||
- (isp->devflags & ISP1760_FLAG_PERIPHERAL_EN)) {
|
||||
- isp1760_field_set(hcd->fields, HW_DM_PULLDOWN);
|
||||
- isp1760_field_set(hcd->fields, HW_DP_PULLDOWN);
|
||||
- isp1760_field_set(hcd->fields, HW_OTG_DISABLE);
|
||||
- } else {
|
||||
- isp1760_field_set(hcd->fields, HW_SW_SEL_HC_DC);
|
||||
- isp1760_field_set(hcd->fields, HW_VBUS_DRV);
|
||||
- isp1760_field_set(hcd->fields, HW_SEL_CP_EXT);
|
||||
+ if (isp->devflags & ISP1760_FLAG_ISP1761) {
|
||||
+ if (isp->devflags & ISP1760_FLAG_PERIPHERAL_EN) {
|
||||
+ otg_ctrl = (ISP176x_HW_DM_PULLDOWN_CLEAR |
|
||||
+ ISP176x_HW_DP_PULLDOWN_CLEAR |
|
||||
+ ISP176x_HW_OTG_DISABLE);
|
||||
+ } else {
|
||||
+ otg_ctrl = (ISP176x_HW_SW_SEL_HC_DC_CLEAR |
|
||||
+ ISP176x_HW_VBUS_DRV |
|
||||
+ ISP176x_HW_SEL_CP_EXT);
|
||||
+ }
|
||||
+ isp1760_reg_write(hcd->regs, ISP176x_HC_OTG_CTRL, otg_ctrl);
|
||||
}
|
||||
|
||||
dev_info(isp->dev, "%s bus width: %u, oc: %s\n",
|
||||
@@ -235,20 +237,20 @@ static const struct reg_field isp1760_hc_reg_fields[] = {
|
||||
[HC_ISO_IRQ_MASK_AND] = REG_FIELD(ISP176x_HC_ISO_IRQ_MASK_AND, 0, 31),
|
||||
[HC_INT_IRQ_MASK_AND] = REG_FIELD(ISP176x_HC_INT_IRQ_MASK_AND, 0, 31),
|
||||
[HC_ATL_IRQ_MASK_AND] = REG_FIELD(ISP176x_HC_ATL_IRQ_MASK_AND, 0, 31),
|
||||
- [HW_OTG_DISABLE] = REG_FIELD(ISP176x_HC_OTG_CTRL_SET, 10, 10),
|
||||
- [HW_SW_SEL_HC_DC] = REG_FIELD(ISP176x_HC_OTG_CTRL_SET, 7, 7),
|
||||
- [HW_VBUS_DRV] = REG_FIELD(ISP176x_HC_OTG_CTRL_SET, 4, 4),
|
||||
- [HW_SEL_CP_EXT] = REG_FIELD(ISP176x_HC_OTG_CTRL_SET, 3, 3),
|
||||
- [HW_DM_PULLDOWN] = REG_FIELD(ISP176x_HC_OTG_CTRL_SET, 2, 2),
|
||||
- [HW_DP_PULLDOWN] = REG_FIELD(ISP176x_HC_OTG_CTRL_SET, 1, 1),
|
||||
- [HW_DP_PULLUP] = REG_FIELD(ISP176x_HC_OTG_CTRL_SET, 0, 0),
|
||||
- [HW_OTG_DISABLE_CLEAR] = REG_FIELD(ISP176x_HC_OTG_CTRL_CLEAR, 10, 10),
|
||||
- [HW_SW_SEL_HC_DC_CLEAR] = REG_FIELD(ISP176x_HC_OTG_CTRL_CLEAR, 7, 7),
|
||||
- [HW_VBUS_DRV_CLEAR] = REG_FIELD(ISP176x_HC_OTG_CTRL_CLEAR, 4, 4),
|
||||
- [HW_SEL_CP_EXT_CLEAR] = REG_FIELD(ISP176x_HC_OTG_CTRL_CLEAR, 3, 3),
|
||||
- [HW_DM_PULLDOWN_CLEAR] = REG_FIELD(ISP176x_HC_OTG_CTRL_CLEAR, 2, 2),
|
||||
- [HW_DP_PULLDOWN_CLEAR] = REG_FIELD(ISP176x_HC_OTG_CTRL_CLEAR, 1, 1),
|
||||
- [HW_DP_PULLUP_CLEAR] = REG_FIELD(ISP176x_HC_OTG_CTRL_CLEAR, 0, 0),
|
||||
+ [HW_OTG_DISABLE_CLEAR] = REG_FIELD(ISP176x_HC_OTG_CTRL, 26, 26),
|
||||
+ [HW_SW_SEL_HC_DC_CLEAR] = REG_FIELD(ISP176x_HC_OTG_CTRL, 23, 23),
|
||||
+ [HW_VBUS_DRV_CLEAR] = REG_FIELD(ISP176x_HC_OTG_CTRL, 20, 20),
|
||||
+ [HW_SEL_CP_EXT_CLEAR] = REG_FIELD(ISP176x_HC_OTG_CTRL, 19, 19),
|
||||
+ [HW_DM_PULLDOWN_CLEAR] = REG_FIELD(ISP176x_HC_OTG_CTRL, 18, 18),
|
||||
+ [HW_DP_PULLDOWN_CLEAR] = REG_FIELD(ISP176x_HC_OTG_CTRL, 17, 17),
|
||||
+ [HW_DP_PULLUP_CLEAR] = REG_FIELD(ISP176x_HC_OTG_CTRL, 16, 16),
|
||||
+ [HW_OTG_DISABLE] = REG_FIELD(ISP176x_HC_OTG_CTRL, 10, 10),
|
||||
+ [HW_SW_SEL_HC_DC] = REG_FIELD(ISP176x_HC_OTG_CTRL, 7, 7),
|
||||
+ [HW_VBUS_DRV] = REG_FIELD(ISP176x_HC_OTG_CTRL, 4, 4),
|
||||
+ [HW_SEL_CP_EXT] = REG_FIELD(ISP176x_HC_OTG_CTRL, 3, 3),
|
||||
+ [HW_DM_PULLDOWN] = REG_FIELD(ISP176x_HC_OTG_CTRL, 2, 2),
|
||||
+ [HW_DP_PULLDOWN] = REG_FIELD(ISP176x_HC_OTG_CTRL, 1, 1),
|
||||
+ [HW_DP_PULLUP] = REG_FIELD(ISP176x_HC_OTG_CTRL, 0, 0),
|
||||
};
|
||||
|
||||
static const struct reg_field isp1763_hc_reg_fields[] = {
|
||||
diff --git a/drivers/usb/isp1760/isp1760-regs.h b/drivers/usb/isp1760/isp1760-regs.h
|
||||
index 94ea60c20b2a..3a6751197e97 100644
|
||||
--- a/drivers/usb/isp1760/isp1760-regs.h
|
||||
+++ b/drivers/usb/isp1760/isp1760-regs.h
|
||||
@@ -61,6 +61,7 @@
|
||||
#define ISP176x_HC_INT_IRQ_MASK_AND 0x328
|
||||
#define ISP176x_HC_ATL_IRQ_MASK_AND 0x32c
|
||||
|
||||
+#define ISP176x_HC_OTG_CTRL 0x374
|
||||
#define ISP176x_HC_OTG_CTRL_SET 0x374
|
||||
#define ISP176x_HC_OTG_CTRL_CLEAR 0x376
|
||||
|
||||
@@ -179,6 +180,21 @@ enum isp176x_host_controller_fields {
|
||||
#define ISP176x_DC_IESUSP BIT(3)
|
||||
#define ISP176x_DC_IEBRST BIT(0)
|
||||
|
||||
+#define ISP176x_HW_OTG_DISABLE_CLEAR BIT(26)
|
||||
+#define ISP176x_HW_SW_SEL_HC_DC_CLEAR BIT(23)
|
||||
+#define ISP176x_HW_VBUS_DRV_CLEAR BIT(20)
|
||||
+#define ISP176x_HW_SEL_CP_EXT_CLEAR BIT(19)
|
||||
+#define ISP176x_HW_DM_PULLDOWN_CLEAR BIT(18)
|
||||
+#define ISP176x_HW_DP_PULLDOWN_CLEAR BIT(17)
|
||||
+#define ISP176x_HW_DP_PULLUP_CLEAR BIT(16)
|
||||
+#define ISP176x_HW_OTG_DISABLE BIT(10)
|
||||
+#define ISP176x_HW_SW_SEL_HC_DC BIT(7)
|
||||
+#define ISP176x_HW_VBUS_DRV BIT(4)
|
||||
+#define ISP176x_HW_SEL_CP_EXT BIT(3)
|
||||
+#define ISP176x_HW_DM_PULLDOWN BIT(2)
|
||||
+#define ISP176x_HW_DP_PULLDOWN BIT(1)
|
||||
+#define ISP176x_HW_DP_PULLUP BIT(0)
|
||||
+
|
||||
#define ISP176x_DC_ENDPTYP_ISOC 0x01
|
||||
#define ISP176x_DC_ENDPTYP_BULK 0x02
|
||||
#define ISP176x_DC_ENDPTYP_INTERRUPT 0x03
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DEBUG_INFO_DWARF4=y
|
||||
@@ -0,0 +1,88 @@
|
||||
CONFIG_LOCALVERSION="-yocto-standard"
|
||||
# CONFIG_LOCALVERSION_AUTO is not set
|
||||
CONFIG_HIGH_RES_TIMERS=y
|
||||
CONFIG_PREEMPT=y
|
||||
CONFIG_LOG_BUF_SHIFT=13
|
||||
CONFIG_LOG_CPU_MAX_BUF_SHIFT=13
|
||||
CONFIG_RELAY=y
|
||||
CONFIG_BOOT_CONFIG=y
|
||||
CONFIG_ARCH_VEXPRESS=y
|
||||
CONFIG_CMDLINE="console=ttyAMA0 loglevel=9"
|
||||
# CONFIG_SUSPEND is not set
|
||||
# CONFIG_STACKPROTECTOR is not set
|
||||
# CONFIG_BLK_DEV_BSG is not set
|
||||
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_IP_PNP=y
|
||||
CONFIG_IP_PNP_DHCP=y
|
||||
CONFIG_IP_PNP_BOOTP=y
|
||||
CONFIG_SYN_COOKIES=y
|
||||
CONFIG_NET_SCHED=y
|
||||
CONFIG_DEVTMPFS=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_NETDEVICES=y
|
||||
# CONFIG_NET_VENDOR_ALACRITECH is not set
|
||||
# CONFIG_NET_VENDOR_AMAZON is not set
|
||||
# CONFIG_NET_VENDOR_AMD is not set
|
||||
# CONFIG_NET_VENDOR_AQUANTIA is not set
|
||||
# CONFIG_NET_VENDOR_ARC is not set
|
||||
# CONFIG_NET_VENDOR_AURORA is not set
|
||||
# CONFIG_NET_VENDOR_BROADCOM is not set
|
||||
# CONFIG_NET_VENDOR_CADENCE is not set
|
||||
# CONFIG_NET_VENDOR_CAVIUM is not set
|
||||
# CONFIG_NET_VENDOR_CORTINA is not set
|
||||
# CONFIG_NET_VENDOR_EZCHIP is not set
|
||||
# CONFIG_NET_VENDOR_GOOGLE is not set
|
||||
# CONFIG_NET_VENDOR_HISILICON is not set
|
||||
# CONFIG_NET_VENDOR_HUAWEI is not set
|
||||
# CONFIG_NET_VENDOR_INTEL is not set
|
||||
# CONFIG_NET_VENDOR_MARVELL is not set
|
||||
# CONFIG_NET_VENDOR_MICREL is not set
|
||||
# CONFIG_NET_VENDOR_MICROCHIP is not set
|
||||
# CONFIG_NET_VENDOR_MICROSEMI is not set
|
||||
# CONFIG_NET_VENDOR_NATSEMI is not set
|
||||
# CONFIG_NET_VENDOR_NETRONOME is not set
|
||||
# CONFIG_NET_VENDOR_NI is not set
|
||||
# CONFIG_NET_VENDOR_PENSANDO is not set
|
||||
# CONFIG_NET_VENDOR_QUALCOMM is not set
|
||||
# CONFIG_NET_VENDOR_RENESAS is not set
|
||||
# CONFIG_NET_VENDOR_ROCKER is not set
|
||||
# CONFIG_NET_VENDOR_SAMSUNG is not set
|
||||
# CONFIG_NET_VENDOR_SEEQ is not set
|
||||
# CONFIG_NET_VENDOR_SOLARFLARE is not set
|
||||
CONFIG_SMC91X=y
|
||||
CONFIG_SMSC911X=y
|
||||
# CONFIG_NET_VENDOR_SOCIONEXT is not set
|
||||
# CONFIG_NET_VENDOR_STMICRO is not set
|
||||
# CONFIG_NET_VENDOR_SYNOPSYS is not set
|
||||
# CONFIG_NET_VENDOR_VIA is not set
|
||||
# CONFIG_NET_VENDOR_WIZNET is not set
|
||||
# CONFIG_NET_VENDOR_XILINX is not set
|
||||
# CONFIG_SERIO_SERPORT is not set
|
||||
CONFIG_SERIAL_AMBA_PL011=y
|
||||
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_UAS=y
|
||||
CONFIG_USB_ISP1760=y
|
||||
CONFIG_RTC_CLASS=y
|
||||
CONFIG_RTC_DRV_PL031=y
|
||||
CONFIG_TEE=y
|
||||
CONFIG_OPTEE=y
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_CONFIGFS_FS=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_CODEPAGE_860=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_NLS_ISO8859_15=y
|
||||
CONFIG_NLS_UTF8=y
|
||||
CONFIG_LIBCRC32C=y
|
||||
# CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
|
||||
CONFIG_DEBUG_FS=y
|
||||
CONFIG_PANIC_TIMEOUT=5
|
||||
CONFIG_STACKTRACE=y
|
||||
@@ -81,6 +81,74 @@ KERNEL_FEATURES:append:corstone700-mps3 = " \
|
||||
'', \
|
||||
d)}"
|
||||
|
||||
#
|
||||
# Corstone1000 KMACHINE
|
||||
#
|
||||
FILESEXTRAPATHS:prepend:corstone1000 := "${ARMBSPFILESPATHS}"
|
||||
COMPATIBLE_MACHINE:corstone1000 = "${MACHINE}"
|
||||
KCONFIG_MODE:corstone1000 = "--alldefconfig"
|
||||
KMACHINE:corstone1000 = "corstone1000"
|
||||
LINUX_KERNEL_TYPE:corstone1000 = "standard"
|
||||
#disabling the rootfs cpio file compression so it is not compressed twice when bundled with the kernel
|
||||
KERNEL_EXTRA_ARGS:corstone1000 += "CONFIG_INITRAMFS_COMPRESSION_NONE=y"
|
||||
SRC_URI:append:corstone1000 = " \
|
||||
file://0001-usb-isp1760-fix-strict-typechecking.patch \
|
||||
file://0002-usb-isp1760-move-to-regmap-for-register-access.patch \
|
||||
file://0003-usb-isp1760-use-relaxed-primitives.patch \
|
||||
file://0004-usb-isp1760-remove-platform-data-struct-and-code.patch \
|
||||
file://0005-usb-isp1760-hcd-refactor-mempool-config-and-setup.patch \
|
||||
file://0006-usb-isp1760-use-dr_mode-binding.patch \
|
||||
file://0007-usb-isp1760-add-support-for-isp1763.patch \
|
||||
file://0008-dt-bindings-usb-nxp-isp1760-add-bindings.patch \
|
||||
file://0009-usb-isp1763-add-peripheral-mode.patch \
|
||||
file://0022-usb-isp1760-isp1760-udc-Provide-missing-description-.patch \
|
||||
file://0023-usb-isp1760-Fix-meaningless-check-in-isp1763_run.patch \
|
||||
file://0024-usb-isp1760-remove-debug-message-as-error.patch \
|
||||
file://0025-usb-isp1760-do-not-sleep-in-field-register-poll.patch \
|
||||
file://0026-usb-isp1760-rework-cache-initialization-error-handli.patch \
|
||||
file://0027-usb-isp1760-ignore-return-value-for-bus-change-patte.patch \
|
||||
file://0028-usb-isp1760-check-maxpacketsize-before-using-it.patch \
|
||||
file://0029-usb-isp1760-do-not-reset-retval.patch \
|
||||
file://0030-usb-isp1760-do-not-shift-in-uninitialized-slot.patch \
|
||||
file://0031-usb-isp1760-clean-never-read-udc_enabled-warning.patch \
|
||||
file://0032-usb-isp1760-fix-memory-pool-initialization.patch \
|
||||
file://0033-usb-isp1760-fix-qtd-fill-length.patch \
|
||||
file://0034-usb-isp1760-write-to-status-and-address-register.patch \
|
||||
file://0035-usb-isp1760-use-the-right-irq-status-bit.patch \
|
||||
file://0036-usb-isp1760-otg-control-register-access.patch \
|
||||
file://defconfig \
|
||||
"
|
||||
|
||||
SRC_URI:append:corstone1000 = " ${@bb.utils.contains('MACHINE_FEATURES', \
|
||||
'corstone1000_kernel_debug', \
|
||||
'file://corstone1000_kernel_debug.cfg', \
|
||||
'', \
|
||||
d)}"
|
||||
|
||||
# Default kernel features not needed for corstone1000
|
||||
# otherwise the extra kernel modules will increase the rootfs size
|
||||
# corstone1000 has limited flash memory constraints
|
||||
KERNEL_EXTRA_FEATURES:corstone1000 = ""
|
||||
KERNEL_FEATURES:corstone1000 = ""
|
||||
# No need to include the kernel image in the rootfs
|
||||
# So, let's delete the package doing that and uninstalling the initial
|
||||
# kernel binary.
|
||||
# The kernel binary needed is the initramfs bundle
|
||||
|
||||
FILES:kernel-image-image:corstone1000=""
|
||||
|
||||
# Uninstalling the initial kernel binary
|
||||
|
||||
do_install:append:corstone1000() {
|
||||
if [ -e "${D}/${KERNEL_IMAGEDEST}/$imageType-${KERNEL_VERSION}" ]; then
|
||||
rm ${D}/${KERNEL_IMAGEDEST}/$imageType-${KERNEL_VERSION}
|
||||
fi
|
||||
|
||||
if [ -e "${D}/${KERNEL_IMAGEDEST}/$imageType" ]; then
|
||||
rm ${D}/${KERNEL_IMAGEDEST}/$imageType
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# FVP BASE KMACHINE
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user