From nobody Sun Nov 24 17:06:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+84294+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84294+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1638519146; cv=none; d=zohomail.com; s=zohoarc; b=Ic1x5D476FCYKRv/4hZmFIEMpHxr9RNQ0TC54CABIo8M2tGYp4CmPlBpciyjmbUU7+JYu03sY4P3/9esoEuL4I3YmXCy5rvBJY16VlY9GzoJQ2WjaAH7enGCwylq8z/hm8oGUIi9ZZ64fyjl4uMDfVesHgYrDr6jjcbT7kIOIhY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638519146; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Q3qJVEvV9x0L1mZULAG/+fLPQivdeWh4BwnUOYlvi6E=; b=hpj27kJ/zdRqA4qHVtYx3qOuPGmBhXpfP62AUTo7U/E5icwmIPeggAzQ5GNE3EbXX1t42LUEJkVxv5bb9PH9YRIszQT/f3DQEBxY252u67yVt2IncIvDFO35G4lI0xPwEhuPZuwjv3FtbkFEEpl4RIorolJgeOuRTSuJgbFRGv0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84294+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1638519146801290.47420588071657; Fri, 3 Dec 2021 00:12:26 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id NDIDYY1788612xn9a4tUOxmb; Fri, 03 Dec 2021 00:12:26 -0800 X-Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mx.groups.io with SMTP id smtpd.web10.9140.1638519145727640544 for ; Fri, 03 Dec 2021 00:12:25 -0800 X-Received: by mail-pf1-f176.google.com with SMTP id n26so2175466pff.3 for ; Fri, 03 Dec 2021 00:12:25 -0800 (PST) X-Gm-Message-State: e8J9pDTF6XUZqxVYnX5sHlkbx1787277AA= X-Google-Smtp-Source: ABdhPJyLAq27jzoNJ0Cu7rJoYs7moLjGVM6W3RpW+WrJlmE60+p/FOOThDU5iCFWrB/yK8KTK/qV0w== X-Received: by 2002:a63:eb4a:: with SMTP id b10mr3496557pgk.78.1638519145048; Fri, 03 Dec 2021 00:12:25 -0800 (PST) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id k18sm1624484pgb.70.2021.12.03.00.12.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 00:12:24 -0800 (PST) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [edk2-devel] [PATCH v2 1/5] [edk2-platforms] Silicon/SynQuacerI2cDxe: Wait for bus busy Date: Fri, 3 Dec 2021 17:12:22 +0900 Message-Id: <163851914200.1636051.8878791399296298132.stgit@localhost> In-Reply-To: <163851913341.1636051.3357297397950801289.stgit@localhost> References: <163851913341.1636051.3357297397950801289.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,masami.hiramatsu@linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1638519146; bh=cJC03jski1nZRnOxp+/j4+Xo0lXFT45I1mSwXf12d9c=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=YwhEpSVvk/pN2n5+4uX5gkTVqyX5FS7xdPdeMirJuB8w354c+8MeGzVWdGVqO+yaIEi eqNXwxHKCy4KXIfueC8WQak84IIMiImo6tVjdyY2ybsgdybFSa5h60FyEgzPDWU5r3urW 69cpsORJMGWy3xniPlGeEwYI97HETxzqVfE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1638519148190100002 If an EFI application frequently repeats SetTime and GetTime, the I2C bus can be busy and failed to start. To fix this issue, add waiting loop for the bus busy status. (Usually, it is enough to read 3 times for checking, but for safety this sets 10 for timeout.) This also clean up the code path a bit so that it is easy to understand what should do on each combinations of BSR.BB and BCR.MSS. Signed-off-by: Masami Hiramatsu Reported-by: Kazuhiko Sakamoto --- Changes in v2: - Rename WAIT_FOR_BUS_BUSY_TIMEOUT to WAIT_FOR_BUS_READY_TIMEOUT - Fix indentation. --- .../Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c | 38 ++++++++++++++--= ---- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI= 2cDxe.c b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cD= xe.c index 31f6e3072f..918a9e7752 100644 --- a/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c +++ b/Silicon/Socionext/SynQuacer/Drivers/SynQuacerI2cDxe/SynQuacerI2cDxe.c @@ -16,6 +16,8 @@ // #define WAIT_FOR_INTERRUPT_TIMEOUT 50000 =20 +#define WAIT_FOR_BUS_READY_TIMEOUT 10 + /** Set the frequency for the I2C clock line. =20 @@ -152,6 +154,7 @@ SynQuacerI2cMasterStart ( IN EFI_I2C_OPERATION *Op ) { + UINTN Timeout =3D WAIT_FOR_BUS_READY_TIMEOUT; UINT8 Bsr; UINT8 Bcr; =20 @@ -167,24 +170,35 @@ SynQuacerI2cMasterStart ( Bsr =3D MmioRead8 (I2c->MmioBase + F_I2C_REG_BSR); Bcr =3D MmioRead8 (I2c->MmioBase + F_I2C_REG_BCR); =20 - if ((Bsr & F_I2C_BSR_BB) && !(Bcr & F_I2C_BCR_MSS)) { - DEBUG ((DEBUG_INFO, "%a: bus is busy\n", __FUNCTION__)); - return EFI_ALREADY_STARTED; - } + if (!(Bcr & F_I2C_BCR_MSS)) { =20 - if (Bsr & F_I2C_BSR_BB) { // Bus is busy - DEBUG ((DEBUG_INFO, "%a: Continuous Start\n", __FUNCTION__)); - MmioWrite8 (I2c->MmioBase + F_I2C_REG_BCR, Bcr | F_I2C_BCR_SCC); - } else { - if (Bcr & F_I2C_BCR_MSS) { - DEBUG ((DEBUG_WARN, - "%a: is not in master mode\n", __FUNCTION__)); - return EFI_DEVICE_ERROR; + if (Bsr & F_I2C_BSR_BB) { // Bus is busy + do { + Bsr =3D MmioRead8 (I2c->MmioBase + F_I2C_REG_BSR); + } while (Timeout-- && (Bsr & F_I2C_BSR_BB)); + + if (Bsr & F_I2C_BSR_BB) { + DEBUG ((DEBUG_INFO, "%a: bus is busy\n", __FUNCTION__)); + return EFI_ALREADY_STARTED; + } } + DEBUG ((DEBUG_INFO, "%a: Start Condition\n", __FUNCTION__)); MmioWrite8 (I2c->MmioBase + F_I2C_REG_BCR, Bcr | F_I2C_BCR_MSS | F_I2C_BCR_INTE | F_I2C_BCR_BEIE); + + } else { // F_I2C_BCR_MSS is set + + if (!(Bsr & F_I2C_BSR_BB)) { + DEBUG ((DEBUG_WARN, + "%a: is not in master mode\n", __FUNCTION__)); + return EFI_DEVICE_ERROR; + } + + DEBUG ((DEBUG_INFO, "%a: Continuous Start\n", __FUNCTION__)); + MmioWrite8 (I2c->MmioBase + F_I2C_REG_BCR, Bcr | F_I2C_BCR_SCC); } + return EFI_SUCCESS; } =20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84294): https://edk2.groups.io/g/devel/message/84294 Mute This Topic: https://groups.io/mt/87472864/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Nov 24 17:06:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+84295+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84295+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1638519155; cv=none; d=zohomail.com; s=zohoarc; b=VCWjDzPoAfeua2TEpqWzuNcOJMs15m+PpDWguRxRxRsSW1sXNwYRQ8VeS27YIQdt0e7+vs/M9XG+2v8+jy+DcPkSb7uZ0pTKkE+xI/4RjsSi7acOHXZDXCWFjzaZ+uyhFglPL5EBqhyDXV1MO5XxO1nSqaqvgZAR48wQmJfcqEo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638519155; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=LHEt1uFjYpFGNijwLF9p/43gOGFL7BCZPzWNqGGOP10=; b=gz/eWW+rO7OEC0sAQEJlyFC08XwOraYMAreAI+Cr/cy3o8TP7N0I4/a8h5YPhx5CtxLJEZdzKUdIlHehoA9NCV4CaqwU10Fh+11Wjk53ywmWEZraXGAZWCmQNl8KZI7QxiP+s42aPrV0Qggt6UtstJlDCg7KH9T5seef4Zzi0+s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84295+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1638519155176355.49976474799644; Fri, 3 Dec 2021 00:12:35 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id OYi9YY1788612xfw85qjjxb0; Fri, 03 Dec 2021 00:12:34 -0800 X-Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by mx.groups.io with SMTP id smtpd.web12.9303.1638519154092870810 for ; Fri, 03 Dec 2021 00:12:34 -0800 X-Received: by mail-pg1-f177.google.com with SMTP id s37so2291185pga.9 for ; Fri, 03 Dec 2021 00:12:34 -0800 (PST) X-Gm-Message-State: RjbOUQM4RDmPK3ad57WUgsIWx1787277AA= X-Google-Smtp-Source: ABdhPJyNgxjt26aX+NC2qD4/FLN0YOiABDB04Q33eItKnfMh3pyZDicYoBpyF73sOGaooi3f4ZrYFA== X-Received: by 2002:a63:b0e:: with SMTP id 14mr3521523pgl.229.1638519153478; Fri, 03 Dec 2021 00:12:33 -0800 (PST) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id 63sm2246362pfz.119.2021.12.03.00.12.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 00:12:33 -0800 (PST) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [edk2-devel] [PATCH v2 2/5] [edk2-platforms] Silicon/Socionext/SynQuacer: Fix GenericWatchdog interrupt number Date: Fri, 3 Dec 2021 17:12:30 +0900 Message-Id: <163851915043.1636051.5939257196491747411.stgit@localhost> In-Reply-To: <163851913341.1636051.3357297397950801289.stgit@localhost> References: <163851913341.1636051.3357297397950801289.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,masami.hiramatsu@linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1638519154; bh=mtlc3MGYrJiqjTwZfNfss91xD5PwuLzTSRIcSCoHFTg=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=lCkK6c+5rJWsnsv0XgCnIunrB4jfXO2Bwgxqh3wvdZvSoYyIATuhe60yTgOvEMfPC+j Dru91wsOqFL0+s+5LjXg9FB/TrPCxnq9TUrG3IBZ2+j0IO33m49Odx/yKSQAmdr+Cpa3n iQYw9KY+Ex/ezAeC80RDurhMYPvp9hMavt0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1638519155547100002 This fixes Socionext DeveloperBox GenericWatchdog interrupt number to 93 instead of 94. Since the 93 is the default interrupt number defined in ArmPkg/ArmPkg.dec, this doesn't redefine gArmTokenSpaceGuid.PcdGenericWatchdogEl2IntrNum. Signed-off-by: Masami Hiramatsu Reported-by: Kazuhiko Sakamoto --- Changes in v2: - Just focus on using PcdGenericWatchdogEl2IntrNum in Gtdt.aslc --- .../Socionext/SynQuacer/AcpiTables/AcpiTables.inf | 1 + Silicon/Socionext/SynQuacer/AcpiTables/Gtdt.aslc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf b/Silico= n/Socionext/SynQuacer/AcpiTables/AcpiTables.inf index 96efb2d38e..886777a0fa 100644 --- a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf +++ b/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf @@ -50,6 +50,7 @@ =20 gArmTokenSpaceGuid.PcdGenericWatchdogControlBase gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase + gArmTokenSpaceGuid.PcdGenericWatchdogEl2IntrNum =20 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/Gtdt.aslc b/Silicon/Soc= ionext/SynQuacer/AcpiTables/Gtdt.aslc index c811fc5a0c..e7ab88b0a8 100644 --- a/Silicon/Socionext/SynQuacer/AcpiTables/Gtdt.aslc +++ b/Silicon/Socionext/SynQuacer/AcpiTables/Gtdt.aslc @@ -76,7 +76,7 @@ EFI_ACPI_6_0_GENERIC_TIMER_DESCRIPTION_TABLES Gtdt =3D { EFI_ACPI_6_0_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT ( FixedPcdGet32 (PcdGenericWatchdogRefreshBase), FixedPcdGet32 (PcdGenericWatchdogControlBase), - 94, + FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum), 0), }; =20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84295): https://edk2.groups.io/g/devel/message/84295 Mute This Topic: https://groups.io/mt/87472866/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Nov 24 17:06:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+84296+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84296+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1638519163; cv=none; d=zohomail.com; s=zohoarc; b=kvVHbXHL1wkhR35Tk7/+H3kETRoS3pInxPDu//dzg2GrgDvTt7ZhrsT3/4+lcrg25cN2v246urpGl2n8IdbDKbsdOJsdtXtdkqQvbW30mqGvPqhj7zbIR/d/xWdTa1pADLWZE/Os8Ip0f8E/LlU9mlvdZeFu7ymFTbl690twhB8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638519163; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=fQm6MzpOGDw/q9DtmdRIFHpQmTR0TMIBKvwqaZYjajM=; b=FZ3iSmMrpoe/bu8D8XIGuw8cM5TvaNqr+Q2MMLB/uj/Ym2qAMSsNXcpeh5Uh95/y4WQ7ft2pr9YohNm5jKjO/UA+Qe2s9xFTPz4BXPhD9rETt65sYYa6Qs16A5gbXpomuSfV8nGZqdPStKHV4ZZxSQiqxWqlFPlujJaEBlN+VFk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84296+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1638519163165340.0524433920375; Fri, 3 Dec 2021 00:12:43 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id jQJUYY1788612xCMTZR0byC8; Fri, 03 Dec 2021 00:12:42 -0800 X-Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by mx.groups.io with SMTP id smtpd.web12.9306.1638519162252287790 for ; Fri, 03 Dec 2021 00:12:42 -0800 X-Received: by mail-pg1-f177.google.com with SMTP id r138so2276243pgr.13 for ; Fri, 03 Dec 2021 00:12:42 -0800 (PST) X-Gm-Message-State: GRsIX7eT7gC1HZKoxO5gE3Lwx1787277AA= X-Google-Smtp-Source: ABdhPJyYhNJMTjOQ02V5i7TMXYKuTKYaFrrnvcCkaqRmdoJVFkRS2Y1kqt6+VwuoJFtqe/kwbUwGbA== X-Received: by 2002:a63:654:: with SMTP id 81mr3403484pgg.218.1638519161735; Fri, 03 Dec 2021 00:12:41 -0800 (PST) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id f185sm2202481pfg.39.2021.12.03.00.12.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 00:12:41 -0800 (PST) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [edk2-devel] [PATCH v2 3/5] [edk2-platforms] Silicon/Socionext/SynQuacer: Fix to read watchdog parameters with correct width Date: Fri, 3 Dec 2021 17:12:39 +0900 Message-Id: <163851915888.1636051.2034037309423270728.stgit@localhost> In-Reply-To: <163851913341.1636051.3357297397950801289.stgit@localhost> References: <163851913341.1636051.3357297397950801289.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,masami.hiramatsu@linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1638519162; bh=dQHHdswqSFNW8DsH0VY/jWQjxWSe+A1XfnRduHSY+FQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=WA1H4NQ/upsI9xIErC/85s1YNgyc3jkhaSjScR4WoefxNpyLGjJewBtKP9ntc4jZe1F Jx2ZQJu2pvTVmcGcho1norG8fOQZz7F1Vt/3xFUUX4OUBTZYpd8idtc4BwS1S4msH7BZF 3PJXgXBMoOjrE4L4PXt4RBtjZmzBG431IcQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1638519164645100002 Since the RefreshFramePhysicalAddress and WatchdogControlFramePhysicalAddress fields are defined as UINT64 in EFI_ACPI_6_0_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE data structure, and both of gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase and gArmTokenSpaceGuid.PcdGenericWatchdogControlBase are defined as UINT64, FixedPcdGet64() should be used for reading and setting those parameters. Signed-off-by: Masami Hiramatsu --- Silicon/Socionext/SynQuacer/AcpiTables/Gtdt.aslc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/Gtdt.aslc b/Silicon/Soc= ionext/SynQuacer/AcpiTables/Gtdt.aslc index e7ab88b0a8..b045a49efa 100644 --- a/Silicon/Socionext/SynQuacer/AcpiTables/Gtdt.aslc +++ b/Silicon/Socionext/SynQuacer/AcpiTables/Gtdt.aslc @@ -74,8 +74,8 @@ EFI_ACPI_6_0_GENERIC_TIMER_DESCRIPTION_TABLES Gtdt =3D { // UINT32 GTxCommonFlags }, EFI_ACPI_6_0_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT ( - FixedPcdGet32 (PcdGenericWatchdogRefreshBase), - FixedPcdGet32 (PcdGenericWatchdogControlBase), + FixedPcdGet64 (PcdGenericWatchdogRefreshBase), + FixedPcdGet64 (PcdGenericWatchdogControlBase), FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum), 0), }; -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84296): https://edk2.groups.io/g/devel/message/84296 Mute This Topic: https://groups.io/mt/87472867/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Nov 24 17:06:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+84297+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84297+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1638519171; cv=none; d=zohomail.com; s=zohoarc; b=l8Sj4EEOMzK0uHZ/L6oD830/sBPURJuZPFMX3PB3Sstbe1OrZH6Rv75XWXmaJeMdgWC+u3WnfbefWm5T7Mv6kyM/Nskh7oDdhWv0xx4PF1fI1IWU5eaz4sUctbkGFqWSCUl+zOsSuiHjy+o69Q3ZsvZq/GIIRxCe/jF66hMC85E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638519171; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=EqyXTD0hV+G9FPQQHT1lIOIOT5vmRFYyuVCTvXsytyU=; b=BCvwDpAHMwTmFqHeFH2cYOyWuNWL9WZd90ZlD7xL2UbKYG7l/s5OyOcpSvqgNXiJZJx3UFQlQelyIw+GujmeA38GPNfomumpLNo0DBBnhMhGi+iUXeTxEz+Wc+OjruK3oUltH6qBP1hgaSriD4FiFtzxfOus/9V20h6h1dlIims= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84297+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1638519171604415.9055839594232; Fri, 3 Dec 2021 00:12:51 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 77QAYY1788612x0Oj1RdKMRs; Fri, 03 Dec 2021 00:12:51 -0800 X-Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mx.groups.io with SMTP id smtpd.web12.9307.1638519170654954834 for ; Fri, 03 Dec 2021 00:12:50 -0800 X-Received: by mail-pl1-f178.google.com with SMTP id o14so1575321plg.5 for ; Fri, 03 Dec 2021 00:12:50 -0800 (PST) X-Gm-Message-State: qsguMQtb7agIGZRgo5ElXmAMx1787277AA= X-Google-Smtp-Source: ABdhPJznwuwWMJYvynUIna4B7VSNtRga+bvbZpmkyeEl1hzN9tZolTuBeY/rd50YRylLuLivur2/Qw== X-Received: by 2002:a17:90a:46c9:: with SMTP id x9mr12444396pjg.183.1638519170202; Fri, 03 Dec 2021 00:12:50 -0800 (PST) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id m10sm1648094pgv.75.2021.12.03.00.12.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 00:12:49 -0800 (PST) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [edk2-devel] [PATCH v2 4/5] [edk2-platforms] Silicon/SynQuacerPlatformFlashAccessLib: Fix the number of erase blocks Date: Fri, 3 Dec 2021 17:12:47 +0900 Message-Id: <163851916709.1636051.9018442736759044218.stgit@localhost> In-Reply-To: <163851913341.1636051.3357297397950801289.stgit@localhost> References: <163851913341.1636051.3357297397950801289.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,masami.hiramatsu@linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1638519171; bh=6lp0JIm5+mX7h2hYuNAaJ/mUaRk3Xgr8KymqvXNx21E=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=p7vIpR61slCzal00/BFu/KYhBcmFKa0s/fRoVH+zx57DYNFJCMl2dS3H7eHjx5lq0z/ seS26f5uRJhzUiLRRKIZqrg4YWCsTxaxo0F45m0jjdVLl7JuQZVMY3asE6TO1ikQBk63G K5OFsVyOmAVTO0LOti3YTyanoCmIVz/rzdU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1638519171884100001 Fix the number of erase blocks by rounding up the result. The erase blocks must include the last block covered by the length bytes. Signed-off-by: Masami Hiramatsu Reported-by: Kazuhiko Sakamoto Reviewed-by: Leif Lindholm --- .../SynQuacerPlatformFlashAccessLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAcce= ssLib/SynQuacerPlatformFlashAccessLib.c b/Silicon/Socionext/SynQuacer/Libra= ry/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c index bded74dc4f..ad4021cf59 100644 --- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/S= ynQuacerPlatformFlashAccessLib.c +++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/S= ynQuacerPlatformFlashAccessLib.c @@ -283,7 +283,7 @@ PerformFlashWriteWithProgress ( DEBUG ((DEBUG_INFO, "%a: erasing 0x%llx bytes at address %llx (LBA 0x%lx= )\n", __FUNCTION__, Length, FlashAddress, Lba)); =20 - Status =3D Fvb->EraseBlocks (Fvb, Lba, Length / BlockSize, + Status =3D Fvb->EraseBlocks (Fvb, Lba, (Length + BlockSize - 1) / BlockS= ize, EFI_LBA_LIST_TERMINATOR); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a: Fvb->EraseBlocks () failed - %r\n", -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84297): https://edk2.groups.io/g/devel/message/84297 Mute This Topic: https://groups.io/mt/87472869/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Nov 24 17:06:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+84298+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84298+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1638519180; cv=none; d=zohomail.com; s=zohoarc; b=Qdw05SfxOM+oLRoLmzq0mUXrUzthDL6oXcFrC/LBMq3nZ0ejvrOB9zHiWLDJws4EGXHdUfy3f6rGleCZHgpFar7wsAkDFRZPrTqP3b36spAVxD8kTpJSt4l+KvjHoEJLSBwm1t1lEPOFQwcYHq+NmvDoKW4F27DaHzN4AyfOyM0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638519180; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Y/QDCAYWdwVCnqcGTF7nTuOHVKGfps09iwbATH7FGrs=; b=ABjRGBU/vbPunrSjx8BqA1jIdaJzuk5xPSVWDNw4hxfPuE7y6b5qylXu3qMV56NkTqQfWDTpVB5449vmJmXNgrFOMhpMMp68HQkeAr/XmrAwr50gekowvh+GmU0ug8lbX8AkbO2eonkUTrZzx0oAUxnUy6pb+zOzHkn0typMmNQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84298+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1638519180083238.20392883337468; Fri, 3 Dec 2021 00:13:00 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id VcNYYY1788612xpMVT5Ji9wG; Fri, 03 Dec 2021 00:12:59 -0800 X-Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mx.groups.io with SMTP id smtpd.web12.9308.1638519179178782612 for ; Fri, 03 Dec 2021 00:12:59 -0800 X-Received: by mail-pj1-f52.google.com with SMTP id gx15-20020a17090b124f00b001a695f3734aso1883013pjb.0 for ; Fri, 03 Dec 2021 00:12:59 -0800 (PST) X-Gm-Message-State: BcaJ3BNOmJmD72cwdpdANZ6qx1787277AA= X-Google-Smtp-Source: ABdhPJyM+B6VWirZrw6FMHu3TOFdGalmHv/H64M6q10ZrTC6q0WVmR0UJPuZdvWS6AJw045s5zxv5g== X-Received: by 2002:a17:90a:6886:: with SMTP id a6mr12421009pjd.78.1638519178736; Fri, 03 Dec 2021 00:12:58 -0800 (PST) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id o124sm2142602pfb.177.2021.12.03.00.12.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 00:12:58 -0800 (PST) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [edk2-devel] [PATCH v2 5/5] [edk2-platforms] Silicon/SynQuacer: add DBG2 ACPI table Date: Fri, 3 Dec 2021 17:12:55 +0900 Message-Id: <163851917557.1636051.61892798163129130.stgit@localhost> In-Reply-To: <163851913341.1636051.3357297397950801289.stgit@localhost> References: <163851913341.1636051.3357297397950801289.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,masami.hiramatsu@linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1638519179; bh=EgIu0MyWEHRdP+j3ALfUiYL49u5SqTC1W7rmRK4uVEk=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=vYm+EN2bpBkjBSgZIsLuifAu4lP1EOTt0dJAaGBcrRJuVdB7j4HlWHfAB8MJCoVK5cT 99lSrP3WkpE2UCuM4g7CNd5Rm7DTZUYEWYnnk/BfI1KeOYB6y3txfI7cKCYmJp3pqvl/n tblqcgCGu+uunZhpf57njvIiQmei5WijJ2I= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1638519180884100002 Add DBG2 table to ACPI tables. The COM1 uart port will be used for OS debug, and it is 16550 compatible. Signed-off-by: Masami Hiramatsu --- Changes in v2: - Move Dbg2.aslc before Dsdt.asl to keep the list alphabetically sorted. - Use EFI_ACPI_6_3_SYSTEM_MEMORY and EFI_ACPI_6_3_BYTE for initializatio= n. --- .../Socionext/SynQuacer/AcpiTables/AcpiTables.inf | 1=20 Silicon/Socionext/SynQuacer/AcpiTables/Dbg2.aslc | 70 ++++++++++++++++= ++++ 2 files changed, 71 insertions(+) create mode 100644 Silicon/Socionext/SynQuacer/AcpiTables/Dbg2.aslc diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf b/Silico= n/Socionext/SynQuacer/AcpiTables/AcpiTables.inf index 886777a0fa..e77d7a3056 100644 --- a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf +++ b/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf @@ -19,6 +19,7 @@ [Sources] AcpiTables.h AcpiSsdtRootPci.asl + Dbg2.aslc Dsdt.asl Fadt.aslc Gtdt.aslc diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/Dbg2.aslc b/Silicon/Soc= ionext/SynQuacer/AcpiTables/Dbg2.aslc new file mode 100644 index 0000000000..89c9dbd998 --- /dev/null +++ b/Silicon/Socionext/SynQuacer/AcpiTables/Dbg2.aslc @@ -0,0 +1,70 @@ +/** @file +* Debug Port Table (DBG2) +* +* Copyright (c) 2020,2021 Linaro Ltd. All rights reserved. +* +* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ +#include +#include +#include +#include +#include + +#include "AcpiTables.h" + +#pragma pack(1) + +#define SYNQUACER_UART1_STR { '\\', '_', 'S', 'B', '.', 'C', 'O', 'M', '1'= , 0x00 } +#define SQ_GAS32(Address) { EFI_ACPI_6_3_SYSTEM_MEMORY, 32, 0, EFI_ACPI_6_= 3_BYTE, Address } + +typedef struct { + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT Dbg2Device; + EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE BaseAddressRegister; + UINT32 AddressSize; + UINT8 NameSpaceString[10]; +} DBG2_DEBUG_DEVICE_INFORMATION; + +typedef struct { + EFI_ACPI_DEBUG_PORT_2_DESCRIPTION_TABLE Description; + DBG2_DEBUG_DEVICE_INFORMATION Dbg2DeviceInfo; +} DBG2_TABLE; + + +STATIC DBG2_TABLE Dbg2 =3D { + { + __ACPI_HEADER ( + EFI_ACPI_6_3_DEBUG_PORT_2_TABLE_SIGNATURE, + DBG2_TABLE, + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION + ), + OFFSET_OF (DBG2_TABLE, Dbg2DeviceInfo), + 1 /* NumberOfDebugPorts */ + }, + { + { + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION, + sizeof (DBG2_DEBUG_DEVICE_INFORMATION), + 1, /* NumberofGenericAddressRegist= ers */ + 10, /* NameSpaceStringLength */ + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, NameSpaceString), + 0, /* OemDataLength */ + 0, /* OemDataOffset */ + EFI_ACPI_DBG2_PORT_TYPE_SERIAL, + EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_16550_WITH_GAS, + {EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE}, + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, BaseAddressRegister), + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, AddressSize) + }, + SQ_GAS32 (SYNQUACER_UART1_BASE), /* BaseAddressRegister */ + SYNQUACER_UART1_SIZE, /* AddressSize */ + SYNQUACER_UART1_STR, /* NameSpaceString */ + } +}; + +#pragma pack() + +// Reference the table being generated to prevent the optimizer from remov= ing +// the data structure from the executable +VOID* CONST ReferenceAcpiTable =3D &Dbg2; -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84298): https://edk2.groups.io/g/devel/message/84298 Mute This Topic: https://groups.io/mt/87472870/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-