Skip to content

Commit

Permalink
加入hg255d支持
Browse files Browse the repository at this point in the history
  • Loading branch information
shenrui01 committed Nov 26, 2012
1 parent 731a6db commit a2ca5ee
Show file tree
Hide file tree
Showing 17 changed files with 371 additions and 2 deletions.
3 changes: 3 additions & 0 deletions target/linux/ramips/base-files/etc/diag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ get_status_led() {
fonera20n)
status_led="fonera20n:green:power"
;;
hg255d)
status_led="hg255d:power"
;;
all0239-3g|\
hw550-3g)
status_led="hw550-3g:green:status"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ case "$FIRMWARE" in
dir-620-a1 | \
esr-9753 | \
fonera20n | \
hg255d | \
freestation5 | \
hw550-3g | \
mofi3500-3gn | \
Expand Down
39 changes: 39 additions & 0 deletions target/linux/ramips/base-files/etc/uci-defaults/hg255d
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh
#
# Copyright (C) 2011 OpenWrt.org
#

hg255d_set_leds() {
uci batch <<EOF
set system.usb_led=led
set system.usb_led.name='USB'
set system.usb_led.sysfs='hg255d:usb'
set system.usb_led.trigger='usbdev'
set system.usb_led.dev='1-1'
set system.usb_led.interval='50'
set system.wlan_led=led
set system.wlan_led.name='WLAN'
set system.wlan_led.sysfs='hg255d:wlan'
set system.wlan_led.trigger='netdev'
set system.wlan_led.dev='wlan0'
set system.wlan_led.mode='link tx rx'
set system.internet_led=led
set system.internet_led.name='INTERNET'
set system.internet_led.sysfs='hg255d:internet'
set system.internet_led.trigger='netdev'
set system.internet_led.dev='eth0.2'
set system.internet_led.mode='tx rx'
commit system
EOF
}

. /lib/ramips.sh

board=$(ramips_board_name)

if [ "${board}" == "hg255d" ]; then
hg255d_set_leds
fi
1 change: 1 addition & 0 deletions target/linux/ramips/base-files/etc/uci-defaults/network
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ ramips_setup_macs()
wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 5)
;;

hg255d | \
fonera20n)
lan_mac=$(ramips_get_mac_binary factory 40)
wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ preinit_set_mac_address() {
carambola |\
dir-615-h1 |\
fonera20n |\
hg255d |\
hw550-3g |\
nbg-419n |\
omni-emb |\
Expand Down
3 changes: 3 additions & 0 deletions target/linux/ramips/base-files/lib/ramips.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ ramips_board_name() {
*"La Fonera 2.0N")
name="fonera20n"
;;
*"HuaWei HG255D")
name="hg255d"
;;
*"MoFi Network MOFI3500-3GN")
name="mofi3500-3gn"
;;
Expand Down
1 change: 1 addition & 0 deletions target/linux/ramips/base-files/lib/upgrade/platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ platform_check_image() {
dap-1350 | \
esr-9753 | \
fonera20n | \
hg255d | \
freestation5 | \
hw550-3g | \
mofi3500-3gn | \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ enum ramips_mach_type {
RAMIPS_MACH_ESR_9753, /* Senao / EnGenius ESR-9753*/
RAMIPS_MACH_F5D8235_V2, /* Belkin F5D8235 v2 */
RAMIPS_MACH_FONERA20N, /* La Fonera 2.0N */
RAMIPS_MACH_HG255D, /* HuaWei HG255D */
RAMIPS_MACH_FREESTATION5, /* ARC Freestation5 */
RAMIPS_MACH_HW550_3G, /* Aztech HW550-3G */
RAMIPS_MACH_MOFI3500_3GN, /* MoFi Network MOFI3500-3GN */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#define RT305X_UART1_SIZE 0x100
#define RT305X_SPI_SIZE 0x100
#define RT305X_FLASH1_SIZE (16 * 1024 * 1024)
#define RT305X_FLASH0_SIZE (8 * 1024 * 1024)
#define RT305X_FLASH0_SIZE (16 * 1024 * 1024)

#define RT3352_EHCI_BASE 0x101c0000
#define RT3352_EHCI_SIZE 0x1000
Expand Down
5 changes: 5 additions & 0 deletions target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ config RT305X_MACH_FONERA20N
select RALINK_DEV_GPIO_BUTTONS
select RALINK_DEV_GPIO_LEDS

config RT305X_MACH_HG255D
bool "HuaWei HG255D board support"
select RALINK_DEV_GPIO_BUTTONS
select RALINK_DEV_GPIO_LEDS

config RT305X_MACH_FREESTATION5
bool "ARC FreeStation5"

Expand Down
1 change: 1 addition & 0 deletions target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ obj-$(CONFIG_RT305X_MACH_DAP_1350) += mach-dap-1350.o
obj-$(CONFIG_RT305X_MACH_ESR_9753) += mach-esr-9753.o
obj-$(CONFIG_RT305X_MACH_F5D8235_V2) += mach-f5d8235-v2.o
obj-$(CONFIG_RT305X_MACH_FONERA20N) += mach-fonera20n.o
obj-$(CONFIG_RT305X_MACH_HG255D) += mach-hg255d.o
obj-$(CONFIG_RT305X_MACH_FREESTATION5) += mach-freestation5.o
obj-$(CONFIG_RT305X_MACH_HW550_3G) += mach-hw550-3g.o
obj-$(CONFIG_RT305X_MACH_MOFI3500_3GN) += mach-mofi3500-3gn.o
Expand Down
12 changes: 12 additions & 0 deletions target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,18 @@ static struct rt3883_ohci_platform_data rt3352_ohci_data = {
.stop_hw = rt3352_usb_host_stop,
};

/*
* map the gpio
*/
static struct resource gpiodev_resource = {
.start = 0xFFFFFFFF,
};

void __init rt305x_register_gpiodev(void)
{
platform_device_register_simple("GPIODEV", 0, &gpiodev_resource, 1);
}

static u64 rt3352_ohci_dmamask = DMA_BIT_MASK(32);
static struct platform_device rt3352_ohci_device = {
.name = "rt3883-ohci",
Expand Down
Loading

0 comments on commit a2ca5ee

Please sign in to comment.