mbox series

[0/3] arm: Add Analog Devices SC5xx Machine Type

Message ID 20240411234021.14534-1-greg.malysa@timesys.com
Headers show
Series arm: Add Analog Devices SC5xx Machine Type | expand

Message

Greg Malysa April 11, 2024, 11:37 p.m. UTC
This series adds support for the ADI SC5xx machine type and includes two
core drivers that are required for being able to boot any board--a UART
driver and the clock tree driver. Our corresponding Linux support relies
on u-boot configuring the clocks correctly before booting, so it is not
possible to boot any board without the CGU/CDU configuration happening
here. The clock tree itself is only used by the UART in this minimal
patch set, but is of course broadly useful for all other peripheral
drivers to be submitted in future patch sets. There are also no board
files or defconfigs included here, but some common definitions that will
be used to build board files currently are.

Some of the configuration code in dmcinit and clkinit is quite scary and
causes a lot of checkpatch violations. It is modified from code
initially provided by ADI, but it has not been fully rewritten. There's
a question of how important it is to clean up this code--it has some
quality violations, but it has been in use (including in production) for
over two years and is known to work for performing the low level SoC
initialization, while a rewrite might introduce bugs that could take a
significant amount of time to detect in the future.

Please provide any feedback or comments that will be helpful in creating
a v2 of this patch that will be ready to submit for inclusion into the
main tree, as well as general observations that we should consider in
other driver patches before submitting them.

Thank you!


Nathan Barrett-Morrison (3):
  arch: arm: Add Analog Devices SC5xx machine type
  drivers: clk: adi: Add in SC5XX-family clock driver
  drivers: serial: Add in UART for ADI SC5XX-family processors

 MAINTAINERS                                  |  15 +
 arch/arm/Kconfig                             |   6 +
 arch/arm/Makefile                            |   1 +
 arch/arm/include/asm/arch-adi/sc5xx/sc5xx.h  | 115 +++
 arch/arm/include/asm/arch-adi/sc5xx/soc.h    |  18 +
 arch/arm/include/asm/arch-adi/sc5xx/spl.h    |  41 +
 arch/arm/include/asm/mach-types.h            |   4 +
 arch/arm/mach-sc5xx/Kconfig                  | 464 +++++++++
 arch/arm/mach-sc5xx/Makefile                 |  19 +
 arch/arm/mach-sc5xx/config.mk                |  21 +
 arch/arm/mach-sc5xx/init/Makefile            |  11 +
 arch/arm/mach-sc5xx/init/clkinit.c           | 543 +++++++++++
 arch/arm/mach-sc5xx/init/clkinit.h           |  18 +
 arch/arm/mach-sc5xx/init/dmcinit.c           | 973 +++++++++++++++++++
 arch/arm/mach-sc5xx/init/dmcinit.h           |  29 +
 arch/arm/mach-sc5xx/init/init.c              |  68 ++
 arch/arm/mach-sc5xx/init/init.h              |  37 +
 arch/arm/mach-sc5xx/init/mem/is43tr16512bl.h |  63 ++
 arch/arm/mach-sc5xx/init/mem/mt41k128m16jt.h |  51 +
 arch/arm/mach-sc5xx/init/mem/mt41k512m16ha.h |  51 +
 arch/arm/mach-sc5xx/init/mem/mt47h128m16rt.h |  50 +
 arch/arm/mach-sc5xx/rcu.c                    |  22 +
 arch/arm/mach-sc5xx/sc57x.c                  |  21 +
 arch/arm/mach-sc5xx/sc58x.c                  |  21 +
 arch/arm/mach-sc5xx/sc59x.c                  |  32 +
 arch/arm/mach-sc5xx/sc59x_64.c               |  36 +
 arch/arm/mach-sc5xx/soc.c                    | 142 +++
 arch/arm/mach-sc5xx/spl.c                    | 140 +++
 drivers/clk/Kconfig                          |   1 +
 drivers/clk/Makefile                         |   1 +
 drivers/clk/adi/Kconfig                      |  83 ++
 drivers/clk/adi/Makefile                     |  16 +
 drivers/clk/adi/clk-adi-pll.c                |  94 ++
 drivers/clk/adi/clk-adi-sc57x.c              | 205 ++++
 drivers/clk/adi/clk-adi-sc58x.c              | 221 +++++
 drivers/clk/adi/clk-adi-sc594.c              | 230 +++++
 drivers/clk/adi/clk-adi-sc598.c              | 307 ++++++
 drivers/clk/adi/clk-shared.c                 |  48 +
 drivers/clk/adi/clk.h                        | 122 +++
 drivers/serial/Makefile                      |   1 +
 drivers/serial/serial_adi_uart4.c            | 228 +++++
 include/configs/sc_adi_common.h              | 226 +++++
 include/dt-bindings/clock/adi-sc5xx-clock.h  | 271 ++++++
 43 files changed, 5066 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-adi/sc5xx/sc5xx.h
 create mode 100644 arch/arm/include/asm/arch-adi/sc5xx/soc.h
 create mode 100644 arch/arm/include/asm/arch-adi/sc5xx/spl.h
 create mode 100644 arch/arm/mach-sc5xx/Kconfig
 create mode 100644 arch/arm/mach-sc5xx/Makefile
 create mode 100644 arch/arm/mach-sc5xx/config.mk
 create mode 100644 arch/arm/mach-sc5xx/init/Makefile
 create mode 100644 arch/arm/mach-sc5xx/init/clkinit.c
 create mode 100644 arch/arm/mach-sc5xx/init/clkinit.h
 create mode 100644 arch/arm/mach-sc5xx/init/dmcinit.c
 create mode 100644 arch/arm/mach-sc5xx/init/dmcinit.h
 create mode 100644 arch/arm/mach-sc5xx/init/init.c
 create mode 100644 arch/arm/mach-sc5xx/init/init.h
 create mode 100644 arch/arm/mach-sc5xx/init/mem/is43tr16512bl.h
 create mode 100644 arch/arm/mach-sc5xx/init/mem/mt41k128m16jt.h
 create mode 100644 arch/arm/mach-sc5xx/init/mem/mt41k512m16ha.h
 create mode 100644 arch/arm/mach-sc5xx/init/mem/mt47h128m16rt.h
 create mode 100644 arch/arm/mach-sc5xx/rcu.c
 create mode 100644 arch/arm/mach-sc5xx/sc57x.c
 create mode 100644 arch/arm/mach-sc5xx/sc58x.c
 create mode 100644 arch/arm/mach-sc5xx/sc59x.c
 create mode 100644 arch/arm/mach-sc5xx/sc59x_64.c
 create mode 100644 arch/arm/mach-sc5xx/soc.c
 create mode 100644 arch/arm/mach-sc5xx/spl.c
 create mode 100644 drivers/clk/adi/Kconfig
 create mode 100644 drivers/clk/adi/Makefile
 create mode 100644 drivers/clk/adi/clk-adi-pll.c
 create mode 100644 drivers/clk/adi/clk-adi-sc57x.c
 create mode 100644 drivers/clk/adi/clk-adi-sc58x.c
 create mode 100644 drivers/clk/adi/clk-adi-sc594.c
 create mode 100644 drivers/clk/adi/clk-adi-sc598.c
 create mode 100644 drivers/clk/adi/clk-shared.c
 create mode 100644 drivers/clk/adi/clk.h
 create mode 100644 drivers/serial/serial_adi_uart4.c
 create mode 100644 include/configs/sc_adi_common.h
 create mode 100644 include/dt-bindings/clock/adi-sc5xx-clock.h

Comments

Tom Rini April 11, 2024, 11:52 p.m. UTC | #1
On Thu, Apr 11, 2024 at 07:37:27PM -0400, Greg Malysa wrote:
> 
> This series adds support for the ADI SC5xx machine type and includes two
> core drivers that are required for being able to boot any board--a UART
> driver and the clock tree driver. Our corresponding Linux support relies
> on u-boot configuring the clocks correctly before booting, so it is not
> possible to boot any board without the CGU/CDU configuration happening
> here. The clock tree itself is only used by the UART in this minimal
> patch set, but is of course broadly useful for all other peripheral
> drivers to be submitted in future patch sets. There are also no board
> files or defconfigs included here, but some common definitions that will
> be used to build board files currently are.
> 
> Some of the configuration code in dmcinit and clkinit is quite scary and
> causes a lot of checkpatch violations. It is modified from code
> initially provided by ADI, but it has not been fully rewritten. There's
> a question of how important it is to clean up this code--it has some
> quality violations, but it has been in use (including in production) for
> over two years and is known to work for performing the low level SoC
> initialization, while a rewrite might introduce bugs that could take a
> significant amount of time to detect in the future.
> 
> Please provide any feedback or comments that will be helpful in creating
> a v2 of this patch that will be ready to submit for inclusion into the
> main tree, as well as general observations that we should consider in
> other driver patches before submitting them.

Does this series pass CI currently? Thanks.
Greg Malysa April 12, 2024, 12:18 a.m. UTC | #2
I'm afraid I have to admit I don't know. I'll work with our IT team to
make sure we can run CI locally, and when v2 comes around the answer
will be yes.

On Thu, Apr 11, 2024 at 7:52 PM Tom Rini <trini@konsulko.com> wrote:
>
> On Thu, Apr 11, 2024 at 07:37:27PM -0400, Greg Malysa wrote:
> >
> > This series adds support for the ADI SC5xx machine type and includes two
> > core drivers that are required for being able to boot any board--a UART
> > driver and the clock tree driver. Our corresponding Linux support relies
> > on u-boot configuring the clocks correctly before booting, so it is not
> > possible to boot any board without the CGU/CDU configuration happening
> > here. The clock tree itself is only used by the UART in this minimal
> > patch set, but is of course broadly useful for all other peripheral
> > drivers to be submitted in future patch sets. There are also no board
> > files or defconfigs included here, but some common definitions that will
> > be used to build board files currently are.
> >
> > Some of the configuration code in dmcinit and clkinit is quite scary and
> > causes a lot of checkpatch violations. It is modified from code
> > initially provided by ADI, but it has not been fully rewritten. There's
> > a question of how important it is to clean up this code--it has some
> > quality violations, but it has been in use (including in production) for
> > over two years and is known to work for performing the low level SoC
> > initialization, while a rewrite might introduce bugs that could take a
> > significant amount of time to detect in the future.
> >
> > Please provide any feedback or comments that will be helpful in creating
> > a v2 of this patch that will be ready to submit for inclusion into the
> > main tree, as well as general observations that we should consider in
> > other driver patches before submitting them.
>
> Does this series pass CI currently? Thanks.
>
> --
> Tom
Nuno Sá April 12, 2024, 10:34 a.m. UTC | #3
On Thu, 2024-04-11 at 20:18 -0400, Greg Malysa wrote:
> I'm afraid I have to admit I don't know. I'll work with our IT team to
> make sure we can run CI locally, and when v2 comes around the answer
> will be yes.
> 

AFAIR, I think you the only exception to open a PR in the github fork is to run CI.

- Nuno Sá