--- /dev/null
+From e7e650e8bdb09ac46da017250394f8c589df10bb Mon Sep 17 00:00:00 2001
+Date: Mon, 14 Sep 2020 15:48:47 -0400
+Subject: [PATCH] arm: kirkwood: dns325: Correct CONFIG_NR_DRAM_BANKS parameter
+
+Testing on a DNS-325 NAS has shown that in order for the device to work
+we need to set CONFIG_NR_DRAM_BANKS to 1 and not 2.
+
+---
+ configs/dns325_defconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/configs/dns325_defconfig
++++ b/configs/dns325_defconfig
+@@ -6,7 +6,7 @@ CONFIG_SYS_TEXT_BASE=0x600000
+ CONFIG_TARGET_DNS325=y
+ CONFIG_ENV_SIZE=0x20000
+ CONFIG_ENV_OFFSET=0xE0000
+-CONFIG_NR_DRAM_BANKS=2
++CONFIG_NR_DRAM_BANKS=1
+ CONFIG_IDENT_STRING="\nD-Link DNS-325"
+ # CONFIG_SYS_MALLOC_F is not set
+ CONFIG_BOOTDELAY=3
--- /dev/null
+--- a/configs/dns325_defconfig
++++ b/configs/dns325_defconfig
+@@ -27,7 +27,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:896k(u-boot),128k(u-boot-env),5m(kernel),-(rootfs)"
++CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(u-boot),0x20000@0xe0000(u-boot-env),-@0x100000(ubi)"
+ CONFIG_CMD_UBI=y
+ CONFIG_ISO_PARTITION=y
+ CONFIG_OF_CONTROL=y
+--- a/include/configs/dns325.h
++++ b/include/configs/dns325.h
+@@ -66,46 +66,12 @@
+ */
+
+ #define CONFIG_EXTRA_ENV_SETTINGS \
+- "stdin=serial\0" \
+- "stdout=serial\0" \
+- "stderr=serial\0" \
+- "loadaddr=0x800000\0" \
+- "autoload=no\0" \
+- "console=ttyS0,115200\0" \
+- "mtdparts="CONFIG_MTDPARTS_DEFAULT \
+- "optargs=\0" \
+- "bootenv=uEnv.txt\0" \
+- "importbootenv=echo Importing environment ...; " \
+- "env import -t ${loadaddr} ${filesize}\0" \
+- "loadbootenv=fatload usb 0 ${loadaddr} ${bootenv}\0" \
+- "setbootargs=setenv bootargs console=${console} " \
+- "${optargs} " \
+- "${mtdparts} " \
+- "root=${bootenvroot} " \
+- "rootfstype=${bootenvrootfstype}\0" \
+- "subbootcmd=run setbootargs; " \
+- "if run bootenvloadimage; then " \
+- "bootm ${loadaddr};" \
+- "fi;\0" \
+- "nandroot=ubi0:rootfs ubi.mtd=rootfs\0" \
+- "nandrootfstype=ubifs\0" \
+- "nandloadimage=nand read ${loadaddr} kernel\0" \
+- "setnandbootenv=echo Booting from nand ...; " \
+- "setenv bootenvroot ${nandroot}; " \
+- "setenv bootenvrootfstype ${nandrootfstype}; " \
+- "setenv bootenvloadimage ${nandloadimage}\0"
++ "mtdids="CONFIG_MTDIDS_DEFAULT "\0" \
++ "mtdparts="CONFIG_MTDPARTS_DEFAULT "\0"
+
+ #define CONFIG_BOOTCOMMAND \
+- "if test -n ${bootenv} && usb start; then " \
+- "if run loadbootenv; then " \
+- "echo Loaded environment ${bootenv} from usb;" \
+- "run importbootenv;" \
+- "fi;" \
+- "if test -n ${bootenvcmd}; then " \
+- "echo Running bootenvcmd ...;" \
+- "run bootenvcmd;" \
+- "fi;" \
+- "fi;" \
+- "run setnandbootenv subbootcmd;"
++ "ubi part ubi; " \
++ "ubi read 0x800000 kernel; " \
++ "bootm 0x800000"
+
+ #endif /* _CONFIG_DNS325_H */
endef
TARGET_DEVICES += dlink_dns320l
+define Device/dlink_dns-325-a1
+ DEVICE_VENDOR := D-Link
+ DEVICE_MODEL := DNS-325
+ DEVICE_VARIANT := A1
+ DEVICE_DTS := kirkwood-dns325
+ DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-hwmon-lm75 kmod-hwmon-gpiofan \
+ kmod-thermal kmod-usb-ledtrig-usbport kmod-gpio-button-hotplug block-mount \
+ mdadm kmod-md-linear kmod-usb-storage kmod-fs-ext4 e2fsprogs partx-utils \
+ fdisk kmod-rtc-mv
+endef
+TARGET_DEVICES += dlink_dns-325-a1
+
define Device/endian_4i-edge-200
DEVICE_VENDOR := Endian
DEVICE_MODEL := 4i Edge 200