Skip to contentSkip to conversation

board: qnap-ts433: Cleanups + add support for TS233

PATCH In review Heiko Stuebner 3 participants 25 messages Jan 14 – Mar 9

Subsystems (3)
lore
Share & tools
lore

Heiko Stuebner

author maintainer
#0 lore raw

v2 cover board: qnap-ts433: Cleanups + add support for TS233

This series does a number of cleanups for the existing TS433 NAS, and also introduces support for a second device.

Right now the code can detect the variant from the I2C eeprom(s) and set the fdtfile accordingly. Later on (once I figured out what is needed) this should also select an optional overlay, because later model-variants do have additional per-disk presence detection and also regulator-handling that is not present on the earlier versions.

Heiko Stuebner (12):
rockchip: board: qnap-ts433: Fix TPL binary in build-example
rockchip: board: qnap-ts433: drop DW_MMC config options
rockchip: board: qnap-ts433: Fix dir naming to allow build-system to
find it
rockchip: board: qnap-ts433: Update documentation to recent tool
versions
rockchip: board: qnap-ts433: Add instructions for how to use upstream
TF-A
rockchip: board: qnap-ts433: Support multiple models of the TSx33
family
arm64: dts: rockchip: move cpu_thermal node to the correct position
arm64: dts: rockchip: describe mcu eeprom cells on rk3568-ts433
arm64: dts: rockchip: move common qnap tsx33 parts to dtsi
arm64: dts: rockchip: add QNAP TS233 devicetree
rockchip: board: qnap-ts433: Rename the board code to not be TS433
specific
rockchip: board: qnap-tsx33: add support for Qnap TS233 devices

 arch/arm/dts/rk3568-qnap-ts233-u-boot.dtsi    |   6 +
 arch/arm/mach-rockchip/rk3568/Kconfig         |  17 +-
 board/qnap/ts433/MAINTAINERS                  |   8 -
 board/qnap/{ts433 => tsx33_rk356x}/Kconfig    |   6 +-
 board/qnap/tsx33_rk356x/MAINTAINERS           |  10 +
 board/qnap/tsx33_rk356x/Makefile              |   7 +
 board/qnap/tsx33_rk356x/board.c               | 386 +++++++++++
 configs/qnap-ts233-rk3568_defconfig           |  85 +++
 configs/qnap-ts433-rk3568_defconfig           |   6 +-
 doc/board/qnap/ts233.rst                      |  37 ++
 doc/board/qnap/ts433.rst                      |  34 +-
 .../src/arm64/rockchip/rk3568-qnap-ts233.dts  | 131 ++++
 .../src/arm64/rockchip/rk3568-qnap-ts433.dts  | 604 ++---------------
 .../src/arm64/rockchip/rk3568-qnap-tsx33.dtsi | 608 ++++++++++++++++++
 .../configs/{qnap_ts433.h => tsx33_rk356x.h}  |   0
 15 files changed, 1352 insertions(+), 593 deletions(-)
 create mode 100644 arch/arm/dts/rk3568-qnap-ts233-u-boot.dtsi
 delete mode 100644 board/qnap/ts433/MAINTAINERS
 rename board/qnap/{ts433 => tsx33_rk356x}/Kconfig (52%)
 create mode 100644 board/qnap/tsx33_rk356x/MAINTAINERS
 create mode 100644 board/qnap/tsx33_rk356x/Makefile
 create mode 100644 board/qnap/tsx33_rk356x/board.c
 create mode 100644 configs/qnap-ts233-rk3568_defconfig
 create mode 100644 doc/board/qnap/ts233.rst
 create mode 100644 dts/upstream/src/arm64/rockchip/rk3568-qnap-ts233.dts
 create mode 100644 dts/upstream/src/arm64/rockchip/rk3568-qnap-tsx33.dtsi
 rename include/configs/{qnap_ts433.h => tsx33_rk356x.h} (100%)
Signature · 1 line
2.47.2
author maintainer
#1 lore raw

PATCH v2 1/12 rockchip: board: qnap-ts433: Fix TPL binary in build-example

In the example on how to modify the serial-console in the TPL binary we already use the v1.21 of the 1560MHz DDR-init binary.

Yet in the build-example the TPL link goes to v1.13 of the 1056MHz DDR-init.

Not only will that setup reduce performance but it also will prevent actual serial output from the DDR init, because someone following the examples will have modified a different binary.

I've been running the 1560MHz DDR-speed in all my tests on now 3 different devices and never saw any issues with it, so adapt the build-example to link to the faster binary.

Fixes d3cacb79e706 ("board: rockchip: add support for Qnap TS433 devices")
---
 doc/board/qnap/ts433.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
doc/board/qnap/ts433.rst +1 -1
index 1e1bfbb9190..5e5f0394ada 100644
@@ -46,7 +46,7 @@ Building U-Boot
 
     $ export CROSS_COMPILE=aarch64-linux-gnu-
     $ export BL31=../rkbin/bin/rk35/rk3568_bl31_v1.34.elf
-    $ export ROCKCHIP_TPL=../rkbin/bin/rk35/rk3568_ddr_1056MHz_v1.13.bin
+    $ export ROCKCHIP_TPL=../rkbin/bin/rk35/rk3568_ddr_1560MHz_v1.21.bin
     $ make qnap-ts433-rk3568_defconfig
     $ make
 
Signature · 1 line
2.47.2
Reviewed-by on v2 1/12
#2 lore raw

Re: [PATCH v2 01/12] rockchip: board: qnap-ts433: Fix TPL binary in build-example

Hi Heiko,

Quoted 6 lines · Heiko Stuebner

In the example on how to modify the serial-console in the TPL binary we already use the v1.21 of the 1560MHz DDR-init binary.

Yet in the build-example the TPL link goes to v1.13 of the 1056MHz DDR-init.

May I suggest to set BL31 earlier, such that one can use $BL31 as parameter to tools/ddrbin_tool and we don't need to worry about having them out of sync?

Also, both are for versions that are not the latest in rkbin git repo.
May I suggest to provide the commit hash to checkout for this to work, or to adapt the instructions to use the latest available binary?
See the instructions for Jaguar for example. Also, there's a sed command there which is probably more user-friendly than asking the user to manually patch the file with a diff?

Same for BL31 for that matter.

Also the ddbin_tool is now a python script with different arguments, so you'll need to update that as well.

And the version of the spl_loader file will probably also be different.

Finally, how about using the usb-471 and usb-472 binaries we now generate instead of the output of tools/boot_merger with the default binaries from rkbin?

I'm wondering if we shouldn't reverse engineer tools/boot_merger so we can generate an image usable with rkdeveloptool straight out of binman for example.

Only suggestions (highly recommend either hardcoding the commit hash or using globs/logic to find the appropriate file from latest version in the repo), thus:

Thanks!
Quentin

Reviewed-by on v2 1/12
#3 lore raw

Re: [PATCH v2 01/12] rockchip: board: qnap-ts433: Fix TPL binary in build-example

In reply to Heiko Stuebner
Quoted 10 lines · Heiko Stuebner

In the example on how to modify the serial-console in the TPL binary we already use the v1.21 of the 1560MHz DDR-init binary.

Yet in the build-example the TPL link goes to v1.13 of the 1056MHz DDR-init.

Not only will that setup reduce performance but it also will prevent actual serial output from the DDR init, because someone following the examples will have modified a different binary.

Quoted 7 lines

I've been running the 1560MHz DDR-speed in all my tests on now 3 different devices and never saw any issues with it, so adapt the build-example to link to the faster binary.

Fixes d3cacb79e706 ("board: rockchip: add support for Qnap TS433 devices")

Thanks,
- Kever

Quoted 17 lines
---
  doc/board/qnap/ts433.rst | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
doc/board/qnap/ts433.rst +1 -1
index 1e1bfbb9190..5e5f0394ada 100644
@@ -46,7 +46,7 @@ Building U-Boot
 
      $ export CROSS_COMPILE=aarch64-linux-gnu-
      $ export BL31=../rkbin/bin/rk35/rk3568_bl31_v1.34.elf
-    $ export ROCKCHIP_TPL=../rkbin/bin/rk35/rk3568_ddr_1056MHz_v1.13.bin
+    $ export ROCKCHIP_TPL=../rkbin/bin/rk35/rk3568_ddr_1560MHz_v1.21.bin
      $ make qnap-ts433-rk3568_defconfig
      $ make
 
author maintainer
#4 lore raw

PATCH v2 2/12 rockchip: board: qnap-ts433: drop DW_MMC config options

In reply to Heiko Stuebner

The TS433 does not have a SD-card slot, just the separate SDHCI-controlled EMMC on the board.

So drop the 2 config options.

Fixes d3cacb79e706 ("board: rockchip: add support for Qnap TS433 devices")
---
 configs/qnap-ts433-rk3568_defconfig | 2 --
 1 file changed, 2 deletions(-)
configs/qnap-ts433-rk3568_defconfig +0 -2
index 1e494073bc9..ebcd3b69e90 100644
@@ -51,8 +51,6 @@ CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_MISC=y
 CONFIG_SUPPORT_EMMC_RPMB=y
-CONFIG_MMC_DW=y
-CONFIG_MMC_DW_ROCKCHIP=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
 CONFIG_MMC_SDHCI_ROCKCHIP=y
Signature · 1 line
2.47.2
Reviewed-by on v2 2/12
#5 lore raw

Re: [PATCH v2 02/12] rockchip: board: qnap-ts433: drop DW_MMC config options

Hi Heiko,

Quoted 5 lines · Heiko Stuebner

The TS433 does not have a SD-card slot, just the separate SDHCI-controlled EMMC on the board.

So drop the 2 config options.

Thanks!
Quentin

Reviewed-by on v2 2/12
#6 lore raw

Re: [PATCH v2 02/12] rockchip: board: qnap-ts433: drop DW_MMC config options

In reply to Heiko Stuebner
Quoted 7 lines · Heiko Stuebner

The TS433 does not have a SD-card slot, just the separate SDHCI-controlled EMMC on the board.

So drop the 2 config options.

Fixes d3cacb79e706 ("board: rockchip: add support for Qnap TS433 devices")

Thanks,
- Kever

Quoted 17 lines
---
  configs/qnap-ts433-rk3568_defconfig | 2 --
  1 file changed, 2 deletions(-)
configs/qnap-ts433-rk3568_defconfig +0 -2
index 1e494073bc9..ebcd3b69e90 100644
@@ -51,8 +51,6 @@ CONFIG_LED=y
  CONFIG_LED_GPIO=y
  CONFIG_MISC=y
  CONFIG_SUPPORT_EMMC_RPMB=y
-CONFIG_MMC_DW=y
-CONFIG_MMC_DW_ROCKCHIP=y
  CONFIG_MMC_SDHCI=y
  CONFIG_MMC_SDHCI_SDMA=y
  CONFIG_MMC_SDHCI_ROCKCHIP=y
author maintainer
#7 lore raw

PATCH v2 3/12 rockchip: board: qnap-ts433: Fix dir naming to allow build-system to find it

In reply to Heiko Stuebner

Right now the board directory for the TS433 only contains its Kconfig which is linked to directly from the main RK3568 Kconfig.

But as the namings are currently set, the build system will never find the board directory to check if it contains something to build.

So adapt the board naming to a pattern similar to all the other boards (boardname_rkSoC).

Fixes d3cacb79e706 ("board: rockchip: add support for Qnap TS433 devices")
---
 arch/arm/mach-rockchip/rk3568/Kconfig            | 2 +-
 board/qnap/{ts433 => ts433_rk3568}/Kconfig       | 4 ++--
 board/qnap/{ts433 => ts433_rk3568}/MAINTAINERS   | 2 +-
 include/configs/{qnap_ts433.h => ts433_rk3568.h} | 0
 4 files changed, 4 insertions(+), 4 deletions(-)
 rename board/qnap/{ts433 => ts433_rk3568}/Kconfig (70%)
 rename board/qnap/{ts433 => ts433_rk3568}/MAINTAINERS (87%)
 rename include/configs/{qnap_ts433.h => ts433_rk3568.h} (100%)
arch/arm/mach-rockchip/rk3568/Kconfig +1 -1
index 2730220a18e..16e14ee4fa7 100644
@@ -76,7 +76,7 @@ source "board/hardkernel/odroid_m1/Kconfig"
 source "board/hardkernel/odroid_m1s/Kconfig"
 source "board/pine64/quartz64_rk3566/Kconfig"
 source "board/powkiddy/x55/Kconfig"
-source "board/qnap/ts433/Kconfig"
+source "board/qnap/ts433_rk3568/Kconfig"
 source "board/radxa/zero3-rk3566/Kconfig"
 source "board/xunlong/orangepi-3b-rk3566/Kconfig"
 
board/qnap/ts433_rk3568/Kconfig renamed from board/qnap/ts433/Kconfig +2 -2
similarity index 70%
rename from board/qnap/ts433/Kconfig
rename to board/qnap/ts433_rk3568/Kconfig
index b00e1f9f2ef..c5f9db849f2 100644
@@ -1,12 +1,12 @@
 if TARGET_QNAP_TS433_RK3568
 
 config SYS_BOARD
-	default "qnap_ts433"
+	default "ts433_rk3568"
 
 config SYS_VENDOR
 	default "qnap"
 
 config SYS_CONFIG_NAME
-	default "qnap_ts433"
+	default "ts433_rk3568"
 
 endif
board/qnap/ts433_rk3568/MAINTAINERS renamed from board/qnap/ts433/MAINTAINERS +1 -1
similarity index 87%
rename from board/qnap/ts433/MAINTAINERS
rename to board/qnap/ts433_rk3568/MAINTAINERS
index c2b31ad9794..02ce7ff383c 100644
@@ -1,7 +1,7 @@
 QNAP-TS433
 M:	Heiko Stuebner <[email protected]>
 S:	Maintained
-F:	board/qnap/ts433/
+F:	board/qnap/ts433_rk3568/
 F:	doc/board/qnap/
 F:	include/configs/qnap_ts433.h
 F:	configs/qnap-ts433-rk3568_defconfig
include/configs/ts433_rk3568.h renamed from include/configs/qnap_ts433.h +0 -0
similarity index 100%
rename from include/configs/qnap_ts433.h
rename to include/configs/ts433_rk3568.h
Signature · 1 line
2.47.2
#8 lore raw

Re: [PATCH v2 03/12] rockchip: board: qnap-ts433: Fix dir naming to allow build-system to find it

Hi Heiko,

Quoted 42 lines · Heiko Stuebner

Right now the board directory for the TS433 only contains its Kconfig which is linked to directly from the main RK3568 Kconfig.

But as the namings are currently set, the build system will never find the board directory to check if it contains something to build.

So adapt the board naming to a pattern similar to all the other boards (boardname_rkSoC).

Fixes d3cacb79e706 ("board: rockchip: add support for Qnap TS433 devices")
---
  arch/arm/mach-rockchip/rk3568/Kconfig            | 2 +-
  board/qnap/{ts433 => ts433_rk3568}/Kconfig       | 4 ++--
  board/qnap/{ts433 => ts433_rk3568}/MAINTAINERS   | 2 +-
  include/configs/{qnap_ts433.h => ts433_rk3568.h} | 0
  4 files changed, 4 insertions(+), 4 deletions(-)

rename board/qnap/{ts433 => ts433_rk3568}/Kconfig (70%) rename board/qnap/{ts433 => ts433_rk3568}/MAINTAINERS (87%) rename include/configs/{qnap_ts433.h => ts433_rk3568.h} (100%)

arch/arm/mach-rockchip/rk3568/Kconfig +1 -1
index 2730220a18e..16e14ee4fa7 100644
@@ -76,7 +76,7 @@ source "board/hardkernel/odroid_m1/Kconfig"
  source "board/hardkernel/odroid_m1s/Kconfig"
  source "board/pine64/quartz64_rk3566/Kconfig"
  source "board/powkiddy/x55/Kconfig"
-source "board/qnap/ts433/Kconfig"
+source "board/qnap/ts433_rk3568/Kconfig"
  source "board/radxa/zero3-rk3566/Kconfig"
  source "board/xunlong/orangepi-3b-rk3566/Kconfig"
 
board/qnap/ts433_rk3568/Kconfig renamed from board/qnap/ts433/Kconfig +0 -0
similarity index 70%
rename from board/qnap/ts433/Kconfig
rename to board/qnap/ts433_rk3568/Kconfig
index b00e1f9f2ef..c5f9db849f2 100644

board/qnap/ts433_rk3568/Kconfig line 4

Quoted 5 lines
board/qnap/ts433_rk3568/Kconfig renamed from board/qnap/ts433/Kconfig +1 -1
@@ -1,12 +1,12 @@
  if TARGET_QNAP_TS433_RK3568
 
  config SYS_BOARD
-	default "qnap_ts433"
+	default "ts433_rk3568"

SYS_BOARD is used in the default environment so this would change it and not be backward compatible... Is this something we're ok with? I'm not sure it is worth it?

I also see you're modifying it again in a later patch in this series.

Another option is to make use of HAVE_VENDOR_COMMON_LIB mechanism such that you have board/qnap/common/ where you can put files in common without having to modify the existing layout?

You can also have a symlink if you reaaaally want board/qnap/qnap_ts433 to be board/qnap/ts433_rk3568? Hopefully that works.

In essence, I'm conflicted about this change but hopefully nobody actually uses the "board" environment variable?

Quoted 17 lines
board/qnap/ts433_rk3568/Kconfig renamed from board/qnap/ts433/Kconfig +1 -1
  config SYS_VENDOR
  	default "qnap"
 
  config SYS_CONFIG_NAME
-	default "qnap_ts433"
+	default "ts433_rk3568"
 
  endif
board/qnap/ts433_rk3568/MAINTAINERS renamed from board/qnap/ts433/MAINTAINERS +0 -0
similarity index 87%
rename from board/qnap/ts433/MAINTAINERS
rename to board/qnap/ts433_rk3568/MAINTAINERS
index c2b31ad9794..02ce7ff383c 100644

board/qnap/ts433_rk3568/MAINTAINERS line 6

Quoted 7 lines
board/qnap/ts433_rk3568/MAINTAINERS renamed from board/qnap/ts433/MAINTAINERS +1 -1
@@ -1,7 +1,7 @@
  QNAP-TS433
  M:	Heiko Stuebner <[email protected]>
  S:	Maintained
-F:	board/qnap/ts433/
+F:	board/qnap/ts433_rk3568/
  F:	doc/board/qnap/
  F:	include/configs/qnap_ts433.h

Missing rename here...

include/configs/ts433_rk3568.h

Quoted 5 lines
board/qnap/ts433_rk3568/MAINTAINERS renamed from board/qnap/ts433/MAINTAINERS +0 -0
  F:	configs/qnap-ts433-rk3568_defconfig
include/configs/ts433_rk3568.h renamed from include/configs/qnap_ts433.h +0 -0
similarity index 100%
rename from include/configs/qnap_ts433.h
rename to include/configs/ts433_rk3568.h

... since you rename it here.

Cheers,
Quentin

author maintainer
#9 lore raw

PATCH v2 4/12 rockchip: board: qnap-ts433: Update documentation to recent tool versions

In reply to Heiko Stuebner

ddr_tool was migrated from a binary to a python implementation ddr_tool.py The ddr-init binaries were also upgraded to new versions.

---
 doc/board/qnap/ts433.rst | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
doc/board/qnap/ts433.rst +4 -4
index 5e5f0394ada..2cd7cf13d67 100644
@@ -36,7 +36,7 @@ modification and also a new maskrom downloader can be build:
 
 .. code-block:: bash
 
-    $ tools/ddrbin_tool rk3568 tools/ddrbin_param.txt bin/rk35/rk3568_ddr_1560MHz_v1.21.bin
+    $ tools/ddrbin_tool.py rk3568 tools/ddrbin_param.txt bin/rk35/rk3568_ddr_1560MHz_v1.23.bin
     $ tools/boot_merger RKBOOT/RK3568MINIALL.ini
 
 Building U-Boot
@@ -45,8 +45,8 @@ Building U-Boot
 .. code-block:: bash
 
     $ export CROSS_COMPILE=aarch64-linux-gnu-
-    $ export BL31=../rkbin/bin/rk35/rk3568_bl31_v1.34.elf
-    $ export ROCKCHIP_TPL=../rkbin/bin/rk35/rk3568_ddr_1560MHz_v1.21.bin
+    $ export BL31=../rkbin/bin/rk35/rk3568_bl31_v1.45.elf
+    $ export ROCKCHIP_TPL=../rkbin/bin/rk35/rk3568_ddr_1560MHz_v1.23.bin
     $ make qnap-ts433-rk3568_defconfig
     $ make
 
@@ -87,5 +87,5 @@ example as package of that name in Debian-based distributions:
 
 .. code-block:: bash
 
-    $ rkdeveloptool db rk356x_spl_loader_v1.21.113.bin
+    $ rkdeveloptool db rk356x_spl_loader_v1.23.114.bin
     $ rkdeveloptool wl 64 u-boot-rockchip.bin
Signature · 1 line
2.47.2
Reviewed-by on v2 4/12
#10 lore raw

Re: [PATCH v2 04/12] rockchip: board: qnap-ts433: Update documentation to recent tool versions

Hi Heiko,

Quoted 3 lines · Heiko Stuebner

ddr_tool was migrated from a binary to a python implementation ddr_tool.py The ddr-init binaries were also upgraded to new versions.

Thanks!
Quentin

author maintainer
#11 lore raw

PATCH v2 5/12 rockchip: board: qnap-ts433: Add instructions for how to use upstream TF-A

In reply to Heiko Stuebner

Upstream TF-A has basic support for RK3568 for a while, but only with the last release finally gained also cpufreq support.

The only known missing piece is enabling the ARM crypto extensions, but otherwise upstream TF-A is fully usable now.

So steal and adapt Quentin's wording from tiger-rk3588 on how to use either upstream or vendor TF-A.

---
 doc/board/qnap/ts433.rst | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
doc/board/qnap/ts433.rst +27 -1
index 2cd7cf13d67..5c81dc953a6 100644
@@ -39,17 +39,43 @@ modification and also a new maskrom downloader can be build:
     $ tools/ddrbin_tool.py rk3568 tools/ddrbin_param.txt bin/rk35/rk3568_ddr_1560MHz_v1.23.bin
     $ tools/boot_merger RKBOOT/RK3568MINIALL.ini
 
+Get TF-A
+--------
+
+There are two possible options, pick one or the other.
+
+Prebuilt binary from Rockchip
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. prompt:: bash
+
+   $ export BL31=../rkbin/bin/rk35/rk3568_bl31_v1.45.elf
+
+Upstream
+~~~~~~~~
+
+.. prompt:: bash
+
+   git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
+   cd trusted-firmware-a
+   make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3568 bl31
+   export BL31=$PWD/build/rk3568/release/bl31/bl31.elf
+
 Building U-Boot
 ---------------
 
 .. code-block:: bash
 
     $ export CROSS_COMPILE=aarch64-linux-gnu-
-    $ export BL31=../rkbin/bin/rk35/rk3568_bl31_v1.45.elf
     $ export ROCKCHIP_TPL=../rkbin/bin/rk35/rk3568_ddr_1560MHz_v1.23.bin
     $ make qnap-ts433-rk3568_defconfig
     $ make
 
+.. note::
+   If using upstream TF-A, one should disable ``SPL_ATF_NO_PLATFORM_PARAM`` symbol in
+   U-Boot config (via e.g. ``make CROSS_COMPILE=aarch64-linux-gnu- menuconfig``) which
+   will, among other things, enable console output in TF-A.
+
 This will build ``u-boot-rockchip.bin`` which can be written to the
 on-board eMMC.
 
Signature · 1 line
2.47.2
Reviewed-by on v2 5/12
#12 lore raw

Re: [PATCH v2 05/12] rockchip: board: qnap-ts433: Add instructions for how to use upstream TF-A

Hi Heiko,

Quoted 6 lines · Heiko Stuebner

Upstream TF-A has basic support for RK3568 for a while, but only with the last release finally gained also cpufreq support.

The only known missing piece is enabling the ARM crypto extensions, but otherwise upstream TF-A is fully usable now.

Missing ARM crypto extensions means crypto stuff is going to be slower, not broken right?

Quoted 3 lines

So steal and adapt Quentin's wording from tiger-rk3588 on how to use either upstream or vendor TF-A.

I see you carefully removed the logic to detect the proper file to use without having to hardcode the version number though ;)

Quoted 41 lines
---
  doc/board/qnap/ts433.rst | 28 +++++++++++++++++++++++++++-
  1 file changed, 27 insertions(+), 1 deletion(-)
doc/board/qnap/ts433.rst +22 -0
index 2cd7cf13d67..5c81dc953a6 100644
@@ -39,17 +39,43 @@ modification and also a new maskrom downloader can be build:
      $ tools/ddrbin_tool.py rk3568 tools/ddrbin_param.txt bin/rk35/rk3568_ddr_1560MHz_v1.23.bin
      $ tools/boot_merger RKBOOT/RK3568MINIALL.ini
 
+Get TF-A
+--------
+
+There are two possible options, pick one or the other.
+
+Prebuilt binary from Rockchip
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. prompt:: bash
+
+   $ export BL31=../rkbin/bin/rk35/rk3568_bl31_v1.45.elf
+
+Upstream
+~~~~~~~~
+
+.. prompt:: bash
+
+   git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
+   cd trusted-firmware-a
+   make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3568 bl31
+   export BL31=$PWD/build/rk3568/release/bl31/bl31.elf
+
  Building U-Boot
  ---------------
 
  .. code-block:: bash
 
      $ export CROSS_COMPILE=aarch64-linux-gnu-

doc/board/qnap/ts433.rst modification and also a new maskrom downloader can be build: · line 78

Quoted 10 lines
doc/board/qnap/ts433.rst +5 -1
-    $ export BL31=../rkbin/bin/rk35/rk3568_bl31_v1.45.elf
      $ export ROCKCHIP_TPL=../rkbin/bin/rk35/rk3568_ddr_1560MHz_v1.23.bin
      $ make qnap-ts433-rk3568_defconfig
      $ make
 
+.. note::
+   If using upstream TF-A, one should disable ``SPL_ATF_NO_PLATFORM_PARAM`` symbol in
+   U-Boot config (via e.g. ``make CROSS_COMPILE=aarch64-linux-gnu- menuconfig``) which
+   will, among other things, enable console output in TF-A.
+

Wondering if we shouldn't add a config fragment which disables that, such that it's easier for the user (and can be part of build systems).

In any case, unrelated, so:

Thanks!
Quentin

author maintainer
#13 lore raw

PATCH v2 6/12 rockchip: board: qnap-ts433: Support multiple models of the TSx33 family

In reply to Heiko Stuebner

The RK3568-based NAS systems share a common basic structure and mainly only differ in the number of available hard-drive slots.

They also contain EEPROMs on their mainboard and backplane, that contain identifying information and therefore make it possible to determine the model at runtime.

There are 3 different formats for identifiers found on TSx33 models in the wild, which can only be distinguised by the position of dashes ("-") in them, so the code determines which format it is, and uses a dedicated decoder function to get the relevant information.

Add that EEPROM reading and model association, to set the correct devicetree filename for the OS that gets booted. This allows to just set fdtdir in extlinux and have u-boot then load the correct devicetree.

For u-boot itself, all models are similar enough up to the emmc that in theory we wouldn't necessarily need to diversify here, especially as reading the eeproms gets tricky at the stage where embedded_dtb_select would run. But especially the still to introduce TS133 does have a quite different USB setup, so definitly will need its own DTB.

So for now, we'll still need separate configs per model, but can share the board-code. I do hope to consolidate this further in the future.

---
 board/qnap/ts433_rk3568/Makefile    |   7 +
 board/qnap/ts433_rk3568/board.c     | 386 ++++++++++++++++++++++++++++
 configs/qnap-ts433-rk3568_defconfig |   2 +
 3 files changed, 395 insertions(+)
 create mode 100644 board/qnap/ts433_rk3568/Makefile
 create mode 100644 board/qnap/ts433_rk3568/board.c
board/qnap/ts433_rk3568/Makefile new file +7 -0
new file mode 100644
index 00000000000..d87f916d00b
@@ -0,0 +1,7 @@
+#
+# (C) Copyright 2026 Heiko Stuebner <[email protected]>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y	+= board.o
board/qnap/ts433_rk3568/board.c new file +386 -0

386 lines not on this page · raw message

configs/qnap-ts433-rk3568_defconfig +2 -0
index ebcd3b69e90..dfb240ed70f 100644
@@ -24,6 +24,7 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_MAX_SIZE=0x40000
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 CONFIG_SPL_ATF=y
+CONFIG_BOARD_TYPES=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -50,6 +51,7 @@ CONFIG_SYS_I2C_ROCKCHIP=y
 CONFIG_LED=y
 CONFIG_LED_GPIO=y
 CONFIG_MISC=y
+CONFIG_I2C_EEPROM=y
 CONFIG_SUPPORT_EMMC_RPMB=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
Signature · 1 line
2.47.2
#14 lore raw

Re: [PATCH v2 06/12] rockchip: board: qnap-ts433: Support multiple models of the TSx33 family

Hi Heiko,

Quoted 9 lines · Heiko Stuebner

The RK3568-based NAS systems share a common basic structure and mainly only differ in the number of available hard-drive slots.

They also contain EEPROMs on their mainboard and backplane, that contain identifying information and therefore make it possible to determine the model at runtime.

There are 3 different formats for identifiers found on TSx33 models in the wild, which can only be distinguised by the position of dashes ("-")

s/distinguised/distinguished/

Quoted 7 lines

in them, so the code determines which format it is, and uses a dedicated decoder function to get the relevant information.

Add that EEPROM reading and model association, to set the correct devicetree filename for the OS that gets booted. This allows to just set fdtdir in extlinux and have u-boot then load the correct devicetree.

Quoted 5 lines

For u-boot itself, all models are similar enough up to the emmc that in theory we wouldn't necessarily need to diversify here, especially as reading the eeproms gets tricky at the stage where embedded_dtb_select would run. But especially the still to introduce TS133 does have a quite different USB setup, so definitly will need its own DTB.

s/definitly/definitely/

Quoted 19 lines

So for now, we'll still need separate configs per model, but can share the board-code. I do hope to consolidate this further in the future.

---
  board/qnap/ts433_rk3568/Makefile    |   7 +
  board/qnap/ts433_rk3568/board.c     | 386 ++++++++++++++++++++++++++++
  configs/qnap-ts433-rk3568_defconfig |   2 +
  3 files changed, 395 insertions(+)

create mode 100644 board/qnap/ts433_rk3568/Makefile create mode 100644 board/qnap/ts433_rk3568/board.c

board/qnap/ts433_rk3568/Makefile new file +0 -0
new file mode 100644
index 00000000000..d87f916d00b

board/qnap/ts433_rk3568/Makefile line 7

Quoted 7 lines
board/qnap/ts433_rk3568/Makefile new file +7 -0
@@ -0,0 +1,7 @@
+#
+# (C) Copyright 2026 Heiko Stuebner <[email protected]>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y	+= board.o

Only build for non-SPL...

"""
ifneq ($(CONFIG_XPL_BUILD),y)
obj-y += board.o
endif
"""

Quoted 11 lines
board/qnap/ts433_rk3568/board.c new file +5 -0
new file mode 100644
index 00000000000..006add6fb30
@@ -0,0 +1,386 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2026 Heiko Stuebner <[email protected]>
+ */
+

board/qnap/ts433_rk3568/board.c line 15

Quoted 10 lines
board/qnap/ts433_rk3568/board.c new file +10 -0
+#include <dm.h>
+#include <env.h>
+#include <i2c_eeprom.h>
+#include <init.h>
+#include <net.h>
+#include <netdev.h>
+#include <vsprintf.h>
+
+#ifndef CONFIG_XPL_BUILD
+

... to avoid this big ifdef.

board/qnap/ts433_rk3568/board.c line 20

Quoted 5 lines
board/qnap/ts433_rk3568/board.c new file +5 -0
+DECLARE_GLOBAL_DATA_PTR;
+
+#define DTB_DIR			"rockchip/"
+
+struct tsx33_model {

Please document members (bp meaning wasn't so obvious, had to read a bit more to get that this was meant as backplane).

board/qnap/ts433_rk3568/board.c line 30

Quoted 10 lines
board/qnap/ts433_rk3568/board.c new file +10 -0
+	const char *mb;
+	const u8 mb_pcb;
+	const char *bp;
+	const u8 bp_pcb;
+	const char *name;
+	const char *fdtfile;
+};
+
+/*
+ * gd->board_type is unsigned long, so start at 1 for actual found types

Don't understand why that justifies starting at 1?

board/qnap/ts433_rk3568/board.c line 35

Quoted 5 lines
board/qnap/ts433_rk3568/board.c new file +5 -0
+ * The numeric PCB ids should be matched against the highest available
+ * one for best feature matching. For example Q0AI0_13 gained per-disk
+ * gpios for presence detection and power-control. Similar changes
+ * for the other boards.
+ * So the list should be sorted higest to lowest pcb-id.

s/higest/highest/

board/qnap/ts433_rk3568/board.c line 47

Quoted 12 lines
board/qnap/ts433_rk3568/board.c new file +12 -0
+ */
+enum tsx33_device_id {
+	UNKNOWN_TSX33 = 0,
+	Q0AI0_13,
+	Q0AI0_11,
+	Q0AJ0_Q0AM0_12_11,
+	Q0AJ0_Q0AM0_11_10,
+	Q0B20_Q0AW0_12_10,
+	Q0B20_Q0B30_12_10,
+	Q0B20_Q0B30_10_10,
+	QA0110_10,
+	TSX33_MODELS,

Because you start at 1, this means this represents n+1 supported models.

board/qnap/ts433_rk3568/board.c line 55

Quoted 8 lines
board/qnap/ts433_rk3568/board.c new file +8 -0
+};
+
+/*
+ * All TSx33 devices consist of a mainboard and possible backplane.
+ * Each board has a model identifier and a pcb code written to an eeprom
+ * on it. Later board revisions got per-harddrive presence detection
+ * and power-supply switches, so might need an overlay applied later on
+ * to support those.

Maybe make the last sentence a TODO: ?

Quoted 75 lines
board/qnap/ts433_rk3568/board.c new file +75 -0
+ */
+static const struct tsx33_model tsx33_models[TSX33_MODELS] = {
+	[UNKNOWN_TSX33] = {
+		"UNKNOWN",
+		0,
+		NULL,
+		0,
+		"Unknown TSx33",
+		NULL,
+	},
+	[Q0AI0_13] = {
+		"Q0AI0",
+		13,
+		NULL,
+		0,
+		"TS133",
+		NULL, /* not yet supported */
+	},
+	[Q0AI0_11] = {
+		"Q0AI0",
+		11,
+		NULL,
+		0,
+		"TS133",
+		NULL, /* not yet supported */
+	},
+	[Q0AJ0_Q0AM0_12_11] = {
+		"Q0AJ0",
+		12,
+		"Q0AM0",
+		11,
+		"TS233",
+		NULL, /* not yet supported */
+	},
+	[Q0AJ0_Q0AM0_11_10] = {
+		"Q0AJ0",
+		11,
+		"Q0AM0",
+		10,
+		"TS233",
+		NULL, /* not yet supported */
+	},
+	[Q0B20_Q0AW0_12_10] = {
+		"Q0B20",
+		12,
+		"Q0AW0",
+		10,
+		"TS216G",
+		NULL, /* not yet supported */
+	},
+	[Q0B20_Q0B30_12_10] = {
+		"Q0B20",
+		12,
+		"Q0B30",
+		10,
+		"TS433",
+		DTB_DIR "rk3568-qnap-ts433.dtb",
+	},
+	[Q0B20_Q0B30_10_10] = {
+		"Q0B20",
+		10,
+		"Q0B30",
+		10,
+		"TS433",
+		DTB_DIR "rk3568-qnap-ts433.dtb",
+	},
+	[QA0110_10] = {
+		/*
+		 * The board ident in the original firmware is longer here.
+		 * Likely the field order is different in the ident string.
+		 * So this needs an EEPROM dump to figure out.
+		 */
+		"QA0110",
+		11,
+		NULL,

board/qnap/ts433_rk3568/board.c line 140

Quoted 10 lines
board/qnap/ts433_rk3568/board.c new file +10 -0
+		0,
+		"TS433eU",
+		NULL, /* not yet supported */
+	},
+};
+
+enum tsx33_product_id_format {
+	LEN_22 = 0,
+	LEN_21,
+	LEN_12, /* has the least amound of dashes in the string, so last */

s/amound/amount/

board/qnap/ts433_rk3568/board.c line 146

Quoted 6 lines
board/qnap/ts433_rk3568/board.c new file +6 -0
+	TSX33_PRODUCT_FORMATS,
+};
+
+/*
+ * We (only) identify the serial format via the different position of dashes.
+ * Because we read the product string from an eeprom there is no

there is no?

board/qnap/ts433_rk3568/board.c line 156

Quoted 10 lines
board/qnap/ts433_rk3568/board.c new file +10 -0
+ */
+struct tsx33_product_format {
+	int *dashes;
+	int num_dashes;
+	int (*decoder)(char *product, char *board, int *pcb);
+};
+
+/*
+ * The longest board-name length known.
+ * Buffers using this need to be MAX-LEN + 1 for the final 0-termination.

s/MAX-LEN/MAX_BOARD_LEN/

But also, why? It seems the other _LEN variables do take this into account and you have - 1 wherever applicable, some consistency would be nice?

board/qnap/ts433_rk3568/board.c line 169

Quoted 13 lines
board/qnap/ts433_rk3568/board.c new file +13 -0
+ */
+#define PRODUCT_MAX_BOARD_LEN		6
+
+#define LEN22_PRODUCT_BOARD_OFF		6
+#define LEN22_PRODUCT_BOARD_OFF2	12
+#define LEN22_PRODUCT_BOARD_LEN		6
+#define LEN22_PRODUCT_PCB_OFF		16
+#define LEN22_PRODUCT_PCB_LEN		2
+#define LEN22_PRODUCT_BOM_OFF		14
+#define LEN22_PRODUCT_BOM_LEN		1
+
+static int tsx33_decode_len22(char *product, char *board, int *pcb)
+{

Please document this.

"We get this as input, we return this as output" such that we know what's supposed to happen without deciphering the implementation?

Ditto for other decode functions.

board/qnap/ts433_rk3568/board.c line 177

Quoted 8 lines
board/qnap/ts433_rk3568/board.c new file +8 -0
+	strncpy(board, product + LEN22_PRODUCT_BOARD_OFF,
+		LEN22_PRODUCT_BOARD_LEN - 1);
+	board[LEN22_PRODUCT_BOARD_LEN - 1] = product[LEN22_PRODUCT_BOARD_OFF2];
+
+	/* add an artificial end to the PCB part for strtol */
+	product[LEN22_PRODUCT_PCB_OFF + LEN22_PRODUCT_PCB_LEN] = '\0';
+	*pcb = (int)simple_strtol(product + LEN22_PRODUCT_PCB_OFF, NULL, 0);
+

Are you sure you want to auto-detect the base? If the string starts with 0 it'll be understood as octal. I think you want 10 as base?

Quoted 32 lines
board/qnap/ts433_rk3568/board.c new file +32 -0
+	return 0;
+}
+
+#define LEN21_PRODUCT_BOARD_OFF		6
+#define LEN21_PRODUCT_BOARD_OFF2	11
+#define LEN21_PRODUCT_BOARD_LEN		5
+#define LEN21_PRODUCT_PCB_OFF		15
+#define LEN21_PRODUCT_PCB_LEN		2
+#define LEN21_PRODUCT_BOM_OFF		13
+#define LEN21_PRODUCT_BOM_LEN		1
+
+static int tsx33_decode_len21(char *product, char *board, int *pcb)
+{
+	strncpy(board, product + LEN21_PRODUCT_BOARD_OFF,
+		LEN21_PRODUCT_BOARD_LEN - 1);
+	board[LEN21_PRODUCT_BOARD_LEN - 1] = product[LEN21_PRODUCT_BOARD_OFF2];
+
+	/* add an artificial end to the PCB part for strtol */
+	product[LEN21_PRODUCT_PCB_OFF + LEN21_PRODUCT_PCB_LEN] = '\0';
+	*pcb = (int)simple_strtol(product + LEN21_PRODUCT_PCB_OFF, NULL, 0);
+
+	return 0;
+}
+
+#define LEN12_PRODUCT_BOARD_OFF	4
+#define LEN12_PRODUCT_BOARD_LEN	5
+#define LEN12_PRODUCT_PCB_OFF	9
+#define LEN12_PRODUCT_PCB_LEN	2
+#define LEN12_PRODUCT_BOM_OFF	11
+#define LEN12_PRODUCT_BOM_LEN	1
+
+static int tsx33_decode_len12(char *product, char *board, int *pcb)

board/qnap/ts433_rk3568/board.c line 219

Quoted 10 lines
board/qnap/ts433_rk3568/board.c new file +10 -0
+{
+	strncpy(board, product + LEN12_PRODUCT_BOARD_OFF,
+		LEN12_PRODUCT_BOARD_LEN);
+
+	/* add an artificial end to the PCB part for strtol */
+	product[LEN12_PRODUCT_PCB_OFF + LEN12_PRODUCT_PCB_LEN] = '\0';
+	*pcb = (int)simple_strtol(product + LEN12_PRODUCT_PCB_OFF, NULL, 0);
+
+	return 0;
+}

The logic seem to be awfully similar, would it make sense to have a single function with offsets passed as parameters?

board/qnap/ts433_rk3568/board.c line 221

Quoted 2 lines
board/qnap/ts433_rk3568/board.c new file +2 -0
+
+const struct tsx33_product_format product_formats[TSX33_PRODUCT_FORMATS] = {

Can be static I assume?

board/qnap/ts433_rk3568/board.c line 224

Quoted 3 lines
board/qnap/ts433_rk3568/board.c new file +3 -0
+	[LEN_22] = {
+		(int[]){ 2, 11, 15 },
+		3,

If you'd declared an array, you could simply use ARRAY_SIZE(array) and never have to worry about them being unsynced.

Quoted 11 lines
board/qnap/ts433_rk3568/board.c new file +11 -0
+		tsx33_decode_len22,
+	},
+	[LEN_21] = {
+		(int[]){ 2, 10, 14 },
+		3,
+		tsx33_decode_len21,
+	},
+	[LEN_12] = {
+		(int[]){ 2 },
+		1,
+		tsx33_decode_len12,

board/qnap/ts433_rk3568/board.c line 245

Quoted 10 lines
board/qnap/ts433_rk3568/board.c new file +10 -0
+	},
+};
+
+static int tsx33_decode_product(char *product, char *board, int *pcb)
+{
+	const struct tsx33_product_format *format;
+	int i, j;
+
+	/* Find the correct serial variant */
+	for (i = 0; i < TSX33_PRODUCT_FORMATS; i++) {

ARRAY_SIZE(product_formats)?

board/qnap/ts433_rk3568/board.c line 253

Quoted 8 lines
board/qnap/ts433_rk3568/board.c new file +8 -0
+		format = &product_formats[i];
+
+		for (j = 0; j < format->num_dashes; j++) {
+			int dash_char = format->dashes[j];
+
+			if (product[dash_char] != '-')
+				goto next_format;
+		}

You can use strstr() instead of looping on all characters manually.

Cheers,
Quentin

author maintainer
#15 lore raw

PATCH v2 7/12 arm64: dts: rockchip: move cpu_thermal node to the correct position

In reply to Heiko Stuebner

The &cpu_thermal node was added at the wrong position, move it to the correctly sorted one.

[ upstream commit: 15efa2414602ad4c411ea8d4113b87656ebe0737 ]

(cherry picked from commit 0ac36d180d89464e8dda0287cee633ad71c43211)

---
 .../src/arm64/rockchip/rk3568-qnap-ts433.dts  | 96 +++++++++----------
 1 file changed, 48 insertions(+), 48 deletions(-)
dts/upstream/src/arm64/rockchip/rk3568-qnap-ts433.dts +48 -48
index 6ae4316761c..5656554ca28 100644
@@ -196,6 +196,54 @@
 	cpu-supply = <&vdd_cpu>;
 };
 
+/*
+ * The MCU can provide system temperature too, but only by polling and of
+ * course also cannot set trip points. So attach to the cpu thermal-zone
+ * instead to control the fan.
+ */
+&cpu_thermal {
+	trips {
+		case_fan0: case-fan0 {
+			hysteresis = <2000>;
+			temperature = <35000>;
+			type = "active";
+		};
+
+		case_fan1: case-fan1 {
+			hysteresis = <2000>;
+			temperature = <45000>;
+			type = "active";
+		};
+
+		case_fan2: case-fan2 {
+			hysteresis = <2000>;
+			temperature = <65000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		/*
+		 * Always provide some air movement, due to small case
+		 * full of harddrives.
+		 */
+		map1 {
+			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+			trip = <&case_fan0>;
+		};
+
+		map2 {
+			cooling-device = <&fan 2 3>;
+			trip = <&case_fan1>;
+		};
+
+		map3 {
+			cooling-device = <&fan 4 THERMAL_NO_LIMIT>;
+			trip = <&case_fan2>;
+		};
+	};
+};
+
 &gmac0 {
 	assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
 	assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>;
@@ -492,54 +540,6 @@
 	};
 };
 
-/*
- * The MCU can provide system temperature too, but only by polling and of
- * course also cannot set trip points. So attach to the cpu thermal-zone
- * instead to control the fan.
- */
-&cpu_thermal {
-	trips {
-		case_fan0: case-fan0 {
-			hysteresis = <2000>;
-			temperature = <35000>;
-			type = "active";
-		};
-
-		case_fan1: case-fan1 {
-			hysteresis = <2000>;
-			temperature = <45000>;
-			type = "active";
-		};
-
-		case_fan2: case-fan2 {
-			hysteresis = <2000>;
-			temperature = <65000>;
-			type = "active";
-		};
-	};
-
-	cooling-maps {
-		/*
-		 * Always provide some air movement, due to small case
-		 * full of harddrives.
-		 */
-		map1 {
-			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
-			trip = <&case_fan0>;
-		};
-
-		map2 {
-			cooling-device = <&fan 2 3>;
-			trip = <&case_fan1>;
-		};
-
-		map3 {
-			cooling-device = <&fan 4 THERMAL_NO_LIMIT>;
-			trip = <&case_fan2>;
-		};
-	};
-};
-
 &pcie30phy {
 	data-lanes = <1 2>;
 	status = "okay";
Signature · 1 line
2.47.2
#16 lore raw

Re: [PATCH v2 07/12] arm64: dts: rockchip: move cpu_thermal node to the correct position

Hi Heiko,

As far as I could tell the DTS patches all are already in next, so please rebase on top of that for v3.

Cheers,
Quentin

author maintainer
#17 lore raw

PATCH v2 8/12 arm64: dts: rockchip: describe mcu eeprom cells on rk3568-ts433

In reply to Heiko Stuebner

The MCU's eeprom contains the unit's serial and a number of slots for mac-addresses. As the MCU seems to be used in different devices, up to 8 mac addresses can live there and the unused slots are actually initialized with empty mac-address strings like 00:00:00:00:05:09 .

Interestingly on the TS-433, the PCIe ethernet adapter brings its own memory to hold its mac, and the gmac0 is supposed to get its mac from the second mac-slot, while the first one stays empty.

[ upstream commit: 81f116991433d2547d7f350873cb4511ebcd4fec ]

(cherry picked from commit 51b234a762b64dd4d8b1f338b4abbcf7cfc748a4)

---
 .../src/arm64/rockchip/rk3568-qnap-ts433.dts  | 62 +++++++++++++++++++
 1 file changed, 62 insertions(+)
dts/upstream/src/arm64/rockchip/rk3568-qnap-ts433.dts +62 -0
index 5656554ca28..224db87973b 100644
@@ -655,6 +655,68 @@
 			#cooling-cells = <2>;
 			cooling-levels = <0 64 89 128 166 204 221 238>;
 		};
+
+		nvmem-layout {
+			compatible = "fixed-layout";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			serial-number@0 {
+				reg = <0x0 0x13>;
+			};
+
+			ext-port@22 {
+				reg = <0x22 0x2>;
+			};
+
+			mac0: mac@24 {
+				compatible = "mac-base";
+				reg = <0x24 0x11>;
+				#nvmem-cell-cells = <1>;
+			};
+
+			mac1: mac@35 {
+				compatible = "mac-base";
+				reg = <0x35 0x11>;
+				#nvmem-cell-cells = <1>;
+			};
+
+			mac2: mac@46 {
+				compatible = "mac-base";
+				reg = <0x46 0x11>;
+				#nvmem-cell-cells = <1>;
+			};
+
+			mac3: mac@57 {
+				compatible = "mac-base";
+				reg = <0x57 0x11>;
+				#nvmem-cell-cells = <1>;
+			};
+
+			mac4: mac@68 {
+				compatible = "mac-base";
+				reg = <0x68 0x11>;
+				#nvmem-cell-cells = <1>;
+			};
+
+			mac5: mac@79 {
+				compatible = "mac-base";
+				reg = <0x79 0x11>;
+				#nvmem-cell-cells = <1>;
+			};
+
+			mac6: mac@8a {
+				compatible = "mac-base";
+				reg = <0x8a 0x11>;
+				#nvmem-cell-cells = <1>;
+			};
+
+			mac7: mac@9b {
+				compatible = "mac-base";
+				reg = <0x9b 0x11>;
+				#nvmem-cell-cells = <1>;
+			};
+		};
 	};
 };
 
Signature · 1 line
2.47.2
author maintainer
#18 lore raw

PATCH v2 9/12 arm64: dts: rockchip: move common qnap tsx33 parts to dtsi

In reply to Heiko Stuebner

The NAS series based around the rk3568 contains a number of models with 1-4 drives, that reuse most of the board structure.

Therefore move the shared parts to a dtsi, to be included by the devices.

As the smallest device is the 1-bay TS133, keep everything > slot1 in the individual devicetree.

[ upstream commit: 35202606ea08b9ec2b1386ac937a729e25d5beb0 ]

(cherry picked from commit 8cf4cbd14444705137b5129a2acba303eb975fd1)

---
 .../src/arm64/rockchip/rk3568-qnap-ts433.dts  | 666 +-----------------
 .../src/arm64/rockchip/rk3568-qnap-tsx33.dtsi | 608 ++++++++++++++++
 2 files changed, 645 insertions(+), 629 deletions(-)
 create mode 100644 dts/upstream/src/arm64/rockchip/rk3568-qnap-tsx33.dtsi
dts/upstream/src/arm64/rockchip/rk3568-qnap-ts433.dts +37 -629
index 224db87973b..d1e3b7e7a28 100644
@@ -6,10 +6,7 @@
 
 /dts-v1/;
 
-#include <dt-bindings/input/input.h>
-#include <dt-bindings/leds/common.h>
-#include <dt-bindings/gpio/gpio.h>
-#include "rk3568.dtsi"
+#include "rk3568-qnap-tsx33.dtsi"
 
 / {
 	model = "Qnap TS-433-4G NAS System 4-Bay";
@@ -17,83 +14,6 @@
 
 	aliases {
 		ethernet0 = &gmac0;
-		mmc0 = &sdhci;
-		rtc0 = &rtc_rv8263;
-	};
-
-	chosen {
-		stdout-path = "serial2:115200n8";
-	};
-
-	keys {
-		compatible = "gpio-keys";
-		pinctrl-0 = <&copy_button_pin>, <&reset_button_pin>;
-		pinctrl-names = "default";
-
-		key-copy {
-			label = "copy";
-			gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_COPY>;
-		};
-
-		key-reset {
-			label = "reset";
-			gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_RESTART>;
-		};
-	};
-
-	leds {
-		compatible = "gpio-leds";
-
-		led-0 {
-			color = <LED_COLOR_ID_GREEN>;
-			function = LED_FUNCTION_DISK;
-			gpios = <&gpio1 RK_PD5 GPIO_ACTIVE_LOW>;
-			label = "hdd1:green:disk";
-			linux,default-trigger = "disk-activity";
-			pinctrl-names = "default";
-			pinctrl-0 = <&hdd1_led_pin>;
-		};
-
-		led-1 {
-			color = <LED_COLOR_ID_GREEN>;
-			function = LED_FUNCTION_DISK;
-			gpios = <&gpio1 RK_PD6 GPIO_ACTIVE_LOW>;
-			label = "hdd2:green:disk";
-			linux,default-trigger = "disk-activity";
-			pinctrl-names = "default";
-			pinctrl-0 = <&hdd2_led_pin>;
-		};
-
-		led-2 {
-			color = <LED_COLOR_ID_GREEN>;
-			function = LED_FUNCTION_DISK;
-			gpios = <&gpio1 RK_PD7 GPIO_ACTIVE_LOW>;
-			label = "hdd3:green:disk";
-			linux,default-trigger = "disk-activity";
-			pinctrl-names = "default";
-			pinctrl-0 = <&hdd3_led_pin>;
-		};
-
-		led-3 {
-			color = <LED_COLOR_ID_GREEN>;
-			function = LED_FUNCTION_DISK;
-			gpios = <&gpio2 RK_PA0 GPIO_ACTIVE_LOW>;
-			label = "hdd4:green:disk";
-			linux,default-trigger = "disk-activity";
-			pinctrl-names = "default";
-			pinctrl-0 = <&hdd4_led_pin>;
-		};
-	};
-
-	dc_12v: regulator-dc-12v {
-		compatible = "regulator-fixed";
-		regulator-name = "dc_12v";
-		regulator-always-on;
-		regulator-boot-on;
-		regulator-min-microvolt = <12000000>;
-		regulator-max-microvolt = <12000000>;
 	};
 
 	vcc3v3_pcie: regulator-vcc3v3-pcie {
@@ -105,74 +25,6 @@
 		gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>;
 		vin-supply = <&dc_12v>;
 	};
-
-	vcc3v3_sys: regulator-vcc3v3-sys {
-		compatible = "regulator-fixed";
-		regulator-name = "vcc3v3_sys";
-		regulator-always-on;
-		regulator-boot-on;
-		regulator-min-microvolt = <3300000>;
-		regulator-max-microvolt = <3300000>;
-		vin-supply = <&dc_12v>;
-	};
-
-	vcc5v0_host: regulator-vcc5v0-host {
-		compatible = "regulator-fixed";
-		enable-active-high;
-		pinctrl-names = "default";
-		pinctrl-0 = <&vcc5v0_host_en>;
-		gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
-		regulator-name = "vcc5v0_host";
-		regulator-always-on;
-		regulator-boot-on;
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		vin-supply = <&vcc5v0_usb>;
-	};
-
-	vcc5v0_otg: regulator-vcc5v0-otg {
-		compatible = "regulator-fixed";
-		enable-active-high;
-		gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
-		pinctrl-names = "default";
-		pinctrl-0 = <&vcc5v0_otg_en>;
-		regulator-name = "vcc5v0_otg";
-		regulator-always-on;
-		regulator-boot-on;
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		vin-supply = <&vcc5v0_usb>;
-	};
-
-	vcc5v0_sys: regulator-vcc5v0-sys {
-		compatible = "regulator-fixed";
-		regulator-name = "vcc5v0_sys";
-		regulator-always-on;
-		regulator-boot-on;
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		vin-supply = <&dc_12v>;
-	};
-
-	vcc5v0_usb: regulator-vcc5v0-usb {
-		compatible = "regulator-fixed";
-		regulator-name = "vcc5v0_usb";
-		regulator-always-on;
-		regulator-boot-on;
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		vin-supply = <&dc_12v>;
-	};
-};
-
-/* connected to usb_host0_xhci */
-&combphy0 {
-	status = "okay";
-};
-
-/* connected to sata1 */
-&combphy1 {
-	status = "okay";
 };
 
 /* connected to sata2 */
@@ -180,70 +32,6 @@
 	status = "okay";
 };
 
-&cpu0 {
-	cpu-supply = <&vdd_cpu>;
-};
-
-&cpu1 {
-	cpu-supply = <&vdd_cpu>;
-};
-
-&cpu2 {
-	cpu-supply = <&vdd_cpu>;
-};
-
-&cpu3 {
-	cpu-supply = <&vdd_cpu>;
-};
-
-/*
- * The MCU can provide system temperature too, but only by polling and of
- * course also cannot set trip points. So attach to the cpu thermal-zone
- * instead to control the fan.
- */
-&cpu_thermal {
-	trips {
-		case_fan0: case-fan0 {
-			hysteresis = <2000>;
-			temperature = <35000>;
-			type = "active";
-		};
-
-		case_fan1: case-fan1 {
-			hysteresis = <2000>;
-			temperature = <45000>;
-			type = "active";
-		};
-
-		case_fan2: case-fan2 {
-			hysteresis = <2000>;
-			temperature = <65000>;
-			type = "active";
-		};
-	};
-
-	cooling-maps {
-		/*
-		 * Always provide some air movement, due to small case
-		 * full of harddrives.
-		 */
-		map1 {
-			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
-			trip = <&case_fan0>;
-		};
-
-		map2 {
-			cooling-device = <&fan 2 3>;
-			trip = <&case_fan1>;
-		};
-
-		map3 {
-			cooling-device = <&fan 4 THERMAL_NO_LIMIT>;
-			trip = <&case_fan2>;
-		};
-	};
-};
-
 &gmac0 {
 	assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
 	assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>;
@@ -260,263 +48,7 @@
 	status = "okay";
 };
 
-&gpu {
-	mali-supply = <&vdd_gpu>;
-	status = "okay";
-};
-
-&i2c0 {
-	status = "okay";
-
-	pmic@20 {
-		compatible = "rockchip,rk809";
-		reg = <0x20>;
-		interrupt-parent = <&gpio0>;
-		interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
-		#clock-cells = <1>;
-		pinctrl-names = "default";
-		pinctrl-0 = <&pmic_int_l>;
-		system-power-controller;
-		vcc1-supply = <&vcc3v3_sys>;
-		vcc2-supply = <&vcc3v3_sys>;
-		vcc3-supply = <&vcc3v3_sys>;
-		vcc4-supply = <&vcc3v3_sys>;
-		vcc5-supply = <&vcc3v3_sys>;
-		vcc6-supply = <&vcc3v3_sys>;
-		vcc7-supply = <&vcc3v3_sys>;
-		vcc8-supply = <&vcc3v3_sys>;
-		vcc9-supply = <&vcc3v3_sys>;
-		wakeup-source;
-
-		regulators {
-			vdd_logic: DCDC_REG1 {
-				regulator-name = "vdd_logic";
-				regulator-always-on;
-				regulator-boot-on;
-				regulator-initial-mode = <0x2>;
-				regulator-min-microvolt = <500000>;
-				regulator-max-microvolt = <1350000>;
-				regulator-ramp-delay = <6001>;
-
-				regulator-state-mem {
-					regulator-off-in-suspend;
-				};
-			};
-
-			vdd_gpu: DCDC_REG2 {
-				regulator-name = "vdd_gpu";
-				regulator-always-on;
-				regulator-initial-mode = <0x2>;
-				regulator-min-microvolt = <500000>;
-				regulator-max-microvolt = <1350000>;
-				regulator-ramp-delay = <6001>;
-
-				regulator-state-mem {
-					regulator-off-in-suspend;
-				};
-			};
-
-			vcc_ddr: DCDC_REG3 {
-				regulator-name = "vcc_ddr";
-				regulator-always-on;
-				regulator-boot-on;
-				regulator-initial-mode = <0x2>;
-
-				regulator-state-mem {
-					regulator-on-in-suspend;
-				};
-			};
-
-			vdd_npu: DCDC_REG4 {
-				regulator-name = "vdd_npu";
-				regulator-initial-mode = <0x2>;
-				regulator-min-microvolt = <500000>;
-				regulator-max-microvolt = <1350000>;
-				regulator-ramp-delay = <6001>;
-
-				regulator-state-mem {
-					regulator-off-in-suspend;
-				};
-			};
-
-			vcc_1v8: DCDC_REG5 {
-				regulator-name = "vcc_1v8";
-				regulator-always-on;
-				regulator-boot-on;
-				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <1800000>;
-
-				regulator-state-mem {
-					regulator-off-in-suspend;
-				};
-			};
-
-			vdda0v9_image: LDO_REG1 {
-				regulator-name = "vdda0v9_image";
-				regulator-always-on;
-				regulator-min-microvolt = <900000>;
-				regulator-max-microvolt = <900000>;
-
-				regulator-state-mem {
-					regulator-off-in-suspend;
-				};
-			};
-
-			vdda_0v9: LDO_REG2 {
-				regulator-name = "vdda_0v9";
-				regulator-always-on;
-				regulator-boot-on;
-				regulator-min-microvolt = <900000>;
-				regulator-max-microvolt = <900000>;
-
-				regulator-state-mem {
-					regulator-off-in-suspend;
-				};
-			};
-
-			vdda0v9_pmu: LDO_REG3 {
-				regulator-name = "vdda0v9_pmu";
-				regulator-always-on;
-				regulator-boot-on;
-				regulator-min-microvolt = <900000>;
-				regulator-max-microvolt = <900000>;
-
-				regulator-state-mem {
-					regulator-on-in-suspend;
-					regulator-suspend-microvolt = <900000>;
-				};
-			};
-
-			vccio_acodec: LDO_REG4 {
-				regulator-name = "vccio_acodec";
-				regulator-always-on;
-				regulator-boot-on;
-				regulator-min-microvolt = <3300000>;
-				regulator-max-microvolt = <3300000>;
-
-				regulator-state-mem {
-					regulator-off-in-suspend;
-				};
-			};
-
-			vccio_sd: LDO_REG5 {
-				regulator-name = "vccio_sd";
-				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <3300000>;
-
-				regulator-state-mem {
-					regulator-off-in-suspend;
-				};
-			};
-
-			vcc3v3_pmu: LDO_REG6 {
-				regulator-name = "vcc3v3_pmu";
-				regulator-always-on;
-				regulator-boot-on;
-				regulator-min-microvolt = <3300000>;
-				regulator-max-microvolt = <3300000>;
-
-				regulator-state-mem {
-					regulator-on-in-suspend;
-					regulator-suspend-microvolt = <3300000>;
-				};
-			};
-
-			vcca_1v8: LDO_REG7 {
-				regulator-name = "vcca_1v8";
-				regulator-always-on;
-				regulator-boot-on;
-				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <1800000>;
-
-				regulator-state-mem {
-					regulator-off-in-suspend;
-				};
-			};
-
-			vcca1v8_pmu: LDO_REG8 {
-				regulator-name = "vcca1v8_pmu";
-				regulator-always-on;
-				regulator-boot-on;
-				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <1800000>;
-
-				regulator-state-mem {
-					regulator-on-in-suspend;
-					regulator-suspend-microvolt = <1800000>;
-				};
-			};
-
-			vcca1v8_image: LDO_REG9 {
-				regulator-name = "vcca1v8_image";
-				regulator-always-on;
-				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <1800000>;
-
-				regulator-state-mem {
-					regulator-off-in-suspend;
-				};
-			};
-
-			vcc_3v3: SWITCH_REG1 {
-				regulator-name = "vcc_3v3";
-				regulator-always-on;
-				regulator-boot-on;
-
-				regulator-state-mem {
-					regulator-off-in-suspend;
-				};
-			};
-
-			vcc3v3_sd: SWITCH_REG2 {
-				regulator-name = "vcc3v3_sd";
-				/*
-				 * turning this off, breaks access to both
-				 * PCIe controllers, refclk generator perhaps
-				 */
-				regulator-always-on;
-				regulator-boot-on;
-
-				regulator-state-mem {
-					regulator-off-in-suspend;
-				};
-			};
-		};
-	};
-
-	vdd_cpu: regulator@40 {
-		compatible = "silergy,syr827";
-		reg = <0x40>;
-		fcs,suspend-voltage-selector = <1>;
-		regulator-name = "vdd_cpu";
-		regulator-always-on;
-		regulator-boot-on;
-		regulator-min-microvolt = <712500>;
-		regulator-max-microvolt = <1390000>;
-		regulator-ramp-delay = <2300>;
-		vin-supply = <&vcc5v0_sys>;
-	};
-};
-
 &i2c1 {
-	status = "okay";
-
-	rtc_rv8263: rtc@51 {
-		compatible = "microcrystal,rv8263";
-		reg = <0x51>;
-		wakeup-source;
-	};
-
-	/* eeprom for vital-product-data on the mainboard */
-	eeprom@54 {
-		compatible = "giantec,gt24c04a", "atmel,24c04";
-		reg = <0x54>;
-		label = "VPD_MB";
-		num-addresses = <2>;
-		pagesize = <16>;
-		read-only;
-	};
-
 	/* eeprom for vital-product-data on the backplane */
 	eeprom@56 {
 		compatible = "giantec,gt24c04a", "atmel,24c04";
@@ -528,6 +60,42 @@
 	};
 };
 
+&leds {
+	led-1 {
+		color = <LED_COLOR_ID_GREEN>;
+		function = LED_FUNCTION_DISK;
+		gpios = <&gpio1 RK_PD6 GPIO_ACTIVE_LOW>;
+		label = "hdd2:green:disk";
+		linux,default-trigger = "disk-activity";
+		pinctrl-names = "default";
+		pinctrl-0 = <&hdd2_led_pin>;
+	};
+
+	led-2 {
+		color = <LED_COLOR_ID_GREEN>;
+		function = LED_FUNCTION_DISK;
+		gpios = <&gpio1 RK_PD7 GPIO_ACTIVE_LOW>;
+		label = "hdd3:green:disk";
+		linux,default-trigger = "disk-activity";
+		pinctrl-names = "default";
+		pinctrl-0 = <&hdd3_led_pin>;
+	};
+
+	led-3 {
+		color = <LED_COLOR_ID_GREEN>;
+		function = LED_FUNCTION_DISK;
+		gpios = <&gpio2 RK_PA0 GPIO_ACTIVE_LOW>;
+		label = "hdd4:green:disk";
+		linux,default-trigger = "disk-activity";
+		pinctrl-names = "default";
+		pinctrl-0 = <&hdd4_led_pin>;
+	};
+};
+
+&mcu {
+	compatible = "qnap,ts433-mcu";
+};
+
 &mdio0 {
 	rgmii_phy0: ethernet-phy@3 {
 		/* Motorcomm YT8521 phy */
@@ -567,21 +135,7 @@
 		};
 	};
 
-	keys {
-		copy_button_pin: copy-button-pin {
-			rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>;
-		};
-
-		reset_button_pin: reset-button-pin {
-			rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
-		};
-	};
-
 	leds {
-		hdd1_led_pin: hdd1-led-pin {
-			rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up>;
-		};
-
 		hdd2_led_pin: hdd2-led-pin {
 			rockchip,pins = <1 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
 		};
@@ -594,152 +148,12 @@
 			rockchip,pins = <2 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
 		};
 	};
-
-	pmic {
-		pmic_int_l: pmic-int-l {
-			rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
-		};
-	};
-
-	usb {
-		vcc5v0_host_en: vcc5v0-host-en {
-			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
-		};
-
-		vcc5v0_otg_en: vcc5v0-otg-en {
-			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
-		};
-	};
-};
-
-&pmu_io_domains {
-	vccio4-supply = <&vcc_1v8>;
-	vccio6-supply = <&vcc_1v8>;
-	status = "okay";
-};
-
-&sata1 {
-	status = "okay";
 };
 
 &sata2 {
 	status = "okay";
 };
 
-&sdhci {
-	bus-width = <8>;
-	max-frequency = <200000000>;
-	non-removable;
-	pinctrl-names = "default";
-	pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
-	status = "okay";
-};
-
-&tsadc {
-	rockchip,hw-tshut-mode = <1>;
-	rockchip,hw-tshut-polarity = <0>;
-	status = "okay";
-};
-
-/*
- * Connected to an MCU, that provides access to more LEDs,
- * buzzer, fan control and more.
- */
-&uart0 {
-	status = "okay";
-
-	mcu {
-		compatible = "qnap,ts433-mcu";
-
-		fan: fan-0 {
-			#cooling-cells = <2>;
-			cooling-levels = <0 64 89 128 166 204 221 238>;
-		};
-
-		nvmem-layout {
-			compatible = "fixed-layout";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			serial-number@0 {
-				reg = <0x0 0x13>;
-			};
-
-			ext-port@22 {
-				reg = <0x22 0x2>;
-			};
-
-			mac0: mac@24 {
-				compatible = "mac-base";
-				reg = <0x24 0x11>;
-				#nvmem-cell-cells = <1>;
-			};
-
-			mac1: mac@35 {
-				compatible = "mac-base";
-				reg = <0x35 0x11>;
-				#nvmem-cell-cells = <1>;
-			};
-
-			mac2: mac@46 {
-				compatible = "mac-base";
-				reg = <0x46 0x11>;
-				#nvmem-cell-cells = <1>;
-			};
-
-			mac3: mac@57 {
-				compatible = "mac-base";
-				reg = <0x57 0x11>;
-				#nvmem-cell-cells = <1>;
-			};
-
-			mac4: mac@68 {
-				compatible = "mac-base";
-				reg = <0x68 0x11>;
-				#nvmem-cell-cells = <1>;
-			};
-
-			mac5: mac@79 {
-				compatible = "mac-base";
-				reg = <0x79 0x11>;
-				#nvmem-cell-cells = <1>;
-			};
-
-			mac6: mac@8a {
-				compatible = "mac-base";
-				reg = <0x8a 0x11>;
-				#nvmem-cell-cells = <1>;
-			};
-
-			mac7: mac@9b {
-				compatible = "mac-base";
-				reg = <0x9b 0x11>;
-				#nvmem-cell-cells = <1>;
-			};
-		};
-	};
-};
-
-/*
- * Pins available on CN3 connector at TTL voltage level (3V3).
- * ,_  _.
- * |1234|  1=TX 2=VCC
- * `----'  3=RX 4=GND
- */
-&uart2 {
-	status = "okay";
-};
-
-&usb2phy0 {
-	status = "okay";
-};
-
-/* connected to usb_host0_xhci */
-&usb2phy0_otg {
-	phy-supply = <&vcc5v0_otg>;
-	status = "okay";
-};
-
 &usb2phy1 {
 	status = "okay";
 };
@@ -765,12 +179,6 @@
 	status = "okay";
 };
 
-/* front port */
-&usb_host0_xhci {
-	dr_mode = "host";
-	status = "okay";
-};
-
 /* left port backside */
 &usb_host1_ehci {
 	status = "okay";
dts/upstream/src/arm64/rockchip/rk3568-qnap-tsx33.dtsi new file +608 -0

608 lines not on this page · raw message

Signature · 1 line
2.47.2
author maintainer
#19 lore raw

PATCH v2 10/12 arm64: dts: rockchip: add QNAP TS233 devicetree

In reply to Heiko Stuebner

The TS233 is a 2 bay NAS similar to the TS433. Architecture-wise it really seems to be the same minus the additional PCIe connected components the TS433 has.

So it just uses two of the SoCs SATA ports and the SoC's gigabit ethernet.

[ upstream commit: ce0b84e766ad7b2ec5d2ac7840675f223640f3e3 ]

(cherry picked from commit be3ad0fe4738a324213dcf63efaccfd00fca9918)

---
 .../src/arm64/rockchip/rk3568-qnap-ts233.dts  | 131 ++++++++++++++++++
 1 file changed, 131 insertions(+)
 create mode 100644 dts/upstream/src/arm64/rockchip/rk3568-qnap-ts233.dts
dts/upstream/src/arm64/rockchip/rk3568-qnap-ts233.dts new file +131 -0
new file mode 100644
index 00000000000..f16d1c62879
@@ -0,0 +1,131 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
+ * Copyright (c) 2024 Heiko Stuebner <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "rk3568-qnap-tsx33.dtsi"
+
+/ {
+	model = "Qnap TS-233-2G NAS System 2-Bay";
+	compatible = "qnap,ts233", "rockchip,rk3568";
+
+	aliases {
+		ethernet0 = &gmac0;
+	};
+};
+
+/* connected to sata2 */
+&combphy2 {
+	status = "okay";
+};
+
+&gmac0 {
+	assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
+	assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>;
+	assigned-clock-rates = <0>, <125000000>;
+	clock_in_out = "output";
+	phy-handle = <&rgmii_phy0>;
+	phy-mode = "rgmii-id";
+	pinctrl-names = "default";
+	pinctrl-0 = <&gmac0_miim
+		     &gmac0_tx_bus2
+		     &gmac0_rx_bus2
+		     &gmac0_rgmii_clk
+		     &gmac0_rgmii_bus>;
+	status = "okay";
+};
+
+&i2c1 {
+	/* eeprom for vital-product-data on the backplane */
+	eeprom@56 {
+		compatible = "giantec,gt24c04a", "atmel,24c04";
+		reg = <0x56>;
+		label = "VPD_BP";
+		num-addresses = <2>;
+		pagesize = <16>;
+		read-only;
+	};
+};
+
+&leds {
+	led-1 {
+		color = <LED_COLOR_ID_GREEN>;
+		function = LED_FUNCTION_DISK;
+		gpios = <&gpio1 RK_PD6 GPIO_ACTIVE_LOW>;
+		label = "hdd2:green:disk";
+		linux,default-trigger = "disk-activity";
+		pinctrl-names = "default";
+		pinctrl-0 = <&hdd2_led_pin>;
+	};
+};
+
+&mcu {
+	compatible = "qnap,ts233-mcu";
+};
+
+&mdio0 {
+	rgmii_phy0: ethernet-phy@3 {
+		/* Motorcomm YT8521 phy */
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x3>;
+		pinctrl-0 = <&eth_phy0_reset_pin>;
+		pinctrl-names = "default";
+		reset-assert-us = <10000>;
+		reset-gpios = <&gpio0 RK_PC6 GPIO_ACTIVE_LOW>;
+	};
+};
+
+&pinctrl {
+	gmac0 {
+		eth_phy0_reset_pin: eth-phy0-reset-pin {
+			rockchip,pins = <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
+
+	leds {
+		hdd2_led_pin: hdd2-led-pin {
+			rockchip,pins = <1 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
+};
+
+&sata2 {
+	status = "okay";
+};
+
+&usb2phy1 {
+	status = "okay";
+};
+
+/* connected to usb_host1_ehci/ohci */
+&usb2phy1_host {
+	phy-supply = <&vcc5v0_host>;
+	status = "okay";
+};
+
+/* connected to usb_host0_ehci/ohci */
+&usb2phy1_otg {
+	phy-supply = <&vcc5v0_host>;
+	status = "okay";
+};
+
+/* right port backside */
+&usb_host0_ehci {
+	status = "okay";
+};
+
+&usb_host0_ohci {
+	status = "okay";
+};
+
+/* left port backside */
+&usb_host1_ehci {
+	status = "okay";
+};
+
+&usb_host1_ohci {
+	status = "okay";
+};
Signature · 1 line
2.47.2
author maintainer
#20 lore raw

PATCH v2 11/12 rockchip: board: qnap-ts433: Rename the board code to not be TS433 specific

In reply to Heiko Stuebner

We can do support at least 2 devices now, so rename the code-side to a TSx33 form to not read as specific to the TS433 anymore.

---
 arch/arm/mach-rockchip/rk3568/Kconfig           | 17 +++++++++--------
 .../qnap/{ts433_rk3568 => tsx33_rk356x}/Kconfig |  6 +++---
 .../{ts433_rk3568 => tsx33_rk356x}/MAINTAINERS  |  6 +++---
 .../{ts433_rk3568 => tsx33_rk356x}/Makefile     |  0
 .../qnap/{ts433_rk3568 => tsx33_rk356x}/board.c |  0
 configs/qnap-ts433-rk3568_defconfig             |  2 +-
 .../configs/{ts433_rk3568.h => tsx33_rk356x.h}  |  0
 7 files changed, 16 insertions(+), 15 deletions(-)
 rename board/qnap/{ts433_rk3568 => tsx33_rk356x}/Kconfig (52%)
 rename board/qnap/{ts433_rk3568 => tsx33_rk356x}/MAINTAINERS (68%)
 rename board/qnap/{ts433_rk3568 => tsx33_rk356x}/Makefile (100%)
 rename board/qnap/{ts433_rk3568 => tsx33_rk356x}/board.c (100%)
 rename include/configs/{ts433_rk3568.h => tsx33_rk356x.h} (100%)
arch/arm/mach-rockchip/rk3568/Kconfig +9 -8
index 16e14ee4fa7..725c008795d 100644
@@ -31,18 +31,19 @@ config TARGET_POWKIDDY_X55_RK3566
 	help
 	  Powkiddy X55 handheld gaming console with an RK3566 SoC.
 
-config TARGET_QNAP_TS433_RK3568
-	bool "QNAP-TS433"
+config TARGET_QNAP_TSX33_RK356X
+	bool "QNAP-TSx33"
 	help
-	  Qnap TS433 4-bay NAS with a RK3568 SoC.
+	  Qnap TSx33 1-to-4-bay NAS with a RK3566/RK3568 SoC.
 
 	  It provides the following featureset:
-	   * 4GB LPDDR4
+	   * 2-4GB LPDDR4
 	   * 4GB eMMC
-	   * 2 SATA ports connected to two RK3568's SATA controllers
-	   * 2 SATA ports connected to a JMicron JMB58x AHCI SATA controller
+	   * 1-2 SATA ports connected to two RK3568's SATA controllers
+	   * On TS433 2 SATA ports connected to a JMicron JMB58x AHCI SATA
+	     controller
 	   * 1 1G network controller
-	   * 1 2.5G Realtek RTL8125 network controller
+	   * On TS433 1 2.5G Realtek RTL8125 network controller
 
 config TARGET_QUARTZ64_RK3566
 	bool "Pine64 Quartz64"
@@ -76,7 +77,7 @@ source "board/hardkernel/odroid_m1/Kconfig"
 source "board/hardkernel/odroid_m1s/Kconfig"
 source "board/pine64/quartz64_rk3566/Kconfig"
 source "board/powkiddy/x55/Kconfig"
-source "board/qnap/ts433_rk3568/Kconfig"
+source "board/qnap/tsx33_rk356x/Kconfig"
 source "board/radxa/zero3-rk3566/Kconfig"
 source "board/xunlong/orangepi-3b-rk3566/Kconfig"
 
board/qnap/tsx33_rk356x/Kconfig renamed from board/qnap/ts433_rk3568/Kconfig +3 -3
similarity index 52%
rename from board/qnap/ts433_rk3568/Kconfig
rename to board/qnap/tsx33_rk356x/Kconfig
index c5f9db849f2..2f64b9be062 100644
@@ -1,12 +1,12 @@
-if TARGET_QNAP_TS433_RK3568
+if TARGET_QNAP_TSX33_RK356X
 
 config SYS_BOARD
-	default "ts433_rk3568"
+	default "tsx33_rk356x"
 
 config SYS_VENDOR
 	default "qnap"
 
 config SYS_CONFIG_NAME
-	default "ts433_rk3568"
+	default "tsx33_rk356x"
 
 endif
board/qnap/tsx33_rk356x/MAINTAINERS renamed from board/qnap/ts433_rk3568/MAINTAINERS +3 -3
similarity index 68%
rename from board/qnap/ts433_rk3568/MAINTAINERS
rename to board/qnap/tsx33_rk356x/MAINTAINERS
index 02ce7ff383c..b91274c7b43 100644
@@ -1,8 +1,8 @@
-QNAP-TS433
+QNAP-TSX33
 M:	Heiko Stuebner <[email protected]>
 S:	Maintained
-F:	board/qnap/ts433_rk3568/
+F:	board/qnap/tsx33_rk356x/
 F:	doc/board/qnap/
-F:	include/configs/qnap_ts433.h
+F:	include/configs/qnap_tsx33.h
 F:	configs/qnap-ts433-rk3568_defconfig
 F:	arch/arm/dts/rk3568-qnap-ts433-u-boot.dtsi
board/qnap/tsx33_rk356x/Makefile renamed from board/qnap/ts433_rk3568/Makefile +0 -0
similarity index 100%
rename from board/qnap/ts433_rk3568/Makefile
rename to board/qnap/tsx33_rk356x/Makefile
board/qnap/tsx33_rk356x/board.c renamed from board/qnap/ts433_rk3568/board.c +0 -0
similarity index 100%
rename from board/qnap/ts433_rk3568/board.c
rename to board/qnap/tsx33_rk356x/board.c
configs/qnap-ts433-rk3568_defconfig +1 -1
index dfb240ed70f..475488534cd 100644
@@ -6,7 +6,7 @@ CONFIG_ARCH_ROCKCHIP=y
 CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3568-qnap-ts433"
 CONFIG_ROCKCHIP_RK3568=y
 CONFIG_SPL_SERIAL=y
-CONFIG_TARGET_QNAP_TS433_RK3568=y
+CONFIG_TARGET_QNAP_TSX33_RK356X=y
 CONFIG_SYS_LOAD_ADDR=0xc00800
 CONFIG_DEBUG_UART_BASE=0xFE660000
 CONFIG_DEBUG_UART_CLOCK=24000000
include/configs/tsx33_rk356x.h renamed from include/configs/ts433_rk3568.h +0 -0
similarity index 100%
rename from include/configs/ts433_rk3568.h
rename to include/configs/tsx33_rk356x.h
Signature · 1 line
2.47.2
#21 lore raw

Re: [PATCH v2 11/12] rockchip: board: qnap-ts433: Rename the board code to not be TS433 specific

Hi Heiko,

Quoted 25 lines · Heiko Stuebner

We can do support at least 2 devices now, so rename the code-side to a TSx33 form to not read as specific to the TS433 anymore.

---
  arch/arm/mach-rockchip/rk3568/Kconfig           | 17 +++++++++--------
  .../qnap/{ts433_rk3568 => tsx33_rk356x}/Kconfig |  6 +++---
  .../{ts433_rk3568 => tsx33_rk356x}/MAINTAINERS  |  6 +++---
  .../{ts433_rk3568 => tsx33_rk356x}/Makefile     |  0
  .../qnap/{ts433_rk3568 => tsx33_rk356x}/board.c |  0
  configs/qnap-ts433-rk3568_defconfig             |  2 +-
  .../configs/{ts433_rk3568.h => tsx33_rk356x.h}  |  0
  7 files changed, 16 insertions(+), 15 deletions(-)

rename board/qnap/{ts433_rk3568 => tsx33_rk356x}/Kconfig (52%) rename board/qnap/{ts433_rk3568 => tsx33_rk356x}/MAINTAINERS (68%) rename board/qnap/{ts433_rk3568 => tsx33_rk356x}/Makefile (100%) rename board/qnap/{ts433_rk3568 => tsx33_rk356x}/board.c (100%) rename include/configs/{ts433_rk3568.h => tsx33_rk356x.h} (100%)

arch/arm/mach-rockchip/rk3568/Kconfig +0 -0
index 16e14ee4fa7..725c008795d 100644
@@ -31,18 +31,19 @@ config TARGET_POWKIDDY_X55_RK3566
  	help

arch/arm/mach-rockchip/rk3568/Kconfig config TARGET_POWKIDDY_X55_RK3566 · line 38

Quoted 10 lines
arch/arm/mach-rockchip/rk3568/Kconfig +3 -3
  	  Powkiddy X55 handheld gaming console with an RK3566 SoC.
 
-config TARGET_QNAP_TS433_RK3568
-	bool "QNAP-TS433"
+config TARGET_QNAP_TSX33_RK356X
+	bool "QNAP-TSx33"
  	help
-	  Qnap TS433 4-bay NAS with a RK3568 SoC.
+	  Qnap TSx33 1-to-4-bay NAS with a RK3566/RK3568 SoC.
 

But TS233 is 2-bay?

Maybe do something like

Qnap TS233/TS433 2/4-bay NAS with a RK3566/RK3568.

Such that we know the former is for TS233 and the latter for TS433 when reading below as well?

arch/arm/mach-rockchip/rk3568/Kconfig config TARGET_POWKIDDY_X55_RK3566 · line 46

Quoted 12 lines
arch/arm/mach-rockchip/rk3568/Kconfig +5 -4
  	  It provides the following featureset:
-	   * 4GB LPDDR4
+	   * 2-4GB LPDDR4
  	   * 4GB eMMC
-	   * 2 SATA ports connected to two RK3568's SATA controllers
-	   * 2 SATA ports connected to a JMicron JMB58x AHCI SATA controller
+	   * 1-2 SATA ports connected to two RK3568's SATA controllers
+	   * On TS433 2 SATA ports connected to a JMicron JMB58x AHCI SATA
+	     controller
  	   * 1 1G network controller
-	   * 1 2.5G Realtek RTL8125 network controller
+	   * On TS433 1 2.5G Realtek RTL8125 network controller

e.g.
0/1 2.5G Realtek...

I also see QNAP has a TS-216G, so even this TSX33 won't match (if we can support it with the same code).

I see the TS233 is still an RK3568 (according to the device tree). I also know that the RK3566 and RK3568 have a different DRAM init blob... So can we reuse the RK3568 DRAM init blob with RK3566 and it'll work? Otherwise, how do you plan on supporting multiple SoC variants? I think it'd be quite confusing to have everything the same except the DRAM init blob for devices that don't seem to be binary compatible (from the DRAM PoV at the very least).

Quoted 43 lines
arch/arm/mach-rockchip/rk3568/Kconfig +1 -1
  config TARGET_QUARTZ64_RK3566
  	bool "Pine64 Quartz64"
@@ -76,7 +77,7 @@ source "board/hardkernel/odroid_m1/Kconfig"
  source "board/hardkernel/odroid_m1s/Kconfig"
  source "board/pine64/quartz64_rk3566/Kconfig"
  source "board/powkiddy/x55/Kconfig"
-source "board/qnap/ts433_rk3568/Kconfig"
+source "board/qnap/tsx33_rk356x/Kconfig"
  source "board/radxa/zero3-rk3566/Kconfig"
  source "board/xunlong/orangepi-3b-rk3566/Kconfig"
 
board/qnap/tsx33_rk356x/Kconfig renamed from board/qnap/ts433_rk3568/Kconfig +3 -3
similarity index 52%
rename from board/qnap/ts433_rk3568/Kconfig
rename to board/qnap/tsx33_rk356x/Kconfig
index c5f9db849f2..2f64b9be062 100644
@@ -1,12 +1,12 @@
-if TARGET_QNAP_TS433_RK3568
+if TARGET_QNAP_TSX33_RK356X
 
  config SYS_BOARD
-	default "ts433_rk3568"
+	default "tsx33_rk356x"
 
  config SYS_VENDOR
  	default "qnap"
 
  config SYS_CONFIG_NAME
-	default "ts433_rk3568"
+	default "tsx33_rk356x"
 
  endif
board/qnap/tsx33_rk356x/MAINTAINERS renamed from board/qnap/ts433_rk3568/MAINTAINERS +0 -0
similarity index 68%
rename from board/qnap/ts433_rk3568/MAINTAINERS
rename to board/qnap/tsx33_rk356x/MAINTAINERS
index 02ce7ff383c..b91274c7b43 100644

board/qnap/tsx33_rk356x/MAINTAINERS line 6

Quoted 9 lines
board/qnap/tsx33_rk356x/MAINTAINERS renamed from board/qnap/ts433_rk3568/MAINTAINERS +3 -3
@@ -1,8 +1,8 @@
-QNAP-TS433
+QNAP-TSX33
  M:	Heiko Stuebner <[email protected]>
  S:	Maintained
-F:	board/qnap/ts433_rk3568/
+F:	board/qnap/tsx33_rk356x/
  F:	doc/board/qnap/
-F:	include/configs/qnap_ts433.h
+F:	include/configs/qnap_tsx33.h

Doesn't match SYS_CONFIG_NAME.

board/qnap/tsx33_rk356x/MAINTAINERS line 7

Quoted 1 line
board/qnap/tsx33_rk356x/MAINTAINERS renamed from board/qnap/ts433_rk3568/MAINTAINERS +0 -0
  F:	configs/qnap-ts433-rk3568_defconfig

And you don't rename the defconfig? Odd choice :)

Cheers,
Quentin

author maintainer
#22 lore raw

PATCH v2 12/12 rockchip: board: qnap-tsx33: add support for Qnap TS233 devices

In reply to Heiko Stuebner

The TS233 shares the same basic peripheral setup for SoC, DDR, EMMC, 3 USB-ports, 1G network interface, SoC-SATA ports, serial and maskrom access.

It could just share the same U-Boot binary with the TS433, and the type- selection would take care of loading the right DTB for the operating system. But right now we can't select the correct DTB for inside U-Boot itself.

So for the time being, add separate defconfig and documentation for it.

---
 arch/arm/dts/rk3568-qnap-ts233-u-boot.dtsi |  6 ++
 board/qnap/tsx33_rk356x/MAINTAINERS        |  2 +
 board/qnap/tsx33_rk356x/board.c            |  4 +-
 configs/qnap-ts233-rk3568_defconfig        | 85 ++++++++++++++++++++++
 doc/board/qnap/ts233.rst                   | 37 ++++++++++
 5 files changed, 132 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/rk3568-qnap-ts233-u-boot.dtsi
 create mode 100644 configs/qnap-ts233-rk3568_defconfig
 create mode 100644 doc/board/qnap/ts233.rst
arch/arm/dts/rk3568-qnap-ts233-u-boot.dtsi new file +6 -0
new file mode 100644
index 00000000000..19acbceb468
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2024 Heiko Stuebner <[email protected]>
+ */
+
+#include "rk356x-u-boot.dtsi"
board/qnap/tsx33_rk356x/MAINTAINERS +2 -0
index b91274c7b43..af9bf9fe0c5 100644
@@ -4,5 +4,7 @@ S:	Maintained
 F:	board/qnap/tsx33_rk356x/
 F:	doc/board/qnap/
 F:	include/configs/qnap_tsx33.h
+F:	configs/qnap-ts233-rk3568_defconfig
 F:	configs/qnap-ts433-rk3568_defconfig
+F:	arch/arm/dts/rk3568-qnap-ts233-u-boot.dtsi
 F:	arch/arm/dts/rk3568-qnap-ts433-u-boot.dtsi
board/qnap/tsx33_rk356x/board.c +2 -2
index 006add6fb30..7cfff372d8e 100644
@@ -85,7 +85,7 @@ static const struct tsx33_model tsx33_models[TSX33_MODELS] = {
 		"Q0AM0",
 		11,
 		"TS233",
-		NULL, /* not yet supported */
+		DTB_DIR "rk3568-qnap-ts233.dtb",
 	},
 	[Q0AJ0_Q0AM0_11_10] = {
 		"Q0AJ0",
@@ -93,7 +93,7 @@ static const struct tsx33_model tsx33_models[TSX33_MODELS] = {
 		"Q0AM0",
 		10,
 		"TS233",
-		NULL, /* not yet supported */
+		DTB_DIR "rk3568-qnap-ts233.dtb",
 	},
 	[Q0B20_Q0AW0_12_10] = {
 		"Q0B20",
configs/qnap-ts233-rk3568_defconfig new file +85 -0

85 lines not on this page · raw message

doc/board/qnap/ts233.rst new file +37 -0
new file mode 100644
index 00000000000..b706d97afa0
@@ -0,0 +1,37 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+U-Boot for Qnap TS233 Devices
+=============================
+
+This allows U-Boot to boot the Qnap TS233 NAS
+
+The device is similar to the TS433 in terms of its basic peripheral setup
+of SoC, DDR, EMMC, 3 USB-ports, 1G network interface, SoC-SATA ports,
+serial and maskrom access.
+
+Please follow the TS433 steps but with the following changes.
+
+Building U-Boot
+---------------
+
+The TS233 can just run the TS433 U-Boot binary, but if a separate binary
+should be build, the following command will do so:
+
+.. code-block:: bash
+
+    $ export CROSS_COMPILE=aarch64-linux-gnu-
+    $ export ROCKCHIP_TPL=../rkbin/bin/rk35/rk3568_ddr_1560MHz_v1.23.bin
+    $ make qnap-ts233-rk3568_defconfig
+    $ make
+
+This will build ``u-boot-rockchip.bin`` which can be written to the
+on-board eMMC.
+
+Image installation
+------------------
+
+The serial port is located next to the CPU and labeled "SOC_UART", while
+the maskrom jumper header is located in the smaller cutout and
+labeled "MASKROM RECOVERY".
+
+The USB port to use is the one located in the front of the device.
Signature · 1 line
2.47.2
#23 lore raw

Re: [PATCH v2 12/12] rockchip: board: qnap-tsx33: add support for Qnap TS233 devices

Hi Heiko,

Quoted 149 lines · Heiko Stuebner

The TS233 shares the same basic peripheral setup for SoC, DDR, EMMC, 3 USB-ports, 1G network interface, SoC-SATA ports, serial and maskrom access.

It could just share the same U-Boot binary with the TS433, and the type- selection would take care of loading the right DTB for the operating system. But right now we can't select the correct DTB for inside U-Boot itself.

So for the time being, add separate defconfig and documentation for it.

---
  arch/arm/dts/rk3568-qnap-ts233-u-boot.dtsi |  6 ++
  board/qnap/tsx33_rk356x/MAINTAINERS        |  2 +
  board/qnap/tsx33_rk356x/board.c            |  4 +-
  configs/qnap-ts233-rk3568_defconfig        | 85 ++++++++++++++++++++++
  doc/board/qnap/ts233.rst                   | 37 ++++++++++
  5 files changed, 132 insertions(+), 2 deletions(-)

create mode 100644 arch/arm/dts/rk3568-qnap-ts233-u-boot.dtsi create mode 100644 configs/qnap-ts233-rk3568_defconfig create mode 100644 doc/board/qnap/ts233.rst

arch/arm/dts/rk3568-qnap-ts233-u-boot.dtsi new file +6 -0
new file mode 100644
index 00000000000..19acbceb468
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2024 Heiko Stuebner <[email protected]>
+ */
+
+#include "rk356x-u-boot.dtsi"
board/qnap/tsx33_rk356x/MAINTAINERS +2 -0
index b91274c7b43..af9bf9fe0c5 100644
@@ -4,5 +4,7 @@ S:	Maintained
  F:	board/qnap/tsx33_rk356x/
  F:	doc/board/qnap/
  F:	include/configs/qnap_tsx33.h
+F:	configs/qnap-ts233-rk3568_defconfig
  F:	configs/qnap-ts433-rk3568_defconfig
+F:	arch/arm/dts/rk3568-qnap-ts233-u-boot.dtsi
  F:	arch/arm/dts/rk3568-qnap-ts433-u-boot.dtsi
board/qnap/tsx33_rk356x/board.c +2 -2
index 006add6fb30..7cfff372d8e 100644
@@ -85,7 +85,7 @@ static const struct tsx33_model tsx33_models[TSX33_MODELS] = {
  		"Q0AM0",
  		11,
  		"TS233",
-		NULL, /* not yet supported */
+		DTB_DIR "rk3568-qnap-ts233.dtb",
  	},
  	[Q0AJ0_Q0AM0_11_10] = {
  		"Q0AJ0",
@@ -93,7 +93,7 @@ static const struct tsx33_model tsx33_models[TSX33_MODELS] = {
  		"Q0AM0",
  		10,
  		"TS233",
-		NULL, /* not yet supported */
+		DTB_DIR "rk3568-qnap-ts233.dtb",
  	},
  	[Q0B20_Q0AW0_12_10] = {
  		"Q0B20",
configs/qnap-ts233-rk3568_defconfig new file +74 -0
new file mode 100644
index 00000000000..53ac5b25bd0
@@ -0,0 +1,85 @@
+CONFIG_ARM=y
+CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
+CONFIG_COUNTER_FREQUENCY=24000000
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3568-qnap-ts233"
+CONFIG_ROCKCHIP_RK3568=y
+CONFIG_SPL_SERIAL=y
+CONFIG_TARGET_QNAP_TSX33_RK356X=y
+CONFIG_SYS_LOAD_ADDR=0xc00800
+CONFIG_DEBUG_UART_BASE=0xFE660000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_PCI=y
+CONFIG_DEBUG_UART=y
+CONFIG_AHCI=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_LEGACY_IMAGE_FORMAT=y
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-qnap-ts233.dtb"
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_SPL_MAX_SIZE=0x40000
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+CONFIG_SPL_ATF=y
+CONFIG_BOARD_TYPES=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_PCI=y
+CONFIG_CMD_SATA=y
+CONFIG_CMD_USB=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
+# CONFIG_SPL_DOS_PARTITION is not set
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_LIVE=y
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_ENV_RELOC_GD_ENV_ADDR=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_SPL_REGMAP=y
+CONFIG_SPL_SYSCON=y
+CONFIG_AHCI_PCI=y
+CONFIG_DWC_AHCI=y
+CONFIG_SPL_CLK=y
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_SYS_I2C_ROCKCHIP=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
+CONFIG_MISC=y
+CONFIG_I2C_EEPROM=y
+CONFIG_SUPPORT_EMMC_RPMB=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_SDMA=y
+CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_DWC_ETH_QOS=y
+CONFIG_DWC_ETH_QOS_ROCKCHIP=y
+CONFIG_RTL8169=y
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
+CONFIG_SPL_PINCTRL=y
+CONFIG_DM_PMIC=y
+CONFIG_DM_PMIC_FAN53555=y
+CONFIG_PMIC_RK8XX=y
+CONFIG_REGULATOR_RK8XX=y
+CONFIG_PWM_ROCKCHIP=y
+CONFIG_SPL_RAM=y
+CONFIG_SCSI=y
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550_MEM32=y
+CONFIG_SYSRESET=y

configs/qnap-ts233-rk3568_defconfig line 84

Quoted 10 lines
configs/qnap-ts233-rk3568_defconfig new file +10 -0
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_GENERIC=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GENERIC=y
+CONFIG_ERRNO_STR=y
+# CONFIG_SPL_ATF_NO_PLATFORM_PARAM is not set

NAK. This forces upstream TF-A to be used with this device and differs from the config used for TS433.

doc/board/qnap/ts233.rst

Quoted 6 lines
configs/qnap-ts233-rk3568_defconfig new file +1 -0
+CONFIG_OPTEE_LIB=y
doc/board/qnap/ts233.rst new file +0 -0
new file mode 100644
index 00000000000..b706d97afa0

You need to add ts233.rst to doc/board/qnap/index.rst (or use :glob: with a pattern in the toctree, see https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-option-toctree-glob).

doc/board/qnap/ts233.rst line 12

Quoted 13 lines
doc/board/qnap/ts233.rst new file +12 -0
@@ -0,0 +1,37 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+U-Boot for Qnap TS233 Devices
+=============================
+
+This allows U-Boot to boot the Qnap TS233 NAS
+
+The device is similar to the TS433 in terms of its basic peripheral setup
+of SoC, DDR, EMMC, 3 USB-ports, 1G network interface, SoC-SATA ports,
+serial and maskrom access.
+
+Please follow the TS433 steps but with the following changes.

Please link to it, e.g. with :doc:../ts433 (not tested).

Otherwise, I can suggest to make use of the include directive such that you have a file with the common content for TS233 and TS433 that you

.. include:: building-u-boot.rst

See https://docutils.sourceforge.io/docs/ref/rst/directives.html#include.

Maybe we should provide such a base file for Rockchip SoCs such that we don't need to duplicate this for all boards. And they won't be outdated. For another time :)

Cheers,
Quentin

#24 lore raw

Re: [PATCH v2 12/12] rockchip: board: qnap-tsx33: add support for Qnap TS233 devices

In reply to Heiko Stuebner

Hi Heiko,

Quoted 11 lines · Heiko Stuebner

The TS233 shares the same basic peripheral setup for SoC, DDR, EMMC, 3 USB-ports, 1G network interface, SoC-SATA ports, serial and maskrom access.

It could just share the same U-Boot binary with the TS433, and the type- selection would take care of loading the right DTB for the operating system. But right now we can't select the correct DTB for inside U-Boot itself.

So for the time being, add separate defconfig and documentation for it.

Quoted 7 lines
---
  arch/arm/dts/rk3568-qnap-ts233-u-boot.dtsi |  6 ++
  board/qnap/tsx33_rk356x/MAINTAINERS        |  2 +
  board/qnap/tsx33_rk356x/board.c            |  4 +-
  configs/qnap-ts233-rk3568_defconfig        | 85 ++++++++++++++++++++++
  doc/board/qnap/ts233.rst                   | 37 ++++++++++

checking consistency... /builds/u-boot/custodians/u-boot-rockchip/doc/board/qnap/ts233.rst: WARNING: document isn't included in any toctree

Thanks,

- Kever