Skip to contentSkip to conversation

powerpc: Move fsl_errata.h out of arch/powerpc

RFC PATCH New York Sun 3 participants 10 messages Nov 19, 2014 – Nov 24, 2014

Subsystems (3)
lore
Share & tools
lore

York Sun

author
#0 lore raw

RFC PATCH 1/2 powerpc: Move fsl_errata.h out of arch/powerpc

This header file becomes common for both powerpc and arm SoCs.

CC Alison Wang <[email protected]>
CC Nikhil Badola <[email protected]>

---
This patch is needed if USB is enabled for LS1021 SoC.

 arch/powerpc/cpu/mpc85xx/cmd_errata.c              |    2 +-
 arch/powerpc/cpu/mpc85xx/cpu_init.c                |    2 +-
 drivers/usb/host/ehci-fsl.c                        |    2 +-
 {arch/powerpc/include/asm => include}/fsl_errata.h |    5 +++++
 4 files changed, 8 insertions(+), 3 deletions(-)
 rename {arch/powerpc/include/asm => include}/fsl_errata.h (95%)
arch/powerpc/cpu/mpc85xx/cmd_errata.c +1 -1
index 3a04a89..1b36e4f 100644
@@ -7,7 +7,7 @@
 #include <common.h>
 #include <command.h>
 #include <linux/compiler.h>
-#include <asm/fsl_errata.h>
+#include <fsl_errata.h>
 #include <asm/processor.h>
 #include "fsl_corenet_serdes.h"
 
arch/powerpc/cpu/mpc85xx/cpu_init.c +1 -1
index 85d32fc..36f7aeb 100644
@@ -19,7 +19,7 @@
 #include <asm/io.h>
 #include <asm/cache.h>
 #include <asm/mmu.h>
-#include <asm/fsl_errata.h>
+#include <fsl_errata.h>
 #include <asm/fsl_law.h>
 #include <asm/fsl_serdes.h>
 #include <asm/fsl_srio.h>
drivers/usb/host/ehci-fsl.c +1 -1
index 45062e6..79fb6b4 100644
@@ -14,7 +14,7 @@
 #include <asm/io.h>
 #include <usb/ehci-fsl.h>
 #include <hwconfig.h>
-#include <asm/fsl_errata.h>
+#include <fsl_errata.h>
 
 #include "ehci.h"
 
include/fsl_errata.h renamed from arch/powerpc/include/asm/fsl_errata.h +5 -0
similarity index 95%
rename from arch/powerpc/include/asm/fsl_errata.h
rename to include/fsl_errata.h
index 64da4bb..0693679 100644
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <asm/processor.h>
 
+#ifdef CONFIG_PPC
 #ifdef CONFIG_SYS_FSL_ERRATUM_A006379
 static inline bool has_erratum_a006379(void)
 {
@@ -64,9 +65,11 @@ static inline bool has_erratum_a006261(void)
 	return false;
 }
 #endif
+#endif /* CONFIG_PPC */
 
 static inline bool has_erratum_a007075(void)
 {
+#ifdef CONFIG_PPC
 	u32 svr = get_svr();
 	u32 soc = SVR_SOC_VER(svr);
 
@@ -79,6 +82,8 @@ static inline bool has_erratum_a007075(void)
 	case SVR_P4080:
 		return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0);
 	}
+#endif /* CONFIG_PPC */
+
 	return false;
 }
 #endif
Signature · 1 line
1.7.9.5
author
#1 lore raw

RFC PATCH 2/2 driver/usb/fsl: Make FSL USB driver common

Add ifdef for powerpc specific code. This driver can be used by arm SoCs.

CC Alison Wang <[email protected]>
CC Nikhil Badola <[email protected]>

---
This patch is needed if fsl USB driver is enabled for ARM SoCs, like LS1021.

 drivers/usb/host/ehci-fsl.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/usb/host/ehci-fsl.c +4 -1
index 79fb6b4..994bfd7 100644
@@ -130,9 +130,11 @@ int ehci_hcd_init(int index, enum usb_init_type init,
 
 	in_le32(&ehci->usbmode);
 
+#ifdef CONFIG_PPC
 	if (SVR_SOC_VER(get_svr()) == SVR_T4240 &&
 	    IS_SVR_REV(get_svr(), 2, 0))
 		set_txfifothresh(ehci, TXFIFOTHRESH);
+#endif
 
 	return 0;
 }
@@ -151,7 +153,8 @@ int ehci_hcd_stop(int index)
  * to counter DDR latencies in writing data into Tx buffer.
  * This prevents Tx buffer from getting underrun
  */
-static void set_txfifothresh(struct usb_ehci *ehci, u32 txfifo_thresh)
+static void __maybe_unused set_txfifothresh(struct usb_ehci *ehci,
+					    u32 txfifo_thresh)
 {
 	u32 cmd;
 	cmd = ehci_readl(&ehci->txfilltuning);
Signature · 1 line
1.7.9.5
#2 lore raw

RFC PATCH 2/2 driver/usb/fsl: Make FSL USB driver common

Quoted 23 lines

-----Original Message-----
From: York Sun [mailto:yorksun at freescale.com]
Sent: Thursday, November 20, 2014 2:55 AM
To: u-boot at lists.denx.de
Cc: Sun York-R58495; Wang Huan-B18965; Badola Nikhil-B46172
Subject: [RFC Patch 2/2] driver/usb/fsl: Make FSL USB driver common

Add ifdef for powerpc specific code. This driver can be used by arm SoCs.

CC Alison Wang <[email protected]>
CC Nikhil Badola <[email protected]>

---
This patch is needed if fsl USB driver is enabled for ARM SoCs, like LS1021.

 drivers/usb/host/ehci-fsl.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/usb/host/ehci-fsl.c index renamed from drivers/usb/host/ehci-fsl.c +0 -0

79fb6b4..994bfd7 100644

drivers/usb/host/ehci-fsl.c int ehci_hcd_init(int index, enum usb_init_type init, · line 137

Quoted 8 lines
drivers/usb/host/ehci-fsl.c +2 -0
@@ -130,9 +130,11 @@ int ehci_hcd_init(int index, enum usb_init_type init,
 
 	in_le32(&ehci->usbmode);
 
+#ifdef CONFIG_PPC
 	if (SVR_SOC_VER(get_svr()) == SVR_T4240 &&
 	    IS_SVR_REV(get_svr(), 2, 0))
 		set_txfifothresh(ehci, TXFIFOTHRESH);
+#endif

This patch can be replaced by
http://patchwork.ozlabs.org/patch/400407/

Quoted 15 lines
drivers/usb/host/ehci-fsl.c +2 -2
 	return 0;
 }
@@ -151,7 +153,8 @@ int ehci_hcd_stop(int index)
  * to counter DDR latencies in writing data into Tx buffer.
  * This prevents Tx buffer from getting underrun
  */
-static void set_txfifothresh(struct usb_ehci *ehci, u32 txfifo_thresh)
+static void __maybe_unused set_txfifothresh(struct usb_ehci *ehci,
+					    u32 txfifo_thresh)
 {
 	u32 cmd;
 	cmd = ehci_readl(&ehci->txfilltuning);
--

1.7.9.5

author
#3 lore raw

RFC PATCH 2/2 driver/usb/fsl: Make FSL USB driver common

Quoted 26 lines · On 11/21/2014 08:27 PM, Badola Nikhil-B46172 wrote:
Quoted 26 lines

-----Original Message-----
From: York Sun [mailto:yorksun at freescale.com]
Sent: Thursday, November 20, 2014 2:55 AM
To: u-boot at lists.denx.de
Cc: Sun York-R58495; Wang Huan-B18965; Badola Nikhil-B46172
Subject: [RFC Patch 2/2] driver/usb/fsl: Make FSL USB driver common

Add ifdef for powerpc specific code. This driver can be used by arm SoCs.

CC Alison Wang <[email protected]>
CC Nikhil Badola <[email protected]>

---
This patch is needed if fsl USB driver is enabled for ARM SoCs, like LS1021.

 drivers/usb/host/ehci-fsl.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/usb/host/ehci-fsl.c index renamed from drivers/usb/host/ehci-fsl.c +0 -0

79fb6b4..994bfd7 100644

drivers/usb/host/ehci-fsl.c +0 -0
@@ -130,9 +130,11 @@ int ehci_hcd_init(int index, enum usb_init_type init,
 
 	in_le32(&ehci->usbmode);
 
Quoted 8 lines

drivers/usb/host/ehci-fsl.c int ehci_hcd_init(int index, enum usb_init_type init, · line 137

Quoted 5 lines
drivers/usb/host/ehci-fsl.c +2 -0
+#ifdef CONFIG_PPC
 	if (SVR_SOC_VER(get_svr()) == SVR_T4240 &&
 	    IS_SVR_REV(get_svr(), 2, 0))
 		set_txfifothresh(ehci, TXFIFOTHRESH);
+#endif

This patch can be replaced by
http://patchwork.ozlabs.org/patch/400407/

Great! I will drop this patch.

York

#4 lore raw

RFC PATCH 1/2 powerpc: Move fsl_errata.h out of arch/powerpc

In reply to York Sun

Hi York,

Quoted 8 lines · York Sun

This header file becomes common for both powerpc and arm SoCs.

CC Alison Wang <[email protected]>
CC Nikhil Badola <[email protected]>

---
This patch is needed if USB is enabled for LS1021 SoC.

Quoted 6 lines
  arch/powerpc/cpu/mpc85xx/cmd_errata.c              |    2 +-
  arch/powerpc/cpu/mpc85xx/cpu_init.c                |    2 +-
  drivers/usb/host/ehci-fsl.c                        |    2 +-
  {arch/powerpc/include/asm => include}/fsl_errata.h |    5 +++++
  4 files changed, 8 insertions(+), 3 deletions(-)

rename {arch/powerpc/include/asm => include}/fsl_errata.h (95%)

We should also move cmd_errata.c outside arch/powerpc/. otherwise it needs to be complied specially for LS1

--prabhakar

author
#5 lore raw

RFC PATCH 1/2 powerpc: Move fsl_errata.h out of arch/powerpc

Quoted 18 lines · Prabhakar Kushwaha

Hi York,

Quoted 8 lines · York Sun

This header file becomes common for both powerpc and arm SoCs.

CC Alison Wang <[email protected]>
CC Nikhil Badola <[email protected]>

---
This patch is needed if USB is enabled for LS1021 SoC.

Quoted 6 lines
  arch/powerpc/cpu/mpc85xx/cmd_errata.c              |    2 +-
  arch/powerpc/cpu/mpc85xx/cpu_init.c                |    2 +-
  drivers/usb/host/ehci-fsl.c                        |    2 +-
  {arch/powerpc/include/asm => include}/fsl_errata.h |    5 +++++
  4 files changed, 8 insertions(+), 3 deletions(-)

rename {arch/powerpc/include/asm => include}/fsl_errata.h (95%)

Quoted 3 lines

We should also move cmd_errata.c outside arch/powerpc/. otherwise it needs to be complied specially for LS1

I am now trying to resolve a conflict between LS1 and powerpc for USB so I can apply some pending patches. I do plan to move out cmd_errata.c to common, but not in this patch.

York

#6 lore raw

RFC PATCH 1/2 powerpc: Move fsl_errata.h out of arch/powerpc

In reply to York Sun
Quoted 7 lines

-----Original Message-----
From: York Sun [mailto:yorksun at freescale.com]
Sent: Thursday, November 20, 2014 2:55 AM
To: u-boot at lists.denx.de
Cc: Sun York-R58495; Wang Huan-B18965; Badola Nikhil-B46172
Subject: [RFC Patch 1/2] powerpc: Move fsl_errata.h out of arch/powerpc

Quoted 7 lines

This header file becomes common for both powerpc and arm SoCs.

CC Alison Wang <[email protected]>
CC Nikhil Badola <[email protected]>

---
This patch is needed if USB is enabled for LS1021 SoC.

For USB, patches are already under review for making erratum checking code to be platform independent.
Please see https://patchwork.ozlabs.org/patch/394796/ and related patches

Quoted 84 lines
 arch/powerpc/cpu/mpc85xx/cmd_errata.c              |    2 +-
 arch/powerpc/cpu/mpc85xx/cpu_init.c                |    2 +-
 drivers/usb/host/ehci-fsl.c                        |    2 +-
 {arch/powerpc/include/asm => include}/fsl_errata.h |    5 +++++
 4 files changed, 8 insertions(+), 3 deletions(-)  rename

{arch/powerpc/include/asm => include}/fsl_errata.h (95%)

arch/powerpc/cpu/mpc85xx/cmd_errata.c +1 -1
index 3a04a89..1b36e4f 100644
@@ -7,7 +7,7 @@
 #include <common.h>
 #include <command.h>
 #include <linux/compiler.h>
-#include <asm/fsl_errata.h>
+#include <fsl_errata.h>
 #include <asm/processor.h>
 #include "fsl_corenet_serdes.h"
 
arch/powerpc/cpu/mpc85xx/cpu_init.c +1 -1
index 85d32fc..36f7aeb 100644
@@ -19,7 +19,7 @@
 #include <asm/io.h>
 #include <asm/cache.h>
 #include <asm/mmu.h>
-#include <asm/fsl_errata.h>
+#include <fsl_errata.h>
 #include <asm/fsl_law.h>
 #include <asm/fsl_serdes.h>
 #include <asm/fsl_srio.h>
drivers/usb/host/ehci-fsl.c index renamed from drivers/usb/host/ehci-fsl.c +0 -0

45062e6..79fb6b4 100644

drivers/usb/host/ehci-fsl.c +1 -1
@@ -14,7 +14,7 @@
 #include <asm/io.h>
 #include <usb/ehci-fsl.h>
 #include <hwconfig.h>
-#include <asm/fsl_errata.h>
+#include <fsl_errata.h>
 
 #include "ehci.h"
 
include/fsl_errata.h renamed from arch/powerpc/include/asm/fsl_errata.h +1 -0
similarity index 95% rename from arch/powerpc/include/asm/fsl_errata.h
rename to include/fsl_errata.h
index 64da4bb..0693679 100644
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <asm/processor.h>
 
+#ifdef CONFIG_PPC
 #ifdef CONFIG_SYS_FSL_ERRATUM_A006379
 static inline bool has_erratum_a006379(void)  { @@ -64,9 +65,11 @@ static
 inline bool has_erratum_a006261(void)
include/fsl_errata.h renamed from arch/powerpc/include/asm/fsl_errata.h +4 -1
 	return false;
 }
 #endif
+#endif /* CONFIG_PPC */
 
 static inline bool has_erratum_a007075(void)  {
+#ifdef CONFIG_PPC
 	u32 svr = get_svr();
 	u32 soc = SVR_SOC_VER(svr);
@@ -79,6 +82,8 @@ static inline bool has_erratum_a007075(void)
 	case SVR_P4080:
 		return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0);
 	}
+#endif /* CONFIG_PPC */
+
 	return false;
 }
 #endif
--

1.7.9.5

author
#7 lore raw

RFC PATCH 1/2 powerpc: Move fsl_errata.h out of arch/powerpc

Quoted 15 lines · On 11/21/2014 01:09 AM, Badola Nikhil-B46172 wrote:
Quoted 7 lines

-----Original Message-----
From: York Sun [mailto:yorksun at freescale.com]
Sent: Thursday, November 20, 2014 2:55 AM
To: u-boot at lists.denx.de
Cc: Sun York-R58495; Wang Huan-B18965; Badola Nikhil-B46172
Subject: [RFC Patch 1/2] powerpc: Move fsl_errata.h out of arch/powerpc

Quoted 7 lines

This header file becomes common for both powerpc and arm SoCs.

CC Alison Wang <[email protected]>
CC Nikhil Badola <[email protected]>

---
This patch is needed if USB is enabled for LS1021 SoC.

Quoted 4 lines

For USB, patches are already under review for making erratum checking code to be platform independent.
Please see https://patchwork.ozlabs.org/patch/394796/ and related patches

Let me try to insert this patch in front of other USB patches. Please address the compiling error for https://patchwork.ozlabs.org/patch/401067/.

York

author
#8 lore raw

RFC PATCH 1/2 powerpc: Move fsl_errata.h out of arch/powerpc

Quoted 16 lines · York Sun
Quoted 15 lines · On 11/21/2014 01:09 AM, Badola Nikhil-B46172 wrote:
Quoted 14 lines

-----Original Message-----
From: York Sun [mailto:yorksun at freescale.com]
Sent: Thursday, November 20, 2014 2:55 AM
To: u-boot at lists.denx.de
Cc: Sun York-R58495; Wang Huan-B18965; Badola Nikhil-B46172
Subject: [RFC Patch 1/2] powerpc: Move fsl_errata.h out of arch/powerpc

This header file becomes common for both powerpc and arm SoCs.

CC Alison Wang <[email protected]>
CC Nikhil Badola <[email protected]>

---
This patch is needed if USB is enabled for LS1021 SoC.

Quoted 8 lines
Quoted 4 lines

For USB, patches are already under review for making erratum checking code to be platform independent.
Please see https://patchwork.ozlabs.org/patch/394796/ and related patches

Let me try to insert this patch in front of other USB patches. Please address the compiling error for https://patchwork.ozlabs.org/patch/401067/.

This patch can be dropped, and replaced with your patch. Please comment on this patch http://patchwork.ozlabs.org/patch/412513/.

York

#9 lore raw

RFC PATCH 1/2 powerpc: Move fsl_errata.h out of arch/powerpc

Quoted 32 lines

-----Original Message-----
From: York Sun [mailto:yorksun at freescale.com]
Sent: Friday, November 21, 2014 11:03 PM
To: Badola Nikhil-B46172
Cc: u-boot at lists.denx.de; Wang Huan-B18965
Subject: Re: [U-Boot] [RFC Patch 1/2] powerpc: Move fsl_errata.h out of arch/powerpc

Quoted 23 lines · York Sun
Quoted 21 lines · On 11/21/2014 01:09 AM, Badola Nikhil-B46172 wrote:
Quoted 8 lines

-----Original Message-----
From: York Sun [mailto:yorksun at freescale.com]
Sent: Thursday, November 20, 2014 2:55 AM
To: u-boot at lists.denx.de
Cc: Sun York-R58495; Wang Huan-B18965; Badola Nikhil-B46172
Subject: [RFC Patch 1/2] powerpc: Move fsl_errata.h out of arch/powerpc

Quoted 7 lines

This header file becomes common for both powerpc and arm SoCs.

CC Alison Wang <[email protected]>
CC Nikhil Badola <[email protected]>

---
This patch is needed if USB is enabled for LS1021 SoC.

For USB, patches are already under review for making erratum checking code to be platform independent.
Please see https://patchwork.ozlabs.org/patch/394796/ and related patches

Quoted 3 lines
Quoted 2 lines

Let me try to insert this patch in front of other USB patches. Please address the compiling error for

https://patchwork.ozlabs.org/patch/401067/.

These compilation errors are taken care by patch
http://patchwork.ozlabs.org/patch/401063/

Quoted 4 lines
Quoted 1 line

This patch can be dropped, and replaced with your patch. Please comment on this patch http://patchwork.ozlabs.org/patch/412513/.

Done

Quoted 3 lines

York