mbox series

[V3,0/3] ARM: imx: move cpu code to drivers/soc/imx

Message ID 1589953889-30955-1-git-send-email-peng.fan@nxp.com (mailing list archive)
Headers show
Series ARM: imx: move cpu code to drivers/soc/imx | expand

Message

Peng Fan May 20, 2020, 5:51 a.m. UTC
From: Peng Fan <peng.fan@nxp.com>

V3:
 Rebased to latest next tree
 Resolved the conflicts with vf610 soc patch

V2:
 Keep i.MX1/2/3/5 cpu type for completness
 Correct return value in patch 1/3
 use CONFIG_ARM to guard compile soc-imx.c in patch 3/3

V1:
https://patchwork.kernel.org/cover/11433689/
RFC version :
https://patchwork.kernel.org/cover/11336433/

Nothing changed in v1, just rename to formal patches

Shawn,
 The original concern has been eliminated in RFC discussion,
 so this patchset is ready to be in next.
Thanks.

Follow i.MX8, move the soc device register code to drivers/soc/imx
to simplify arch/arm/mach-imx/cpu.c

I planned to use similar logic as soc-imx8m.c to restructure soc-imx.c
and merged the two files into one. But not sure, so still keep
the logic in cpu.c.

There is one change is the platform devices are not under
/sys/devices/soc0 after patch 1/4. Actually ARM64 platform
devices are not under /sys/devices/soc0, such as i.MX8/8M.
So it should not hurt to let the platform devices under platform dir.

Peng Fan (3):
  ARM: imx: use device_initcall for imx_soc_device_init
  ARM: imx: move cpu definitions into a header
  soc: imx: move cpu code to drivers/soc/imx

 arch/arm/mach-imx/common.h       |   1 -
 arch/arm/mach-imx/cpu.c          | 175 -----------------------------------
 arch/arm/mach-imx/mach-imx6q.c   |   8 +-
 arch/arm/mach-imx/mach-imx6sl.c  |   8 +-
 arch/arm/mach-imx/mach-imx6sx.c  |   8 +-
 arch/arm/mach-imx/mach-imx6ul.c  |   8 +-
 arch/arm/mach-imx/mach-imx7d.c   |   6 --
 arch/arm/mach-imx/mach-imx7ulp.c |   2 +-
 arch/arm/mach-imx/mach-vf610.c   |   8 +-
 arch/arm/mach-imx/mxc.h          |  28 +-----
 drivers/soc/imx/Makefile         |   3 +
 drivers/soc/imx/soc-imx.c        | 192 +++++++++++++++++++++++++++++++++++++++
 include/soc/imx/cpu.h            |  36 ++++++++
 13 files changed, 238 insertions(+), 245 deletions(-)
 create mode 100644 drivers/soc/imx/soc-imx.c
 create mode 100644 include/soc/imx/cpu.h

Comments

Shawn Guo May 20, 2020, 3:11 p.m. UTC | #1
On Wed, May 20, 2020 at 01:51:26PM +0800, peng.fan@nxp.com wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> V3:
>  Rebased to latest next tree
>  Resolved the conflicts with vf610 soc patch
> 
> V2:
>  Keep i.MX1/2/3/5 cpu type for completness
>  Correct return value in patch 1/3
>  use CONFIG_ARM to guard compile soc-imx.c in patch 3/3
> 
> V1:
> https://patchwork.kernel.org/cover/11433689/
> RFC version :
> https://patchwork.kernel.org/cover/11336433/
> 
> Nothing changed in v1, just rename to formal patches
> 
> Shawn,
>  The original concern has been eliminated in RFC discussion,
>  so this patchset is ready to be in next.
> Thanks.
> 
> Follow i.MX8, move the soc device register code to drivers/soc/imx
> to simplify arch/arm/mach-imx/cpu.c
> 
> I planned to use similar logic as soc-imx8m.c to restructure soc-imx.c
> and merged the two files into one. But not sure, so still keep
> the logic in cpu.c.
> 
> There is one change is the platform devices are not under
> /sys/devices/soc0 after patch 1/4. Actually ARM64 platform
> devices are not under /sys/devices/soc0, such as i.MX8/8M.
> So it should not hurt to let the platform devices under platform dir.
> 
> Peng Fan (3):
>   ARM: imx: use device_initcall for imx_soc_device_init
>   ARM: imx: move cpu definitions into a header
>   soc: imx: move cpu code to drivers/soc/imx

Applied all, thanks.
Horia Geanta July 3, 2020, 8:53 a.m. UTC | #2
On 5/20/2020 9:01 AM, Peng Fan wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> V3:
>  Rebased to latest next tree
>  Resolved the conflicts with vf610 soc patch
> 
> V2:
>  Keep i.MX1/2/3/5 cpu type for completness
>  Correct return value in patch 1/3
>  use CONFIG_ARM to guard compile soc-imx.c in patch 3/3
> 
> V1:
> https://patchwork.kernel.org/cover/11433689/
> RFC version :
> https://patchwork.kernel.org/cover/11336433/
> 
> Nothing changed in v1, just rename to formal patches
> 
> Shawn,
>  The original concern has been eliminated in RFC discussion,
>  so this patchset is ready to be in next.
> Thanks.
> 
> Follow i.MX8, move the soc device register code to drivers/soc/imx
> to simplify arch/arm/mach-imx/cpu.c
> 
> I planned to use similar logic as soc-imx8m.c to restructure soc-imx.c
> and merged the two files into one. But not sure, so still keep
> the logic in cpu.c.
> 
> There is one change is the platform devices are not under
> /sys/devices/soc0 after patch 1/4. Actually ARM64 platform
> devices are not under /sys/devices/soc0, such as i.MX8/8M.
> So it should not hurt to let the platform devices under platform dir.
> 
> Peng Fan (3):
>   ARM: imx: use device_initcall for imx_soc_device_init
>   ARM: imx: move cpu definitions into a header
>   soc: imx: move cpu code to drivers/soc/imx
> 
This patch series has the side effect of LS1021A platform now reporting
that it's part of "i.MX family".

caam driver relies on the SoC bus / SoC attributes (ID, family) to determine
if it's running on an i.MX SoC or other (Layerscape, QorIQ).

With this patch set, driver fails to probe on LS1021A:
[    5.998928] caam 1700000.crypto: No clock data provided for i.MX SoC
[    6.005306] caam: probe of 1700000.crypto failed with error -22

Horia
Peng Fan July 3, 2020, 12:25 p.m. UTC | #3
> Subject: Re: [PATCH V3 0/3] ARM: imx: move cpu code to drivers/soc/imx
> 
> On 5/20/2020 9:01 AM, Peng Fan wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > V3:
> >  Rebased to latest next tree
> >  Resolved the conflicts with vf610 soc patch
> >
> > V2:
> >  Keep i.MX1/2/3/5 cpu type for completness  Correct return value in
> > patch 1/3  use CONFIG_ARM to guard compile soc-imx.c in patch 3/3
> >
> > V1:
> > https://patchwork.kernel.org/cover/11433689/
> > RFC version :
> > https://patchwork.kernel.org/cover/11336433/
> >
> > Nothing changed in v1, just rename to formal patches
> >
> > Shawn,
> >  The original concern has been eliminated in RFC discussion,  so this
> > patchset is ready to be in next.
> > Thanks.
> >
> > Follow i.MX8, move the soc device register code to drivers/soc/imx to
> > simplify arch/arm/mach-imx/cpu.c
> >
> > I planned to use similar logic as soc-imx8m.c to restructure soc-imx.c
> > and merged the two files into one. But not sure, so still keep the
> > logic in cpu.c.
> >
> > There is one change is the platform devices are not under
> > /sys/devices/soc0 after patch 1/4. Actually ARM64 platform devices are
> > not under /sys/devices/soc0, such as i.MX8/8M.
> > So it should not hurt to let the platform devices under platform dir.
> >
> > Peng Fan (3):
> >   ARM: imx: use device_initcall for imx_soc_device_init
> >   ARM: imx: move cpu definitions into a header
> >   soc: imx: move cpu code to drivers/soc/imx
> >
> This patch series has the side effect of LS1021A platform now reporting that
> it's part of "i.MX family".
> 
> caam driver relies on the SoC bus / SoC attributes (ID, family) to determine if
> it's running on an i.MX SoC or other (Layerscape, QorIQ).

Sorry to break LS1021A. But I wonder why i.MX code would affect LS?

Regards,
Peng.

> 
> With this patch set, driver fails to probe on LS1021A:
> [    5.998928] caam 1700000.crypto: No clock data provided for i.MX SoC
> [    6.005306] caam: probe of 1700000.crypto failed with error -22
> 
> Horia
Horia Geanta July 5, 2020, 9:47 a.m. UTC | #4
On 7/3/2020 3:25 PM, Peng Fan wrote:
> Sorry to break LS1021A. But I wonder why i.MX code would affect LS?
> 
imx_soc_device_init() was modified to be called for all SoCs under ARCH_MXC.
multi_v7_defconfig, which is used for LS1021A, selects ARCH_MXC.

Previously imx_soc_device_init() was called only for i.MX (and Vybrid) SoCs.

Horia