From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.19916.1630919101115536701 for ; Mon, 06 Sep 2021 02:05:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=TlaHekbh; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: chasel.chiu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10098"; a="207148346" X-IronPort-AV: E=Sophos;i="5.85,271,1624345200"; d="scan'208";a="207148346" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2021 02:05:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,271,1624345200"; d="scan'208";a="536676664" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by FMSMGA003.fm.intel.com with ESMTP; 06 Sep 2021 02:05:03 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 6 Sep 2021 02:05:03 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 6 Sep 2021 02:05:02 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 6 Sep 2021 02:05:02 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.103) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Mon, 6 Sep 2021 02:05:02 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DqkaZALYDh5qa3L1NOfOqXsQYVI9Pe5sAPVs8wVpcRoEM1Wunbw34jnxDJYklCqhYvcuxiMwtaDApm/Rx7Yw8TwusI84wMGIn7+yi6SocF6/Zz8YGAvGRgaKJfZOu7U9l0BhkTkQgSL6c4zT9oDxC4h11fPGxiawWhHtCg2IUhCpeWaGMSJNg5uwognsMbiYGttmJ6bGlRfOoiZH3MbMgnSrLzB/xzYhArh7F9zexjQ1bL4vB4ElsuXhjJsozVuOivIlPtlr+8LguRavk6PaMr6l5ZA0oaPqeplCmY0vrBbnL0PbuhdzHExdDP6UHHpabmDXd/V7+Ta7BxnD18wVaw== 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; bh=zTBvZOPxHEE8aofOlnmTSC86M5v9HQxJqEDu78H61Us=; b=YL5AH+hLhs5UWe8+m/QlTSyWa8Ahm5SdJoeWvE6NDe7M0IRet2I9XfI8Z51CtpRzGturZcnJTA/oGIAgbSIsjt2fC4NRB1qWw7NLulIabqrsnkVtKPwEezRS738L/ynf0BUrGPv0t3H/RGAFFsNHOQJCoT0lUHeQ6V2hTe3IJ/3w0iJt8SiI7YqyTV0oq5CmvaEXUZFvswNxXFOcnTAYZ3ZSXO8xBlvknHBFrvslNL9JY+amgLSAlylr4fMEX/+rtVPsn5FGNfqo45pYwTZFt5GCMg3iZhW9ajEJojA0IpN/KxH+7ddRYsTAA/A0q426vWy0Bsd73iSoYmBDKVYPrA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zTBvZOPxHEE8aofOlnmTSC86M5v9HQxJqEDu78H61Us=; b=TlaHekbh3nh1mo7kw2hDqYlXM6dTY3IhPO1rXqDIorFybPMIB0qnBmGA230vdH0Z2n0USTff52jQcC7yJsMKYNn4bMf3Uosm4TLbFoMGBt34BjeRpNIODIXsa1vqBxRal/Jc7MAAaTp/bY8XvVTTqvn8ZxxLaidPgOa8LzDdbmw= Received: from BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by BN6PR11MB1396.namprd11.prod.outlook.com (2603:10b6:404:4a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19; Mon, 6 Sep 2021 09:05:01 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::882:4e40:b0e4:239e]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::882:4e40:b0e4:239e%6]) with mapi id 15.20.4478.025; Mon, 6 Sep 2021 09:05:01 +0000 From: "Chiu, Chasel" To: Benjamin Doron , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" Subject: Re: [edk2-platforms][PATCH v4 2/2] KabylakeOpenBoardPkg/AspireVn7Dash572G/DxeBoardInitLib: Fix byte shift Thread-Topic: [edk2-platforms][PATCH v4 2/2] KabylakeOpenBoardPkg/AspireVn7Dash572G/DxeBoardInitLib: Fix byte shift Thread-Index: AQHXosrFEuZOyuXUy0G8m2OfSh/J66uWtu9Q Date: Mon, 6 Sep 2021 09:05:01 +0000 Message-ID: References: <20210906025530.279219-1-benjamin.doron00@gmail.com> <20210906025530.279219-2-benjamin.doron00@gmail.com> In-Reply-To: <20210906025530.279219-2-benjamin.doron00@gmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 87f803c6-31ec-4ee9-9b42-08d9711568f8 x-ms-traffictypediagnostic: BN6PR11MB1396: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2toAv8Iz0wP4cchKm6G91BXp1TxPz0daZP2pHg4CNrXZmPw7yBKDCQXLR2OJhPygehw/jEzyKV/mX7hNaV0KMldcBqt/BpO2iZ98ojiPYfO3HNv3pl1Cbax/uKqtRAh3RRPpUnXbDKC/jHQoVmQZF7TiN4utm+iSb1e8I4s2mfgcabmyEYGAUQSJQC407uavMy8sOTCRrdFC4kbRupRhVAoHU1RctcLnI7Iud7+tHa4IMA6x9CZOiX4R5PZtFAvmNEwogbtA4LP8nzdq/lGrS7nPJqtW1RMR2SHo15oO8jxX8CFgubsnFVMGHfX02oKVXBKnJ6n9alQdrdxfGaWrWCDc0+EWZJOsIHPzKKueept8hRvoTW8nf8RYAjDdFYRj484W+KipbKWxV4TEuXYK9P7z+a5xXHnQ1IXxYqjx1eNdY8XtMloLgqbfHnsoqgAQD2P8SsSSNiau/p2/cBbC/oX5WyLK2Snu/gQE1hTpHTNRpqFqfPqxQYhATMB9tg2KsryvLURI3AApIJKL3Y3Q1cOrMsWnqkwl2CTwegjthbkHGpCKniV84iC2BR4eAL47be9m028jv+44MPDXawdBbUzKAmJjv3nXQ0i8x6RZnMZXHdLng9Lu7HCiJtYDmMVL4sPOCNfSl8BmBSRXF7/djBRtOwcAoX5Su2zuKjnN/Ts/vjSJhDHXzfH2imq35jd3vDGaft6OPk2bIYjkN2r/iA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5483.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(136003)(396003)(376002)(366004)(39860400002)(55016002)(26005)(53546011)(6506007)(33656002)(66556008)(122000001)(64756008)(38100700002)(66946007)(4326008)(478600001)(83380400001)(38070700005)(186003)(316002)(52536014)(110136005)(8936002)(66446008)(7696005)(66476007)(8676002)(71200400001)(9686003)(2906002)(86362001)(76116006)(107886003)(5660300002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DC9GLhqtaPgCitiGoz9bVbtDPugoVRgf/K/xskF/05qJ/bcnQZAdL2EO9OBh?= =?us-ascii?Q?Ya7MX9rKPKG4FRsQcv0S3R9ReydLlPrcmTlaFQ8a7Q0ewm/0r8y3BSz6l1EA?= =?us-ascii?Q?D9Mv+c7Ogv6l/r5KS3TNA5OV+Mlhr2wjifLIbVOoVfJ93O1x9vGnvrONpe9/?= =?us-ascii?Q?kUvNyINAJ3KgnXCDsh/4viUhg9/qzrDN00SOLbNK2yD0ogkcRctjzI9RU2fa?= =?us-ascii?Q?4E50UordAo4wkQVJCv+z6vYh1+YJF03hpuumVeVa9lwFM5lU0C/sMHHt91ea?= =?us-ascii?Q?h7hhtUNWlHMJsVd2bXH9w0aXea2UhojkvHYmY6kpvMYy8KJJ7SV+SbheepCp?= =?us-ascii?Q?lt0PUf6UIy830KV0cGswDyD9ji82WNRDAqVgPMwAEQv6yQb5WKy+2PuX/EjX?= =?us-ascii?Q?ZTdD4T8aC3wq1SZJ3PNLbhEJ4s9OXMbejtk1ka6Kikmb1fiNxnj6dGfPcDlH?= =?us-ascii?Q?cOmC4L1K3ri2UIYK7ThGHpn0Y/ScE11YZRXw3k/nXz3+7GMMk8byaQ1d8k31?= =?us-ascii?Q?0fHWtujCz0oiua7HlFNKXXvt6jNiYrMaDDMmPf3qUUXM1J8aimz+xAtGBPM6?= =?us-ascii?Q?nw9Lk58mpgO8xsQrDY6KgoYe5dSqXn9fiFulOWe5ZiZSWwRPYRcADwzAE3B+?= =?us-ascii?Q?V7TntQA4rVRBoPnGBTvPfLGRpnzvXUgWQOpbFJem1su8musPGgNKaULKMKn/?= =?us-ascii?Q?NCHhhaSLTM//xfxTTJEbPw8ureiW72lLGWUhNLgpn9O+VXnf/qZoq3UGwOjH?= =?us-ascii?Q?KJ2wzHRxO4Jc0BpFQ3brRLoi6f9WU8pCfXU9xJvkVDL+bRld5esMUyTh6hDm?= =?us-ascii?Q?EdaUbjXfveLqmnY9swJcyxcRFyol0DjFWB/5YAl/322k8oxZoN+vCt4Pkj0o?= =?us-ascii?Q?MubMSzVkBLv8JWvzs8h2xQ1BPqS835olK1pmIdWT7PRPY2kr/gGxjWH1TWHU?= =?us-ascii?Q?PITZZYOir3DIz9pL9REKcMSmvtZB9qNJZeV3EVnvaJrK/fkJdteGo9Fh2/o0?= =?us-ascii?Q?kLtexScSb8GVv1gkAYIDZd1DoMrZFTh7ZLd693CRAN/QLqy0asPcTe/yOooZ?= =?us-ascii?Q?D2KgwEkxixnP+n7t/Pi76G8IOlBUj7qpyR/0raxEhtb2Pbs6HsCzvhJvKiaN?= =?us-ascii?Q?Bc52mzky+0a7aV+ENsCDjCC/CU0p45hwJ2H4JV8yY4hC2W1qhrWSvP8PtTLf?= =?us-ascii?Q?8ACXveoWgPQEbQsK8KKF3wkbsjiwLuiKdt3h8KlHJcv3EDbDndo4/UsXLoSY?= =?us-ascii?Q?nYQa5pPv0DTl2V0CeKhiE++3kddWTof/WRkDKeFnXt8B+GIipCRbxDtrMHoT?= =?us-ascii?Q?80Pd52nkgyLCc5hRMJIWMjfQ?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87f803c6-31ec-4ee9-9b42-08d9711568f8 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Sep 2021 09:05:01.7178 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ln9srEp+YARlIf1PowWIk7k4p/zAmhZI5G40sy1jSU9v9sExYyIJQI1V8IByGjjNPIsU6MuJVu20/4hl7v3ajg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1396 Return-Path: chasel.chiu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Chasel Chiu > -----Original Message----- > From: Benjamin Doron > Sent: Monday, September 6, 2021 10:56 AM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Desimone, Nathaniel L > > Subject: [edk2-platforms][PATCH v4 2/2] > KabylakeOpenBoardPkg/AspireVn7Dash572G/DxeBoardInitLib: Fix byte shift >=20 > Since the time is sent to the EC byte-by-byte, perform shift by a byte mu= ltiple of > bits. Also update some comments. >=20 > Cc: Chasel Chiu > Cc: Nate DeSimone > Signed-off-by: Benjamin Doron > --- >=20 > Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Library/BoardInitLi > b/DxeBoardInitLib.c | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) >=20 > diff --git > a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Library/BoardInit > Lib/DxeBoardInitLib.c > b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Library/BoardInit > Lib/DxeBoardInitLib.c > index 906b2d265092..4bce51886e3a 100644 > --- > a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Library/BoardInit > Lib/DxeBoardInitLib.c > +++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Library/Boar > +++ dInitLib/DxeBoardInitLib.c > @@ -24,7 +24,7 @@ EcSendTime ( > { EFI_STATUS Status; EFI_TIME EfiTime;- // TODO: Confirm this i= s really > INTN and not UINTN+ // Time could be negative (before 2016) INTN > EcTime; UINT8 EcTimeByte; INTN Index;@@ -36,7 +36,7 @@ > EcSendTime ( > return; } - // Time since year of release?+ // Time since year o= f release. > Note that "century" is ignored. EcTime =3D ((EfiTime.Year << 26) + > (EfiTime.Month << 22) + (EfiTime.Day << 17) + (EfiTime.Hour << 1= 2) + > (EfiTime.Minute << 6) + (EfiTime.Second) /* 16 years */@@ -45,7 = +45,8 > @@ EcSendTime ( > DEBUG ((DEBUG_INFO, "EC: reporting present time 0x%x\n", EcTime)); > SendEcCommand (0xE0); for (Index =3D 0; Index < 4; Index++) {- EcTim= eByte =3D > EcTime >> Index;+ // Shift bytes+ EcTimeByte =3D EcTime >> Index*8;= DEBUG > ((DEBUG_INFO, "EC: Sending 0x%x (iteration %d)\n", EcTimeByte, Index)); > SendEcData (EcTimeByte); }@@ -61,13 +62,14 @@ EcSendTime ( > **/ VOID-EcInit (+EcRequestsTime ( VOID ) { UINT8 Dat; = - /* Vendor's > UEFI modules "notify" this protocol in RtKbcDriver */+ /* This is execut= ed as > protocol notify in vendor's RtKbcDriver when *CommonService+ * protocol= is > installed. Effectively, this code could execute from the entrypoint */ > EcCmd90Read (0x79, &Dat); if (Dat & BIT0) { EcSendTime ();@@ -86,7 = +88,7 > @@ BoardInitAfterPciEnumeration ( > VOID ) {- EcInit ();+ EcRequestsTime (); return EFI_SUCCESS; } -= - > 2.31.1