nonspd: Get memory type from SMBIOS table

For the non-SPD memories, this change reads the memory type from
SMBIOS table for any memory part that does not match the list of
memories that mosys knows about. The memory type needs to be
translated from SMBIOS type to SPD type for rest of the functions to
work properly.

With this change, it is no longer necessary to add support for every
non-SPD memory type in mosys. We do lose some information
e.g. Manufacturer id/name, device width, ranks and list of different
speeds supported by the memory part. But none of these are interesting
from any uses cases / tests that we have.

If a memory has table in mosys, the output of "mosys memory spd print
all" looks something like:

0 | LPDDR4
1 | LPDDR4
2 | LPDDR4
3 | LPDDR4
0 | 1-44: Micron Technology | 00000000 | MT53B256M32D1NP
1 | 1-44: Micron Technology | 00000000 | MT53B256M32D1NP
2 | 1-44: Micron Technology | 00000000 | MT53B256M32D1NP
3 | 1-44: Micron Technology | 00000000 | MT53B256M32D1NP
0 | 1024 | 1 | 32
1 | 1024 | 1 | 32
2 | 1024 | 1 | 32
3 | 1024 | 1 | 32
0 | LPDDR4-1333, LPDDR4-1600, LPDDR4-1866, LPDDR4-2133, LPDDR4-2400
1 | LPDDR4-1333, LPDDR4-1600, LPDDR4-1866, LPDDR4-2133, LPDDR4-2400
2 | LPDDR4-1333, LPDDR4-1600, LPDDR4-1866, LPDDR4-2133, LPDDR4-2400
3 | LPDDR4-1333, LPDDR4-1600, LPDDR4-1866, LPDDR4-2133, LPDDR4-2400

Without the entry in mosys, following is the output based on
information in SMBIOS:
0 | LPDDR4
1 | LPDDR4
2 | LPDDR4
3 | LPDDR4
0 | 1-0 | 00000000 | MT53B256M32D1NP
1 | 1-0 | 00000000 | MT53B256M32D1NP
2 | 1-0 | 00000000 | MT53B256M32D1NP
3 | 1-0 | 00000000 | MT53B256M32D1NP
0 | 1024 | 0 | 0
1 | 1024 | 0 | 0
2 | 1024 | 0 | 0
3 | 1024 | 0 | 0
0 | LPDDR4-2400
1 | LPDDR4-2400
2 | LPDDR4-2400
3 | LPDDR4-2400

BUG=b:117711313,b:120183640
BRANCH=None
TEST=Verified that memory type gets reported correctly. Also, verified
that platform_MemCheck is successful.

Change-Id: I352904263fae1e24bbf53d7fdec5e966e36095df
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1356300
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Karthikeyan Ramasubramanian <kramasub@chromium.org>
2 files changed