Re: [OpenWrt-Devel] [PATCH] ar71xx: Add support for Mikrotik Groove 52HPn
Hi, On Sat, Jan 25, 2014 at 06:08:23AM +0100, openwrt-devel-requ...@lists.openwrt.org wrote: Date: Fri, 24 Jan 2014 22:11:08 -0700 From: David Hutchison dhutchi...@bluemesh.net Everything works except UART, I can receive output from the groove but when i try to transmit keystrokes it seems to struggle on receiving them. I'm guessing there is another driver attempting to use the UART pins? Perhaps they need to be disabled to get proper UART usage? I'm also not sure how to unlock the bottom 2 LED's from the hardware. It appears that the second to last LED is ethernet link, and the last LED is ethernet netdev. Everything else seems to work networking, wireless, etc. My recent port.serial addition: http://wiki.openwrt.org/doc/hardware/port.serial If you successfully receive router bootup logs but seem unable to send data (e.g. some keyboard input which might be required to intercept bootup, and where you're unable to stop continued kernel bootup), then this may be due to having configured the connection as hardware flow control rather than software (happened on TL-WDR3600 in my case). Or perhaps it's a matter of voltage levels: perhaps a pullup/pulldown resistor needs to be applied (there are some OpenWrt router pages where it's documented that that needs to be done, AFAIR a 10k value was mentioned) - but if going down that route take care to start by using large (== weak) resistor values at first, to try to avoid hardware damage. And of course: thanks for your nice support patch! Andreas Mohr ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] Kernel modules depends in openwrt
Dear All I wrote a driver for AR9287 GPIO. My module always load before ath9k and cause bus error. The read/write PCI bus operate should after ath9k init the PCI bus. I know I can use modules.dep or modules.softdep, but I can't find it in /lib/modules/xx/ dir. I run `modinfo ath9k`, it show ath9k_hw,mac80211,ath9k_common,compat,cfg80211,ath, but my module show noting. So, I want to know how to make ath9k as my module's depends ? Thanks BRS ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 4/4] b53: mdio: Avoid re-registering the same switch device
On Fri, Jan 24, 2014 at 12:57 PM, Helmut Schaa helmut.sc...@googlemail.com wrote: When setting the associated interface down and up again a new switch device will be registered due to b53_phy_config_init doing the necessary allocations and registrations. Instead, register the switch device already in b53_phy_probe. Generally I'm fine with it, but two issues I saw ... Signed-off-by: Helmut Schaa helmut.sc...@googlemail.com --- .../generic/files/drivers/net/phy/b53/b53_common.c | 2 +- .../generic/files/drivers/net/phy/b53/b53_mdio.c | 40 -- .../generic/files/drivers/net/phy/b53/b53_priv.h | 2 ++ 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c index b82bc93..37f520d 100644 --- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c @@ -478,7 +478,7 @@ static void b53_switch_reset_gpio(struct b53_device *dev) dev-current_page = 0xff; } -static int b53_switch_reset(struct b53_device *dev) +int b53_switch_reset(struct b53_device *dev) { u8 mgmt; diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c index b86ea1a..e626217 100644 --- a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c @@ -253,56 +253,44 @@ static struct b53_io_ops b53_mdio_ops = { static int b53_phy_probe(struct phy_device *phydev) { - struct b53_device dev; + struct b53_device *dev; int ret; /* allow the generic phy driver to take over */ if (phydev-addr != B53_PSEUDO_PHY phydev-addr != 0) return -ENODEV; - dev.current_page = 0xff; - dev.priv = phydev-bus; - dev.ops = b53_mdio_ops; - dev.pdata = NULL; - mutex_init(dev.reg_mutex); + dev = b53_switch_alloc(phydev-dev, b53_mdio_ops, phydev-bus); + if (!dev) + return -ENOMEM; - ret = b53_switch_detect(dev); - if (ret) + dev-current_page = 0xff; + + ret = b53_switch_register(dev); + if (ret) { + kfree(dev); The b53_device is allocated with devm_kzalloc and automatically free'd on exit/failure, so this would cause a double free. return ret; + } - if (is5325(dev) || is5365(dev)) + if (is5325(dev) || is5365(dev)) phydev-supported = SUPPORTED_100baseT_Full; else phydev-supported = SUPPORTED_1000baseT_Full; phydev-advertising = phydev-supported; + phydev-priv = dev; return 0; } static int b53_phy_config_init(struct phy_device *phydev) { - struct b53_device *dev; - int ret; + struct b53_device *dev = phydev-priv; - dev = b53_switch_alloc(phydev-dev, b53_mdio_ops, phydev-bus); - if (!dev) - return -ENOMEM; - - /* we don't use page 0xff, so force a page set */ - dev-current_page = 0xff; /* force the ethX as alias */ dev-sw_dev.alias = phydev-attached_dev-name; I'm not sure it is safe to modify sw_dev after registration. We should probably either drop the ethX alias or set it in _probe() (IIRC phydev-attached_dev-name wasn't set yet in _probe(), which was the reason for doing it in _config_init(), but I might misremember). - ret = b53_switch_register(dev); - if (ret) { - dev_err(dev-dev, failed to register switch: %i\n, ret); - return ret; - } - - phydev-priv = dev; - - return 0; + return b53_switch_reset(dev); } static void b53_phy_remove(struct phy_device *phydev) diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_priv.h b/target/linux/generic/files/drivers/net/phy/b53/b53_priv.h index ce5b530..75b86dc 100644 --- a/target/linux/generic/files/drivers/net/phy/b53/b53_priv.h +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_priv.h @@ -180,6 +180,8 @@ int b53_switch_detect(struct b53_device *dev); int b53_switch_register(struct b53_device *dev); +int b53_switch_reset(struct b53_device *dev); + static inline void b53_switch_remove(struct b53_device *dev) { unregister_switch(dev-sw_dev); Jonas ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 2/4] b53: Use phy_drivers_register to register multiple phy drivers at once
On Fri, Jan 24, 2014 at 12:57 PM, Helmut Schaa helmut.sc...@googlemail.com wrote: Signed-off-by: Helmut Schaa helmut.sc...@googlemail.com --- .../generic/files/drivers/net/phy/b53/b53_mdio.c | 44 ++ 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c index 3c25f0e..b86ea1a 100644 --- a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c @@ -341,8 +341,9 @@ static int b53_phy_read_status(struct phy_device *phydev) return 0; } -/* BCM5325, BCM539x */ -static struct phy_driver b53_phy_driver_id1 = { +static struct phy_driver b53_phy_drivers[] = { +{ + /* BCM5325, BCM539x */ .phy_id = 0x0143bc00, .name = Broadcom B53 (1), .phy_id_mask= 0x1c00, @@ -355,10 +356,8 @@ static struct phy_driver b53_phy_driver_id1 = { .driver = { .owner = THIS_MODULE, }, -}; - -/* BCM53125, BCM53128 */ -static struct phy_driver b53_phy_driver_id2 = { +}, { + /* BCM53125, BCM53128 */ .phy_id = 0x03625c00, .name = Broadcom B53 (2), .phy_id_mask= 0x1c00, @@ -371,10 +370,8 @@ static struct phy_driver b53_phy_driver_id2 = { .driver = { .owner = THIS_MODULE, }, -}; - -/* BCM5365 */ -static struct phy_driver b53_phy_driver_id3 = { +}, { + /* BCM5365 */ .phy_id = 0x00406000, .name = Broadcom B53 (3), .phy_id_mask= 0x1c00, @@ -387,35 +384,18 @@ static struct phy_driver b53_phy_driver_id3 = { .driver = { .owner = THIS_MODULE, }, -}; +} }; + int __init b53_phy_driver_register(void) { - int ret; - - ret = phy_driver_register(b53_phy_driver_id1); - if (ret) - return ret; - - ret = phy_driver_register(b53_phy_driver_id2); - if (ret) - goto err1; - - ret = phy_driver_register(b53_phy_driver_id3); - if (!ret) - return 0; - - phy_driver_unregister(b53_phy_driver_id2); -err1: - phy_driver_unregister(b53_phy_driver_id1); - return ret; + return phy_drivers_register(b53_phy_drivers, + ARRAY_SIZE(b53_phy_drivers)); } void __exit b53_phy_driver_unregister(void) { - phy_driver_unregister(b53_phy_driver_id3); - phy_driver_unregister(b53_phy_driver_id2); - phy_driver_unregister(b53_phy_driver_id1); + phy_drivers_unregister(b53_phy_drivers, ARRAY_SIZE(b53_phy_drivers)); AFAICT phy_drivers_{un,}register is only available in 3.6+, so I would like to hold this off until all targets are in appropriate version to not risk breaking the older targets. Jonas ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Kernel modules depends in openwrt
Hi, can you post the driver ? i have a board with AR9287 where one of the gpios is used, would love to test your driver John On 25/01/2014 10:06, 郭涛 wrote: Dear All I wrote a driver for AR9287 GPIO. My module always load before ath9k and cause bus error. The read/write PCI bus operate should after ath9k init the PCI bus. I know I can use modules.dep or modules.softdep, but I can't find it in /lib/modules/xx/ dir. I run `modinfo ath9k`, it show ath9k_hw,mac80211,ath9k_common,compat,cfg80211,ath, but my module show noting. So, I want to know how to make ath9k as my module's depends ? Thanks BRS ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Kernel modules depends in openwrt
/* * wnr2200-keys.c * * Created on: 2014年1月20日 * Author: tao */ #include linux/module.h #include linux/version.h #include linux/kmod.h #include linux/workqueue.h #include linux/skbuff.h #include linux/netlink.h #include linux/kobject.h #include linux/input.h #include linux/interrupt.h #include linux/platform_device.h #include linux/of_gpio.h #include linux/gpio_keys.h #include asm/mach-ath79/ar71xx_regs.h #define DRV_NAMEwnr2200-keys #undef BH_DEBUG #define BH_SKB_SIZE2048 #ifdef BH_DEBUG #define BH_DBG(fmt, args...) printk(KERN_DEBUG %s: fmt, DRV_NAME, ##args ) #else #define BH_DBG(fmt, args...) do {} while (0) #endif #define BH_ERR(fmt, args...) printk(KERN_ERR %s: fmt, DRV_NAME, ##args ) #define WNR2200_GPIO_BUTTON_WIFI3 #define WNR2200_GPIO_BUTTON_WPS5 #define WNR2200_GPIO_BUTTON_RESET6 #define WNR2200_PCI_GPIO_BASE 0x20 #define WNR2200_PCI_GPIO_COUNT10 #define WNR2200_KEYS_POLL_INTERVAL20 /* msecs */ #define WNR2200_KEYS_DEBOUNCE_INTERVAL(3 * WNR2200_KEYS_POLL_INTERVAL) #define AR9287_BASE AR71XX_PCI_MEM_BASE #define AR9287_GPIO_IN_OUT 0x4048 // GPIO input / output register #define AR9287_GPIO_IN_VAL 0x001FF800 #define AR9287_GPIO_IN_VAL_S 11 #define AR9287_GPIO_OE_OUT 0x404c // GPIO output enable register #define AR9287_GPIO_OE_OUT_DRV 0x3// 2 bit field mask, shifted by 2*bitpos #define AR9287_GPIO_OE_OUT_DRV_NO0x0// tristate #define AR9287_GPIO_OE_OUT_DRV_LOW 0x1// drive if low #define AR9287_GPIO_OE_OUT_DRV_HI0x2// drive if high #define AR9287_GPIO_OE_OUT_DRV_ALL 0x3// drive always #define AR9287_GPIO_OUTPUT_MUX_AS_OUTPUT 0 #define AR9287_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED 1 #define AR9287_GPIO_OUTPUT_MUX_AS_PCIE_POWER_LED 2 #define AR9287_GPIO_OUTPUT_MUX_AS_TX_FRAME 3 #define AR9287_GPIO_OUTPUT_MUX_AS_RX_CLEAR_EXTERNAL 4 #define AR9287_GPIO_OUTPUT_MUX_AS_MAC_NETWORK_LED5 #define AR9287_GPIO_OUTPUT_MUX_AS_MAC_POWER_LED 6 #define AR9287_GPIO_OUTPUT_MUX1 0x4060 #define AR9287_GPIO_OUTPUT_MUX2 0x4064 #define AR9287_GPIO_IE_VALUE 0x4054 // GPIO input enable and value register #define AR9287_GPIO_BIT(_gpio) (1 (_gpio)) #define MS(_v, _f) (((_v) _f) _f##_S) struct bh_priv { unsigned longseen; }; struct bh_event { const char*name; unsigned inttype; char*action; unsigned longseen; struct sk_buff*skb; struct work_structwork; }; struct bh_map { unsigned intcode; const char*name; }; struct gpio_keys_button_data { struct delayed_work work; struct bh_priv bh; int last_state; int count; int threshold; int can_sleep; struct gpio_keys_button *b; }; struct gpio_keys_button_dev { int polled; struct delayed_work work; struct device *dev; struct gpio_keys_platform_data *pdata; struct gpio_keys_button_data data[0]; }; void __iomem *ar9287_gpio_base; extern u64 uevent_next_seqnum(void); #define BH_MAP(_code, _name)\ {\ .code = (_code),\ .name = (_name),\ } static struct bh_map button_map[] = { BH_MAP(KEY_RESTART,reset), BH_MAP(KEY_RFKILL,rfkill), BH_MAP(KEY_WPS_BUTTON,wps), }; static struct platform_device *wnr2200_key_devs; static int ar9287_gpio_get_value(struct gpio_chip *chip, unsigned offset) { return (MS(__raw_readl(ar9287_gpio_base + AR9287_GPIO_IN_OUT), AR9287_GPIO_IN_VAL) AR9287_GPIO_BIT(offset)) != 0; } static void ar9287_gpio_set_value(struct gpio_chip *chip, unsigned offset, int value) { unsigned long reg, mask; reg = __raw_readl(ar9287_gpio_base + AR9287_GPIO_IN_OUT); mask = ~(1 offset); reg = mask | ((value1) offset); __raw_writel(reg, ar9287_gpio_base + AR9287_GPIO_IN_OUT); } static int ar9287_gpio_direction_input(struct gpio_chip *chip, unsigned offset) { /*FIXME*/ return 0; } static int ar9287_gpio_direction_output(struct gpio_chip *chip, unsigned offset, int value) { /*FIXME*/ return 0; } static struct gpio_chip ar9287_gpio_chip = { .label= ar9287-gpio, .get= ar9287_gpio_get_value, .set= ar9287_gpio_set_value, .direction_input= ar9287_gpio_direction_input, .direction_output= ar9287_gpio_direction_output, .ngpio= WNR2200_PCI_GPIO_COUNT, .base=WNR2200_PCI_GPIO_BASE }; static struct gpio_keys_button wnr2200_gpio_keys[] = { { .desc= rfkill, .type= EV_KEY, .code= KEY_RFKILL,
[OpenWrt-Devel] trunk: firstboot forever on tp-link tl-wr740n v4.21
Hi. I just made a squashfs trunk image for tl-wr740n v4.21. Whatever changes I make, they are done after reboot and all looks like it was firstboot again. Any idea what might be wrong? note that AA oficial build works correctly. Thanks. Jiri ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] trunk: firstboot forever on tp-link tl-wr740n v4.21
* Jiri Pirko j...@resnulli.us [25.01.2014 20:32]: Any idea what might be wrong? yes, your image is too big and jffs2 has not enough space / erase blocks for a working writeable partition, so everything is done in ramdisc-overlay only. check dmesg. bye, bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] trunk: firstboot forever on tp-link tl-wr740n v4.21
* Jiri Pirko j...@resnulli.us [25.01.2014 20:32]: Any idea what might be wrong? thanks to Gabor Juhos - since r39397 there is a mechanism for ar71xx, which actively prevents such situations during buildtime. bye, bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] trunk: firstboot forever on tp-link tl-wr740n v4.21
Sat, Jan 25, 2014 at 09:28:16PM CET, bitt...@bluebottle.com wrote: * Jiri Pirko j...@resnulli.us [25.01.2014 20:32]: Any idea what might be wrong? thanks to Gabor Juhos - since r39397 there is a mechanism for ar71xx, which actively prevents such situations during buildtime. Great! Thank you and Gabor. bye, bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel