Skip to contentSkip to conversation

arm: add support for SoC S5P4418

PATCH New Stefan Bosch 2 participants 29 messages Jul 10, 2020 – Jul 29, 2020

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

v4 cover arm: add support for SoC S5P4418

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.

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).
- USB is not supported yet.
- pinctrl-driver/dt is used for mmc and i2c now instead of configuring the I/O-pins in the drivers.
- '#ifdef CONFIG...' changed to 'if (IS_ENABLED(CONFIG...))' where possible (and similar).
- livetree API (dev_read_...) is used instead of fdt one (fdt...).

The patch-series has been checked by buildman (all arm boards and two m68k boards = M5235EVB):
buildman --step 0 -b master arm
buildman --step 0 -b master M5235EVB
There have been no new warnings or errors.

Changes in v4:
- cosmetic changes in nx_i2c.c: if-else block simplified, defines used for constant values.

Changes in v3:
- arch/arm/mach-nexell/Kconfig: "NEXELL_COMMON" removed, has not been used at all. NEXELL_ARMV7_COMMON and NEXELL_ARMV8_COMMON removed, has been used only in the Kconfig at ARCH_S5P4418 and ARCH_S5P6818. Used "select ..."-statements moved appropriately.
Missing helps added.
- arch/arm/mach-nexell/timer.c: '#include <log.h>' inserted because it has been removed from common.h.
- '#ifdef...' changed to 'if (IS_ENABLED(CONFIG...))' where possible because of appropriate warnings of patman.
- Changed to livetree API as proposed by patman:
fdtdec_get_int() --> dev_read_s32_default()
fdt_getprop() --> dev_read_string()
- pinctrl-driver/dt is used now instead of configuring the i2c I/O-pins in the i2c-driver.
- drivers/i2c/nx_i2c.c: '#include <log.h>' inserted because it has been removed from common.h.
- Changed to livetree API as proposed by patman:
fdtdec_get_int() --> dev_read_s32_default()
- nexell_dw_mmc_dm.c renamed (back) to nexell_dw_mmc.c
- pinctrl-driver/dt is used now instead of configuring the mmc I/O-pins in the mmc-driver.
- nexell_dwmmc_ofdata_to_platdata() reworked, i.e. valid default values are used now (where possible) and the appropriate if-blocks have been removed.
- "nexell," removed from dt-properties, e.g. "nexell,bus-width" changed to "bus-width".
- new dt-property "mmcboost" is used now instead of "CONFIG_BOOST_MMC" which was not defined anywhere.
- Boot error "Loading Environment from MMC... *** Warning - No block device, using default environment" after updating local repository. Bugfix in drivers/mmc/nexell_dw_mmc.c: "#include <clk.h>" changed to "#include <asm/arch/clk.h>". This Bug showed up now because of the commit "dm: clk: add stub when CONFIG_CLK is deactivated" where include/clk.h has been changed.
- drivers/mmc/nexell_dw_mmc.c: '#include <log.h>' inserted because it has been removed from common.h.
- Kconfig: Missing helps added.
- Changed to livetree API as proposed by patman:
fdt_stringlist_count() --> dev_read_string_count() fdt_stringlist_get() --> dev_read_string_index() fdtdec_get_int() --> dev_read_s32_default()
- doc/device-tree-bindings/pinctrl/nexell,s5pxx18-pinctrl.txt added.
- Handling of Configs for LCD backlight control reworked because (among others) not setting CONFIG_S5P4418_ONEWIRE and/or CONFIG_PWM_NX has caused errors when compiling board/friendlyarm/nanopi2/onewire.c.
- pwm.h: () around macro argument x added to avoid precedence issues.
- drivers/video/nexell/s5pxx18_dp_hdmi.c: '#include <log.h>' and '#include <linux/delay.h>' inserted because it has been removed from common.h.
- drivers/video/nexell_display.c: '#include <command.h>' inserted because '#include <image.h>' (includes command.h) has been removed from common.h.
- Changed to livetree API as proposed by patman:
fdtdec_get_int() --> ofnode_read_s32_default()
for (node = ...) --> ofnode_for_each_subnode()
fdt_get_name() --> ofnode_get_name()
fdt_getprop() --> dev_read_string()
- nx_display_probe() removed, nx_display_dev_probe_uclass() renamed to nx_display_probe().
- dts: pinctrl is supported now, therefore s5p4418-pinctrl.dtsi added, mmc- and i2c-entries extended appropriately. New mmc-property "mmcboost" added.
- Handling of Configs for LCD backlight control reworked because (among others) not setting CONFIG_S5P4418_ONEWIRE and/or CONFIG_PWM_NX has caused errors when compiling board/friendlyarm/nanopi2/onewire.c.
- arch/arm/cpu/armv7/s5p4418/cpu.c: '#include <linux/delay.h>' inserted because it has been removed from common.h.
- board/friendlyarm/nanopi2/board.c: Several includes inserted because some includes have been removed from common.h.
- Several initialisations of static variables to 0 removed because of appropriate errors of patman.
- CONFIG_SYS_RESERVE_MEM_SIZE removed, has not been used anymore
- s5p4418_nanopi2_defconfig: "CONFIG_PINCTRL=y" added because pinctrl is supported now. "CONFIG_EFI_LOADER=n" removed (there have been boot errors "efi_runtime_relocate: Unknown relocation type 0" at a previous U-Boot Version without this). "CONFIG_DM_I2C_GPIO=y" removed because I2C-peripherial is used (Nexell I2C driver). Some configs moved down for cosmetic reason.
- Handling of Configs for LCD backlight control reworked because (among others) not setting CONFIG_S5P4418_ONEWIRE and/or CONFIG_PWM_NX has caused errors when compiling board/friendlyarm/nanopi2/onewire.c.
- CONFIG_SYS_MEMTEST_START, CONFIG_SYS_MEMTEST_END, CONFIG_CMDLINE_TAG and CONFIG_CMD_BMP moved from s5p4418_nanopi2.h to s5p4418_nanopi2_defconfig.
- "#undef CONFIG_CMD_IMLS" removed in s5p4418_nanopi2.h

Changes in v2:
- arch/arm/mach-nexell/serial.c removed because this is for the UARTs of the S5P6818 SoC which is not supported yet. S5P4418 UARTs are different, here the (existing) PL011-code is used.
- line '... += spl/' in in arch/arm/mach-nexell/Makefile deleted, this change has already been stated in the commit message but was missing nethertheless.
- commit "i2c: mmc: add nexell driver (gpio, i2c, mmc, pwm)" splitted into separate commits for gpio, i2c, mmc, pwm.
- cosmetic: line "obj-$(CONFIG_NX_GPIO) += nx_gpio.o" in drivers/gpio/Makefile moved up.
- several Bugfixes in nx_i2c.c.
- the i2c-driver has been for s5p6818 only. Code extended approriately in order s5p4418 is also working.
- "probe_chip" added to the i2c-driver.
- doc/device-tree-bindings/i2c/nx_i2c.txt added.
- Since drivers/pwm/pwm-nexell.c is an adapted version of s5p-common/pwm.c an appropriately changed version of s5p-common/pwm.c is used now. Therefore arch/arm/mach-s5pc1xx/include/mach/pwm.h copied to arch/arm/mach-nexell/include/mach and s5p-common/Makefile changed appropriately.
- i2c: "nexell,s5pxx18-i2c"-driver is used now instead of "i2c-gpio". i2c0 and i2c1 added. I.e. dts files changed appropriately.
- dts: gmac-, ehci- and dwc2otg-entries removed because the appropriate functionality is not supported yet.
- s5p4418-pinctrl.dtsi removed because there is no pinctrl-driver available.
- "obj-$(CONFIG_ARCH_NEXELL) += s5p-common/" added to arch/arm/cpu/armv7/Makefile since s5p-common/pwm.c is used now instead of drivers/pwm/pwm-nexell.c.
- cosmetic: additional GPL license text removed, SPDX-License-Identifier is enough. Furthermore file path removed (two files).
- USB related configs removed because USB is not supported yet.
- CONFIG_CMD_MEMTEST moved from s5p4418_nanopi2.h to s5p4418_nanopi2_defconfig.
- MAINTAINERS: "F: drivers/pwm/pwm-nexell*" deleted because arch/arm/cpu/armv7/s5p-common/pwm.c is used now. Furthermore double line "F: drivers/video/nexell/" deleted.

Stefan Bosch (14):
arm: add mach-nexell (header files)
arm: add mach-nexell (all files except header files)
gpio: add nexell driver
i2c: add nexell driver
mmc: add nexell driver
pinctrl: add nexell driver
pwm: add driver for nexell
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                                        |   17 +
 arch/arm/Kconfig                                   |    7 +
 arch/arm/Makefile                                  |    1 +
 arch/arm/cpu/armv7/Makefile                        |    2 +
 arch/arm/cpu/armv7/s5p-common/Makefile             |   13 +-
 arch/arm/cpu/armv7/s5p-common/pwm.c                |   57 +-
 arch/arm/cpu/armv7/s5p4418/Makefile                |    6 +
 arch/arm/cpu/armv7/s5p4418/cpu.c                   |  121 ++
 arch/arm/dts/Makefile                              |    3 +
 arch/arm/dts/s5p4418-nanopi2.dts                   |  110 ++
 arch/arm/dts/s5p4418-pinctrl.dtsi                  |  135 ++
 arch/arm/dts/s5p4418.dtsi                          |  170 ++
 arch/arm/mach-nexell/Kconfig                       |   58 +
 arch/arm/mach-nexell/Makefile                      |   13 +
 arch/arm/mach-nexell/clock.c                       |  869 +++++++++
 arch/arm/mach-nexell/cmd_boot_linux.c              |  144 ++
 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   |  215 +++
 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/pwm.h            |   54 +
 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/tieoff.c                      |  107 ++
 arch/arm/mach-nexell/timer.c                       |  299 ++++
 board/friendlyarm/Kconfig                          |   37 +
 board/friendlyarm/nanopi2/Kconfig                  |   12 +
 board/friendlyarm/nanopi2/MAINTAINERS              |    7 +
 board/friendlyarm/nanopi2/Makefile                 |    7 +
 board/friendlyarm/nanopi2/board.c                  |  575 ++++++
 board/friendlyarm/nanopi2/hwrev.c                  |  108 ++
 board/friendlyarm/nanopi2/hwrev.h                  |   15 +
 board/friendlyarm/nanopi2/lcds.c                   |  697 ++++++++
 board/friendlyarm/nanopi2/nxp-fb.h                 |   94 +
 board/friendlyarm/nanopi2/onewire.c                |  307 ++++
 board/friendlyarm/nanopi2/onewire.h                |   15 +
 configs/s5p4418_nanopi2_defconfig                  |  147 ++
 doc/README.s5p4418                                 |   63 +
 doc/device-tree-bindings/i2c/nx_i2c.txt            |   28 +
 .../pinctrl/nexell,s5pxx18-pinctrl.txt             |   78 +
 drivers/gpio/Kconfig                               |    9 +
 drivers/gpio/Makefile                              |    1 +
 drivers/gpio/nx_gpio.c                             |  250 +++
 drivers/i2c/Kconfig                                |    9 +
 drivers/i2c/Makefile                               |    1 +
 drivers/i2c/nx_i2c.c                               |  626 +++++++
 drivers/mmc/Kconfig                                |    8 +
 drivers/mmc/Makefile                               |    1 +
 drivers/mmc/nexell_dw_mmc.c                        |  237 +++
 drivers/pinctrl/Kconfig                            |    1 +
 drivers/pinctrl/Makefile                           |    1 +
 drivers/pinctrl/nexell/Kconfig                     |   18 +
 drivers/pinctrl/nexell/Makefile                    |    7 +
 drivers/pinctrl/nexell/pinctrl-nexell.c            |   66 +
 drivers/pinctrl/nexell/pinctrl-nexell.h            |   68 +
 drivers/pinctrl/nexell/pinctrl-s5pxx18.c           |  220 +++
 drivers/pinctrl/nexell/pinctrl-s5pxx18.h           |   53 +
 drivers/video/Kconfig                              |   10 +
 drivers/video/Makefile                             |    1 +
 drivers/video/nexell/Kconfig                       |   27 +
 drivers/video/nexell/Makefile                      |   12 +
 drivers/video/nexell/s5pxx18_dp.c                  |  341 ++++
 drivers/video/nexell/s5pxx18_dp_hdmi.c             |  545 ++++++
 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                     |  651 +++++++
 include/configs/s5p4418_nanopi2.h                  |  257 +++
 95 files changed, 17981 insertions(+), 5 deletions(-)
 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/pwm.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/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 doc/device-tree-bindings/i2c/nx_i2c.txt
 create mode 100644 doc/device-tree-bindings/pinctrl/nexell,s5pxx18-pinctrl.txt
 create mode 100644 drivers/gpio/nx_gpio.c
 create mode 100644 drivers/i2c/nx_i2c.c
 create mode 100644 drivers/mmc/nexell_dw_mmc.c
 create mode 100644 drivers/pinctrl/nexell/Kconfig
 create mode 100644 drivers/pinctrl/nexell/Makefile
 create mode 100644 drivers/pinctrl/nexell/pinctrl-nexell.c
 create mode 100644 drivers/pinctrl/nexell/pinctrl-nexell.h
 create mode 100644 drivers/pinctrl/nexell/pinctrl-s5pxx18.c
 create mode 100644 drivers/pinctrl/nexell/pinctrl-s5pxx18.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
Signature · 1 line
1.9.1
#1 lore raw

PATCH v4 1/14 arm: add mach-nexell (header files)

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- DM_VIDEO support (display_dev.h).
- boot0.h added, handles NSIH --> tools/nexell obsolete.
- gpio.h: Include-path to errno.h changed.

---

(no changes since v2)

Changes in v2:
- cosmetic: additional GPL license text removed, SPDX-License-Identifier is enough.

 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 | 215 ++++++++++++
 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 +++++++++++++++++++++++
 12 files changed, 1624 insertions(+)
 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
arch/arm/mach-nexell/include/mach/boot0.h new file +40 -0
new file mode 100644
index 0000000..e05c07e
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0+
+ *
+ * NSIH (Nexell System Information Header) for FriendlyArm nanopi2 board
+ *
+ * The NSIH (first 512 Bytes of u-boot.bin) is necessary for the
+ * 2nd-Bootloader to get information like load address of U-Boot.
+ *
+ * 0x400 must be added to CONFIG_SYS_TEXT_BASE to have the actual load and
+ * start address because 2nd-Bootloader loads with an offset of 0x400
+ * (NSIH + 0x200 bytes are not loaded into RAM).
+ *
+ * It has been tested / is working with the following 2nd-Bootloader:
+ * "BL1 by Nexell V1.0.0-gd551e13 [Built on 2018-01-25 16:58:29]"
+ *
+ * (C) Copyright 2020 Stefan Bosch <[email protected]>
+ */
+
+#ifndef __BOOT0_H
+#define __BOOT0_H
+
+	ARM_VECTORS
+	.space	0x30
+	.word	(_end - _start) + 20 * 1024	/* 0x50: load size
+						 *       (bin + 20k for DTB) */
+	.space	0x4
+	.word	CONFIG_SYS_TEXT_BASE + 0x400	/* 0x58: load address */
+	.word	0x00000000
+	.word	CONFIG_SYS_TEXT_BASE + 0x400	/* 0x60: start address */
+	.space	0x198
+	.byte	'N'				/* 0x1FC: "NSIH" signature */
+	.byte	'S'
+	.byte	'I'
+	.byte	'H'
+
+	/* The NSIH + 0x200 bytes are omitted by the 2nd-Bootloader */
+	.space	0x200
+_start:
+	ARM_VECTORS
+
+#endif /* __BOOT0_H */
arch/arm/mach-nexell/include/mach/clk.h new file +24 -0
new file mode 100644
index 0000000..cc5589a
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0+
+ *
+ * (C) Copyright 2016 Nexell
+ * Hyunseok, Jung <[email protected]>
+ */
+
+#ifndef __ASM_ARM_ARCH_CLK_H_
+#define __ASM_ARM_ARCH_CLK_H_
+
+struct clk {
+	unsigned long rate;
+};
+
+void clk_init(void);
+
+struct clk *clk_get(const char *id);
+void clk_put(struct clk *clk);
+unsigned long clk_get_rate(struct clk *clk);
+long clk_round_rate(struct clk *clk, unsigned long rate);
+int clk_set_rate(struct clk *clk, unsigned long rate);
+int clk_enable(struct clk *clk);
+void clk_disable(struct clk *clk);
+
+#endif
arch/arm/mach-nexell/include/mach/display.h new file +273 -0

273 lines not on this page · raw message

arch/arm/mach-nexell/include/mach/display_dev.h new file +37 -0
new file mode 100644
index 0000000..77eb614
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: GPL-2.0+
+ *
+ * Copyright (C) 2016  Nexell Co., Ltd.
+ *
+ * Author: junghyun, kim <[email protected]>
+ */
+
+#ifndef _NX__DISPLAY_DEV_H_
+#define _NX__DISPLAY_DEV_H_
+
+#if defined CONFIG_VIDEO || defined CONFIG_DM_VIDEO
+#include <video_fb.h>
+#elif defined CONFIG_LCD
+#include <lcd.h>
+#endif
+
+struct nx_display_dev {
+#if defined CONFIG_VIDEO || defined CONFIG_DM_VIDEO
+	GraphicDevice graphic_device;
+#elif defined CONFIG_LCD
+	vidinfo_t *panel_info;
+#endif
+	unsigned long base;
+	int module;
+	struct dp_sync_info sync;
+	struct dp_ctrl_info ctrl;
+	struct dp_plane_top top;
+	struct dp_plane_info planes[DP_PLANS_NUM];
+	int dev_type;
+	void *device;
+	struct dp_plane_info *fb_plane;
+	unsigned int depth;	/* byte per pixel */
+	unsigned int fb_addr;
+	unsigned int fb_size;
+};
+
+#endif
arch/arm/mach-nexell/include/mach/ehci.h new file +106 -0

106 lines not on this page · raw message

arch/arm/mach-nexell/include/mach/gpio.h new file +17 -0
new file mode 100644
index 0000000..7167d3c
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0+
+ *
+ * (C) Copyright 2016 Nexell
+ * DeokJin, Lee <[email protected]>
+ */
+
+#ifndef __ASM_ARCH_NEXELL_GPIO_H
+#define __ASM_ARCH_NEXELL_GPIO_H
+
+#include <asm/io.h>
+#include <linux/errno.h>
+
+#define PIN_BASE		0
+
+#define MAX_GPIO_BANKS		5
+
+#endif /* __ASM_ARCH_NEXELL_GPIO_H */
arch/arm/mach-nexell/include/mach/mipi_display.h new file +215 -0

215 lines not on this page · raw message

arch/arm/mach-nexell/include/mach/nexell.h new file +352 -0

352 lines not on this page · raw message

arch/arm/mach-nexell/include/mach/nx_gpio.h new file +103 -0

103 lines not on this page · raw message

arch/arm/mach-nexell/include/mach/reset.h new file +19 -0
new file mode 100644
index 0000000..e1301d4
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0+
+ *
+ * (C) Copyright 2016 Nexell
+ * Youngbok, Park <[email protected]>
+ */
+
+#ifndef __NEXELL_RESET__
+#define __NEXELL_RESET__
+
+#define NUMBER_OF_RESET_MODULE_PIN      69
+
+enum rstcon {
+	RSTCON_ASSERT	= 0UL,
+	RSTCON_NEGATE	= 1UL
+};
+
+void nx_rstcon_setrst(u32 rstindex, enum rstcon status);
+
+#endif /* __NEXELL_RESET__ */
arch/arm/mach-nexell/include/mach/sec_reg.h new file +15 -0
new file mode 100644
index 0000000..e3ae5ac
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0+
+ *
+ * (C) Copyright 2016 Nexell
+ * Youngbok, Park <[email protected]>
+ */
+
+#define NEXELL_L2C_SEC_ID	0
+#define NEXELL_MALI_SEC_ID	2
+#define NEXELL_MIPI_SEC_ID	4
+#define NEXELL_TOFF_SEC_ID	6
+
+int write_sec_reg_by_id(void __iomem *reg, int val, int id);
+int read_sec_reg_by_id(void __iomem *reg, int id);
+int read_sec_reg(void __iomem *reg);
+int write_sec_reg(void __iomem *reg, int val);
arch/arm/mach-nexell/include/mach/tieoff.h new file +423 -0

423 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

PATCH v4 1/14 arm: add mach-nexell (header files)

Quoted 6 lines · Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- DM_VIDEO support (display_dev.h).
- boot0.h added, handles NSIH --> tools/nexell obsolete.
- gpio.h: Include-path to errno.h changed.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/30c21977/attachment.sig>
#3 lore raw

PATCH v4 2/14 arm: add mach-nexell (all files except header files)

In reply to Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- SPL not supported yet --> no spl-directory in arch/arm/mach-nexell. Appropriate line in Makefile removed.
- clock.c: 'section(".data")' added to declaration of clk_periphs[] and core_hz.
- Kconfig: Changes to have a structure like in mach-bcm283x/Kconfig, e.g. "config ..." entries moved from other Kconfig.
- timer.c: 'section(".data")' added to declaration of timestamp and lastdec.
- arch/arm/mach-nexell/serial.c removed because this is for the UARTs of the S5P6818 SoC which is not supported yet. S5P4418 UARTs are different, here the (existing) PL011-code is used.
- '#ifdef CONFIG...' changed to 'if (IS_ENABLED(CONFIG...))' where possible (and similar).

---

(no changes since v3)

Changes in v3:
- arch/arm/mach-nexell/Kconfig: "NEXELL_COMMON" removed, has not been used at all. NEXELL_ARMV7_COMMON and NEXELL_ARMV8_COMMON removed, has been used only in the Kconfig at ARCH_S5P4418 and ARCH_S5P6818. Used "select ..."-statements moved appropriately. Missing helps added.
- arch/arm/mach-nexell/timer.c: '#include <log.h>' inserted because it has been removed from common.h.
- '#ifdef...' changed to 'if (IS_ENABLED(CONFIG...))' where possible because of appropriate warnings of patman.

Changes in v2:
- arch/arm/mach-nexell/serial.c removed because this is for the UARTs of the S5P6818 SoC which is not supported yet. S5P4418 UARTs are different, here the (existing) PL011-code is used.
- line '... += spl/' in in arch/arm/mach-nexell/Makefile deleted, this change has already been stated in the commit message but was missing nethertheless.

 arch/arm/Kconfig                      |   7 +
 arch/arm/Makefile                     |   1 +
 arch/arm/mach-nexell/Kconfig          |  58 +++
 arch/arm/mach-nexell/Makefile         |  13 +
 arch/arm/mach-nexell/clock.c          | 869 ++++++++++++++++++++++++++++++++++
 arch/arm/mach-nexell/cmd_boot_linux.c | 144 ++++++
 arch/arm/mach-nexell/config.mk        |  11 +
 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/tieoff.c         | 107 +++++
 arch/arm/mach-nexell/timer.c          | 299 ++++++++++++
 13 files changed, 1999 insertions(+)
 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/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/tieoff.c
 create mode 100644 arch/arm/mach-nexell/timer.c
arch/arm/Kconfig +7 -0
index edc9e38..17a0cb5 100644
@@ -901,6 +901,11 @@ config ARCH_MX5
 	select CPU_V7A
 	imply MXC_GPIO
 
+config ARCH_NEXELL
+	bool "Nexell S5P4418/S5P6818 SoC"
+	select ENABLE_ARM_SOC_BOOT0_HOOK
+	select DM
+
 config ARCH_OWL
 	bool "Actions Semi OWL SoCs"
 	select DM
@@ -1858,6 +1863,8 @@ source "arch/arm/cpu/armv8/Kconfig"
 
 source "arch/arm/mach-imx/Kconfig"
 
+source "arch/arm/mach-nexell/Kconfig"
+
 source "board/bosch/shc/Kconfig"
 source "board/bosch/guardian/Kconfig"
 source "board/CarMediaLab/flea3/Kconfig"
arch/arm/Makefile +1 -0
index 94eb50b..b9cc985 100644
@@ -65,6 +65,7 @@ machine-$(CONFIG_ARCH_LPC32XX)		+= lpc32xx
 machine-$(CONFIG_ARCH_MEDIATEK)		+= mediatek
 machine-$(CONFIG_ARCH_MESON)		+= meson
 machine-$(CONFIG_ARCH_MVEBU)		+= mvebu
+machine-$(CONFIG_ARCH_NEXELL)		+= nexell
 machine-$(CONFIG_ARCH_OMAP2PLUS)	+= omap2
 machine-$(CONFIG_ARCH_ORION5X)		+= orion5x
 machine-$(CONFIG_ARCH_OWL)		+= owl
arch/arm/mach-nexell/Kconfig new file +58 -0

58 lines not on this page · raw message

arch/arm/mach-nexell/Makefile new file +13 -0
new file mode 100644
index 0000000..10b3963
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2016 Nexell
+# Hyunseok, Jung <[email protected]>
+
+obj-y				+= clock.o
+obj-y				+= timer.o
+obj-y				+= reset.o
+obj-y				+= nx_gpio.o
+obj-y				+= tieoff.o
+obj-$(CONFIG_ARCH_S5P4418)	+= reg-call.o
+obj-$(CONFIG_ARCH_S5P4418)	+= nx_sec_reg.o
+obj-$(CONFIG_CMD_BOOTL)		+= cmd_boot_linux.o
arch/arm/mach-nexell/clock.c new file +869 -0

869 lines not on this page · raw message

arch/arm/mach-nexell/cmd_boot_linux.c new file +144 -0

144 lines not on this page · raw message

arch/arm/mach-nexell/config.mk new file +11 -0
new file mode 100644
index 0000000..7b06626
@@ -0,0 +1,11 @@
+#
+# (C) Copyright 2016 Nexell
+# junghyun kim<[email protected]>
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+
+SOCDIR=CPUDIR/$(VENDOR)
+MACHDIR=$(patsubst %,arch/arm/mach-%,$(machine-y))
+
+LDPPFLAGS += -DMACHDIR=$(MACHDIR) -DSOCDIR=$(SOCDIR)
arch/arm/mach-nexell/nx_gpio.c new file +352 -0

352 lines not on this page · raw message

arch/arm/mach-nexell/nx_sec_reg.c new file +82 -0

82 lines not on this page · raw message

arch/arm/mach-nexell/reg-call.S new file +23 -0
new file mode 100644
index 0000000..5fdf515
@@ -0,0 +1,23 @@
+#include <asm-offsets.h>
+#include <config.h>
+#include <linux/linkage.h>
+
+#define ___asm_opcode_identity32(x) ((x) & 0xFFFFFFFF)
+#define __opcode_to_mem_arm(x) ___opcode_identity32(x)
+#define ___asm_opcode_to_mem_arm(x) ___asm_opcode_identity32(x)
+
+#define ___opcode_identity32(x) ((u32)(x))
+#define ___inst_arm(x) .long x
+#define __inst_arm(x) ___inst_arm(___asm_opcode_to_mem_arm(x))
+
+#define __inst_arm_thumb32(arm_opcode, thumb_opcode) __inst_arm(arm_opcode)
+
+#define __SMC(imm4) __inst_arm_thumb32(                                 \
+        0xE1600070 | (((imm4) & 0xF) << 0),                             \
+        0xF7F08000 | (((imm4) & 0xF) << 16)                             \
+)
+
+ENTRY(__invoke_nexell_fn_smc)
+	__SMC(0)
+	bx      lr
+ENDPROC(__invoke_nexell_fn_smc)
arch/arm/mach-nexell/reset.c new file +33 -0
new file mode 100644
index 0000000..1f732a3
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2016 Nexell
+ * Youngbok, Park <[email protected]>
+ */
+
+/*
+ *FIXME : Not support device tree & reset control driver.
+ *        will remove after support device tree & reset control driver.
+ */
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/nexell.h>
+#include <asm/arch/reset.h>
+
+struct	nx_rstcon_registerset {
+	u32	regrst[(NUMBER_OF_RESET_MODULE_PIN + 31) >> 5];
+};
+
+static struct nx_rstcon_registerset *nx_rstcon =
+			(struct nx_rstcon_registerset *)PHY_BASEADDR_RSTCON;
+
+void nx_rstcon_setrst(u32 rstindex, enum rstcon status)
+{
+	u32 regnum, bitpos, curstat;
+
+	regnum		= rstindex >> 5;
+	curstat		= (u32)readl(&nx_rstcon->regrst[regnum]);
+	bitpos		= rstindex & 0x1f;
+	curstat		&= ~(1UL << bitpos);
+	curstat		|= (status & 0x01) << bitpos;
+	writel(curstat, &nx_rstcon->regrst[regnum]);
+}
arch/arm/mach-nexell/tieoff.c new file +107 -0

107 lines not on this page · raw message

arch/arm/mach-nexell/timer.c new file +299 -0

299 lines not on this page · raw message

Signature · 1 line
1.9.1
#4 lore raw

PATCH v4 2/14 arm: add mach-nexell (all files except header files)

Quoted 15 lines · Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- SPL not supported yet --> no spl-directory in arch/arm/mach-nexell. Appropriate line in Makefile removed.
- clock.c: 'section(".data")' added to declaration of clk_periphs[] and core_hz.
- Kconfig: Changes to have a structure like in mach-bcm283x/Kconfig, e.g. "config ..." entries moved from other Kconfig.
- timer.c: 'section(".data")' added to declaration of timestamp and lastdec.
- arch/arm/mach-nexell/serial.c removed because this is for the UARTs of the S5P6818 SoC which is not supported yet. S5P4418 UARTs are different, here the (existing) PL011-code is used.
- '#ifdef CONFIG...' changed to 'if (IS_ENABLED(CONFIG...))' where possible (and similar).

Quoted 1 line

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/26f127b6/attachment.sig>
#5 lore raw

PATCH v4 3/14 gpio: add nexell driver

In reply to Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- livetree API (dev_read_...) is used instead of fdt one (fdt...).

---

(no changes since v3)

Changes in v3:
- Changed to livetree API as proposed by patman:
fdtdec_get_int() --> dev_read_s32_default()
fdt_getprop() --> dev_read_string()

Changes in v2:
- commit "i2c: mmc: add nexell driver (gpio, i2c, mmc, pwm)" splitted into separate commits for gpio, i2c, mmc, pwm.
- cosmetic: line "obj-$(CONFIG_NX_GPIO) += nx_gpio.o" in drivers/gpio/Makefile moved up.

 drivers/gpio/Kconfig   |   9 ++
 drivers/gpio/Makefile  |   1 +
 drivers/gpio/nx_gpio.c | 250 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 260 insertions(+)
 create mode 100644 drivers/gpio/nx_gpio.c
drivers/gpio/Kconfig +9 -0
index d87f6cc..921d1e2 100644
@@ -438,4 +438,13 @@ config MT7621_GPIO
 	help
 	  Say yes here to support MediaTek MT7621 compatible GPIOs.
 
+config NX_GPIO
+	bool "Nexell GPIO driver"
+	depends on DM_GPIO
+	help
+	  Support GPIO access on Nexell SoCs. The GPIOs are arranged into
+	  a number of banks (different for each SoC type) each with 32 GPIOs.
+	  The GPIOs for a device are defined in the device tree with one node
+	  for each bank.
+
 endmenu
drivers/gpio/Makefile +1 -0
index 7638259..334c5f2 100644
@@ -64,4 +64,5 @@ obj-$(CONFIG_$(SPL_)PCF8575_GPIO)	+= pcf8575_gpio.o
 obj-$(CONFIG_PM8916_GPIO)	+= pm8916_gpio.o
 obj-$(CONFIG_MT7621_GPIO)	+= mt7621_gpio.o
 obj-$(CONFIG_MSCC_SGPIO)	+= mscc_sgpio.o
+obj-$(CONFIG_NX_GPIO)		+= nx_gpio.o
 obj-$(CONFIG_SIFIVE_GPIO)	+= sifive-gpio.o
drivers/gpio/nx_gpio.c new file +250 -0

250 lines not on this page · raw message

Signature · 1 line
1.9.1
#6 lore raw

PATCH v4 3/14 gpio: add nexell driver

Quoted 4 lines · Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- livetree API (dev_read_...) is used instead of fdt one (fdt...).

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/c758fb36/attachment.sig>
#7 lore raw

PATCH v4 4/14 i2c: add nexell driver

In reply to Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- i2c/nx_i2c.c: Some adaptions mainly because of changes in "struct udevice".
- several Bugfixes in nx_i2c.c.
- the driver has been for s5p6818 only. Code extended appropriately in order s5p4418 is also working.
- "probe_chip" added.
- pinctrl-driver/dt is used instead of configuring the i2c I/O-pins in the i2c-driver.
- '#ifdef CONFIG...' changed to 'if (IS_ENABLED(CONFIG...))' where possible (and similar).
- livetree API (dev_read_...) is used instead of fdt one (fdt...).

---

Changes in v4:
- cosmetic changes in nx_i2c.c: if-else block simplified, defines used for constant values.

Changes in v3:
- pinctrl-driver/dt is used now instead of configuring the i2c I/O-pins in the i2c-driver.
- drivers/i2c/nx_i2c.c: '#include <log.h>' inserted because it has been removed from common.h.
- '#ifdef...' changed to 'if (IS_ENABLED(CONFIG...))' where possible because of appropriate warnings of patman.
- Changed to livetree API as proposed by patman:
fdtdec_get_int() --> dev_read_s32_default()

Changes in v2:
- commit "i2c: mmc: add nexell driver (gpio, i2c, mmc, pwm)" splitted into separate commits for gpio, i2c, mmc, pwm.
- several Bugfixes in nx_i2c.c.
- the i2c-driver has been for s5p6818 only. Code extended approriately in order s5p4418 is also working.
- "probe_chip" added to the i2c-driver.
- doc/device-tree-bindings/i2c/nx_i2c.txt added.

 doc/device-tree-bindings/i2c/nx_i2c.txt |  28 ++
 drivers/i2c/Kconfig                     |   9 +
 drivers/i2c/Makefile                    |   1 +
 drivers/i2c/nx_i2c.c                    | 626 ++++++++++++++++++++++++++++++++
 4 files changed, 664 insertions(+)
 create mode 100644 doc/device-tree-bindings/i2c/nx_i2c.txt
 create mode 100644 drivers/i2c/nx_i2c.c
doc/device-tree-bindings/i2c/nx_i2c.txt new file +28 -0
new file mode 100644
index 0000000..9f3abe7
@@ -0,0 +1,28 @@
+I2C controller embedded in Nexell's/Samsung's SoC S5P4418 and S5P6818
+
+Driver:
+- drivers/i2c/nx_i2c.c
+
+Required properties:
+- #address-cells = <1>;
+- #size-cells = <0>;
+- compatible = "nexell,s5pxx18-i2c";
+- reg = <i2c_base 0x100>;
+        Where i2c_base has to be the base address of the i2c-register set.
+        I2C0: 0xc00a4000
+        I2C1: 0xc00a5000
+        I2C2: 0xc00a6000
+
+Optional properties:
+- clock-frequency: Desired I2C bus frequency in Hz, default value is 100000.
+- i2c-sda-delay-ns (S5P6818 only): SDA delay in ns, default value is 0.
+- Child nodes conforming to i2c bus binding.
+
+Example:
+	i2c0:i2c at c00a4000 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		compatible = "nexell,s5pxx18-i2c";
+		reg = <0xc00a4000 0x100>;
+		clock-frequency = <400000>;
+	};
drivers/i2c/Kconfig +9 -0
index f8b18de..b276f0b 100644
@@ -325,6 +325,15 @@ config SYS_MXC_I2C8_SLAVE
 	 MXC I2C8 Slave
 endif
 
+config SYS_I2C_NEXELL
+	bool "Nexell I2C driver"
+	depends on DM_I2C
+	help
+	  Add support for the Nexell I2C driver. This is used with various
+	  Nexell parts such as S5Pxx18 series SoCs. All chips
+	  have several I2C ports and all are provided, controlled by the
+	  device tree.
+
 config SYS_I2C_OMAP24XX
 	bool "TI OMAP2+ I2C driver"
 	depends on ARCH_OMAP2PLUS || ARCH_K3
drivers/i2c/Makefile +1 -0
index 62935b7..6ebc1aa 100644
@@ -27,6 +27,7 @@ obj-$(CONFIG_SYS_I2C_LPC32XX) += lpc32xx_i2c.o
 obj-$(CONFIG_SYS_I2C_MESON) += meson_i2c.o
 obj-$(CONFIG_SYS_I2C_MVTWSI) += mvtwsi.o
 obj-$(CONFIG_SYS_I2C_MXC) += mxc_i2c.o
+obj-$(CONFIG_SYS_I2C_NEXELL) += nx_i2c.o
 obj-$(CONFIG_SYS_I2C_OMAP24XX) += omap24xx_i2c.o
 obj-$(CONFIG_SYS_I2C_RCAR_I2C) += rcar_i2c.o
 obj-$(CONFIG_SYS_I2C_RCAR_IIC) += rcar_iic.o
drivers/i2c/nx_i2c.c new file +626 -0

626 lines not on this page · raw message

Signature · 1 line
1.9.1
#8 lore raw

PATCH v4 4/14 i2c: add nexell driver

Quoted 13 lines · Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- i2c/nx_i2c.c: Some adaptions mainly because of changes in "struct udevice".
- several Bugfixes in nx_i2c.c.
- the driver has been for s5p6818 only. Code extended appropriately in order s5p4418 is also working.
- "probe_chip" added.
- pinctrl-driver/dt is used instead of configuring the i2c I/O-pins in the i2c-driver.
- '#ifdef CONFIG...' changed to 'if (IS_ENABLED(CONFIG...))' where possible (and similar).
- livetree API (dev_read_...) is used instead of fdt one (fdt...).

Quoted 1 line

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/810fe968/attachment.sig>
#9 lore raw

PATCH v4 5/14 mmc: add nexell driver

In reply to Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- driver changed to DM.
- pinctrl-driver/dt is used now instead of configuring the mmc I/O-pins in the mmc-driver.
- nexell_dwmmc_ofdata_to_platdata() reworked, i.e. valid default values are used now (where possible) and the appropriate if-blocks have been removed.
- new dt-property "mmcboost" is used now instead of "CONFIG_BOOST_MMC" which was not defined anywhere.

---

(no changes since v3)

Changes in v3:
- nexell_dw_mmc_dm.c renamed (back) to nexell_dw_mmc.c
- pinctrl-driver/dt is used now instead of configuring the mmc I/O-pins in the mmc-driver.
- nexell_dwmmc_ofdata_to_platdata() reworked, i.e. valid default values are used now (where possible) and the appropriate if-blocks have been removed.
- "nexell," removed from dt-properties, e.g. "nexell,bus-width" changed to "bus-width".
- new dt-property "mmcboost" is used now instead of "CONFIG_BOOST_MMC" which was not defined anywhere.
- Boot error "Loading Environment from MMC... *** Warning - No block device, using default environment" after updating local repository. Bugfix in drivers/mmc/nexell_dw_mmc.c: "#include <clk.h>" changed to "#include <asm/arch/clk.h>". This Bug showed up now because of the commit "dm: clk: add stub when CONFIG_CLK is deactivated" where include/clk.h has been changed.
- drivers/mmc/nexell_dw_mmc.c: '#include <log.h>' inserted because it has been removed from common.h.

Changes in v2:
- commit "i2c: mmc: add nexell driver (gpio, i2c, mmc, pwm)" splitted into separate commits for gpio, i2c, mmc, pwm.

 drivers/mmc/Kconfig         |   8 ++
 drivers/mmc/Makefile        |   1 +
 drivers/mmc/nexell_dw_mmc.c | 237 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 246 insertions(+)
 create mode 100644 drivers/mmc/nexell_dw_mmc.c
drivers/mmc/Kconfig +8 -0
index 3c4f057..5fc47c8 100644
@@ -264,6 +264,14 @@ config MMC_DW_SNPS
 	  This selects support for Synopsys DesignWare Memory Card Interface driver
 	  extensions used in various Synopsys ARC devboards.
 
+config NEXELL_DWMMC
+	bool "Nexell SD/MMC controller support"
+	depends on ARCH_NEXELL
+	depends on MMC_DW
+	depends on DM_MMC
+	depends on PINCTRL_NEXELL
+	default y
+
 config MMC_MESON_GX
 	bool "Meson GX EMMC controller support"
 	depends on DM_MMC && BLK && ARCH_MESON
drivers/mmc/Makefile +1 -0
index e84c792..d375669 100644
@@ -44,6 +44,7 @@ obj-$(CONFIG_SH_MMCIF) += sh_mmcif.o
 obj-$(CONFIG_SH_SDHI) += sh_sdhi.o
 obj-$(CONFIG_STM32_SDMMC2) += stm32_sdmmc2.o
 obj-$(CONFIG_JZ47XX_MMC) += jz_mmc.o
+obj-$(CONFIG_NEXELL_DWMMC) += nexell_dw_mmc.o
 
 # SDHCI
 obj-$(CONFIG_MMC_SDHCI)			+= sdhci.o
drivers/mmc/nexell_dw_mmc.c new file +237 -0

237 lines not on this page · raw message

Signature · 1 line
1.9.1
#10 lore raw

PATCH v4 5/14 mmc: add nexell driver

Quoted 11 lines · Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- driver changed to DM.
- pinctrl-driver/dt is used now instead of configuring the mmc I/O-pins in the mmc-driver.
- nexell_dwmmc_ofdata_to_platdata() reworked, i.e. valid default values are used now (where possible) and the appropriate if-blocks have been removed.
- new dt-property "mmcboost" is used now instead of "CONFIG_BOOST_MMC" which was not defined anywhere.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/1b03a8d6/attachment.sig>
#11 lore raw

PATCH v4 6/14 pinctrl: add nexell driver

In reply to Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- livetree API (dev_read_...) is used instead of fdt one (fdt...).
- doc/device-tree-bindings/pinctrl/nexell,s5pxx18-pinctrl.txt added.

---

(no changes since v3)

Changes in v3:
- Kconfig: Missing helps added.
- Changed to livetree API as proposed by patman:
fdt_stringlist_count() --> dev_read_string_count() fdt_stringlist_get() --> dev_read_string_index() fdtdec_get_int() --> dev_read_s32_default()
- doc/device-tree-bindings/pinctrl/nexell,s5pxx18-pinctrl.txt added.

 .../pinctrl/nexell,s5pxx18-pinctrl.txt             |  78 ++++++++
 drivers/pinctrl/Kconfig                            |   1 +
 drivers/pinctrl/Makefile                           |   1 +
 drivers/pinctrl/nexell/Kconfig                     |  18 ++
 drivers/pinctrl/nexell/Makefile                    |   7 +
 drivers/pinctrl/nexell/pinctrl-nexell.c            |  66 +++++++
 drivers/pinctrl/nexell/pinctrl-nexell.h            |  68 +++++++
 drivers/pinctrl/nexell/pinctrl-s5pxx18.c           | 220 +++++++++++++++++++++
 drivers/pinctrl/nexell/pinctrl-s5pxx18.h           |  53 +++++
 9 files changed, 512 insertions(+)
 create mode 100644 doc/device-tree-bindings/pinctrl/nexell,s5pxx18-pinctrl.txt
 create mode 100644 drivers/pinctrl/nexell/Kconfig
 create mode 100644 drivers/pinctrl/nexell/Makefile
 create mode 100644 drivers/pinctrl/nexell/pinctrl-nexell.c
 create mode 100644 drivers/pinctrl/nexell/pinctrl-nexell.h
 create mode 100644 drivers/pinctrl/nexell/pinctrl-s5pxx18.c
 create mode 100644 drivers/pinctrl/nexell/pinctrl-s5pxx18.h
doc/device-tree-bindings/pinctrl/nexell,s5pxx18-pinctrl.txt new file +78 -0
new file mode 100644
index 0000000..115ab53
@@ -0,0 +1,78 @@
+Binding for Nexell s5pxx18 pin cotroller
+========================================
+
+Nexell's ARM bases SoC's integrates a GPIO and Pin mux/config hardware
+controller. It controls the input/output settings on the available pads/pins
+and also provides ability to multiplex and configure the output of various
+on-chip controllers onto these pads.
+
+Please refer to pinctrl-bindings.txt in this directory for details of the
+common pinctrl bindings used by client devices, including the meaning of the
+phrase "pin configuration node".
+
+
+Required properties:
+  - compatible: "nexell,s5pxx18-pinctrl"
+  - reg: should be register base and length as documented in the datasheet
+  - interrupts: interrupt specifier for the controller over gpio and alive pins
+
+Example:
+pinctrl_0: pinctrl at c0010000 {
+	compatible = "nexell,s5pxx18-pinctrl";
+		reg = <0xc0010000 0xf000>;
+		u-boot,dm-pre-reloc;
+};
+
+Nexell's pin configuration nodes act as a container for an arbitrary number of
+subnodes. Each of these subnodes represents some desired configuration for a
+pin, a group, or a list of pins or groups. This configuration can include the
+mux function to select on those pin(s)/group(s), and various pin configuration
+parameters.
+
+  Child nodes must be set at least one of the following settings:
+  - pins = Select pins for using this function.
+  - pin-function = Select the function for use in a selected pin.
+  - pin-pull = Pull up/down configuration.
+  - pin-strength = Drive strength configuration.
+
+  Valid values for nexell,pins are:
+     "gpioX-N" : X in {A,B,C,D,E}, N in {0-31}
+  Valid values for nexell,pin-function are:
+     "N"       : N in {0-3}.
+                 This setting means that the value is different for each pin.
+                 Please refer to datasheet.
+  Valid values for nexell,pin-pull are:
+     "N"       : 0 - Down, 1 - Up, 2 - Off
+  Valid values for nexell,pin-strength are:
+     "N"       : 0,1,2,3
+
+
+Example:
+  - pin settings
+	mmc0_clk: mmc0-clk {
+		pins = "gpioa-29";
+		pin-function = <1>;
+		pin-pull = <2>;
+		pin-strength = <2>;
+	};
+
+	mmc0_cmd: mmc0-cmd {
+		pins = "gpioa-31";
+		pin-function = <1>;
+		pin-pull = <2>;
+		pin-strength = <1>;
+	};
+
+	mmc0_bus4: mmc0-bus-width4 {
+		pins = "gpiob-1, gpiob-3, gpiob-5, gpiob-7";
+		pin-function = <1>;
+		pin-pull = <2>;
+		pin-strength = <1>;
+	};
+
+  - used by client devices
+	mmc0:mmc at ... {
+		pinctrl-names = "default";
+		pinctrl-0 = <&mmc0_clk>, <&mmc0_cmd>, <&mmc0_bus4>;
+		...
+	};
drivers/pinctrl/Kconfig +1 -0
index 83e39b9..bd2061b 100644
@@ -294,6 +294,7 @@ source "drivers/pinctrl/meson/Kconfig"
 source "drivers/pinctrl/mscc/Kconfig"
 source "drivers/pinctrl/mtmips/Kconfig"
 source "drivers/pinctrl/mvebu/Kconfig"
+source "drivers/pinctrl/nexell/Kconfig"
 source "drivers/pinctrl/nxp/Kconfig"
 source "drivers/pinctrl/renesas/Kconfig"
 source "drivers/pinctrl/rockchip/Kconfig"
drivers/pinctrl/Makefile +1 -0
index 4f662c4..92cff1b 100644
@@ -21,6 +21,7 @@ obj-$(CONFIG_PINCTRL_MESON)	+= meson/
 obj-$(CONFIG_PINCTRL_MTK)	+= mediatek/
 obj-$(CONFIG_PINCTRL_MSCC)	+= mscc/
 obj-$(CONFIG_ARCH_MVEBU)	+= mvebu/
+obj-$(CONFIG_ARCH_NEXELL)	+= nexell/
 obj-$(CONFIG_PINCTRL_SINGLE)	+= pinctrl-single.o
 obj-$(CONFIG_PINCTRL_STI)	+= pinctrl-sti.o
 obj-$(CONFIG_PINCTRL_STM32)	+= pinctrl_stm32.o
drivers/pinctrl/nexell/Kconfig new file +18 -0
new file mode 100644
index 0000000..8f1e472
@@ -0,0 +1,18 @@
+if ARCH_NEXELL
+
+config PINCTRL_NEXELL
+	bool "Nexell pinctrl driver"
+	help
+	  Support of pin multiplexing and pin configuration for Nexell
+	  SoCs.
+
+config PINCTRL_NEXELL_S5PXX18
+	bool "Nexell s5pxx18 SoC pinctrl driver"
+	default y if ARCH_S5P4418 || ARCH_S5P6818
+	depends on ARCH_NEXELL && PINCTRL_FULL
+	select PINCTRL_NEXELL
+	help
+	  Support of pin multiplexing and pin configuration for S5P4418
+	  and S5P6818 SoC.
+
+endif
drivers/pinctrl/nexell/Makefile new file +7 -0
new file mode 100644
index 0000000..74df414
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier:	GPL-2.0+
+#
+# (C) Copyright 2016 Nexell
+# Bongyu, KOO <[email protected]>
+
+obj-$(CONFIG_PINCTRL_NEXELL) += pinctrl-nexell.o
+obj-$(CONFIG_PINCTRL_NEXELL_S5PXX18) += pinctrl-s5pxx18.o
drivers/pinctrl/nexell/pinctrl-nexell.c new file +66 -0

66 lines not on this page · raw message

drivers/pinctrl/nexell/pinctrl-nexell.h new file +68 -0

68 lines not on this page · raw message

drivers/pinctrl/nexell/pinctrl-s5pxx18.c new file +220 -0

220 lines not on this page · raw message

drivers/pinctrl/nexell/pinctrl-s5pxx18.h new file +53 -0

53 lines not on this page · raw message

Signature · 1 line
1.9.1
#12 lore raw

PATCH v4 6/14 pinctrl: add nexell driver

Quoted 5 lines · Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- livetree API (dev_read_...) is used instead of fdt one (fdt...).
- doc/device-tree-bindings/pinctrl/nexell,s5pxx18-pinctrl.txt added.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/a8543f8a/attachment.sig>
#13 lore raw

PATCH v4 7/14 pwm: add driver for nexell

In reply to Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- Since drivers/pwm/pwm-nexell.c is an adapted version of s5p-common/pwm.c an appropriately changed version of s5p-common/pwm.c is used instead. Therefore arch/arm/mach-s5pc1xx/include/mach/pwm.h copied to arch/arm/mach-nexell/include/mach and s5p-common/Makefile changed appropriately.
- '#ifdef CONFIG...' changed to 'if (IS_ENABLED(CONFIG...))' where possible (and similar).

---

(no changes since v3)

Changes in v3:
- Handling of Configs for LCD backlight control reworked because (among others) not setting CONFIG_S5P4418_ONEWIRE and/or CONFIG_PWM_NX has caused errors when compiling board/friendlyarm/nanopi2/onewire.c.
- pwm.h: () around macro argument x added to avoid precedence issues.
- '#ifdef...' changed to 'if (IS_ENABLED(CONFIG...))' where possible because of appropriate warnings of patman.

Changes in v2:
- commit "i2c: mmc: add nexell driver (gpio, i2c, mmc, pwm)" splitted into separate commits for gpio, i2c, mmc, pwm.
- Since drivers/pwm/pwm-nexell.c is an adapted version of s5p-common/pwm.c an appropriately changed version of s5p-common/pwm.c is used now. Therefore arch/arm/mach-s5pc1xx/include/mach/pwm.h copied to arch/arm/mach-nexell/include/mach and s5p-common/Makefile changed appropriately.

 arch/arm/cpu/armv7/s5p-common/Makefile  | 13 +++++---
 arch/arm/cpu/armv7/s5p-common/pwm.c     | 57 ++++++++++++++++++++++++++++++++-
 arch/arm/mach-nexell/include/mach/pwm.h | 54 +++++++++++++++++++++++++++++++
 3 files changed, 119 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/mach-nexell/include/mach/pwm.h
arch/arm/cpu/armv7/s5p-common/Makefile +9 -4
index 12cf804..bfe0238 100644
@@ -3,9 +3,14 @@
 # Copyright (C) 2009 Samsung Electronics
 # Minkyu Kang <[email protected]>
 
-obj-y		+= cpu_info.o
+ifdef CONFIG_ARCH_NEXELL
+obj-$(CONFIG_PWM_NX) += pwm.o
+obj-$(CONFIG_S5P4418_ONEWIRE) += pwm.o
+else
+obj-y += cpu_info.o
 ifndef CONFIG_SPL_BUILD
-obj-y		+= timer.o
-obj-y		+= sromc.o
-obj-$(CONFIG_PWM)	+= pwm.o
+obj-y += timer.o
+obj-y += sromc.o
+obj-$(CONFIG_PWM) += pwm.o
+endif
 endif
arch/arm/cpu/armv7/s5p-common/pwm.c +56 -1

112 lines not on this page · raw message

arch/arm/mach-nexell/include/mach/pwm.h new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
1.9.1
#14 lore raw

PATCH v4 7/14 pwm: add driver for nexell

Quoted 10 lines · Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- Since drivers/pwm/pwm-nexell.c is an adapted version of s5p-common/pwm.c an appropriately changed version of s5p-common/pwm.c is used instead. Therefore arch/arm/mach-s5pc1xx/include/mach/pwm.h copied to arch/arm/mach-nexell/include/mach and s5p-common/Makefile changed appropriately.
- '#ifdef CONFIG...' changed to 'if (IS_ENABLED(CONFIG...))' where possible (and similar).

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/af16f533/attachment.sig>
#15 lore raw

PATCH v4 8/14 video: add nexell video driver (soc: displaytop)

In reply to Stefan Bosch

Low level functions for DisplayTop (Display Topology).

---

(no changes since v1)

 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 ++
 5 files changed, 961 insertions(+)
 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
drivers/video/nexell/soc/s5pxx18_soc_disptop.c new file +185 -0
new file mode 100644
index 0000000..626e53a
@@ -0,0 +1,185 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2016  Nexell Co., Ltd.
+ *
+ * Author: junghyun, kim <[email protected]>
+ */
+
+#include <linux/types.h>
+#include <linux/io.h>
+
+#include "s5pxx18_soc_disptop.h"
+
+static struct {
+	struct nx_disp_top_register_set *pregister;
+} __g_module_variables = { NULL, };
+
+int nx_disp_top_initialize(void)
+{
+	static int binit;
+	u32 i;
+
+	if (binit == 0) {
+		for (i = 0; i < NUMBER_OF_DISPTOP_MODULE; i++)
+			__g_module_variables.pregister = NULL;
+		binit = 1;
+	}
+	return 1;
+}
+
+u32 nx_disp_top_get_number_of_module(void)
+{
+	return NUMBER_OF_DISPTOP_MODULE;
+}
+
+u32 nx_disp_top_get_physical_address(void)
+{
+	static const u32 physical_addr[] = PHY_BASEADDR_DISPTOP_LIST;
+
+	return (u32)(physical_addr[0] + PHY_BASEADDR_DISPLAYTOP_MODULE_OFFSET);
+}
+
+u32 nx_disp_top_get_size_of_register_set(void)
+{
+	return sizeof(struct nx_disp_top_register_set);
+}
+
+void nx_disp_top_set_base_address(void *base_address)
+{
+	__g_module_variables.pregister =
+	    (struct nx_disp_top_register_set *)base_address;
+}
+
+void *nx_disp_top_get_base_address(void)
+{
+	return (void *)__g_module_variables.pregister;
+}
+
+void nx_disp_top_set_resconvmux(int benb, u32 sel)
+{
+	register struct nx_disp_top_register_set *pregister;
+	u32 regvalue;
+
+	pregister = __g_module_variables.pregister;
+	regvalue = (benb << 31) | (sel << 0);
+	writel((u32)regvalue, &pregister->resconv_mux_ctrl);
+}
+
+void nx_disp_top_set_hdmimux(int benb, u32 sel)
+{
+	register struct nx_disp_top_register_set *pregister;
+	u32 regvalue;
+
+	pregister = __g_module_variables.pregister;
+	regvalue = (benb << 31) | (sel << 0);
+	writel((u32)regvalue, &pregister->interconv_mux_ctrl);
+}
+
+void nx_disp_top_set_mipimux(int benb, u32 sel)
+{
+	register struct nx_disp_top_register_set *pregister;
+	u32 regvalue;
+
+	pregister = __g_module_variables.pregister;
+	regvalue = (benb << 31) | (sel << 0);
+	writel((u32)regvalue, &pregister->mipi_mux_ctrl);
+}
+
+void nx_disp_top_set_lvdsmux(int benb, u32 sel)
+{
+	register struct nx_disp_top_register_set *pregister;
+	u32 regvalue;
+
+	pregister = __g_module_variables.pregister;
+	regvalue = (benb << 31) | (sel << 0);
+	writel((u32)regvalue, &pregister->lvds_mux_ctrl);
+}
+
+void nx_disp_top_set_primary_mux(u32 sel)
+{
+	register struct nx_disp_top_register_set *pregister;
+
+	pregister = __g_module_variables.pregister;
+	writel((u32)sel, &pregister->tftmpu_mux);
+}
+
+void nx_disp_top_hdmi_set_vsync_start(u32 sel)
+{
+	register struct nx_disp_top_register_set *pregister;
+
+	pregister = __g_module_variables.pregister;
+	writel((u32)sel, &pregister->hdmisyncctrl0);
+}
+
+void nx_disp_top_hdmi_set_vsync_hsstart_end(u32 start, u32 end)
+{
+	register struct nx_disp_top_register_set *pregister;
+
+	pregister = __g_module_variables.pregister;
+	writel((u32)(end << 16) | (start << 0), &pregister->hdmisyncctrl3);
+}
+
+void nx_disp_top_hdmi_set_hactive_start(u32 sel)
+{
+	register struct nx_disp_top_register_set *pregister;
+
+	pregister = __g_module_variables.pregister;
+	writel((u32)sel, &pregister->hdmisyncctrl1);
+}
+
+void nx_disp_top_hdmi_set_hactive_end(u32 sel)
+{
+	register struct nx_disp_top_register_set *pregister;
+
+	pregister = __g_module_variables.pregister;
+	writel((u32)sel, &pregister->hdmisyncctrl2);
+}
+
+void nx_disp_top_set_hdmifield(u32 enable, u32 init_val, u32 vsynctoggle,
+			       u32 hsynctoggle, u32 vsyncclr, u32 hsyncclr,
+			       u32 field_use, u32 muxsel)
+{
+	register struct nx_disp_top_register_set *pregister;
+	u32 regvalue;
+
+	pregister = __g_module_variables.pregister;
+	regvalue = ((enable & 0x01) << 0) | ((init_val & 0x01) << 1) |
+		   ((vsynctoggle & 0x3fff) << 2) |
+		   ((hsynctoggle & 0x3fff) << 17);
+	writel(regvalue, &pregister->hdmifieldctrl);
+	regvalue = ((field_use & 0x01) << 31) | ((muxsel & 0x01) << 30) |
+		   ((hsyncclr) << 15) | ((vsyncclr) << 0);
+	writel(regvalue, &pregister->greg0);
+}
+
+void nx_disp_top_set_padclock(u32 mux_index, u32 padclk_cfg)
+{
+	register struct nx_disp_top_register_set *pregister;
+	u32 regvalue;
+
+	pregister = __g_module_variables.pregister;
+	regvalue = readl(&pregister->greg1);
+	if (padmux_secondary_mlc == mux_index) {
+		regvalue = regvalue & (~(0x7 << 3));
+		regvalue = regvalue | (padclk_cfg << 3);
+	} else if (padmux_resolution_conv == mux_index) {
+		regvalue = regvalue & (~(0x7 << 6));
+		regvalue = regvalue | (padclk_cfg << 6);
+	} else {
+		regvalue = regvalue & (~(0x7 << 0));
+		regvalue = regvalue | (padclk_cfg << 0);
+	}
+	writel(regvalue, &pregister->greg1);
+}
+
+void nx_disp_top_set_lcdif_enb(int enb)
+{
+	register struct nx_disp_top_register_set *pregister;
+	u32 regvalue;
+
+	pregister = __g_module_variables.pregister;
+	regvalue = readl(&pregister->greg1);
+	regvalue = regvalue & (~(0x1 << 9));
+	regvalue = regvalue | ((enb & 0x1) << 9);
+	writel(regvalue, &pregister->greg1);
+}
drivers/video/nexell/soc/s5pxx18_soc_disptop.h new file +385 -0

385 lines not on this page · raw message

drivers/video/nexell/soc/s5pxx18_soc_disptop_clk.c new file +309 -0

309 lines not on this page · raw message

drivers/video/nexell/soc/s5pxx18_soc_disptop_clk.h new file +59 -0

59 lines not on this page · raw message

drivers/video/nexell/soc/s5pxx18_soc_disptype.h new file +23 -0
new file mode 100644
index 0000000..b5df7a7
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0+
+ *
+ * Copyright (C) 2016  Nexell Co., Ltd.
+ *
+ * Author: junghyun, kim <[email protected]>
+ */
+
+#ifndef _S5PXX18_SOC_DISP_TYPE_H_
+#define _S5PXX18_SOC_DISP_TYPE_H_
+
+/* clock control types */
+enum nx_pclkmode {
+	nx_pclkmode_dynamic = 0UL,
+	nx_pclkmode_always	= 1UL
+};
+
+enum nx_bclkmode {
+	nx_bclkmode_disable	= 0UL,
+	nx_bclkmode_dynamic	= 2UL,
+	nx_bclkmode_always	= 3UL
+};
+
+#endif
Signature · 1 line
1.9.1
#16 lore raw

PATCH v4 8/14 video: add nexell video driver (soc: displaytop)

Quoted 3 lines · Stefan Bosch

Low level functions for DisplayTop (Display Topology).

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/b166354d/attachment.sig>
#17 lore raw

PATCH v4 9/14 video: add nexell video driver (soc: mlc, mipi)

In reply to Stefan Bosch

Low level functions for MLC (Multi Layer Control) and MIPI (Mobile Industry Processor Interface).

---

(no changes since v1)

 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 ++++++
 4 files changed, 3161 insertions(+)
 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
drivers/video/nexell/soc/s5pxx18_soc_mipi.c new file +580 -0
new file mode 100644
index 0000000..1000ddb
@@ -0,0 +1,580 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2016  Nexell Co., Ltd.
+ *
+ * Author: junghyun, kim <[email protected]>
+ */
+
+#include <linux/types.h>
+#include <linux/io.h>
+
+#include "s5pxx18_soc_disptop.h"
+#include "s5pxx18_soc_mipi.h"
+
+static struct nx_mipi_register_set *__g_pregister[NUMBER_OF_MIPI_MODULE];
+
+int nx_mipi_smoke_test(u32 module_index)
+{
+	register struct nx_mipi_register_set *pregister;
+
+	pregister = __g_pregister[module_index];
+
+	if (pregister->csis_config_ch0 != 0x000000FC)
+		return false;
+
+	if (pregister->dsim_intmsk != 0xB337FFFF)
+		return false;
+
+	writel(0xDEADC0DE, &pregister->csis_dphyctrl);
+	writel(0xFFFFFFFF, &pregister->csis_ctrl2);
+	writel(0xDEADC0DE, &pregister->dsim_msync);
+
+	if (pregister->csis_dphyctrl != 0xDE80001E)
+		return false;
+
+	if ((pregister->csis_ctrl2 & (~1)) != 0xEEE00010)
+		return false;
+
+	if (pregister->dsim_msync != 0xDE80C0DE)
+		return false;
+
+	return true;
+}
+
+void nx_mipi_set_base_address(u32 module_index, void *base_address)
+{
+	__g_pregister[module_index] =
+	    (struct nx_mipi_register_set *)base_address;
+}
+
+void *nx_mipi_get_base_address(u32 module_index)
+{
+	return (void *)__g_pregister[module_index];
+}
+
+u32 nx_mipi_get_physical_address(u32 module_index)
+{
+	const u32 physical_addr[] = PHY_BASEADDR_MIPI_LIST;
+
+	return physical_addr[module_index];
+}
+
+#define __nx_mipi_valid_dsi_intmask__	\
+	(~((1 << 26) | (1 << 23) | (1 << 22) | (1 << 19)))
+
+void nx_mipi_set_interrupt_enable(u32 module_index, u32 int_num, int enable)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+
+	pregister = __g_pregister[module_index];
+	if (int_num < 32) {
+		regvalue = pregister->csis_intmsk;
+		regvalue &= ~(1ul << int_num);
+		regvalue |= (u32)enable << int_num;
+		writel(regvalue, &pregister->csis_intmsk);
+	} else {
+		regvalue = pregister->dsim_intmsk;
+		regvalue &= ~(1ul << (int_num - 32));
+		regvalue |= (u32)enable << (int_num - 32);
+		writel(regvalue, &pregister->dsim_intmsk);
+	}
+}
+
+int nx_mipi_get_interrupt_enable(u32 module_index, u32 int_num)
+{
+	if (int_num < 32)
+		return (int)((__g_pregister[module_index]->csis_intmsk >>
+			      int_num) & 0x01);
+	else
+		return (int)((__g_pregister[module_index]->dsim_intmsk >>
+			      (int_num - 32)) & 0x01);
+}
+
+int nx_mipi_get_interrupt_pending(u32 module_index, u32 int_num)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+	int ret;
+
+	pregister = __g_pregister[module_index];
+	if (int_num < 32) {
+		regvalue = pregister->csis_intmsk;
+		regvalue &= pregister->csis_intsrc;
+		ret = (int)((regvalue >> int_num) & 0x01);
+	} else {
+		regvalue = pregister->dsim_intmsk;
+		regvalue &= pregister->dsim_intsrc;
+		ret = (int)((regvalue >> (int_num - 32)) & 0x01);
+	}
+
+	return ret;
+}
+
+void nx_mipi_clear_interrupt_pending(u32 module_index, u32 int_num)
+{
+	register struct nx_mipi_register_set *pregister;
+
+	pregister = __g_pregister[module_index];
+	if (int_num < 32)
+		writel(1ul << int_num, &pregister->csis_intsrc);
+	else
+		writel(1ul << (int_num - 32), &pregister->dsim_intsrc);
+}
+
+void nx_mipi_set_interrupt_enable_all(u32 module_index, int enable)
+{
+	register struct nx_mipi_register_set *pregister;
+
+	pregister = __g_pregister[module_index];
+	if (enable)
+		writel(__nx_mipi_valid_dsi_intmask__, &pregister->dsim_intmsk);
+	else
+		writel(0, &pregister->dsim_intmsk);
+}
+
+int nx_mipi_get_interrupt_enable_all(u32 module_index)
+{
+	if (__g_pregister[module_index]->csis_intmsk)
+		return true;
+
+	if (__g_pregister[module_index]->dsim_intmsk)
+		return true;
+
+	return false;
+}
+
+int nx_mipi_get_interrupt_pending_all(u32 module_index)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+
+	pregister = __g_pregister[module_index];
+	regvalue = pregister->csis_intmsk;
+	regvalue &= pregister->csis_intsrc;
+
+	if (regvalue)
+		return true;
+
+	regvalue = pregister->dsim_intmsk;
+	regvalue &= pregister->dsim_intsrc;
+
+	if (regvalue)
+		return true;
+
+	return false;
+}
+
+void nx_mipi_clear_interrupt_pending_all(u32 module_index)
+{
+	register struct nx_mipi_register_set *pregister;
+
+	pregister = __g_pregister[module_index];
+	writel(__nx_mipi_valid_dsi_intmask__, &pregister->dsim_intsrc);
+}
+
+int32_t nx_mipi_get_interrupt_pending_number(u32 module_index)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+	int i;
+
+	pregister = __g_pregister[module_index];
+	regvalue = pregister->csis_intmsk;
+	regvalue &= pregister->csis_intsrc;
+	if (regvalue != 0) {
+		for (i = 0; i < 32; i++) {
+			if (regvalue & 1ul)
+				return i;
+			regvalue >>= 1;
+		}
+	}
+
+	regvalue = pregister->dsim_intmsk;
+	regvalue &= pregister->dsim_intsrc;
+	if (regvalue != 0) {
+		for (i = 0; i < 32; i++) {
+			if (regvalue & 1ul)
+				return i + 32;
+			regvalue >>= 1;
+		}
+	}
+	return -1;
+}
+
+#define writereg(regname, mask, value) \
+	regvalue = pregister->(regname);	\
+	regvalue = (regvalue & (~(mask))) | (value); \
+	writel(regvalue, &pregister->(regname))
+
+void nx_mipi_dsi_get_status(u32 module_index, u32 *pulps, u32 *pstop,
+			    u32 *pispllstable, u32 *pisinreset,
+			    u32 *pisbackward, u32 *pishsclockready)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+
+	pregister = __g_pregister[module_index];
+	regvalue = pregister->dsim_status;
+	if (pulps) {
+		*pulps = 0;
+		if (regvalue & (1 << 4))
+			*pulps |= (1 << 0);
+		if (regvalue & (1 << 5))
+			*pulps |= (1 << 1);
+		if (regvalue & (1 << 6))
+			*pulps |= (1 << 2);
+		if (regvalue & (1 << 7))
+			*pulps |= (1 << 3);
+		if (regvalue & (1 << 9))
+			*pulps |= (1 << 4);
+	}
+
+	if (pstop) {
+		*pstop = 0;
+		if (regvalue & (1 << 0))
+			*pstop |= (1 << 0);
+		if (regvalue & (1 << 1))
+			*pstop |= (1 << 1);
+		if (regvalue & (1 << 2))
+			*pstop |= (1 << 2);
+		if (regvalue & (1 << 3))
+			*pstop |= (1 << 3);
+		if (regvalue & (1 << 8))
+			*pstop |= (1 << 4);
+	}
+
+	if (pispllstable)
+		*pispllstable = (regvalue >> 31) & 1;
+
+	if (pisinreset)
+		*pisinreset = ((regvalue >> 20) & 1) ? 0 : 1;
+
+	if (pisbackward)
+		*pisbackward = (regvalue >> 16) & 1;
+
+	if (pishsclockready)
+		*pishsclockready = (regvalue >> 10) & 1;
+}
+
+void nx_mipi_dsi_software_reset(u32 module_index)
+{
+	register struct nx_mipi_register_set *pregister;
+
+	pregister = __g_pregister[module_index];
+
+	writel(0x00010001, &pregister->dsim_swrst);
+
+	while (0 != (readl(&pregister->dsim_status) & (1 << 20)))
+		;
+
+	writel(0x00000000, &pregister->dsim_swrst);
+}
+
+void nx_mipi_dsi_set_clock(u32 module_index, int enable_txhsclock,
+			   int use_external_clock, int enable_byte_clock,
+			   int enable_escclock_clock_lane,
+			   int enable_escclock_data_lane0,
+			   int enable_escclock_data_lane1,
+			   int enable_escclock_data_lane2,
+			   int enable_escclock_data_lane3,
+			   int enable_escprescaler, u32 escprescalervalue)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+
+	pregister = __g_pregister[module_index];
+	regvalue = 0;
+	regvalue |= (enable_txhsclock << 31);
+	regvalue |= (use_external_clock << 27);
+	regvalue |= (enable_byte_clock << 24);
+	regvalue |= (enable_escclock_clock_lane << 19);
+	regvalue |= (enable_escclock_data_lane0 << 20);
+	regvalue |= (enable_escclock_data_lane1 << 21);
+	regvalue |= (enable_escclock_data_lane2 << 22);
+	regvalue |= (enable_escclock_data_lane3 << 23);
+	regvalue |= (enable_escprescaler << 28);
+	regvalue |= escprescalervalue;
+
+	writel(regvalue, &pregister->dsim_clkctrl);
+}
+
+void nx_mipi_dsi_set_timeout(u32 module_index, u32 bta_tout, u32 lpdrtout)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+
+	pregister = __g_pregister[module_index];
+	regvalue = 0;
+	regvalue |= (bta_tout << 16);
+	regvalue |= (lpdrtout << 0);
+
+	writel(regvalue, &pregister->dsim_timeout);
+}
+
+void nx_mipi_dsi_set_config_video_mode(u32 module_index,
+				       int enable_auto_flush_main_display_fifo,
+				       int enable_auto_vertical_count,
+				       int enable_burst,
+				       enum nx_mipi_dsi_syncmode sync_mode,
+				       int enable_eo_tpacket,
+				       int enable_hsync_end_packet,
+				       int enable_hfp, int enable_hbp,
+				       int enable_hsa,
+				       u32 number_of_virtual_channel,
+				       enum nx_mipi_dsi_format format,
+				       u32 number_of_words_in_hfp,
+				       u32 number_of_words_in_hbp,
+				       u32 number_of_words_in_hsync,
+				       u32 number_of_lines_in_vfp,
+				       u32 number_of_lines_in_vbp,
+				       u32 number_of_lines_in_vsync,
+				       u32 number_of_lines_in_command_allow)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+	u32 newvalue;
+
+	pregister = __g_pregister[module_index];
+	newvalue = (1 << 25);
+	newvalue |= ((1 - enable_auto_flush_main_display_fifo) << 29);
+	newvalue |= (enable_auto_vertical_count << 24);
+	newvalue |= (enable_burst << 26);
+	newvalue |= (sync_mode << 27);
+	newvalue |= ((1 - enable_eo_tpacket) << 28);
+	newvalue |= (enable_hsync_end_packet << 23);
+	newvalue |= ((1 - enable_hfp) << 22);
+	newvalue |= ((1 - enable_hbp) << 21);
+	newvalue |= ((1 - enable_hsa) << 20);
+	newvalue |= (number_of_virtual_channel << 18);
+	newvalue |= (format << 12);
+
+	writereg(dsim_config, 0xFFFFFF00, newvalue);
+
+	newvalue = (number_of_lines_in_command_allow << 28);
+	newvalue |= (number_of_lines_in_vfp << 16);
+	newvalue |= (number_of_lines_in_vbp << 0);
+
+	writel(newvalue, &pregister->dsim_mvporch);
+
+	newvalue = (number_of_words_in_hfp << 16);
+	newvalue |= (number_of_words_in_hbp << 0);
+
+	writel(newvalue, &pregister->dsim_mhporch);
+
+	newvalue = (number_of_words_in_hsync << 0);
+	newvalue |= (number_of_lines_in_vsync << 22);
+
+	writel(newvalue, &pregister->dsim_msync);
+}
+
+void nx_mipi_dsi_set_config_command_mode(u32 module_index,
+					 int
+					 enable_auto_flush_main_display_fifo,
+					 int enable_eo_tpacket,
+					 u32 number_of_virtual_channel,
+					 enum nx_mipi_dsi_format format)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+	u32 newvalue;
+
+	pregister = __g_pregister[module_index];
+	newvalue = (0 << 25);
+	newvalue |= (enable_auto_flush_main_display_fifo << 29);
+	newvalue |= (enable_eo_tpacket << 28);
+	newvalue |= (number_of_virtual_channel << 18);
+	newvalue |= (format << 12);
+	writereg(dsim_config, 0xFFFFFF00, newvalue);
+}
+
+void nx_mipi_dsi_set_escape_mode(u32 module_index, u32 stop_state_count,
+				 int force_stop_state, int force_bta,
+				 enum nx_mipi_dsi_lpmode cmdin_lp,
+				 enum nx_mipi_dsi_lpmode txinlp)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+	u32 newvalue;
+
+	pregister = __g_pregister[module_index];
+	newvalue = (stop_state_count << 21);
+	newvalue |= (force_stop_state << 20);
+	newvalue |= (force_bta << 16);
+	newvalue |= (cmdin_lp << 7);
+	newvalue |= (txinlp << 6);
+	writereg(dsim_escmode, 0xFFFFFFC0, newvalue);
+}
+
+void nx_mipi_dsi_set_escape_lp(u32 module_index,
+			       enum nx_mipi_dsi_lpmode cmdin_lp,
+			       enum nx_mipi_dsi_lpmode txinlp)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+	u32 newvalue = 0;
+
+	pregister = __g_pregister[module_index];
+	newvalue |= (cmdin_lp << 7);
+	newvalue |= (txinlp << 6);
+	writereg(dsim_escmode, 0xC0, newvalue);
+}
+
+void nx_mipi_dsi_remote_reset_trigger(u32 module_index)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+	u32 newvalue;
+
+	pregister = __g_pregister[module_index];
+	newvalue = (1 << 4);
+	writereg(dsim_escmode, (1 << 4), newvalue);
+
+	while (readl(&pregister->dsim_escmode) & (1 << 4))
+		;
+}
+
+void nx_mipi_dsi_set_ulps(u32 module_index, int ulpsclocklane, int ulpsdatalane)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+
+	pregister = __g_pregister[module_index];
+	regvalue = pregister->dsim_escmode;
+
+	if (ulpsclocklane) {
+		regvalue &= ~(1 << 0);
+		regvalue |= (1 << 1);
+	} else {
+		regvalue |= (1 << 0);
+	}
+
+	if (ulpsdatalane) {
+		regvalue &= ~(1 << 2);
+		regvalue |= (1 << 3);
+	} else {
+		regvalue |= (1 << 2);
+	}
+
+	writel(regvalue, &pregister->dsim_escmode);
+
+	if (ulpsclocklane)
+		while ((1 << 9) ==
+		       (readl(&pregister->dsim_status) & (1 << 9)))
+			;
+	else
+		while (0 != (readl(&pregister->dsim_status) & (1 << 9)))
+			;
+
+	if (ulpsdatalane)
+		while ((15 << 4) ==
+		       (readl(&pregister->dsim_status) & (15 << 4)))
+			;
+	else
+		while (0 != (readl(&pregister->dsim_status) & (15 << 4)))
+			;
+
+	if (!ulpsclocklane)
+		regvalue &= (3 << 0);
+
+	if (!ulpsdatalane)
+		regvalue |= (3 << 2);
+
+	writel(regvalue, &pregister->dsim_escmode);
+}
+
+void nx_mipi_dsi_set_size(u32 module_index, u32 width, u32 height)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+	u32 newvalue;
+
+	pregister = __g_pregister[module_index];
+	newvalue = (height << 16);
+	newvalue |= (width << 0);
+	writereg(dsim_mdresol, 0x0FFFFFFF, newvalue);
+}
+
+void nx_mipi_dsi_set_enable(u32 module_index, int enable)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+
+	pregister = __g_pregister[module_index];
+	writereg(dsim_mdresol, (1 << 31), (enable << 31));
+}
+
+void nx_mipi_dsi_set_phy(u32 module_index, u32 number_of_data_lanes,
+			 int enable_clock_lane, int enable_data_lane0,
+			 int enable_data_lane1, int enable_data_lane2,
+			 int enable_data_lane3, int swap_clock_lane,
+			 int swap_data_lane)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+	u32 newvalue;
+
+	pregister = __g_pregister[module_index];
+	newvalue = (number_of_data_lanes << 5);
+	newvalue |= (enable_clock_lane << 0);
+	newvalue |= (enable_data_lane0 << 1);
+	newvalue |= (enable_data_lane1 << 2);
+	newvalue |= (enable_data_lane2 << 3);
+	newvalue |= (enable_data_lane3 << 4);
+	writereg(dsim_config, 0xFF, newvalue);
+	newvalue = (swap_clock_lane << 1);
+	newvalue |= (swap_data_lane << 0);
+	writereg(dsim_phyacchr1, 0x3, newvalue);
+}
+
+void nx_mipi_dsi_set_pll(u32 module_index, int enable, u32 pllstabletimer,
+			 u32 m_pllpms, u32 m_bandctl, u32 m_dphyctl,
+			 u32 b_dphyctl)
+{
+	register struct nx_mipi_register_set *pregister;
+	register u32 regvalue;
+	u32 newvalue;
+
+	pregister = __g_pregister[module_index];
+	if (!enable) {
+		newvalue = (enable << 23);
+		newvalue |= (m_pllpms << 1);
+		newvalue |= (m_bandctl << 24);
+		writereg(dsim_pllctrl, 0x0FFFFFFF, newvalue);
+	}
+
+	writel(m_dphyctl, &pregister->dsim_phyacchr);
+	writel(pllstabletimer, &pregister->dsim_plltmr);
+	writel((b_dphyctl << 9), &pregister->dsim_phyacchr1);
+
+	if (enable) {
+		newvalue = (enable << 23);
+		newvalue |= (m_pllpms << 1);
+		newvalue |= (m_bandctl << 24);
+		writereg(dsim_pllctrl, 0x0FFFFFFF, newvalue);
+	}
+}
+
+void nx_mipi_dsi_write_pkheader(u32 module_index, u32 data)
+{
+	register struct nx_mipi_register_set *pregister;
+
+	pregister = __g_pregister[module_index];
+	writel(data, &pregister->dsim_pkthdr);
+}
+
+void nx_mipi_dsi_write_payload(u32 module_index, u32 data)
+{
+	register struct nx_mipi_register_set *pregister;
+
+	pregister = __g_pregister[module_index];
+	writel(data, &pregister->dsim_payload);
+}
+
+u32 nx_mipi_dsi_read_fifo_status(u32 module_index)
+{
+	register struct nx_mipi_register_set *pregister;
+
+	pregister = __g_pregister[module_index];
+	return readl(&pregister->dsim_fifoctrl);
+}
drivers/video/nexell/soc/s5pxx18_soc_mipi.h new file +291 -0

291 lines not on this page · raw message

drivers/video/nexell/soc/s5pxx18_soc_mlc.c new file +1861 -0

1,861 lines not on this page · raw message

drivers/video/nexell/soc/s5pxx18_soc_mlc.h new file +429 -0

268 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.9.1

Part of the diff is not shown here. View the raw message.

#18 lore raw

PATCH v4 9/14 video: add nexell video driver (soc: mlc, mipi)

Quoted 4 lines · Stefan Bosch

Low level functions for MLC (Multi Layer Control) and MIPI (Mobile Industry Processor Interface).

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/d8e1c4ff/attachment.sig>
#19 lore raw

PATCH v4 10/14 video: add nexell video driver (soc: lvds, hdmi)

In reply to Stefan Bosch

Low level functions for LVDS and HDMI display interfaces.

---

(no changes since v1)

 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 +++++
 4 files changed, 899 insertions(+)
 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
drivers/video/nexell/soc/s5pxx18_soc_hdmi.c new file +50 -0
new file mode 100644
index 0000000..7b8be7e
@@ -0,0 +1,50 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2016  Nexell Co., Ltd.
+ *
+ * Author: junghyun, kim <[email protected]>
+ */
+
+#include <linux/types.h>
+#include <linux/io.h>
+
+#include "s5pxx18_soc_hdmi.h"
+
+static u32 *hdmi_base_addr;
+
+u32 nx_hdmi_get_reg(u32 module_index, u32 offset)
+{
+	u32 *reg_addr;
+	u32 regvalue;
+
+	reg_addr = hdmi_base_addr + (offset / sizeof(u32));
+	regvalue = readl((u32 *)reg_addr);
+
+	return regvalue;
+}
+
+void nx_hdmi_set_reg(u32 module_index, u32 offset, u32 regvalue)
+{
+	s64 offset_new = (s64)((int32_t)offset);
+	u32 *reg_addr;
+
+	reg_addr = hdmi_base_addr + (offset_new / sizeof(u32));
+	writel(regvalue, (u32 *)reg_addr);
+}
+
+void nx_hdmi_set_base_address(u32 module_index, void *base_address)
+{
+	hdmi_base_addr = (u32 *)base_address;
+}
+
+void *nx_hdmi_get_base_address(u32 module_index)
+{
+	return (u32 *)hdmi_base_addr;
+}
+
+u32 nx_hdmi_get_physical_address(u32 module_index)
+{
+	const u32 physical_addr[] = PHY_BASEADDR_HDMI_LIST;
+
+	return physical_addr[module_index];
+}
drivers/video/nexell/soc/s5pxx18_soc_hdmi.h new file +488 -0

488 lines not on this page · raw message

drivers/video/nexell/soc/s5pxx18_soc_lvds.c new file +278 -0

278 lines not on this page · raw message

drivers/video/nexell/soc/s5pxx18_soc_lvds.h new file +83 -0

83 lines not on this page · raw message

Signature · 1 line
1.9.1
#20 lore raw

PATCH v4 10/14 video: add nexell video driver (soc: lvds, hdmi)

Quoted 3 lines · Stefan Bosch

Low level functions for LVDS and HDMI display interfaces.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/3ed86fc0/attachment.sig>
#21 lore raw

PATCH v4 11/14 video: add nexell video driver (soc: dpc, makefile)

In reply to Stefan Bosch

Low level functions for DPC (Display Controller) and Makefile for all nexell video low level functions.

---

(no changes since v1)

 drivers/video/nexell/soc/Makefile          |   11 +
 drivers/video/nexell/soc/s5pxx18_soc_dpc.c | 1569 ++++++++++++++++++++++++++++
 drivers/video/nexell/soc/s5pxx18_soc_dpc.h |  444 ++++++++
 3 files changed, 2024 insertions(+)
 create mode 100644 drivers/video/nexell/soc/Makefile
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_dpc.c
 create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_dpc.h
drivers/video/nexell/soc/Makefile new file +11 -0
new file mode 100644
index 0000000..a3036e5
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2016 Nexell
+# Junghyun, kim<[email protected]>
+
+obj-$(CONFIG_VIDEO_NX) += s5pxx18_soc_dpc.o s5pxx18_soc_mlc.o \
+			  s5pxx18_soc_disptop.o s5pxx18_soc_disptop_clk.o
+
+obj-$(CONFIG_VIDEO_NX_LVDS) += s5pxx18_soc_lvds.o
+obj-$(CONFIG_VIDEO_NX_MIPI) += s5pxx18_soc_mipi.o
+obj-$(CONFIG_VIDEO_NX_HDMI) += s5pxx18_soc_hdmi.o
drivers/video/nexell/soc/s5pxx18_soc_dpc.c new file +1569 -0

1,569 lines not on this page · raw message

drivers/video/nexell/soc/s5pxx18_soc_dpc.h new file +444 -0

444 lines not on this page · raw message

Signature · 1 line
1.9.1
#22 lore raw

PATCH v4 11/14 video: add nexell video driver (soc: dpc, makefile)

Quoted 4 lines · Stefan Bosch

Low level functions for DPC (Display Controller) and Makefile for all nexell video low level functions.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/f4a95a02/attachment.sig>
#23 lore raw

PATCH v4 12/14 video: add nexell video driver (display/video driver)

In reply to Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- nexell_display.c: Changed to DM, CONFIG_FB_ADDR can not be used anymore because framebuffer is allocated by video_reserve() in video-uclass.c. Therefore code changed appropriately.
- '#ifdef CONFIG...' changed to 'if (IS_ENABLED(CONFIG...))' where possible (and similar).
- livetree API (dev_read_...) is used instead of fdt one (fdt...).

---

(no changes since v3)

Changes in v3:
- drivers/video/nexell/s5pxx18_dp_hdmi.c: '#include <log.h>' and '#include <linux/delay.h>' inserted because it has been removed from common.h.
- drivers/video/nexell_display.c: '#include <command.h>' inserted because '#include <image.h>' (includes command.h) has been removed from common.h.
- '#ifdef...' changed to 'if (IS_ENABLED(CONFIG...))' where possible because of appropriate warnings of patman.
- Changed to livetree API as proposed by patman:
fdtdec_get_int() --> ofnode_read_s32_default()
for (node = ...) --> ofnode_for_each_subnode()
fdt_get_name() --> ofnode_get_name()
fdt_getprop() --> dev_read_string()
- nx_display_probe() removed, nx_display_dev_probe_uclass() renamed to nx_display_probe().

 drivers/video/Kconfig                  |  10 +
 drivers/video/Makefile                 |   1 +
 drivers/video/nexell/Kconfig           |  27 ++
 drivers/video/nexell/Makefile          |  12 +
 drivers/video/nexell/s5pxx18_dp.c      | 341 +++++++++++++++++
 drivers/video/nexell/s5pxx18_dp_hdmi.c | 545 ++++++++++++++++++++++++++
 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_display.c         | 651 +++++++++++++++++++++++++++++++
 10 files changed, 2607 insertions(+)
 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_display.c
drivers/video/Kconfig +10 -0
index 3812354..fb145e5 100644
@@ -572,6 +572,16 @@ source "drivers/video/bridge/Kconfig"
 
 source "drivers/video/imx/Kconfig"
 
+config VIDEO_NX
+	bool "Enable video support on Nexell SoC"
+	depends on ARCH_S5P6818 || ARCH_S5P4418
+	help
+	   Nexell SoC supports many video output options including eDP and
+	   HDMI. This option enables this support which can be used on devices
+	   which have an eDP display connected.
+
+source "drivers/video/nexell/Kconfig"
+
 config VIDEO
 	bool "Enable legacy video support"
 	depends on !DM_VIDEO
drivers/video/Makefile +1 -0
index df7119d..3bacc64 100644
@@ -61,6 +61,7 @@ obj-${CONFIG_VIDEO_MIPI_DSI} += mipi_dsi.o
 obj-$(CONFIG_VIDEO_MVEBU) += mvebu_lcd.o
 obj-$(CONFIG_VIDEO_MX3) += mx3fb.o videomodes.o
 obj-$(CONFIG_VIDEO_MXS) += mxsfb.o videomodes.o
+obj-$(CONFIG_VIDEO_NX) += nexell_display.o videomodes.o nexell/
 obj-$(CONFIG_VIDEO_OMAP3) += omap3_dss.o
 obj-$(CONFIG_VIDEO_DSI_HOST_SANDBOX) += sandbox_dsi_host.o
 obj-$(CONFIG_VIDEO_SANDBOX_SDL) += sandbox_sdl.o
drivers/video/nexell/Kconfig new file +27 -0
new file mode 100644
index 0000000..54b8ccb
@@ -0,0 +1,27 @@
+if VIDEO_NX
+
+menu "LCD select"
+
+config VIDEO_NX_RGB
+	bool "RGB LCD"
+	help
+	  Support for RGB lcd output.
+
+config VIDEO_NX_LVDS
+	bool "LVDS LCD"
+	help
+	  Support for LVDS lcd output.
+
+config VIDEO_NX_MIPI
+	bool "MiPi"
+	help
+	  Support for MiPi lcd output.
+
+config VIDEO_NX_HDMI
+	bool "HDMI"
+	help
+	  Support for hdmi output.
+
+endmenu
+
+endif
drivers/video/nexell/Makefile new file +12 -0
new file mode 100644
index 0000000..111ab45
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2016 Nexell
+# Junghyun, kim<[email protected]>
+
+obj-$(CONFIG_VIDEO_NX) += s5pxx18_dp.o
+obj-$(CONFIG_VIDEO_NX) += soc/
+
+obj-$(CONFIG_VIDEO_NX_RGB)  += s5pxx18_dp_rgb.o
+obj-$(CONFIG_VIDEO_NX_LVDS) += s5pxx18_dp_lvds.o
+obj-$(CONFIG_VIDEO_NX_MIPI) += s5pxx18_dp_mipi.o
+obj-$(CONFIG_VIDEO_NX_HDMI) += s5pxx18_dp_hdmi.o
drivers/video/nexell/s5pxx18_dp.c new file +341 -0

341 lines not on this page · raw message

drivers/video/nexell/s5pxx18_dp_hdmi.c new file +545 -0

545 lines not on this page · raw message

drivers/video/nexell/s5pxx18_dp_lvds.c new file +274 -0

274 lines not on this page · raw message

drivers/video/nexell/s5pxx18_dp_mipi.c new file +677 -0

677 lines not on this page · raw message

drivers/video/nexell/s5pxx18_dp_rgb.c new file +69 -0

69 lines not on this page · raw message

drivers/video/nexell_display.c new file +651 -0

651 lines not on this page · raw message

Signature · 1 line
1.9.1
#24 lore raw

PATCH v4 12/14 video: add nexell video driver (display/video driver)

Quoted 9 lines · Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- nexell_display.c: Changed to DM, CONFIG_FB_ADDR can not be used anymore because framebuffer is allocated by video_reserve() in video-uclass.c. Therefore code changed appropriately.
- '#ifdef CONFIG...' changed to 'if (IS_ENABLED(CONFIG...))' where possible (and similar).
- livetree API (dev_read_...) is used instead of fdt one (fdt...).

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/eb8c4362/attachment.sig>
#25 lore raw

PATCH v4 13/14 arm: add support for SoC s5p4418 (cpu) / nanopi2 board

In reply to Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- SPL not supported yet --> no spl-dir in arch/arm/cpu/armv7/s5p4418/. Appropriate line in Makefile removed.
- cpu.c: '#include <cpu_func.h>' added.
- arch/arm/cpu/armv7/s5p4418/u-boot.lds removed, is not required anylonger.
- "obj-$(CONFIG_ARCH_NEXELL) += s5p-common/" added to arch/arm/cpu/armv7/Makefile since s5p-common/pwm.c is used instead of drivers/pwm/pwm-nexell.c.
- s5p4418.dtsi: '#include "../../../include/generated/autoconf.h"' removed, is not necessary, error at out-of-tree building. '#ifdef CONFIG_CPU_NXP4330'-blocks (2x) removed. Some minor changes regarding mmc. 'u-boot,dm-pre-reloc' added to dp0 because of added DM_VIDEO support.
- board/s5p4418/ renamed to board/friendlyarm/
- All s5p4418-boards except nanopi2 removed because there is no possibility to test the other boards.
- Kconfig: Changes to have a structure like mach-bcm283x (RaspberryPi), e.g. "config ..." entries moved from/to other Kconfig.
- "CONFIG_" removed from several s5p4418/nanopi2 specific defines because the appropriate values do not need to be configurable.
- nanopi2/board.c: All getenv(), getenv_ulong(), setenv() and saveenv() renamed to env_get(), env_get_ulong(), env_set() and env_save(), respectively. MACH_TYPE_S5P4418 is not defined anymore, therefore appropriate code removed (not necessary for DT-kernels).
- nanopi2/onewire.c: All crc8() renamed to crc8_ow() because crc8() is already defined in lib/crc8.c (with different parameters).
- dts: "nexell,s5pxx18-i2c" used instead of "i2c-gpio", i2c0 and i2c1 added. gmac-, ehci- and dwc2otg-entries removed because the appropriate functionality is not supported yet. New mmc-property "mmcboost" added.
s5p4418-pinctrl.dtsi: gmac-entries removed, mmc- and i2c-entries added.
- '#ifdef CONFIG...' changed to 'if (IS_ENABLED(CONFIG...))' where possible (and similar).

---

(no changes since v3)

Changes in v3:
- dts: pinctrl is supported now, therefore s5p4418-pinctrl.dtsi added, mmc- and i2c-entries extended appropriately. New mmc-property "mmcboost" added.
- Handling of Configs for LCD backlight control reworked because (among others) not setting CONFIG_S5P4418_ONEWIRE and/or CONFIG_PWM_NX has caused errors when compiling board/friendlyarm/nanopi2/onewire.c.
- arch/arm/cpu/armv7/s5p4418/cpu.c: '#include <linux/delay.h>' inserted because it has been removed from common.h.
- board/friendlyarm/nanopi2/board.c: Several includes inserted because some includes have been removed from common.h.
- '#ifdef...' changed to 'if (IS_ENABLED(CONFIG...))' where possible because of appropriate warnings of patman.
- Several initialisations of static variables to 0 removed because of appropriate errors of patman.

Changes in v2:
- i2c: "nexell,s5pxx18-i2c"-driver is used now instead of "i2c-gpio". i2c0 and i2c1 added. I.e. dts files changed appropriately.
- dts: gmac-, ehci- and dwc2otg-entries removed because the appropriate functionality is not supported yet.
- s5p4418-pinctrl.dtsi removed because there is no pinctrl-driver available.
- "obj-$(CONFIG_ARCH_NEXELL) += s5p-common/" added to arch/arm/cpu/armv7/Makefile since s5p-common/pwm.c is used now instead of drivers/pwm/pwm-nexell.c.
- cosmetic: additional GPL license text removed, SPDX-License-Identifier is enough. Furthermore file path removed (two files).

 arch/arm/cpu/armv7/Makefile           |   2 +
 arch/arm/cpu/armv7/s5p4418/Makefile   |   6 +
 arch/arm/cpu/armv7/s5p4418/cpu.c      | 121 ++++++
 arch/arm/dts/Makefile                 |   3 +
 arch/arm/dts/s5p4418-nanopi2.dts      | 110 ++++++
 arch/arm/dts/s5p4418-pinctrl.dtsi     | 135 +++++++
 arch/arm/dts/s5p4418.dtsi             | 170 +++++++++
 board/friendlyarm/Kconfig             |  37 ++
 board/friendlyarm/nanopi2/Kconfig     |  12 +
 board/friendlyarm/nanopi2/MAINTAINERS |   7 +
 board/friendlyarm/nanopi2/Makefile    |   7 +
 board/friendlyarm/nanopi2/board.c     | 575 ++++++++++++++++++++++++++++
 board/friendlyarm/nanopi2/hwrev.c     | 108 ++++++
 board/friendlyarm/nanopi2/hwrev.h     |  15 +
 board/friendlyarm/nanopi2/lcds.c      | 697 ++++++++++++++++++++++++++++++++++
 board/friendlyarm/nanopi2/nxp-fb.h    |  94 +++++
 board/friendlyarm/nanopi2/onewire.c   | 307 +++++++++++++++
 board/friendlyarm/nanopi2/onewire.h   |  15 +
 18 files changed, 2421 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 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
arch/arm/cpu/armv7/Makefile +2 -0
index 8c955d0..0e83e39 100644
@@ -42,3 +42,5 @@ obj-$(CONFIG_RMOBILE) += rmobile/
 obj-$(if $(filter stv0991,$(SOC)),y) += stv0991/
 obj-$(CONFIG_ARCH_SUNXI) += sunxi/
 obj-$(CONFIG_VF610) += vf610/
+obj-$(CONFIG_ARCH_S5P4418) += s5p4418/
+obj-$(CONFIG_ARCH_NEXELL) += s5p-common/
arch/arm/cpu/armv7/s5p4418/Makefile new file +6 -0
new file mode 100644
index 0000000..321b257
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2016 Nexell
+# Hyunseok, Jung <[email protected]>
+
+obj-y += cpu.o
arch/arm/cpu/armv7/s5p4418/cpu.c new file +121 -0

121 lines not on this page · raw message

arch/arm/dts/Makefile +3 -0
index 9900b44..fbabcc0 100644
@@ -142,6 +142,9 @@ dtb-$(CONFIG_ROCKCHIP_RV1108) += \
 	rv1108-elgin-r1.dtb \
 	rv1108-evb.dtb
 
+dtb-$(CONFIG_ARCH_S5P4418) += \
+	s5p4418-nanopi2.dtb
+
 dtb-$(CONFIG_ARCH_MESON) += \
 	meson-gxbb-nanopi-k2.dtb \
 	meson-gxbb-odroidc2.dtb \
arch/arm/dts/s5p4418-nanopi2.dts new file +110 -0

110 lines not on this page · raw message

arch/arm/dts/s5p4418-pinctrl.dtsi new file +135 -0

135 lines not on this page · raw message

arch/arm/dts/s5p4418.dtsi new file +170 -0

170 lines not on this page · raw message

board/friendlyarm/Kconfig new file +37 -0
new file mode 100644
index 0000000..f8f9cfd
@@ -0,0 +1,37 @@
+choice
+	prompt "LCD backlight control"
+	optional
+	default S5P4418_ONEWIRE
+
+config S5P4418_ONEWIRE
+	bool "I2C / 1-Wire"
+	help
+	  This enables LCD-Backlight control for FriendlyARM LCD-panels.
+	  I2C is used if available, otherwise 1-Wire is used.
+
+config PWM_NX
+	bool "PWM"
+	help
+	  This enables LCD-Backlight control via PWM.
+endchoice
+
+config ROOT_DEV
+	int "ROOT_DEV"
+	help
+	  Environment variable rootdev is set to this value if env. var. firstboot
+	  does not exist. Otherwise rootdev is set to the MMC boot device. rootdev
+	  determines (together with env. var. bootpart) where the OS (linux) is
+	  booted from.
+
+config BOOT_PART
+	int "BOOT_PART"
+	help
+	  Environment variable bootpart is set to this value. bootpart determines
+	  (together with env. var. rootdev) where the OS (linux) is booted from.
+
+config ROOT_PART
+	int "ROOT_PART"
+	help
+	  Environment variable rootpart is set to this value.
+
+source "board/friendlyarm/nanopi2/Kconfig"
board/friendlyarm/nanopi2/Kconfig new file +12 -0
new file mode 100644
index 0000000..0f68422
@@ -0,0 +1,12 @@
+if TARGET_NANOPI2
+
+config SYS_BOARD
+	default "nanopi2"
+
+config SYS_VENDOR
+	default "friendlyarm"
+
+config SYS_CONFIG_NAME
+	default "s5p4418_nanopi2"
+
+endif
board/friendlyarm/nanopi2/MAINTAINERS new file +7 -0
new file mode 100644
index 0000000..c8e2ce7
@@ -0,0 +1,7 @@
+NANOPI2 BOARD
+NANOPC-T2 BOARD
+M:  Stefan Bosch <[email protected]>
+S:  Maintained
+F:  board/s5p4418/nanopi2/
+F:  include/configs/s5p4418_nanopi2.h
+F:  configs/s5p4418_nanopi2_defconfig
board/friendlyarm/nanopi2/Makefile new file +7 -0
new file mode 100644
index 0000000..5c8b3b7
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2016 Nexell
+# Hyunseok, Jung <[email protected]>
+
+obj-y	:= board.o hwrev.o lcds.o
+obj-$(CONFIG_S5P4418_ONEWIRE) += onewire.o
board/friendlyarm/nanopi2/board.c new file +575 -0

575 lines not on this page · raw message

board/friendlyarm/nanopi2/hwrev.c new file +108 -0

108 lines not on this page · raw message

board/friendlyarm/nanopi2/hwrev.h new file +15 -0
new file mode 100644
index 0000000..1b1a828
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0+
+ *
+ * Copyright (C) Guangzhou FriendlyARM Computer Tech. Co., Ltd.
+ * (http://www.friendlyarm.com)
+ */
+
+#ifndef __BD_HW_REV_H__
+#define __BD_HW_REV_H__
+
+extern void bd_hwrev_init(void);
+extern void bd_base_rev_init(void);
+extern u32 get_board_rev(void);
+extern const char *get_board_name(void);
+
+#endif /* __BD_HW_REV_H__ */
board/friendlyarm/nanopi2/lcds.c new file +697 -0

697 lines not on this page · raw message

board/friendlyarm/nanopi2/nxp-fb.h new file +94 -0

94 lines not on this page · raw message

board/friendlyarm/nanopi2/onewire.c new file +307 -0

307 lines not on this page · raw message

board/friendlyarm/nanopi2/onewire.h new file +15 -0
new file mode 100644
index 0000000..9f6d7cf
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0+
+ *
+ * Copyright (C) Guangzhou FriendlyARM Computer Tech. Co., Ltd.
+ * (http://www.friendlyarm.com)
+ */
+
+#ifndef __ONE_WIRE_H__
+#define __ONE_WIRE_H__
+
+extern void onewire_init(void);
+extern int  onewire_get_info(unsigned char *lcd, unsigned short *fw_ver);
+extern int  onewire_get_lcd_id(void);
+extern int  onewire_set_backlight(int brightness);
+
+#endif /* __ONE_WIRE_H__ */
Signature · 1 line
1.9.1
#26 lore raw

PATCH v4 13/14 arm: add support for SoC s5p4418 (cpu) / nanopi2 board

Quoted 36 lines · Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- SPL not supported yet --> no spl-dir in arch/arm/cpu/armv7/s5p4418/. Appropriate line in Makefile removed.
- cpu.c: '#include <cpu_func.h>' added.
- arch/arm/cpu/armv7/s5p4418/u-boot.lds removed, is not required anylonger.
- "obj-$(CONFIG_ARCH_NEXELL) += s5p-common/" added to arch/arm/cpu/armv7/Makefile since s5p-common/pwm.c is used instead of drivers/pwm/pwm-nexell.c.
- s5p4418.dtsi: '#include "../../../include/generated/autoconf.h"' removed, is not necessary, error at out-of-tree building. '#ifdef CONFIG_CPU_NXP4330'-blocks (2x) removed. Some minor changes regarding mmc. 'u-boot,dm-pre-reloc' added to dp0 because of added DM_VIDEO support.
- board/s5p4418/ renamed to board/friendlyarm/
- All s5p4418-boards except nanopi2 removed because there is no possibility to test the other boards.
- Kconfig: Changes to have a structure like mach-bcm283x (RaspberryPi), e.g. "config ..." entries moved from/to other Kconfig.
- "CONFIG_" removed from several s5p4418/nanopi2 specific defines because the appropriate values do not need to be configurable.
- nanopi2/board.c: All getenv(), getenv_ulong(), setenv() and saveenv() renamed to env_get(), env_get_ulong(), env_set() and env_save(), respectively. MACH_TYPE_S5P4418 is not defined anymore, therefore appropriate code removed (not necessary for DT-kernels).
- nanopi2/onewire.c: All crc8() renamed to crc8_ow() because crc8() is already defined in lib/crc8.c (with different parameters).
- dts: "nexell,s5pxx18-i2c" used instead of "i2c-gpio", i2c0 and i2c1 added. gmac-, ehci- and dwc2otg-entries removed because the appropriate functionality is not supported yet. New mmc-property "mmcboost" added.
s5p4418-pinctrl.dtsi: gmac-entries removed, mmc- and i2c-entries added.
- '#ifdef CONFIG...' changed to 'if (IS_ENABLED(CONFIG...))' where possible (and similar).

Quoted 1 line

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/e7e774b8/attachment.sig>
#27 lore raw

PATCH v4 14/14 arm: add (default) config for nanopi2 board

In reply to Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- Configuration changed, mainly several "CONFIG_..." moved from s5p4418_nanopi2.h to s5p4418_nanopi2_defconfig and USB related configs removed because USB is not supported yet.
- s5p4418_nanopi2.h: "CONFIG_" removed from several s5p4418/nanopi2 specific defines because the appropriate values do not need to be configurable.
- pinctrl is supported now, therefore "CONFIG_PINCTRL=y" added to s5p4418_nanopi2_defconfig.

---

(no changes since v3)

Changes in v3:
- CONFIG_SYS_RESERVE_MEM_SIZE removed, has not been used anymore
- s5p4418_nanopi2_defconfig: "CONFIG_PINCTRL=y" added because pinctrl is supported now. "CONFIG_EFI_LOADER=n" removed (there have been boot errors "efi_runtime_relocate: Unknown relocation type 0" at a previous U-Boot Version without this). "CONFIG_DM_I2C_GPIO=y" removed because I2C-peripherial is used (Nexell I2C driver). Some configs moved down for cosmetic reason.
- Handling of Configs for LCD backlight control reworked because (among others) not setting CONFIG_S5P4418_ONEWIRE and/or CONFIG_PWM_NX has caused errors when compiling board/friendlyarm/nanopi2/onewire.c.
- CONFIG_SYS_MEMTEST_START, CONFIG_SYS_MEMTEST_END, CONFIG_CMDLINE_TAG and CONFIG_CMD_BMP moved from s5p4418_nanopi2.h to s5p4418_nanopi2_defconfig.
- "#undef CONFIG_CMD_IMLS" removed in s5p4418_nanopi2.h

Changes in v2:
- USB related configs removed because USB is not supported yet.
- CONFIG_CMD_MEMTEST moved from s5p4418_nanopi2.h to s5p4418_nanopi2_defconfig.
- MAINTAINERS: "F: drivers/pwm/pwm-nexell*" deleted because arch/arm/cpu/armv7/s5p-common/pwm.c is used now. Furthermore double line "F: drivers/video/nexell/" deleted.

 MAINTAINERS                       |  17 +++
 configs/s5p4418_nanopi2_defconfig | 147 ++++++++++++++++++++++
 doc/README.s5p4418                |  63 ++++++++++
 include/configs/s5p4418_nanopi2.h | 257 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 484 insertions(+)
 create mode 100644 configs/s5p4418_nanopi2_defconfig
 create mode 100644 doc/README.s5p4418
 create mode 100644 include/configs/s5p4418_nanopi2.h
MAINTAINERS +17 -0
index 1fd975c..314162c 100644
@@ -270,6 +270,23 @@ F:	arch/arm/mach-at91/
 F:	board/atmel/
 F:	drivers/misc/microchip_flexcom.c
 
+ARM NEXELL S5P4418
+M:	Stefan Bosch <[email protected]>
+S:	Maintained
+F:	arch/arm/cpu/armv7/s5p4418/
+F:	arch/arm/dts/s5p4418*
+F:	arch/arm/mach-nexell/
+F:	board/friendlyarm/
+F:	configs/s5p4418_nanopi2_defconfig
+F:	doc/README.s5p4418
+F:	drivers/gpio/nx_gpio.c
+F:	drivers/i2c/nx_i2c.c
+F:	drivers/mmc/nexell_dw_mmc_dm.c
+F:	drivers/pinctrl/nexell/
+F:	drivers/video/nexell/
+F:	drivers/video/nexell_display.c
+F:	include/configs/s5p4418_nanopi2.h
+
 ARM OWL
 M:	Manivannan Sadhasivam <[email protected]>
 S:	Maintained
configs/s5p4418_nanopi2_defconfig new file +147 -0

147 lines not on this page · raw message

doc/README.s5p4418 new file +63 -0

63 lines not on this page · raw message

include/configs/s5p4418_nanopi2.h new file +257 -0

257 lines not on this page · raw message

Signature · 1 line
1.9.1
#28 lore raw

PATCH v4 14/14 arm: add (default) config for nanopi2 board

Quoted 11 lines · Stefan Bosch

Changes in relation to FriendlyARM's U-Boot nanopi2-v2016.01:
- Configuration changed, mainly several "CONFIG_..." moved from s5p4418_nanopi2.h to s5p4418_nanopi2_defconfig and USB related configs removed because USB is not supported yet.
- s5p4418_nanopi2.h: "CONFIG_" removed from several s5p4418/nanopi2 specific defines because the appropriate values do not need to be configurable.
- pinctrl is supported now, therefore "CONFIG_PINCTRL=y" added to s5p4418_nanopi2_defconfig.

Quoted 1 line

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200729/d705c055/attachment.sig>