define Profile/DIR825B1/Description
Package set optimized for the D-Link DIR-825 rev. B1.
+ WARNING: Flashing wholeflash (openwrt optimized) image may brick your router
+ . This will occur if your openwrt optimized image is larger than the
+ maximum size for a regular dir-825 b1 image (a little more than 6MB).
+ Please flash a TOWHOLEFLASH image instead of this image before flashing
+a
+ WHOLEFLASH image.
+endef
+
+$(eval $(call Profile,DIR825B1))
+
+define Profile/DIR825B1_TOWHOLEFLASH
+ NAME:=D-Link DIR-825 rev. B1 designed for transition to image using whole flash
+ PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev
+endef
+
+define Profile/DIR825B1_TOWHOLEFLASH/Description
+ Package set optimized for the D-Link DIR-825 rev. B1. design for transtion to
+ image using whole flash.
Copies the calibration data to the last erase block so that, if desired,
an image optimized for use with OpenWrt (access to full flash) can be flashed.
endef
-$(eval $(call Profile,DIR825B1))
+$(eval $(call Profile,DIR825B1_TOWHOLEFLASH))
-define Profile/DIR825B1_OPENWRT
- NAME:=D-Link DIR-825 rev. B1 optimized for OpenWrt
+define Profile/DIR825B1_WHOLEFLASH
+ NAME:=D-Link DIR-825 rev. B1 optimized for OpenWrt which uses full 8M flash
PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev
endef
-define Profile/DIR825B1_OPENWRT/Description
- Package set optimized for the D-Link DIR-825 rev. B1. running OpenWrt
+define Profile/DIR825B1_WHOLEFLASH/Description
+ Package set optimized for the D-Link DIR-825 rev. B1. using wholeflash
Can only be flashed from OpenWrt because it requires that the calibration data
be on the last sector of the flash (which the 'standard' version that can be flashed from
stock will ensure).
endef
-$(eval $(call Profile,DIR825B1_OPENWRT))
+$(eval $(call Profile,DIR825B1_WHOLEFLASH))
define Profile/DIR825B1_TOSTOCK
- NAME:=D-Link DIR-825 rev. B1 that undoes OpenWrt optimization
+ NAME:=D-Link DIR-825 rev. B1 that undoes OpenWrt optimization (i.e. wholeflash)
PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev
endef
cameo913x_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(config)ro,960k(kernel),2880k(rootfs),64k(art)ro,3840k@0x30000(firmware)
cameo933x_mtdlayout=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k(nvram)ro,192k(language)ro,896k(kernel),2752k(rootfs),3648k@0x70000(firmware)
db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware)
-dir825b1_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata)ro,1536k(unknown)ro,64k(owrt_caldata),6208k@0x50000(firmware)
-dir825b1_openwrt_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),6784k(rootfs),64k(caldata)ro,7808k@0x50000(firmware)
+dir825b1_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata)ro,1600k(unknown)ro,6208k@0x50000(firmware)
+dir825b1_towholeflash_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata)ro,1536k(unknown)ro,64k(owrt_caldata),7808k@0x50000(firmware)
+dir825b1_wholeflash_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),6784k(rootfs),64k(caldata)ro,7808k@0x50000(firmware)
ew-dorin_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),1024k(kernel),2688k(rootfs),64k(art),3712k@0x50000(firmware)
dir825b1_tostock_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata),1536k(unknown)ro,64k(owrt_caldata)ro,6208k@0x50000(firmware)
pb92_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2752k(rootfs),896k(kernel),64k(nvram),64k(art)ro,3648k@0x50000(firmware)
fi
endef
-define Image/Build/DIR825B1_OPENWRT
- $(call MkuImageLzma,$(2),$(3) $(dir825b1_openwrt_mtdlayout))
+define Image/Build/DIR825B1_TOWHOLEFLASH
+ $(call MkuImageLzma,$(2),$(3) $(dir825b1_towholeflash_mtdlayout))
+ $(call Sysupgrade/KRuImage,$(1),$(2),1048576,5308416)
+ if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+ ( \
+ dd if=$(call sysupname,$(1),$(2)); \
+ echo -n "$(4)"; \
+ ) > $(call imgname,$(1),$(2))-backup-loader.bin; \
+ if [ `stat -c%s $(call sysupname,$(1),$(2))` -gt 4194304 ]; then \
+ echo "Warning: $(call sysupname,$(1),$(2)) is too big"; \
+ else \
+ ( \
+ dd if=$(call sysupname,$(1),$(2)) bs=4096k conv=sync; \
+ echo -n "$(5)"; \
+ ) > $(call factoryname,$(1),$(2)); \
+ fi; \
+ fi
+endef
+
+define Image/Build/DIR825B1_WHOLEFLASH
+ $(call MkuImageLzma,$(2),$(3) $(dir825b1_wholeflash_mtdlayout))
$(call Sysupgrade/KRuImage,$(1),$(2),1048576,6946816)
endef
$(eval $(call SingleProfile,CyberTAN,$(fs_64k),WRT160NL,wrt160nl,WRT160NL,ttyS0,115200,1.00.01))
$(eval $(call SingleProfile,DIR825B1,$(fs_64k),DIR825B1,dir-825-b1,DIR-825-B1,ttyS0,115200,01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
-$(eval $(call SingleProfile,DIR825B1_OPENWRT,$(fs_64k),DIR825B1_OPENWRT,dir-825-b1-openwrt,DIR-825-B1_OPENWRT,ttyS0,115200,01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
+$(eval $(call SingleProfile,DIR825B1_TOWHOLEFLASH,$(fs_64k),DIR825B1_TOWHOLEFLASH,dir-825-b1-towholeflash,DIR-825-B1_TOWHOLEFLASH,ttyS0,115200,01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
+$(eval $(call SingleProfile,DIR825B1_WHOLEFLASH,$(fs_64k),DIR825B1_WHOLEFLASH,dir-825-b1-wholeflash,DIR-825-B1_WHOLEFLASH,ttyS0,115200,01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
$(eval $(call SingleProfile,DIR825B1_TOSTOCK,$(fs_64k),DIR825B1_TOSTOCK,dir-825-b1-tostock,DIR-825-B1_TOSTOCK,ttyS0,115200,01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
$(eval $(call SingleProfile,DIR825B1,$(fs_64k),TEW673GRU,tew-637gru,TEW-673GRU,ttyS0,115200,01AP94-AR7161-RT-080619-01,00AP94-AR7161-RT-080619-01))
$(eval $(call MultiProfile,AP121,AP121_2M AP121_4M))
-$(eval $(call MultiProfile,DIR825B1_ALL,DIR825B1 DIR825B1_OPENWRT DIR825B1_TOSTOCK))
+$(eval $(call MultiProfile,DIR825B1_ALL,DIR825B1 DIR825B1_TOWHOLEFLASH DIR825B1_WHOLEFLASH DIR825B1_TOSTOCK))
$(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT))
$(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY))
$(eval $(call MultiProfile,TLWA901,TLWA901NV1 TLWA901NV2))
#define DIR825B1_MAC_LOCATION_0 0x1f66ffa0
#define DIR825B1_MAC_LOCATION_1 0x1f66ffb4
-+#define DIR825B1_OPENWRT_CAL_LOCATION_0 0x1f7f1000
-+#define DIR825B1_OPENWRT_CAL_LOCATION_1 0x1f7f5000
++#define DIR825B1_WHOLEFLASH_CAL_LOCATION_0 0x1f7f1000
++#define DIR825B1_WHOLEFLASH_CAL_LOCATION_1 0x1f7f5000
+
-+#define DIR825B1_OPENWRT_MAC_LOCATION_0 0x1f7fffa0
-+#define DIR825B1_OPENWRT_MAC_LOCATION_1 0x1f7fffb4
++#define DIR825B1_WHOLEFLASH_MAC_LOCATION_0 0x1f7fffa0
++#define DIR825B1_WHOLEFLASH_MAC_LOCATION_1 0x1f7fffb4
+
static struct gpio_led dir825b1_leds_gpio[] __initdata = {
{
ath79_register_mdio(0, 0x0);
-@@ -165,9 +171,27 @@ static void __init dir825b1_setup(void)
+@@ -165,9 +171,30 @@ static void __init dir825b1_setup(void)
ap9x_pci_setup_wmac_led_pin(0, 5);
ap9x_pci_setup_wmac_led_pin(1, 5);
+ DIR825B1_CAL_LOCATION_0, DIR825B1_CAL_LOCATION_1);
+}
+
-+static void __init dir825b1_openwrt_setup(void)
++static void __init dir825b1_wholeflash_setup(void)
+{
-+ dir825b1_common_setup(DIR825B1_OPENWRT_MAC_LOCATION_0, DIR825B1_OPENWRT_MAC_LOCATION_1,
-+ DIR825B1_OPENWRT_CAL_LOCATION_0, DIR825B1_OPENWRT_CAL_LOCATION_1);
++ dir825b1_common_setup(DIR825B1_WHOLEFLASH_MAC_LOCATION_0, DIR825B1_WHOLEFLASH_MAC_LOCATION_1,
++ DIR825B1_WHOLEFLASH_CAL_LOCATION_0, DIR825B1_WHOLEFLASH_CAL_LOCATION_1);
}
MIPS_MACHINE(ATH79_MACH_DIR_825_B1, "DIR-825-B1", "D-Link DIR-825 rev. B1",
dir825b1_setup);
+
-+MIPS_MACHINE(ATH79_MACH_DIR_825_B1_OPENWRT, "DIR-825-B1_OPENWRT", "D-Link DIR-825 rev. B1 OpenWrt",
-+ dir825b1_openwrt_setup);
++MIPS_MACHINE(ATH79_MACH_DIR_825_B1_TOWHOLEFLASH, "DIR-825-B1_TOWHOLEFLASH", "D-Link DIR-825 rev. B1 TOWHOLEFLASH",
++ dir825b1_setup);
+
-+MIPS_MACHINE(ATH79_MACH_DIR_825_B1_TOSTOCK, "DIR-825-B1_TOSTOCK", "D-Link DIR-825 rev. B1 TOSTOCK", dir825b1_openwrt_setup);
++MIPS_MACHINE(ATH79_MACH_DIR_825_B1_WHOLEFLASH, "DIR-825-B1_WHOLEFLASH", "D-Link DIR-825 rev. B1 WHOLEFLASH",
++ dir825b1_wholeflash_setup);
++
++MIPS_MACHINE(ATH79_MACH_DIR_825_B1_TOSTOCK, "DIR-825-B1_TOSTOCK", "D-Link DIR-825 rev. B1 TOSTOCK", dir825b1_wholeflash_setup);
+
--- a/arch/mips/ath79/machtypes.h
+++ b/arch/mips/ath79/machtypes.h
-@@ -35,6 +35,8 @@ enum ath79_mach_type {
+@@ -35,6 +35,9 @@ enum ath79_mach_type {
ATH79_MACH_DIR_615_C1, /* D-Link DIR-615 rev. C1 */
ATH79_MACH_DIR_615_E4, /* D-Link DIR-615 rev. E4 */
ATH79_MACH_DIR_825_B1, /* D-Link DIR-825 rev. B1 */
-+ ATH79_MACH_DIR_825_B1_OPENWRT, /* D-Link DIR-825 rev. B1 OpenWrt */
++ ATH79_MACH_DIR_825_B1_TOWHOLEFLASH, /* D-Link DIR-825 rev. B1 TOWHOLEFLASH */
++ ATH79_MACH_DIR_825_B1_WHOLEFLASH, /* D-Link DIR-825 rev. B1 WHOLEFLASH */
+ ATH79_MACH_DIR_825_B1_TOSTOCK, /* D-Link DIR-825 rev. B1 TOSTOCK */
ATH79_MACH_EW_DORIN, /* embedded wireless Dorin Platform */
ATH79_MACH_EW_DORIN_ROUTER, /* embedded wireless Dorin Router Platform */