Hi! Its the first time I try this, so please give the attached patches a review.
To simplify, all points which weren't clear to me are: dd-wrt has an explicit: (http://svn.dd-wrt.com/browser/src/router/Makefile.pb42) ifeq ($(CONFIG_DIR825C1),y) dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=65536 conv=sync else dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync endif and: (src/linux/universal/linux-3.3/drivers/mtd/devices/ar7240_flash.c) #ifdef CONFIG_DIR825C1 dir_parts[4].offset = dir_parts[5].offset - (mtd->erasesize*2); //nvram dir_parts[4].size = mtd->erasesize; #else dir_parts[4].offset = dir_parts[5].offset - mtd->erasesize; //nvram dir_parts[4].size = mtd->erasesize; #endif Don't see why we should need the 1st one, and no clue for what the 2nd one is. But in case it's important - I think you can do more with the information then me. Besides that 825b1 had the added fat logic it seems like they're built as the other cameo's. 825c1 doesn't need fat anymore, so i used the standard routine. But I could change to the 825b1 one so that the backup image logic (without fat) is included if needed (for whatever that was needed). Most unsure and complicated for me was the mach-dir-825-c1.c. #include "dev-nfc.h" is not used on wdr4300, but on wndr4300, rb2011, and db120 I think. As it's not a must have, I left it. #include "dev-m25p80.h" #include "dev-spi.h" ath79_register_m25p80(NULL); Is needed or not? wdr4300 has it with struct flash_platform_data wndr4300 doesn't have this at all. and dir-* changed the ath79_register_m25p80 to NULL like I did now. wndr4300 only uses at end: ath79_register_wmac_simple(); ap91_pci_init_simple(); rb2011 seems more special, not sure about db120 so I tried to clone from wdr4300 there: ap9x_pci_setup_wmac_led_pin(0, 0); only once? will/can the numbers be the same on this device? I've commented it for now. Is GPIO_USB_POWER only needed on some designs? wdr4300 makes two gpio_request_one, wndr4300 does not. As I don't know gpio's for now I didn't add it. I only added 3 gpio's because I'm unsure about the calculation of the values. I've done this with help of http://svn.dd-wrt.com/browser/src/router/libutils/utils.c I hope I guessed/converted these 3 right. No clue what to do with connected_gpio and disconnected_gpio. By the way - how to find these values when I have the hardware? (i.e. activating a gpio from running openwrt so i can see a led flashing, or is it a risk to come over an other gpio as a led one) Ah, and no gpio button for now. And last but not least: I calculatetd offsets, *mac and *art also from dd-wrt: http://svn.dd-wrt.com/browser/src/linux/universal/linux-3.3/arch/mips/ar7240/platform.c dir825b1_read_ascii_mac is the same there, so I hope my values are correct. But please review it, because coming up without network will be bad ;-). The strangest thing there was #ifdef CONFIG_DIR825C1 u8 *art = (u8 *) KSEG1ADDR(0x1fff1000); #else u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); But I don't think it plays into anything. (Also the partitions there seem to be ugly if http://svn.dd-wrt.com/ticket/2722 is right. I took the info from: http://www.wikidevi.com/wiki/D-Link_DIR-835_rev_A1) But I'm unsure how to handle the two mac adresses then, and where the wan one is. dd-wrt's code is hard to read. 825b1 differs much, but at least this info could be helpful (besides dd-wrt's platform.c): dir 825b1 seems to have (from https://dev.openwrt.org/ticket/10357) LAN and WLAN0 address = DIR825B1_MAC_LOCATION_0 WAN address = DIR825B1_MAC_LOCATION_1 WLAN1 address = = DIR825B1_MAC_LOCATION_1 + 1 So thank you for the time and please help, as I think there are only a few changes of someone experienced needed for everything to be fine. DIR835 can be added then too (not avalaible here, but same thing as with WDR4300 and WDR3600 - additional wifi chip is 2 or 3 chains). Ah, the second wifi chip on DIR825c1 is an AR9382 (AR9380) not AR9582 (AR9580) like on the currently supported models (WNDR4300,WDR4300/3600). And the next step could be the WNDR3700v4 then (https://forum.openwrt.org/viewtopic.php?id=41093). But they always seemed to be a bit more non standard for switch configuration :-/. Alex
diff -urN a/trunk/target/linux/ar71xx/config-3.6 b/trunk/target/linux/ar71xx/config-3.6
--- a/trunk/target/linux/ar71xx/config-3.6 2012-12-31 19:36:34.000000000 +0100
+++ b/trunk/target/linux/ar71xx/config-3.6 2013-01-07 19:53:08.000000000 +0100
@@ -38,6 +38,7 @@
CONFIG_ATH79_MACH_DIR_600_A1=y
CONFIG_ATH79_MACH_DIR_615_C1=y
CONFIG_ATH79_MACH_DIR_825_B1=y
+CONFIG_ATH79_MACH_DIR_825_C1=y
CONFIG_ATH79_MACH_EAP7660D=y
CONFIG_ATH79_MACH_EW_DORIN=y
CONFIG_ATH79_MACH_HORNET_UB=y
diff -urN a/trunk/target/linux/ar71xx/config-3.7 b/trunk/target/linux/ar71xx/config-3.7
--- a/trunk/target/linux/ar71xx/config-3.7 2012-12-31 19:36:34.000000000 +0100
+++ b/trunk/target/linux/ar71xx/config-3.7 2013-01-07 19:53:10.000000000 +0100
@@ -38,6 +38,7 @@
CONFIG_ATH79_MACH_DIR_600_A1=y
CONFIG_ATH79_MACH_DIR_615_C1=y
CONFIG_ATH79_MACH_DIR_825_B1=y
+CONFIG_ATH79_MACH_DIR_825_C1=y
CONFIG_ATH79_MACH_EAP7660D=y
CONFIG_ATH79_MACH_EW_DORIN=y
CONFIG_ATH79_MACH_HORNET_UB=y
diff -urN a/trunk/target/linux/ar71xx/patches-3.6/610-MIPS-ath79-openwrt-machines.patch b/trunk/target/linux/ar71xx/patches-3.6/610-MIPS-ath79-openwrt-machines.patch
--- a/trunk/target/linux/ar71xx/patches-3.6/610-MIPS-ath79-openwrt-machines.patch 2012-12-31 19:36:34.000000000 +0100
+++ b/trunk/target/linux/ar71xx/patches-3.6/610-MIPS-ath79-openwrt-machines.patch 2013-01-07 20:04:30.000000000 +0100
@@ -1,6 +1,6 @@
--- a/arch/mips/ath79/machtypes.h
+++ b/arch/mips/ath79/machtypes.h
-@@ -16,21 +16,111 @@
+@@ -16,21 +16,112 @@
enum ath79_mach_type {
ATH79_MACH_GENERIC = 0,
@@ -25,6 +25,7 @@
+ 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_C1, /* D-Link DIR-825 rev. C1 */
+ ATH79_MACH_EW_DORIN, /* embedded wireless Dorin Platform */
+ ATH79_MACH_EW_DORIN_ROUTER, /* embedded wireless Dorin Router Platform */
+ ATH79_MACH_EAP7660D, /* Senao EAP7660D */
@@ -215,7 +216,7 @@
config ATH79_MACH_PB44
bool "Atheros PB44 reference board"
select SOC_AR71XX
-@@ -67,6 +147,488 @@ config ATH79_MACH_PB44
+@@ -67,6 +147,499 @@ config ATH79_MACH_PB44
Say 'Y' here if you want your kernel to support the
Atheros PB44 reference board.
@@ -342,6 +343,17 @@
+ select ATH79_DEV_M25P80
+ select ATH79_DEV_USB
+
++config ATH79_MACH_DIR_825_C1
++ bool "D-Link DIR-825 rev. C1 board support"
++ select SOC_AR934X
++ select ATH79_DEV_AP9X_PCI if PCI
++ select ATH79_DEV_ETH
++ select ATH79_DEV_GPIO_BUTTONS
++ select ATH79_DEV_LEDS_GPIO
++ select ATH79_DEV_M25P80
++ select ATH79_DEV_USB
++ select ATH79_DEV_WMAC
++
+config ATH79_MACH_EW_DORIN
+ bool "embedded wireless Dorin Platform support"
+ select SOC_AR933X
@@ -766,7 +778,7 @@
endif
--- a/arch/mips/ath79/Makefile
+++ b/arch/mips/ath79/Makefile
-@@ -38,9 +38,71 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route
+@@ -38,9 +38,72 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route
#
# Machines
#
@@ -786,6 +798,7 @@
+obj-$(CONFIG_ATH79_MACH_DIR_600_A1) += mach-dir-600-a1.o
+obj-$(CONFIG_ATH79_MACH_DIR_615_C1) += mach-dir-615-c1.o
+obj-$(CONFIG_ATH79_MACH_DIR_825_B1) += mach-dir-825-b1.o
++obj-$(CONFIG_ATH79_MACH_DIR_825_C1) += mach-dir-825-c1.o
+obj-$(CONFIG_ATH79_MACH_EW_DORIN) += mach-ew-dorin.o
+obj-$(CONFIG_ATH79_MACH_EAP7660D) += mach-eap7660d.o
+obj-$(CONFIG_ATH79_MACH_JA76PF) += mach-ja76pf.o
diff -urN a/trunk/target/linux/ar71xx/patches-3.7/610-MIPS-ath79-openwrt-machines.patch b/trunk/target/linux/ar71xx/patches-3.7/610-MIPS-ath79-openwrt-machines.patch
--- a/trunk/target/linux/ar71xx/patches-3.7/610-MIPS-ath79-openwrt-machines.patch 2012-12-31 19:36:34.000000000 +0100
+++ b/trunk/target/linux/ar71xx/patches-3.7/610-MIPS-ath79-openwrt-machines.patch 2013-01-07 20:04:27.000000000 +0100
@@ -1,6 +1,6 @@
--- a/arch/mips/ath79/machtypes.h
+++ b/arch/mips/ath79/machtypes.h
-@@ -16,21 +16,111 @@
+@@ -16,21 +16,112 @@
enum ath79_mach_type {
ATH79_MACH_GENERIC = 0,
@@ -25,6 +25,7 @@
+ 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_C1, /* D-Link DIR-825 rev. C1 */
+ ATH79_MACH_EW_DORIN, /* embedded wireless Dorin Platform */
+ ATH79_MACH_EW_DORIN_ROUTER, /* embedded wireless Dorin Router Platform */
+ ATH79_MACH_EAP7660D, /* Senao EAP7660D */
@@ -215,7 +216,7 @@
config ATH79_MACH_PB44
bool "Atheros PB44 reference board"
select SOC_AR71XX
-@@ -67,6 +147,488 @@ config ATH79_MACH_PB44
+@@ -67,6 +147,499 @@ config ATH79_MACH_PB44
Say 'Y' here if you want your kernel to support the
Atheros PB44 reference board.
@@ -342,6 +343,17 @@
+ select ATH79_DEV_M25P80
+ select ATH79_DEV_USB
+
++config ATH79_MACH_DIR_825_C1
++ bool "D-Link DIR-825 rev. C1 board support"
++ select SOC_AR934X
++ select ATH79_DEV_AP9X_PCI if PCI
++ select ATH79_DEV_ETH
++ select ATH79_DEV_GPIO_BUTTONS
++ select ATH79_DEV_LEDS_GPIO
++ select ATH79_DEV_M25P80
++ select ATH79_DEV_USB
++ select ATH79_DEV_WMAC
++
+config ATH79_MACH_EW_DORIN
+ bool "embedded wireless Dorin Platform support"
+ select SOC_AR933X
@@ -766,7 +778,7 @@
endif
--- a/arch/mips/ath79/Makefile
+++ b/arch/mips/ath79/Makefile
-@@ -38,9 +38,71 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route
+@@ -38,9 +38,72 @@ obj-$(CONFIG_ATH79_ROUTERBOOT) += route
#
# Machines
#
@@ -786,6 +798,7 @@
+obj-$(CONFIG_ATH79_MACH_DIR_600_A1) += mach-dir-600-a1.o
+obj-$(CONFIG_ATH79_MACH_DIR_615_C1) += mach-dir-615-c1.o
+obj-$(CONFIG_ATH79_MACH_DIR_825_B1) += mach-dir-825-b1.o
++obj-$(CONFIG_ATH79_MACH_DIR_825_C1) += mach-dir-825-c1.o
+obj-$(CONFIG_ATH79_MACH_EW_DORIN) += mach-ew-dorin.o
+obj-$(CONFIG_ATH79_MACH_EAP7660D) += mach-eap7660d.o
+obj-$(CONFIG_ATH79_MACH_JA76PF) += mach-ja76pf.odiff -urN a/trunk/target/linux/ar71xx/base-files/etc/diag.sh b/trunk/target/linux/ar71xx/base-files/etc/diag.sh --- a/trunk/target/linux/ar71xx/base-files/etc/diag.sh 2012-12-31 19:36:34.000000000 +0100 +++ b/trunk/target/linux/ar71xx/base-files/etc/diag.sh 2013-01-07 20:14:38.000000000 +0100 @@ -74,6 +74,9 @@ dir-825-b1) status_led="d-link:orange:power" ;; + dir-825-c1) + status_led="d-link:orange:power" + ;; eap7660d) status_led="eap7660d:green:ds4" ;; diff -urN a/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/leds b/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/leds --- a/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/leds 2012-12-31 19:36:34.000000000 +0100 +++ b/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/leds 2013-01-07 20:16:32.000000000 +0100 @@ -64,6 +64,10 @@ ucidef_set_led_usbdev "usb" "USB" "d-link:blue:usb" "1-1" ;; +dir-825-c1) + ucidef_set_led_usbdev "usb" "USB" "d-link:blue:usb" "1-1" + ;; + hornet-ub) ucidef_set_led_netdev "lan" "LAN" "alfa:blue:lan" "eth0" ucidef_set_led_netdev "wan" "WAN" "alfa:blue:wan" "eth1" diff -urN a/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/network b/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/network --- a/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/network 2012-12-31 19:36:34.000000000 +0100 +++ b/trunk/target/linux/ar71xx/base-files/etc/uci-defaults/network 2013-01-07 20:18:26.000000000 +0100 @@ -55,6 +55,13 @@ ucidef_add_switch_vlan "rtl8366s" "1" "0 1 2 3 5t" ;; +dir-825-c1) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "eth0" "1" "1" + ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5" + ucidef_add_switch_vlan "eth0" "2" "0t 1" + ;; + nbg460n_550n_550nh) ucidef_set_interfaces_lan_wan "eth0" "eth1" ucidef_add_switch "rtl8366s" "1" "1" diff -urN a/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh b/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh --- a/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh 2012-12-31 19:36:34.000000000 +0100 +++ b/trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh 2013-01-07 20:20:02.000000000 +0100 @@ -210,6 +210,9 @@ *"DIR-825 rev. B1") name="dir-825-b1" ;; + *"DIR-825 rev. C1") + name="dir-825-c1" + ;; *EAP7660D) name="eap7660d" ;; diff -urN a/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh --- a/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 2012-12-31 19:36:34.000000000 +0100 +++ b/trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 2013-01-07 20:21:33.000000000 +0100 @@ -107,6 +107,7 @@ dir-600-a1 | \ dir-615-c1 | \ dir-615-e4 | \ + dir-825-c1 | \ ew-dorin | \ ew-dorin-router | \ mzk-w04nu | \
diff -urN a/trunk/target/linux/ar71xx/generic/profiles/d-link.mk b/trunk/target/linux/ar71xx/generic/profiles/d-link.mk --- a/trunk/target/linux/ar71xx/generic/profiles/d-link.mk 2012-12-31 19:36:34.000000000 +0100 +++ b/trunk/target/linux/ar71xx/generic/profiles/d-link.mk 2013-01-07 20:29:43.000000000 +0100 @@ -61,3 +61,14 @@ endef $(eval $(call Profile,DIR825B1)) + +define Profile/DIR825C1 + NAME:=D-Link DIR-825 rev. C1 + PACKAGES:=kmod-usb-core mod-usb2 kmod-ledtrig-usbdev +endef + +define Profile/DIR825C1/Description + Package set optimized for the D-Link DIR-825 rev. C1. +endef + +$(eval $(call Profile,DIR825C1)) diff -urN a/trunk/target/linux/ar71xx/image/Makefile b/trunk/target/linux/ar71xx/image/Makefile --- a/trunk/target/linux/ar71xx/image/Makefile 2012-12-31 19:36:34.000000000 +0100 +++ b/trunk/target/linux/ar71xx/image/Makefile 2013-01-07 20:33:23.000000000 +0100 @@ -170,6 +170,7 @@ cameo7240_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,960k(kernel),2752k(rootfs),64k(mac)ro,64k(art)ro,3712k@0x40000(firmware) 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) +cameo934x_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,1280k(kernel),14656k(rootfs),192k(lang)ro,64k(mac)ro,64k(art)ro,15936k@0x20000(firmware) cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k@0xa0000(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,1600k(unknown)ro,6208k@0x50000(firmware),64k@0x7f0000(caldata_copy) @@ -352,6 +353,14 @@ $(call MkuImageLzma/initramfs,$(2),$(3) $(cameo933x_mtdlayout)) endef +define Image/Build/Cameo934x + $(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo934x_mtdlayout),1310720,15007744,$(4)) +endef + +define Image/Build/Cameo934x/initramfs + $(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo934x_mtdlayout)) +endef + define Image/Build/Ath $(call Sysupgrade/$(7),$(1),$(2),$(5),$(6)) if [ -e "$(call sysupname,$(1),$(2))" ]; then \ @@ -843,6 +852,8 @@ $(eval $(call SingleProfile,Cameo933x,$(fs_squash),TEW712BR,tew-712br,TEW-712BR,ttyATH0,115200,"HORNET-RT-TEW712BR-3")) +$(eval $(call SingleProfile,Cameo934x,$(fs_64k),DIR825C1,dir-825-c1,DIR-825-C1,ttyS0,115200,"00DB120AR9344-RT-101214-00")) + $(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))
mach-dir-825-c1.c
Description: Binary data
_______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
