mbox series

[RFC,00/10] arm: add support for SoC S5P4418

Message ID 1580758773-5287-1-git-send-email-stefan_b@posteo.net
Headers show
Series arm: add support for SoC S5P4418 | expand

Message

Stefan Bosch Feb. 3, 2020, 7:39 p.m. UTC
This patch adds support for SAMSUNG's/NEXELL's ARM Cortex-A9 based
S5P4418 SoC, especially FriendlyARM's NanoPi2 and NanoPC-T2 boards.
It is based on the following FriendlyARM's U-Boot version:
https://github.com/friendlyarm/u-boot/tree/nanopi2-v2016.01.

The added mach-nexell also supports the S5P6818 SoC which is a
follow-up of the S5P4418.

Main changes in relation to nanopi2-v2016.01:
- Cosmetic changes due to patman warnings/errors.
- MMC and Video drivers changed to DM.
- Configs reworked (e.g. "CONFIG_..." moved from s5p4418_nanopi2.h
  to s5p4418_nanopi2_defconfig)
- SPL related files are not included.
- MACH_TYPE_S5P4418 is not defined/used anymore.
- arch/arm/mach-nexell/include/mach/boot0.h added to generate the NSIH
  (Nexell System Information Header), substitudes tools/nexell.
- board/s5p4418/ renamed to board/friendlyarm/
- Only the NanoPi2 and NanoPC-T2 boards are supported yet because I
  do only have the NanoPC-T2 board to test the code (this board uses
  the NanoPi2 code).


Stefan Bosch (10):
  arm: add mach-nexell (header files)
  arm: add mach-nexell (all files except header files)
  i2c: mmc: add nexell driver (gpio, i2c, mmc, pwm)
  video: add nexell video driver (soc: displaytop)
  video: add nexell video driver (soc: mlc, mipi)
  video: add nexell video driver (soc: lvds, hdmi)
  video: add nexell video driver (soc: dpc, makefile)
  video: add nexell video driver (display/video driver)
  arm: add support for SoC s5p4418 (cpu) / nanopi2 board
  arm: add (default) config for nanopi2 board

 MAINTAINERS                                        |   19 +
 arch/arm/Kconfig                                   |    7 +
 arch/arm/Makefile                                  |    1 +
 arch/arm/cpu/armv7/Makefile                        |    1 +
 arch/arm/cpu/armv7/s5p4418/Makefile                |    6 +
 arch/arm/cpu/armv7/s5p4418/cpu.c                   |  120 ++
 arch/arm/dts/Makefile                              |    3 +
 arch/arm/dts/s5p4418-nanopi2.dts                   |  109 ++
 arch/arm/dts/s5p4418-pinctrl.dtsi                  |   66 +
 arch/arm/dts/s5p4418.dtsi                          |  157 ++
 arch/arm/mach-nexell/Kconfig                       |   67 +
 arch/arm/mach-nexell/Makefile                      |   15 +
 arch/arm/mach-nexell/clock.c                       |  869 +++++++++
 arch/arm/mach-nexell/cmd_boot_linux.c              |  145 ++
 arch/arm/mach-nexell/config.mk                     |   11 +
 arch/arm/mach-nexell/include/mach/boot0.h          |   40 +
 arch/arm/mach-nexell/include/mach/clk.h            |   24 +
 arch/arm/mach-nexell/include/mach/display.h        |  273 +++
 arch/arm/mach-nexell/include/mach/display_dev.h    |   37 +
 arch/arm/mach-nexell/include/mach/ehci.h           |  106 ++
 arch/arm/mach-nexell/include/mach/gpio.h           |   17 +
 arch/arm/mach-nexell/include/mach/mipi_display.h   |  219 +++
 arch/arm/mach-nexell/include/mach/nexell.h         |  352 ++++
 arch/arm/mach-nexell/include/mach/nx_gpio.h        |  103 ++
 arch/arm/mach-nexell/include/mach/reset.h          |   19 +
 arch/arm/mach-nexell/include/mach/sec_reg.h        |   15 +
 arch/arm/mach-nexell/include/mach/tieoff.h         |  423 +++++
 arch/arm/mach-nexell/nx_gpio.c                     |  352 ++++
 arch/arm/mach-nexell/nx_sec_reg.c                  |   82 +
 arch/arm/mach-nexell/reg-call.S                    |   23 +
 arch/arm/mach-nexell/reset.c                       |   33 +
 arch/arm/mach-nexell/serial.c                      |  262 +++
 arch/arm/mach-nexell/tieoff.c                      |  109 ++
 arch/arm/mach-nexell/timer.c                       |  297 ++++
 board/friendlyarm/Kconfig                          |   39 +
 board/friendlyarm/nanopi2/Kconfig                  |   12 +
 board/friendlyarm/nanopi2/MAINTAINERS              |    7 +
 board/friendlyarm/nanopi2/Makefile                 |    6 +
 board/friendlyarm/nanopi2/board.c                  |  581 ++++++
 board/friendlyarm/nanopi2/hwrev.c                  |  122 ++
 board/friendlyarm/nanopi2/hwrev.h                  |   29 +
 board/friendlyarm/nanopi2/lcds.c                   |  703 ++++++++
 board/friendlyarm/nanopi2/nxp-fb.h                 |   99 ++
 board/friendlyarm/nanopi2/onewire.c                |  323 ++++
 board/friendlyarm/nanopi2/onewire.h                |   29 +
 configs/s5p4418_nanopi2_defconfig                  |  177 ++
 doc/README.s5p4418                                 |   63 +
 drivers/gpio/Kconfig                               |    9 +
 drivers/gpio/Makefile                              |    1 +
 drivers/gpio/nx_gpio.c                             |  252 +++
 drivers/i2c/Kconfig                                |    9 +
 drivers/i2c/Makefile                               |    1 +
 drivers/i2c/nx_i2c.c                               |  537 ++++++
 drivers/mmc/Kconfig                                |    6 +
 drivers/mmc/Makefile                               |    1 +
 drivers/mmc/nexell_dw_mmc_dm.c                     |  350 ++++
 drivers/pwm/Makefile                               |    1 +
 drivers/pwm/pwm-nexell.c                           |  252 +++
 drivers/pwm/pwm-nexell.h                           |   54 +
 drivers/video/Kconfig                              |   10 +
 drivers/video/Makefile                             |    1 +
 drivers/video/nexell/Kconfig                       |   27 +
 drivers/video/nexell/Makefile                      |   12 +
 drivers/video/nexell/s5pxx18_dp.c                  |  338 ++++
 drivers/video/nexell/s5pxx18_dp_hdmi.c             |  543 ++++++
 drivers/video/nexell/s5pxx18_dp_lvds.c             |  274 +++
 drivers/video/nexell/s5pxx18_dp_mipi.c             |  677 +++++++
 drivers/video/nexell/s5pxx18_dp_rgb.c              |   69 +
 drivers/video/nexell/soc/Makefile                  |   11 +
 drivers/video/nexell/soc/s5pxx18_soc_disptop.c     |  185 ++
 drivers/video/nexell/soc/s5pxx18_soc_disptop.h     |  385 ++++
 drivers/video/nexell/soc/s5pxx18_soc_disptop_clk.c |  309 ++++
 drivers/video/nexell/soc/s5pxx18_soc_disptop_clk.h |   59 +
 drivers/video/nexell/soc/s5pxx18_soc_disptype.h    |   23 +
 drivers/video/nexell/soc/s5pxx18_soc_dpc.c         | 1569 +++++++++++++++++
 drivers/video/nexell/soc/s5pxx18_soc_dpc.h         |  444 +++++
 drivers/video/nexell/soc/s5pxx18_soc_hdmi.c        |   50 +
 drivers/video/nexell/soc/s5pxx18_soc_hdmi.h        |  488 +++++
 drivers/video/nexell/soc/s5pxx18_soc_lvds.c        |  278 +++
 drivers/video/nexell/soc/s5pxx18_soc_lvds.h        |   83 +
 drivers/video/nexell/soc/s5pxx18_soc_mipi.c        |  580 ++++++
 drivers/video/nexell/soc/s5pxx18_soc_mipi.h        |  291 +++
 drivers/video/nexell/soc/s5pxx18_soc_mlc.c         | 1861 ++++++++++++++++++++
 drivers/video/nexell/soc/s5pxx18_soc_mlc.h         |  429 +++++
 drivers/video/nexell_display.c                     |  658 +++++++
 include/configs/s5p4418_nanopi2.h                  |  270 +++
 86 files changed, 17969 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/s5p4418/Makefile
 create mode 100644 arch/arm/cpu/armv7/s5p4418/cpu.c
 create mode 100644 arch/arm/dts/s5p4418-nanopi2.dts
 create mode 100644 arch/arm/dts/s5p4418-pinctrl.dtsi
 create mode 100644 arch/arm/dts/s5p4418.dtsi
 create mode 100644 arch/arm/mach-nexell/Kconfig
 create mode 100644 arch/arm/mach-nexell/Makefile
 create mode 100644 arch/arm/mach-nexell/clock.c
 create mode 100644 arch/arm/mach-nexell/cmd_boot_linux.c
 create mode 100644 arch/arm/mach-nexell/config.mk
 create mode 100644 arch/arm/mach-nexell/include/mach/boot0.h
 create mode 100644 arch/arm/mach-nexell/include/mach/clk.h
 create mode 100644 arch/arm/mach-nexell/include/mach/display.h
 create mode 100644 arch/arm/mach-nexell/include/mach/display_dev.h
 create mode 100644 arch/arm/mach-nexell/include/mach/ehci.h
 create mode 100644 arch/arm/mach-nexell/include/mach/gpio.h
 create mode 100644 arch/arm/mach-nexell/include/mach/mipi_display.h
 create mode 100644 arch/arm/mach-nexell/include/mach/nexell.h
 create mode 100644 arch/arm/mach-nexell/include/mach/nx_gpio.h
 create mode 100644 arch/arm/mach-nexell/include/mach/reset.h
 create mode 100644 arch/arm/mach-nexell/include/mach/sec_reg.h
 create mode 100644 arch/arm/mach-nexell/include/mach/tieoff.h
 create mode 100644 arch/arm/mach-nexell/nx_gpio.c
 create mode 100644 arch/arm/mach-nexell/nx_sec_reg.c
 create mode 100644 arch/arm/mach-nexell/reg-call.S
 create mode 100644 arch/arm/mach-nexell/reset.c
 create mode 100644 arch/arm/mach-nexell/serial.c
 create mode 100644 arch/arm/mach-nexell/tieoff.c
 create mode 100644 arch/arm/mach-nexell/timer.c
 create mode 100644 board/friendlyarm/Kconfig
 create mode 100644 board/friendlyarm/nanopi2/Kconfig
 create mode 100644 board/friendlyarm/nanopi2/MAINTAINERS
 create mode 100644 board/friendlyarm/nanopi2/Makefile
 create mode 100644 board/friendlyarm/nanopi2/board.c
 create mode 100644 board/friendlyarm/nanopi2/hwrev.c
 create mode 100644 board/friendlyarm/nanopi2/hwrev.h
 create mode 100644 board/friendlyarm/nanopi2/lcds.c
 create mode 100644 board/friendlyarm/nanopi2/nxp-fb.h
 create mode 100644 board/friendlyarm/nanopi2/onewire.c
 create mode 100644 board/friendlyarm/nanopi2/onewire.h
 create mode 100644 configs/s5p4418_nanopi2_defconfig
 create mode 100644 doc/README.s5p4418
 create mode 100644 drivers/gpio/nx_gpio.c
 create mode 100644 drivers/i2c/nx_i2c.c
 create mode 100644 drivers/mmc/nexell_dw_mmc_dm.c
 create mode 100644 drivers/pwm/pwm-nexell.c
 create mode 100644 drivers/pwm/pwm-nexell.h
 create mode 100644 drivers/video/nexell/Kconfig
 create mode 100644 drivers/video/nexell/Makefile
 create mode 100644 drivers/video/nexell/s5pxx18_dp.c
 create mode 100644 drivers/video/nexell/s5pxx18_dp_hdmi.c
 create mode 100644 drivers/video/nexell/s5pxx18_dp_lvds.c
 create mode 100644 drivers/video/nexell/s5pxx18_dp_mipi.c
 create mode 100644 drivers/video/nexell/s5pxx18_dp_rgb.c
 create mode 100644 drivers/video/nexell/soc/Makefile
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_disptop.c
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_disptop.h
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_disptop_clk.c
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_disptop_clk.h
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_disptype.h
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_dpc.c
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_dpc.h
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_hdmi.c
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_hdmi.h
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_lvds.c
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_lvds.h
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_mipi.c
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_mipi.h
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_mlc.c
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_mlc.h
 create mode 100644 drivers/video/nexell_display.c
 create mode 100644 include/configs/s5p4418_nanopi2.h

Comments

Tom Rini Feb. 7, 2020, 4:11 p.m. UTC | #1
On Mon, Feb 03, 2020 at 08:39:22PM +0100, Stefan Bosch wrote:

> This patch adds support for SAMSUNG's/NEXELL's ARM Cortex-A9 based
> S5P4418 SoC, especially FriendlyARM's NanoPi2 and NanoPC-T2 boards.
> It is based on the following FriendlyARM's U-Boot version:
> https://github.com/friendlyarm/u-boot/tree/nanopi2-v2016.01.
> 
> The added mach-nexell also supports the S5P6818 SoC which is a
> follow-up of the S5P4418.
> 
> Main changes in relation to nanopi2-v2016.01:
> - Cosmetic changes due to patman warnings/errors.
> - MMC and Video drivers changed to DM.
> - Configs reworked (e.g. "CONFIG_..." moved from s5p4418_nanopi2.h
>   to s5p4418_nanopi2_defconfig)
> - SPL related files are not included.
> - MACH_TYPE_S5P4418 is not defined/used anymore.
> - arch/arm/mach-nexell/include/mach/boot0.h added to generate the NSIH
>   (Nexell System Information Header), substitudes tools/nexell.
> - board/s5p4418/ renamed to board/friendlyarm/
> - Only the NanoPi2 and NanoPC-T2 boards are supported yet because I
>   do only have the NanoPC-T2 board to test the code (this board uses
>   the NanoPi2 code).
> 
> 
> Stefan Bosch (10):
>   arm: add mach-nexell (header files)
>   arm: add mach-nexell (all files except header files)
>   i2c: mmc: add nexell driver (gpio, i2c, mmc, pwm)
>   video: add nexell video driver (soc: displaytop)
>   video: add nexell video driver (soc: mlc, mipi)
>   video: add nexell video driver (soc: lvds, hdmi)
>   video: add nexell video driver (soc: dpc, makefile)
>   video: add nexell video driver (display/video driver)
>   arm: add support for SoC s5p4418 (cpu) / nanopi2 board
>   arm: add (default) config for nanopi2 board

In general:
- Make sure everything is checkpatch clean (or when not, explainable).
- Don't include unused (by the end of the series at least) code.
- Don't include both SPDX tags and then the whole license boilerplate.
- Do make sure that there's nothing in the config.h file that should be
  in a _defconfig file at this point.

Thanks!
Amit Tomer Feb. 22, 2020, 1:06 p.m. UTC | #2
Hi,

On Tue, Feb 4, 2020 at 1:12 AM Stefan Bosch <stefan_b@posteo.net> wrote:
>
>
> This patch adds support for SAMSUNG's/NEXELL's ARM Cortex-A9 based
> S5P4418 SoC, especially FriendlyARM's NanoPi2 and NanoPC-T2 boards.
> It is based on the following FriendlyARM's U-Boot version:
> https://github.com/friendlyarm/u-boot/tree/nanopi2-v2016.01.
>
I don't think this is the right approach, i.e. to take everything from
BSP source as it is and put
it into mainline U-BOOT. AFAIR,  Some of the peripherals present on
these NEXELL SoC's are
compatible with SAMSUNG IP (for instance the UART).
So, are we sure that some of the already existing code in U-BOOT can't
be re-used to drive those
compatible peripherals at-least ?

Thanks
-Amit
Stefan Bosch Feb. 25, 2020, 7:13 p.m. UTC | #3
Hi Amit,

Am 22.02.20 um 14:06 schrieb Amit Tomer:
> Hi,
> 
> On Tue, Feb 4, 2020 at 1:12 AM Stefan Bosch <stefan_b@posteo.net> wrote:
>>
>>
>> This patch adds support for SAMSUNG's/NEXELL's ARM Cortex-A9 based
>> S5P4418 SoC, especially FriendlyARM's NanoPi2 and NanoPC-T2 boards.
>> It is based on the following FriendlyARM's U-Boot version:
>> https://github.com/friendlyarm/u-boot/tree/nanopi2-v2016.01.
>>
> I don't think this is the right approach, i.e. to take everything from
> BSP source as it is and put
> it into mainline U-BOOT. AFAIR,  Some of the peripherals present on
> these NEXELL SoC's are
> compatible with SAMSUNG IP (for instance the UART).
> So, are we sure that some of the already existing code in U-BOOT can't
> be re-used to drive those
> compatible peripherals at-least ?
> 
> Thanks
> -Amit
> 

You are right, already existing code in U-BOOT should be used where 
possible. So I have reviewed the code (and will review it further). Up 
to now, I have the following proposals for the peripherials indicated:

UART:
Actually the UARTs of the S5P4418 are Amba PrimeCell PL011 compatible, 
therefore the appropriate code is used. S5P6818 does have different 
UARTs which apparently arch/arm/mach-nexell/serial.c is for. Since 
S5P6818 is not supported (yet) I will remove this file.

TIMER:
Currently arch/arm/mach-nexell/timer.c is used. I will try to use 
arch/arm/cpu/armv7/s5p-common/timer.c instead. The timer-registers used 
seem to be the same, but the functions in timer.c are not which is a 
possible pitfall.

PWM:
Currently drivers/pwm/pwm-nexell.c is used. This is a extended version 
of arch/arm/cpu/armv7/s5p-common/pwm.c. I.e. pwm.c is adapted with
"#if defined(CONFIG_ARCH_NEXELL) ... #else" at some places. So my 
proposal is to change s5p-common/pwm.c appropriately to get rid of 
pwm-nexell.c.


Regards
Stefan