linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/47] QUICC Engine support on ARM and ARM64
@ 2019-11-08 13:00 Rasmus Villemoes
  2019-11-08 13:00 ` [PATCH v4 01/47] soc: fsl: qe: remove space-before-tab Rasmus Villemoes
                   ` (47 more replies)
  0 siblings, 48 replies; 80+ messages in thread
From: Rasmus Villemoes @ 2019-11-08 13:00 UTC (permalink / raw)
  To: Qiang Zhao, Li Yang, Christophe Leroy
  Cc: linuxppc-dev, linux-arm-kernel, linux-kernel, Scott Wood,
	Rasmus Villemoes

There have been several attempts in the past few years to allow
building the QUICC engine drivers for platforms other than PPC. This
is yet another attempt.

v3 can be found here: https://lore.kernel.org/lkml/20191101124210.14510-1-linux@rasmusvillemoes.dk/

v4 adds a some patches to fix (ab)use of IS_ERR_VALUE which fails when
sizeof(u32) != sizeof(long), i.e. on 64-bit platforms. Freescale
drivers are some of the last holdouts using that macro (outside of
arch/ and core mm code), so I decided trying to simply get rid of it
instead of papering over it by using a temporary long to store the
result in. Doing that I stumbled on some other things that should be
fixed. These are the new patches 34-45.

Patch 35 from v3 (which added a PPC32 dependency to FSL_UCC_HDLC) is
gone from this version, so that that driver can indeed now be built
for arm and arm64.

1-5 are about replacing in_be32 etc. in the core QE code (drivers/soc/fsl/qe).

6-8 handle miscellaneous other ppcisms.

9-21 deal with qe_ic: Simplifying the driver significantly by removing
unused code, and removing the platform-specific initialization from
arch/powerpc/.

22-25 deal with raw access to devicetree properties in native endianness.

26-33 makes drivers/tty/serial/ucc_uart.c (CONFIG_SERIAL_QE) ready to build on arm.

34-45 deal with IS_ERR_VALUE() and some other things found while
digging around that part of the code.

46 adds a PPC32 dependency to UCC_GETH - it has some of the same
issues that have been fixed in the ucc_uart and ucc_hdlc cases. Nobody
has requested that I allow that driver to be built for arm{,64}, so
instead of growing this series even bigger, I kept that addition. It's
trivial to remove if somebody cares enough to fix the build
errors/warnings and actually has a platform to test the result on.

Finally patch 47 lifts the PPC32 restriction from QUICC_ENGINE. At the
request of Li Yang, it doesn't remove the PPC32 dependency but instead
changes it to PPC32 || ARM || ARM64 (or COMPILE_TEST), i.e. listing
the platforms that may have a QE.

The series has been built and booted on both an mpc8309-based platform
(ppc) as well as an ls1021a-based platform (arm). The core QE code is
exercised on both, while I could only test the ucc_uart on arm, since
the uarts are not wired up on our mpc8309 board. Qiang Zhao reports
that the ucc_hdlc driver does indeed work on a ls1043ardb (arm64)
board, I hope he'll formally add a Tested-by: to the relevant patches
since I don't have any arm64 board with QE.

Rasmus Villemoes (47):
  soc: fsl: qe: remove space-before-tab
  soc: fsl: qe: drop volatile qualifier of struct qe_ic::regs
  soc: fsl: qe: rename qe_(clr/set/clrset)bit* helpers
  soc: fsl: qe: introduce qe_io{read,write}* wrappers
  soc: fsl: qe: avoid ppc-specific io accessors
  soc: fsl: qe: replace spin_event_timeout by readx_poll_timeout_atomic
  soc: fsl: qe: qe.c: guard use of pvr_version_is() with CONFIG_PPC32
  soc: fsl: qe: drop unneeded #includes
  soc: fsl: qe: drop assign-only high_active in qe_ic_init
  soc: fsl: qe: remove pointless sysfs registration in qe_ic.c
  soc: fsl: qe: use qe_ic_cascade_{low,high}_mpic also on 83xx
  soc: fsl: qe: move calls of qe_ic_init out of arch/powerpc/
  powerpc/83xx: remove mpc83xx_ipic_and_qe_init_IRQ
  powerpc/85xx: remove mostly pointless mpc85xx_qe_init()
  soc: fsl: qe: move qe_ic_cascade_* functions to qe_ic.c
  soc: fsl: qe: rename qe_ic_cascade_low_mpic -> qe_ic_cascade_low
  soc: fsl: qe: remove unused qe_ic_set_* functions
  soc: fsl: qe: don't use NO_IRQ in qe_ic.c
  soc: fsl: qe: make qe_ic_get_{low,high}_irq static
  soc: fsl: qe: simplify qe_ic_init()
  soc: fsl: qe: merge qe_ic.h headers into qe_ic.c
  soc: fsl: qe: qe.c: use of_property_read_* helpers
  soc: fsl: qe: qe_io.c: don't open-code of_parse_phandle()
  soc: fsl: qe: qe_io.c: access device tree property using be32_to_cpu
  soc: fsl: qe: qe_io.c: use of_property_read_u32() in par_io_init()
  soc: fsl: move cpm.h from powerpc/include/asm to include/soc/fsl
  soc/fsl/qe/qe.h: update include path for cpm.h
  serial: ucc_uart: explicitly include soc/fsl/cpm.h
  serial: ucc_uart: replace ppc-specific IO accessors
  serial: ucc_uart: factor out soft_uart initialization
  serial: ucc_uart: stub out soft_uart_init for !CONFIG_PPC32
  serial: ucc_uart: use of_property_read_u32() in ucc_uart_probe()
  serial: ucc_uart: access __be32 field using be32_to_cpu
  soc: fsl: qe: change return type of cpm_muram_alloc() to s32
  soc: fsl: qe: make cpm_muram_free() return void
  soc: fsl: qe: make cpm_muram_free() ignore a negative offset
  soc: fsl: qe: drop broken lazy call of cpm_muram_init()
  soc: fsl: qe: refactor cpm_muram_alloc_common to prevent BUG on error
    path
  soc: fsl: qe: avoid IS_ERR_VALUE in ucc_slow.c
  soc: fsl: qe: drop use of IS_ERR_VALUE in qe_sdma_init()
  soc: fsl: qe: drop pointless check in qe_sdma_init()
  soc: fsl: qe: avoid IS_ERR_VALUE in ucc_fast.c
  net/wan/fsl_ucc_hdlc: avoid use of IS_ERR_VALUE()
  net/wan/fsl_ucc_hdlc: fix reading of __be16 registers
  net/wan/fsl_ucc_hdlc: reject muram offsets above 64K
  net: ethernet: freescale: make UCC_GETH explicitly depend on PPC32
  soc: fsl: qe: remove PPC32 dependency from CONFIG_QUICC_ENGINE

 arch/powerpc/include/asm/cpm.h                | 172 +-------
 arch/powerpc/platforms/83xx/km83xx.c          |   3 +-
 arch/powerpc/platforms/83xx/misc.c            |  23 --
 arch/powerpc/platforms/83xx/mpc832x_mds.c     |   3 +-
 arch/powerpc/platforms/83xx/mpc832x_rdb.c     |   3 +-
 arch/powerpc/platforms/83xx/mpc836x_mds.c     |   3 +-
 arch/powerpc/platforms/83xx/mpc836x_rdk.c     |   3 +-
 arch/powerpc/platforms/83xx/mpc83xx.h         |   7 -
 arch/powerpc/platforms/85xx/common.c          |  23 --
 arch/powerpc/platforms/85xx/corenet_generic.c |  12 -
 arch/powerpc/platforms/85xx/mpc85xx.h         |   2 -
 arch/powerpc/platforms/85xx/mpc85xx_mds.c     |  28 --
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c     |  18 -
 arch/powerpc/platforms/85xx/twr_p102x.c       |  16 -
 drivers/net/ethernet/freescale/Kconfig        |   2 +-
 drivers/net/wan/fsl_ucc_hdlc.c                |  23 +-
 drivers/net/wan/fsl_ucc_hdlc.h                |   2 +-
 drivers/soc/fsl/qe/Kconfig                    |   3 +-
 drivers/soc/fsl/qe/gpio.c                     |  34 +-
 drivers/soc/fsl/qe/qe.c                       | 104 ++---
 drivers/soc/fsl/qe/qe_common.c                |  50 +--
 drivers/soc/fsl/qe/qe_ic.c                    | 285 ++++++-------
 drivers/soc/fsl/qe/qe_ic.h                    |  99 -----
 drivers/soc/fsl/qe/qe_io.c                    |  70 ++--
 drivers/soc/fsl/qe/qe_tdm.c                   |   8 +-
 drivers/soc/fsl/qe/ucc.c                      |  26 +-
 drivers/soc/fsl/qe/ucc_fast.c                 |  86 ++--
 drivers/soc/fsl/qe/ucc_slow.c                 |  60 ++-
 drivers/soc/fsl/qe/usb.c                      |   2 +-
 drivers/tty/serial/ucc_uart.c                 | 383 +++++++++---------
 include/soc/fsl/cpm.h                         | 171 ++++++++
 include/soc/fsl/qe/qe.h                       |  59 ++-
 include/soc/fsl/qe/qe_ic.h                    | 135 ------
 include/soc/fsl/qe/ucc_fast.h                 |   4 +-
 include/soc/fsl/qe/ucc_slow.h                 |   6 +-
 35 files changed, 770 insertions(+), 1158 deletions(-)
 delete mode 100644 drivers/soc/fsl/qe/qe_ic.h
 create mode 100644 include/soc/fsl/cpm.h
 delete mode 100644 include/soc/fsl/qe/qe_ic.h

-- 
2.23.0


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

end of thread, other threads:[~2019-11-20 19:45 UTC | newest]

Thread overview: 80+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-08 13:00 [PATCH v4 00/47] QUICC Engine support on ARM and ARM64 Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 01/47] soc: fsl: qe: remove space-before-tab Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 02/47] soc: fsl: qe: drop volatile qualifier of struct qe_ic::regs Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 03/47] soc: fsl: qe: rename qe_(clr/set/clrset)bit* helpers Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 04/47] soc: fsl: qe: introduce qe_io{read,write}* wrappers Rasmus Villemoes
2019-11-12  5:17   ` Timur Tabi
2019-11-12  7:14     ` Rasmus Villemoes
2019-11-14  5:08       ` Timur Tabi
2019-11-14  8:55         ` Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 05/47] soc: fsl: qe: avoid ppc-specific io accessors Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 06/47] soc: fsl: qe: replace spin_event_timeout by readx_poll_timeout_atomic Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 07/47] soc: fsl: qe: qe.c: guard use of pvr_version_is() with CONFIG_PPC32 Rasmus Villemoes
2019-11-15  4:50   ` Timur Tabi
2019-11-15  8:11     ` Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 08/47] soc: fsl: qe: drop unneeded #includes Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 09/47] soc: fsl: qe: drop assign-only high_active in qe_ic_init Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 10/47] soc: fsl: qe: remove pointless sysfs registration in qe_ic.c Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 11/47] soc: fsl: qe: use qe_ic_cascade_{low,high}_mpic also on 83xx Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 12/47] soc: fsl: qe: move calls of qe_ic_init out of arch/powerpc/ Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 13/47] powerpc/83xx: remove mpc83xx_ipic_and_qe_init_IRQ Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 14/47] powerpc/85xx: remove mostly pointless mpc85xx_qe_init() Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 15/47] soc: fsl: qe: move qe_ic_cascade_* functions to qe_ic.c Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 16/47] soc: fsl: qe: rename qe_ic_cascade_low_mpic -> qe_ic_cascade_low Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 17/47] soc: fsl: qe: remove unused qe_ic_set_* functions Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 18/47] soc: fsl: qe: don't use NO_IRQ in qe_ic.c Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 19/47] soc: fsl: qe: make qe_ic_get_{low,high}_irq static Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 20/47] soc: fsl: qe: simplify qe_ic_init() Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 21/47] soc: fsl: qe: merge qe_ic.h headers into qe_ic.c Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 22/47] soc: fsl: qe: qe.c: use of_property_read_* helpers Rasmus Villemoes
2019-11-08 13:00 ` [PATCH v4 23/47] soc: fsl: qe: qe_io.c: don't open-code of_parse_phandle() Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 24/47] soc: fsl: qe: qe_io.c: access device tree property using be32_to_cpu Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 25/47] soc: fsl: qe: qe_io.c: use of_property_read_u32() in par_io_init() Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 26/47] soc: fsl: move cpm.h from powerpc/include/asm to include/soc/fsl Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 27/47] soc/fsl/qe/qe.h: update include path for cpm.h Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 28/47] serial: ucc_uart: explicitly include soc/fsl/cpm.h Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 29/47] serial: ucc_uart: replace ppc-specific IO accessors Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 30/47] serial: ucc_uart: factor out soft_uart initialization Rasmus Villemoes
2019-11-14  5:14   ` Timur Tabi
2019-11-14  9:00     ` Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 31/47] serial: ucc_uart: stub out soft_uart_init for !CONFIG_PPC32 Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 32/47] serial: ucc_uart: use of_property_read_u32() in ucc_uart_probe() Rasmus Villemoes
2019-11-14 13:57   ` Timur Tabi
2019-11-15  8:01     ` Rasmus Villemoes
2019-11-15 14:35       ` Timur Tabi
2019-11-15 22:44         ` Scott Wood
2019-11-15  4:25   ` Timur Tabi
2019-11-15  7:57     ` Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 33/47] serial: ucc_uart: access __be32 field using be32_to_cpu Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 34/47] soc: fsl: qe: change return type of cpm_muram_alloc() to s32 Rasmus Villemoes
2019-11-12  8:01   ` Qiang Zhao
2019-11-12  8:17     ` Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 35/47] soc: fsl: qe: make cpm_muram_free() return void Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 36/47] soc: fsl: qe: make cpm_muram_free() ignore a negative offset Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 37/47] soc: fsl: qe: drop broken lazy call of cpm_muram_init() Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 38/47] soc: fsl: qe: refactor cpm_muram_alloc_common to prevent BUG on error path Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 39/47] soc: fsl: qe: avoid IS_ERR_VALUE in ucc_slow.c Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 40/47] soc: fsl: qe: drop use of IS_ERR_VALUE in qe_sdma_init() Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 41/47] soc: fsl: qe: drop pointless check " Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 42/47] soc: fsl: qe: avoid IS_ERR_VALUE in ucc_fast.c Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 43/47] net/wan/fsl_ucc_hdlc: avoid use of IS_ERR_VALUE() Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 44/47] net/wan/fsl_ucc_hdlc: fix reading of __be16 registers Rasmus Villemoes
2019-11-08 13:01 ` [PATCH v4 45/47] net/wan/fsl_ucc_hdlc: reject muram offsets above 64K Rasmus Villemoes
2019-11-15  4:41   ` Timur Tabi
2019-11-15  7:44     ` Rasmus Villemoes
2019-11-15 14:33       ` Timur Tabi
2019-11-08 13:01 ` [PATCH v4 46/47] net: ethernet: freescale: make UCC_GETH explicitly depend on PPC32 Rasmus Villemoes
2019-11-15  4:35   ` Timur Tabi
2019-11-15  5:44     ` Li Yang
2019-11-15  7:54       ` Rasmus Villemoes
2019-11-15 14:32         ` Timur Tabi
2019-11-15 14:31       ` Timur Tabi
2019-11-08 13:01 ` [PATCH v4 47/47] soc: fsl: qe: remove PPC32 dependency from CONFIG_QUICC_ENGINE Rasmus Villemoes
2019-11-08 23:48   ` Li Yang
2019-11-11  7:33     ` Rasmus Villemoes
2019-11-11 18:11       ` Li Yang
2019-11-13  2:48   ` Qiang Zhao
2019-11-20 19:42   ` kbuild test robot
2019-11-11 23:39 ` [PATCH v4 00/47] QUICC Engine support on ARM and ARM64 Li Yang
2019-11-12 20:45   ` Li Yang
2019-11-13  7:26     ` Rasmus Villemoes

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).