kirkwood: Add support for Sheevaplug
authorBERENYI Balazs <balazs@wee.hu>
Sat, 2 Jan 2021 18:49:42 +0000 (18:49 +0000)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Sun, 6 Jun 2021 17:05:07 +0000 (19:05 +0200)
Globalscale SheevaPlug:
* Marvell Kirkwood 88F6281
* 512 MB SDRAM
* 512 MB Flash
* Gigabit Network
* USB 2.0
* SD slot
* Serial console

The device is supported in mainline uboot/linux the commit adds only
some openwrt config for building an image.

Installation:
1 - Update uboot:
setenv ipaddr '192.168.0.111'
setenv serverip '192.168.0.1'
tftpboot u-boot.kwb
nand erase 0x0 0x100000
nand write 0x800000 0x0 0x100000
reset
2 - Install OpenWRT:
setenv ethaddr 00:50:43:01:xx:xx
saveenv
setenv ipaddr '192.168.0.111'
setenv serverip '192.168.0.1'
tftpboot openwrt-kirkwood-globalscale_sheevaplug-squashfs-factory.bin
nand erase.part ubi
nand write 0x800000 ubi 0x600000
reset

Signed-off-by: BERENYI Balazs <balazs@wee.hu>
Reviewed-by: Pawel Dembicki <paweldembicki@gmail.com>
[add vendor name for uboot-kirkwood, merge patches, copy to 5.10,
add AUTORELEASE for uboot-kirkwood, refresh patches]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
package/boot/uboot-envtools/files/kirkwood
package/boot/uboot-kirkwood/Makefile
package/boot/uboot-kirkwood/patches/170-sheevaplug.patch [new file with mode: 0644]
package/boot/uboot-kirkwood/patches/200-openwrt-config.patch
target/linux/kirkwood/base-files/etc/board.d/02_network
target/linux/kirkwood/image/Makefile
target/linux/kirkwood/patches-5.10/112-sheevaplug.patch [new file with mode: 0644]
target/linux/kirkwood/patches-5.4/112-sheevaplug.patch [new file with mode: 0644]

index d1986f206d4825ff8572b6efa891ec6a090c64e4..6a3dfcaba81ba061021e0a8ccc1ce2a6b2ed3e39 100644 (file)
@@ -15,6 +15,7 @@ case "$board" in
 checkpoint,l-50|\
 cloudengines,pogoe02|\
 cloudengines,pogoplugv4|\
+globalscale,sheevaplug|\
 iom,ix2-200|\
 linksys,e4200-v2|\
 linksys,ea4500|\
index 1ed1743e21232e38b61d7c7bfdf78b416be170a2..d9cb10ce13affd100f71f81c7bc8389d9ee090a4 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_VERSION:=2020.04
-PKG_RELEASE:=1
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_HASH:=fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372
 
@@ -94,6 +94,11 @@ define U-Boot/pogoplugv4
   BUILD_DEVICES:=cloudengines_pogoplugv4
 endef
 
+define U-Boot/sheevaplug
+  NAME:=Globalscale SheevaPlug
+  BUILD_DEVICES:=globalscale_sheevaplug
+endef
+
 UBOOT_TARGETS := \
        dockstar dockstar_second_stage \
        goflexhome \
@@ -105,7 +110,8 @@ UBOOT_TARGETS := \
        nsa310s \
        nsa325 \
        pogo_e02 pogo_e02_second_stage \
-       pogoplugv4
+       pogoplugv4 \
+       sheevaplug
 
 define Build/Configure
        $(if $(findstring _second_stage,$(BUILD_VARIANT)),
diff --git a/package/boot/uboot-kirkwood/patches/170-sheevaplug.patch b/package/boot/uboot-kirkwood/patches/170-sheevaplug.patch
new file mode 100644 (file)
index 0000000..12b3e68
--- /dev/null
@@ -0,0 +1,39 @@
+--- a/include/configs/sheevaplug.h
++++ b/include/configs/sheevaplug.h
+@@ -45,15 +45,17 @@
+ /*
+  * Default environment variables
+  */
+-#define CONFIG_BOOTCOMMAND            "${x_bootcmd_kernel}; " \
+-      "setenv bootargs ${x_bootargs} ${x_bootargs_root}; "    \
+-      "bootm 0x6400000;"
++#define CONFIG_BOOTCOMMAND                                    \
++      "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; "     \
++      "ubi part ubi; "                                                \
++      "ubi read 0x800000 kernel; "                    \
++      "bootm 0x800000"
+-#define CONFIG_EXTRA_ENV_SETTINGS     "x_bootargs=console"    \
+-      "=ttyS0,115200 mtdparts="CONFIG_MTDPARTS_DEFAULT        \
+-      "x_bootcmd_kernel=nand read 0x6400000 0x100000 0x400000\0" \
+-      "x_bootcmd_usb=usb start\0" \
+-      "x_bootargs_root=root=/dev/mtdblock3 rw rootfstype=jffs2\0"
++#define CONFIG_EXTRA_ENV_SETTINGS                     \
++      "console=console=ttyS0,115200\0"                \
++      "mtdids="CONFIG_MTDIDS_DEFAULT "\0"             \
++      "mtdparts="CONFIG_MTDPARTS_DEFAULT "\0" \
++      "bootargs_root=\0"
+ /*
+  * Ethernet Driver configuration
+--- a/configs/sheevaplug_defconfig
++++ b/configs/sheevaplug_defconfig
+@@ -30,7 +30,7 @@ CONFIG_CMD_FAT=y
+ CONFIG_CMD_JFFS2=y
+ CONFIG_CMD_MTDPARTS=y
+ CONFIG_MTDIDS_DEFAULT="nand0=orion_nand"
+-CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:512K(uboot),512K(env),4M(kernel),-(rootfs)"
++CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:1M(uboot),-(ubi)"
+ CONFIG_CMD_UBI=y
+ CONFIG_ISO_PARTITION=y
+ CONFIG_OF_CONTROL=y
index 83eb0f9d2cf8538dbd4630aa31afb8faf5db66d8..ae9fdf3390cb7e9ba8cf1941469f29653c150471 100644 (file)
 +#include "openwrt-kirkwood-common.h"
 +
  #endif /* _CONFIG_NSA310S_H */
+--- a/configs/sheevaplug_defconfig
++++ b/configs/sheevaplug_defconfig
+@@ -49,4 +49,7 @@
+ CONFIG_DM_USB=y
+ CONFIG_USB_EHCI_HCD=y
+ CONFIG_USB_STORAGE=y
++CONFIG_FIT=y
++CONFIG_FIT_VERBOSE=y
+ CONFIG_LZMA=y
++CONFIG_LZO=y
index 05786911444c9339d811270f282512bdebe511b6..c379d130460c30d1ae75dbfe0da7242aab2f5e57 100644 (file)
@@ -18,6 +18,7 @@ case "$board" in
        ;;
 "cloudengines,pogoe02"|\
 "cloudengines,pogoplugv4"|\
+"globalscale,sheevaplug"|\
 "iom,iconnect-1.1"|\
 "iom,ix2-200"|\
 "raidsonic,ib-nas62x0"|\
index e06eb050ef9515b5decc3b5709bb385a17760171..c2c5bcab8fdff415f8b8a4e8c0b7a9efedeee739 100644 (file)
@@ -67,6 +67,13 @@ define Device/cloudengines_pogoplugv4
 endef
 TARGET_DEVICES += cloudengines_pogoplugv4
 
+define Device/globalscale_sheevaplug
+  DEVICE_VENDOR := Globalscale
+  DEVICE_MODEL := Sheevaplug
+  DEVICE_PACKAGES := kmod-mvsdio
+endef
+TARGET_DEVICES += globalscale_sheevaplug
+
 define Device/iom_iconnect-1.1
   DEVICE_VENDOR := Iomega
   DEVICE_MODEL := Iconnect
diff --git a/target/linux/kirkwood/patches-5.10/112-sheevaplug.patch b/target/linux/kirkwood/patches-5.10/112-sheevaplug.patch
new file mode 100644 (file)
index 0000000..d1ff988
--- /dev/null
@@ -0,0 +1,47 @@
+--- a/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
++++ b/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
+@@ -78,13 +78,8 @@
+       };
+       partition@100000 {
+-              label = "uImage";
+-              reg = <0x0100000 0x400000>;
+-      };
+-
+-      partition@500000 {
+-              label = "root";
+-              reg = <0x0500000 0x1fb00000>;
++              label = "ubi";
++              reg = <0x0100000 0x1ff00000>;
+       };
+ };
+--- a/arch/arm/boot/dts/kirkwood-sheevaplug.dts
++++ b/arch/arm/boot/dts/kirkwood-sheevaplug.dts
+@@ -13,6 +13,13 @@
+       model = "Globalscale Technologies SheevaPlug";
+       compatible = "globalscale,sheevaplug", "marvell,kirkwood-88f6281", "marvell,kirkwood";
++      aliases {
++              led-boot = &led_health;
++              led-failsafe = &led_health;
++              led-running = &led_health;
++              led-upgrade = &led_health;
++      };
++
+       ocp@f1000000 {
+               mvsdio@90000 {
+                       pinctrl-0 = <&pmx_sdio>;
+@@ -28,10 +35,10 @@
+               pinctrl-0 = <&pmx_led_blue &pmx_led_red>;
+               pinctrl-names = "default";
+-              health {
++              led_health: health {
+                       label = "sheevaplug:blue:health";
+                       gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
+-                      default-state = "keep";
++                      default-state = "on";
+               };
+               misc {
diff --git a/target/linux/kirkwood/patches-5.4/112-sheevaplug.patch b/target/linux/kirkwood/patches-5.4/112-sheevaplug.patch
new file mode 100644 (file)
index 0000000..d1ff988
--- /dev/null
@@ -0,0 +1,47 @@
+--- a/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
++++ b/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
+@@ -78,13 +78,8 @@
+       };
+       partition@100000 {
+-              label = "uImage";
+-              reg = <0x0100000 0x400000>;
+-      };
+-
+-      partition@500000 {
+-              label = "root";
+-              reg = <0x0500000 0x1fb00000>;
++              label = "ubi";
++              reg = <0x0100000 0x1ff00000>;
+       };
+ };
+--- a/arch/arm/boot/dts/kirkwood-sheevaplug.dts
++++ b/arch/arm/boot/dts/kirkwood-sheevaplug.dts
+@@ -13,6 +13,13 @@
+       model = "Globalscale Technologies SheevaPlug";
+       compatible = "globalscale,sheevaplug", "marvell,kirkwood-88f6281", "marvell,kirkwood";
++      aliases {
++              led-boot = &led_health;
++              led-failsafe = &led_health;
++              led-running = &led_health;
++              led-upgrade = &led_health;
++      };
++
+       ocp@f1000000 {
+               mvsdio@90000 {
+                       pinctrl-0 = <&pmx_sdio>;
+@@ -28,10 +35,10 @@
+               pinctrl-0 = <&pmx_led_blue &pmx_led_red>;
+               pinctrl-names = "default";
+-              health {
++              led_health: health {
+                       label = "sheevaplug:blue:health";
+                       gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
+-                      default-state = "keep";
++                      default-state = "on";
+               };
+               misc {