From: Florian Fainelli Date: Wed, 4 Apr 2012 15:53:55 +0000 (+0000) Subject: add support for D-Link DNS-323 X-Git-Tag: attitude_adjustment_12.09~1848 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b47fc0f936c0a49c4dc88621d3f48a62c82fb98a;p=openwrt%2Fsvn-archive%2Fopenwrt.git add support for D-Link DNS-323 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 > SVN-Revision: 31198 --- diff --git a/target/linux/orion/Makefile b/target/linux/orion/Makefile index ed899a139d..e6e2686935 100644 --- a/target/linux/orion/Makefile +++ b/target/linux/orion/Makefile @@ -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 diff --git a/target/linux/orion/config-default b/target/linux/orion/config-default index d07e8aa167..7e3193e2bb 100644 --- a/target/linux/orion/config-default +++ b/target/linux/orion/config-default @@ -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 index 0000000000..8bdd3b060b --- /dev/null +++ b/target/linux/orion/dns323/base-files/etc/config/network @@ -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 index 0000000000..c5ec9592bb --- /dev/null +++ b/target/linux/orion/dns323/config-default @@ -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 index 0000000000..25523aee91 --- /dev/null +++ b/target/linux/orion/dns323/target.mk @@ -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 index 0000000000..c33e612956 --- /dev/null +++ b/target/linux/orion/image/dns323.mk @@ -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 index 0000000000..87e357b0c0 --- /dev/null +++ b/target/linux/orion/patches/300-dns323_partition_map.patch @@ -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, + }, {