From 86756461198a00edea058eef6064bc8f10383849 Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 4 Apr 2012 15:53:55 +0000 Subject: [PATCH] [orion] 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 > git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31198 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/orion/Makefile | 2 +- target/linux/orion/config-default | 2 +- .../dns323/base-files/etc/config/network | 12 +++++ target/linux/orion/dns323/config-default | 54 +++++++++++++++++++ target/linux/orion/dns323/target.mk | 6 +++ target/linux/orion/image/dns323.mk | 36 +++++++++++++ .../patches/300-dns323_partition_map.patch | 30 +++++++++++ 7 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 target/linux/orion/dns323/base-files/etc/config/network create mode 100644 target/linux/orion/dns323/config-default create mode 100644 target/linux/orion/dns323/target.mk create mode 100644 target/linux/orion/image/dns323.mk create mode 100644 target/linux/orion/patches/300-dns323_partition_map.patch diff --git a/target/linux/orion/Makefile b/target/linux/orion/Makefile index ed899a139..e6e268693 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 d07e8aa16..7e3193e2b 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 000000000..8bdd3b060 --- /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 000000000..c5ec9592b --- /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 000000000..25523aee9 --- /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 000000000..c33e61295 --- /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 000000000..87e357b0c --- /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, + }, { -- 2.20.1