OSDN Git Service

soc: amlogic: gx-socinfo: Add mask for each SoC packages
authorNeil Armstrong <narmstrong@baylibre.com>
Thu, 7 Mar 2019 14:01:45 +0000 (15:01 +0100)
committerKevin Hilman <khilman@baylibre.com>
Mon, 18 Mar 2019 16:07:31 +0000 (09:07 -0700)
commitdce47aed20c7de3ee2011b7a63e67f08e9dcfb5e
tree229efc37e50a40f0cdbc613bed63ef109b95f977
parent9e98c678c2d6ae3a17cb2de55d17f69dddaa231b
soc: amlogic: gx-socinfo: Add mask for each SoC packages

When updated IDs on f842c41adc04 ("amlogic: meson-gx-socinfo: Update soc ids")
we introduced packages ids using the full 8bit value, but in the function
socinfo_to_package_id() the id was filtered with the 0xf0 mask.

While the 0xf0 mask is valid for most board, it filters out the lower
4 bits which encodes some characteristics of the chip.

This patch moves the mask into the meson_gx_package_id table to be applied
on each package name independently and add the correct mask for some
specific entries.

An example is the S905, in the vendor code the S905 is package_id
different from 0x20, and S905M is exactly 0x20.

Another example are the The Wetek Hub & Play2 boards using a S905-H
variant, which is the S905 SoC with some licence bits enabled.
These licence bits are encoded in the lower 4bits, so to detect
the -H variant, we must detect the id == 0x3 with the 0xf mask.

Fixes: f842c41adc04 ("amlogic: meson-gx-socinfo: Update soc ids")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
drivers/soc/amlogic/meson-gx-socinfo.c