Repository navigation
novatek: read the die temperature on NA51055 and NA51084 too - #277
Merged
Merged
Conversation
#276's reader is not NA51089's alone. The SDK's kernel carries plat-na51055, which serves both NA51055 and NA51084, next to plat-na51089, and the two agree on everything it touches: - the peripheral base, CG at +0x20000 and eFuse at +0x660000 (hardware.h); the ADC's gate is CG_CLK_EN_REG1 bit 13 on both (na51055-clk.c and na51089-clk.c name "f0260000.adc" alike); - adc_reg.h, byte for byte, so the thermal average is the same field; - EFUSE_THERMAL_TRIM_DATA, 0x105 in both efuse_protected.h; - the eFuse read. na51055/otp_protected.o_shipped is a different binary, but its efuse_open/efuse_read/efuse_close are the same register sequence as NA51089's, and its efuse_readParamOps maps 0x105 to row 6 and takes the first of the two copies with bit 15 set and bit 14 clear, as NA51089's does. What differs is nvt_adc's thermal_get_temp(): on NA51055 it is 1.3 degC per code with a default trim of 259 (DEFAULT_THERMAL_LEVEL); every later die gets 1.319 and 231, a default the SDK names for the NT98528, which is an NA51084. So the reader is installed for all three IDs, with NA51055's slope and default chosen by ID, and the register names lose their NA51089_ prefix. A device-tree model of NA51055 or NA51084 now sets the ID as NA51089's does. NA51090, NA51103 and NA51023 keep the sysfs reader. There is no NA51055 or NA51084 camera here, so this is the SDK's word, not a measurement. NA51089 is unchanged: lab NT98566, code 257 with trim 228, 68.25 degC. ipcinfo grows 180 bytes (IPCHW_VENDORS=all).
PR Summary by QodoRead die temperature directly on NA51055 and NA51084
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can move or hide resolved findings to focus on what still needs action |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #276, which reads the die temperature directly on NA51089 (NT98562/NT98566). The vendor SDK shows that NA51055 (NT9852x) and NA51084 (NT98528/NT98529) work the same way, so this installs the same reader for them.
Why the same code applies
na51089_linux_sdk_uclibc_v1.01.002shipsplat-na51055alongsideplat-na51089. Theplat-na51055platform covers both NA51055 and NA51084;top.hlists both IDs.plat-na51055(NA51055, NA51084)plat-na51089hardware.h)0xF0020000/0xF0660000*-clk.c,"f0260000.adc")CG_CLK_EN_REG1bit 13adc_reg.h(thermal average at+0x40 [24:16])EFUSE_THERMAL_TRIM_DATA0x1050x105otp_protected.o_shippedefuse_open/read/closeefuse_readParamOps(0x105)The only difference is in
nvt_adc'sthermal_get_temp():0x4821)DEFAULT_THERMAL_LEVEL)0x5021), NA51089DEFAULT_THERMAL_528_LEVEL, named for the NT98528, i.e. NA51084)The reader chooses the slope and default by chip ID. A device-tree model of
NA51055orNA51084now sets the ID the wayNA51089already does. NA51090, NA51103 and NA51023 keep the sysfs reader. The register macros lose theirNA51089_prefix.Tested
novatek_testcovers both formulas and defaults, the reader being installed for all three IDs, the device-tree names, and the three dies that keep sysfs. Breaking the slope choice, the default choice, NA51084's installation or NA51055's device-tree mapping each makes it fail.ipcinfo --tempprinted 68.25, which is code 257 with trim 228. The eFuse was left closed.ipcinfogrows 180 bytes withIPCHW_VENDORS=alland 0 withnone.Not tested on NA51055 or NA51084 hardware. There is no such camera in the lab, so the table above is what the SDK says, not a measurement. If you have an NT9852x or NT98528/529, please post the output of: