[LEDE-DEV] [OpenWrt-Devel] [PATCH 0/4] Gemini forward-port to kernel v4.14

Roman Yeryomin roman at advem.lv
Tue May 1 11:44:52 PDT 2018


On 2018-04-29 21:32, Roman Yeryomin wrote:
> On 2018-04-27 09:18, John Crispin wrote:
>> On 17/04/18 00:34, Roman Yeryomin wrote:
>>> On 2018-04-15 20:22, Roman Yeryomin wrote:
>>>> On 2018-04-14 20:36, Hans Ulli Kroll wrote:
>>>>> Hi Roman
>>>>> 
>>>>> On Tue, 10 Apr 2018, Linus Walleij wrote:
>>>>> 
>>>>>> On Mon, Apr 9, 2018 at 12:38 PM, Roman Yeryomin <roman at advem.lv> 
>>>>>> wrote:
>>>>>> 
>>>>>> > I have tested them quickly yesterday on nas4220b board. Although I've
>>>>>> > managed to boot it (had to fix rootfs image) ethernet and usb didn't work.
>>>>>> > And I didn't check anything else.
>>>>>> > I didn't yet look at the code but before I dive there I have a question: did
>>>>>> > you have a chance to test it yourself on any of the boards? And if yes,
>>>>>> > which one?
>>>>>> 
>>>>> 
>>>>> I think the fotg controller gets stalled after a port reset.
>>>>> Please check attached (untested) patch for openwrt.
>>>>> I can test this next week by myself
>>>>> 
>>>>> +diff --git a/drivers/usb/host/fotg210-hcd.c 
>>>>> b/drivers/usb/host/fotg210-hcd.c
>>>>> +index 2acc51b0be5a..bc9efb49adc7 100644
>>>>> +--- a/drivers/usb/host/fotg210-hcd.c
>>>>> ++++ b/drivers/usb/host/fotg210-hcd.c
>>>>> +@@ -1653,6 +1653,10 @@ static int fotg210_hub_control(struct 
>>>>> usb_hcd
>>>>> *hcd, u16 typeReq, u16 wValue,
>>>>> +             /* see what we found out */
>>>>> +             temp = check_reset_complete(fotg210, wIndex, 
>>>>> status_reg,
>>>>> +                     fotg210_readl(fotg210, status_reg));
>>>>> ++
>>>>> ++            /* restart schedule */
>>>>> ++            fotg210->command |= CMD_RUN;
>>>>> ++            fotg210_writel(fotg210, fotg210->command, 
>>>>> &fotg210->regs->command);
>>>>> +         }
>>>>> +
>>>>> +         if (!(temp & (PORT_RESUME|PORT_RESET))) {
>>>>> +--
>>>>> +2.16.2
>>>>> +
>>>> 
>>>> Didn't work for me :(
>>>> 
>>> 
>>> I've found why it didn't work:
>>> [    5.845199] Warning! fotg210_hcd should always be loaded before 
>>> uhci_hcd and ohci_hcd, not after
>>> 
>>> After fixing kernel config and applying your patch it works.
>>> So your patch works and is needed indeed.
>>> 
>>> But there are other problems.
>>> Second USB (USB1) port cannot be initialized and only USB0 is 
>>> working:
>>> [    5.843831] fotg210_hcd: FOTG210 Host Controller (EHCI) Driver
>>> [    5.844298] pinctrl-gemini 40000000.syscon:pinctrl: ACTIVATE 
>>> function "usb" with group "usbgrp"
>>> [    5.845067] fotg210-hcd 68000000.usb: initialized Gemini PHY
>>> [    5.845095] fotg210-hcd 68000000.usb: Faraday USB2.0 Host 
>>> Controller
>>> [    5.845176] fotg210-hcd 68000000.usb: new USB bus registered, 
>>> assigned bus number 1
>>> [    5.845696] fotg210-hcd 68000000.usb: irq 29, io mem 0x68000000
>>> [    5.877212] fotg210-hcd 68000000.usb: USB 2.0 started, EHCI 1.00
>>> [    5.880314] hub 1-0:1.0: USB hub found
>>> [    5.880546] hub 1-0:1.0: 1 port detected
>>> [    5.904768] pinctrl-gemini 40000000.syscon:pinctrl: pin T6 USB 
>>> GNDA U20 already requested by 68000000.usb; cannot claim for 
>>> 69000000.usb
>>> [    5.904807] pinctrl-gemini 40000000.syscon:pinctrl: pin-305 
>>> (69000000.usb) status -22
>>> [    5.904845] pinctrl-gemini 40000000.syscon:pinctrl: could not 
>>> request pin 305 (T6 USB GNDA U20) from group usbgrp  on device 
>>> pinctrl-gemini
>>> [    5.904872] fotg210-hcd 69000000.usb: Error applying setting, 
>>> reverse things back
>>> [    5.904928] fotg210-hcd: probe of 69000000.usb failed with error 
>>> -22
>>> 
>>> After removing pinctrl from USB1 it is initialized but then only USB1 
>>> is working, USB0 is seen but there are no interrupts.
>>> Didn't yet look at the code, maybe you will know where to fix right 
>>> away.
>>> 
>>> Regards,
>>> Roman
>>> 
>> 
>> Hi,
>> how shall we proceed ? merge 1, 2 and 3, let roman fix the regressions
>> and then merge 4 ? or drop the series for now and let you guys send a
>> V2 with the regression fixes integrated ?
> 
> Hi John,
> I've prepared 4.14 branch here
> https://github.com/yeryomin/openwrt/commits/gemini-4.14
> I think it can be merged in it's current state. The only problem I'm
> aware of is that usb is not fully working (afaik, Hans is working on
> it).
> 
> Linus, could you test that branch on your device and see if network is
> working by default?
> 

Linus, if you have time, could you check if this helps to bring network 
up on dir-685?
https://github.com/yeryomin/openwrt/commit/b0296b1f71bd3d677c931addd6de341203fbf18f

Note I have disabled video and input drivers, since dir-685 seems is the 
only board which could potentially use them. And ili display wasn't 
enabled anyway.
All those modules can be enabled via kernel modules. If you could test 
the needed set we could add them to dir-685 packages.


Regards,
Roman




More information about the Lede-dev mailing list