soc/intel: Fix for missing mem_rank info in SMBIOS

"mosys memory spd print all" returns incorrect memory ranks info.
This patch and 2 upcomming ones (one in FSP) will address the issue.
BUG=b:122329046
TEST=Boot to OS

Change-Id: I367e9c8f267be72b09b1004d13cbb0fb4352972b
Signed-off-by: Francois Toguo <francois.toguo.fotso@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1453260
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Francois Toguo Fotso <francois.toguo.fotso@intel.com>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
diff --git a/include/lib/smbios_tables.h b/include/lib/smbios_tables.h
index bafad84..8c9ec30 100644
--- a/include/lib/smbios_tables.h
+++ b/include/lib/smbios_tables.h
@@ -246,6 +246,7 @@
 	uint8_t serial_number;			/* string */
 	uint8_t asset_tag;			/* string */
 	uint8_t part_number;			/* string */
+        uint8_t attributes;			/* number of rank in dimm */
 } __attribute__ ((packed));
 
 /* memory device types */
diff --git a/lib/spd/nonspd_modules.c b/lib/spd/nonspd_modules.c
index 092696c..d95c27c 100644
--- a/lib/spd/nonspd_modules.c
+++ b/lib/spd/nonspd_modules.c
@@ -916,6 +916,8 @@
 	strncpy((char *)info->part_num, smbios_part_num, max_part_num_len);
 
 	info->dram_type = map_smbios_mem_type_to_spd(table);
+	info->num_ranks = table->data.mem_device.attributes & 0xf;
+	info->device_width = table->data.mem_device.data_width;
 
 	return transfer_speed_from_smbios_to_nonspd_mem_info(table, info);
 }