Date:2010-01-11 09:02:10 (3 years 4 months ago)
Author:juhosg
Commit:0ab559a23e27f18ef8fbe5d18d0b6971c7f8d6a9
Message:ar71xx: add support for the D-Link DIR-600 rev. A1 board

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19100 3c298f89-4303-0410-b956-a3cf2f4a3e73
Files: target/linux/ar71xx/base-files/etc/diag.sh (1 diff)
target/linux/ar71xx/base-files/lib/ar71xx.sh (1 diff)
target/linux/ar71xx/base-files/lib/upgrade/platform.sh (1 diff)
target/linux/ar71xx/config-2.6.30 (1 diff)
target/linux/ar71xx/config-2.6.31 (1 diff)
target/linux/ar71xx/config-2.6.32 (1 diff)
target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig (1 diff)
target/linux/ar71xx/files/arch/mips/ar71xx/Makefile (1 diff)
target/linux/ar71xx/files/arch/mips/ar71xx/mach-dir-600-a1.c (1 diff)
target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h (2 diffs)
target/linux/ar71xx/image/Makefile (3 diffs)
target/linux/ar71xx/profiles/d-link.mk (1 diff)

Change Details

target/linux/ar71xx/base-files/etc/diag.sh
4242    bullet-m | rocket-m | nano-m)
4343        status_led="ubnt:green:link4"
4444        ;;
45    dir-600-a1)
46        status_led="dir-600-a1:green:power"
47        ;;
4548    dir-615-c1)
4649        status_led="dir-615c1:green:status"
4750        ;;
target/linux/ar71xx/base-files/lib/ar71xx.sh
1919    *AW-NR580)
2020        name="aw-nr580"
2121        ;;
22    *"DIR-600 rev. A1")
23        name="dir-600-a1"
24        ;;
2225    *"DIR-825 rev. B1")
2326        name="dir-825-b1"
2427        ;;
target/linux/ar71xx/base-files/lib/upgrade/platform.sh
6868    [ "$ARGC" -gt 1 ] && return 1
6969
7070    case "$board" in
71    ap81 | ap83 | dir-615-c1 | dir-825-b1 | mzk-w04nu | mzk-w300nh | tew-632brp | wrt-400n | bullet-m | nano-m | rocket-m)
71    ap81 | ap83 | dir-600-a1 | dir-615-c1 | dir-825-b1 | mzk-w04nu | mzk-w300nh | tew-632brp | wrt-400n | bullet-m | nano-m | rocket-m)
7272        [ "$magic" != "2705" ] && {
7373            echo "Invalid image type."
7474            return 1
target/linux/ar71xx/config-2.6.30
1616CONFIG_AR71XX_MACH_AP81=y
1717CONFIG_AR71XX_MACH_AP83=y
1818CONFIG_AR71XX_MACH_AW_NR580=y
19CONFIG_AR71XX_MACH_DIR_600_A1=y
1920CONFIG_AR71XX_MACH_DIR_615_C1=y
2021CONFIG_AR71XX_MACH_DIR_825_B1=y
2122CONFIG_AR71XX_MACH_GENERIC=y
target/linux/ar71xx/config-2.6.31
1818CONFIG_AR71XX_MACH_AP81=y
1919CONFIG_AR71XX_MACH_AP83=y
2020CONFIG_AR71XX_MACH_AW_NR580=y
21CONFIG_AR71XX_MACH_DIR_600_A1=y
2122CONFIG_AR71XX_MACH_DIR_615_C1=y
2223CONFIG_AR71XX_MACH_DIR_825_B1=y
2324CONFIG_AR71XX_MACH_GENERIC=y
target/linux/ar71xx/config-2.6.32
1818CONFIG_AR71XX_MACH_AP81=y
1919CONFIG_AR71XX_MACH_AP83=y
2020CONFIG_AR71XX_MACH_AW_NR580=y
21CONFIG_AR71XX_MACH_DIR_600_A1=y
2122CONFIG_AR71XX_MACH_DIR_615_C1=y
2223CONFIG_AR71XX_MACH_DIR_825_B1=y
2324CONFIG_AR71XX_MACH_GENERIC=y
target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig
1919    select AR71XX_DEV_USB
2020    default n
2121
22config AR71XX_MACH_DIR_600_A1
23    bool "D-Link DIR-600 rev. A1 support"
24    select AR71XX_DEV_AP91_PCI if PCI
25    select AR71XX_DEV_M25P80
26    select AR71XX_DEV_GPIO_BUTTONS
27    select AR71XX_DEV_LEDS_GPIO
28    default n
29
2230config AR71XX_MACH_DIR_615_C1
2331    bool "D-Link DIR-615 rev. C1 support"
2432    select AR71XX_DEV_M25P80
target/linux/ar71xx/files/arch/mips/ar71xx/Makefile
2828obj-$(CONFIG_AR71XX_MACH_AP81) += mach-ap81.o
2929obj-$(CONFIG_AR71XX_MACH_AP83) += mach-ap83.o
3030obj-$(CONFIG_AR71XX_MACH_AW_NR580) += mach-aw-nr580.o
31obj-$(CONFIG_AR71XX_MACH_DIR_600_A1) += mach-dir-600-a1.o
3132obj-$(CONFIG_AR71XX_MACH_DIR_615_C1) += mach-dir-615-c1.o
3233obj-$(CONFIG_AR71XX_MACH_DIR_825_B1) += mach-dir-825-b1.o
3334obj-$(CONFIG_AR71XX_MACH_GENERIC) += mach-generic.o
target/linux/ar71xx/files/arch/mips/ar71xx/mach-dir-600-a1.c
1/*
2 * D-Link DIR-600 rev. A1 board support
3 *
4 * Copyright (C) 2010 Gabor Juhos <juhosg@openwrt.org>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
9 */
10
11#include <linux/mtd/mtd.h>
12#include <linux/mtd/partitions.h>
13
14#include <asm/mach-ar71xx/ar71xx.h>
15
16#include "machtype.h"
17#include "devices.h"
18#include "dev-m25p80.h"
19#include "dev-ap91-pci.h"
20#include "dev-gpio-buttons.h"
21#include "dev-leds-gpio.h"
22
23#define DIR_600_A1_GPIO_LED_WPS 0
24#define DIR_600_A1_GPIO_LED_POWER_AMBER 1
25#define DIR_600_A1_GPIO_LED_POWER_GREEN 6
26
27#define DIR_600_A1_GPIO_BTN_RESET 8
28#define DIR_600_A1_GPIO_BTN_WPS 12
29
30#define DIR_600_A1_BUTTONS_POLL_INTERVAL 20
31
32#ifdef CONFIG_MTD_PARTITIONS
33static struct mtd_partition dir_600_a1_partitions[] = {
34    {
35        .name = "u-boot",
36        .offset = 0,
37        .size = 0x030000,
38        .mask_flags = MTD_WRITEABLE,
39    }, {
40        .name = "nvram",
41        .offset = 0x030000,
42        .size = 0x010000,
43    }, {
44        .name = "kernel",
45        .offset = 0x040000,
46        .size = 0x0e0000,
47    }, {
48        .name = "rootfs",
49        .offset = 0x120000,
50        .size = 0x2c0000,
51    }, {
52        .name = "mac",
53        .offset = 0x3e0000,
54        .size = 0x010000,
55        .mask_flags = MTD_WRITEABLE,
56    }, {
57        .name = "art",
58        .offset = 0x3f0000,
59        .size = 0x010000,
60        .mask_flags = MTD_WRITEABLE,
61    }, {
62        .name = "firmware",
63        .offset = 0x040000,
64        .size = 0x3a0000,
65    }
66};
67#endif /* CONFIG_MTD_PARTITIONS */
68
69static struct flash_platform_data dir_600_a1_flash_data = {
70#ifdef CONFIG_MTD_PARTITIONS
71        .parts = dir_600_a1_partitions,
72        .nr_parts = ARRAY_SIZE(dir_600_a1_partitions),
73#endif
74};
75
76static struct gpio_led dir_600_a1_leds_gpio[] __initdata = {
77    {
78        .name = "dir-600-a1:green:power",
79        .gpio = DIR_600_A1_GPIO_LED_POWER_GREEN,
80    }, {
81        .name = "dir-600-a1:amber:power",
82        .gpio = DIR_600_A1_GPIO_LED_POWER_AMBER,
83    }, {
84        .name = "dir-600-a1:blue:wps",
85        .gpio = DIR_600_A1_GPIO_LED_WPS,
86        .active_low = 1,
87    }
88};
89
90static struct gpio_button dir_600_a1_gpio_buttons[] __initdata = {
91    {
92        .desc = "reset",
93        .type = EV_KEY,
94        .code = BTN_0,
95        .threshold = 5,
96        .gpio = DIR_600_A1_GPIO_BTN_RESET,
97        .active_low = 1,
98    }, {
99        .desc = "wps",
100        .type = EV_KEY,
101        .code = BTN_1,
102        .threshold = 5,
103        .gpio = DIR_600_A1_GPIO_BTN_WPS,
104        .active_low = 1,
105    }
106};
107
108static void __init dir_600_a1_setup(void)
109{
110    u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);
111    u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
112
113    ar71xx_set_mac_base(mac);
114    ar71xx_add_device_mdio(0x0);
115
116    /* WAN port */
117    ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
118    ar71xx_eth0_data.phy_mask = 0x0;
119    ar71xx_eth0_data.speed = SPEED_100;
120    ar71xx_eth0_data.duplex = DUPLEX_FULL;
121    ar71xx_eth0_data.fifo_cfg1 = 0x0fff0000;
122    ar71xx_eth0_data.fifo_cfg2 = 0x00001fff;
123    ar71xx_eth0_data.fifo_cfg3 = 0x008001ff;
124
125    /* LAN ports */
126    ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
127    ar71xx_eth1_data.phy_mask = 0x0;
128    ar71xx_eth1_data.speed = SPEED_1000;
129    ar71xx_eth1_data.duplex = DUPLEX_FULL;
130    ar71xx_eth1_data.fifo_cfg1 = 0x0fff0000;
131    ar71xx_eth1_data.fifo_cfg2 = 0x00001fff;
132    ar71xx_eth1_data.fifo_cfg3 = 0x008001ff;
133
134    ar71xx_add_device_eth(1);
135    ar71xx_add_device_eth(0);
136
137    ar71xx_add_device_m25p80(&dir_600_a1_flash_data);
138
139    ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(dir_600_a1_leds_gpio),
140                    dir_600_a1_leds_gpio);
141
142    ar71xx_add_device_gpio_buttons(-1, DIR_600_A1_BUTTONS_POLL_INTERVAL,
143                    ARRAY_SIZE(dir_600_a1_gpio_buttons),
144                    dir_600_a1_gpio_buttons);
145
146    ap91_pci_init(ee, NULL);
147}
148
149MIPS_MACHINE(AR71XX_MACH_DIR_600_A1, "DIR-600-A1", "D-Link DIR-600 rev. A1",
150         dir_600_a1_setup);
target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h
11/*
22 * Atheros AR71xx machine type definitions
33 *
4 * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
4 * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
55 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
66 *
77 * This program is free software; you can redistribute it and/or modify it
...... 
1919    AR71XX_MACH_AP81, /* Atheros AP81 */
2020    AR71XX_MACH_AP83, /* Atheros AP83 */
2121    AR71XX_MACH_AW_NR580, /* AzureWave AW-NR580 */
22    AR71XX_MACH_DIR_600_A1, /* D-Link DIR-600 rev. A1 */
2223    AR71XX_MACH_DIR_615_C1, /* D-Link DIR-615 rev. C1 */
2324    AR71XX_MACH_DIR_825_B1, /* D-Link DIR-825 rev. B1 */
2425    AR71XX_MACH_RB_411, /* MikroTik RouterBOARD 411/411A/411AH */
target/linux/ar71xx/image/Makefile
7777    fi; fi
7878endef
7979
80dir600a1_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,896k(kernel),2816k(rootfs),64k(mac)ro,64k(art)ro,3712k@0x40000(firmware)
81define Image/Build/DIR600A1
82    $(call PatchKernelLzma,$(2),$(3) $(dir600a1_mtdlayout))
83    if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.lzma"` -gt 917504 ]; then \
84        echo "Warning: $(KDIR)/vmlinux-$(2).bin.lzma is too big"; \
85    else if [ `stat -c%s $(KDIR)/root.$(1)` -gt 2818048 ]; then \
86        echo "Warning: $(KDIR)/root.$(1) is too big"; \
87    else \
88        mkimage -A mips -O linux -T kernel -a 0x80060000 -C lzma -e \
89            0x80060000 \
90            -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
91            -d $(KDIR)/vmlinux-$(2).bin.lzma $(KDIR)/vmlinux-$(2).uImage; \
92        ( \
93            dd if=$(KDIR)/vmlinux-$(2).uImage bs=896k conv=sync; \
94            dd if=$(KDIR)/root.$(1) bs=2752k conv=sync; \
95            echo -n "AP91-AR7240-RT-090223-00"; \
96        ) > $(call imgname,$(1),$(2))-universal.bin; \
97    fi; fi
98endef
99
80100dir825b1_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata)ro,1600k(unknown)ro,6208k@0x50000(firmware)
81101define Image/Build/DIR825B1
82102    $(call PatchKernelLzma,$(2),$(3) $(dir825b1_mtdlayout))
...... 
328348    $(call Image/Build/Template/64k/$(1),MyLoader,wp543)
329349endef
330350
351define Image/Build/Profile/DIR600A1
352    $(call Image/Build/Template/64k/$(1),DIR600A1,dir-600-a1,board=DIR-600-A1)
353endef
354
331355define Image/Build/Profile/DIR615C1
332356    $(call Image/Build/Template/squashfs-only/$(1),Cameo,dir-615-c1,board=DIR-615-C1,"AP81-AR9130-RT-070614-02")
333357endef
...... 
429453    $(call Image/Build/Profile/AP81,$(1))
430454    $(call Image/Build/Profile/AP83,$(1))
431455    $(call Image/Build/Profile/A02RBW300N,$(1))
456    $(call Image/Build/Profile/DIR600A1,$(1))
432457    $(call Image/Build/Profile/DIR615C1,$(1))
433458    $(call Image/Build/Profile/DIR825B1,$(1))
434459    $(call Image/Build/Profile/MZKW04NU,$(1))
target/linux/ar71xx/profiles/d-link.mk
55# See /LICENSE for more information.
66#
77
8define Profile/DIR600A1
9    NAME:=D-Link DIR-600 rev. A1
10    PACKAGES:=kmod-ath9k hostapd-mini
11endef
12
13define Profile/DIR600A1/Description
14    Package set optimized for the D-Link DIR-600 rev. A1.
15endef
16
17$(eval $(call Profile,DIR600A1))
18
19
820define Profile/DIR615C1
921    NAME:=D-Link DIR-615 rev. C1
1022    PACKAGES:=kmod-ath9k hostapd-mini

Archive Download the corresponding diff file



interactive