mvebu: add Kobol Helios 4 device
authorAlberto Bursi <bobafetthotmail@gmail.com>
Sun, 12 Jul 2020 13:35:54 +0000 (15:35 +0200)
committerPetr Štetiar <ynezz@true.cz>
Fri, 17 Jul 2020 09:00:33 +0000 (11:00 +0200)
The Helios 4 is a NAS from Kobol
that is powered by an Armada 38x
MicroSOM from Solidrun, similarly
to Clearfog.

This device has:
-Armada 38x CPU
 (dual core ARMv7 1.6 Ghz)
-2 GB of ECC RAM
-Gigabit ethernet (Marvell)
-2x USB 3.0 ports
-4x Sata 3.0 ports
-i2c header (J9 |>GND|SDA|SCL|VCC)
-2x 3-pin fan headers with PWM
-micro-usb port is a TTL/UART to
 USB converter connected to TTL
-MicroSD card slot
-System, 4xSata and 1xUSB LEDs

NOT WORKING: fan control

Fan Control requires a kernel patch
that is available in the Armbian
project (the "default firmware"
of this device) and named
mvebu-gpio-remove-hardcoded
-timer-assignment
This patch isn't acceptable
by OpenWrt, it should be upstreamed.
I also have that patch in my own
local OpenWrt builds,
in case you want a more
clean and less confusing patch
for upstreaming.

To install, write the disk image
on a micro SD card with dd or
win32 disk imager, insert the
card in the slot.
Check that the dip switch battery
for boot selection is as follows
Switch 1 and 2 down/off, switches
3, 4, 5 up/on.

Signed-off-by: Alberto Bursi <bobafetthotmail@gmail.com>
target/linux/mvebu/config-4.19
target/linux/mvebu/config-5.4
target/linux/mvebu/cortexa9/base-files/etc/board.d/01_leds
target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh
target/linux/mvebu/image/cortexa9.mk
target/linux/mvebu/patches-4.19/560-helios4-dts-status-led-alias.patch [new file with mode: 0644]
target/linux/mvebu/patches-4.19/561-mvebu-armada-38x-enable-libata-leds.patch [new file with mode: 0644]
target/linux/mvebu/patches-5.4/560-helios4-dts-status-led-alias.patch [new file with mode: 0644]
target/linux/mvebu/patches-5.4/561-mvebu-armada-38x-enable-libata-leds.patch [new file with mode: 0644]

index bf07ec58fdf677a4e4ae83cea494475ef5f98b00..3de6296a8d05bc908d09b59ed89e06b86ceb1c96 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y
 CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
 CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_ARCH_WANT_LIBATA_LEDS=y
 CONFIG_ARM=y
 CONFIG_ARMADA_370_CLK=y
 CONFIG_ARMADA_370_XP_IRQ=y
@@ -64,6 +65,7 @@ CONFIG_ARM_UNWIND=y
 CONFIG_ARM_VIRT_EXT=y
 CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
 CONFIG_ATA=y
+CONFIG_ATA_LEDS=y
 CONFIG_ATAGS=y
 CONFIG_AUTO_ZRELADDR=y
 CONFIG_BLK_DEV_LOOP=y
index 69c7ea3da818f21b8ad7001dc92614a989bc2ed7..9739ee62ae25a1110e673c1f458abf3e16fd38f0 100644 (file)
@@ -37,6 +37,7 @@ CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
 CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y
 CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_ARCH_WANT_LIBATA_LEDS=y
 CONFIG_ARM=y
 CONFIG_ARMADA_370_CLK=y
 CONFIG_ARMADA_370_XP_IRQ=y
@@ -69,6 +70,7 @@ CONFIG_ARM_UNWIND=y
 CONFIG_ARM_VIRT_EXT=y
 CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
 CONFIG_ATA=y
+CONFIG_ATA_LEDS=y
 CONFIG_ATAGS=y
 CONFIG_AUTO_ZRELADDR=y
 CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y
index c62de013d482a9fb619e487c507e348ceb1a1bb8..5a2ca3fa85833053ff2b8be4ffa270a525946a2d 100755 (executable)
@@ -12,6 +12,9 @@ board=$(board_name)
 boardname="${board##*,}"
 
 case "$board" in
+kobol,helios4)
+       ucidef_set_led_usbport "USB" "USB" "helios4:green:usb" "usb1-port1" "usb2-port1" "usb3-port1" "usb4-port1" "usb5-port1"
+       ;;
 linksys,wrt1200ac)
        ucidef_set_led_netdev "wan" "WAN" "pca963x:caiman:white:wan" "wan"
        ucidef_set_led_usbport "usb1" "USB 1" "pca963x:caiman:white:usb2" "usb1-port1"
index 6dccb491ba23cb78eb839cbbdfc46e2318e61192..42289209d5386988e3749d6fe489c2d2fe2c07ac 100755 (executable)
@@ -10,6 +10,7 @@ REQUIRE_IMAGE_METADATA=1
 platform_check_image() {
        case "$(board_name)" in
        cznic,turris-omnia|\
+       kobol,helios4|\
        solidrun,clearfog-base-a1|\
        solidrun,clearfog-pro-a1)
                platform_check_image_sdcard "$1"
@@ -26,6 +27,7 @@ platform_do_upgrade() {
                nand_do_upgrade "$1"
                ;;
        cznic,turris-omnia|\
+       kobol,helios4|\
        solidrun,clearfog-base-a1|\
        solidrun,clearfog-pro-a1)
                platform_do_upgrade_sdcard "$1"
@@ -46,6 +48,7 @@ platform_do_upgrade() {
 platform_copy_config() {
        case "$(board_name)" in
        cznic,turris-omnia|\
+       kobol,helios4|\
        solidrun,clearfog-base-a1|\
        solidrun,clearfog-pro-a1)
                platform_copy_config_sdcard
index 7f0a2fe6974f7b97cf7b4f9c3e7a77d0f048e450..5f323674317c0e15de21979e6758a3d935c6a807 100644 (file)
@@ -51,6 +51,20 @@ define Device/globalscale_mirabox
 endef
 TARGET_DEVICES += globalscale_mirabox
 
+define Device/kobol_helios4
+  DEVICE_VENDOR := Kobol
+  DEVICE_MODEL := Helios4
+  KERNEL_INSTALL := 1
+  KERNEL := kernel-bin
+  DEVICE_PACKAGES := mkf2fs e2fsprogs partx-utils
+  IMAGES := sdcard.img.gz
+  IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
+  SOC := armada-388
+  UBOOT := helios4-u-boot-spl.kwb
+  BOOT_SCRIPT := clearfog
+endef
+TARGET_DEVICES += kobol_helios4
+
 define Device/linksys
   $(Device/NAND-128K)
   DEVICE_VENDOR := Linksys
diff --git a/target/linux/mvebu/patches-4.19/560-helios4-dts-status-led-alias.patch b/target/linux/mvebu/patches-4.19/560-helios4-dts-status-led-alias.patch
new file mode 100644 (file)
index 0000000..4c4fbec
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/arch/arm/boot/dts/armada-388-helios4.dts
++++ b/arch/arm/boot/dts/armada-388-helios4.dts
+@@ -15,6 +15,13 @@
+       model = "Helios4";
+       compatible = "kobol,helios4", "marvell,armada388",
+               "marvell,armada385", "marvell,armada380";
++              
++      aliases {
++              led-boot = &led_status;
++              led-failsafe = &led_status;
++              led-running = &led_status;
++              led-upgrade = &led_status;
++      };
+       memory {
+               device_type = "memory";
+@@ -70,10 +77,9 @@
+       system-leds {
+               compatible = "gpio-leds";
+-              status-led {
++              led_status: status-led {
+                       label = "helios4:green:status";
+                       gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
+-                      linux,default-trigger = "heartbeat";
+                       default-state = "on";
+               };
diff --git a/target/linux/mvebu/patches-4.19/561-mvebu-armada-38x-enable-libata-leds.patch b/target/linux/mvebu/patches-4.19/561-mvebu-armada-38x-enable-libata-leds.patch
new file mode 100644 (file)
index 0000000..3f9ad36
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/arch/arm/mach-mvebu/Kconfig
++++ b/arch/arm/mach-mvebu/Kconfig
+@@ -68,6 +68,7 @@
+       select HAVE_SMP
+       select MACH_MVEBU_V7
+       select PINCTRL_ARMADA_38X
++      select ARCH_WANT_LIBATA_LEDS
+       help
+         Say 'Y' here if you want your kernel to support boards based
+         on the Marvell Armada 380/385 SoC with device tree.
diff --git a/target/linux/mvebu/patches-5.4/560-helios4-dts-status-led-alias.patch b/target/linux/mvebu/patches-5.4/560-helios4-dts-status-led-alias.patch
new file mode 100644 (file)
index 0000000..4c4fbec
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/arch/arm/boot/dts/armada-388-helios4.dts
++++ b/arch/arm/boot/dts/armada-388-helios4.dts
+@@ -15,6 +15,13 @@
+       model = "Helios4";
+       compatible = "kobol,helios4", "marvell,armada388",
+               "marvell,armada385", "marvell,armada380";
++              
++      aliases {
++              led-boot = &led_status;
++              led-failsafe = &led_status;
++              led-running = &led_status;
++              led-upgrade = &led_status;
++      };
+       memory {
+               device_type = "memory";
+@@ -70,10 +77,9 @@
+       system-leds {
+               compatible = "gpio-leds";
+-              status-led {
++              led_status: status-led {
+                       label = "helios4:green:status";
+                       gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
+-                      linux,default-trigger = "heartbeat";
+                       default-state = "on";
+               };
diff --git a/target/linux/mvebu/patches-5.4/561-mvebu-armada-38x-enable-libata-leds.patch b/target/linux/mvebu/patches-5.4/561-mvebu-armada-38x-enable-libata-leds.patch
new file mode 100644 (file)
index 0000000..3f9ad36
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/arch/arm/mach-mvebu/Kconfig
++++ b/arch/arm/mach-mvebu/Kconfig
+@@ -68,6 +68,7 @@
+       select HAVE_SMP
+       select MACH_MVEBU_V7
+       select PINCTRL_ARMADA_38X
++      select ARCH_WANT_LIBATA_LEDS
+       help
+         Say 'Y' here if you want your kernel to support boards based
+         on the Marvell Armada 380/385 SoC with device tree.