On 14 February 2012 21:30, Gabor Juhos <juh...@openwrt.org> wrote:
> 2012.02.11. 23:06 keltezéssel, Roman Yeryomin írta:
>> On 11 February 2012 19:12, Gabor Juhos <juh...@openwrt.org> wrote:
>>> 2012.02.01. 3:19 keltezéssel, Roman Yeryomin írta:
>>>> This fixes Belkin F5D8235 v2 ethernet stuff.
>>>> To do it we first need to enable rgmii and then not to configure any
>>>> vlans at all. Then there are two ways: enable double tagging on ports
>>>> 5 and 6 and enable tag removal (as I was doing from the very
>>>> beginning) OR we can simply disable vlans and vlan tag removal (as
>>>> proposed by Tobias Diedrich). I'm leaving both variants (first one is
>>>> commented out) for the sake of reference. Of cause you're free to
>>>> remove the commented code.
>>>> So:
>>>> * add RT305X_ESW_VLAN_CONFIG_EXTSW
>>>> * add belkin profile (and remove it from default one)
>>>> * remap ports
>>>>
>>>> Tested with r29978.
>>>> Adding the patch as attachment also.
>>>>
>>>> Signed-off-by: Roman Yeryomin <ro...@advem.lv>
>>>>
>>>> Index: target/linux/ramips/files/arch/mips/ralink/rt305x/mach-f5d8235-v2.c
>>>> ===================================================================
>>>> --- a/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-f5d8235-v2.c  
>>>>    (revision
>>>> 29868)
>>>> +++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/mach-f5d8235-v2.c  
>>>>    (working
>>>> copy)
>>>> @@ -124,15 +124,16 @@
>>>>
>>>>  static void __init f5d8235v2_init(void)
>>>>  {
>>>> -     rt305x_gpio_init((RT305X_GPIO_MODE_GPIO <<
>>>> +     rt305x_gpio_init(((RT305X_GPIO_MODE_GPIO <<
>>>>                                       RT305X_GPIO_MODE_UART0_SHIFT) |
>>>>                                       RT305X_GPIO_MODE_I2C |
>>>>                                       RT305X_GPIO_MODE_SPI |
>>>> -                                     RT305X_GPIO_MODE_MDIO);
>>>> +                                     RT305X_GPIO_MODE_MDIO) &
>>>> +                                     ~RT305X_GPIO_MODE_RGMII);
>>>
>>> This change makes no sense. RT305X_GPIO_MODE_RGMII is defined as BIT(9), and
>>> that bit is not present in the original value.
>>
>> right, it's not present, but default value in the chip is 1, also it
>> doesn't work without this
>
> Well, if it is working with this change, it must work without it as well,
> becasue the argument of the rt305x_gpio_init() call is the same in both cases:
>
> RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT = 0x7 << 2 = 0x0000001c
> RT305X_GPIO_MODE_I2C = BIT(0) = 0x00000001
> RT305X_GPIO_MODE_SPI = BIT(1) = 0x00000002
> RT305X_GPIO_MODE_MDIO = BIT(7) = 0x00000080
>
> 0x0000001c | 0x00000001 | 0x00000002 | 0x00000080 = 0x0000009f
>
> ~RT305X_GPIO_MODE_RGMII = ~BIT(9) = 0xfffffdff
>
> 0x0000009f & 0xfffffdff = 0x0000009f

Looks that you are right but I think I tried everything and without
this change it didn't work, but I'm not sure now...

>>>>       rt305x_register_flash(0, &f5d8235v2_flash_data);
>>>>       ramips_register_gpio_leds(-1, ARRAY_SIZE(f5d8235v2_leds_gpio),
>>>>                                               f5d8235v2_leds_gpio);
>>>> -     rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_NONE;
>>>> +     rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_EXTSW;
>>>>       rt305x_register_ethernet();
>>>>       platform_device_register(&f5d8235v2_switch);
>>>>       rt305x_register_wifi();
>>>> Index: 
>>>> target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_esw_platform.h
>>>> ===================================================================
>>>> --- 
>>>> a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_esw_platform.h
>>>>        (revision
>>>> 29868)
>>>> +++ 
>>>> b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_esw_platform.h
>>>>        (working
>>>> copy)
>>>> @@ -14,6 +14,7 @@
>>>>  enum {
>>>>       RT305X_ESW_VLAN_CONFIG_NONE = 0,
>>>>       RT305X_ESW_VLAN_CONFIG_BYPASS,
>>>> +     RT305X_ESW_VLAN_CONFIG_EXTSW,
>>>
>>> The RT305X_ESW_VLAN_CONFIG_BYPASS mode has been introduced in order to 
>>> handle
>>> the external switch case. Adding yet another mode for the same thing seems
>>> superfluous.
>>
>> BYPASS doesn't work for me, it works _only_ if I don't touch vlan
>> config at all (see below) AND do one out of two things (one of those
>> is commented) under CONFIG_EXTSW
>
> It means that the BYPASS mode is broken probably. However, I still don't want 
> to
> have two different options for the same thing. I believe that both of the 
> BYPASS
> and EXTSW options can be avoided.
>
> Can you try the attached patches please? Along with the patches, you still 
> have
> to override the FPA2 register value in the board setup.
>

Sorry for such long delay, I've tried you patches with 31053 revision.
Ethernet doesn't work as if there is no switch support (driver is
loaded).
But I'm not sure if they still should work as I see that there are
many changes in ramips platform.
Also I've noticed that jffs2 image generation is broken.

Regards,
Roman
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to