Welcome! Log In Create A New Profile

Advanced

NSA320: hwmon / status

Posted by shivahoj 
NSA320: hwmon / status
November 22, 2015 08:22AM
Hello, i just updated to the latest u-boot and kernel 4.2 (by Your method 4b), which worked fine.
From the information You provided about the recent kernels i thought the hwmon issue was somehow solved. But unfortunately the sys/class/hwmon/directory ist still empty, before and after insmod nsa3xx_hwmon.
Also sensors-detect doesnt find anything.
Is this maybe a FDT vs. non-FDT thing? (I still dont get what this really is, and how to find out which i have or need)

Any ideas? Any tweaks?

Dirk

----
Mod: made this own topic

2 Pieces NSA320 , u-boot 2016.05, debian 4.12.1, Several Mac and Linux boxes connected.
More into soldering than programming. Location:Hildesheim, Germany



Edited 2 time(s). Last edit at 11/22/2015 02:04PM by bodhi.
Re: NSA320: hwmon / status
November 22, 2015 10:30AM
Sorry,
this was intended NOT to go in the u-boot forum, but into the Debian section.
Re: NSA320: hwmon / status
November 22, 2015 02:11PM
Dirk,

This hwmon patch has been implmented and tested by pbg4. Hopefully he is visiting this forum and will give you a better answer than I do. pbg4 has a post explaining how to activate the module properly, you could search for it. If I can find it, I'll post the link.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA320: hwmon / status
November 22, 2015 03:36PM
Hi,

this was the last status end of august this year 2015,

http://forum.doozan.com/read.php?2,23555

both of my NSA320 systems have this kernel and are running fine and the fan speed
sensor is working fine, the patch I added was a port to device tree descriptions for testing purposes,.. since nobody else
tested I did not make any further modifications, that is all,..

best wishes pbg4



Edited 1 time(s). Last edit at 11/22/2015 03:39PM by pbg4.
Re: NSA320: hwmon / status
December 02, 2015 04:45PM
Hello pbg4,
i have just re-installed bodhi's 4.2.0 kernel after the 4b method(4a didnt work for me, maybe i made some typos, but i won't dig into that now).

This is a minor issue, and if its much work , i'll just leave it as is now.
Could You please describe how You persuaded the kernel to create the directory and its contents in sys/class/platform/hwmon ?
i have succesfully modprobed nsa3xx-hwmon which appears after lsmod with size 4052, as nsa3xx_hwmon(note the hyphen versus underscore!), but isnt used by anything.
Also sensors-detect (again) doesnt find anything. Maybe you have some tweaks in Your sensors.conf?
Or what else did You do to get valid sensor data?
From everything i read about the recent kernel changelogs, the updated and working hwmon driver should be in the kernel modules...

2 Pieces NSA320 , u-boot 2016.05, debian 4.12.1, Several Mac and Linux boxes connected.
More into soldering than programming. Location:Hildesheim, Germany



Edited 1 time(s). Last edit at 12/03/2015 02:22PM by shivahoj.
Re: NSA320: hwmon / status
December 09, 2015 11:17AM
Hi shivahoj,

the only kernel tested by me which was released from bodhi with my patch for
nsa3xx-hwmon included was the 4.1.0-kirkwood-tld-3-test kernel mentioned above,

the link is in my answer above, this was a test kernel with a working nsa3xx-hwmon module with
some debugging info spit out in the kernel messages when lm-sensors is used,

if you want a working temp sensor and fan speed simply use this test kernel and you have a working solution,
that is all to do, but as there is no zImage in the testkernel package you must have a new uboot installed and be able to load the dtb when booting (method 4a),.. that is the only prerequisite,

until now I had no time to test the latest 4.2 kernel, but you can check easily if my patch is included
by:

strings /lib/modules/4.2.0-kirkwood-tld-1/kernel/drivers/hwmon/nsa3xx-hwmon.ko |grep of_get_named_gpio_flags

if you find the string of_get_named_gpio_flags twice than my patch with the port of nsa3xx-hwmon to
devicetree structures is included, otherwise not,..

best wishes pbg4



Edited 1 time(s). Last edit at 12/09/2015 11:20AM by pbg4.
Re: NSA320: hwmon / status
December 09, 2015 12:29PM
Yep it is there:
root@public:/home/dirk# strings /lib/modules/4.2.0-kirkwood-tld-1/kernel/drivers/hwmon/nsa3xx-hwmon.ko |grep of_get_named_gpio_flags
of_get_named_gpio_flags
of_get_named_gpio_flags
root@public:/home/dirk#

i wonder why it doesnt perform at all...
Re: NSA320: hwmon / status
December 09, 2015 12:50PM
shivahoj,

As pbg4 recommended, I think it is best to run the test kernel first to verify that whether your setup is faulty. It is quite simple to do that? And you don't have to remove it later. Keep it installed, just switch to the new/old kernels by renaming uImage and uInitrd.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA320: hwmon / status
December 09, 2015 01:44PM
Hi shivahoj,

just tested the 4.2 kernel on one of my NSA320 boxes, all is fine here,..

sensors are working, just put nsa3xx-hwmon in /etc/modules to get the module
loaded at boot time,..

since bodhi rightly did not activate # CONFIG_HWMON_DEBUG_CHIP (which is not set to y in the config)
the hwmon debug in this production kernel 4.2 is not activated, (although it was activated in the test kernel),
so there are no debug kernel messages,

maybe you did not get the correct kirkwood-nsa320.dtb file when you embedded this in the kernel image
with the 4b method?? I have checked the 4.2 kirkwood-nsa320.dtb by reverse compiling with dtc, it is OK!!

best wishes pbg4
Re: NSA320: hwmon / status
December 09, 2015 05:55PM
bodhi Wrote:
-------------------------------------------------------
> pbg4 Wrote:
> --------------------------------------------------
> -----
> > Hi shivahoj,
> >
> > just tested the 4.2 kernel on one of my NSA320
> > boxes, all is fine here,..
> >
> > sensors are working, just put nsa3xx-hwmon in
> > /etc/modules to get the module
> > loaded at boot time,..
> >
> > since bodhi rightly did not activate #
> > CONFIG_HWMON_DEBUG_CHIP (which is not set to y
> in
> > the config)
> > the hwmon debug in this production kernel 4.2
> is
> > not activated, (although it was activated in
> the
> > test kernel),
> > so there are no debug kernel messages,
> >
> > maybe you did not get the correct
> > kirkwood-nsa320.dtb file when you embedded this
> in
> > the kernel image
> > with the 4b method?? I have checked the 4.2
> > kirkwood-nsa320.dtb by reverse compiling with
> dtc,
> > it is OK!!
> >
> > best wishes pbg4
>
Bummer :) missed that config switch. I could add it back in kenel 4.4 , only when and if needed. I think when in doubt, we can run the tet kernel to get debug info? Sounds like a good plan?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 12/09/2015 05:59PM by bodhi.
Re: NSA320: hwmon / status
December 10, 2015 10:21AM
Hi bodhi,

there is no need to set CONFIG_HWMON_DEBUG_CHIP=y except in a test kernel package,
as this affects all hwmon sensor chips for all devices supported by the kernel,

as we have already a test kernel for NSA3X0 and nsa3xx-hwmon you can leave it as it is for now,

best wishes pbg4
Re: NSA320: hwmon / status
February 07, 2016 10:35AM
Hi,

based on the activities here in the forum to get nsa3xx-hwmon working again in bodhis newer devicetree
based kernels Adam Baker found my patch, after some email discussions with us he decided to clean
the patch and send it upstream for inclusion in mainline, so hopefully it will be included in 4.6, lets see,..

the patch adresses the NSA320 with the old holtek mcu (factory programmed by zyxel) which is connected to gpios,
not the other variants with i2c attached regular sensor chips, but may work also on the other NSA3xx boxes with newer
holtek mcu's,...

see: http://marc.info/?l=linux-arm-kernel&m=145485721422396&w=2

best wishes pbg4



Edited 1 time(s). Last edit at 02/07/2016 02:56PM by pbg4.
Re: NSA320: hwmon / status
February 08, 2016 05:42PM
Thanks pbg4,

Perhaps the latest patch will be better. I've tried the NSA325 with the previous patch and it did not work, I think it's due to a different Holtek MCU (i.e. different magic number).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: NSA320: hwmon / status
February 10, 2016 04:35AM
Hi bodhi,

have you downloaded the NSA325 kernel sources?, it might be worth to look if
zyxel has implemented something like a /proc/hwmon device, this was the case
with NSA320 which has the least capable simple holtek mcu, but that was sufficient
to implement nsa3xx-hwmon new,

but because zyxel used i2cget commands to read out the values from the newer
holtek mcu in the NSA325, maybe there is little chance that they have implemented something
equivalent,..

best wishes pbg4
Re: NSA320: hwmon / status
February 10, 2016 11:54AM
Hi pbg4,

> have you downloaded the NSA325 kernel sources?,
> it might be worth to look if
> zyxel has implemented something like a /proc/hwmon
> device, this was the case
> with NSA320 which has the least capable simple
> holtek mcu, but that was sufficient
> to implement nsa3xx-hwmon new,
>
> but because zyxel used i2cget commands to read out
> the values from the newer
> holtek mcu in the NSA325, maybe there is little
> chance that they have implemented something
> equivalent,..

Yes, you've guessed rigth! they use i2cget command simply because they did not implement hwmon. I have the Zyxel 325 stock GPL source, and IIRC, did look for this but could not find any implementation of hwmon in the source.

However, I think with the new hwmon that you/Adam/Sebestian have worked on, it might be worthwhile to test using a different magic number in the module for the new Holtek. It might make it work. As I'm currently a little bit busy with day job, and also debugging the Pogo V3 Oxnas kernel panic, I will have to put this on my Todo list :)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 02/10/2016 12:01PM by bodhi.
Re: NSA320: hwmon / status
March 08, 2016 07:19AM
Hi,

the patch from Adam for nsa320-hwmon just has passed the 3. review round
and is accepted, but now that the rc7 was released it is too late putting it to arm-soc
for the 4.6 kernel, so it will hopefully land in 4.7 kernel,

best wishes pbg4
Re: NSA320: hwmon / status
March 08, 2016 01:07PM
Thanks for the info pbg4!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: