<div> </div><div> </div><div>30.06.2014, 08:28, "xfguo@credosemi.com" <xfguo@credosemi.com>:</div><blockquote type="cite"><p>hi,<br /><br />as I know, wrt get MAC address from some mtd partition, if it got all 0xff,the ethernet will not boot up. for more details just check the dts file for rt-n14u.<br /><br />Alex Guo <br /><br />Roman Yeryomin <<a href="mailto:leroi.lists@gmail.com">leroi.lists@gmail.com</a>>编写:</p><blockquote>On 29 June 2014 16:33, Сергей Василюгин <<a href="mailto:vasilugin@yandex.ru">vasilugin@yandex.ru</a>> wrote:<br /><blockquote> 29.06.2014, 18:33, "Roman Yeryomin" <<a href="mailto:leroi.lists@gmail.com">leroi.lists@gmail.com</a>>:<br /><br /> On 28 June 2014 19:17, Сергей Василюгин <<a href="mailto:vasilugin@yandex.ru">vasilugin@yandex.ru</a>> wrote:<br /><br />  26.06.2014, 06:03, "Daniel" <<a href="mailto:daniel@makrotopia.org">daniel@makrotopia.org</a>>:<br /><br />  Hi Roman,<br /><br />  On 04/04/2014 04:39 PM, Roman Yeryomin wrote:<br /><br />   I worked on other things lately but plan to return to rt2x00 soon and<br />   maybe try ralink driver on trunk again.<br /><br />  I started looking into your patches and started to see things moving as far<br />  as<br />  you got.<br />  I suggest to define RT6352 and set chip.rt to that instead of checking for<br />  chip.rf == RF7620 in cases which were meant for RT5390.<br />  Is there any more recent version of your work on rt2x00 than the<br />  630-rt2x00-add-mt<span>7620-20140131</span>.patch included in your first post? If so,<br />  please<br />  share it, I'd like to re-use what ever there is and try to botch things up<br /> a<br />  bit ;)<br /><br />  Cheers<br /><br /><br />  Daniel<br /><br />  After some attempts tonight I make working version of the patch. But my<br />  trunk revision really very old and I need time to rebase it.<br />  The key error was in rt2800_rfcsr_read for RF7620 (wrong bitmask). So<br />  *value = rt2x00_get_field32(reg, RF_CSR_CFG_DATA);<br />  instead of<br />  *value = rt2x00_get_field32(reg, RF_CSR_CFG_DATA_MT7620);<br />  broke all rf reading.<br /><br /> Honestly that sounds weird because unless you change all the other<br /> masks for mt7620 you will have them overlapped.<br /> Also this is how that register is described in datasheet (the fields<br /> are in reverse order comparing to all other socs).<br /> If you say you got it working can you send at least binary image to<br /> test (while you are trying to rebase it)?<br /><br /> Regards,<br /> Roman<br /><br /> 1. As my friends say - let me show :)<br /> Your recently sent patch:<br /><br /> static void rt2800_rfcsr_read(struct rt2x00_dev *rt2x00dev,<br />                               const unsigned int word, u8 *value)<br />  {<br /> @@ -182,15 +221,31 @@<br />          * doesn't become available in time, reg will be 0xffffffff<br />          * which means we return 0xff to the caller.<br />          */<br /> -       if (WAIT_FOR_RFCSR(rt2x00dev, &reg)) {<br /> -               reg = 0;<br /> -               rt2x00_set_field32(&reg, RF_CSR_CFG_REGNUM, word);<br /> -               rt2x00_set_field32(&reg, RF_CSR_CFG_WRITE, 0);<br /> -               rt2x00_set_field32(&reg, RF_CSR_CFG_BUSY, 1);<br /> +       switch (rt2x00dev->chip.rf) {<br /> +       case RF7620:<br /> +               if (WAIT_FOR_RFCSR_MT7620(rt2x00dev, &reg)) {<br /> +                       reg = 0;<br /> +                       rt2x00_set_field32(&reg, RF_CSR_CFG_REGNUM_MT7620,<br /> word);<br /> +                       rt2x00_set_field32(&reg, RF_CSR_CFG_WRITE_MT7620,<br /> 0);<br /> +                       rt2x00_set_field32(&reg, RF_CSR_CFG_BUSY_MT7620, 1);<br /> +<br /> +                       rt2800_register_write_lock(rt2x00dev, RF_CSR_CFG,<br /> reg);<br /> +<br /> +                       WAIT_FOR_RFCSR_MT7620(rt2x00dev, &reg);<br /> +               }<br /> +               break;<br /> +       default:<br /> +               if (WAIT_FOR_RFCSR(rt2x00dev, &reg)) {<br /> +                       reg = 0;<br /> +                       rt2x00_set_field32(&reg, RF_CSR_CFG_REGNUM, word);<br /> +                       rt2x00_set_field32(&reg, RF_CSR_CFG_WRITE, 0);<br /> +                       rt2x00_set_field32(&reg, RF_CSR_CFG_BUSY, 1);<br /><br /> -               rt2800_register_write_lock(rt2x00dev, RF_CSR_CFG, reg);<br /> +                       rt2800_register_write_lock(rt2x00dev, RF_CSR_CFG,<br /> reg);<br /><br /> -               WAIT_FOR_RFCSR(rt2x00dev, &reg);<br /> +                       WAIT_FOR_RFCSR(rt2x00dev, &reg);<br /> +               }<br /> +               break;<br />         }<br /><br />         *value = rt2x00_get_field32(reg, RF_CSR_CFG_DATA);<br /> @@ -198,6 +253,12 @@<br />         mutex_unlock(&rt2x00dev->csr_mutex);<br />  }<br /><br /> use call<br /> *value = rt2x00_get_field32(reg, RF_CSR_CFG_DATA);<br /> for both case - default and mt7620. I call<br /> *value = rt2x00_get_field32(reg, RF_CSR_CFG_DATA_MT7620);<br /> for mt7620 :)<br /><br /> 2. Binary images: <a href="https://yadi.sk/d/OeTxrigZVMg8g">https://yadi.sk/d/OeTxrigZVMg8g</a><br /> Dlink dir620f1 is my test board (pkg_id=0, chip_ver=2, eco_num=3 - auto<br /> detect not working yet). AFAIK asus rt-n14u use the same.</blockquote>Sorry, I've read your previous email wrong.<br />By looking at the code seems you are right! I can't believe I've<br />missed that line before! I will look - maybe I kept the old tree I was<br />experimenting with.<br />BTW, I don't know why but your image for rt-n14u didn't work for me -<br />even ethernet is not working.<br /><br />Regards,<br />Roman<br />_______________________________________________<br />openwrt-devel mailing list<br /><a href="mailto:openwrt-devel@lists.openwrt.org">openwrt-devel@lists.openwrt.org</a><br /><a href="https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel">https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel</a></blockquote></blockquote><div> </div><div>It's a possible solution. My board have</div><div>ethernet@10100000 {<br />        mtd-mac-address = <&factory 0x4>;<br />        ralink,port-map = "llllw";<br />    };</div><div>I'll rebuild images tonight for test.</div><div> </div><div>---<br />serge</div><div> </div>