Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpio-nct5104d doesn't work with APU2C4 #3

Open
wifi4u opened this issue Mar 27, 2018 · 5 comments
Open

gpio-nct5104d doesn't work with APU2C4 #3

wifi4u opened this issue Mar 27, 2018 · 5 comments
Labels

Comments

@wifi4u
Copy link

wifi4u commented Mar 27, 2018

Hi RafPe,

in LEDE 17.01-4 (stable) the gpio-nct5104d driver module throws following errors on an APU 2C4:

[   15.876136] gpio-nct5104d: Unsupported device 0xc453
[   15.881155] gpio-nct5104d: Unsupported device 0xffff

What's more, the board name for APU2 has been changed (again) for coreboot v4.6.x mainline (could patch this easily, but I'm not sure about any hardware changes from PC Engines chip ID c452 to c453).

@wifi4u wifi4u changed the title gpio-nct5104d doesn't with APU2C4 gpio-nct5104d doesn't work with APU2C4 Mar 27, 2018
@RafPe
Copy link
Owner

RafPe commented Mar 27, 2018

I'm guessing ur owner of the APU 2C4 ? Could you run it in debug mode ? and paste output here

@wifi4u
Copy link
Author

wifi4u commented Mar 28, 2018

Unfortunately no, it's not my APU, I just have to port LEDE on it and deadline is in two days, so I'm somewhat under pressure, since many things changed there. I own an APU1D4 currently running Debian8, but probably could help debugging later if I get my hands on another APU2C4. Just wanted to let you know, that PC Engines chip ID has been changed on 2C4, but I don't know wether HW design actually was changed regarding to the HW version you did use for development. For which HW model/version did you develop the driver? Would it help if I try to find out whether GPIO pin assignments etc. have been changed? Or is the chip ID just set by the bootloader / kernel usually?

@RafPe RafPe added the bug label Mar 28, 2018
@RafPe
Copy link
Owner

RafPe commented Mar 28, 2018

This is really surprising since I believe I got APU2C4 ( you can see it in my blog post about this https://rafpe.ninja/2017/04/29/pcengines-apu-board-and-nct5104d-gpio-driver/ ) - I will double check when I will get home.
I can try to help you out so you reach your deadline. Looking at the code the magic of chipID check happens here https://github.com/RafPe/gpio-driver-nct5104d/blob/master/nct5104d_gpio.c#L414

and from definition I can see that they are defined as following

/*--------  chip IDs  --------*/
#define NCT5104D_ID					    0x1061	
#define NCT5104D_ID_APU         	    0xc452

which for obvious reasons throws back Unsupported device and I also checked the manufacturer page but could not find info about changed id.

So in short - we can try adding it - just dunno if it will work as expected :O

@wifi4u
Copy link
Author

wifi4u commented Mar 29, 2018

Thanks so much for your kind offer, but this is a mis-understanding: I meant that I can't debug the module at the moment b/c of short time the APU2 is available to me, not that I would need the GPIO module right now. I stumbled about the module's error message when boot time for LEDE on APU2 was more than doubled (~ 25 seconds instead of 11 seconds) due to the kernel module loader going nuts while trying to load modules (gpio-nct5104d and leds-apu). While I could fix the LED module, I couldn't do so with nct5104, so I removed this from the firmware image for now. Sure, I could replace the chip ID, but won't it harm the hardware if pin assignments probably have changed, too? I'm always somewhat respectful with chips whose input pins can be programmed as outputs, too :-)

Anyway, I just wanted to let you know about this issue, because OpenWRT wiki still suggests to include the gpio-nct5104 module for APU2 and if doing so, the time for booting LEDE will be significantly increased due to unsuccessful tries to load it.

@RafPe
Copy link
Owner

RafPe commented Mar 30, 2018

Hey,

I think we can easily start supporting it. After doing some googling it seems there is a new revision. Look here https://pcengines.ch/file/NCT5104D_Datasheet_V1_9.pdf ( page 21/22 ). The change seems to be related to UART RS485 Auto Flow Control. For the rest

I would say make a PR by adding the proper chipID and we should be good to go. And then you can safely include the driver and just add this information to README so it does not get lost

What do you think ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants