diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2010-03-09 18:05:45 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2010-03-09 18:05:45 +0000 |
commit | 45ff7289fe88bb81109dc0c002b16d96e7adbf5c (patch) | |
tree | 8701371a2f55a9d91d521ae113fc94a80decf7e9 /target | |
parent | 781c482e6a361865946ff6b8555345a61ebb5a88 (diff) | |
download | mtk-20170518-45ff7289fe88bb81109dc0c002b16d96e7adbf5c.zip mtk-20170518-45ff7289fe88bb81109dc0c002b16d96e7adbf5c.tar.gz mtk-20170518-45ff7289fe88bb81109dc0c002b16d96e7adbf5c.tar.bz2 |
ar71xx: allow overriding of the lan port names on AP91 based boards
SVN-Revision: 20095
Diffstat (limited to 'target')
5 files changed, 24 insertions, 5 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-eth.c b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-eth.c index be48b8a..571901e 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-eth.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-eth.c @@ -10,6 +10,7 @@ #include "devices.h" #include "dev-dsa.h" +#include "dev-ap91-eth.h" static struct dsa_chip_data ap91_dsa_chip = { .port_names[0] = "cpu", @@ -24,11 +25,27 @@ static struct dsa_platform_data ap91_dsa_data = { .chip = &ap91_dsa_chip, }; -void __init ap91_eth_init(u8 *mac_addr) +static void ap91_eth_set_port_name(unsigned port, const char *name) +{ + if (port < 1 || port > 5) + return; + + if (name) + ap91_dsa_chip.port_names[port] = (char *) name; +} + +void __init ap91_eth_init(u8 *mac_addr, const char *port_names[]) { if (mac_addr) ar71xx_set_mac_base(mac_addr); + if (port_names) { + int i; + + for (i = 0; i < AP91_ETH_NUM_PORT_NAMES; i++) + ap91_eth_set_port_name(i + 1, port_names[i]); + } + /* WAN port */ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII; ar71xx_eth0_data.phy_mask = 0x0; diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-eth.h b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-eth.h index 424e2ae..d9cd214 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-eth.h +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap91-eth.h @@ -11,8 +11,10 @@ #ifndef _AR71XX_DEV_AP91_ETH_H #define _AR71XX_DEV_AP91_ETH_H +#define AP91_ETH_NUM_PORT_NAMES 4 + #if defined(CONFIG_AR71XX_DEV_AP91_ETH) -void ap91_eth_init(u8 *mac_addr) __init; +void ap91_eth_init(u8 *mac_addr, const char *port_names[]) __init; #else static inline void ap91_eth_init(u8 *mac_addr) { } #endif diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-dir-600-a1.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-dir-600-a1.c index 42146f5..7222405 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-dir-600-a1.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-dir-600-a1.c @@ -130,7 +130,7 @@ static void __init dir_600_a1_setup(void) ARRAY_SIZE(dir_600_a1_gpio_buttons), dir_600_a1_gpio_buttons); - ap91_eth_init(mac); + ap91_eth_init(mac, NULL); ap91_pci_init(ee, mac); } diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb750.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb750.c index c2c3ee6..a39101d 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb750.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb750.c @@ -117,7 +117,7 @@ static void __init rb750_setup(void) AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN | AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN); - ap91_eth_init(NULL); + ap91_eth_init(NULL, NULL); platform_device_register(&rb750_leds_device); platform_device_register(&rb750_nand_device); } diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr741nd.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr741nd.c index f6f3059..510dcf4 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr741nd.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr741nd.c @@ -108,7 +108,7 @@ static void __init tl_wr741nd_setup(void) ARRAY_SIZE(tl_wr741nd_gpio_buttons), tl_wr741nd_gpio_buttons); - ap91_eth_init(mac); + ap91_eth_init(mac, NULL); ap91_pci_init(ee, mac); } MIPS_MACHINE(AR71XX_MACH_TL_WR741ND, "TL-WR741ND", "TP-LINK TL-WR741ND", |