soc: ti: k3-socinfo: Revamp driver to accommodate different rev structs
authorNeha Malcom Francis <n-francis@ti.com>
Mon, 16 Oct 2023 10:16:08 +0000 (15:46 +0530)
committerNishanth Menon <nm@ti.com>
Wed, 6 Dec 2023 14:58:08 +0000 (08:58 -0600)
commit3ba080bf46e4a9039d0d41356f4a2515e00bf747
treeeae6c9fc36d76d0bc58e57c74c9aeada3a6f7430
parent964946b88887089f447a9b6a28c39ee97dc76360
soc: ti: k3-socinfo: Revamp driver to accommodate different rev structs

k3-socinfo.c driver assumes silicon revisions for every platform are
incremental and one-to-one, corresponding to JTAG_ID's variant field:
1.0, 2.0 etc. This assumption is wrong for SoCs such as J721E, where the
variant field to revision mapping is 1.0, 1.1. Further, there are SoCs
such as AM65x where the sub-variant version requires custom decoding of
other registers.

Address this by using conditional handling per JTAG ID that requires an
exception with J721E as the first example. To facilitate this
conversion, use macros to identify the JTAG_ID part number and map them
to predefined string array.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Co-developed-by: Thejasvi Konduru <t-konduru@ti.com>
Signed-off-by: Thejasvi Konduru <t-konduru@ti.com>
Link: https://lore.kernel.org/r/20231016101608.993921-4-n-francis@ti.com
Signed-off-by: Nishanth Menon <nm@ti.com>
drivers/soc/ti/k3-socinfo.c