[linux-yocto] [PATCH 1/1] sound: soc: xilinx: give a name to stream_name in xilinx_dp_dai_links

2019-11-11 Thread quanyang.wang
From: Quanyang Wang 

If .stream_name is NULL, when calling "aplay -l", it will show:

card 0: monitor [DisplayPort monitor], device 0: (null) 
xilinx-dp-snd-codec-dai-0 [(null) xilinx-dp-snd-codec-dai-0]

Adding .stream_name can eliminate the "(null)" in the output.

Signed-off-by: Quanyang Wang 
---
 sound/soc/xilinx/xilinx-dp-card.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/xilinx/xilinx-dp-card.c 
b/sound/soc/xilinx/xilinx-dp-card.c
index c99faccf666a..a149da095df8 100644
--- a/sound/soc/xilinx/xilinx-dp-card.c
+++ b/sound/soc/xilinx/xilinx-dp-card.c
@@ -37,11 +37,13 @@ static const struct snd_soc_ops xilinx_dp_ops = {
 static struct snd_soc_dai_link xilinx_dp_dai_links[] = {
{
.name   = "xilinx-dp0",
+   .stream_name= "xilinx-dp0",
.codec_dai_name = "xilinx-dp-snd-codec-dai",
.ops= _dp_ops,
},
{
.name   = "xilinx-dp1",
+   .stream_name= "xilinx-dp1",
.codec_dai_name = "xilinx-dp-snd-codec-dai",
.ops= _dp_ops,
},
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 0/1] sound: soc: xilinx: give a name to stream_name in xilinx_dp_dai_links

2019-11-11 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce & Michal,

When running "aplay -l" in zcu102 board, there will be a "(null)" in output:
root@xilinx-zynqmp:~# aplay -l
 List of PLAYBACK Hardware Devices 
card 0: monitor [DisplayPort monitor], device 0: (null) 
xilinx-dp-snd-codec-dai-0 [(null) xilinx-dp-snd-codec-dai-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: monitor [DisplayPort monitor], device 1: (null) 
xilinx-dp-snd-codec-dai-1 [(null) xilinx-dp-snd-codec-dai-1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Just give a name to .stream_name, not to fix any issue but just decorate the 
output.
After applying this patch, the output becomes:
root@xilinx-zynqmp:~# aplay -l
 List of PLAYBACK Hardware Devices 
card 0: monitor [DisplayPort monitor], device 0: xilinx-dp0 
xilinx-dp-snd-codec-dai-0 [xilinx-dp0 xilinx-dp-snd-codec-dai-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: monitor [DisplayPort monitor], device 1: xilinx-dp1 
xilinx-dp-snd-codec-dai-1 [xilinx-dp1 xilinx-dp-snd-codec-dai-1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Would you please help review and merge these patches to linux-yocto 
v5.2/standard/xlnx-soc branch?

Quanyang Wang (1):
  sound: soc: xilinx: give a name to stream_name in xilinx_dp_dai_links

 sound/soc/xilinx/xilinx-dp-card.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 1/1] xilinx-zynqmp: remove CONFIG_VIRTIO=y from xilinx-zynqmp.cfg

2019-11-05 Thread quanyang.wang
From: Quanyang Wang 

Don't need to set CONFIG_VIRTIO to be "y" explicitly, or else
when bitbake core-image-base there will be building warning as below:

WARNING: linux-yocto-5.2.x+gitAUTOINC+343a633207_b039f25b0a-r0 
do_kernel_configcheck: [kernel config]: specified values did not make it into 
the kernel's final configuration:
-- CONFIG_VIRTIO -
Config: CONFIG_VIRTIO
Requested value: CONFIG_VIRTIO=y
Actual value: CONFIG_VIRTIO=m

Signed-off-by: Quanyang Wang 
---
 bsp/xilinx-zynqmp/xilinx-zynqmp.cfg | 1 -
 1 file changed, 1 deletion(-)

diff --git a/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg 
b/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg
index b87c28924..c86bda117 100644
--- a/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg
+++ b/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg
@@ -121,7 +121,6 @@ CONFIG_XILINX_DMA=y
 
 CONFIG_UIO=y
 CONFIG_UIO_XILINX_APM=y
-CONFIG_VIRTIO=y
 CONFIG_COMMON_CLK=y
 CONFIG_COMMON_CLK_SI570=y
 CONFIG_COMMON_CLK_SI5324=y
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 0/1] xilinx-zynqmp: remove CONFIG_VIRTIO=y from xilinx-zynqmp.cfg

2019-11-05 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce & Michal,

This patch delete kernel option CONFIG_VIRTIO. This is because that 
CONFIG_VIRTIO
can be set to "Y" or "m". If set it to be "Y" explicitly, there will be build 
warning:

WARNING: linux-yocto-5.2.x+gitAUTOINC+343a633207_b039f25b0a-r0 
do_kernel_configcheck: [kernel config]: specified values did not make it into 
the kernel's final configuration:
-- CONFIG_VIRTIO -
Config: CONFIG_VIRTIO
Requested value: CONFIG_VIRTIO=y
Actual value: CONFIG_VIRTIO=m

Thanks,
Quanyang

Quanyang Wang (1):
  xilinx-zynqmp: remove CONFIG_VIRTIO=y from xilinx-zynqmp.cfg

 bsp/xilinx-zynqmp/xilinx-zynqmp.cfg | 1 -
 1 file changed, 1 deletion(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH] drivers: soc: xilinx: fix compile warning by defining payload array length to 32

2019-11-04 Thread quanyang.wang
From: Quanyang Wang 

In zynqmp-ipi-mailbox.c and zynqmp_r5_remoteproc.c, the variables of
zynqmp_ipi_message structures are all using 32 as the maximum size of
data length. So move IPI_BUF_LEN_MAX to zynqmp-ipi-message.h to share with
zynqmp_power.c.

Signed-off-by: Quanyang Wang 
---
 drivers/remoteproc/zynqmp_r5_remoteproc.c  | 2 --
 drivers/soc/xilinx/zynqmp_power.c  | 2 +-
 include/linux/mailbox/zynqmp-ipi-message.h | 3 +++
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/remoteproc/zynqmp_r5_remoteproc.c 
b/drivers/remoteproc/zynqmp_r5_remoteproc.c
index 097e2055b39f..5df4e512865e 100644
--- a/drivers/remoteproc/zynqmp_r5_remoteproc.c
+++ b/drivers/remoteproc/zynqmp_r5_remoteproc.c
@@ -48,8 +48,6 @@
 /* PM proc states */
 #define PM_PROC_STATE_ACTIVE 1U
 
-/* IPI buffer MAX length */
-#define IPI_BUF_LEN_MAX32U
 /* RX mailbox client buffer max length */
 #define RX_MBOX_CLIENT_BUF_MAX (IPI_BUF_LEN_MAX + \
 sizeof(struct zynqmp_ipi_message))
diff --git a/drivers/soc/xilinx/zynqmp_power.c 
b/drivers/soc/xilinx/zynqmp_power.c
index 663010658b2a..01a2e9dc1fe5 100644
--- a/drivers/soc/xilinx/zynqmp_power.c
+++ b/drivers/soc/xilinx/zynqmp_power.c
@@ -88,7 +88,7 @@ static irqreturn_t zynqmp_pm_isr(int irq, void *data)
 static void ipi_receive_callback(struct mbox_client *cl, void *data)
 {
struct zynqmp_ipi_message *msg = (struct zynqmp_ipi_message *)data;
-   u32 payload[msg->len];
+   u32 payload[IPI_BUF_LEN_MAX];
int ret;
 
memcpy(payload, msg->data, sizeof(msg->len));
diff --git a/include/linux/mailbox/zynqmp-ipi-message.h 
b/include/linux/mailbox/zynqmp-ipi-message.h
index 9542b41eacfd..d9f0a7471b51 100644
--- a/include/linux/mailbox/zynqmp-ipi-message.h
+++ b/include/linux/mailbox/zynqmp-ipi-message.h
@@ -3,6 +3,9 @@
 #ifndef _LINUX_ZYNQMP_IPI_MESSAGE_H_
 #define _LINUX_ZYNQMP_IPI_MESSAGE_H_
 
+/* IPI buffer MAX length */
+#define IPI_BUF_LEN_MAX 32U
+
 /**
  * struct zynqmp_ipi_message - ZynqMP IPI message structure
  * @len:  Length of message
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [V2][[kernel v5.2/standard/xlnx-soc]][PATCH 0/3] xililnx-zynqmp: fix compile warning in zynqmp platform

2019-11-04 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce & Michal,

In V1 patch, I define the maximum length of data buffer to 12. But when
I try to search if there is existing macro defined for the maxium length,
I find that the maximum length should be 32.
In drivers/remoteproc/zynqmp_r5_remoteproc.c, it use IPI_BUF_LEN_MAX which is 
defined as 32.
In drivers/mailbox/zynqmp-ipi-mailbox.c, it will use the "size" property value 
(0x20)
of "local_request_region" node in ./arch/arm64/boot/dts/xilinx/zynqmp.dtsi.
So change the value from 12 to 32 in V2 patch.

Thanks,
Quanyang

Quanyang Wang (1):
  drivers: soc: xilinx: fix compile warning by defining payload array
length to 32

 drivers/remoteproc/zynqmp_r5_remoteproc.c  | 2 --
 drivers/soc/xilinx/zynqmp_power.c  | 2 +-
 include/linux/mailbox/zynqmp-ipi-message.h | 3 +++
 3 files changed, 4 insertions(+), 3 deletions(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 1/1] clk: zynqmp: fix memory leak in zynqmp_register_clocks

2019-10-29 Thread quanyang.wang
From: Quanyang Wang 

This is detected by kmemleak running on zcu102 board:

unreferenced object 0xffc877e48180 (size 128):
comm "swapper/0", pid 1, jiffies 4294892909 (age 315.436s)
hex dump (first 32 bytes):
64 70 5f 76 69 64 65 6f 5f 72 65 66 5f 64 69 76 dp_video_ref_div
31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1...
backtrace:
[] __kmalloc_track_caller+0x200/0x380
[] kvasprintf+0x7c/0x100
[] kasprintf+0x60/0x80
[<92298b05>] zynqmp_register_clocks+0x29c/0x398
[] zynqmp_clock_probe+0x3cc/0x4c0
[<5f5986f0>] platform_drv_probe+0x58/0xa8
[] really_probe+0xd8/0x2a8
[] driver_probe_device+0x5c/0x100
[<38f91fcf>] __device_attach_driver+0x98/0xb8
[<8a3f2ac2>] bus_for_each_drv+0x74/0xd8
[<1cb2783d>] __device_attach+0xe0/0x140
[] device_initial_probe+0x24/0x30
[<6998de4b>] bus_probe_device+0x9c/0xa8
[<647ae6ff>] device_add+0x3c0/0x610
[<71c14bb8>] of_device_add+0x40/0x50
[<4bb5d132>] of_platform_device_create_pdata+0xbc/0x138

This is because that when num_nodes is larger than 1, clk_out is
allocated using kasprintf for these nodes but only the last node's
clk_out is freed.

Signed-off-by: Quanyang Wang 
Tested-by: Michal Simek 
---
 drivers/clk/zynqmp/clkc.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/zynqmp/clkc.c b/drivers/clk/zynqmp/clkc.c
index 64355fd07f6b..536f68c98e97 100644
--- a/drivers/clk/zynqmp/clkc.c
+++ b/drivers/clk/zynqmp/clkc.c
@@ -563,7 +563,7 @@ static struct clk_hw *zynqmp_register_clk_topology(int 
clk_id, char *clk_name,
 {
int j;
u32 num_nodes, clk_dev_id;
-   char *clk_out = NULL;
+   char *clk_out[MAX_NODES];
struct clock_topology *nodes;
struct clk_hw *hw = NULL;
 
@@ -577,16 +577,16 @@ static struct clk_hw *zynqmp_register_clk_topology(int 
clk_id, char *clk_name,
 * Intermediate clock names are postfixed with type of clock.
 */
if (j != (num_nodes - 1)) {
-   clk_out = kasprintf(GFP_KERNEL, "%s%s", clk_name,
+   clk_out[j] = kasprintf(GFP_KERNEL, "%s%s", clk_name,
clk_type_postfix[nodes[j].type]);
} else {
-   clk_out = kasprintf(GFP_KERNEL, "%s", clk_name);
+   clk_out[j] = kasprintf(GFP_KERNEL, "%s", clk_name);
}
 
if (!clk_topology[nodes[j].type])
continue;
 
-   hw = (*clk_topology[nodes[j].type])(clk_out, clk_dev_id,
+   hw = (*clk_topology[nodes[j].type])(clk_out[j], clk_dev_id,
parent_names,
num_parents,
[j]);
@@ -595,9 +595,12 @@ static struct clk_hw *zynqmp_register_clk_topology(int 
clk_id, char *clk_name,
 __func__,  clk_dev_id, clk_name,
 PTR_ERR(hw));
 
-   parent_names[0] = clk_out;
+   parent_names[0] = clk_out[j];
}
-   kfree(clk_out);
+
+   for (j = 0; j < num_nodes; j++)
+   kfree(clk_out[j]);
+
return hw;
 }
 
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [V2][kernel v5.2/standard/xlnx-soc][PATCH 0/1] fix kmemleak in zcu102

2019-10-29 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce,

This patch is missing to be merged. So I send it again.

Would you please help merge these patches to linux-yocto
v5.2/standard/xlnx-soc branch?

Quanyang Wang (1):
  clk: zynqmp: fix memory leak in zynqmp_register_clocks

 drivers/clk/zynqmp/clkc.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 3/3] fpga: zynqmp-fpga: fix compile warning in fpga_mgr_register

2019-10-29 Thread quanyang.wang
From: Quanyang Wang 

This fixes the compile warning as below:

drivers/fpga/fpga-mgr.c:911:2: warning: ISO C90 forbids mixed declarations and 
code [-Wdeclaration-after-statement]
911 | struct dentry *d, *parent;
^~

Signed-off-by: Quanyang Wang 
---
 drivers/fpga/fpga-mgr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c
index 0511fde09138..83c02c0b4a20 100644
--- a/drivers/fpga/fpga-mgr.c
+++ b/drivers/fpga/fpga-mgr.c
@@ -895,6 +895,9 @@ EXPORT_SYMBOL_GPL(devm_fpga_mgr_create);
 int fpga_mgr_register(struct fpga_manager *mgr)
 {
int ret;
+#ifdef CONFIG_FPGA_MGR_DEBUG_FS
+   struct dentry *d, *parent;
+#endif
 
/*
 * Initialize framework state by requesting low level driver read state
@@ -908,8 +911,6 @@ int fpga_mgr_register(struct fpga_manager *mgr)
goto error_device;
 
 #ifdef CONFIG_FPGA_MGR_DEBUG_FS
-   struct dentry *d, *parent;
-
mgr->dir = debugfs_create_dir("fpga", NULL);
if (!mgr->dir)
goto error_device;
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 1/3] net: emaclite: fix compile warning in BUFFER_ALIGN

2019-10-29 Thread quanyang.wang
From: Quanyang Wang 

Use ulong instead of u32 to fix compile warning when building
kernel for arm64 (zynqmp):

drivers/net/ethernet/xilinx/xilinx_emaclite.c:98:42: warning: cast from pointer 
to integer of different size [-Wpointer-to-int-cast]
   98 | #define BUFFER_ALIGN(adr) ((ALIGNMENT - ((u32)adr)) % ALIGNMENT)
  |  ^

Signed-off-by: Quanyang Wang 
---
 drivers/net/ethernet/xilinx/xilinx_emaclite.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c 
b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 37fb0f6f5fee..134da2d726a7 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -95,7 +95,7 @@
 #define ALIGNMENT  4
 
 /* BUFFER_ALIGN(adr) calculates the number of bytes to the next alignment. */
-#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((u32)adr)) % ALIGNMENT)
+#define BUFFER_ALIGN(adr) ((ALIGNMENT - ((ulong)adr)) % ALIGNMENT)
 
 #ifdef __BIG_ENDIAN
 #define xemaclite_readlioread32be
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 2/3] drivers: soc: xilinx: fix compile warning by defining payload array length to 12

2019-10-29 Thread quanyang.wang
From: Quanyang Wang 

In include/linux/mailbox/zynqmp-ipi-message.h, it says that
the maximum length of data buffer is fixed to 12 bytes. So
define payload array length to 12 to fix compile warning as
below:

drivers/soc/xilinx/zynqmp_power.c:91:2: warning: ISO C90 forbids variable 
length array 'payload' [-Wvla]
   91 |  u32 payload[msg->len];
  |  ^~~

Signed-off-by: Quanyang Wang 
---
 drivers/soc/xilinx/zynqmp_power.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/xilinx/zynqmp_power.c 
b/drivers/soc/xilinx/zynqmp_power.c
index 663010658b2a..0036d013aacd 100644
--- a/drivers/soc/xilinx/zynqmp_power.c
+++ b/drivers/soc/xilinx/zynqmp_power.c
@@ -88,7 +88,7 @@ static irqreturn_t zynqmp_pm_isr(int irq, void *data)
 static void ipi_receive_callback(struct mbox_client *cl, void *data)
 {
struct zynqmp_ipi_message *msg = (struct zynqmp_ipi_message *)data;
-   u32 payload[msg->len];
+   u32 payload[12];
int ret;
 
memcpy(payload, msg->data, sizeof(msg->len));
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [[kernel v5.2/standard/xlnx-soc]][PATCH 0/3] xililnx-zynqmp: fix compile warning in zynqmp platform

2019-10-29 Thread quanyang.wang
From: Quanyang Wang 


Hi Bruce, Michal,

There are 3 patches to fix compile warnings in xilinx-zynqmp platform.

Would you please help review and merge these patches to 
linux-yocto v5.2/standard/xlnx-soc branch?

Thanks,
Quanyang


Quanyang Wang (3):
  net: emaclite: fix compile warning in BUFFER_ALIGN
  drivers: soc: xilinx: fix compile warning by defining payload array
length to 12
  fpga: zynqmp-fpga: fix compile warning in fpga_mgr_register

 drivers/fpga/fpga-mgr.c   | 5 +++--
 drivers/net/ethernet/xilinx/xilinx_emaclite.c | 2 +-
 drivers/soc/xilinx/zynqmp_power.c | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 1/1] i2c: cadence: keep bus_hold_flag unless I2C_M_NOSTART is set

2019-10-24 Thread quanyang.wang
From: Quanyang Wang 

When using i2c_smbus_read_byte_data to read one byte from a
slave device, because of the commit d358def70688
("i2c: cadence: Fix the hold bit setting"), the transaction becomes:

S Addr Wr [A] Comm [A] P S Addr Rd [A] [Data] NA P
   ^
CR_HOLD bit as 0

This will result that the read operation fails and will read "0xff" from
the slave device. In the SMBus protocol, it stipulates that it must follow
that command with a repeated START condition as below:

S Addr Wr [A] Comm [A] Sr Addr Rd [A] [Data] NA P

So add a check if I2C_M_NOSTART is set in flags. If set, clear the
CR_HOLD bit, or else keep CR_HOLD bit to be 1 to make sure that
the read operation begins with a repeated START.

Signed-off-by: Quanyang Wang 
---
According to Shubhrajyoti's suggestion, add a I2C_M_NOSTART flag
check in msg->flags to avoid breaking the intended behaviour of
the code.

 drivers/i2c/busses/i2c-cadence.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
index 6b011931e090..22c1590c0e7a 100644
--- a/drivers/i2c/busses/i2c-cadence.c
+++ b/drivers/i2c/busses/i2c-cadence.c
@@ -624,10 +624,12 @@ static void cdns_i2c_mrecv(struct cdns_i2c *id)
 * Check for the message size against FIFO depth and set the
 * 'hold bus' bit if it is greater than FIFO depth.
 */
-   if ((id->recv_count > CDNS_I2C_FIFO_DEPTH)  || id->bus_hold_flag)
+   if ((id->recv_count > CDNS_I2C_FIFO_DEPTH)  || id->bus_hold_flag) {
ctrl_reg |= CDNS_I2C_CR_HOLD;
-   else
-   ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD;
+   } else {
+   if (id->p_msg->flags & I2C_M_NOSTART)
+   ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD;
+   }
 
cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET);
 
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 0/1][V2]patches for xilinx

2019-10-24 Thread quanyang.wang
From: Quanyang Wang 

Hi all,

V1 ---> V2:

1. delete the patch "arch: arm64: dts: add overlay dts file" because it is 
improper
to add into kernel source.

2. modify the patch " i2c: cadence: do not clear bus_hold_flag in mrecv" by 
adding
a I2C_M_NOSTART flag check according to Shubhrajyoti's suggestion. And test it 
at
zcu102 board (read bus 0x8 device 0x65 (ucd10120) register 0xd6)as below:
Before applying this patch:
root@xilinx-zynq:~# i2cget -f -y 0x8 0x65 0xd6
0xff
After applying this patch:
root@xilinx-zynq:~# i2cget -f -y 0x8 0x65 0xd6
0x05

Thanks,
Quanyang

Quanyang Wang (1):
  i2c: cadence: keep bus_hold_flag unless I2C_M_NOSTART is set

 drivers/i2c/busses/i2c-cadence.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 1/1] dma: xilinx: dpdma: alloc xilinx_dpdma_tx_desc using GFP_ATOMIC

2019-10-22 Thread quanyang.wang
From: Quanyang Wang 

The function xilinx_dpdma_chan_alloc_tx_desc can be called
from atomic context, hence use GFP_ATOMIC instead of GFP_KERNEL,
or else it will cause the calltrace as below:

BUG: sleeping function called from invalid context at mm/slab.h:418
in_atomic(): 1, irqs_disabled(): 128, pid: 416, name: alsa-sink-(null 
Preemption disabled at:
[] snd_pcm_stream_lock_irq+0x40/0x50
CPU: 2 PID: 416 Comm: alsa-sink-(null Tainted: G O 5.2.17-yocto-standard #1
Hardware name: ZynqMP ZCU102 Rev1.0 (DT) Call trace:
dump_backtrace+0x0/0x138
show_stack+0x24/0x30
dump_stack+0x94/0xbc
___might_sleep+0x14c/0x178
__might_sleep+0x58/0x90
kmem_cache_alloc_trace+0x1a4/0x300
xilinx_dpdma_chan_alloc_tx_desc.isra.0+0x24/0x40
xilinx_dpdma_prep_dma_cyclic+0xc0/0x208
snd_dmaengine_pcm_trigger+0xf8/0x198
soc_pcm_trigger+0xb4/0x128
snd_pcm_do_start+0x48/0x58
snd_pcm_action_single+0x4c/0xa0
snd_pcm_action+0x78/0x90
snd_pcm_action_lock_irq+0x3c/0x60
snd_pcm_common_ioctl+0x4ac/0x10c8
snd_pcm_ioctl+0x48/0x68
do_vfs_ioctl+0x6d4/0x968
ksys_ioctl+0x84/0xb8
__arm64_sys_ioctl+0x28/0x38
el0_svc_common.constprop.0+0x74/0x180
el0_svc_handler+0x70/0x90
el0_svc+0x8/0xc

Signed-off-by: Quanyang Wang 
Reviewed-by: Hyun Kwon 
---
There are two available flags which can be used here: GFP_ATOMIC
and GFP_NOWAIT. The difference is that GFP_ATOMIC may grab memory
from emergency pools but GFP_NOWAIT not. Since struct xilinx_dpdma_tx_desc
is small, use GFP_ATOMIC is better.

 drivers/dma/xilinx/xilinx_dpdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/xilinx/xilinx_dpdma.c 
b/drivers/dma/xilinx/xilinx_dpdma.c
index 1ea509e00742..89ade893f51c 100644
--- a/drivers/dma/xilinx/xilinx_dpdma.c
+++ b/drivers/dma/xilinx/xilinx_dpdma.c
@@ -797,7 +797,7 @@ xilinx_dpdma_chan_alloc_tx_desc(struct xilinx_dpdma_chan 
*chan)
 {
struct xilinx_dpdma_tx_desc *tx_desc;
 
-   tx_desc = kzalloc(sizeof(*tx_desc), GFP_KERNEL);
+   tx_desc = kzalloc(sizeof(*tx_desc), GFP_ATOMIC);
if (!tx_desc)
return NULL;
 
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 0/1] [V2] xilinx-zynqmp: fix calltrace

2019-10-22 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce,

This patch is a V2 patch but no change against V1. Just add some comments
in the temporary section of the patch.

Would you please help merge these patches to linux-yocto v5.2/standard/xlnx-soc 
branch?

Quanyang Wang (1):
  dma: xilinx: dpdma: alloc xilinx_dpdma_tx_desc using GFP_ATOMIC

 drivers/dma/xilinx/xilinx_dpdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 2/2] xilinx-zynq: Revert "zynq: SMP crashkernel support"

2019-10-21 Thread quanyang.wang
From: Quanyang Wang 

This reverts commit 5d1a5900882ceb86cddf36c258bd5bda498c8da8.

Since the commit ("ARM: zynq: use physical cpuid in zynq_slcr_cpu_stop/start")
has fixed the hang issue in kdump, this patch can be reverted.

Signed-off-by: Quanyang Wang 
---
 arch/arm/kernel/machine_kexec.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index 654f2b1f9ac0..76300f3813e8 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -3,7 +3,6 @@
  * machine_kexec.c - handle transition of Linux booting another kernel
  */
 
-#include 
 #include 
 #include 
 #include 
@@ -146,8 +145,6 @@ static void machine_kexec_mask_interrupts(void)
 void machine_crash_shutdown(struct pt_regs *regs)
 {
local_irq_disable();
-   disable_nonboot_cpus();
-
crash_smp_send_stop();
 
crash_save_cpu(regs, smp_processor_id());
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 0/2] xilinx-zynq: fix kdump hang issue

2019-10-21 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce, Michal,

There are 2 patches.

The patch "ARM: zynq: use physical cpuid in zynq_slcr_cpu_stop/start"
fix the kdump hang issue when not using disable_nonboot_cpus.
And the patch "xilinx-zynq: Revert "zynq: SMP crashkernel support""
revert the patch which using disable_nonboot_cpus.

Thanks,
Quanyang

Quanyang Wang (2):
  ARM: zynq: use physical cpuid in zynq_slcr_cpu_stop/start
  xilinx-zynq: Revert "zynq: SMP crashkernel support"

 arch/arm/kernel/machine_kexec.c | 3 ---
 arch/arm/mach-zynq/platsmp.c| 6 --
 2 files changed, 4 insertions(+), 5 deletions(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 1/2] ARM: zynq: use physical cpuid in zynq_slcr_cpu_stop/start

2019-10-21 Thread quanyang.wang
From: Quanyang Wang 

When kernel booting, it will create a cpuid map between the logical cpus
and physical cpus. In a normal boot, the cpuid map is as below:

Physical  Logical
0==> 0
1==> 1

But in kdump, there is a condition that the crash happens at the
physical cpu1, and the crash kernel will run at the physical cpu1 too,
so the cpuid map in crash kernel is as below:

Physical  Logical
1==> 0
0==> 1

The functions zynq_slcr_cpu_stop/start is to stop/start the physical
cpus, the parameter cpu should be the physical cpuid. So use
cpu_logical_map to translate the logical cpuid to physical cpuid.
Or else the logical cpu0(physical cpu1) will stop itself and
the processor will hang.

Signed-off-by: Quanyang Wang 
---
 arch/arm/mach-zynq/platsmp.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c
index 141e7c8d5024..5d76546fd8b2 100644
--- a/arch/arm/mach-zynq/platsmp.c
+++ b/arch/arm/mach-zynq/platsmp.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "common.h"
@@ -30,6 +31,7 @@ int zynq_cpun_start(u32 address, int cpu)
 {
u32 trampoline_code_size = _secondary_trampoline_end -
_secondary_trampoline;
+   u32 phy_cpuid = cpu_logical_map(cpu);
 
/* MS: Expectation that SLCR are directly map and accessible */
/* Not possible to jump to non aligned address */
@@ -39,7 +41,7 @@ int zynq_cpun_start(u32 address, int cpu)
u32 trampoline_size = _secondary_trampoline_jump -
_secondary_trampoline;
 
-   zynq_slcr_cpu_stop(cpu);
+   zynq_slcr_cpu_stop(phy_cpuid);
if (address) {
if (__pa(PAGE_OFFSET)) {
zero = ioremap(0, trampoline_code_size);
@@ -68,7 +70,7 @@ int zynq_cpun_start(u32 address, int cpu)
if (__pa(PAGE_OFFSET))
iounmap(zero);
}
-   zynq_slcr_cpu_start(cpu);
+   zynq_slcr_cpu_start(phy_cpuid);
 
return 0;
}
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 1/1] xilinx-zyqn: Move disable_nonboot_cpus() in front of local_irq_disable()

2019-10-20 Thread quanyang.wang
From: Quanyang Wang 

When run kdump with enabling CONFIG_DEBUG_PREEMPT, there is a calltrace
as below:

BUG: using smp_processor_id() in preemptible [] code: sh/303
caller is machine_crash_shutdown+0x2c/0xe8
CPU: 0 PID: 303 Comm: sh Kdump: loaded Not tainted 5.2.20-yocto-standard #1
Hardware name: Xilinx Zynq Platform
[<80112ff4>] (unwind_backtrace) from [<8010ca4c>] (show_stack+0x18/0x1c)
[<8010ca4c>] (show_stack) from [<809b000c>] (dump_stack+0x70/0x8c)
[<809b000c>] (dump_stack) from [<80549a14>] (debug_smp_processor_id+0xd4/0x118)
[<80549a14>] (debug_smp_processor_id) from [<80111428>] 
(machine_crash_shutdown+0x2c/0xe8)
[<80111428>] (machine_crash_shutdown) from [<801afe24>] 
(__crash_kexec+0x70/0xd0)
[<801afe24>] (__crash_kexec) from [<801259b4>] (panic+0x110/0x324)
[<801259b4>] (panic) from [<805f7018>] (sysrq_handle_crash+0x18/0x1c)
[<805f7018>] (sysrq_handle_crash) from [<805f7584>] (__handle_sysrq+0x9c/0x14c)
[<805f7584>] (__handle_sysrq) from [<805f79e8>] (write_sysrq_trigger+0x5c/0x6c)
[<805f79e8>] (write_sysrq_trigger) from [<8031e850>] (proc_reg_write+0x78/0x8c)
[<8031e850>] (proc_reg_write) from [<802b1b28>] (vfs_write+0xc0/0x154)
[<802b1b28>] (vfs_write) from [<802b2a64>] (ksys_write+0x6c/0xd4)
[<802b2a64>] (ksys_write) from [<80101000>] (ret_fast_syscall+0x0/0x54)
Exception stack(0xba157fa8 to 0xba157ff0)
7fa0: 0002 005ab930 0001 005ab930 0002 
7fc0: 0002 005ab930 76fa2290 0004 76f3d124 76f3cc8c  
7fe0: 0004 7edec940 76edbfff 76e67d16

This is because that the function disable_nonboot_cpus is called in
order to make sure that the crash kernel runs in the boot CPU(cpu0).
And it will enable local irq by calling as below:

disable_nonboot_cpus
 -> freeze_secondary_cpus
  -> _cpu_down
   -> percpu_down_write
-> rcu_sync_enter
 -> spin_unlock_irq(>rss_lock)
  -> local_irq_enable()

Then the functions including smp_processor_id() behind disable_nonboot_cpus
will run at the irq-enabled context, and this will trigger the calltrace.

So move disable_nonboot_cpus() in front of local_irq_disable() to avoid
it since disable_nonboot_cpus() not need run at an atomic context.

Signed-off-by: Quanyang Wang 
---
 arch/arm/kernel/machine_kexec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index 654f2b1f9ac0..83d2025a4ab1 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -145,9 +145,10 @@ static void machine_kexec_mask_interrupts(void)
 
 void machine_crash_shutdown(struct pt_regs *regs)
 {
-   local_irq_disable();
disable_nonboot_cpus();
 
+   local_irq_disable();
+
crash_smp_send_stop();
 
crash_save_cpu(regs, smp_processor_id());
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 0/1] xilinx-zynq: fix kdump calltrace in zynq

2019-10-20 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce, Michal,

This patch fixes a calltrace when running kdump with enabling 
CONFIG_DEBUG_PREEMPT
kernel option.

Would you please help review and merge these patches to linux-yocto
v5.2/standard/xlnx-soc branch?

Thanks,
Quanyang

Quanyang Wang (1):
  xilinx-zyqn: Move disable_nonboot_cpus() in front of
local_irq_disable()

 arch/arm/kernel/machine_kexec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 1/1] xilinx-zynqmp: add kernel options for ZynqMP PL Programming

2019-10-17 Thread quanyang.wang
From: Quanyang Wang 

Add kernel options for zynqmp FPGA programming.

Signed-off-by: Quanyang Wang 
---
 bsp/xilinx-zynqmp/xilinx-zynqmp.cfg | 4 
 1 file changed, 4 insertions(+)

diff --git a/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg 
b/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg
index fe8ae24d..b87c2892 100644
--- a/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg
+++ b/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg
@@ -234,3 +234,7 @@ CONFIG_RESET_CONTROLLER=y
 
 CONFIG_PMBUS=y
 CONFIG_SENSORS_MAX20751=y
+
+CONFIG_OF_OVERLAY=y
+CONFIG_OF_CONFIGFS=y
+CONFIG_FPGA_MGR_DEBUG_FS=y
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel-cache][PATCH 0/1] xilinx-zynqmp: add kernel options for ZynqMP PL Programming

2019-10-17 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce, Michal,

Would you please help review and merge this patch to
yocto-kernel-cache's branch yocto-5.2 and master?

Thanks,
Quanyang

Quanyang Wang (1):
  xilinx-zynqmp: add kernel options for ZynqMP PL Programming

 bsp/xilinx-zynqmp/xilinx-zynqmp.cfg | 4 
 1 file changed, 4 insertions(+)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 1/1] clk: zynqmp: fix memory leak in zynqmp_register_clocks

2019-10-16 Thread quanyang.wang
From: Quanyang Wang 

This is detected by kmemleak running on zcu102 board:

unreferenced object 0xffc877e48180 (size 128):
comm "swapper/0", pid 1, jiffies 4294892909 (age 315.436s)
hex dump (first 32 bytes):
64 70 5f 76 69 64 65 6f 5f 72 65 66 5f 64 69 76 dp_video_ref_div
31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1...
backtrace:
[] __kmalloc_track_caller+0x200/0x380
[] kvasprintf+0x7c/0x100
[] kasprintf+0x60/0x80
[<92298b05>] zynqmp_register_clocks+0x29c/0x398
[] zynqmp_clock_probe+0x3cc/0x4c0
[<5f5986f0>] platform_drv_probe+0x58/0xa8
[] really_probe+0xd8/0x2a8
[] driver_probe_device+0x5c/0x100
[<38f91fcf>] __device_attach_driver+0x98/0xb8
[<8a3f2ac2>] bus_for_each_drv+0x74/0xd8
[<1cb2783d>] __device_attach+0xe0/0x140
[] device_initial_probe+0x24/0x30
[<6998de4b>] bus_probe_device+0x9c/0xa8
[<647ae6ff>] device_add+0x3c0/0x610
[<71c14bb8>] of_device_add+0x40/0x50
[<4bb5d132>] of_platform_device_create_pdata+0xbc/0x138

This is because that when num_nodes is larger than 1, clk_out is
allocated using kasprintf for these nodes but only the last node's
clk_out is freed.

Signed-off-by: Quanyang Wang 
---
 drivers/clk/zynqmp/clkc.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/zynqmp/clkc.c b/drivers/clk/zynqmp/clkc.c
index 64355fd07f6b..536f68c98e97 100644
--- a/drivers/clk/zynqmp/clkc.c
+++ b/drivers/clk/zynqmp/clkc.c
@@ -563,7 +563,7 @@ static struct clk_hw *zynqmp_register_clk_topology(int 
clk_id, char *clk_name,
 {
int j;
u32 num_nodes, clk_dev_id;
-   char *clk_out = NULL;
+   char *clk_out[MAX_NODES];
struct clock_topology *nodes;
struct clk_hw *hw = NULL;
 
@@ -577,16 +577,16 @@ static struct clk_hw *zynqmp_register_clk_topology(int 
clk_id, char *clk_name,
 * Intermediate clock names are postfixed with type of clock.
 */
if (j != (num_nodes - 1)) {
-   clk_out = kasprintf(GFP_KERNEL, "%s%s", clk_name,
+   clk_out[j] = kasprintf(GFP_KERNEL, "%s%s", clk_name,
clk_type_postfix[nodes[j].type]);
} else {
-   clk_out = kasprintf(GFP_KERNEL, "%s", clk_name);
+   clk_out[j] = kasprintf(GFP_KERNEL, "%s", clk_name);
}
 
if (!clk_topology[nodes[j].type])
continue;
 
-   hw = (*clk_topology[nodes[j].type])(clk_out, clk_dev_id,
+   hw = (*clk_topology[nodes[j].type])(clk_out[j], clk_dev_id,
parent_names,
num_parents,
[j]);
@@ -595,9 +595,12 @@ static struct clk_hw *zynqmp_register_clk_topology(int 
clk_id, char *clk_name,
 __func__,  clk_dev_id, clk_name,
 PTR_ERR(hw));
 
-   parent_names[0] = clk_out;
+   parent_names[0] = clk_out[j];
}
-   kfree(clk_out);
+
+   for (j = 0; j < num_nodes; j++)
+   kfree(clk_out[j]);
+
return hw;
 }
 
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 0/1] fix kmemleak in zcu102

2019-10-16 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce, Michal,

This patch fixes a kmemleak in zcu102 board.

Would you please help review and merge these patches to linux-yocto
v5.2/standard/xlnx-soc branch?

Quanyang Wang (1):
  clk: zynqmp: fix memory leak in zynqmp_register_clocks

 drivers/clk/zynqmp/clkc.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 0/1] xilinx-zynqmp: fix calltrace

2019-10-15 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce, Michal,

This patch fixes a calltrace when enable CONFIG_TRACING kernel option.

Would you please help review and merge these patches to linux-yocto
v5.2/standard/xlnx-soc branch?

Quanyang Wang (1):
  dma: xilinx: dpdma: alloc xilinx_dpdma_tx_desc using GFP_ATOMIC

 drivers/dma/xilinx/xilinx_dpdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 1/1] dma: xilinx: dpdma: alloc xilinx_dpdma_tx_desc using GFP_ATOMIC

2019-10-15 Thread quanyang.wang
From: Quanyang Wang 

The function xilinx_dpdma_chan_alloc_tx_desc can be called
from atomic context, hence use GFP_ATOMIC instead of GFP_KERNEL,
or else it will cause the calltrace as below:

BUG: sleeping function called from invalid context at mm/slab.h:418
in_atomic(): 1, irqs_disabled(): 128, pid: 416, name: alsa-sink-(null 
Preemption disabled at:
[] snd_pcm_stream_lock_irq+0x40/0x50
CPU: 2 PID: 416 Comm: alsa-sink-(null Tainted: G O 5.2.17-yocto-standard #1
Hardware name: ZynqMP ZCU102 Rev1.0 (DT) Call trace:
dump_backtrace+0x0/0x138
show_stack+0x24/0x30
dump_stack+0x94/0xbc
___might_sleep+0x14c/0x178
__might_sleep+0x58/0x90
kmem_cache_alloc_trace+0x1a4/0x300
xilinx_dpdma_chan_alloc_tx_desc.isra.0+0x24/0x40
xilinx_dpdma_prep_dma_cyclic+0xc0/0x208
snd_dmaengine_pcm_trigger+0xf8/0x198
soc_pcm_trigger+0xb4/0x128
snd_pcm_do_start+0x48/0x58
snd_pcm_action_single+0x4c/0xa0
snd_pcm_action+0x78/0x90
snd_pcm_action_lock_irq+0x3c/0x60
snd_pcm_common_ioctl+0x4ac/0x10c8
snd_pcm_ioctl+0x48/0x68
do_vfs_ioctl+0x6d4/0x968
ksys_ioctl+0x84/0xb8
__arm64_sys_ioctl+0x28/0x38
el0_svc_common.constprop.0+0x74/0x180
el0_svc_handler+0x70/0x90
el0_svc+0x8/0xc

Signed-off-by: Quanyang Wang 
---
 drivers/dma/xilinx/xilinx_dpdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/xilinx/xilinx_dpdma.c 
b/drivers/dma/xilinx/xilinx_dpdma.c
index 1ea509e00742..89ade893f51c 100644
--- a/drivers/dma/xilinx/xilinx_dpdma.c
+++ b/drivers/dma/xilinx/xilinx_dpdma.c
@@ -797,7 +797,7 @@ xilinx_dpdma_chan_alloc_tx_desc(struct xilinx_dpdma_chan 
*chan)
 {
struct xilinx_dpdma_tx_desc *tx_desc;
 
-   tx_desc = kzalloc(sizeof(*tx_desc), GFP_KERNEL);
+   tx_desc = kzalloc(sizeof(*tx_desc), GFP_ATOMIC);
if (!tx_desc)
return NULL;
 
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 1/1] xilinx-zynqmp: delete obsolete kernel options

2019-10-15 Thread quanyang.wang
From: Quanyang Wang 

These kernel options have been removed frome kernel, so
delete them from xilinx-zynqmp.cfg.

Signed-off-by: Quanyang Wang 
---
 bsp/xilinx-zynqmp/xilinx-zynqmp.cfg | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg 
b/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg
index 0560739c..fe8ae24d 100644
--- a/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg
+++ b/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg
@@ -35,9 +35,8 @@ CONFIG_NETDEVICES=y
 CONFIG_OF=y
 CONFIG_OF_MDIO=y
 CONFIG_ETHERNET=y
-CONFIG_NET_CADENCE=y
+CONFIG_NET_VENDOR_CADENCE=y
 CONFIG_MACB=y
-CONFIG_MACB_EXT_BD=y
 CONFIG_XILINX_EMACLITE=y
 CONFIG_XILINX_AXI_EMAC=y
 
@@ -71,7 +70,6 @@ CONFIG_SPI_XILINX=y
 CONFIG_SPI_ZYNQMP_GQSPI=y
 
 CONFIG_GPIOLIB=y
-CONFIG_GPIO_DEVRES=y
 CONFIG_OF_GPIO=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_XILINX=y
@@ -101,7 +99,6 @@ CONFIG_MMC_SDHCI_PLTFM=y
 CONFIG_MMC_SDHCI_OF_ARASAN=y
 
 CONFIG_EDAC=y
-CONFIG_EDAC_MM_EDAC=y
 CONFIG_EDAC_SYNOPSYS=y
 CONFIG_EDAC_ZYNQMP_OCM=y
 
@@ -129,7 +126,6 @@ CONFIG_COMMON_CLK=y
 CONFIG_COMMON_CLK_SI570=y
 CONFIG_COMMON_CLK_SI5324=y
 CONFIG_COMMON_CLK_ZYNQMP=y
-CONFIG_CLKSRC_OF=y
 CONFIG_IOMMU_API=y
 CONFIG_IOMMU_SUPPORT=y
 CONFIG_OF_IOMMU=y
@@ -141,7 +137,6 @@ CONFIG_REMOTEPROC=m
 CONFIG_ZYNQMP_R5_REMOTEPROC=m
 
 CONFIG_STAGING=y
-CONFIG_SOC_XILINX_ZYNQMP=y
 CONFIG_ZYNQMP_PM_DOMAINS=y
 CONFIG_PM_GENERIC_DOMAINS=y
 CONFIG_IRQCHIP=y
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel-cache master/yocto-5.2][PATCH 0/1] xilinx-zynqmp: delete obsolete kernel options

2019-10-15 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce, Michal,

This patch is to delete some obsolete kernel options. Now delete them
or else yocto will throw out build warning infos.

Could you please merge this patch into yocto-kernel-cache, branch is master and 
yocto-5.2?

Thanks,
Quanyang

Quanyang Wang (1):
  xilinx-zynqmp: delete obsolete kernel options

 bsp/xilinx-zynqmp/xilinx-zynqmp.cfg | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 1/2] i2c: cadence: do not clear bus_hold_flag in mrecv

2019-10-13 Thread quanyang.wang
From: Quanyang Wang 

When using i2c_smbus_read_byte_data to read one byte from a
slave device, because of the commit d358def70688
("i2c: cadence: Fix the hold bit setting"), the transaction becomes:

S Addr Wr [A] Comm [A] P S Addr Rd [A] [Data] NA P
   ^
CR_HOLD bit as 0

This will result that the read operation fails and will read "0xff" from
the slave device. In the SMBus protocol stipulates that it must follow that
command with a repeated START condition as below:

S Addr Wr [A] Comm [A] Sr Addr Rd [A] [Data] NA P

So keep CR_HOLD bit to be 1 to make sure that the read operation begins
with a Sr (repeated START) but not a STOP followed by START.

Signed-off-by: Quanyang Wang 
---
 drivers/i2c/busses/i2c-cadence.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
index 6b011931e090..d9493914be15 100644
--- a/drivers/i2c/busses/i2c-cadence.c
+++ b/drivers/i2c/busses/i2c-cadence.c
@@ -626,8 +626,6 @@ static void cdns_i2c_mrecv(struct cdns_i2c *id)
 */
if ((id->recv_count > CDNS_I2C_FIFO_DEPTH)  || id->bus_hold_flag)
ctrl_reg |= CDNS_I2C_CR_HOLD;
-   else
-   ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD;
 
cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET);
 
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 2/2] arch: arm64: dts: add overlay dts file

2019-10-13 Thread quanyang.wang
From: MengLi 

Add overlay dts file for updating FPGA bitstream file on
zynqmp platform.

Signed-off-by: Meng Li 
Signed-off-by: Quanyang Wang 
---
 arch/arm64/boot/dts/xilinx/Makefile|  1 +
 .../dts/xilinx/zynqmp-zcu102-fpga-update.dts   | 18 ++
 2 files changed, 19 insertions(+)
 create mode 100644 arch/arm64/boot/dts/xilinx/zynqmp-zcu102-fpga-update.dts

diff --git a/arch/arm64/boot/dts/xilinx/Makefile 
b/arch/arm64/boot/dts/xilinx/Makefile
index bec4746fe721..d56c449988d0 100644
--- a/arch/arm64/boot/dts/xilinx/Makefile
+++ b/arch/arm64/boot/dts/xilinx/Makefile
@@ -13,6 +13,7 @@ dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zcu100-revC.dtb
 dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zcu102-revA.dtb
 dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zcu102-revB.dtb
 dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zcu102-rev1.0.dtb
+dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zcu102-fpga-update.dtb
 dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zcu104-revA.dtb
 dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zcu104-revC.dtb
 dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-zcu106-revA.dtb
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-fpga-update.dts 
b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-fpga-update.dts
new file mode 100644
index ..f1e1506b6210
--- /dev/null
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-fpga-update.dts
@@ -0,0 +1,18 @@
+// overlay dts file.
+/dts-v1/;
+/plugin/;
+
+/ {
+   fragment@0 {
+   target-path = "/fpga-full";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   __overlay__ {
+   #address-cells = <2>;
+   #size-cells = <2>;
+
+   firmware-name = "system.bit.bin";
+   };
+   };
+};
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 0/2] patches for xilinx

2019-10-13 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce, Michal,

The patch "arch: arm64: dts: add overlay dts file" is made for FPGA programming
using Device Tree Overlay.

The patch "i2c: cadence: do not clear bus_hold_flag in mrecv" is to
fix a bug which is introduced by upstream commit d358def70688. This
bug will result that all i2c_smbus_read_byte_data calls will read
invalid data from slave device for example ucd10120 in zynq-zc706 board.

Would you please help review and merge these patches to linux-yocto
v5.2/standard/xlnx-soc branch?

Thanks,
Quanyang

MengLi (1):
  arch: arm64: dts: add overlay dts file

Quanyang Wang (1):
  i2c: cadence: do not clear bus_hold_flag in mrecv

 arch/arm64/boot/dts/xilinx/Makefile|  1 +
 .../dts/xilinx/zynqmp-zcu102-fpga-update.dts   | 18 ++
 drivers/i2c/busses/i2c-cadence.c   |  2 --
 3 files changed, 19 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm64/boot/dts/xilinx/zynqmp-zcu102-fpga-update.dts

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 1/2] arm: zynq: delete AFLAGS_suspend.o to fix compile warning

2019-10-08 Thread quanyang.wang
From: Quanyang Wang 

When using arm-linux-gnueabihf-gcc v9.2.0 to compile kernel, there will be
warning info as below:

cc1: warning: switch '-mcpu=cortex-a9' conflicts with '-march=armv7-a' switch

This is because that if "-march" and "-mcpu" options are passed to gcc together,
gcc will check if there is conflict between the two options unconsidering 
"quirk"
and "fpu" features. In gcc, the commit e319ca91f665 ("PR target/88799 Add +mp
and +sec extensions to ARMv7-a") add "mp" and "sec" features to "cortex-a9".
So the check will fail because the features in "cortex-a9" and "armv7-a" are no
longer the same.

Since suspend.S doesn't contain any "mp (Multiprocessing Extensions for v7-A
and v7-R architectures)" and "sec" (Security Extensions for v6K and v7-A
architectures) instruction, and "-march=armv7-a" has been defined in 
arch/arm/Makefile,
the "-mcpu=cortex-a9" is redudant here.

Signed-off-by: Quanyang Wang 
---
 arch/arm/mach-zynq/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-zynq/Makefile b/arch/arm/mach-zynq/Makefile
index 374207c87f96..dbb75be53deb 100644
--- a/arch/arm/mach-zynq/Makefile
+++ b/arch/arm/mach-zynq/Makefile
@@ -9,5 +9,4 @@ obj-y   := common.o efuse.o slcr.o 
zynq_ocm.o pm.o
 obj-$(CONFIG_SMP)  += headsmp.o platsmp.o
 ORIG_AFLAGS := $(KBUILD_AFLAGS)
 KBUILD_AFLAGS = $(subst -march=armv6k,,$(ORIG_AFLAGS))
-AFLAGS_suspend.o   +=-Wa,-march=armv7-a -mcpu=cortex-a9
 obj-$(CONFIG_SUSPEND)  += suspend.o
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 2/2] arm: dts: zynq: update coresight device node

2019-10-08 Thread quanyang.wang
From: Quanyang Wang 

Using new compatible value for funnel and replicator device nodes,
and use correct unit-address.

Signed-off-by: Quanyang Wang 
---
 arch/arm/boot/dts/zynq-7000.dtsi | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi
index 5602f4f3ad1c..9b8f46d25d38 100644
--- a/arch/arm/boot/dts/zynq-7000.dtsi
+++ b/arch/arm/boot/dts/zynq-7000.dtsi
@@ -447,8 +447,8 @@
};
};
 
-   funnel@0,f8804000 {
-   compatible = "arm,coresight-funnel", "arm,primecell";
+   funnel@f8804000 {
+   compatible = "arm,coresight-static-funnel", 
"arm,primecell";
reg = <0xf8804000 0x1000>;
clocks = < 27>, < 46>, < 47>;
clock-names = "apb_pclk", "dbg_trc", "dbg_apb";
@@ -503,7 +503,7 @@
};
 
replicator {
-   compatible = "arm,coresight-replicator";
+   compatible = "arm,coresight-static-replicator";
clocks = < 27>, < 46>, < 47>;
clock-names = "apb_pclk", "dbg_trc", "dbg_apb";
 
@@ -536,8 +536,8 @@
};
};
 
-   itm@0,f8805000 {
-   compatible = "arm,coresight-etm3x", "arm,primecell";
+   /* ITM is not supported by kernel, only leave device node here 
*/
+   itm@f8805000 {
reg = <0xf8805000 0x1000>;
clocks = < 27>, < 46>, < 47>;
clock-names = "apb_pclk", "dbg_trc", "dbg_apb";
@@ -549,7 +549,7 @@
};
};
 
-   ptm@0,f889c000 {
+   ptm@f889c000 {
compatible = "arm,coresight-etm3x", "arm,primecell";
reg = <0xf889c000 0x1000>;
clocks = < 27>, < 46>, < 47>;
@@ -562,7 +562,7 @@
};
};
 
-   ptm@0,f889d000 {
+   ptm@f889d000 {
compatible = "arm,coresight-etm3x", "arm,primecell";
reg = <0xf889d000 0x1000>;
clocks = < 27>, < 46>, < 47>;
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 0/2] patches for zynq

2019-10-08 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce, Michal,

There are 2 patches. One is fixing compile warning which is triggered by
new version gcc 9.2.0. And the other is changed according to Michal's
suggestions.

Would you please help review and merge these patches to linux-yocto 
v5.2/standard/xlnx-soc branch?

Thanks,
Quanyang

Quanyang Wang (2):
  arm: zynq: delete AFLAGS_suspend.o to fix compile warning
  arm: dts: zynq: update coresight device node

 arch/arm/boot/dts/zynq-7000.dtsi | 14 +++---
 arch/arm/mach-zynq/Makefile  |  1 -
 2 files changed, 7 insertions(+), 8 deletions(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 1/3] ARM: dts: zc702: Fix I2C bus warnings

2019-09-23 Thread quanyang.wang
From: Quanyang Wang 

The dtc has new checks for I2C and SPI buses.
Fix the warnings in node names and unit-addresses.

arch/arm/boot/dts/zynq-zc702.dts:187.13-190.6: Warning (i2c_bus_reg): 
/amba/i2c@e0004000/i2c-mux@74/i2c@7/hwmon@52: I2C bus unit address format 
error, expected "34"
arch/arm/boot/dts/zynq-zc702.dts:191.13-194.6: Warning (i2c_bus_reg): 
/amba/i2c@e0004000/i2c-mux@74/i2c@7/hwmon@53: I2C bus unit address format 
error, expected "35"
arch/arm/boot/dts/zynq-zc702.dts:195.13-198.6: Warning (i2c_bus_reg): 
/amba/i2c@e0004000/i2c-mux@74/i2c@7/hwmon@54: I2C bus unit address format 
error, expected "36"

Signed-off-by: Quanyang Wang 
---
 arch/arm/boot/dts/zynq-zc702.dts | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/zynq-zc702.dts b/arch/arm/boot/dts/zynq-zc702.dts
index 0071b2b7f853..c9940fb366ce 100644
--- a/arch/arm/boot/dts/zynq-zc702.dts
+++ b/arch/arm/boot/dts/zynq-zc702.dts
@@ -184,17 +184,17 @@
#address-cells = <1>;
#size-cells = <0>;
reg = <7>;
-   hwmon@52 {
+   hwmon@34 {
compatible = "ti,ucd9248";
-   reg = <52>;
+   reg = <0x34>;
};
-   hwmon@53 {
+   hwmon@35 {
compatible = "ti,ucd9248";
-   reg = <53>;
+   reg = <0x35>;
};
-   hwmon@54 {
+   hwmon@36 {
compatible = "ti,ucd9248";
-   reg = <54>;
+   reg = <0x36>;
};
};
};
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 2/3] arm: dts: zynq: enablement of coresight topology

2019-09-23 Thread quanyang.wang
From: Zumeng Chen 

This patch is to build the coresight topology structure of zynq-7000
series according to the docs of coresight and userguide of zynq-7000.

Signed-off-by: Zumeng Chen 
Signed-off-by: Quanyang Wang 
---
 arch/arm/boot/dts/zynq-7000.dtsi | 155 +++
 1 file changed, 155 insertions(+)

diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi
index 07bd31d2ed4a..5602f4f3ad1c 100644
--- a/arch/arm/boot/dts/zynq-7000.dtsi
+++ b/arch/arm/boot/dts/zynq-7000.dtsi
@@ -419,5 +419,160 @@
reg = <0xf8005000 0x1000>;
timeout-sec = <10>;
};
+
+   etb@f8801000 {
+   compatible = "arm,coresight-etb10", "arm,primecell";
+   reg = <0xf8801000 0x1000>;
+   clocks = < 27>, < 46>, < 47>;
+   clock-names = "apb_pclk", "dbg_trc", "dbg_apb";
+
+   port {
+   etb_in_port: endpoint {
+   remote-endpoint = 
<_out_port1>;
+   };
+   };
+   };
+
+   tpiu@f8803000 {
+   compatible = "arm,coresight-tpiu", "arm,primecell";
+   reg = <0xf8803000 0x1000>;
+   clocks = < 27>, < 46>, < 47>;
+   clock-names = "apb_pclk", "dbg_trc", "dbg_apb";
+
+   port {
+   tpiu_in_port: endpoint {
+   slave-mode;
+   remote-endpoint = 
<_out_port0>;
+   };
+   };
+   };
+
+   funnel@0,f8804000 {
+   compatible = "arm,coresight-funnel", "arm,primecell";
+   reg = <0xf8804000 0x1000>;
+   clocks = < 27>, < 46>, < 47>;
+   clock-names = "apb_pclk", "dbg_trc", "dbg_apb";
+
+   /* funnel output ports */
+   out-ports {
+   port {
+   funnel_out_port: endpoint {
+   remote-endpoint =
+   <_in_port0>;
+   };
+   };
+   };
+
+   in-ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   /* funnel input ports */
+   port@0 {
+   reg = <0>;
+   funnel0_in_port0: endpoint {
+   slave-mode;
+   remote-endpoint = 
<_out_port>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+   funnel0_in_port1: endpoint {
+   slave-mode;
+   remote-endpoint = 
<_out_port>;
+   };
+   };
+
+   port@2 {
+   reg = <2>;
+   funnel0_in_port2: endpoint {
+   slave-mode;
+   };
+   };
+
+   port@3 {
+   reg = <3>;
+   funnel0_in_port3: endpoint {
+   slave-mode;
+   remote-endpoint = 
<_out_port>;
+   };
+   };
+   /*The other input ports are not connect to 
anything */
+   };
+   };
+
+   replicator {
+   compatible = "arm,coresight-replicator";
+   clocks = < 27>, < 46>, < 47>;
+   clock-names = "apb_pclk", "dbg_trc", "dbg_apb";
+
+   out-ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   /* replicator output ports */
+   port@0 {
+   reg = <0>;
+   replicator_out_port0: endpoint {
+   remote-endpoint = 
<_in_port>;
+   };

[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 3/3] mmc: sdhci-of-arasan: Fix the incorrect soft reset operation when runtime resuming

2019-09-23 Thread quanyang.wang
From: Quanyang Wang 

Because of upstream commit c6303c5d52d5 ("mmc: sdhci-sprd: Fix
the incorrect soft reset operation when runtime resuming"), add
a new parameter to sdhci_runtime_resume_host.

Signed-off-by: Quanyang Wang 
---
 drivers/mmc/host/sdhci-of-arasan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-of-arasan.c 
b/drivers/mmc/host/sdhci-of-arasan.c
index 7a7b35c9009f..c72382d9ea9d 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -720,7 +720,7 @@ static int sdhci_arasan_runtime_resume(struct device *dev)
return ret;
}
 
-   ret = sdhci_runtime_resume_host(host);
+   ret = sdhci_runtime_resume_host(host, 0);
if (ret)
goto out;
 
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 0/3] patches for zynq7000

2019-09-23 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce,

Would you please help merge these patches to linux-yocto v5.2/standard/xlnx-soc 
branch?

Thanks,
Quanyang

Quanyang Wang (2):
  ARM: dts: zc702: Fix I2C bus warnings
  mmc: sdhci-of-arasan: Fix the incorrect soft reset operation when
runtime resuming

Zumeng Chen (1):
  arm: dts: zynq: enablement of coresight topology

 arch/arm/boot/dts/zynq-7000.dtsi   | 155 +
 arch/arm/boot/dts/zynq-zc702.dts   |  12 +--
 drivers/mmc/host/sdhci-of-arasan.c |   2 +-
 3 files changed, 162 insertions(+), 7 deletions(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel-cache][PATCH 0/1] xilinx-zynq: enable coresight and xadc kernel options for xilinx-zynq bsp

2019-09-23 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce,

Would you please help merge this patch to yocto-kernel-cache's branch yocto-5.2 
?

Thanks,
Quanyang

Quanyang Wang (1):
  xilinx-zynq: enable coresight and xadc kernel options for xilinx-zynq
bsp

 bsp/xilinx-zynq/xilinx-zynq.cfg | 9 +
 1 file changed, 9 insertions(+)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel-cache][PATCH 1/1] xilinx-zynq: enable coresight and xadc kernel options for xilinx-zynq bsp

2019-09-23 Thread quanyang.wang
From: Quanyang Wang 

Signed-off-by: Quanyang Wang 
---
 bsp/xilinx-zynq/xilinx-zynq.cfg | 9 +
 1 file changed, 9 insertions(+)

diff --git a/bsp/xilinx-zynq/xilinx-zynq.cfg b/bsp/xilinx-zynq/xilinx-zynq.cfg
index 3b4cc64d..5cb53294 100644
--- a/bsp/xilinx-zynq/xilinx-zynq.cfg
+++ b/bsp/xilinx-zynq/xilinx-zynq.cfg
@@ -197,3 +197,12 @@ CONFIG_IIO_SW_DEVICE=y
 CONFIG_IIO_SW_TRIGGER=y
 CONFIG_OF_OVERLAY=y
 CONFIG_OF_CONFIGFS=y
+
+CONFIG_CORESIGHT=y
+CONFIG_CORESIGHT_LINKS_AND_SINKS=y
+CONFIG_CORESIGHT_LINK_AND_SINK_TMC=y
+CONFIG_CORESIGHT_SINK_TPIU=y
+CONFIG_CORESIGHT_SINK_ETBV10=y
+CONFIG_CORESIGHT_SOURCE_ETM3X=y
+
+CONFIG_XILINX_XADC=y
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 2/2] spi: spi-mem: zynq-qspi: add is-dual support for zc706 board

2019-09-19 Thread quanyang.wang
From: Quanyang Wang 

There are 2 SPI flash memories in zc706 board and it use the
configuration "Dual SS, 8-bit Parallel" which means separate
Slave-Select lines and separate 4 data lines. So add the is-dual
support for zc706 board according to the spi driver in SDK.

Refer to bd2c1810ae87 ("spi: zynq-qspi: Add driver for zynq qspi")
in https://github.com/Xilinx/linux-xlnx.git xlnx_rebase_v4.19

Signed-off-by: Quanyang Wang 
---
 drivers/spi/spi-zynq-qspi.c | 43 +++--
 1 file changed, 41 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-zynq-qspi.c b/drivers/spi/spi-zynq-qspi.c
index c6bee67decb5..2041d5dcf294 100644
--- a/drivers/spi/spi-zynq-qspi.c
+++ b/drivers/spi/spi-zynq-qspi.c
@@ -129,6 +129,9 @@
  * @rxbuf: Pointer to the RX buffer
  * @tx_bytes:  Number of bytes left to transfer
  * @rx_bytes:  Number of bytes left to receive
+ * @is_dual:   Flag to indicate whether dual flash memories are used
+ * @is_instr:  Flag to indicate if transfer contains an instruction
+ * (Used in dual parallel configuration)
  * @data_completion:   completion structure
  */
 struct zynq_qspi {
@@ -141,6 +144,8 @@ struct zynq_qspi {
u8 *rxbuf;
int tx_bytes;
int rx_bytes;
+   u32 is_dual;
+   u8 is_instr;
struct completion data_completion;
 };
 
@@ -213,6 +218,14 @@ static void zynq_qspi_init_hw(struct zynq_qspi *xqspi)
zynq_qspi_write(xqspi, ZYNQ_QSPI_TX_THRESH_OFFSET,
ZYNQ_QSPI_TX_THRESHOLD);
 
+   if (xqspi->is_dual)
+   /* Enable two memories on separate buses */
+   zynq_qspi_write(xqspi, ZYNQ_QSPI_LINEAR_CFG_OFFSET,
+   (ZYNQ_QSPI_LCFG_TWO_MEM_MASK |
+   ZYNQ_QSPI_LCFG_SEP_BUS_MASK |
+   (1 << ZYNQ_QSPI_LCFG_DUMMY_SHIFT) |
+   ZYNQ_QSPI_FAST_READ_QOUT_CODE));
+
zynq_qspi_write(xqspi, ZYNQ_QSPI_ENABLE_OFFSET,
ZYNQ_QSPI_ENABLE_ENABLE_MASK);
 }
@@ -236,15 +249,23 @@ static bool zynq_qspi_supports_op(struct spi_mem *mem,
  * zynq_qspi_rxfifo_op - Read 1..4 bytes from RxFIFO to RX buffer
  * @xqspi: Pointer to the zynq_qspi structure
  * @size:  Number of bytes to be read (1..4)
+ *
+ * Note: In case of dual parallel connection, even number of bytes are read
+ * when odd bytes are requested to avoid transfer of a nibble to each flash.
+ * The receive buffer though, is populated with the number of bytes requested.
  */
 static void zynq_qspi_rxfifo_op(struct zynq_qspi *xqspi, unsigned int size)
 {
+   unsigned int xsize;
u32 data;
 
data = zynq_qspi_read(xqspi, ZYNQ_QSPI_RXD_OFFSET);
 
if (xqspi->rxbuf) {
-   memcpy(xqspi->rxbuf, ((u8 *)) + 4 - size, size);
+   xsize = size;
+   if (xqspi->is_dual && !xqspi->is_instr && (size % 2))
+   xsize++;
+   memcpy(xqspi->rxbuf, ((u8 *)) + 4 - xsize, size);
xqspi->rxbuf += size;
}
 
@@ -257,12 +278,19 @@ static void zynq_qspi_rxfifo_op(struct zynq_qspi *xqspi, 
unsigned int size)
  * zynq_qspi_txfifo_op - Write 1..4 bytes from TX buffer to TxFIFO
  * @xqspi: Pointer to the zynq_qspi structure
  * @size:  Number of bytes to be written (1..4)
+ *
+ * In dual parallel configuration, when read/write data operations
+ * are performed, odd data bytes have to be converted to even to
+ * avoid a nibble (of data when programming / dummy when reading)
+ * going to individual flash devices, where a byte is expected.
+ * This check is only for data and will not apply for commands.
  */
 static void zynq_qspi_txfifo_op(struct zynq_qspi *xqspi, unsigned int size)
 {
static const unsigned int offset[4] = {
ZYNQ_QSPI_TXD_00_01_OFFSET, ZYNQ_QSPI_TXD_00_10_OFFSET,
ZYNQ_QSPI_TXD_00_11_OFFSET, ZYNQ_QSPI_TXD_00_00_OFFSET };
+   unsigned int xsize;
u32 data;
 
if (xqspi->txbuf) {
@@ -274,7 +302,11 @@ static void zynq_qspi_txfifo_op(struct zynq_qspi *xqspi, 
unsigned int size)
}
 
xqspi->tx_bytes -= size;
-   zynq_qspi_write(xqspi, offset[size - 1], data);
+
+   xsize = size;
+   if (xqspi->is_dual && !xqspi->is_instr && (size % 2))
+   xsize++;
+   zynq_qspi_write(xqspi, offset[xsize - 1], data);
 }
 
 /**
@@ -295,6 +327,7 @@ static void zynq_qspi_chipselect(struct spi_device *spi, 
bool assert)
config_reg |= (((~(BIT(spi->chip_select))) <<
ZYNQ_QSPI_SS_SHIFT) &
ZYNQ_QSPI_CONFIG_SSCTRL_MASK);
+   xqspi->is_instr = 1;
} else {
config_reg |= ZYNQ_QSPI_CONFIG_SSCTRL_MASK;
}
@@ -637,6 +670,12 @@ static int zynq_qspi_probe(struct platform_device *pdev)
goto remove_master;
}
 
+ 

[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 1/2] mtd: spi-nor: change flash_info.flags from u16 to u32 to avoid compile warning

2019-09-19 Thread quanyang.wang
From: Quanyang Wang 

Because SST_GLOBAL_PROT_UNLK is BIT(16) which exceed the extent of
u16, so change it to u32.

drivers/mtd/spi-nor/spi-nor.c:2076:12: warning: large integer implicitly 
truncated to
unsigned type [-Woverflow]
   .flags = (_flags),
^
drivers/mtd/spi-nor/spi-nor.c:2385:19: note: in expansion of macro ‘INFO’
{ "sst26wf016B", INFO(0xbf2651, 0, 64 * 1024, 32, SECT_4K | 
SST_GLOBAL_PROT_UNLK) },
   ^~~~

Signed-off-by: Quanyang Wang 
---
 drivers/mtd/spi-nor/spi-nor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index d3b287e851cf..0c412b77597a 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -268,7 +268,7 @@ struct flash_info {
u16 page_size;
u16 addr_width;
 
-   u16 flags;
+   u32 flags;
 #define SECT_4KBIT(0)  /* SPINOR_OP_BE_4K works 
uniformly */
 #define SPI_NOR_NO_ERASE   BIT(1)  /* No erase command needed */
 #define SST_WRITE  BIT(2)  /* use SST byte programming */
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel v5.2/standard/xlnx-soc][PATCH 0/2] fix compile warning

2019-09-19 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce,

Would you please help me merge the two patches into
linux-ycoto-5.2 kernel, branch v5.2/standard/xlnx-soc ?

Thanks,
Quanyang

Quanyang Wang (2):
  mtd: spi-nor: change flash_info.flags from u16 to u32 to avoid compile
warning
  spi: spi-mem: zynq-qspi: add is-dual support for zc706 board

 drivers/mtd/spi-nor/spi-nor.c |  2 +-
 drivers/spi/spi-zynq-qspi.c   | 43 +--
 2 files changed, 42 insertions(+), 3 deletions(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel-cache yocto-5.2][PATCH 1/1] xilinx-zynq: add the support for xlinx-zynq bsp

2019-09-05 Thread quanyang.wang
From: Quanyang Wang 

This add cfg files to support xilinx zc702 and zc706 boards.

Signed-off-by: Quanyang Wang 
---
 bsp/xilinx-zynq/xilinx-zynq-standard.scc |   7 +
 bsp/xilinx-zynq/xilinx-zynq.cfg  | 199 +++
 bsp/xilinx-zynq/xilinx-zynq.scc  |   8 +
 3 files changed, 214 insertions(+)
 create mode 100644 bsp/xilinx-zynq/xilinx-zynq-standard.scc
 create mode 100644 bsp/xilinx-zynq/xilinx-zynq.cfg
 create mode 100644 bsp/xilinx-zynq/xilinx-zynq.scc

diff --git a/bsp/xilinx-zynq/xilinx-zynq-standard.scc 
b/bsp/xilinx-zynq/xilinx-zynq-standard.scc
new file mode 100644
index ..34856f90
--- /dev/null
+++ b/bsp/xilinx-zynq/xilinx-zynq-standard.scc
@@ -0,0 +1,7 @@
+define KMACHINE xilinx-zynq
+define KTYPE standard
+define KARCH arm
+
+include ktypes/standard
+
+include xilinx-zynq.scc
diff --git a/bsp/xilinx-zynq/xilinx-zynq.cfg b/bsp/xilinx-zynq/xilinx-zynq.cfg
new file mode 100644
index ..3b4cc64d
--- /dev/null
+++ b/bsp/xilinx-zynq/xilinx-zynq.cfg
@@ -0,0 +1,199 @@
+CONFIG_ARCH_ZYNQ=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=4
+CONFIG_HOTPLUG_CPU=y
+CONFIG_VMSPLIT_2G=y
+
+#
+# Xilinx Specific Options
+#
+CONFIG_XILINX_PREFETCH=y
+
+# ERRATA
+CONFIG_PL310_ERRATA_588369=y
+CONFIG_ARM_ERRATA_720789=y
+CONFIG_PL310_ERRATA_727915=y
+CONFIG_PL310_ERRATA_753970=y
+CONFIG_ARM_ERRATA_754322=y
+CONFIG_PL310_ERRATA_769419=y
+CONFIG_ARM_ERRATA_775420=y
+
+CONFIG_VFP=y
+CONFIG_NEON=y
+
+# DMA
+CONFIG_XILINX_DMA_ENGINES=y
+CONFIG_AXI_DMAC=y
+CONFIG_DMADEVICES=y
+CONFIG_DMA_ENGINE=y
+CONFIG_PL330_DMA=y
+CONFIG_XILINX_DMA=y
+
+# Power Management
+CONFIG_PMBUS=y
+CONFIG_SENSORS_UCD9000=y
+
+# Watchdog
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+CONFIG_CADENCE_WATCHDOG=y
+
+# GPIO
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_XILINX=y
+CONFIG_GPIO_ZYNQ=y
+CONFIG_GPIO_PCA953X=y
+
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_LEDS_GPIO=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+# UART
+CONFIG_SERIAL_XILINX_PS_UART=y
+CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
+
+# PTP clock support
+CONFIG_PTP_1588_CLOCK=y
+
+# AXI Ethernet
+CONFIG_NET_VENDOR_XILINX=y
+CONFIG_XILINX_AXI_EMAC=y
+CONFIG_XILINX_AXI_EMAC_HWTSTAMP=y
+
+# Cadence Ethernet
+CONFIG_MACB=y
+CONFIG_MACB_USE_HWSTAMP=y
+
+# PHY
+CONFIG_MARVELL_PHY=y
+CONFIG_VITESSE_PHY=y
+
+# I2C
+CONFIG_I2C=y
+CONFIG_I2C_MUX=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_MUX_PCA954x=y
+CONFIG_I2C_CADENCE=y
+CONFIG_I2C_XILINX=y
+
+# RTC
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_PCF8563=y
+CONFIG_RTC_DRV_DS1307=y
+
+CONFIG_COMMON_CLK_AXI_CLKGEN=y
+
+# SPI
+CONFIG_SPI_CADENCE=y
+CONFIG_SPI_ZYNQ_QSPI=y
+
+# MTD
+CONFIG_MTD=y
+CONFIG_MTD_OF_PARTS=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_M25P80=y
+CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_GEN_PROBE=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_OF=y
+
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+
+# MMC
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_PLTFM=y
+CONFIG_MMC_SDHCI_OF_ARASAN=y
+
+# USB
+CONFIG_USB_OTG=y
+CONFIG_USB_CHIPIDEA=y
+CONFIG_USB_CHIPIDEA_OF=y
+CONFIG_USB_CHIPIDEA_PCI=y
+CONFIG_USB_CHIPIDEA_UDC=y
+CONFIG_USB_CHIPIDEA_HOST=y
+
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_XILINX=y
+
+CONFIG_USB_PHY=y
+CONFIG_USB_ULPI=y
+CONFIG_NOP_USB_XCEIV=y
+
+# PCIe
+CONFIG_PCI=y
+CONFIG_PCI_MSI=y
+CONFIG_PCIE_XILINX=y
+
+# Graphic
+CONFIG_FB=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+
+CONFIG_DRM=y
+CONFIG_DRM_KMS_HELPER=y
+CONFIG_DRM_XILINX=y
+CONFIG_FB_XILINX=y
+
+CONFIG_DRM_I2C_ADV7511=y
+CONFIG_DRM_I2C_ADV7511_AUDIO=y
+CONFIG_DRM_I2C_ADV7533=y
+CONFIG_DRM_I2C_ADV7511_CEC=y
+
+# FPGA
+CONFIG_FPGA=y
+CONFIG_FPGA_MGR_ZYNQ_FPGA=y
+CONFIG_FPGA_BRIDGE=y
+CONFIG_FPGA_REGION=y
+CONFIG_OF_FPGA_REGION=y
+
+# Misc
+CONFIG_INPUT=y
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_EVDEV=y
+CONFIG_CMA=y
+CONFIG_DMA_CMA=y
+CONFIG_UIO=y
+CONFIG_UIO_PDRV_GENIRQ=y
+CONFIG_UIO_XILINX_APM=y
+
+CONFIG_COMMON_CLK_SI570=y
+
+CONFIG_CPU_IDLE=y
+CONFIG_ARM_CPUIDLE=y
+CONFIG_ARM_ZYNQ_CPUIDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
+
+CONFIG_EEPROM_AT24=y
+
+CONFIG_MEDIA_SUPPORT=y
+CONFIG_MEDIA_CAMERA_SUPPORT=y
+CONFIG_MEDIA_CONTROLLER=y
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
+CONFIG_V4L_PLATFORM_DRIVERS=y
+CONFIG_MEDIA_SUBDRV_AUTOSELECT=y
+CONFIG_MEDIA_USB_SUPPORT=y
+
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
+CONFIG_SND_SOC_ADI=y
+CONFIG_SND_SOC_ADI_AXI_I2S=y
+CONFIG_SND_SOC_ADI_AXI_SPDIF=y
+CONFIG_SND_SIMPLE_CARD=y
+
+CONFIG_DEBUG_LL=y
+CONFIG_DEBUG_ZYNQ_UART1=y
+CONFIG_EARLY_PRINTK=y
+
+CONFIG_IIO=y
+CONFIG_XILINX_TRAFGEN=y
+CONFIG_IIO_CONFIGFS=y
+CONFIG_IIO_SW_DEVICE=y
+CONFIG_IIO_SW_TRIGGER=y
+CONFIG_OF_OVERLAY=y
+CONFIG_OF_CONFIGFS=y
diff --git a/bsp/xilinx-zynq/xilinx-zynq.scc b/bsp/xilinx-zynq/xilinx-zynq.scc
new file mode 100644
index ..621f6954
--- /dev/null
+++ b/bsp/xilinx-zynq/xilinx-zynq.scc
@@ -0,0 +1,8 @@
+include arch/arm/arm.scc nopatch
+include cfg/usb-mass-storage.scc
+include features/spi/spi.scc
+include features/spi/spidev.scc
+include features/usb/ehci-hcd.scc
+include features/debug/debug-kernel.scc
+
+kconf hardware 

[linux-yocto] [kernel-cache yocto-5.2][PATCH 0/1] xilinx-zynq: add kernel-cache support for zc702 and zc706 boards

2019-09-05 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce,

The patch as below includes scc and cfg files for xilinx zc702/zc706 boards.

Could you please merge this patch into yocto-kernel-cache, branch is yocto-5.2?

Quanyang Wang (1):
  xilinx-zynq: add the support for xlinx-zynq bsp

 bsp/xilinx-zynq/xilinx-zynq-standard.scc |   7 +
 bsp/xilinx-zynq/xilinx-zynq.cfg  | 199 +++
 bsp/xilinx-zynq/xilinx-zynq.scc  |   8 +
 3 files changed, 214 insertions(+)
 create mode 100644 bsp/xilinx-zynq/xilinx-zynq-standard.scc
 create mode 100644 bsp/xilinx-zynq/xilinx-zynq.cfg
 create mode 100644 bsp/xilinx-zynq/xilinx-zynq.scc

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [linux-yocto-dev standard/xlnx-soc][PATCH 1/1] net: phy: dp83867: correct the code postion

2019-07-22 Thread quanyang.wang
From: Quanyang Wang 

Signed-off-by: Quanyang Wang 
---
 drivers/net/phy/dp83867.c | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 01e2abcbb226..2d8126953ebd 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -335,33 +335,33 @@ static int dp83867_config_init(struct phy_device *phydev)
phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_CFG4,
  val);
}
+   }
 
-   /* Set up RGMII delays */
-   val = phy_read_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIICTL);
+   /* Set up RGMII delays */
+   val = phy_read_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIICTL);
 
-   if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
-   val |= (DP83867_RGMII_TX_CLK_DELAY_EN | 
DP83867_RGMII_RX_CLK_DELAY_EN);
+   if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
+   val |= (DP83867_RGMII_TX_CLK_DELAY_EN | 
DP83867_RGMII_RX_CLK_DELAY_EN);
 
-   if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
-   val |= DP83867_RGMII_TX_CLK_DELAY_EN;
+   if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
+   val |= DP83867_RGMII_TX_CLK_DELAY_EN;
 
-   if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
-   val |= DP83867_RGMII_RX_CLK_DELAY_EN;
+   if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
+   val |= DP83867_RGMII_RX_CLK_DELAY_EN;
 
-   phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIICTL, val);
+   phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIICTL, val);
 
-   delay = (dp83867->rx_id_delay |
-   (dp83867->tx_id_delay << 
DP83867_RGMII_TX_CLK_DELAY_SHIFT));
+   delay = (dp83867->rx_id_delay |
+   (dp83867->tx_id_delay << DP83867_RGMII_TX_CLK_DELAY_SHIFT));
 
-   phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIIDCTL,
- delay);
+   phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIIDCTL,
+ delay);
 
-   if (dp83867->io_impedance >= 0)
-   phy_modify_mmd(phydev, DP83867_DEVADDR, 
DP83867_IO_MUX_CFG,
-  DP83867_IO_MUX_CFG_IO_IMPEDANCE_CTRL,
-  dp83867->io_impedance &
-  DP83867_IO_MUX_CFG_IO_IMPEDANCE_CTRL);
-   }
+   if (dp83867->io_impedance >= 0)
+   phy_modify_mmd(phydev, DP83867_DEVADDR, DP83867_IO_MUX_CFG,
+  DP83867_IO_MUX_CFG_IO_IMPEDANCE_CTRL,
+  dp83867->io_impedance &
+  DP83867_IO_MUX_CFG_IO_IMPEDANCE_CTRL);
 
if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
/* For support SPEED_10 in SGMII mode
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [linux-yocto-dev standard/xlnx-soc][PATCH 0/1] correct the code position

2019-07-22 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce,

Would you please help to merge this patch to 
linux-yocto-dev standard/xlnx-soc
linux-yocto v5.2/standard/xlnx-soc

Thanks,
Quanyang 

Quanyang Wang (1):
  net: phy: dp83867: correct the code postion

 drivers/net/phy/dp83867.c | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel-cache master][PATCH 1/1] xilinx-zynqmp: enable kernel options for SDK xlnx_rebase_v4.19

2019-07-22 Thread quanyang.wang
From: Quanyang Wang 

The SDK xlnx_rebase_v4.19 bsp patches need enable more kernel options.

Signed-off-by: Quanyang Wang 
---
 bsp/xilinx-zynqmp/xilinx-zynqmp.cfg | 76 +
 bsp/xilinx-zynqmp/xilinx-zynqmp.scc |  1 +
 2 files changed, 77 insertions(+)

diff --git a/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg 
b/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg
index cf9ba4a6..50dd32aa 100644
--- a/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg
+++ b/bsp/xilinx-zynqmp/xilinx-zynqmp.cfg
@@ -37,9 +37,12 @@ CONFIG_ETHERNET=y
 CONFIG_NET_CADENCE=y
 CONFIG_MACB=y
 CONFIG_MACB_EXT_BD=y
+CONFIG_XILINX_EMACLITE=y
+CONFIG_XILINX_AXI_EMAC=y
 
 CONFIG_PHYLIB=y
 CONFIG_XILINX_PHY=y
+CONFIG_DP83867_PHY=y
 
 CONFIG_PHY_XILINX_ZYNQMP=y
 CONFIG_FIXED_PHY=y
@@ -72,6 +75,7 @@ CONFIG_OF_GPIO=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_XILINX=y
 CONFIG_GPIO_PCA953X=y
+CONFIG_GPIO_PCA953X_IRQ=y
 CONFIG_GPIO_ZYNQ=y
 
 CONFIG_POWER_RESET=y
@@ -85,6 +89,7 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_OF_SIMPLE=y
 CONFIG_USB_OTG=y
+CONFIG_USB_OTG_FSM=m
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_XILINX=y
 
@@ -101,20 +106,27 @@ CONFIG_EDAC_ZYNQMP_OCM=y
 
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+CONFIG_RTC_INTF_SYSFS=y
 CONFIG_RTC_DRV_ZYNQMP=y
 
 CONFIG_DMADEVICES=y
+CONFIG_XILINX_DMA_ENGINES=y
 CONFIG_DMA_ENGINE=y
 CONFIG_DMA_OF=y
 CONFIG_CMA=y
 CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=256
 
 CONFIG_XILINX_ZYNQMP_DMA=y
 CONFIG_XILINX_DMA=y
 
+CONFIG_UIO=y
+CONFIG_UIO_XILINX_APM=y
 CONFIG_VIRTIO=y
 CONFIG_COMMON_CLK=y
 CONFIG_COMMON_CLK_SI570=y
+CONFIG_COMMON_CLK_SI5324=y
 CONFIG_COMMON_CLK_ZYNQMP=y
 CONFIG_CLKSRC_OF=y
 CONFIG_IOMMU_API=y
@@ -122,6 +134,10 @@ CONFIG_IOMMU_SUPPORT=y
 CONFIG_OF_IOMMU=y
 CONFIG_ARM_SMMU=y
 CONFIG_ARM_SMMU_V3=y
+#
+CONFIG_RPMSG=m
+CONFIG_REMOTEPROC=m
+CONFIG_ZYNQMP_R5_REMOTEPROC=m
 
 CONFIG_STAGING=y
 CONFIG_SOC_XILINX_ZYNQMP=y
@@ -132,11 +148,17 @@ CONFIG_ARM_GIC=y
 CONFIG_ARM_GIC_V3=y
 CONFIG_ARM_GIC_V3_ITS=y
 
+CONFIG_IIO=y
+CONFIG_XILINX_XADC=y
+CONFIG_XILINX_AMS=y
+CONFIG_XILINX_FCLK=y
+
 CONFIG_FPGA=y
 CONFIG_FPGA_MGR_ZYNQMP_FPGA=y
 CONFIG_NVMEM_ZYNQMP=y
 CONFIG_FPGA_REGION=y
 CONFIG_FPGA_BRIDGE=y
+CONFIG_OF_FPGA_REGION=y
 
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
@@ -152,13 +174,67 @@ CONFIG_VIDEO_V4L2_SUBDEV_API=y
 CONFIG_VIDEO_V4L2=y
 CONFIG_V4L_PLATFORM_DRIVERS=y
 CONFIG_VIDEO_XILINX=y
+CONFIG_VIDEO_XILINX_CFA=y
+CONFIG_VIDEO_XILINX_CRESAMPLE=y
+CONFIG_VIDEO_XILINX_HLS=y
+CONFIG_VIDEO_XILINX_REMAPPER=y
+CONFIG_VIDEO_XILINX_RGB2YUV=y
+CONFIG_VIDEO_XILINX_SCALER=y
+CONFIG_VIDEO_XILINX_SWITCH=y
 CONFIG_VIDEO_XILINX_TPG=y
 CONFIG_VIDEO_XILINX_VTC=y
+CONFIG_VIDEO_XILINX_SDIRXSS=y
+CONFIG_VIDEO_XILINX_AXI4S_SWITCH=y
+CONFIG_VIDEO_XILINX_SCD=y
+CONFIG_VIDEO_XILINX_M2M=y
+CONFIG_VIDEO_XILINX_MULTISCALER=y
 
 CONFIG_DRM=y
 CONFIG_DRM_KMS_HELPER=y
+CONFIG_DRM_KMS_FB_HELPER=y
+CONFIG_DRM_FBDEV_EMULATION=y
+CONFIG_DRM_GEM_CMA_HELPER=y
+CONFIG_DRM_KMS_CMA_HELPER=y
 CONFIG_DRM_BRIDGE=y
 CONFIG_DRM_XILINX=y
 CONFIG_HDMI=y
 
+CONFIG_DRM_XLNX=y
+CONFIG_DRM_XLNX_BRIDGE=y
+CONFIG_DRM_XLNX_BRIDGE_DEBUG_FS=y
+CONFIG_DRM_ZYNQMP_DPSUB=y
+CONFIG_DRM_XLNX_DSI=y
+CONFIG_DRM_XLNX_MIXER=y
+CONFIG_DRM_XLNX_PL_DISP=y
+CONFIG_DRM_XLNX_SDI=y
+CONFIG_DRM_XLNX_BRIDGE_CSC=y
+CONFIG_DRM_XLNX_BRIDGE_SCALER=y
+CONFIG_XILINX_FRMBUF=y
+CONFIG_XILINX_DPDMA=y
+CONFIG_DRM_XILINX_SDI=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC_XILINX_DP=y
+CONFIG_SND_SOC_XILINX_AUDIO_FORMATTER=y
+CONFIG_SND_SOC_XILINX_SDI=y
+CONFIG_SND_SOC_XILINX_I2S=y
+CONFIG_SND_SOC_XILINX_PL_SND_CARD=y
+CONFIG_SND_PCM=y
+CONFIG_SND_DMAENGINE_PCM=y
+CONFIG_SND_DRIVERS=y
+CONFIG_SND_SOC=y
+CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y
+CONFIG_SND_PROC_FS=y
+CONFIG_SND_USB_AUDIO=y
+
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_GPIO_POLLED=y
+
+CONFIG_ARM_CCI_PMU=y
+
 CONFIG_FW_LOADER=y
+
+CONFIG_RESET_CONTROLLER=y
+
+CONFIG_PMBUS=y
+CONFIG_SENSORS_MAX20751=y
diff --git a/bsp/xilinx-zynqmp/xilinx-zynqmp.scc 
b/bsp/xilinx-zynqmp/xilinx-zynqmp.scc
index ef59543f..46ba54d1 100644
--- a/bsp/xilinx-zynqmp/xilinx-zynqmp.scc
+++ b/bsp/xilinx-zynqmp/xilinx-zynqmp.scc
@@ -3,6 +3,7 @@ include cfg/fs/flash_fs.cfg
 include cfg/usb-mass-storage.scc
 include features/hugetlb/hugetlb.scc
 include features/power/arm.scc
+include features/usb/usb-gadgets.scc
 
 # enable the ability to run 32 bit apps
 include arch/arm/32bit-compat.scc
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [kernel-cache master][PATCH 0/1] xilinx-zynqmp: update xilinx-zynqmp to support SDK xlnx_rebase_v4.19

2019-07-22 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce,

Would you please help to merge this patch to yocto-kernel-cache master?

--LOG
Booting Linux on physical CPU 0x00 [0x410fd034]
Linux version 5.2.0-yoctodev-standard (wrsadmin@pek-qwang2-d1) (gcc version 
7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb9
Machine model: ZynqMP ZCU102 Rev1.0
earlycon: cdns0 at MMIO 0xff00 (options '')
printk: bootconsole [cdns0] enabled
efi: Getting EFI parameters from FDT:
efi: UEFI not found.
crashkernel reserved: 0x5fe0 - 0x7fe0 (512 MB)
cma: Reserved 256 MiB at 0x4fc0
psci: probing for conduit method from DT.
psci: PSCIv1.1 detected in firmware.
psci: Using standard PSCI v0.2 function IDs
psci: MIGRATE_INFO_TYPE not supported.
psci: SMC Calling Convention v1.1
percpu: Embedded 30 pages/cpu s85208 r8192 d29480 u122880
Detected VIPT I-cache on CPU0
CPU features: detected: ARM erratum 845719
Speculative Store Bypass Disable mitigation not required
Built 1 zonelists, mobility grouping on.  Total pages: 1031940
Kernel command line: console=ttyPS0,115200n8 earlycon=cdns,0xFF00 
clk_ignore_unused root=/dev/nfs rw rootwait 
nfsroot=128.224.162.137:/home/wrsadmM
Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes)
Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)
software IO TLB: mapped [mem 0x4bc0-0x4fc0] (64MB)
Memory: 3240236K/4193280K available (12348K kernel code, 1292K rwdata, 3260K 
rodata, 2112K init, 774K bss, 690900K reserved, 262144K cma-reserved)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
ftrace: allocating 40981 entries in 161 pages
rcu: Preemptible hierarchical RCU implementation.
rcu:RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
Tasks RCU enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
GIC: Adjusting CPU interface base to 0xf902f000
GIC: Using split EOI/Deactivate mode
random: get_random_bytes called from start_kernel+0x32c/0x4dc with crng_init=0
arch_timer: cp15 timer(s) running at 99.99MHz (phys).
clocksource: arch_sys_counter: mask: 0xff max_cycles: 0x170f8de2d3, 
max_idle_ns: 440795206112 ns
sched_clock: 56 bits at 99MHz, resolution 10ns, wraps every 4398046511101ns
Console: colour dummy device 80x25
Calibrating delay loop (skipped), value calculated using timer frequency.. 
199.98 BogoMIPS (lpj=399960)
pid_max: default: 32768 minimum: 301
LSM: Security Framework initializing
Mount-cache hash table entries: 8192 (order: 4, 65536 bytes)
Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes)
ASID allocator initialised with 32768 entries
rcu: Hierarchical SRCU implementation.
EFI services will not be available.
smp: Bringing up secondary CPUs ...
Detected VIPT I-cache on CPU1
CPU1: Booted secondary processor 0x01 [0x410fd034]
Detected VIPT I-cache on CPU2
CPU2: Booted secondary processor 0x02 [0x410fd034]
Detected VIPT I-cache on CPU3
CPU3: Booted secondary processor 0x03 [0x410fd034]
smp: Brought up 1 node, 4 CPUs
SMP: Total of 4 processors activated.
CPU features: detected: 32-bit EL0 Support
CPU features: detected: CRC32 instructions
CPU: All CPU(s) started at EL2
alternatives: patching kernel code
devtmpfs: initialized
clocksource: jiffies: mask: 0x max_cycles: 0x, max_idle_ns: 
764504178510 ns
futex hash table entries: 1024 (order: 4, 65536 bytes)
xor: measuring software checksum speed
   8regs :  2292.000 MB/sec
   32regs:  2811.000 MB/sec
   arm64_neon:  2130.000 MB/sec
xor: using function: 32regs (2811.000 MB/sec)
pinctrl core: initialized pinctrl subsystem
DMI not present or invalid.
NET: Registered protocol family 16
cpuidle: using governor ladder
hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
DMA: preallocated 256 KiB pool for atomic allocations
HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages
HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
raid6: neonx8   gen()  1649 MB/s
raid6: neonx8   xor()  1511 MB/s
raid6: neonx4   gen()  1500 MB/s
raid6: neonx4   xor()  1434 MB/s
raid6: neonx2   gen()  1159 MB/s
raid6: neonx2   xor()  1204 MB/s
raid6: neonx1   gen()   728 MB/s
raid6: neonx1   xor()   857 MB/s
raid6: int64x8  gen()   985 MB/s
raid6: int64x8  xor()   753 MB/s
raid6: int64x4  gen()  1043 MB/s
raid6: int64x4  xor()   770 MB/s
raid6: int64x2  gen()   684 MB/s
raid6: int64x2  xor()   609 MB/s
raid6: int64x1  gen()   450 MB/s
raid6: int64x1  xor()   446 MB/s
raid6: using algorithm neonx8 gen() 1649 MB/s
raid6:  xor() 1511 MB/s, rmw enabled
raid6: using neon recovery algorithm
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver 

[linux-yocto] [linux-yocto-dev standard/xlnx-soc][PATCH 1/2] driver: pcie: reset pcie device with MIO31 on xilinx-zcu102 platform

2019-07-21 Thread quanyang.wang
From: Limeng 

On xilinx-zcu102 platform, when run kdump feature, an active pcie
device need to be reset with MIO31 so that the crash kernel is able
to boot up successfully.

Signed-off-by: Meng Li 
[Quanyang: When power on zcu102 board, pcie bus also occur that PCI link
is down, and this patch can fix it. Also, we need add a 100ms delay
for some NIC (Intel X520 etc), or else PCI config read will fail due to
unstable device status.]
Signed-off-by: Quanyang Wang 
---
 .../boot/dts/xilinx/zynqmp-zcu102-revA.dts|  1 +
 drivers/pci/controller/pcie-xilinx-nwl.c  | 35 +++
 2 files changed, 36 insertions(+)

diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts 
b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts
index 36863f65e94e..2741040fe26a 100644
--- a/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts
@@ -772,6 +772,7 @@
 
  {
status = "okay";
+   reset-gpio = < 31 GPIO_ACTIVE_HIGH>;
 };
 
  {
diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c 
b/drivers/pci/controller/pcie-xilinx-nwl.c
index a1fd436dba8f..908166dc4f3e 100644
--- a/drivers/pci/controller/pcie-xilinx-nwl.c
+++ b/drivers/pci/controller/pcie-xilinx-nwl.c
@@ -21,6 +21,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "../pci.h"
 
@@ -830,6 +832,31 @@ static const struct of_device_id nwl_pcie_of_match[] = {
{}
 };
 
+static int nwl_pcie_reset_ep_device(struct platform_device *pdev)
+{
+   struct device_node *node = pdev->dev.of_node;
+   int gpio;
+   int err;
+
+   gpio = of_get_named_gpio(node, "reset-gpio", 0);
+   if (!gpio_is_valid(gpio)) {
+   dev_err(>dev, "failed to parse reset gpio\n");
+   return gpio;
+   }
+
+   err = devm_gpio_request_one(>dev, gpio, GPIOF_OUT_INIT_HIGH,
+   "pcie reset gpio");
+   if (err)
+   return err;
+
+   udelay(2);
+   gpio_set_value(gpio, 0);
+   udelay(10);
+   gpio_set_value(gpio, 1);
+
+   return err;
+}
+
 static int nwl_pcie_probe(struct platform_device *pdev)
 {
struct device *dev = >dev;
@@ -841,6 +868,14 @@ static int nwl_pcie_probe(struct platform_device *pdev)
resource_size_t iobase = 0;
LIST_HEAD(res);
 
+   err = nwl_pcie_reset_ep_device(pdev);
+   if (err) {
+   dev_err(dev, "fail to reset pcie device\n");
+   return err;
+   }
+   /* wait for ep device reset finished */
+   mdelay(100);
+
bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie));
if (!bridge)
return -ENODEV;
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [linux-yocto-dev standard/xlnx-soc][PATCH 0/2] xilinx-zynqmp: fix 2 issues in zcu102 Rev1.0 board

2019-07-21 Thread quanyang.wang
From: Quanyang Wang 

Hi Bruce,

Would you please help merge these 2 patches to linux-yocto-dev 
standard/xlnx-soc branch?


Limeng (1):
  driver: pcie: reset pcie device with MIO31 on xilinx-zcu102 platform

Quanyang Wang (1):
  drm: xlnx: zynqmp_dp: initialize delayed work before enable interrupts

 .../boot/dts/xilinx/zynqmp-zcu102-revA.dts|  1 +
 drivers/gpu/drm/xlnx/zynqmp_dp.c  |  3 +-
 drivers/pci/controller/pcie-xilinx-nwl.c  | 35 +++
 3 files changed, 38 insertions(+), 1 deletion(-)

-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [linux-yocto-dev standard/xlnx-soc][PATCH 2/2] drm: xlnx: zynqmp_dp: initialize delayed work before enable interrupts

2019-07-21 Thread quanyang.wang
From: Quanyang Wang 

The delay work should be initialize before enables interrupts, because the irq
handler will call this delay work, or else there will be calltrace as below:

WARNING: CPU: 0 PID: 120 at kernel/workqueue.c:1627 
__queue_delayed_work+0xd8/0x100
Modules linked in:
CPU: 0 PID: 120 Comm: irq/44-fd4a Not tainted 5.2.0-rc7-yoctodev-standard 
#75
Hardware name: ZynqMP ZCU102 Rev1.0 (DT)
pstate: 0085 (nzcv daIf -PAN -UAO)
pc : __queue_delayed_work+0xd8/0x100
lr : queue_delayed_work_on+0xbc/0xc8
sp : ff801179bd00
x29: ff801179bd00 x28: 
x27: ff801011 x26: ff8011108000
x25: ffc87a04fed4 x24: 
x23: ffc87a826600 x22: 
x21: 0100 x20: ffc87a826600
x19: ffc879373a50 x18: 
x17:  x16: 0001
x15: ff80111085c8 x14: ffc878841085
x13: ffc878841084 x12: 0028
x11: 0101010101010101 x10: 0930
x9 : ff801179bd20 x8 : ffc878858990
x7 : 0005a2ffd48c x6 : 1c19
x5 : 0005a2ffd48c x4 : 00486e667000
x3 :  x2 : ff80100cdb08
x1 :  x0 : ffc879373a70
Call trace:
 __queue_delayed_work+0xd8/0x100
 queue_delayed_work_on+0xbc/0xc8
 zynqmp_dp_irq_handler+0x110/0x140
 irq_thread_fn+0x30/0x80
 irq_thread+0x12c/0x1c8
 kthread+0x130/0x138
 ret_from_fork+0x10/0x1c
---[ end trace d28f065f559a242d ]---

Signed-off-by: Quanyang Wang 
---
 drivers/gpu/drm/xlnx/zynqmp_dp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c
index efad58bee0a4..c3c86dacac97 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_dp.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c
@@ -1711,13 +1711,14 @@ int zynqmp_dp_bind(struct device *dev, struct device 
*master, void *data)
   ret ? ret : 8);
zynqmp_dp_update_bpp(dp);
 
+   INIT_DELAYED_WORK(>hpd_work, zynqmp_dp_hpd_work_func);
+
/* This enables interrupts, so should be called after DRM init */
ret = zynqmp_dp_init_aux(dp);
if (ret) {
dev_err(dp->dev, "failed to initialize DP aux");
goto error_prop;
}
-   INIT_DELAYED_WORK(>hpd_work, zynqmp_dp_hpd_work_func);
 
return 0;
 
-- 
2.17.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [4.12] [PATCH] clocksource/drivers/arm_arch_timer: Fix mem frame loop initialization

2018-05-30 Thread quanyang.wang
From: Matthias Kaehlcke 

commit d197f7988721221fac64f899efd7657c15281810 upstream

The loop to find the best memory frame in arch_timer_mem_acpi_init()
initializes the loop counter with itself ('i = i'), which is suspicious
in the first place and pointed out by clang. The loop condition is
'i < timer_count' and a prior for loop exits when 'i' reaches
'timer_count', therefore the second loop is never executed.

Initialize the loop counter with 0 to iterate over all timers, which
supposedly was the intention before the typo monster attacked.

Fixes: c2743a36765d3 ("clocksource: arm_arch_timer: add GTDT support for 
memory-mapped timer")
Signed-off-by: Matthias Kaehlcke 
Reported-by: Ard Biesheuvel 
Acked-by: Mark Rutland 
Signed-off-by: Daniel Lezcano 
---
 drivers/clocksource/arm_arch_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/arm_arch_timer.c 
b/drivers/clocksource/arm_arch_timer.c
index e5c4a03..477e431 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -1430,7 +1430,7 @@ static int __init arch_timer_mem_acpi_init(int 
platform_timer_count)
 * While unlikely, it's theoretically possible that none of the frames
 * in a timer expose the combination of feature we want.
 */
-   for (i = i; i < timer_count; i++) {
+   for (i = 0; i < timer_count; i++) {
timer = [i];
 
frame = arch_timer_mem_find_best_frame(timer);
-- 
1.9.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [yocto-4.12][PATCH 3/3] x86/intel_rdt: Turn off most RDT features on Skylake

2018-01-08 Thread quanyang.wang
From: Tony Luck 

commit d56593eb5eda8f593db92927059697bbf89bc4b3 upstream

Errata list is included in this document:
https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/6th-gen-x-series-spec-update.pdf
with more details in:
https://www.intel.com/content/www/us/en/processors/xeon/scalable/xeon-scalable-spec-update.html

But the tl;dr summary (using tags from first of the documents) is:
SKZ4  MBM does not accurately track write bandwidth
SKZ17 CMT counters may not count accurately
SKZ18 CAT may not restrict cacheline allocation under certain conditions
SKZ19 MBM counters may undercount

Disable all these features on Skylake models. Users who understand the
errata may re-enable using boot command line options.

Signed-off-by: Tony Luck 
Cc: Fenghua" 
Cc: Ravi V" 
Cc: "Peter Zijlstra" 
Cc: "Stephane Eranian" 
Cc: "Andi Kleen" 
Cc: "David Carrillo-Cisneros" 
Cc: Vikas Shivappa 
Link: 
http://lkml.kernel.org/r/3aea0a3bae219062c812668bd9b7b8f1a25003ba.1503512900.git.tony.l...@intel.com
Signed-off-by: Thomas Gleixner 
---
 arch/x86/kernel/cpu/intel_rdt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kernel/cpu/intel_rdt.c b/arch/x86/kernel/cpu/intel_rdt.c
index f15c61d..88dcf84 100644
--- a/arch/x86/kernel/cpu/intel_rdt.c
+++ b/arch/x86/kernel/cpu/intel_rdt.c
@@ -770,6 +770,9 @@ static __init void rdt_quirks(void)
if (!rdt_options[RDT_FLAG_L3_CAT].force_off)
cache_alloc_hsw_probe();
break;
+   case INTEL_FAM6_SKYLAKE_X:
+   if (boot_cpu_data.x86_mask <= 4)
+   set_rdt_options("!cmt,!mbmtotal,!mbmlocal,!l3cat");
}
 }
 
-- 
1.9.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [yocto-4.12][PATCH 2/3] x86/intel_rdt: Add command line options for resource director technology

2018-01-08 Thread quanyang.wang
From: Tony Luck 

commit 1d9807fc64c131a83a96917f2b2da1c9b00cf127 upstream

Command line options allow us to ignore features that we don't want.
Also we can re-enable options that have been disabled on a platform
(so long as the underlying h/w actually supports the option).

[ tglx: Marked the option array __initdata and the helper function __init ]

Signed-off-by: Tony Luck 
Signed-off-by: Thomas Gleixner 
Cc: Fenghua" 
Cc: Ravi V" 
Cc: "Peter Zijlstra" 
Cc: "Stephane Eranian" 
Cc: "Andi Kleen" 
Cc: "David Carrillo-Cisneros" 
Cc: Vikas Shivappa 
Link: 
http://lkml.kernel.org/r/0c37b0d4dbc30977a3c1cee08b66420f83662694.1503512900.git.tony.l...@intel.com
---
 Documentation/admin-guide/kernel-parameters.rst |  1 +
 Documentation/admin-guide/kernel-parameters.txt |  6 ++
 arch/x86/kernel/cpu/intel_rdt.c | 96 ++---
 3 files changed, 95 insertions(+), 8 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.rst 
b/Documentation/admin-guide/kernel-parameters.rst
index d76ab39..b2598cc 100644
--- a/Documentation/admin-guide/kernel-parameters.rst
+++ b/Documentation/admin-guide/kernel-parameters.rst
@@ -138,6 +138,7 @@ parameter is applicable::
PPT Parallel port support is enabled.
PS2 Appropriate PS/2 support is enabled.
RAM RAM disk support is enabled.
+   RDT Intel Resource Director Technology.
S390S390 architecture is enabled.
SCSIAppropriate SCSI support is enabled.
A lot of drivers have their options described inside
diff --git a/Documentation/admin-guide/kernel-parameters.txt 
b/Documentation/admin-guide/kernel-parameters.txt
index 7737ab5..19ccfcb 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3538,6 +3538,12 @@
Run specified binary instead of /init from the ramdisk,
used for early userspace startup. See initrd.
 
+   rdt=[HW,X86,RDT]
+   Turn on/off individual RDT features. List is:
+   cmt, mbmtotal, mbmlocal, l3cat, l3cdp, l2cat, mba.
+   E.g. to turn on cmt and turn off mba use:
+   rdt=cmt,!mba
+
reboot= [KNL]
Format (x86 or x86_64):
[w[arm] | c[old] | h[ard] | s[oft] | g[pio]] \
diff --git a/arch/x86/kernel/cpu/intel_rdt.c b/arch/x86/kernel/cpu/intel_rdt.c
index 5af2f8f..f15c61d 100644
--- a/arch/x86/kernel/cpu/intel_rdt.c
+++ b/arch/x86/kernel/cpu/intel_rdt.c
@@ -638,6 +638,85 @@ static __init void rdt_init_padding(void)
}
 }
 
+enum {
+   RDT_FLAG_CMT,
+   RDT_FLAG_MBM_TOTAL,
+   RDT_FLAG_MBM_LOCAL,
+   RDT_FLAG_L3_CAT,
+   RDT_FLAG_L3_CDP,
+   RDT_FLAG_L2_CAT,
+   RDT_FLAG_MBA,
+};
+
+#define RDT_OPT(idx, n, f) \
+[idx] = {  \
+   .name = n,  \
+   .flag = f   \
+}
+
+struct rdt_options {
+   char*name;
+   int flag;
+   boolforce_off, force_on;
+};
+
+static struct rdt_options rdt_options[]  __initdata = {
+   RDT_OPT(RDT_FLAG_CMT,   "cmt",  X86_FEATURE_CQM_OCCUP_LLC),
+   RDT_OPT(RDT_FLAG_MBM_TOTAL, "mbmtotal", X86_FEATURE_CQM_MBM_TOTAL),
+   RDT_OPT(RDT_FLAG_MBM_LOCAL, "mbmlocal", X86_FEATURE_CQM_MBM_LOCAL),
+   RDT_OPT(RDT_FLAG_L3_CAT,"l3cat",X86_FEATURE_CAT_L3),
+   RDT_OPT(RDT_FLAG_L3_CDP,"l3cdp",X86_FEATURE_CDP_L3),
+   RDT_OPT(RDT_FLAG_L2_CAT,"l2cat",X86_FEATURE_CAT_L2),
+   RDT_OPT(RDT_FLAG_MBA,   "mba",  X86_FEATURE_MBA),
+};
+#define NUM_RDT_OPTIONS ARRAY_SIZE(rdt_options)
+
+static int __init set_rdt_options(char *str)
+{
+   struct rdt_options *o;
+   bool force_off;
+   char *tok;
+
+   if (*str == '=')
+   str++;
+   while ((tok = strsep(, ",")) != NULL) {
+   force_off = *tok == '!';
+   if (force_off)
+   tok++;
+   for (o = rdt_options; o < _options[NUM_RDT_OPTIONS]; o++) {
+   if (strcmp(tok, o->name) == 0) {
+   if (force_off)
+   o->force_off = true;
+   else
+   o->force_on = true;
+   break;
+   }
+   }
+   }
+   return 1;
+}
+__setup("rdt", set_rdt_options);
+
+static bool __init rdt_cpu_has(int flag)
+{
+   bool ret = boot_cpu_has(flag);
+   struct rdt_options *o;
+
+   if (!ret)
+   return ret;
+
+   for (o = 

[linux-yocto] [yocto-4.12] [PATCH 1/6] perf/x86/intel/uncore: Fix Skylake UPI PMU event masks

2017-12-18 Thread quanyang.wang
From: Stephane Eranian 

Commit b3625980a65db6b6b6bbd5790a77ab95ce6397c5 upstream

This patch fixes the event_mask and event_ext_mask for the Intel Skylake
Server UPI PMU. Bit 21 is not used as a filter. The extended umask is
from bit 32 to bit 55. Correct both umasks.

Signed-off-by: Stephane Eranian 
Signed-off-by: Kan Liang 
Acked-by: Peter Zijlstra 
Cc: Alexander Shishkin 
Cc: Arnaldo Carvalho de Melo 
Cc: Jiri Olsa 
Cc: Linus Torvalds 
Cc: Thomas Gleixner 
Cc: Vince Weaver 
Link: 
http://lkml.kernel.org/r/1499967350-10385-2-git-send-email-kan.li...@intel.com
Signed-off-by: Ingo Molnar 
---
 arch/x86/events/intel/uncore_snbep.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/events/intel/uncore_snbep.c 
b/arch/x86/events/intel/uncore_snbep.c
index dae2fed..19a00a7 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -316,7 +316,7 @@
 #define SKX_UPI_PCI_PMON_CTL0  0x350
 #define SKX_UPI_PCI_PMON_CTR0  0x318
 #define SKX_UPI_PCI_PMON_BOX_CTL   0x378
-#define SKX_PMON_CTL_UMASK_EXT 0xff
+#define SKX_UPI_CTL_UMASK_EXT  0xffefff
 
 /* SKX M2M */
 #define SKX_M2M_PCI_PMON_CTL0  0x228
@@ -328,7 +328,7 @@
 DEFINE_UNCORE_FORMAT_ATTR(event_ext, event, "config:0-7,21");
 DEFINE_UNCORE_FORMAT_ATTR(use_occ_ctr, use_occ_ctr, "config:7");
 DEFINE_UNCORE_FORMAT_ATTR(umask, umask, "config:8-15");
-DEFINE_UNCORE_FORMAT_ATTR(umask_ext, umask, "config:8-15,32-39");
+DEFINE_UNCORE_FORMAT_ATTR(umask_ext, umask, "config:8-15,32-43,45-55");
 DEFINE_UNCORE_FORMAT_ATTR(qor, qor, "config:16");
 DEFINE_UNCORE_FORMAT_ATTR(edge, edge, "config:18");
 DEFINE_UNCORE_FORMAT_ATTR(tid_en, tid_en, "config:19");
@@ -3603,8 +3603,8 @@ static void skx_upi_uncore_pci_init_box(struct 
intel_uncore_box *box)
.perf_ctr_bits  = 48,
.perf_ctr   = SKX_UPI_PCI_PMON_CTR0,
.event_ctl  = SKX_UPI_PCI_PMON_CTL0,
-   .event_mask = SNBEP_QPI_PCI_PMON_RAW_EVENT_MASK,
-   .event_mask_ext = SKX_PMON_CTL_UMASK_EXT,
+   .event_mask = SNBEP_PMON_RAW_EVENT_MASK,
+   .event_mask_ext = SKX_UPI_CTL_UMASK_EXT,
.box_ctl= SKX_UPI_PCI_PMON_BOX_CTL,
.ops= _upi_uncore_pci_ops,
.format_group   = _upi_uncore_format_group,
-- 
1.9.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [yocto-4.12] [PATCH 5/6] perf/x86/intel/uncore: Fix SKX CHA event extra regs

2017-12-18 Thread quanyang.wang
From: Stephane Eranian 

Commit 8aa7b7b4b4a601978672dce6604b9f5630b2eeb8 upstream

This patch adds two missing event extra regs for Skylake Server CHA PMU:

 - TOR_INSERTS
 - TOR_OCCUPANCY

Were missing support for all the filters, including opcode matchers.

Signed-off-by: Stephane Eranian 
Signed-off-by: Kan Liang 
Acked-by: Peter Zijlstra 
Cc: Alexander Shishkin 
Cc: Arnaldo Carvalho de Melo 
Cc: Jiri Olsa 
Cc: Linus Torvalds 
Cc: Thomas Gleixner 
Cc: Vince Weaver 
Link: 
http://lkml.kernel.org/r/1499967350-10385-6-git-send-email-kan.li...@intel.com
Signed-off-by: Ingo Molnar 
---
 arch/x86/events/intel/uncore_snbep.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/arch/x86/events/intel/uncore_snbep.c 
b/arch/x86/events/intel/uncore_snbep.c
index 2401d06..f9f825b 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -3332,6 +3332,8 @@ int bdx_uncore_pci_init(void)
SNBEP_CBO_EVENT_EXTRA_REG(0x1134, 0x, 0x4),
SNBEP_CBO_EVENT_EXTRA_REG(0x3134, 0x, 0x4),
SNBEP_CBO_EVENT_EXTRA_REG(0x9134, 0x, 0x4),
+   SNBEP_CBO_EVENT_EXTRA_REG(0x35, 0xff, 0x8),
+   SNBEP_CBO_EVENT_EXTRA_REG(0x36, 0xff, 0x8),
 };
 
 static u64 skx_cha_filter_mask(int fields)
@@ -3344,6 +3346,17 @@ static u64 skx_cha_filter_mask(int fields)
mask |= SKX_CHA_MSR_PMON_BOX_FILTER_LINK;
if (fields & 0x4)
mask |= SKX_CHA_MSR_PMON_BOX_FILTER_STATE;
+   if (fields & 0x8) {
+   mask |= SKX_CHA_MSR_PMON_BOX_FILTER_REM;
+   mask |= SKX_CHA_MSR_PMON_BOX_FILTER_LOC;
+   mask |= SKX_CHA_MSR_PMON_BOX_FILTER_ALL_OPC;
+   mask |= SKX_CHA_MSR_PMON_BOX_FILTER_NM;
+   mask |= SKX_CHA_MSR_PMON_BOX_FILTER_NOT_NM;
+   mask |= SKX_CHA_MSR_PMON_BOX_FILTER_OPC0;
+   mask |= SKX_CHA_MSR_PMON_BOX_FILTER_OPC1;
+   mask |= SKX_CHA_MSR_PMON_BOX_FILTER_NC;
+   mask |= SKX_CHA_MSR_PMON_BOX_FILTER_ISOC;
+   }
return mask;
 }
 
-- 
1.9.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [yocto-4.12] [PATCH 6/6] perf/x86/intel/uncore: Fix missing marker for skx_uncore_cha_extra_regs

2017-12-18 Thread quanyang.wang
From: Stephane Eranian 

Commit ba883b4abc9cd837441b01eb9cf8d9196181294d upstream

This skx_uncore_cha_extra_regs array was missing an end-marker.

Signed-off-by: Stephane Eranian 
Signed-off-by: Kan Liang 
Acked-by: Peter Zijlstra 
Cc: Alexander Shishkin 
Cc: Arnaldo Carvalho de Melo 
Cc: Jiri Olsa 
Cc: Linus Torvalds 
Cc: Thomas Gleixner 
Cc: Vince Weaver 
Link: 
http://lkml.kernel.org/r/1499967350-10385-7-git-send-email-kan.li...@intel.com
Signed-off-by: Ingo Molnar 
---
 arch/x86/events/intel/uncore_snbep.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/events/intel/uncore_snbep.c 
b/arch/x86/events/intel/uncore_snbep.c
index f9f825b..4f91276 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -3334,6 +3334,7 @@ int bdx_uncore_pci_init(void)
SNBEP_CBO_EVENT_EXTRA_REG(0x9134, 0x, 0x4),
SNBEP_CBO_EVENT_EXTRA_REG(0x35, 0xff, 0x8),
SNBEP_CBO_EVENT_EXTRA_REG(0x36, 0xff, 0x8),
+   EVENT_EXTRA_END
 };
 
 static u64 skx_cha_filter_mask(int fields)
-- 
1.9.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [yocto-4.12] [PATCH 3/6] perf/x86/intel/uncore: Fix Skylake server CHA LLC_LOOKUP event umask

2017-12-18 Thread quanyang.wang
From: Kan Liang 

Commit c3f02682a101b83424128915b14e60c156c03f02 upstream

Correct the umask for LLC_LOOKUP.LOCAL and LLC_LOOKUP.REMOTE events

Signed-off-by: Kan Liang 
Acked-by: Peter Zijlstra 
Cc: Alexander Shishkin 
Cc: Arnaldo Carvalho de Melo 
Cc: Jiri Olsa 
Cc: Linus Torvalds 
Cc: Stephane Eranian 
Cc: Thomas Gleixner 
Cc: Vince Weaver 
Link: 
http://lkml.kernel.org/r/1499967350-10385-4-git-send-email-kan.li...@intel.com
Signed-off-by: Ingo Molnar 
---
 arch/x86/events/intel/uncore_snbep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/events/intel/uncore_snbep.c 
b/arch/x86/events/intel/uncore_snbep.c
index fbf8f6e..a30bf97 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -,8 +,8 @@ int bdx_uncore_pci_init(void)
SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0x, 0x4),
SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0x, 0x4),
SNBEP_CBO_EVENT_EXTRA_REG(0x1134, 0x, 0x4),
-   SNBEP_CBO_EVENT_EXTRA_REG(0x2134, 0x, 0x4),
-   SNBEP_CBO_EVENT_EXTRA_REG(0x8134, 0x, 0x4),
+   SNBEP_CBO_EVENT_EXTRA_REG(0x3134, 0x, 0x4),
+   SNBEP_CBO_EVENT_EXTRA_REG(0x9134, 0x, 0x4),
 };
 
 static u64 skx_cha_filter_mask(int fields)
-- 
1.9.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [yocto-4.12] [PATCH 2/6] perf/x86/intel/uncore: Fix Skylake server PCU PMU event format

2017-12-18 Thread quanyang.wang
From: Kan Liang 

Commit bab4e569e80c07ba6fe5e4f2d815adeef26cee94 upstream

PCU event format for SKX are different from snbep. Introduce a new
format group for SKX PCU.

Signed-off-by: Kan Liang 
Acked-by: Peter Zijlstra 
Cc: Alexander Shishkin 
Cc: Arnaldo Carvalho de Melo 
Cc: Jiri Olsa 
Cc: Linus Torvalds 
Cc: Stephane Eranian 
Cc: Thomas Gleixner 
Cc: Vince Weaver 
Link: 
http://lkml.kernel.org/r/1499967350-10385-3-git-send-email-kan.li...@intel.com
Signed-off-by: Ingo Molnar 
---
 arch/x86/events/intel/uncore_snbep.c | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/arch/x86/events/intel/uncore_snbep.c 
b/arch/x86/events/intel/uncore_snbep.c
index 19a00a7..fbf8f6e 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -3492,6 +3492,26 @@ static void skx_iio_enable_event(struct intel_uncore_box 
*box,
.format_group   = _uncore_format_group,
 };
 
+static struct attribute *skx_uncore_pcu_formats_attr[] = {
+   _attr_event.attr,
+   _attr_umask.attr,
+   _attr_edge.attr,
+   _attr_inv.attr,
+   _attr_thresh8.attr,
+   _attr_occ_invert.attr,
+   _attr_occ_edge_det.attr,
+   _attr_filter_band0.attr,
+   _attr_filter_band1.attr,
+   _attr_filter_band2.attr,
+   _attr_filter_band3.attr,
+   NULL,
+};
+
+static struct attribute_group skx_uncore_pcu_format_group = {
+   .name = "format",
+   .attrs = skx_uncore_pcu_formats_attr,
+};
+
 static struct intel_uncore_ops skx_uncore_pcu_ops = {
IVBEP_UNCORE_MSR_OPS_COMMON_INIT(),
.hw_config  = hswep_pcu_hw_config,
@@ -3510,7 +3530,7 @@ static void skx_iio_enable_event(struct intel_uncore_box 
*box,
.box_ctl= HSWEP_PCU_MSR_PMON_BOX_CTL,
.num_shared_regs= 1,
.ops= _uncore_pcu_ops,
-   .format_group   = _uncore_pcu_format_group,
+   .format_group   = _uncore_pcu_format_group,
 };
 
 static struct intel_uncore_type *skx_msr_uncores[] = {
-- 
1.9.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [yocto-4.12] [PATCH 1/4] mtd: spi-nor: intel-spi: Add support for Intel Denverton SPI serial flash controller

2017-12-17 Thread quanyang.wang
From: Mika Westerberg 

Commit fe602838a66d34f3d1de71feab92b403e244db8c upstream

Intel Denverton exposes the SPI serial flash controller as a PCI device
instead of being part of the LPC chip as previous generations did.

Signed-off-by: Mika Westerberg 
Signed-off-by: Cyrille Pitchen 
---
 drivers/mtd/spi-nor/Kconfig | 16 
 drivers/mtd/spi-nor/Makefile|  1 +
 drivers/mtd/spi-nor/intel-spi-pci.c | 82 +
 3 files changed, 99 insertions(+)
 create mode 100644 drivers/mtd/spi-nor/intel-spi-pci.c

diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
index bfdfb1e..5f6892d 100644
--- a/drivers/mtd/spi-nor/Kconfig
+++ b/drivers/mtd/spi-nor/Kconfig
@@ -89,6 +89,22 @@ config SPI_NXP_SPIFI
 config SPI_INTEL_SPI
tristate
 
+config SPI_INTEL_SPI_PCI
+   tristate "Intel PCH/PCU SPI flash PCI driver" if EXPERT
+   depends on X86 && PCI
+   select SPI_INTEL_SPI
+   help
+ This enables PCI support for the Intel PCH/PCU SPI controller in
+ master mode. This controller is present in modern Intel hardware
+ and is used to hold BIOS and other persistent settings. Using
+ this driver it is possible to upgrade BIOS directly from Linux.
+
+ Say N here unless you know what you are doing. Overwriting the
+ SPI flash may render the system unbootable.
+
+ To compile this driver as a module, choose M here: the module
+ will be called intel-spi-pci.
+
 config SPI_INTEL_SPI_PLATFORM
tristate "Intel PCH/PCU SPI flash platform driver" if EXPERT
depends on X86
diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile
index 285aab8..c5f171d 100644
--- a/drivers/mtd/spi-nor/Makefile
+++ b/drivers/mtd/spi-nor/Makefile
@@ -7,5 +7,6 @@ obj-$(CONFIG_SPI_HISI_SFC)  += hisi-sfc.o
 obj-$(CONFIG_MTD_MT81xx_NOR)+= mtk-quadspi.o
 obj-$(CONFIG_SPI_NXP_SPIFI)+= nxp-spifi.o
 obj-$(CONFIG_SPI_INTEL_SPI)+= intel-spi.o
+obj-$(CONFIG_SPI_INTEL_SPI_PCI)+= intel-spi-pci.o
 obj-$(CONFIG_SPI_INTEL_SPI_PLATFORM)   += intel-spi-platform.o
 obj-$(CONFIG_SPI_STM32_QUADSPI)+= stm32-quadspi.o
\ No newline at end of file
diff --git a/drivers/mtd/spi-nor/intel-spi-pci.c 
b/drivers/mtd/spi-nor/intel-spi-pci.c
new file mode 100644
index 000..e826523
--- /dev/null
+++ b/drivers/mtd/spi-nor/intel-spi-pci.c
@@ -0,0 +1,82 @@
+/*
+ * Intel PCH/PCU SPI flash PCI driver.
+ *
+ * Copyright (C) 2016, Intel Corporation
+ * Author: Mika Westerberg 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include "intel-spi.h"
+
+#define BCR0xdc
+#define BCR_WPDBIT(0)
+
+static const struct intel_spi_boardinfo bxt_info = {
+   .type = INTEL_SPI_BXT,
+};
+
+static int intel_spi_pci_probe(struct pci_dev *pdev,
+  const struct pci_device_id *id)
+{
+   struct intel_spi_boardinfo *info;
+   struct intel_spi *ispi;
+   u32 bcr;
+   int ret;
+
+   ret = pcim_enable_device(pdev);
+   if (ret)
+   return ret;
+
+   info = devm_kmemdup(>dev, (void *)id->driver_data, sizeof(*info),
+   GFP_KERNEL);
+   if (!info)
+   return -ENOMEM;
+
+   /* Try to make the chip read/write */
+   pci_read_config_dword(pdev, BCR, );
+   if (!(bcr & BCR_WPD)) {
+   bcr |= BCR_WPD;
+   pci_write_config_dword(pdev, BCR, bcr);
+   pci_read_config_dword(pdev, BCR, );
+   }
+   info->writeable = !!(bcr & BCR_WPD);
+
+   ispi = intel_spi_probe(>dev, >resource[0], info);
+   if (IS_ERR(ispi))
+   return PTR_ERR(ispi);
+
+   pci_set_drvdata(pdev, ispi);
+   return 0;
+}
+
+static void intel_spi_pci_remove(struct pci_dev *pdev)
+{
+   intel_spi_remove(pci_get_drvdata(pdev));
+}
+
+static const struct pci_device_id intel_spi_pci_ids[] = {
+   { PCI_VDEVICE(INTEL, 0x19e0), (unsigned long)_info },
+   { },
+};
+MODULE_DEVICE_TABLE(pci, intel_spi_pci_ids);
+
+static struct pci_driver intel_spi_pci_driver = {
+   .name = "intel-spi",
+   .id_table = intel_spi_pci_ids,
+   .probe = intel_spi_pci_probe,
+   .remove = intel_spi_pci_remove,
+};
+
+module_pci_driver(intel_spi_pci_driver);
+
+MODULE_DESCRIPTION("Intel PCH/PCU SPI flash PCI driver");
+MODULE_AUTHOR("Mika Westerberg ");
+MODULE_LICENSE("GPL v2");
-- 
1.9.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [yocto-4.12] [PATCH 3/4] mtd: spi-nor: intel-spi: Add support for Intel Cedar Fork SPI serial flash

2017-12-17 Thread quanyang.wang
From: Mika Westerberg 

Commit 824af37ef2d054d1f89bd2b9125755a4acc37332 upstream

Intel Cedar Fork has the same SPI serial flash controller than Intel
Denverton. Add the Intel Cedar Fork PCI ID to the driver list of
supported devices.

Signed-off-by: Mika Westerberg 
Signed-off-by: Cyrille Pitchen 
---
 drivers/mtd/spi-nor/intel-spi-pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi-nor/intel-spi-pci.c 
b/drivers/mtd/spi-nor/intel-spi-pci.c
index 7fa5b81..a5a5c58 100644
--- a/drivers/mtd/spi-nor/intel-spi-pci.c
+++ b/drivers/mtd/spi-nor/intel-spi-pci.c
@@ -63,6 +63,7 @@ static void intel_spi_pci_remove(struct pci_dev *pdev)
 }
 
 static const struct pci_device_id intel_spi_pci_ids[] = {
+   { PCI_VDEVICE(INTEL, 0x18e0), (unsigned long)_info },
{ PCI_VDEVICE(INTEL, 0x19e0), (unsigned long)_info },
{ PCI_VDEVICE(INTEL, 0xa1a4), (unsigned long)_info },
{ },
-- 
1.9.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [yocto-4.12] [PATCH 2/4] mtd: spi-nor: intel-spi: Add support for Intel Lewisburg SPI serial flash

2017-12-17 Thread quanyang.wang
From: Mika Westerberg 

Commit d92b0f18a2039ff736b4296ad3cf3d505512051e upstream

Intel Lewisburg chipset exposes the SPI serial flash controller as a PCI
device in the same way than Intel Denverton. Add Intel Lewisburg SPI
serial flash PCI ID to the driver list of supported devices.

Signed-off-by: Mika Westerberg 
Signed-off-by: Cyrille Pitchen 
---
 drivers/mtd/spi-nor/intel-spi-pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi-nor/intel-spi-pci.c 
b/drivers/mtd/spi-nor/intel-spi-pci.c
index e826523..7fa5b81 100644
--- a/drivers/mtd/spi-nor/intel-spi-pci.c
+++ b/drivers/mtd/spi-nor/intel-spi-pci.c
@@ -64,6 +64,7 @@ static void intel_spi_pci_remove(struct pci_dev *pdev)
 
 static const struct pci_device_id intel_spi_pci_ids[] = {
{ PCI_VDEVICE(INTEL, 0x19e0), (unsigned long)_info },
+   { PCI_VDEVICE(INTEL, 0xa1a4), (unsigned long)_info },
{ },
 };
 MODULE_DEVICE_TABLE(pci, intel_spi_pci_ids);
-- 
1.9.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [yocto-4.12] [PATCH 4/4] mtd: intel-spi: Add Intel Lewisburg PCH SPI super SKU PCI ID

2017-12-17 Thread quanyang.wang
From: Kuppuswamy Sathyanarayanan 

Commit ec0a9f62b393ed0c5bb9185a8efebb0ad00b7d0d upstream

This patch adds Intel Lewisburg PCH SPI serial flash controller super
SKU PCI ID.

Signed-off-by: Kuppuswamy Sathyanarayanan 

Acked-by: Mika Westerberg 
Signed-off-by: Cyrille Pitchen 
---
 drivers/mtd/spi-nor/intel-spi-pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi-nor/intel-spi-pci.c 
b/drivers/mtd/spi-nor/intel-spi-pci.c
index a5a5c58..c0976f2 100644
--- a/drivers/mtd/spi-nor/intel-spi-pci.c
+++ b/drivers/mtd/spi-nor/intel-spi-pci.c
@@ -66,6 +66,7 @@ static void intel_spi_pci_remove(struct pci_dev *pdev)
{ PCI_VDEVICE(INTEL, 0x18e0), (unsigned long)_info },
{ PCI_VDEVICE(INTEL, 0x19e0), (unsigned long)_info },
{ PCI_VDEVICE(INTEL, 0xa1a4), (unsigned long)_info },
+   { PCI_VDEVICE(INTEL, 0xa224), (unsigned long)_info },
{ },
 };
 MODULE_DEVICE_TABLE(pci, intel_spi_pci_ids);
-- 
1.9.1

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto