-
Notifications
You must be signed in to change notification settings - Fork 78
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
KSZ8563 - get strange results, how to use properly? #99
Comments
I am not sure those created "registers" files are for the standard register access API. The regs_bin utility were created for that implementation inside the non-DSA switch driver. That API allows the registers file to be opened for read and write access. The file location indicates the register and the count indicates how many to read or write and there is a buffer to hold the result. I do not think using the "cat" command works on that properly. Anyway I will try those files to see what is going on. The KSZ switch access is always 8-bit. There are 16-bit and 32-bit accesses because some registers are defined in those widths. |
I just tried using "cat" on the "registers" file created by non-DSA switch driver. It just displayed non-ASCII characters. That API deals with binary numbers so that is expected. The "registers" file created by regmap displays nice ASCII characters and so it uses a different system. It seems to behave like the old debugfs used by the non-DSA driver of old KSZ switches. Those switches have a limited set of registers like 256, so it is okay to dump those registers. But KSZ8563 is a new switch with different register definitions are there are a lot of holes in those registers. Dumping all is not a good idea. |
Do I get it right, this tool is for non-DSA drivers only? But as far as I know only the DSA driver is mainline - at least for that chip.
And I can't disable AutoNeg (as I need it) to disable EEE too. |
Using the KSZ8653 (SPI) and try to figure out how it works (5.14 kernel).
With no readme I start digging into source code, so I found that I have to call some path with "registers" in and found that 3 folders that seems to give access to registers:
Which one to call - some reg are 8, some are 16bit others even 32bit?
regs_bin /sys/kernel/debug/regmap/spi1.0-8 ?
But whatever I handover (-8, -16 or -32) as param it uses:
reg_size: 4
reg_cnt: 8
reg_fmt %08x
and a simple r, rb, rw, rd (which I think should access 8, 16 or 32bit) doesn't work.
Only when I give a count (?)
I get only output with:
which is completly nonsense.
When I "cat" the /sys/kernel/debug/regmap/spi1.0-8/registers I get an uncomfortable list of all registers, so at least read access should work.
But finally I need the write access to MMD register 0x3c to set/clear EEE. Will that work with this tool (once I get a working read)? Or do you know an other way to do so?
The text was updated successfully, but these errors were encountered: