mbox series

[V9,0/7] clk: imx: add imx8qxp clock support

Message ID 1543934041-12572-1-git-send-email-aisheng.dong@nxp.com (mailing list archive)
Headers show
Series clk: imx: add imx8qxp clock support | expand

Message

Aisheng Dong Dec. 4, 2018, 2:39 p.m. UTC
This patch series adds i.MX8QXP clock support which is based
on the clock service provided by SCU firmware.

Note: It depends on SCU driver which has already been merged by Shawn.
So this patch series could go through Shawn's tree as well.

ChangeLog:
v8->v9:
 * add __le32 and __le16 for SCU message structure members as it's little endian
 * use readl_relaxed() as it does not need insert barrier
 * a small code logic improvement suggested by Stephen
v7->v8:
 * add more kernel doc for lpcg and scu clock structures
 * remove one unneccessry reg checking
v6->v7:
 * use struct_size()
 * remove MODULE_ macros
 * add more kernel docs/code comments
 * other small improvements
 * update reviewed-by tags
 * add the missing PATCH 1 in V6
v5->v6:
 * simply the driver a lot by re-orgnizing the driver into a few clock types:
   scu clock (merge scu divider/gate/mux) and scu gpr lock which accessing is
   through SCU protocol and LPCG clock which is directly accessible by CPU.
 * LPCG clock is separate from SCU clock, gpr clock is still not used
   and will be added later.
 * remove old year license as the code is totally rewritten
 * scu mux support will be added later as it's also still not used.
v4->v5:
 Address all Stephen and Sascha's review comments, see details in each patch
v3->v4:
 * scu headfile path update
 * no functionality change
v2->v3:
 * structures/enums name update with imx_sc prefix
 * no functionality change
v1->v2:
 * structure and enums name update
 * api usage update due to api change
 * no functionality change

Dong Aisheng (7):
  clk: imx: add configuration option for mmio clks
  clk: imx: add scu clock common part
  dt-bindings: clock: imx8qxp: add SCU clock IDs
  clk: imx: add imx8qxp clk driver
  dt-bindings: clock: add imx8qxp lpcg clock binding
  clk: imx: add lpcg clock support
  clk: imx: add imx8qxp lpcg driver

 .../devicetree/bindings/clock/imx8qxp-lpcg.txt     |  51 ++++
 arch/arm/mach-imx/Kconfig                          |  11 +
 drivers/clk/Kconfig                                |   1 +
 drivers/clk/imx/Kconfig                            |   9 +
 drivers/clk/imx/Makefile                           |   8 +-
 drivers/clk/imx/clk-imx8qxp-lpcg.c                 | 216 +++++++++++++++
 drivers/clk/imx/clk-imx8qxp-lpcg.h                 | 102 ++++++++
 drivers/clk/imx/clk-imx8qxp.c                      | 153 +++++++++++
 drivers/clk/imx/clk-lpcg-scu.c                     | 114 ++++++++
 drivers/clk/imx/clk-scu.c                          | 265 +++++++++++++++++++
 drivers/clk/imx/clk-scu.h                          |  24 ++
 include/dt-bindings/clock/imx8qxp-clock.h          | 289 +++++++++++++++++++++
 12 files changed, 1242 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/clock/imx8qxp-lpcg.txt
 create mode 100644 drivers/clk/imx/Kconfig
 create mode 100644 drivers/clk/imx/clk-imx8qxp-lpcg.c
 create mode 100644 drivers/clk/imx/clk-imx8qxp-lpcg.h
 create mode 100644 drivers/clk/imx/clk-imx8qxp.c
 create mode 100644 drivers/clk/imx/clk-lpcg-scu.c
 create mode 100644 drivers/clk/imx/clk-scu.c
 create mode 100644 drivers/clk/imx/clk-scu.h
 create mode 100644 include/dt-bindings/clock/imx8qxp-clock.h

Comments

Stephen Boyd Dec. 10, 2018, 8:46 p.m. UTC | #1
Quoting Aisheng DONG (2018-12-04 06:39:18)
> This patch series adds i.MX8QXP clock support which is based
> on the clock service provided by SCU firmware.
> 
> Note: It depends on SCU driver which has already been merged by Shawn.
> So this patch series could go through Shawn's tree as well.

Which patch series?

I'm having trouble applying the first patch, so I suspect something is
wrong.
Aisheng Dong Dec. 11, 2018, 2:04 a.m. UTC | #2
> -----Original Message-----
> From: Stephen Boyd [mailto:sboyd@kernel.org]
> Sent: Tuesday, December 11, 2018 4:47 AM
> To: linux-clk@vger.kernel.org; Aisheng Dong <aisheng.dong@nxp.com>
> Cc: linux-arm-kernel@lists.infradead.org; mturquette@baylibre.com;
> shawnguo@kernel.org; Fabio Estevam <fabio.estevam@nxp.com>; dl-linux-imx
> <linux-imx@nxp.com>; kernel@pengutronix.de; Aisheng Dong
> <aisheng.dong@nxp.com>
> Subject: Re: [PATCH V9 0/7] clk: imx: add imx8qxp clock support
> 
> Quoting Aisheng DONG (2018-12-04 06:39:18)
> > This patch series adds i.MX8QXP clock support which is based on the
> > clock service provided by SCU firmware.
> >
> > Note: It depends on SCU driver which has already been merged by Shawn.
> > So this patch series could go through Shawn's tree as well.
> 
> Which patch series?
> 
> I'm having trouble applying the first patch, so I suspect something is wrong.

Which branch would you like me to make the patch against?
I made the patch against clk-next branch and just re-tested it was ok.

BTW, it depends on the following SCU firmware patch which already in 4.20-RC
In your tree. So it's safe to apply.

commit edbee095fafb4b727b51032bdc41e345f95bbc20
Author: Dong Aisheng <aisheng.dong@nxp.com>
Date:   Sun Oct 7 21:04:42 2018 +0800

    firmware: imx: add SCU firmware driver support

    The System Controller Firmware (SCFW) is a low-level system function
    which runs on a dedicated Cortex-M core to provide power, clock, and
    resource management. It exists on some i.MX8 processors. e.g. i.MX8QM
    (QM, QP), and i.MX8QX (QXP, DX).

    This patch implements the SCU firmware IPC function and the common
    message sending API sc_call_rpc.

    Cc: Shawn Guo <shawnguo@kernel.org>
    Cc: Fabio Estevam <fabio.estevam@nxp.com>
    Cc: Jassi Brar <jassisinghbrar@gmail.com>
    Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
    Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
    Signed-off-by: Shawn Guo <shawnguo@kernel.org>

Regards
Dong Aisheng
Aisheng Dong Dec. 11, 2018, 4:05 a.m. UTC | #3
> -----Original Message-----
> From: Stephen Boyd [mailto:sboyd@kernel.org]
> Quoting Aisheng DONG (2018-12-04 06:39:18)
> > This patch series adds i.MX8QXP clock support which is based on the
> > clock service provided by SCU firmware.
> >
> > Note: It depends on SCU driver which has already been merged by Shawn.
> > So this patch series could go through Shawn's tree as well.
> 
> Which patch series?
> 
> I'm having trouble applying the first patch, so I suspect something is wrong.

As I replied in last mail, patches were made against clk-next branch.
I also tried apply against clk-master branch and met the same failure.

$ git am *.patch
Patch is empty. Was it split wrong?
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ git am --skip
Applying: clk: imx: add configuration option for mmio clks
error: patch failed: drivers/clk/imx/Makefile:1
error: drivers/clk/imx/Makefile: patch does not apply
Patch failed at 0002 clk: imx: add configuration option for mmio clks
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

If manually apply, it can work.
$ patch -p1 < 0001-clk-imx-add-configuration-option-for-mmio-clks.patch
patching file arch/arm/mach-imx/Kconfig
Hunk #7 succeeded at 571 (offset -9 lines).
patching file drivers/clk/Kconfig
patching file drivers/clk/imx/Kconfig
patching file drivers/clk/imx/Makefile
Hunk #1 succeeded at 1 with fuzz 1.

I guess it might because clk-next merged clk-imx7ulp.c and clk-imx8mq.c which
Changed the drivers/clk/imx/Makefile a bit.

If you want me to generate the patch set against clk-master, please let me know.

Regards
Dong Aisheng