From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.42]) by mx.groups.io with SMTP id smtpd.web10.6401.1595282093993013490 for ; Mon, 20 Jul 2020 14:54:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@vmware.com header.s=selector2 header.b=GMqXHP6o; spf=pass (domain: vmware.com, ip: 40.107.237.42, mailfrom: awarkentin@vmware.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eyAao8vvMczkcWSxxkZoqPHJmxfqO06LncUbRlOfirDX7FBlGpinNX65/DnrEj696eows7K6ZSESzNHHzQuVOkaLMJWXFqd4SNoNZ2toBsxjwswED6WiAIP6m+buJdctol4b3OwE8l0um93nYX+EXTTKfcbRlhztQfD+xPkmU+NUtP2A3CjFflJKl4ZsvYr1wxAvsEmuMPw3WMFSrn/j1X6Q9EOeaFd7ByMTWJJ9HEpKqh0kupJGk/7YrLGAsEeq9c3RTLuXO6A2v8alY0odoZe260BNdIHzPT1aQ5ewpd2Uril+TbO80q3aD99XVs7+HkLRbBsmkdhShbvpx3AQsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NGZ68duqPx4liqGKrGq88QSQzF/EbVr/fxFpMiIx/Gg=; b=RusripcEuDpjyNyTFWUJTNBLGZvOH3sFFzjVmQTZrC9Edcs1ooQtYtGEhHA/3OU8GdTbLKRxOF3X8x5uxJbsxVQ+KLpLOHNb6u1RP69Auvin6twqCoCWYL0YD1BVlzdkxB7hA5CHtLaEtbjPPx0aqx5nd14tm9G1h7C1XeDHNkRgO3SPb92XZCsxkZLM2mYy9Q0YdjySOZlaDTuxNKIkVbpA+bG8psp65U8HWpcwVCDWNJEU4afAJnacsM1xUcGnxdZHPIJnxPWqulD/BaW838yAZwqF9twsP58l/03MTOQfB3TdPvLRDA8ZrKY1U0WhJBOfQPGxk2u+QwxFZo/gog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NGZ68duqPx4liqGKrGq88QSQzF/EbVr/fxFpMiIx/Gg=; b=GMqXHP6o+Ve6/k0ySW98t9fgaukSQV8mvxFcBeTtL4kWK84GcaOlvda/o6UOZP9XJwicWihz6UNT02Mj/RTEgxbNXTqRktP9D2vnor3xo21XTtlJlMDM457l4IFLSvfW5pP7303Wk2LMXdFyEhUPxeqNzGsfiSf05TFMVMw45wk= Received: from BN6PR05MB3411.namprd05.prod.outlook.com (2603:10b6:405:43::23) by BN3PR05MB2500.namprd05.prod.outlook.com (2a01:111:e400:7bb5::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.14; Mon, 20 Jul 2020 21:54:50 +0000 Received: from BN6PR05MB3411.namprd05.prod.outlook.com ([fe80::e1ef:31eb:c802:aef0]) by BN6PR05MB3411.namprd05.prod.outlook.com ([fe80::e1ef:31eb:c802:aef0%3]) with mapi id 15.20.3216.017; Mon, 20 Jul 2020 21:54:50 +0000 From: "Andrei Warkentin" To: Samer El-Haj-Mahmoud , "devel@edk2.groups.io" CC: Leif Lindholm , Pete Batard , Ard Biesheuvel Subject: Re: [edk2-platform][PATCH v1 5/7] Platforms/RaspberryPi: SMBIOS Type 7 fixes Thread-Topic: [edk2-platform][PATCH v1 5/7] Platforms/RaspberryPi: SMBIOS Type 7 fixes Thread-Index: AQHWXsH1bjwXmbNBA06Rv63PIxJyK6kRAz3c Date: Mon, 20 Jul 2020 21:54:50 +0000 Message-ID: References: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com>,<20200720181646.2891-6-Samer.El-Haj-Mahmoud@arm.com> In-Reply-To: <20200720181646.2891-6-Samer.El-Haj-Mahmoud@arm.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=vmware.com; x-originating-ip: [98.214.99.181] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f77c4fba-9418-4ba7-03d8-08d82cf786c5 x-ms-traffictypediagnostic: BN3PR05MB2500: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GbiO9Zmxf3E4mA1rMhHQ3WpRuMu4Kd0Oyi4f9+ea30aKM7B9vOZk6V7rwd3wCl10wfBmxA3xK5Gb+nRqLzXBb51qf3DVfeoZP4fHirHO+h2OwZ76Di1txcEc1JuNQH1LieNMj/IondOcOyNikOKxKLFFRg7o14ZmKVWHkclnmS/J0Ijt/D8cd+cpHgwvMC8kLPvAvrWjSqEFRiWjUnjJMqSYUgDWC+HToc52xkhAZsEOITrUllXiJopmoNZiYCws6uYSHa79WD2U42YqlPoPAChAqMrKZKmDMz/1mET7wv6M3vAQd4IBAjoxDj44ItnRxO4zTawTMtGSkwivd5uENA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR05MB3411.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(396003)(39860400002)(346002)(376002)(136003)(53546011)(83380400001)(86362001)(71200400001)(33656002)(19627235002)(6506007)(55016002)(8936002)(316002)(52536014)(8676002)(26005)(5660300002)(19627405001)(66476007)(2906002)(7696005)(110136005)(66556008)(64756008)(66946007)(66446008)(54906003)(9686003)(76116006)(478600001)(186003)(4326008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: oO6JmNTsG/dv4IFMIQY+P3qOacee+N5nsBLs6zxG4rc1pBLsXGTT96I0BfS2MJyV4uk/nmwTNBHZbQaPEJsz1/MwkS0HNH3EkGyj4cbx7Sc7wULTXb0rsAfCN8Uh8dQRtDhlUPukulPGkxAMX3ezRoL8j629o/m9tE1UmYQHOd9mRjIEymJfdL7rvFagBqBFSEEI80bEeTSjSKueU/PDWykUe2oQVUCutdTbNNSv5zq87IRsYEWrNJOJsxttjR0ORwMgG1DyF7g+xq/HszKOjAL/Wsvd9g06ZjSlFSaZx28U1zhHAPUQl4QfSwoCeSioWcTOTqrJS/cPB4XaUY+ote3HIC4pYQLdCsEWNRrMtBQx3ejEPygyxipY38EDMIC476gOgUTlQgblka4T/U6E5h1Lb+sQlK3nuLgIdTmGnXxKAvIE7TOpGGZQhFxC8LgJD2taMyhVwkuhMkXW+I3/rZrFpMeA4owQDCvZ+cymAceacjw5A1Q/cQkEEooOzeQi x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR05MB3411.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f77c4fba-9418-4ba7-03d8-08d82cf786c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2020 21:54:50.0938 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: DonM2heIHPG2ovz77DMNUaiPfubTNOaXXvpxejRLAV0kDpWbRxejudZxp8tCr9OZaN9cz/h5pEcEVDo8nq8oYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR05MB2500 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BN6PR05MB341110347374499FDA382CB0B97B0BN6PR05MB3411namp_" --_000_BN6PR05MB341110347374499FDA382CB0B97B0BN6PR05MB3411namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Andrei Warkentin ________________________________ From: Samer El-Haj-Mahmoud Sent: Monday, July 20, 2020 1:16 PM To: devel@edk2.groups.io Cc: Leif Lindholm ; Pete Batard ; Andrei W= arkentin ; Ard Biesheuvel Subject: [edk2-platform][PATCH v1 5/7] Platforms/RaspberryPi: SMBIOS Type 7= fixes Various fixes and enhancements for SMBIOS Type 7: - Break into 3 instances (L1 Instruction, L1 Data, and L2 cache) - Use correct values for RPi4 and RPi3 SoCs - Add Type 4 association with type 7 handles Cc: Leif Lindholm Cc: Pete Batard Cc: Andrei Warkentin Cc: Ard Biesheuvel Signed-off-by: Samer El-Haj-Mahmoud --- Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 146 += +++++++++++++++++-- 1 file changed, 133 insertions(+), 13 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c index 4dcdec5615dc..4ee8ae6ebfc9 100644 --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c @@ -291,12 +291,24 @@ CHAR8 *mProcessorInfoType4Strings[] =3D { /*********************************************************************** SMBIOS data definition TYPE7 Cache Information ************************************************************************/ -SMBIOS_TABLE_TYPE7 mCacheInfoType7 =3D { +SMBIOS_TABLE_TYPE7 mCacheInfoType7_L1I =3D { { EFI_SMBIOS_TYPE_CACHE_INFORMATION, sizeof (SMBIOS_TABLE_TYPE7), 0 }, 1, // SocketDesignation String - 0x018A, // Cache Configuration - 0x00FF, // Maximum Size 256k - 0x00FF, // Install Size 256k + 0x380, // Cache Configuration + //Cache Level :3 (L1) + //Cache Socketed :1 (Not Socketed) + //Reserved :1 + //Location :2 (Internal) + //Enabled/Disabled :1 (Enabled) + //Operational Mode :2 (Unknown) + //Reserved :6 +#if (RPI_MODEL =3D=3D 4) + 0x0030, // Maximum Size (RPi4: 48KB) + 0x0030, // Install Size (RPi4: 48KB) +#else + 0x0010, // Maximum Size (RPi3: 16KB) + 0x0010, // Install Size (RPi3: 16KB) +#endif { // Supported SRAM Type 0, //Other :1 0, //Unknown :1 @@ -317,16 +329,115 @@ SMBIOS_TABLE_TYPE7 mCacheInfoType7 =3D { 0, //Asynchronous :1 0 //Reserved :9 }, - 0, // Cache Speed unknown - CacheErrorMultiBit, // Error Correction Multi - CacheTypeUnknown, // System Cache Type - CacheAssociativity2Way // Associativity + 0, // Cache Speed unknown + CacheErrorParity, // Error Correction + CacheTypeInstruction, // System Cache Type + CacheAssociativity2Way // Associativity (RPi4 L1 Instruction cache i= s 3-way set associative, but SMBIOS spec does not define that) }; -CHAR8 *mCacheInfoType7Strings[] =3D { - "Cache1", +CHAR8 *mCacheInfoType7Strings_L1I[] =3D { + "L1 Instruction", NULL }; +SMBIOS_TABLE_TYPE7 mCacheInfoType7_L1D =3D { + { EFI_SMBIOS_TYPE_CACHE_INFORMATION, sizeof (SMBIOS_TABLE_TYPE7), 0 }, + 1, // SocketDesignation String + 0x180, // Cache Configuration + //Cache Level :3 (L1) + //Cache Socketed :1 (Not Socketed) + //Reserved :1 + //Location :2 (Internal) + //Enabled/Disabled :1 (Enabled) + //Operational Mode :2 (WB) + //Reserved :6 +#if (RPI_MODEL =3D=3D 4) + 0x0020, // Maximum Size (RPi4: 32KB) + 0x0020, // Install Size (RPi4: 32KB) +#else + 0x0010, // Maximum Size (RPi3: 16KB) + 0x0010, // Install Size (RPi3: 16KB) +#endif + { // Supported SRAM Type + 0, //Other :1 + 0, //Unknown :1 + 0, //NonBurst :1 + 1, //Burst :1 + 0, //PiplelineBurst :1 + 1, //Synchronous :1 + 0, //Asynchronous :1 + 0 //Reserved :9 + }, + { // Current SRAM Type + 0, //Other :1 + 0, //Unknown :1 + 0, //NonBurst :1 + 1, //Burst :1 + 0, //PiplelineBurst :1 + 1, //Synchronous :1 + 0, //Asynchronous :1 + 0 //Reserved :9 + }, + 0, // Cache Speed unknown + CacheErrorSingleBit, // Error Correction + CacheTypeData, // System Cache Type +#if (RPI_MODEL =3D=3D 4) + CacheAssociativity2Way // Associativity +#else + CacheAssociativity4Way // Associativity +#endif +}; +CHAR8 *mCacheInfoType7Strings_L1D[] =3D { + "L1 Data", + NULL +}; + +SMBIOS_TABLE_TYPE7 mCacheInfoType7_L2 =3D { + { EFI_SMBIOS_TYPE_CACHE_INFORMATION, sizeof (SMBIOS_TABLE_TYPE7), 0 }, + 1, // SocketDesignation String + 0x0181, // Cache Configuration + //Cache Level :3 (L2) + //Cache Socketed :1 (Not Socketed) + //Reserved :1 + //Location :2 (Internal) + //Enabled/Disabled :1 (Enabled) + //Operational Mode :2 (WB) + //Reserved :6 +#if (RPI_MODEL =3D=3D 4) + 0x0400, // Maximum Size (RPi4: 1MB) + 0x0400, // Install Size (RPi4: 1MB) +#else + 0x0200, // Maximum Size (RPi3: 512KB) + 0x0200, // Install Size (RPi3: 512KB) +#endif + { // Supported SRAM Type + 0, //Other :1 + 0, //Unknown :1 + 0, //NonBurst :1 + 1, //Burst :1 + 0, //PiplelineBurst :1 + 1, //Synchronous :1 + 0, //Asynchronous :1 + 0 //Reserved :9 + }, + { // Current SRAM Type + 0, //Other :1 + 0, //Unknown :1 + 0, //NonBurst :1 + 1, //Burst :1 + 0, //PiplelineBurst :1 + 1, //Synchronous :1 + 0, //Asynchronous :1 + 0 //Reserved :9 + }, + 0, // Cache Speed unknown + CacheErrorSingleBit, // Error Correction Multi + CacheTypeUnified, // System Cache Type + CacheAssociativity16Way // Associativity +}; +CHAR8 *mCacheInfoType7Strings_L2[] =3D { + "L2", + NULL +}; /*********************************************************************** SMBIOS data definition TYPE9 System Slot Information ************************************************************************/ @@ -846,7 +957,17 @@ CacheInfoUpdateSmbiosType7 ( VOID ) { - LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mCacheInfoType7, mCacheInfoTyp= e7Strings, NULL); + EFI_SMBIOS_HANDLE SmbiosHandle; + + LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mCacheInfoType7_L1I, mCacheInf= oType7Strings_L1I, NULL); + + LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mCacheInfoType7_L1D, mCacheInf= oType7Strings_L1D, &SmbiosHandle); + // Set Type4 L1CacheHandle to point to the newly added L1 Data Cache + mProcessorInfoType4.L1CacheHandle =3D (UINT16) SmbiosHandle; + + LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mCacheInfoType7_L2, mCacheInfo= Type7Strings_L2, &SmbiosHandle); + // Set Type4 L2CacheHandle to point to the newly added L2 Cache + mProcessorInfoType4.L2CacheHandle =3D (UINT16) SmbiosHandle; } /*********************************************************************** @@ -972,11 +1093,10 @@ PlatformSmbiosDriverEntryPoint ( BoardInfoUpdateSmbiosType2 (); + CacheInfoUpdateSmbiosType7 (); // Add Type 7 first to get Cache handle f= or use in Type 4 ProcessorInfoUpdateSmbiosType4 (4); //One example for creating and upd= ating - CacheInfoUpdateSmbiosType7 (); - SysSlotInfoUpdateSmbiosType9 (); OemStringsUpdateSmbiosType11 (); -- 2.17.1 --_000_BN6PR05MB341110347374499FDA382CB0B97B0BN6PR05MB3411namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Reviewed-by: Andrei Warken= tin <awarkentin@vmware.com>

From: Samer El-Haj-Mahmoud = <Samer.El-Haj-Mahmoud@arm.com>
Sent: Monday, July 20, 2020 1:16 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Leif Lindholm <leif@nuviainc.com>; Pete Batard <pete@ak= eo.ie>; Andrei Warkentin <awarkentin@vmware.com>; Ard Biesheuvel &= lt;ard.biesheuvel@arm.com>
Subject: [edk2-platform][PATCH v1 5/7] Platforms/RaspberryPi: SMBIOS= Type 7 fixes
 
Various fixes and enhancements for SMBIOS Type 7:<= br>  - Break into 3 instances (L1 Instruction, L1 Data, and L2 cache)
 - Use correct values for RPi4 and RPi3 SoCs
 - Add Type 4 association with type 7 handles

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Pete Batard <pete@akeo.ie>
Cc: Andrei Warkentin <awarkentin@vmware.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com> ---
 Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | = 146 ++++++++++++++++++--
 1 file changed, 133 insertions(+), 13 deletions(-)

diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c index 4dcdec5615dc..4ee8ae6ebfc9 100644
--- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c @@ -291,12 +291,24 @@ CHAR8 *mProcessorInfoType4Strings[] =3D {
 /********************************************************************= ***
         SMBIOS data definition&nbs= p; TYPE7  Cache Information
 *********************************************************************= ***/
-SMBIOS_TABLE_TYPE7 mCacheInfoType7 =3D {
+SMBIOS_TABLE_TYPE7 mCacheInfoType7_L1I =3D {
   { EFI_SMBIOS_TYPE_CACHE_INFORMATION, sizeof (SMBIOS_TABLE_TYPE= 7), 0 },
   1,          =             &nb= sp; // SocketDesignation String
-  0x018A,          =             &nb= sp;            =     // Cache Configuration
-  0x00FF,          =             &nb= sp;            =     // Maximum Size 256k
-  0x00FF,          =             &nb= sp;            =     // Install Size 256k
+  0x380,          &= nbsp;         // Cache Configuratio= n
+       //Cache Level    =     :3  (L1)
+       //Cache Socketed   &nb= sp; :1  (Not Socketed)
+       //Reserved    &nb= sp;      :1
+       //Location    &nb= sp;      :2  (Internal)
+       //Enabled/Disabled   :1&nbs= p; (Enabled)
+       //Operational Mode   :2&nbs= p; (Unknown)
+       //Reserved    &nb= sp;      :6
+#if (RPI_MODEL =3D=3D 4)
+  0x0030,          =          // Maximum Size (RPi4: 48K= B)
+  0x0030,          =          // Install Size (RPi4: 48K= B)
+#else
+  0x0010,          =          // Maximum Size (RPi3: 16K= B)
+  0x0010,          =          // Install Size (RPi3: 16K= B)
+#endif
   {          &= nbsp;           &nbs= p;  // Supported SRAM Type
     0,  //Other     &nbs= p;       :1
     0,  //Unknown     &n= bsp;     :1
@@ -317,16 +329,115 @@ SMBIOS_TABLE_TYPE7 mCacheInfoType7 =3D {
     0,  //Asynchronous    &nb= sp; :1
     0   //Reserved    &n= bsp;     :9
   },
-  0,           = ;            &n= bsp;            = ;        // Cache Speed unknown
-  CacheErrorMultiBit,        =    // Error Correction Multi
-  CacheTypeUnknown,        &n= bsp;            // S= ystem Cache Type
-  CacheAssociativity2Way        //= Associativity
+  0,           = ;             /= / Cache Speed unknown
+  CacheErrorParity,         /= / Error Correction
+  CacheTypeInstruction,     // System Cache Type<= br> +  CacheAssociativity2Way    // Associativity  (RP= i4 L1 Instruction cache is 3-way set associative, but SMBIOS spec does not = define that)
 };
-CHAR8  *mCacheInfoType7Strings[] =3D {
-  "Cache1",
+CHAR8  *mCacheInfoType7Strings_L1I[] =3D {
+  "L1 Instruction",
   NULL
 };
 
+SMBIOS_TABLE_TYPE7 mCacheInfoType7_L1D =3D {
+  { EFI_SMBIOS_TYPE_CACHE_INFORMATION, sizeof (SMBIOS_TABLE_TYPE7), 0= },
+  1,           = ;             /= / SocketDesignation String
+  0x180,          &= nbsp;         // Cache Configuratio= n
+       //Cache Level    =     :3  (L1)
+       //Cache Socketed   &nb= sp; :1  (Not Socketed)
+       //Reserved    &nb= sp;      :1
+       //Location    &nb= sp;      :2  (Internal)
+       //Enabled/Disabled   :1&nbs= p; (Enabled)
+       //Operational Mode   :2&nbs= p; (WB)
+       //Reserved    &nb= sp;      :6
+#if (RPI_MODEL =3D=3D 4)
+  0x0020,          =          // Maximum Size (RPi4: 32K= B)
+  0x0020,          =          // Install Size (RPi4: 32K= B)
+#else
+  0x0010,          =          // Maximum Size (RPi3: 16K= B)
+  0x0010,          =          // Install Size (RPi3: 16K= B)
+#endif
+  {           =             &nb= sp; // Supported SRAM Type
+    0,  //Other      &nb= sp;      :1
+    0,  //Unknown      &= nbsp;    :1
+    0,  //NonBurst      =     :1
+    1,  //Burst      &nb= sp;      :1
+    0,  //PiplelineBurst    :1
+    1,  //Synchronous     &nb= sp; :1
+    0,  //Asynchronous      := 1
+    0   //Reserved     &= nbsp;    :9
+  },
+  {           =             &nb= sp; // Current SRAM Type
+    0,  //Other      &nb= sp;      :1
+    0,  //Unknown      &= nbsp;    :1
+    0,  //NonBurst      =     :1
+    1,  //Burst      &nb= sp;      :1
+    0,  //PiplelineBurst    :1
+    1,  //Synchronous     &nb= sp; :1
+    0,  //Asynchronous      := 1
+    0   //Reserved     &= nbsp;    :9
+  },
+  0,           = ;             /= / Cache Speed unknown
+  CacheErrorSingleBit,      // Error Correct= ion
+  CacheTypeData,         = ;   // System Cache Type
+#if (RPI_MODEL =3D=3D 4)
+  CacheAssociativity2Way    // Associativity
+#else
+  CacheAssociativity4Way    // Associativity
+#endif
+};
+CHAR8  *mCacheInfoType7Strings_L1D[] =3D {
+  "L1 Data",
+  NULL
+};
+
+SMBIOS_TABLE_TYPE7 mCacheInfoType7_L2 =3D {
+  { EFI_SMBIOS_TYPE_CACHE_INFORMATION, sizeof (SMBIOS_TABLE_TYPE7), 0= },
+  1,           = ;             /= / SocketDesignation String
+  0x0181,          =          // Cache Configuration
+       //Cache Level    =     :3  (L2)
+       //Cache Socketed   &nb= sp; :1  (Not Socketed)
+       //Reserved    &nb= sp;      :1
+       //Location    &nb= sp;      :2  (Internal)
+       //Enabled/Disabled   :1&nbs= p; (Enabled)
+       //Operational Mode   :2&nbs= p; (WB)
+       //Reserved    &nb= sp;      :6
+#if (RPI_MODEL =3D=3D 4)
+  0x0400,          =          // Maximum Size (RPi4: 1MB= )
+  0x0400,          =          // Install Size (RPi4: 1MB= )
+#else
+  0x0200,          =          // Maximum Size (RPi3: 512= KB)
+  0x0200,          =          // Install Size (RPi3: 512= KB)
+#endif
+  {           =             &nb= sp; // Supported SRAM Type
+    0,  //Other      &nb= sp;      :1
+    0,  //Unknown      &= nbsp;    :1
+    0,  //NonBurst      =     :1
+    1,  //Burst      &nb= sp;      :1
+    0,  //PiplelineBurst    :1
+    1,  //Synchronous     &nb= sp; :1
+    0,  //Asynchronous      := 1
+    0   //Reserved     &= nbsp;    :9
+  },
+  {           =             &nb= sp; // Current SRAM Type
+    0,  //Other      &nb= sp;      :1
+    0,  //Unknown      &= nbsp;    :1
+    0,  //NonBurst      =     :1
+    1,  //Burst      &nb= sp;      :1
+    0,  //PiplelineBurst    :1
+    1,  //Synchronous     &nb= sp; :1
+    0,  //Asynchronous      := 1
+    0   //Reserved     &= nbsp;    :9
+  },
+  0,           = ;             /= / Cache Speed unknown
+  CacheErrorSingleBit,      // Error Correct= ion Multi
+  CacheTypeUnified,         /= / System Cache Type
+  CacheAssociativity16Way   // Associativity
+};
+CHAR8  *mCacheInfoType7Strings_L2[] =3D {
+  "L2",
+  NULL
+};
 /********************************************************************= ***
         SMBIOS data definition&nbs= p; TYPE9  System Slot Information
 *********************************************************************= ***/
@@ -846,7 +957,17 @@ CacheInfoUpdateSmbiosType7 (
   VOID
   )
 {
-  LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mCacheInfoType7, mCac= heInfoType7Strings, NULL);
+  EFI_SMBIOS_HANDLE SmbiosHandle;
+
+  LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mCacheInfoType7_L1I, = mCacheInfoType7Strings_L1I, NULL);
+
+  LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mCacheInfoType7_L1D, = mCacheInfoType7Strings_L1D, &SmbiosHandle);
+  // Set Type4 L1CacheHandle to point to the newly added L1 Data Cach= e
+  mProcessorInfoType4.L1CacheHandle =3D (UINT16) SmbiosHandle;
+
+  LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mCacheInfoType7_L2, m= CacheInfoType7Strings_L2, &SmbiosHandle);
+  // Set Type4 L2CacheHandle to point to the newly added L2 Cache
+  mProcessorInfoType4.L2CacheHandle =3D (UINT16) SmbiosHandle;
 }
 
 /********************************************************************= ***
@@ -972,11 +1093,10 @@ PlatformSmbiosDriverEntryPoint (
 
   BoardInfoUpdateSmbiosType2 ();
 
+  CacheInfoUpdateSmbiosType7 (); // Add Type 7 first to get Cache han= dle for use in Type 4
 
   ProcessorInfoUpdateSmbiosType4 (4);   //One example = for creating and updating
 
-  CacheInfoUpdateSmbiosType7 ();
-
   SysSlotInfoUpdateSmbiosType9 ();
 
   OemStringsUpdateSmbiosType11 ();
--
2.17.1

--_000_BN6PR05MB341110347374499FDA382CB0B97B0BN6PR05MB3411namp_--