[orion] add support for D-Link DNS-323
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 4 Apr 2012 15:53:55 +0000 (15:53 +0000)
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 4 Apr 2012 15:53:55 +0000 (15:53 +0000)
this patch adds support for D-Link DNS323 storage device.
You can find more info here:

http://dns323.lukaperkov.net/

Currently you need serial cable to flash OpenWrt on DNS-323.

Signed-off-by: Luka Perkov < openwrt ->-to->- lukaperkov.net >
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31198 3c298f89-4303-0410-b956-a3cf2f4a3e73

target/linux/orion/Makefile
target/linux/orion/config-default
target/linux/orion/dns323/base-files/etc/config/network [new file with mode: 0644]
target/linux/orion/dns323/config-default [new file with mode: 0644]
target/linux/orion/dns323/target.mk [new file with mode: 0644]
target/linux/orion/image/dns323.mk [new file with mode: 0644]
target/linux/orion/patches/300-dns323_partition_map.patch [new file with mode: 0644]

index ed899a1..e6e2686 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 ARCH:=arm
 BOARD:=orion
 BOARDNAME:=Marvell Orion
-SUBTARGETS:=generic harddisk
+SUBTARGETS:=generic harddisk dns323
 CFLAGS=-Os -pipe -march=armv5te -mtune=xscale -fno-caller-saves
 MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
 
index d07e8aa..7e3193e 100644 (file)
@@ -125,7 +125,7 @@ CONFIG_LZO_DECOMPRESS=m
 # CONFIG_MACH_BIGDISK is not set
 # CONFIG_MACH_D2NET is not set
 # CONFIG_MACH_DB88F5281 is not set
-# CONFIG_MACH_DNS323 is not set
+CONFIG_MACH_DNS323=y
 CONFIG_MACH_DT2=y
 # CONFIG_MACH_EDMINI_V2 is not set
 # CONFIG_MACH_KUROBOX_PRO is not set
diff --git a/target/linux/orion/dns323/base-files/etc/config/network b/target/linux/orion/dns323/base-files/etc/config/network
new file mode 100644 (file)
index 0000000..8bdd3b0
--- /dev/null
@@ -0,0 +1,12 @@
+# Copyright (C) 2010 OpenWrt.org
+
+config interface loopback
+       option ifname   lo
+       option proto    static
+       option ipaddr   127.0.0.1
+       option netmask  255.0.0.0
+
+config interface eth0
+       option ifname   eth0
+       option proto    dhcp
+       option hostname dns323
diff --git a/target/linux/orion/dns323/config-default b/target/linux/orion/dns323/config-default
new file mode 100644 (file)
index 0000000..c5ec959
--- /dev/null
@@ -0,0 +1,54 @@
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_ATA=y
+CONFIG_ATAGS_PROC=y
+CONFIG_BLK_DEV_DM=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CMDLINE="root=/dev/mtdblock3 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"
+CONFIG_CPU_PABRT_LEGACY=y
+CONFIG_CPU_TLB_FEROCEON=y
+CONFIG_CRC16=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_AES=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_WORKQUEUE=y
+CONFIG_DM_CRYPT=y
+CONFIG_DM_MIRROR=y
+CONFIG_DM_SNAPSHOT=y
+CONFIG_EXPORTFS=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+CONFIG_EXT4_FS=y
+CONFIG_GPIO_DEVICE=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_HAVE_PROC_CPU=y
+CONFIG_INET_LRO=y
+CONFIG_INPUT=y
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_GPIO_BUTTONS=y
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_JBD=y
+CONFIG_JBD2=y
+CONFIG_KEXEC=y
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_MD=y
+CONFIG_MD_AUTODETECT=y
+CONFIG_MD_LINEAR=y
+CONFIG_MD_RAID0=y
+CONFIG_MD_RAID1=y
+CONFIG_NLS=y
+CONFIG_RTC_DRV_M41T80=y
+CONFIG_RTC_DRV_M41T80_WDT=y
+CONFIG_SATA_MV=y
+CONFIG_SCSI=y
+CONFIG_SCSI_MOD=y
+CONFIG_SENSORS_G760A=y
+CONFIG_SENSORS_LM75=y
+# CONFIG_USB_SUPPORT is not set
+CONFIG_XFS_FS=y
diff --git a/target/linux/orion/dns323/target.mk b/target/linux/orion/dns323/target.mk
new file mode 100644 (file)
index 0000000..25523ae
--- /dev/null
@@ -0,0 +1,6 @@
+BOARDNAME:=D-Link DNS-323
+DEFAULT_PACKAGES += -kmod-ath9k -wpad-mini -dnsmasq
+
+define Target/Description
+       Build OpenWrt image for D-Link DNS-323
+endef
diff --git a/target/linux/orion/image/dns323.mk b/target/linux/orion/image/dns323.mk
new file mode 100644 (file)
index 0000000..c33e612
--- /dev/null
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2010 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Image/Prepare
+       cp $(LINUX_DIR)/arch/arm/boot/uImage $(KDIR)/uImage
+endef
+
+define Image/BuildKernel
+       # Orion Kernel uImages
+ # DNS-323: mach id 1542 (0x606)
+       echo -en "\x06\x1c\xa0\xe3\x06\x10\x81\xe3" > $(KDIR)/dns323-zImage
+       cat $(LINUX_DIR)/arch/arm/boot/zImage >> $(KDIR)/dns323-zImage
+       $(STAGING_DIR_HOST)/bin/mkimage -A arm -O linux -T kernel \
+       -C none -a 0x00008000 -e 0x00008000 -n 'Linux-$(LINUX_VERSION)' \
+       -d $(KDIR)/dns323-zImage $(KDIR)/dns323-uImage
+       cp $(KDIR)/dns323-uImage $(BIN_DIR)/openwrt-dns323-uImage
+endef
+
+define Image/Build/D-Link
+       # Orion DNS-323 Images
+ # mtd image
+       dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-dns323-rootfs bs=128k
+endef
+
+define Image/Build
+$(call Image/Build/$(1),$(1))
+$(call Image/Build/D-Link,$(1),dns323,DNS-323,$(1))
+endef
+
+define Image/Build/squashfs
+$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
+endef
diff --git a/target/linux/orion/patches/300-dns323_partition_map.patch b/target/linux/orion/patches/300-dns323_partition_map.patch
new file mode 100644 (file)
index 0000000..87e357b
--- /dev/null
@@ -0,0 +1,30 @@
+--- a/arch/arm/mach-orion5x/dns323-setup.c
++++ b/arch/arm/mach-orion5x/dns323-setup.c
+@@ -99,6 +99,13 @@
+  *  0x00020000-0x001a0000 : "Linux Kernel"
+  *  0x001a0000-0x007d0000 : "File System"
+  *  0x007d0000-0x00800000 : "u-boot"
++ *
++ * Layout as used by OpenWrt
++ *  0x00000000-0x00010000 : "MTD1"
++ *  0x00010000-0x00020000 : "MTD2"
++ *  0x00020000-0x001a0000 : "kernel"
++ *  0x001a0000-0x007d0000 : "rootfs"
++ *  0x007d0000-0x00800000 : "u-boot"
+  */
+ #define DNS323_NOR_BOOT_BASE 0xf4000000
+@@ -114,11 +121,11 @@
+               .size   = 0x00010000,
+               .offset = 0x00010000,
+       }, {
+-              .name   = "Linux Kernel",
++              .name   = "kernel",
+               .size   = 0x00180000,
+               .offset = 0x00020000,
+       }, {
+-              .name   = "File System",
++              .name   = "rootfs",
+               .size   = 0x00630000,
+               .offset = 0x001A0000,
+       }, {
This page took 0.053 seconds and 4 git commands to generate.