linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/3] QE: move qe code from arch/powerpc to drivers/soc
@ 2014-10-30  7:31 Zhao Qiang
  2014-10-30  7:31 ` [PATCH v3 2/3] qe_common: add qe common functions into qe_common.c Zhao Qiang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Zhao Qiang @ 2014-10-30  7:31 UTC (permalink / raw)
  To: linuxppc-dev, linux-kernel, B07421; +Cc: Zhao Qiang, R63061

LS1 is arm cpu and it has qe ip block.
move qe code from platform directory to public directory.

QE is an IP block integrates several comunications peripheral
controllers. It can implement a variety of applications, such
as uart, usb and tdm and so on.

Signed-off-by: Zhao Qiang <B45475@freescale.com>
---
Changes for v2:
	- move code to driver/soc
Changes for v3:
	- change drivers/soc/qe to drivers/soc/fsl-qe

 arch/powerpc/Kconfig                               |  2 -
 arch/powerpc/platforms/83xx/km83xx.c               |  4 +-
 arch/powerpc/platforms/83xx/misc.c                 |  2 +-
 arch/powerpc/platforms/83xx/mpc832x_mds.c          |  4 +-
 arch/powerpc/platforms/83xx/mpc832x_rdb.c          |  4 +-
 arch/powerpc/platforms/83xx/mpc836x_mds.c          |  4 +-
 arch/powerpc/platforms/83xx/mpc836x_rdk.c          |  4 +-
 arch/powerpc/platforms/85xx/common.c               |  2 +-
 arch/powerpc/platforms/85xx/corenet_generic.c      |  2 +-
 arch/powerpc/platforms/85xx/mpc85xx_mds.c          |  4 +-
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c          |  4 +-
 arch/powerpc/platforms/85xx/twr_p102x.c            |  4 +-
 arch/powerpc/platforms/Kconfig                     | 19 ---------
 arch/powerpc/sysdev/Makefile                       |  1 -
 arch/powerpc/sysdev/qe_lib/Kconfig                 | 27 -------------
 drivers/net/ethernet/freescale/fsl_pq_mdio.c       |  2 +-
 drivers/net/ethernet/freescale/ucc_geth.c          |  8 ++--
 drivers/net/ethernet/freescale/ucc_geth.h          |  8 ++--
 drivers/soc/Kconfig                                |  2 +
 drivers/soc/Makefile                               |  1 +
 drivers/soc/fsl-qe/Kconfig                         | 45 ++++++++++++++++++++++
 .../sysdev/qe_lib => drivers/soc/fsl-qe}/Makefile  |  0
 .../sysdev/qe_lib => drivers/soc/fsl-qe}/gpio.c    |  2 +-
 .../sysdev/qe_lib => drivers/soc/fsl-qe}/qe.c      |  4 +-
 .../sysdev/qe_lib => drivers/soc/fsl-qe}/qe_ic.c   |  2 +-
 .../sysdev/qe_lib => drivers/soc/fsl-qe}/qe_ic.h   |  2 +-
 .../sysdev/qe_lib => drivers/soc/fsl-qe}/qe_io.c   |  2 +-
 .../sysdev/qe_lib => drivers/soc/fsl-qe}/ucc.c     |  6 +--
 .../qe_lib => drivers/soc/fsl-qe}/ucc_fast.c       |  8 ++--
 .../qe_lib => drivers/soc/fsl-qe}/ucc_slow.c       |  8 ++--
 .../sysdev/qe_lib => drivers/soc/fsl-qe}/usb.c     |  4 +-
 drivers/spi/spi-fsl-cpm.c                          |  2 +-
 drivers/tty/serial/ucc_uart.c                      |  2 +-
 drivers/usb/gadget/fsl_qe_udc.c                    |  2 +-
 drivers/usb/host/fhci-hcd.c                        |  2 +-
 drivers/usb/host/fhci-hub.c                        |  2 +-
 drivers/usb/host/fhci-sched.c                      |  2 +-
 drivers/usb/host/fhci.h                            |  4 +-
 .../include/asm => include/linux/fsl}/immap_qe.h   |  0
 .../powerpc/include/asm => include/linux/fsl}/qe.h |  2 +-
 .../include/asm => include/linux/fsl}/qe_ic.h      |  0
 .../include/asm => include/linux/fsl}/ucc.h        |  4 +-
 .../include/asm => include/linux/fsl}/ucc_fast.h   |  6 +--
 .../include/asm => include/linux/fsl}/ucc_slow.h   |  6 +--
 44 files changed, 112 insertions(+), 113 deletions(-)
 delete mode 100644 arch/powerpc/sysdev/qe_lib/Kconfig
 create mode 100644 drivers/soc/fsl-qe/Kconfig
 rename {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/Makefile (100%)
 rename {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/gpio.c (99%)
 rename {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/qe.c (99%)
 rename {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/qe_ic.c (99%)
 rename {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/qe_ic.h (98%)
 rename {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/qe_io.c (99%)
 rename {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/ucc.c (98%)
 rename {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/ucc_fast.c (98%)
 rename {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/ucc_slow.c (98%)
 rename {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/usb.c (96%)
 rename {arch/powerpc/include/asm => include/linux/fsl}/immap_qe.h (100%)
 rename {arch/powerpc/include/asm => include/linux/fsl}/qe.h (99%)
 rename {arch/powerpc/include/asm => include/linux/fsl}/qe_ic.h (100%)
 rename {arch/powerpc/include/asm => include/linux/fsl}/ucc.h (96%)
 rename {arch/powerpc/include/asm => include/linux/fsl}/ucc_fast.h (98%)
 rename {arch/powerpc/include/asm => include/linux/fsl}/ucc_slow.h (99%)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index d003409..007b052 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -1054,8 +1054,6 @@ source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
-source "arch/powerpc/sysdev/qe_lib/Kconfig"
-
 source "lib/Kconfig"
 
 source "arch/powerpc/Kconfig.debug"
diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index bf4c447..584d8cc 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -37,8 +37,8 @@
 #include <asm/udbg.h>
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
-#include <asm/qe.h>
-#include <asm/qe_ic.h>
+#include <linux/fsl/qe.h>
+#include <linux/fsl/qe_ic.h>
 
 #include "mpc83xx.h"
 
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
index 125336f..3e2e6d2 100644
--- a/arch/powerpc/platforms/83xx/misc.c
+++ b/arch/powerpc/platforms/83xx/misc.c
@@ -17,7 +17,7 @@
 #include <asm/io.h>
 #include <asm/hw_irq.h>
 #include <asm/ipic.h>
-#include <asm/qe_ic.h>
+#include <linux/fsl/qe_ic.h>
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
 
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 8d76220..e1186be 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -36,8 +36,8 @@
 #include <asm/udbg.h>
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
-#include <asm/qe.h>
-#include <asm/qe_ic.h>
+#include <linux/fsl/qe.h>
+#include <linux/fsl/qe_ic.h>
 
 #include "mpc83xx.h"
 
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index eff5baa..9f75944 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -25,8 +25,8 @@
 #include <asm/time.h>
 #include <asm/ipic.h>
 #include <asm/udbg.h>
-#include <asm/qe.h>
-#include <asm/qe_ic.h>
+#include <linux/fsl/qe.h>
+#include <linux/fsl/qe_ic.h>
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
 
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 1a26d2f..7c1a22f 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -44,8 +44,8 @@
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
 #include <sysdev/simple_gpio.h>
-#include <asm/qe.h>
-#include <asm/qe_ic.h>
+#include <linux/fsl/qe.h>
+#include <linux/fsl/qe_ic.h>
 
 #include "mpc83xx.h"
 
diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
index b63b42d..5e17d71 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
@@ -20,8 +20,8 @@
 #include <asm/time.h>
 #include <asm/ipic.h>
 #include <asm/udbg.h>
-#include <asm/qe.h>
-#include <asm/qe_ic.h>
+#include <linux/fsl/qe.h>
+#include <linux/fsl/qe_ic.h>
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
 
diff --git a/arch/powerpc/platforms/85xx/common.c b/arch/powerpc/platforms/85xx/common.c
index b564b5e..dfb21da 100644
--- a/arch/powerpc/platforms/85xx/common.c
+++ b/arch/powerpc/platforms/85xx/common.c
@@ -9,7 +9,7 @@
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
-#include <asm/qe.h>
+#include <linux/fsl/qe.h>
 #include <sysdev/cpm2_pic.h>
 
 #include "mpc85xx.h"
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c
index e56b89a..5e2acb9 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -27,7 +27,7 @@
 #include <asm/udbg.h>
 #include <asm/mpic.h>
 #include <asm/ehv_pic.h>
-#include <asm/qe_ic.h>
+#include <linux/fsl/qe_ic.h>
 
 #include <linux/of_platform.h>
 #include <sysdev/fsl_soc.h>
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index a392e94..7cf8eb5 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -47,8 +47,8 @@
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
 #include <sysdev/simple_gpio.h>
-#include <asm/qe.h>
-#include <asm/qe_ic.h>
+#include <linux/fsl/qe.h>
+#include <linux/fsl/qe_ic.h>
 #include <asm/mpic.h>
 #include <asm/swiotlb.h>
 #include <asm/fsl_guts.h>
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
index e358bed..d1b6d1b 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -25,8 +25,8 @@
 #include <asm/prom.h>
 #include <asm/udbg.h>
 #include <asm/mpic.h>
-#include <asm/qe.h>
-#include <asm/qe_ic.h>
+#include <linux/fsl/qe.h>
+#include <linux/fsl/qe_ic.h>
 #include <asm/fsl_guts.h>
 
 #include <sysdev/fsl_soc.h>
diff --git a/arch/powerpc/platforms/85xx/twr_p102x.c b/arch/powerpc/platforms/85xx/twr_p102x.c
index 1eadb6d..7df08d9 100644
--- a/arch/powerpc/platforms/85xx/twr_p102x.c
+++ b/arch/powerpc/platforms/85xx/twr_p102x.c
@@ -21,8 +21,8 @@
 #include <asm/pci-bridge.h>
 #include <asm/udbg.h>
 #include <asm/mpic.h>
-#include <asm/qe.h>
-#include <asm/qe_ic.h>
+#include <linux/fsl/qe.h>
+#include <linux/fsl/qe_ic.h>
 #include <asm/fsl_guts.h>
 
 #include <sysdev/fsl_soc.h>
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 391b3f6..ae8879c 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -277,25 +277,6 @@ config TAU_AVERAGE
 
 	  If in doubt, say N here.
 
-config QUICC_ENGINE
-	bool "Freescale QUICC Engine (QE) Support"
-	depends on FSL_SOC && PPC32
-	select PPC_LIB_RHEAP
-	select CRC32
-	help
-	  The QUICC Engine (QE) is a new generation of communications
-	  coprocessors on Freescale embedded CPUs (akin to CPM in older chips).
-	  Selecting this option means that you wish to build a kernel
-	  for a machine with a QE coprocessor.
-
-config QE_GPIO
-	bool "QE GPIO support"
-	depends on QUICC_ENGINE
-	select ARCH_REQUIRE_GPIOLIB
-	help
-	  Say Y here if you're going to use hardware that connects to the
-	  QE GPIOs.
-
 config CPM2
 	bool "Enable support for the CPM2 (Communications Processor Module)"
 	depends on (FSL_SOC_BOOKE && PPC32) || 8260
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index f7cb2a1..087d301 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -26,7 +26,6 @@ obj-$(CONFIG_FSL_85XX_CACHE_SRAM)	+= fsl_85xx_l2ctlr.o fsl_85xx_cache_sram.o
 obj-$(CONFIG_SIMPLE_GPIO)	+= simple_gpio.o
 obj-$(CONFIG_FSL_RIO)		+= fsl_rio.o fsl_rmu.o
 obj-$(CONFIG_TSI108_BRIDGE)	+= tsi108_pci.o tsi108_dev.o
-obj-$(CONFIG_QUICC_ENGINE)	+= qe_lib/
 mv64x60-$(CONFIG_PCI)		+= mv64x60_pci.o
 obj-$(CONFIG_MV64X60)		+= $(mv64x60-y) mv64x60_pic.o mv64x60_dev.o \
 				   mv64x60_udbg.o
diff --git a/arch/powerpc/sysdev/qe_lib/Kconfig b/arch/powerpc/sysdev/qe_lib/Kconfig
deleted file mode 100644
index 3c25199..0000000
--- a/arch/powerpc/sysdev/qe_lib/Kconfig
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# QE Communication options
-#
-
-config UCC_SLOW
-	bool
-	default y if SERIAL_QE
-	help
-	  This option provides qe_lib support to UCC slow
-	  protocols: UART, BISYNC, QMC
-
-config UCC_FAST
-	bool
-	default y if UCC_GETH
-	help
-	  This option provides qe_lib support to UCC fast
-	  protocols: HDLC, Ethernet, ATM, transparent
-
-config UCC
-	bool
-	default y if UCC_FAST || UCC_SLOW
-
-config QE_USB
-	bool
-	default y if USB_FSL_QE
-	help
-	  QE USB Controller support
diff --git a/drivers/net/ethernet/freescale/fsl_pq_mdio.c b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
index 583e71a..958353c 100644
--- a/drivers/net/ethernet/freescale/fsl_pq_mdio.c
+++ b/drivers/net/ethernet/freescale/fsl_pq_mdio.c
@@ -28,7 +28,7 @@
 #include <linux/of_device.h>
 
 #include <asm/io.h>
-#include <asm/ucc.h>	/* for ucc_set_qe_mux_mii_mng() */
+#include <linux/fsl/ucc.h>	/* for ucc_set_qe_mux_mii_mng() */
 
 #include "gianfar.h"
 
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index fab39e2..ef7740c 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -40,10 +40,10 @@
 #include <asm/uaccess.h>
 #include <asm/irq.h>
 #include <asm/io.h>
-#include <asm/immap_qe.h>
-#include <asm/qe.h>
-#include <asm/ucc.h>
-#include <asm/ucc_fast.h>
+#include <linux/fsl/immap_qe.h>
+#include <linux/fsl/qe.h>
+#include <linux/fsl/ucc.h>
+#include <linux/fsl/ucc_fast.h>
 #include <asm/machdep.h>
 
 #include "ucc_geth.h"
diff --git a/drivers/net/ethernet/freescale/ucc_geth.h b/drivers/net/ethernet/freescale/ucc_geth.h
index 75f3371..a803635 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.h
+++ b/drivers/net/ethernet/freescale/ucc_geth.h
@@ -22,11 +22,11 @@
 #include <linux/list.h>
 #include <linux/if_ether.h>
 
-#include <asm/immap_qe.h>
-#include <asm/qe.h>
+#include <linux/fsl/immap_qe.h>
+#include <linux/fsl/qe.h>
 
-#include <asm/ucc.h>
-#include <asm/ucc_fast.h>
+#include <linux/fsl/ucc.h>
+#include <linux/fsl/ucc_fast.h>
 
 #define DRV_DESC "QE UCC Gigabit Ethernet Controller"
 #define DRV_NAME "ucc_geth"
diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
index c854385..5c8f982 100644
--- a/drivers/soc/Kconfig
+++ b/drivers/soc/Kconfig
@@ -2,4 +2,6 @@ menu "SOC (System On Chip) specific Drivers"
 
 source "drivers/soc/qcom/Kconfig"
 
+source "drivers/soc/fsl-qe/Kconfig"
+
 endmenu
diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile
index 0f7c447..4ebd131 100644
--- a/drivers/soc/Makefile
+++ b/drivers/soc/Makefile
@@ -3,3 +3,4 @@
 #
 
 obj-$(CONFIG_ARCH_QCOM)		+= qcom/
+obj-$(CONFIG_QUICC_ENGINE)	+= fsl-qe/
diff --git a/drivers/soc/fsl-qe/Kconfig b/drivers/soc/fsl-qe/Kconfig
new file mode 100644
index 0000000..8b03ca2
--- /dev/null
+++ b/drivers/soc/fsl-qe/Kconfig
@@ -0,0 +1,45 @@
+#
+# QE Communication options
+#
+config QUICC_ENGINE
+	bool "Freescale QUICC Engine (QE) Support"
+	depends on FSL_SOC && PPC32
+	select PPC_LIB_RHEAP
+	select CRC32
+	help
+	  The QUICC Engine (QE) is a new generation of communications
+	  coprocessors on Freescale embedded CPUs (akin to CPM in older chips).
+	  Selecting this option means that you wish to build a kernel
+	  for a machine with a QE coprocessor.
+
+config QE_GPIO
+	bool "QE GPIO support"
+	depends on QUICC_ENGINE
+	select ARCH_REQUIRE_GPIOLIB
+	help
+	  Say Y here if you're going to use hardware that connects to the
+	  QE GPIOs.
+
+config UCC_SLOW
+	bool
+	default y if SERIAL_QE
+	help
+	  This option provides qe_lib support to UCC slow
+	  protocols: UART, BISYNC, QMC
+
+config UCC_FAST
+	bool
+	default y if UCC_GETH
+	help
+	  This option provides qe_lib support to UCC fast
+	  protocols: HDLC, Ethernet, ATM, transparent
+
+config UCC
+	bool
+	default y if UCC_FAST || UCC_SLOW
+
+config QE_USB
+	bool
+	default y if USB_FSL_QE
+	help
+	  QE USB Controller support
diff --git a/arch/powerpc/sysdev/qe_lib/Makefile b/drivers/soc/fsl-qe/Makefile
similarity index 100%
rename from arch/powerpc/sysdev/qe_lib/Makefile
rename to drivers/soc/fsl-qe/Makefile
diff --git a/arch/powerpc/sysdev/qe_lib/gpio.c b/drivers/soc/fsl-qe/gpio.c
similarity index 99%
rename from arch/powerpc/sysdev/qe_lib/gpio.c
rename to drivers/soc/fsl-qe/gpio.c
index 521e67a..1e38588 100644
--- a/arch/powerpc/sysdev/qe_lib/gpio.c
+++ b/drivers/soc/fsl-qe/gpio.c
@@ -21,7 +21,7 @@
 #include <linux/gpio.h>
 #include <linux/slab.h>
 #include <linux/export.h>
-#include <asm/qe.h>
+#include <linux/fsl/qe.h>
 
 struct qe_gpio_chip {
 	struct of_mm_gpio_chip mm_gc;
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/drivers/soc/fsl-qe/qe.c
similarity index 99%
rename from arch/powerpc/sysdev/qe_lib/qe.c
rename to drivers/soc/fsl-qe/qe.c
index 238a07b..1c5beef 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/drivers/soc/fsl-qe/qe.c
@@ -32,8 +32,8 @@
 #include <asm/irq.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
-#include <asm/immap_qe.h>
-#include <asm/qe.h>
+#include <linux/fsl/immap_qe.h>
+#include <linux/fsl/qe.h>
 #include <asm/prom.h>
 #include <asm/rheap.h>
 
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/drivers/soc/fsl-qe/qe_ic.c
similarity index 99%
rename from arch/powerpc/sysdev/qe_lib/qe_ic.c
rename to drivers/soc/fsl-qe/qe_ic.c
index b2b87c3..eb4d160 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_ic.c
+++ b/drivers/soc/fsl-qe/qe_ic.c
@@ -28,7 +28,7 @@
 #include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/prom.h>
-#include <asm/qe_ic.h>
+#include <linux/fsl/qe_ic.h>
 
 #include "qe_ic.h"
 
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.h b/drivers/soc/fsl-qe/qe_ic.h
similarity index 98%
rename from arch/powerpc/sysdev/qe_lib/qe_ic.h
rename to drivers/soc/fsl-qe/qe_ic.h
index efef7ab..5c4480e 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_ic.h
+++ b/drivers/soc/fsl-qe/qe_ic.h
@@ -16,7 +16,7 @@
 #ifndef _POWERPC_SYSDEV_QE_IC_H
 #define _POWERPC_SYSDEV_QE_IC_H
 
-#include <asm/qe_ic.h>
+#include <linux/fsl/qe_ic.h>
 
 #define NR_QE_IC_INTS		64
 
diff --git a/arch/powerpc/sysdev/qe_lib/qe_io.c b/drivers/soc/fsl-qe/qe_io.c
similarity index 99%
rename from arch/powerpc/sysdev/qe_lib/qe_io.c
rename to drivers/soc/fsl-qe/qe_io.c
index d099941..3bdc2c7 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_io.c
+++ b/drivers/soc/fsl-qe/qe_io.c
@@ -21,7 +21,7 @@
 #include <linux/ioport.h>
 
 #include <asm/io.h>
-#include <asm/qe.h>
+#include <linux/fsl/qe.h>
 #include <asm/prom.h>
 #include <sysdev/fsl_soc.h>
 
diff --git a/arch/powerpc/sysdev/qe_lib/ucc.c b/drivers/soc/fsl-qe/ucc.c
similarity index 98%
rename from arch/powerpc/sysdev/qe_lib/ucc.c
rename to drivers/soc/fsl-qe/ucc.c
index 621575b..36a206f 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc.c
+++ b/drivers/soc/fsl-qe/ucc.c
@@ -21,9 +21,9 @@
 
 #include <asm/irq.h>
 #include <asm/io.h>
-#include <asm/immap_qe.h>
-#include <asm/qe.h>
-#include <asm/ucc.h>
+#include <linux/fsl/immap_qe.h>
+#include <linux/fsl/qe.h>
+#include <linux/fsl/ucc.h>
 
 int ucc_set_qe_mux_mii_mng(unsigned int ucc_num)
 {
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_fast.c b/drivers/soc/fsl-qe/ucc_fast.c
similarity index 98%
rename from arch/powerpc/sysdev/qe_lib/ucc_fast.c
rename to drivers/soc/fsl-qe/ucc_fast.c
index 65aaf15..223bb36 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_fast.c
+++ b/drivers/soc/fsl-qe/ucc_fast.c
@@ -21,11 +21,11 @@
 #include <linux/export.h>
 
 #include <asm/io.h>
-#include <asm/immap_qe.h>
-#include <asm/qe.h>
+#include <linux/fsl/immap_qe.h>
+#include <linux/fsl/qe.h>
 
-#include <asm/ucc.h>
-#include <asm/ucc_fast.h>
+#include <linux/fsl/ucc.h>
+#include <linux/fsl/ucc_fast.h>
 
 void ucc_fast_dump_regs(struct ucc_fast_private * uccf)
 {
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/drivers/soc/fsl-qe/ucc_slow.c
similarity index 98%
rename from arch/powerpc/sysdev/qe_lib/ucc_slow.c
rename to drivers/soc/fsl-qe/ucc_slow.c
index befaf11..7dfff79 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c
+++ b/drivers/soc/fsl-qe/ucc_slow.c
@@ -21,11 +21,11 @@
 #include <linux/export.h>
 
 #include <asm/io.h>
-#include <asm/immap_qe.h>
-#include <asm/qe.h>
+#include <linux/fsl/immap_qe.h>
+#include <linux/fsl/qe.h>
 
-#include <asm/ucc.h>
-#include <asm/ucc_slow.h>
+#include <linux/fsl/ucc.h>
+#include <linux/fsl/ucc_slow.h>
 
 u32 ucc_slow_get_qe_cr_subblock(int uccs_num)
 {
diff --git a/arch/powerpc/sysdev/qe_lib/usb.c b/drivers/soc/fsl-qe/usb.c
similarity index 96%
rename from arch/powerpc/sysdev/qe_lib/usb.c
rename to drivers/soc/fsl-qe/usb.c
index 27f23bd..0bcdf7d 100644
--- a/arch/powerpc/sysdev/qe_lib/usb.c
+++ b/drivers/soc/fsl-qe/usb.c
@@ -17,8 +17,8 @@
 #include <linux/errno.h>
 #include <linux/export.h>
 #include <linux/io.h>
-#include <asm/immap_qe.h>
-#include <asm/qe.h>
+#include <linux/fsl/immap_qe.h>
+#include <linux/fsl/qe.h>
 
 int qe_usb_clock_set(enum qe_clock clk, int rate)
 {
diff --git a/drivers/spi/spi-fsl-cpm.c b/drivers/spi/spi-fsl-cpm.c
index 54b0637..b23676f 100644
--- a/drivers/spi/spi-fsl-cpm.c
+++ b/drivers/spi/spi-fsl-cpm.c
@@ -22,7 +22,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/of_address.h>
 #include <asm/cpm.h>
-#include <asm/qe.h>
+#include <linux/fsl/qe.h>
 
 #include "spi-fsl-lib.h"
 #include "spi-fsl-cpm.h"
diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
index d569ca5..493f74e 100644
--- a/drivers/tty/serial/ucc_uart.c
+++ b/drivers/tty/serial/ucc_uart.c
@@ -31,7 +31,7 @@
 #include <linux/dma-mapping.h>
 
 #include <linux/fs_uart_pd.h>
-#include <asm/ucc_slow.h>
+#include <linux/fsl/ucc_slow.h>
 
 #include <linux/firmware.h>
 #include <asm/reg.h>
diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c
index ad54833..a1d4e00 100644
--- a/drivers/usb/gadget/fsl_qe_udc.c
+++ b/drivers/usb/gadget/fsl_qe_udc.c
@@ -38,7 +38,7 @@
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 #include <linux/usb/otg.h>
-#include <asm/qe.h>
+#include <linux/fsl/qe.h>
 #include <asm/cpm.h>
 #include <asm/dma.h>
 #include <asm/reg.h>
diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c
index 1cf68ea..7df4e74 100644
--- a/drivers/usb/host/fhci-hcd.c
+++ b/drivers/usb/host/fhci-hcd.c
@@ -31,7 +31,7 @@
 #include <linux/of_platform.h>
 #include <linux/of_gpio.h>
 #include <linux/slab.h>
-#include <asm/qe.h>
+#include <linux/fsl/qe.h>
 #include <asm/fsl_gtm.h>
 #include "fhci.h"
 
diff --git a/drivers/usb/host/fhci-hub.c b/drivers/usb/host/fhci-hub.c
index 6af2512..31b4402 100644
--- a/drivers/usb/host/fhci-hub.c
+++ b/drivers/usb/host/fhci-hub.c
@@ -24,7 +24,7 @@
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
 #include <linux/gpio.h>
-#include <asm/qe.h>
+#include <linux/fsl/qe.h>
 #include "fhci.h"
 
 /* virtual root hub specific descriptor */
diff --git a/drivers/usb/host/fhci-sched.c b/drivers/usb/host/fhci-sched.c
index 95ca598..6f1d4ad 100644
--- a/drivers/usb/host/fhci-sched.c
+++ b/drivers/usb/host/fhci-sched.c
@@ -25,7 +25,7 @@
 #include <linux/io.h>
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
-#include <asm/qe.h>
+#include <linux/fsl/qe.h>
 #include <asm/fsl_gtm.h>
 #include "fhci.h"
 
diff --git a/drivers/usb/host/fhci.h b/drivers/usb/host/fhci.h
index 154e6a0..d7c49531 100644
--- a/drivers/usb/host/fhci.h
+++ b/drivers/usb/host/fhci.h
@@ -27,8 +27,8 @@
 #include <linux/io.h>
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
-#include <asm/qe.h>
-#include <asm/immap_qe.h>
+#include <linux/fsl/qe.h>
+#include <linux/fsl/immap_qe.h>
 
 #define USB_CLOCK	48000000
 
diff --git a/arch/powerpc/include/asm/immap_qe.h b/include/linux/fsl/immap_qe.h
similarity index 100%
rename from arch/powerpc/include/asm/immap_qe.h
rename to include/linux/fsl/immap_qe.h
diff --git a/arch/powerpc/include/asm/qe.h b/include/linux/fsl/qe.h
similarity index 99%
rename from arch/powerpc/include/asm/qe.h
rename to include/linux/fsl/qe.h
index 32b9bfa..1c9d626 100644
--- a/arch/powerpc/include/asm/qe.h
+++ b/include/linux/fsl/qe.h
@@ -20,7 +20,7 @@
 #include <linux/errno.h>
 #include <linux/err.h>
 #include <asm/cpm.h>
-#include <asm/immap_qe.h>
+#include <linux/fsl/immap_qe.h>
 
 #define QE_NUM_OF_SNUM	256	/* There are 256 serial number in QE */
 #define QE_NUM_OF_BRGS	16
diff --git a/arch/powerpc/include/asm/qe_ic.h b/include/linux/fsl/qe_ic.h
similarity index 100%
rename from arch/powerpc/include/asm/qe_ic.h
rename to include/linux/fsl/qe_ic.h
diff --git a/arch/powerpc/include/asm/ucc.h b/include/linux/fsl/ucc.h
similarity index 96%
rename from arch/powerpc/include/asm/ucc.h
rename to include/linux/fsl/ucc.h
index 6927ac2..d448813 100644
--- a/arch/powerpc/include/asm/ucc.h
+++ b/include/linux/fsl/ucc.h
@@ -15,8 +15,8 @@
 #ifndef __UCC_H__
 #define __UCC_H__
 
-#include <asm/immap_qe.h>
-#include <asm/qe.h>
+#include <linux/fsl/immap_qe.h>
+#include <linux/fsl/qe.h>
 
 #define STATISTICS
 
diff --git a/arch/powerpc/include/asm/ucc_fast.h b/include/linux/fsl/ucc_fast.h
similarity index 98%
rename from arch/powerpc/include/asm/ucc_fast.h
rename to include/linux/fsl/ucc_fast.h
index 72ea9ba..101fae7 100644
--- a/arch/powerpc/include/asm/ucc_fast.h
+++ b/include/linux/fsl/ucc_fast.h
@@ -16,10 +16,10 @@
 
 #include <linux/kernel.h>
 
-#include <asm/immap_qe.h>
-#include <asm/qe.h>
+#include <linux/fsl/immap_qe.h>
+#include <linux/fsl/qe.h>
 
-#include <asm/ucc.h>
+#include <linux/fsl/ucc.h>
 
 /* Receive BD's status */
 #define R_E	0x80000000	/* buffer empty */
diff --git a/arch/powerpc/include/asm/ucc_slow.h b/include/linux/fsl/ucc_slow.h
similarity index 99%
rename from arch/powerpc/include/asm/ucc_slow.h
rename to include/linux/fsl/ucc_slow.h
index c44131e..61f4c83 100644
--- a/arch/powerpc/include/asm/ucc_slow.h
+++ b/include/linux/fsl/ucc_slow.h
@@ -17,10 +17,10 @@
 
 #include <linux/kernel.h>
 
-#include <asm/immap_qe.h>
-#include <asm/qe.h>
+#include <linux/fsl/immap_qe.h>
+#include <linux/fsl/qe.h>
 
-#include <asm/ucc.h>
+#include <linux/fsl/ucc.h>
 
 /* transmit BD's status */
 #define T_R	0x80000000	/* ready bit */
-- 
2.1.0.27.g96db324

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 2/3] qe_common: add qe common functions into qe_common.c
  2014-10-30  7:31 [PATCH v3 1/3] QE: move qe code from arch/powerpc to drivers/soc Zhao Qiang
@ 2014-10-30  7:31 ` Zhao Qiang
  2014-10-30  7:31 ` [PATCH v3 3/3] rheap: move rheap.c from arch/powerpc/lib/ to lib/ Zhao Qiang
  2014-10-30 13:36 ` [PATCH v3 1/3] QE: move qe code from arch/powerpc to drivers/soc Kumar Gala
  2 siblings, 0 replies; 7+ messages in thread
From: Zhao Qiang @ 2014-10-30  7:31 UTC (permalink / raw)
  To: linuxppc-dev, linux-kernel, B07421; +Cc: Zhao Qiang, R63061

qe need to call some common functions,
add a new file drivers/soc/fsl-qe/qe_common.c
for them.

Signed-off-by: Zhao Qiang <B45475@freescale.com>
---
 drivers/soc/fsl-qe/Makefile    |   2 +-
 drivers/soc/fsl-qe/qe_common.c | 185 +++++++++++++++++++++++++++++++++++++++++
 include/linux/fsl/qe.h         |  52 ++++++++++--
 3 files changed, 230 insertions(+), 9 deletions(-)
 create mode 100644 drivers/soc/fsl-qe/qe_common.c

diff --git a/drivers/soc/fsl-qe/Makefile b/drivers/soc/fsl-qe/Makefile
index f1855c1..77f6fd9 100644
--- a/drivers/soc/fsl-qe/Makefile
+++ b/drivers/soc/fsl-qe/Makefile
@@ -1,7 +1,7 @@
 #
 # Makefile for the linux ppc-specific parts of QE
 #
-obj-$(CONFIG_QUICC_ENGINE)+= qe.o qe_ic.o qe_io.o
+obj-$(CONFIG_QUICC_ENGINE)+= qe.o qe_ic.o qe_io.o qe_common.o
 
 obj-$(CONFIG_UCC)	+= ucc.o
 obj-$(CONFIG_UCC_SLOW)	+= ucc_slow.o
diff --git a/drivers/soc/fsl-qe/qe_common.c b/drivers/soc/fsl-qe/qe_common.c
new file mode 100644
index 0000000..c82ddcc
--- /dev/null
+++ b/drivers/soc/fsl-qe/qe_common.c
@@ -0,0 +1,185 @@
+/*
+ * Common QE code
+ *
+ * Author: Scott Wood <scottwood@freescale.com>
+ *
+ * Copyright 2007-2008,2010 Freescale Semiconductor, Inc.
+ *
+ * Some parts derived from commproc.c/cpm2_common.c, which is:
+ * Copyright (c) 1997 Dan error_act (dmalek@jlc.net)
+ * Copyright (c) 1999-2001 Dan Malek <dan@embeddedalley.com>
+ * Copyright (c) 2000 MontaVista Software, Inc (source@mvista.com)
+ * 2006 (c) MontaVista Software, Inc.
+ * Vitaly Bordug <vbordug@ru.mvista.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/of_device.h>
+#include <linux/spinlock.h>
+#include <linux/export.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/slab.h>
+
+#include <linux/io.h>
+#include <asm/rheap.h>
+#include <linux/fsl/qe.h>
+
+static spinlock_t qe_muram_lock;
+static rh_block_t qe_boot_muram_rh_block[16];
+static rh_info_t qe_muram_info;
+static u8 __iomem *muram_vbase;
+static phys_addr_t muram_pbase;
+
+/* Max address size we deal with */
+#define OF_MAX_ADDR_CELLS	4
+
+int qe_muram_init(void)
+{
+	struct device_node *np;
+	struct resource r;
+	u32 zero[OF_MAX_ADDR_CELLS] = {};
+	resource_size_t max = 0;
+	int i = 0;
+	int ret = 0;
+
+	if (muram_pbase)
+		return 0;
+
+	spin_lock_init(&qe_muram_lock);
+	/* initialize the info header */
+	rh_init(&qe_muram_info, 1,
+		sizeof(qe_boot_muram_rh_block) /
+		sizeof(qe_boot_muram_rh_block[0]),
+		qe_boot_muram_rh_block);
+
+	np = of_find_compatible_node(NULL, NULL, "fsl,qe-muram-data");
+	if (!np) {
+		/* try legacy bindings */
+		np = of_find_node_by_name(NULL, "data-only");
+		if (!np) {
+			pr_err("Cannot find CPM muram data node");
+			ret = -ENODEV;
+			goto out;
+		}
+	}
+
+	muram_pbase = of_translate_address(np, zero);
+	if (muram_pbase == (phys_addr_t)OF_BAD_ADDR) {
+		pr_err("Cannot translate zero through CPM muram node");
+		ret = -ENODEV;
+		goto out;
+	}
+
+	while (of_address_to_resource(np, i++, &r) == 0) {
+		if (r.end > max)
+			max = r.end;
+
+		rh_attach_region(&qe_muram_info, r.start - muram_pbase,
+				 resource_size(&r));
+	}
+
+	muram_vbase = ioremap(muram_pbase, max - muram_pbase + 1);
+	if (!muram_vbase) {
+		pr_err("Cannot map CPM muram");
+		ret = -ENOMEM;
+	}
+
+out:
+	of_node_put(np);
+	return ret;
+}
+
+/**
+ * qe_muram_alloc - allocate the requested size worth of multi-user ram
+ * @size: number of bytes to allocate
+ * @align: requested alignment, in bytes
+ *
+ * This function returns an offset into the muram area.
+ * Use qe_dpram_addr() to get the virtual address of the area.
+ * Use qe_muram_free() to free the allocation.
+ */
+unsigned long qe_muram_alloc(unsigned long size, unsigned long align)
+{
+	unsigned long start;
+	unsigned long flags;
+
+	spin_lock_irqsave(&qe_muram_lock, flags);
+	qe_muram_info.alignment = align;
+	start = rh_alloc(&qe_muram_info, size, "commproc");
+	memset(qe_muram_addr(start), 0, size);
+	spin_unlock_irqrestore(&qe_muram_lock, flags);
+
+	return start;
+}
+EXPORT_SYMBOL(qe_muram_alloc);
+
+/**
+ * qe_muram_free - free a chunk of multi-user ram
+ * @offset: The beginning of the chunk as returned by qe_muram_alloc().
+ */
+int qe_muram_free(unsigned long offset)
+{
+	int ret;
+	unsigned long flags;
+
+	spin_lock_irqsave(&qe_muram_lock, flags);
+	ret = rh_free(&qe_muram_info, offset);
+	spin_unlock_irqrestore(&qe_muram_lock, flags);
+
+	return ret;
+}
+EXPORT_SYMBOL(qe_muram_free);
+
+/**
+ * qe_muram_alloc_fixed - reserve a specific region of multi-user ram
+ * @offset: the offset into the muram area to reserve
+ * @size: the number of bytes to reserve
+ *
+ * This function returns "start" on success, -ENOMEM on failure.
+ * Use qe_dpram_addr() to get the virtual address of the area.
+ * Use qe_muram_free() to free the allocation.
+ */
+unsigned long qe_muram_alloc_fixed(unsigned long offset, unsigned long size)
+{
+	unsigned long start;
+	unsigned long flags;
+
+	spin_lock_irqsave(&qe_muram_lock, flags);
+	qe_muram_info.alignment = 1;
+	start = rh_alloc_fixed(&qe_muram_info, offset, size, "commproc");
+	spin_unlock_irqrestore(&qe_muram_lock, flags);
+
+	return start;
+}
+EXPORT_SYMBOL(qe_muram_alloc_fixed);
+
+/**
+ * qe_muram_addr - turn a muram offset into a virtual address
+ * @offset: muram offset to convert
+ */
+void __iomem *qe_muram_addr(unsigned long offset)
+{
+	return muram_vbase + offset;
+}
+EXPORT_SYMBOL(qe_muram_addr);
+
+unsigned long qe_muram_offset(void __iomem *addr)
+{
+	return addr - (void __iomem *)muram_vbase;
+}
+EXPORT_SYMBOL(qe_muram_offset);
+
+/**
+ * qe_muram_dma - turn a muram virtual address into a DMA address
+ * @offset: virtual address from qe_muram_addr() to convert
+ */
+dma_addr_t qe_muram_dma(void __iomem *addr)
+{
+	return muram_pbase + ((u8 __iomem *)addr - muram_vbase);
+}
+EXPORT_SYMBOL(qe_muram_dma);
diff --git a/include/linux/fsl/qe.h b/include/linux/fsl/qe.h
index 1c9d626..8ac5a8c 100644
--- a/include/linux/fsl/qe.h
+++ b/include/linux/fsl/qe.h
@@ -19,7 +19,8 @@
 #include <linux/spinlock.h>
 #include <linux/errno.h>
 #include <linux/err.h>
-#include <asm/cpm.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/fsl/immap_qe.h>
 
 #define QE_NUM_OF_SNUM	256	/* There are 256 serial number in QE */
@@ -186,13 +187,48 @@ static inline int qe_alive_during_sleep(void)
 #endif
 }
 
-/* we actually use cpm_muram implementation, define this for convenience */
-#define qe_muram_init cpm_muram_init
-#define qe_muram_alloc cpm_muram_alloc
-#define qe_muram_alloc_fixed cpm_muram_alloc_fixed
-#define qe_muram_free cpm_muram_free
-#define qe_muram_addr cpm_muram_addr
-#define qe_muram_offset cpm_muram_offset
+int qe_muram_init(void);
+
+#if defined(CONFIG_QUICC_ENGINE)
+unsigned long qe_muram_alloc(unsigned long size, unsigned long align);
+int qe_muram_free(unsigned long offset);
+unsigned long qe_muram_alloc_fixed(unsigned long offset, unsigned long size);
+void __iomem *qe_muram_addr(unsigned long offset);
+unsigned long qe_muram_offset(void __iomem *addr);
+dma_addr_t qe_muram_dma(void __iomem *addr);
+#else
+static inline unsigned long qe_muram_alloc(unsigned long size,
+					    unsigned long align)
+{
+	return -ENOSYS;
+}
+
+static inline int qe_muram_free(unsigned long offset)
+{
+	return -ENOSYS;
+}
+
+static inline unsigned long qe_muram_alloc_fixed(unsigned long offset,
+						  unsigned long size)
+{
+	return -ENOSYS;
+}
+
+static inline void __iomem *qe_muram_addr(unsigned long offset)
+{
+	return NULL;
+}
+
+static inline unsigned long qe_muram_offset(void __iomem *addr)
+{
+	return -ENOSYS;
+}
+
+static inline dma_addr_t qe_muram_dma(void __iomem *addr)
+{
+	return 0;
+}
+#endif /* defined(CONFIG_QUICC_ENGINE) */
 
 /* Structure that defines QE firmware binary files.
  *
-- 
2.1.0.27.g96db324

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 3/3] rheap: move rheap.c from arch/powerpc/lib/ to lib/
  2014-10-30  7:31 [PATCH v3 1/3] QE: move qe code from arch/powerpc to drivers/soc Zhao Qiang
  2014-10-30  7:31 ` [PATCH v3 2/3] qe_common: add qe common functions into qe_common.c Zhao Qiang
@ 2014-10-30  7:31 ` Zhao Qiang
  2014-10-30 13:25   ` Kumar Gala
  2014-10-30 13:36 ` [PATCH v3 1/3] QE: move qe code from arch/powerpc to drivers/soc Kumar Gala
  2 siblings, 1 reply; 7+ messages in thread
From: Zhao Qiang @ 2014-10-30  7:31 UTC (permalink / raw)
  To: linuxppc-dev, linux-kernel, B07421; +Cc: Zhao Qiang, R63061

qe need to use the rheap, so move it to public directory.

Signed-off-by: Zhao Qiang <B45475@freescale.com>
---
 arch/powerpc/Kconfig                                    | 3 ---
 arch/powerpc/include/asm/fsl_85xx_cache_sram.h          | 2 +-
 arch/powerpc/lib/Makefile                               | 2 --
 arch/powerpc/platforms/44x/Kconfig                      | 2 +-
 arch/powerpc/platforms/85xx/Kconfig                     | 2 +-
 arch/powerpc/platforms/Kconfig                          | 2 +-
 arch/powerpc/platforms/Kconfig.cputype                  | 2 +-
 arch/powerpc/sysdev/cpm1.c                              | 2 +-
 arch/powerpc/sysdev/cpm2.c                              | 2 +-
 arch/powerpc/sysdev/cpm_common.c                        | 2 +-
 arch/powerpc/sysdev/ppc4xx_ocm.c                        | 2 +-
 drivers/dma/bestcomm/Kconfig                            | 2 +-
 drivers/soc/fsl-qe/Kconfig                              | 2 +-
 drivers/soc/fsl-qe/qe.c                                 | 2 +-
 drivers/soc/fsl-qe/qe_common.c                          | 2 +-
 include/linux/fsl/bestcomm/sram.h                       | 2 +-
 {arch/powerpc/include/asm => include/linux/fsl}/rheap.h | 0
 lib/Kconfig                                             | 3 +++
 lib/Makefile                                            | 2 ++
 {arch/powerpc/lib => lib}/rheap.c                       | 2 +-
 20 files changed, 20 insertions(+), 20 deletions(-)
 rename {arch/powerpc/include/asm => include/linux/fsl}/rheap.h (100%)
 rename {arch/powerpc/lib => lib}/rheap.c (99%)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 007b052..d6a31a6 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -1067,7 +1067,4 @@ config KEYS_COMPAT
 
 source "crypto/Kconfig"
 
-config PPC_LIB_RHEAP
-	bool
-
 source "arch/powerpc/kvm/Kconfig"
diff --git a/arch/powerpc/include/asm/fsl_85xx_cache_sram.h b/arch/powerpc/include/asm/fsl_85xx_cache_sram.h
index 2af2bdc..e57888a 100644
--- a/arch/powerpc/include/asm/fsl_85xx_cache_sram.h
+++ b/arch/powerpc/include/asm/fsl_85xx_cache_sram.h
@@ -26,7 +26,7 @@
 #ifndef __ASM_POWERPC_FSL_85XX_CACHE_SRAM_H__
 #define __ASM_POWERPC_FSL_85XX_CACHE_SRAM_H__
 
-#include <asm/rheap.h>
+#include <linux/fsl/rheap.h>
 #include <linux/spinlock.h>
 
 /*
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 59fa2de..c73dff8 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -32,8 +32,6 @@ obj-$(CONFIG_SMP)	+= locks.o
 obj-$(CONFIG_ALTIVEC)	+= vmx-helper.o
 endif
 
-obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
-
 obj-y			+= code-patching.o
 obj-y			+= feature-fixups.o
 obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 4d88f6a..c7994ff 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -282,7 +282,7 @@ config PPC4xx_GPIO
 config PPC4xx_OCM
 	bool "PPC4xx On Chip Memory (OCM) support"
 	depends on 4xx
-	select PPC_LIB_RHEAP
+	select LIB_RHEAP
 	help
 	  Enable OCM support for PowerPC 4xx platforms with on chip memory,
 	  OCM provides the fast place for memory access to improve performance.
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index f22635a..0a7cb9d 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -16,7 +16,7 @@ if PPC32
 
 config FSL_85XX_CACHE_SRAM
 	bool
-	select PPC_LIB_RHEAP
+	select LIB_RHEAP
 	help
 	  When selected, this option enables cache-sram support
 	  for memory allocation on P1/P2 QorIQ platforms.
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index ae8879c..25740c4 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -281,7 +281,7 @@ config CPM2
 	bool "Enable support for the CPM2 (Communications Processor Module)"
 	depends on (FSL_SOC_BOOKE && PPC32) || 8260
 	select CPM
-	select PPC_LIB_RHEAP
+	select LIB_RHEAP
 	select PPC_PCI_CHOICE
 	select ARCH_REQUIRE_GPIOLIB
 	help
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index a41bd02..0bb8c58 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -33,7 +33,7 @@ config PPC_8xx
 	bool "Freescale 8xx"
 	select FSL_SOC
 	select 8xx
-	select PPC_LIB_RHEAP
+	select LIB_RHEAP
 
 config 40x
 	bool "AMCC 40x"
diff --git a/arch/powerpc/sysdev/cpm1.c b/arch/powerpc/sysdev/cpm1.c
index 5e6ff38..c6f5762 100644
--- a/arch/powerpc/sysdev/cpm1.c
+++ b/arch/powerpc/sysdev/cpm1.c
@@ -38,7 +38,7 @@
 #include <asm/cpm1.h>
 #include <asm/io.h>
 #include <asm/tlbflush.h>
-#include <asm/rheap.h>
+#include <linux/fsl/rheap.h>
 #include <asm/prom.h>
 #include <asm/cpm.h>
 
diff --git a/arch/powerpc/sysdev/cpm2.c b/arch/powerpc/sysdev/cpm2.c
index 8dc1e24..5a63d35 100644
--- a/arch/powerpc/sysdev/cpm2.c
+++ b/arch/powerpc/sysdev/cpm2.c
@@ -41,7 +41,7 @@
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/cpm2.h>
-#include <asm/rheap.h>
+#include <linux/fsl/rheap.h>
 #include <asm/fs_pd.h>
 
 #include <sysdev/fsl_soc.h>
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c
index 4f78695..3e06505 100644
--- a/arch/powerpc/sysdev/cpm_common.c
+++ b/arch/powerpc/sysdev/cpm_common.c
@@ -27,7 +27,7 @@
 
 #include <asm/udbg.h>
 #include <asm/io.h>
-#include <asm/rheap.h>
+#include <linux/fsl/rheap.h>
 #include <asm/cpm.h>
 
 #include <mm/mmu_decl.h>
diff --git a/arch/powerpc/sysdev/ppc4xx_ocm.c b/arch/powerpc/sysdev/ppc4xx_ocm.c
index 85d9e37..cfe2e19 100644
--- a/arch/powerpc/sysdev/ppc4xx_ocm.c
+++ b/arch/powerpc/sysdev/ppc4xx_ocm.c
@@ -27,7 +27,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
-#include <asm/rheap.h>
+#include <linux/fsl/rheap.h>
 #include <asm/ppc4xx_ocm.h>
 #include <linux/slab.h>
 #include <linux/debugfs.h>
diff --git a/drivers/dma/bestcomm/Kconfig b/drivers/dma/bestcomm/Kconfig
index 29e4270..9bb1bf8 100644
--- a/drivers/dma/bestcomm/Kconfig
+++ b/drivers/dma/bestcomm/Kconfig
@@ -6,7 +6,7 @@ config PPC_BESTCOMM
 	tristate "Bestcomm DMA engine support"
 	depends on PPC_MPC52xx
 	default n
-	select PPC_LIB_RHEAP
+	select LIB_RHEAP
 	help
 	  BestComm is the name of the communication coprocessor found
 	  on the Freescale MPC5200 family of processor.  Its usage is
diff --git a/drivers/soc/fsl-qe/Kconfig b/drivers/soc/fsl-qe/Kconfig
index 8b03ca2..6241819 100644
--- a/drivers/soc/fsl-qe/Kconfig
+++ b/drivers/soc/fsl-qe/Kconfig
@@ -4,7 +4,7 @@
 config QUICC_ENGINE
 	bool "Freescale QUICC Engine (QE) Support"
 	depends on FSL_SOC && PPC32
-	select PPC_LIB_RHEAP
+	select LIB_RHEAP
 	select CRC32
 	help
 	  The QUICC Engine (QE) is a new generation of communications
diff --git a/drivers/soc/fsl-qe/qe.c b/drivers/soc/fsl-qe/qe.c
index 1c5beef..504bbd6 100644
--- a/drivers/soc/fsl-qe/qe.c
+++ b/drivers/soc/fsl-qe/qe.c
@@ -35,7 +35,7 @@
 #include <linux/fsl/immap_qe.h>
 #include <linux/fsl/qe.h>
 #include <asm/prom.h>
-#include <asm/rheap.h>
+#include <linux/fsl/rheap.h>
 
 static void qe_snums_init(void);
 static int qe_sdma_init(void);
diff --git a/drivers/soc/fsl-qe/qe_common.c b/drivers/soc/fsl-qe/qe_common.c
index c82ddcc..e7fdd02 100644
--- a/drivers/soc/fsl-qe/qe_common.c
+++ b/drivers/soc/fsl-qe/qe_common.c
@@ -26,7 +26,7 @@
 #include <linux/slab.h>
 
 #include <linux/io.h>
-#include <asm/rheap.h>
+#include <linux/fsl/rheap.h>
 #include <linux/fsl/qe.h>
 
 static spinlock_t qe_muram_lock;
diff --git a/include/linux/fsl/bestcomm/sram.h b/include/linux/fsl/bestcomm/sram.h
index b6d6689..117eaa1 100644
--- a/include/linux/fsl/bestcomm/sram.h
+++ b/include/linux/fsl/bestcomm/sram.h
@@ -12,7 +12,7 @@
 #ifndef __BESTCOMM_SRAM_H__
 #define __BESTCOMM_SRAM_H__
 
-#include <asm/rheap.h>
+#include <linux/fsl/rheap.h>
 #include <asm/mmu.h>
 #include <linux/spinlock.h>
 
diff --git a/arch/powerpc/include/asm/rheap.h b/include/linux/fsl/rheap.h
similarity index 100%
rename from arch/powerpc/include/asm/rheap.h
rename to include/linux/fsl/rheap.h
diff --git a/lib/Kconfig b/lib/Kconfig
index 334f772..f5d5e99 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -393,6 +393,9 @@ config CPU_RMAP
 	bool
 	depends on SMP
 
+config LIB_RHEAP
+	bool
+
 config DQL
 	bool
 
diff --git a/lib/Makefile b/lib/Makefile
index ba967a1..dccdef1 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -193,3 +193,5 @@ quiet_cmd_build_OID_registry = GEN     $@
 clean-files	+= oid_registry_data.c
 
 obj-$(CONFIG_UCS2_STRING) += ucs2_string.o
+
+obj-$(CONFIG_LIB_RHEAP) += rheap.o
diff --git a/arch/powerpc/lib/rheap.c b/lib/rheap.c
similarity index 99%
rename from arch/powerpc/lib/rheap.c
rename to lib/rheap.c
index a1060a8..af180fd 100644
--- a/arch/powerpc/lib/rheap.c
+++ b/lib/rheap.c
@@ -20,7 +20,7 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 
-#include <asm/rheap.h>
+#include <linux/fsl/rheap.h>
 
 /*
  * Fixup a list_head, needed when copying lists.  If the pointers fall
-- 
2.1.0.27.g96db324

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 3/3] rheap: move rheap.c from arch/powerpc/lib/ to lib/
  2014-10-30  7:31 ` [PATCH v3 3/3] rheap: move rheap.c from arch/powerpc/lib/ to lib/ Zhao Qiang
@ 2014-10-30 13:25   ` Kumar Gala
  0 siblings, 0 replies; 7+ messages in thread
From: Kumar Gala @ 2014-10-30 13:25 UTC (permalink / raw)
  To: Zhao Qiang; +Cc: B07421, R63061, linuxppc-dev, linux-kernel


On Oct 30, 2014, at 2:31 AM, Zhao Qiang <B45475@freescale.com> wrote:

> qe need to use the rheap, so move it to public directory.
> 
> Signed-off-by: Zhao Qiang <B45475@freescale.com>
> ---
> arch/powerpc/Kconfig                                    | 3 ---
> arch/powerpc/include/asm/fsl_85xx_cache_sram.h          | 2 +-
> arch/powerpc/lib/Makefile                               | 2 --
> arch/powerpc/platforms/44x/Kconfig                      | 2 +-
> arch/powerpc/platforms/85xx/Kconfig                     | 2 +-
> arch/powerpc/platforms/Kconfig                          | 2 +-
> arch/powerpc/platforms/Kconfig.cputype                  | 2 +-
> arch/powerpc/sysdev/cpm1.c                              | 2 +-
> arch/powerpc/sysdev/cpm2.c                              | 2 +-
> arch/powerpc/sysdev/cpm_common.c                        | 2 +-
> arch/powerpc/sysdev/ppc4xx_ocm.c                        | 2 +-
> drivers/dma/bestcomm/Kconfig                            | 2 +-
> drivers/soc/fsl-qe/Kconfig                              | 2 +-
> drivers/soc/fsl-qe/qe.c                                 | 2 +-
> drivers/soc/fsl-qe/qe_common.c                          | 2 +-
> include/linux/fsl/bestcomm/sram.h                       | 2 +-
> {arch/powerpc/include/asm => include/linux/fsl}/rheap.h | 0
> lib/Kconfig                                             | 3 +++
> lib/Makefile                                            | 2 ++
> {arch/powerpc/lib => lib}/rheap.c                       | 2 +-
> 20 files changed, 20 insertions(+), 20 deletions(-)
> rename {arch/powerpc/include/asm => include/linux/fsl}/rheap.h (100%)
> rename {arch/powerpc/lib => lib}/rheap.c (99%)

NAK.  As I stated before you need to convert rheap users to lib/genalloc.c

- k

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 1/3] QE: move qe code from arch/powerpc to drivers/soc
  2014-10-30  7:31 [PATCH v3 1/3] QE: move qe code from arch/powerpc to drivers/soc Zhao Qiang
  2014-10-30  7:31 ` [PATCH v3 2/3] qe_common: add qe common functions into qe_common.c Zhao Qiang
  2014-10-30  7:31 ` [PATCH v3 3/3] rheap: move rheap.c from arch/powerpc/lib/ to lib/ Zhao Qiang
@ 2014-10-30 13:36 ` Kumar Gala
  2014-10-31  7:24   ` qiang.zhao
  2 siblings, 1 reply; 7+ messages in thread
From: Kumar Gala @ 2014-10-30 13:36 UTC (permalink / raw)
  To: Zhao Qiang; +Cc: B07421, R63061, linuxppc-dev, linux-kernel


On Oct 30, 2014, at 2:31 AM, Zhao Qiang <B45475@freescale.com> wrote:

> LS1 is arm cpu and it has qe ip block.
> move qe code from platform directory to public directory.
>=20
> QE is an IP block integrates several comunications peripheral
> controllers. It can implement a variety of applications, such
> as uart, usb and tdm and so on.
>=20
> Signed-off-by: Zhao Qiang <B45475@freescale.com>
> ---
> Changes for v2:
> 	- move code to driver/soc
> Changes for v3:
> 	- change drivers/soc/qe to drivers/soc/fsl-qe
>=20
> arch/powerpc/Kconfig                               |  2 -
> arch/powerpc/platforms/83xx/km83xx.c               |  4 +-
> arch/powerpc/platforms/83xx/misc.c                 |  2 +-
> arch/powerpc/platforms/83xx/mpc832x_mds.c          |  4 +-
> arch/powerpc/platforms/83xx/mpc832x_rdb.c          |  4 +-
> arch/powerpc/platforms/83xx/mpc836x_mds.c          |  4 +-
> arch/powerpc/platforms/83xx/mpc836x_rdk.c          |  4 +-
> arch/powerpc/platforms/85xx/common.c               |  2 +-
> arch/powerpc/platforms/85xx/corenet_generic.c      |  2 +-
> arch/powerpc/platforms/85xx/mpc85xx_mds.c          |  4 +-
> arch/powerpc/platforms/85xx/mpc85xx_rdb.c          |  4 +-
> arch/powerpc/platforms/85xx/twr_p102x.c            |  4 +-
> arch/powerpc/platforms/Kconfig                     | 19 ---------
> arch/powerpc/sysdev/Makefile                       |  1 -
> arch/powerpc/sysdev/qe_lib/Kconfig                 | 27 -------------
> drivers/net/ethernet/freescale/fsl_pq_mdio.c       |  2 +-
> drivers/net/ethernet/freescale/ucc_geth.c          |  8 ++--
> drivers/net/ethernet/freescale/ucc_geth.h          |  8 ++--
> drivers/soc/Kconfig                                |  2 +
> drivers/soc/Makefile                               |  1 +
> drivers/soc/fsl-qe/Kconfig                         | 45 =
++++++++++++++++++++++
> .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/Makefile  |  0
> .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/gpio.c    |  2 +-
> .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe.c      |  4 +-
> .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe_ic.c   |  2 +-
> .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe_ic.h   |  2 +-
> .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe_io.c   |  2 +-
> .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/ucc.c     |  6 +--
> .../qe_lib =3D> drivers/soc/fsl-qe}/ucc_fast.c       |  8 ++--
> .../qe_lib =3D> drivers/soc/fsl-qe}/ucc_slow.c       |  8 ++--
> .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/usb.c     |  4 +-
> drivers/spi/spi-fsl-cpm.c                          |  2 +-
> drivers/tty/serial/ucc_uart.c                      |  2 +-
> drivers/usb/gadget/fsl_qe_udc.c                    |  2 +-
> drivers/usb/host/fhci-hcd.c                        |  2 +-
> drivers/usb/host/fhci-hub.c                        |  2 +-
> drivers/usb/host/fhci-sched.c                      |  2 +-
> drivers/usb/host/fhci.h                            |  4 +-
> .../include/asm =3D> include/linux/fsl}/immap_qe.h   |  0
> .../powerpc/include/asm =3D> include/linux/fsl}/qe.h |  2 +-
> .../include/asm =3D> include/linux/fsl}/qe_ic.h      |  0
> .../include/asm =3D> include/linux/fsl}/ucc.h        |  4 +-
> .../include/asm =3D> include/linux/fsl}/ucc_fast.h   |  6 +--
> .../include/asm =3D> include/linux/fsl}/ucc_slow.h   |  6 +--
> 44 files changed, 112 insertions(+), 113 deletions(-)
> delete mode 100644 arch/powerpc/sysdev/qe_lib/Kconfig
> create mode 100644 drivers/soc/fsl-qe/Kconfig
> rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/Makefile =
(100%)
> rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/gpio.c =
(99%)
> rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe.c (99%)
> rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe_ic.c =
(99%)
> rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe_ic.h =
(98%)
> rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe_io.c =
(99%)
> rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/ucc.c =
(98%)
> rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/ucc_fast.c =
(98%)
> rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/ucc_slow.c =
(98%)
> rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/usb.c =
(96%)
> rename {arch/powerpc/include/asm =3D> include/linux/fsl}/immap_qe.h =
(100%)
> rename {arch/powerpc/include/asm =3D> include/linux/fsl}/qe.h (99%)
> rename {arch/powerpc/include/asm =3D> include/linux/fsl}/qe_ic.h =
(100%)
> rename {arch/powerpc/include/asm =3D> include/linux/fsl}/ucc.h (96%)
> rename {arch/powerpc/include/asm =3D> include/linux/fsl}/ucc_fast.h =
(98%)
> rename {arch/powerpc/include/asm =3D> include/linux/fsl}/ucc_slow.h =
(99%)


So you should be moving things to drivers/soc/fsl/qe/ not =
drivers/soc/fsl-qe/

The headers should be in include/soc/fsl, not include/linux/fsl

In addition before this move is accepted, other changes need to be made =
to convert to using standard frameworks for various functionality in QE =
lib.

1. gpio.c -> needs to be converted to GPIO framework and placed in =
drivers/gpio
2. qe_ic* should probably move into drivers/irqchip
3. qe_io.c should be converted over to pinmux and put in drivers/pinctrl
4. Some of the clock could should be looked to be converted to use the =
clk framework

These changes need to be addressed before any of the qe_lib code can get =
moved into drivers/soc

- k

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH v3 1/3] QE: move qe code from arch/powerpc to drivers/soc
  2014-10-30 13:36 ` [PATCH v3 1/3] QE: move qe code from arch/powerpc to drivers/soc Kumar Gala
@ 2014-10-31  7:24   ` qiang.zhao
  2014-11-04 17:11     ` Kumar Gala
  0 siblings, 1 reply; 7+ messages in thread
From: qiang.zhao @ 2014-10-31  7:24 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Scott Wood, linuxppc-dev, linux-kernel, Xiaobo Xie

On Oct 30, 2014, at 9:37 AM, Kumar Gala wrote:


> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Thursday, October 30, 2014 9:37 PM
> To: Zhao Qiang-B45475
> Cc: linuxppc-dev@lists.ozlabs.org; linux-kernel@vger.kernel.org; Wood
> Scott-B07421; Xie Xiaobo-R63061
> Subject: Re: [PATCH v3 1/3] QE: move qe code from arch/powerpc to
> drivers/soc
>=20
>=20
> On Oct 30, 2014, at 2:31 AM, Zhao Qiang <B45475@freescale.com> wrote:
>=20
> > LS1 is arm cpu and it has qe ip block.
> > move qe code from platform directory to public directory.
> >
> > QE is an IP block integrates several comunications peripheral
> > controllers. It can implement a variety of applications, such as uart,
> > usb and tdm and so on.
> >
> > Signed-off-by: Zhao Qiang <B45475@freescale.com>
> > ---
> > Changes for v2:
> > 	- move code to driver/soc
> > Changes for v3:
> > 	- change drivers/soc/qe to drivers/soc/fsl-qe
> >
> > arch/powerpc/Kconfig                               |  2 -
> > arch/powerpc/platforms/83xx/km83xx.c               |  4 +-
> > arch/powerpc/platforms/83xx/misc.c                 |  2 +-
> > arch/powerpc/platforms/83xx/mpc832x_mds.c          |  4 +-
> > arch/powerpc/platforms/83xx/mpc832x_rdb.c          |  4 +-
> > arch/powerpc/platforms/83xx/mpc836x_mds.c          |  4 +-
> > arch/powerpc/platforms/83xx/mpc836x_rdk.c          |  4 +-
> > arch/powerpc/platforms/85xx/common.c               |  2 +-
> > arch/powerpc/platforms/85xx/corenet_generic.c      |  2 +-
> > arch/powerpc/platforms/85xx/mpc85xx_mds.c          |  4 +-
> > arch/powerpc/platforms/85xx/mpc85xx_rdb.c          |  4 +-
> > arch/powerpc/platforms/85xx/twr_p102x.c            |  4 +-
> > arch/powerpc/platforms/Kconfig                     | 19 ---------
> > arch/powerpc/sysdev/Makefile                       |  1 -
> > arch/powerpc/sysdev/qe_lib/Kconfig                 | 27 -------------
> > drivers/net/ethernet/freescale/fsl_pq_mdio.c       |  2 +-
> > drivers/net/ethernet/freescale/ucc_geth.c          |  8 ++--
> > drivers/net/ethernet/freescale/ucc_geth.h          |  8 ++--
> > drivers/soc/Kconfig                                |  2 +
> > drivers/soc/Makefile                               |  1 +
> > drivers/soc/fsl-qe/Kconfig                         | 45
> ++++++++++++++++++++++
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/Makefile  |  0
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/gpio.c    |  2 +-
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe.c      |  4 +-
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe_ic.c   |  2 +-
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe_ic.h   |  2 +-
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe_io.c   |  2 +-
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/ucc.c     |  6 +--
> > .../qe_lib =3D> drivers/soc/fsl-qe}/ucc_fast.c       |  8 ++--
> > .../qe_lib =3D> drivers/soc/fsl-qe}/ucc_slow.c       |  8 ++--
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/usb.c     |  4 +-
> > drivers/spi/spi-fsl-cpm.c                          |  2 +-
> > drivers/tty/serial/ucc_uart.c                      |  2 +-
> > drivers/usb/gadget/fsl_qe_udc.c                    |  2 +-
> > drivers/usb/host/fhci-hcd.c                        |  2 +-
> > drivers/usb/host/fhci-hub.c                        |  2 +-
> > drivers/usb/host/fhci-sched.c                      |  2 +-
> > drivers/usb/host/fhci.h                            |  4 +-
> > .../include/asm =3D> include/linux/fsl}/immap_qe.h   |  0
> > .../powerpc/include/asm =3D> include/linux/fsl}/qe.h |  2 +-
> > .../include/asm =3D> include/linux/fsl}/qe_ic.h      |  0
> > .../include/asm =3D> include/linux/fsl}/ucc.h        |  4 +-
> > .../include/asm =3D> include/linux/fsl}/ucc_fast.h   |  6 +--
> > .../include/asm =3D> include/linux/fsl}/ucc_slow.h   |  6 +--
> > 44 files changed, 112 insertions(+), 113 deletions(-) delete mode
> > 100644 arch/powerpc/sysdev/qe_lib/Kconfig
> > create mode 100644 drivers/soc/fsl-qe/Kconfig rename
> > {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/Makefile (100%)
> > rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/gpio.c (99%=
)
> > rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe.c (99%)
> > rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe_ic.c
> > (99%) rename {arch/powerpc/sysdev/qe_lib =3D>
> > drivers/soc/fsl-qe}/qe_ic.h (98%) rename {arch/powerpc/sysdev/qe_lib
> > =3D> drivers/soc/fsl-qe}/qe_io.c (99%) rename
> > {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/ucc.c (98%) rename
> > {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/ucc_fast.c (98%)
> > rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/ucc_slow.c
> > (98%) rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/usb.c
> > (96%) rename {arch/powerpc/include/asm =3D>
> > include/linux/fsl}/immap_qe.h (100%) rename {arch/powerpc/include/asm
> > =3D> include/linux/fsl}/qe.h (99%) rename {arch/powerpc/include/asm =3D=
>
> > include/linux/fsl}/qe_ic.h (100%) rename {arch/powerpc/include/asm =3D>
> > include/linux/fsl}/ucc.h (96%) rename {arch/powerpc/include/asm =3D>
> > include/linux/fsl}/ucc_fast.h (98%) rename {arch/powerpc/include/asm
> > =3D> include/linux/fsl}/ucc_slow.h (99%)
>=20
>=20
> So you should be moving things to drivers/soc/fsl/qe/ not
> drivers/soc/fsl-qe/
>=20
> The headers should be in include/soc/fsl, not include/linux/fsl

I don't understand why I need to put headers in include/soc/fsl,
Can you explain more?

>=20
> In addition before this move is accepted, other changes need to be made
> to convert to using standard frameworks for various functionality in QE
> lib.
>=20
> 1. gpio.c -> needs to be converted to GPIO framework and placed in
> drivers/gpio 2. qe_ic* should probably move into drivers/irqchip 3.
> qe_io.c should be converted over to pinmux and put in drivers/pinctrl 4.
> Some of the clock could should be looked to be converted to use the clk
> framework
>=20
> These changes need to be addressed before any of the qe_lib code can get
> moved into drivers/soc
>=20
> - k

Best Regards
Zhao Qiang

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 1/3] QE: move qe code from arch/powerpc to drivers/soc
  2014-10-31  7:24   ` qiang.zhao
@ 2014-11-04 17:11     ` Kumar Gala
  0 siblings, 0 replies; 7+ messages in thread
From: Kumar Gala @ 2014-11-04 17:11 UTC (permalink / raw)
  To: qiang.zhao; +Cc: Scott Wood, linuxppc-dev, linux-kernel, Xiaobo Xie


On Oct 31, 2014, at 2:24 AM, qiang.zhao@freescale.com wrote:

> On Oct 30, 2014, at 9:37 AM, Kumar Gala wrote:
> 
> 
>> -----Original Message-----
>> From: Kumar Gala [mailto:galak@kernel.crashing.org]
>> Sent: Thursday, October 30, 2014 9:37 PM
>> To: Zhao Qiang-B45475
>> Cc: linuxppc-dev@lists.ozlabs.org; linux-kernel@vger.kernel.org; Wood
>> Scott-B07421; Xie Xiaobo-R63061
>> Subject: Re: [PATCH v3 1/3] QE: move qe code from arch/powerpc to
>> drivers/soc
>> 
>> 
>> On Oct 30, 2014, at 2:31 AM, Zhao Qiang <B45475@freescale.com> wrote:
>> 
>>> LS1 is arm cpu and it has qe ip block.
>>> move qe code from platform directory to public directory.
>>> 
>>> QE is an IP block integrates several comunications peripheral
>>> controllers. It can implement a variety of applications, such as uart,
>>> usb and tdm and so on.
>>> 
>>> Signed-off-by: Zhao Qiang <B45475@freescale.com>
>>> ---
>>> Changes for v2:
>>> 	- move code to driver/soc
>>> Changes for v3:
>>> 	- change drivers/soc/qe to drivers/soc/fsl-qe
>>> 
>>> arch/powerpc/Kconfig                               |  2 -
>>> arch/powerpc/platforms/83xx/km83xx.c               |  4 +-
>>> arch/powerpc/platforms/83xx/misc.c                 |  2 +-
>>> arch/powerpc/platforms/83xx/mpc832x_mds.c          |  4 +-
>>> arch/powerpc/platforms/83xx/mpc832x_rdb.c          |  4 +-
>>> arch/powerpc/platforms/83xx/mpc836x_mds.c          |  4 +-
>>> arch/powerpc/platforms/83xx/mpc836x_rdk.c          |  4 +-
>>> arch/powerpc/platforms/85xx/common.c               |  2 +-
>>> arch/powerpc/platforms/85xx/corenet_generic.c      |  2 +-
>>> arch/powerpc/platforms/85xx/mpc85xx_mds.c          |  4 +-
>>> arch/powerpc/platforms/85xx/mpc85xx_rdb.c          |  4 +-
>>> arch/powerpc/platforms/85xx/twr_p102x.c            |  4 +-
>>> arch/powerpc/platforms/Kconfig                     | 19 ---------
>>> arch/powerpc/sysdev/Makefile                       |  1 -
>>> arch/powerpc/sysdev/qe_lib/Kconfig                 | 27 -------------
>>> drivers/net/ethernet/freescale/fsl_pq_mdio.c       |  2 +-
>>> drivers/net/ethernet/freescale/ucc_geth.c          |  8 ++--
>>> drivers/net/ethernet/freescale/ucc_geth.h          |  8 ++--
>>> drivers/soc/Kconfig                                |  2 +
>>> drivers/soc/Makefile                               |  1 +
>>> drivers/soc/fsl-qe/Kconfig                         | 45
>> ++++++++++++++++++++++
>>> .../sysdev/qe_lib => drivers/soc/fsl-qe}/Makefile  |  0
>>> .../sysdev/qe_lib => drivers/soc/fsl-qe}/gpio.c    |  2 +-
>>> .../sysdev/qe_lib => drivers/soc/fsl-qe}/qe.c      |  4 +-
>>> .../sysdev/qe_lib => drivers/soc/fsl-qe}/qe_ic.c   |  2 +-
>>> .../sysdev/qe_lib => drivers/soc/fsl-qe}/qe_ic.h   |  2 +-
>>> .../sysdev/qe_lib => drivers/soc/fsl-qe}/qe_io.c   |  2 +-
>>> .../sysdev/qe_lib => drivers/soc/fsl-qe}/ucc.c     |  6 +--
>>> .../qe_lib => drivers/soc/fsl-qe}/ucc_fast.c       |  8 ++--
>>> .../qe_lib => drivers/soc/fsl-qe}/ucc_slow.c       |  8 ++--
>>> .../sysdev/qe_lib => drivers/soc/fsl-qe}/usb.c     |  4 +-
>>> drivers/spi/spi-fsl-cpm.c                          |  2 +-
>>> drivers/tty/serial/ucc_uart.c                      |  2 +-
>>> drivers/usb/gadget/fsl_qe_udc.c                    |  2 +-
>>> drivers/usb/host/fhci-hcd.c                        |  2 +-
>>> drivers/usb/host/fhci-hub.c                        |  2 +-
>>> drivers/usb/host/fhci-sched.c                      |  2 +-
>>> drivers/usb/host/fhci.h                            |  4 +-
>>> .../include/asm => include/linux/fsl}/immap_qe.h   |  0
>>> .../powerpc/include/asm => include/linux/fsl}/qe.h |  2 +-
>>> .../include/asm => include/linux/fsl}/qe_ic.h      |  0
>>> .../include/asm => include/linux/fsl}/ucc.h        |  4 +-
>>> .../include/asm => include/linux/fsl}/ucc_fast.h   |  6 +--
>>> .../include/asm => include/linux/fsl}/ucc_slow.h   |  6 +--
>>> 44 files changed, 112 insertions(+), 113 deletions(-) delete mode
>>> 100644 arch/powerpc/sysdev/qe_lib/Kconfig
>>> create mode 100644 drivers/soc/fsl-qe/Kconfig rename
>>> {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/Makefile (100%)
>>> rename {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/gpio.c (99%)
>>> rename {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/qe.c (99%)
>>> rename {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/qe_ic.c
>>> (99%) rename {arch/powerpc/sysdev/qe_lib =>
>>> drivers/soc/fsl-qe}/qe_ic.h (98%) rename {arch/powerpc/sysdev/qe_lib
>>> => drivers/soc/fsl-qe}/qe_io.c (99%) rename
>>> {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/ucc.c (98%) rename
>>> {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/ucc_fast.c (98%)
>>> rename {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/ucc_slow.c
>>> (98%) rename {arch/powerpc/sysdev/qe_lib => drivers/soc/fsl-qe}/usb.c
>>> (96%) rename {arch/powerpc/include/asm =>
>>> include/linux/fsl}/immap_qe.h (100%) rename {arch/powerpc/include/asm
>>> => include/linux/fsl}/qe.h (99%) rename {arch/powerpc/include/asm =>
>>> include/linux/fsl}/qe_ic.h (100%) rename {arch/powerpc/include/asm =>
>>> include/linux/fsl}/ucc.h (96%) rename {arch/powerpc/include/asm =>
>>> include/linux/fsl}/ucc_fast.h (98%) rename {arch/powerpc/include/asm
>>> => include/linux/fsl}/ucc_slow.h (99%)
>> 
>> 
>> So you should be moving things to drivers/soc/fsl/qe/ not
>> drivers/soc/fsl-qe/
>> 
>> The headers should be in include/soc/fsl, not include/linux/fsl
> 
> I don't understand why I need to put headers in include/soc/fsl,
> Can you explain more?

Because that is the location of headers associated with drivers/soc

- k

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-11-04 17:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-30  7:31 [PATCH v3 1/3] QE: move qe code from arch/powerpc to drivers/soc Zhao Qiang
2014-10-30  7:31 ` [PATCH v3 2/3] qe_common: add qe common functions into qe_common.c Zhao Qiang
2014-10-30  7:31 ` [PATCH v3 3/3] rheap: move rheap.c from arch/powerpc/lib/ to lib/ Zhao Qiang
2014-10-30 13:25   ` Kumar Gala
2014-10-30 13:36 ` [PATCH v3 1/3] QE: move qe code from arch/powerpc to drivers/soc Kumar Gala
2014-10-31  7:24   ` qiang.zhao
2014-11-04 17:11     ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).