Hi,

Any chance to commit this?

Regards,
Luka Perkov

On Mon, Aug 02, 2010 at 07:37:56PM +0200, Luka Perkov wrote:
> This patch enables running OpenWrt on D-Link DNS-323. More info about this
> device:
> 
> http://www.dlink.com/products/?pid=509
> http://wiki.dns323.info/
> http://www.cyrius.com/debian/orion/d-link/dns-323/
> 
> Currently you need serial cable to flash OpenWrt on DNS-323.
> 
> About the patch:
>  - add kernel support for DNS-323 - CONFIG_MACH_DNS323
>  - patch the kernel so it can recognize flash partitions and use mini_fo
>    overlay - file 300-dns323_partition_map.patch
>  - creating image, still work in progress (does the job for my
>    requirements) - could use some help
>  - I have bricked my usb port ?!? that is why the usb support is
>    commented out in harddisk/config-default file - be careful so you
>    don't make the same mistake and brick you usb port
>  - fan - CONFIG_SENSORS_G760A
>  - temperature sensor - CONFIG_SENSORS_LM75
> 
> I think it be better if you could in menuconfig select Subtarget -> Internal
> Hard-Disk, and then Target Profile -> DNS-323. Help?
> 
> Signed-off-by: Luka Perkov < openwrt ->-to->- lukaperkov.net >
> ---
>  
> 
> Index: target/linux/orion/image/Makefile
> ===================================================================
> --- target/linux/orion/image/Makefile (revision 22462)
> +++ target/linux/orion/image/Makefile (working copy)
> @@ -33,6 +33,13 @@
>       -C none -a 0x00008000 -e 0x00008000 -n 'Linux-$(LINUX_VERSION)' \
>       -d $(KDIR)/dt2-zImage $(KDIR)/dt2-uImage
>       cp $(KDIR)/dt2-uImage $(BIN_DIR)/openwrt-dt2-uImage
> +# DNS-323 v2: 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/Netgear
> @@ -64,15 +71,19 @@
>               echo ":u-boot 0 
> $(STAGING_DIR_HOST)/share/wrt350nv2-builder/u-boot.bin" 
> >>"${TMP_DIR}/$2_webupgrade/$2.par"; )
>       echo "#version 0x2020" >>"${TMP_DIR}/$2_webupgrade/$2.par"
>  # create bin file for recovery and webupgrade image
> -     ( cd "${TMP_DIR}/$2_webupgrade"; \
> -             "${STAGING_DIR_HOST}/bin/$2-builder" \
> -                     -v -b "${TMP_DIR}/$2_webupgrade/$2.par"; \
> -     )
>  # copy bin file as recovery image
> -     $(CP) "${TMP_DIR}/$2_webupgrade/wrt350n.bin" 
> "$(BIN_DIR)/openwrt-$2-$1-recovery.bin"
>  # create webupgrade image for stock firmware update mechanism
> -     zip "${TMP_DIR}/$2_webupgrade/wrt350n.zip" 
> "${TMP_DIR}/$2_webupgrade/wrt350n.bin"
> -     "${STAGING_DIR_HOST}/bin/$2-builder" -v -z 
> "${TMP_DIR}/$2_webupgrade/wrt350n.zip" 
> "${BIN_DIR}/openwrt-$2-$1-webupgrade.img"
> +     ( \
> +             cd "${TMP_DIR}/$2_webupgrade" && \
> +             "${STAGING_DIR_HOST}/bin/$2-builder" -v -b 
> "${TMP_DIR}/$2_webupgrade/$2.par" && \
> +             \
> +             $(CP) "${TMP_DIR}/$2_webupgrade/wrt350n.bin" 
> "$(BIN_DIR)/openwrt-$2-$1-recovery.bin" && \
> +             \
> +             zip "${TMP_DIR}/$2_webupgrade/wrt350n.zip" 
> "${TMP_DIR}/$2_webupgrade/wrt350n.bin" && \
> +             "${STAGING_DIR_HOST}/bin/$2-builder" -v -z 
> "${TMP_DIR}/$2_webupgrade/wrt350n.zip" 
> "${BIN_DIR}/openwrt-$2-$1-webupgrade.img" \
> +     ) || false
> +     # change false value above to true in order to continue building if 
> kernel image is to big
> +     # useful when building images for D-Link DNS-323 :-D
>       rm -rf "${TMP_DIR}/$2_webupgrade"
>  endef
>  
> @@ -86,10 +97,27 @@
>       $(STAGING_DIR_HOST)/bin/encode_crc $(BIN_DIR)/openwrt-$(2)-$(1).img 
> $(BIN_DIR)/openwrt-$(2)-$(1)-webupgrade.img $(3)
>  endef
>  
> +define Image/Build/D-Link
> +# DNS-323 image
> +     # better way to do this?
> +     $(CP) ${KDIR}/root.$1 $(BIN_DIR)/openwrt-$(2)-ramdisk
> +
> +     # arguments for mkimage from debian image builder for DNS-323 ramdisk
> +     # -A arm -O linux -T ramdisk -C gzip -e 0x00800000 -a 0x00800000 -n 
> "debian-installer ramdisk" -d $(TEMP_INITRD) $(TEMP)/dns-323/initrd.uboot
> +
> +     # I don't know where to get -d flag ...
> +     # $(STAGING_DIR_HOST)/bin/mkimage -A arm -O linux -T ramdisk \
> +     # -C gzip -a 0x00008000 -e 0x00008000 -n 'OpenWrt ramdisk' \
> +     # -d ??? $(KDIR)/dns323-uImage
> +     # cp $(KDIR)/dns323-uImage $(BIN_DIR)/openwrt-dns323-ramdisk2
> +endef
> +
> +
>  define Image/Build
>       $(call Image/Build/$(1),$(1))
>       $(call Image/Build/Netgear,$(1),wnr854t,NG_WNR854T,$(1))
>       $(call Image/Build/Freecom,$(1),dt2,DT,$(1))
> +     $(call Image/Build/D-Link,$(1),dns323,DNS-323,$(1))
>  # Leave WRT350Nv2 at last position due to webimage dependency for zip
>  # 5th parameter is kernel mtd size, e.g. 0x00100000 = 1048576 or 0x001A0000 
> = 1703936
>       $(call Image/Build/Linksys,$(1),wrt350nv2,WNR350Nv2,$(1),1048576)
> Index: target/linux/orion/patches/300-dns323_partition_map.patch
> ===================================================================
> --- target/linux/orion/patches/300-dns323_partition_map.patch (revision 0)
> +++ target/linux/orion/patches/300-dns323_partition_map.patch (revision 0)
> @@ -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,
> +     }, {
> Index: target/linux/orion/config-default
> ===================================================================
> --- target/linux/orion/config-default (revision 22462)
> +++ target/linux/orion/config-default (working copy)
> @@ -135,7 +135,7 @@
>  # 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
> Index: target/linux/orion/harddisk/config-default
> ===================================================================
> --- target/linux/orion/harddisk/config-default        (revision 22462)
> +++ target/linux/orion/harddisk/config-default        (working copy)
> @@ -2,34 +2,66 @@
>  CONFIG_BLK_DEV_DM=y
>  CONFIG_BLK_DEV_MD=y
>  CONFIG_BLK_DEV_SD=y
> -# CONFIG_DM_CRYPT is not set
> +CONFIG_CMDLINE="root=/dev/mtdblock3 rootfstype=squashfs,jffs2 noinitrd 
> console=ttyS0,115200"
> +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_DEBUG is not set
>  # CONFIG_DM_DELAY is not set
>  # CONFIG_DM_MIRROR is not set
>  # CONFIG_DM_MULTIPATH is not set
> -# CONFIG_DM_SNAPSHOT is not set
> +CONFIG_DM_SNAPSHOT=y
>  # CONFIG_DM_UEVENT is not set
>  # CONFIG_DM_ZERO is not set
> +CONFIG_EXPORTFS=y
>  CONFIG_EXT2_FS=y
>  CONFIG_EXT3_FS=y
> +CONFIG_EXT4_FS=y
> +# CONFIG_EXT4_FS_XATTR is not set
> +# CONFIG_FS_POSIX_ACL is not set
> +CONFIG_INET_LRO=y
>  CONFIG_JBD=y
> -CONFIG_LBD=y
> +CONFIG_JBD2=y
> +CONFIG_MD=y
>  CONFIG_MD_AUTODETECT=y
>  # CONFIG_MD_FAULTY is not set
>  CONFIG_MD_LINEAR=y
>  # CONFIG_MD_MULTIPATH is not set
>  CONFIG_MD_RAID0=y
> +CONFIG_MD_RAID1=y
>  # CONFIG_MD_RAID10 is not set
> -CONFIG_MD_RAID1=y
>  # CONFIG_MD_RAID456 is not set
> -CONFIG_MD=y
> +CONFIG_NEED_DMA_MAP_STATE=y
> +CONFIG_NET_DSA_MV88E6XXX=y
> +CONFIG_NET_DSA_MV88E6XXX_NEED_PPU=y
> +CONFIG_NET_DSA_TAG_DSA=y
> +# CONFIG_NET_DSA_TAG_EDSA is not set
> +# CONFIG_NET_DSA_TAG_TRAILER is not set
> +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_SWAP=y
> -CONFIG_USB_ARCH_HAS_EHCI=y
> -CONFIG_USB_ARCH_HAS_HCD=y
> -CONFIG_USB_ARCH_HAS_OHCI=y
> -CONFIG_USB_EHCI_HCD=y
> -CONFIG_USB_EHCI_ROOT_HUB_TT=y
> -CONFIG_USB_EHCI_TT_NEWSCHED=y
> -CONFIG_USB_STORAGE=y
> -CONFIG_USB=y
> +##CONFIG_USB_ARCH_HAS_EHCI=y
> +##CONFIG_USB_ARCH_HAS_HCD=y
> +##CONFIG_USB_ARCH_HAS_OHCI=y
> +##CONFIG_USB_EHCI_HCD=y
> +##CONFIG_USB_EHCI_ROOT_HUB_TT=y
> +##CONFIG_USB_EHCI_TT_NEWSCHED=y
> +##CONFIG_USB_STORAGE=y
> +##CONFIG_USB=y
> +CONFIG_XFS_FS=y
> Index: target/linux/orion/harddisk/base-files/etc/config/network
> ===================================================================
> --- target/linux/orion/harddisk/base-files/etc/config/network (revision 0)
> +++ target/linux/orion/harddisk/base-files/etc/config/network (revision 0)
> @@ -0,0 +1,13 @@
> +# 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
> +
> Index: target/linux/orion/harddisk/target.mk
> ===================================================================
> --- target/linux/orion/harddisk/target.mk     (revision 22462)
> +++ target/linux/orion/harddisk/target.mk     (working copy)
> @@ -1,6 +1,6 @@
>  BOARDNAME:=Internal Hard-Disk
>  
>  define Target/Description
> -     Build firmware images for orion based boards that boot directly from 
> internal disk storage
> -     (e.g : Freecom DataTank 2, ...)
> +     Build firmware images for orion based boards that have kernel support 
> for internal disk storage
> +     (e.g : D-Link DNS-323, Freecom DataTank 2, ...)
>  endef
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to