From 4220f75d1ee212348f5b01e2e1878744e4ef8f7c Mon Sep 17 00:00:00 2001
From: Linus Walleij <linus.walleij@linaro.org>
Date: Mon, 20 May 2024 21:32:55 +0200
Subject: [PATCH] ixp4xx: Add back support for Iomega NAS100D

OpenWrt supported the Iomega NAS100D in the past and it has
64 MB of RAM so if booted from a harddrive it will probably
work just fine. The APEX boot loader already has a build
variant for this machine that we can just pick up and use.

This device has a single ethernet port so bring this online
with DHCP as expected for a NAS device.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 .../linux/ixp4xx/base-files/etc/board.d/02_network  |  1 +
 target/linux/ixp4xx/image/Makefile                  | 13 +++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/target/linux/ixp4xx/base-files/etc/board.d/02_network b/target/linux/ixp4xx/base-files/etc/board.d/02_network
index 864328d6bc..96d7b31282 100644
--- a/target/linux/ixp4xx/base-files/etc/board.d/02_network
+++ b/target/linux/ixp4xx/base-files/etc/board.d/02_network
@@ -8,6 +8,7 @@ gateworks,gw2348|\
 gateworks,gw2358)
 	ucidef_set_interfaces_lan_wan "eth0" "eth1"
 	;;
+iom,nas-100d|\
 linksys,nslu2)
 	ucidef_set_interface_lan "eth0" "dhcp"
 	;;
diff --git a/target/linux/ixp4xx/image/Makefile b/target/linux/ixp4xx/image/Makefile
index b532bcd914..14d74cfb70 100644
--- a/target/linux/ixp4xx/image/Makefile
+++ b/target/linux/ixp4xx/image/Makefile
@@ -60,6 +60,19 @@ define Device/gateworks_cambria
 endef
 TARGET_DEVICES += gateworks_cambria
 
+define Device/iomega_nas100d
+	DEVICE_VENDOR := Iomega
+	DEVICE_MODEL := NAS100d
+	# USB2 is compiled in and needs no package
+	DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-pcf8563
+	DEVICE_DTS := intel-ixp42x-iomega-nas100d
+	KERNEL := kernel-bin | append-dtb
+	IMAGES := factory.bin
+	# This has to boot from harddisk so just append the kernel
+	IMAGE/factory.bin := append-kernel | linksys-ixp425-image "nas100d"
+endef
+TARGET_DEVICES += iomega_nas100d
+
 define Device/linksys_nslu2
 	DEVICE_VENDOR := Linksys
 	DEVICE_MODEL := NSLU2
-- 
2.30.2