From nobody Mon Apr 29 03:19:47 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+83376+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+83376+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1636104212; cv=none; d=zohomail.com; s=zohoarc; b=ku9mHq6+HjWCYm8ypyV3R0+f8DqKypOJ5YOzWX60gJGBEzWcUn5dIwr/upF9DGq9ZH9HI/quHgRuArplR7WoqVBJMWda7QuFl8sYAa2Ji9pmMpcZ1fr6T7kaeXUxnYNyNVDg7OKT73sZKGEd83XHRH7BDTJgABO7+rtPfz2aixw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636104212; 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=99pDHLzeFmmLYzONJ+mF5mpYbO8mg6yD4Q9Oh+lnHWU=; b=CKw2jqB03d0DrbJcgKzfclRuUNziY4g648IuWyt7PG5bHO/RFcdJ0n4i4xcl1JmSshvccdasqdsnfsY2QYpwESZBlkG7hvXWxQTIE91hkYYLgLOO1kJUc82M/z3Va0GCaUvVjJJPZQp0U0FXwAvepPqJsA4p0YD4b3gjiLby/1c= 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+83376+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 1636104212623167.53916401626702; Fri, 5 Nov 2021 02:23:32 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id HYHcYY1788612x3kLoJCSZSF; Fri, 05 Nov 2021 02:23:32 -0700 X-Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by mx.groups.io with SMTP id smtpd.web10.3063.1636104211666689586 for ; Fri, 05 Nov 2021 02:23:31 -0700 X-Received: by mail-pg1-f170.google.com with SMTP id t7so7887387pgl.9 for ; Fri, 05 Nov 2021 02:23:31 -0700 (PDT) X-Gm-Message-State: V4b5dgg0MExxqJKXq8mZVBoZx1787277AA= X-Google-Smtp-Source: ABdhPJyMI6nbY+0vzTk94fb75UG9cQAi8n9gg52XXJRW491vp+I3fhyStkea7pcGnnedRkC1f1kwww== X-Received: by 2002:a65:408c:: with SMTP id t12mr24526681pgp.262.1636104211227; Fri, 05 Nov 2021 02:23:31 -0700 (PDT) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id k16sm142617pfu.183.2021.11.05.02.23.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 02:23:30 -0700 (PDT) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [edk2-devel] [PATCH 1/5] [RESEND][edk2-platforms] Silicon/SynQuacerI2cDxe: Wait for bus busy Date: Fri, 5 Nov 2021 18:23:28 +0900 Message-Id: <163610420797.391624.17492204385268340229.stgit@localhost> In-Reply-To: <163610419943.391624.9289897029386201296.stgit@localhost> References: <163610419943.391624.9289897029386201296.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=1636104212; bh=ciU21sUtPCzf7H+HZnOrvegT7TdxCjHT6ehqal/1eig=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=uO1GcVkA2u+s6NkSVoieW8IUEloY9HBCYoITGEEQJlxAJsfukdXBohF05T6xJ0BnG0l cm1lx6aH36faMIubuIBpOLBHtHe5r0zRMajryqKvJiGXlLSjXTDtgnwvHHNPCyZSk7ZaA NmM6b16r3hBfg2dlhjX+YBfBN3X4m7mvnQs= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636104214283100001 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 --- .../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..380eba8059 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_BUSY_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_BUSY_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 (#83376): https://edk2.groups.io/g/devel/message/83376 Mute This Topic: https://groups.io/mt/86836377/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 Mon Apr 29 03:19:47 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+83377+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+83377+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1636104220; cv=none; d=zohomail.com; s=zohoarc; b=JzDMeO2g/SQAt3rZSxXgqDNr+bY4QFezGE+tzOm38qd+BqIdU1bk94Z9nBTzMaxQwryA0jH5jMplxiwKT+eelfkGBAEE3WBBC1QHkn6xb9TZWjFi8AoeU43O8Zds8UenFrG+62DFw6oZgOUvpfjPGNqOrZ8OhotJxgKfqUpXf8s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636104220; 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=AEBdYujhdsAX1aVfD0OpUZAch4DL5x95/JFecjXMY10=; b=EJmJ+GoFme/3YnRhxgnl4m/bTyP5nNClLhBrObyXhaZ8mn/v+TcJUO4lHNu+KRAL2g3OpznNJZCOokCdADucBbrKhZjETqMZ0iBYxsioatDADJMOKoWL1eDCCHPoAqw8MsDGfid8IZ5jq1h961QK2IzGTldMLJFdPAzd8XhjpzU= 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+83377+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 1636104220986512.498390300233; Fri, 5 Nov 2021 02:23:40 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8Q2qYY1788612xKXwdWsyzBp; Fri, 05 Nov 2021 02:23:40 -0700 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.3027.1636104220022311512 for ; Fri, 05 Nov 2021 02:23:40 -0700 X-Received: by mail-pg1-f177.google.com with SMTP id r28so7923960pga.0 for ; Fri, 05 Nov 2021 02:23:39 -0700 (PDT) X-Gm-Message-State: rX2Ltc8m9iXERfNzm3xz53R7x1787277AA= X-Google-Smtp-Source: ABdhPJw5Mhe2ovc8lhd+qwD/u5AQrOLkdV+JqU1IStBK8dmdtZ3NH7TdpNQj6bFBxwrm+TZ35ByyGg== X-Received: by 2002:a62:a50f:0:b0:49e:552a:388 with SMTP id v15-20020a62a50f000000b0049e552a0388mr5093280pfm.10.1636104219606; Fri, 05 Nov 2021 02:23:39 -0700 (PDT) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id f20sm6940894pfc.220.2021.11.05.02.23.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 02:23:39 -0700 (PDT) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [edk2-devel] [PATCH 2/5] [edk2-platforms] Silicon/Socionext/SynQuacer: Fix GenericWatchdog interrupt number Date: Fri, 5 Nov 2021 18:23:36 +0900 Message-Id: <163610421657.391624.390954447741641256.stgit@localhost> In-Reply-To: <163610419943.391624.9289897029386201296.stgit@localhost> References: <163610419943.391624.9289897029386201296.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=1636104220; bh=VrB94fYtbYGF2EQxOQkxGtuaG8No5/k2nUJ67WRpTTs=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=hkVWlKPPxz40n+PJs0P1d9Wt7UePPKlIJvbgckwFmGjKs4fpSeUdb5NQI1FIORdmHNk UIGRv0yCud03XwSLrVOQnpRK47TPl23kAy6c0eNAu4t0yj90e8O9/iDkXAtxidYzl9GDT siX93xBG0Gt49gL77I7fSWOIVbB3KzG1WjA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636104222790100001 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 --- .../Socionext/SynQuacer/AcpiTables/AcpiTables.inf | 1 + Silicon/Socionext/SynQuacer/AcpiTables/Gtdt.aslc | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) 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..b045a49efa 100644 --- a/Silicon/Socionext/SynQuacer/AcpiTables/Gtdt.aslc +++ b/Silicon/Socionext/SynQuacer/AcpiTables/Gtdt.aslc @@ -74,9 +74,9 @@ 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), - 94, + FixedPcdGet64 (PcdGenericWatchdogRefreshBase), + FixedPcdGet64 (PcdGenericWatchdogControlBase), + 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 (#83377): https://edk2.groups.io/g/devel/message/83377 Mute This Topic: https://groups.io/mt/86836378/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 Mon Apr 29 03:19:47 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+83378+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+83378+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1636104229; cv=none; d=zohomail.com; s=zohoarc; b=O+MIzXwSi++LijTrxiG2QujN2GivAHoWfZVnvGnXlP8DoYKFJPmhEU0oGGhip8fQzXkkX1/eAO2Pj0pX9Z8wHLxIoqEBhcm5cq53TC/gDLMDxgIsF1MbFth/J6DodNVsI6vOQUOSVpAuKiwqXVy7HOqhdWopRfKu/OA0/FUR+DI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636104229; 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=gOnTytoe6GHwQg19Q+ykrfD6W/KktDFkKCYcPZRoQMA=; b=NoYSCE84EXL2v+Bb8B1lJZzXhPaN9XcCWj1YtQnJzDgMcwo2H4/ajlOS20OMwMeMWkyaPmOn7IjnHFuFgOJfgTUWQsZkduQl/f1Re6pqRDBVRZQLK+PRUe2Qdfn9NW/znQdybGv82Hf/wJSb9PXb8Cv2GYseRZ7V/DuplxuTHHs= 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+83378+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 1636104229243411.34677115375655; Fri, 5 Nov 2021 02:23:49 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rww6YY1788612xCqJO20UOaB; Fri, 05 Nov 2021 02:23:48 -0700 X-Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by mx.groups.io with SMTP id smtpd.web11.3155.1636104228334133343 for ; Fri, 05 Nov 2021 02:23:48 -0700 X-Received: by mail-pg1-f169.google.com with SMTP id p8so6566249pgh.11 for ; Fri, 05 Nov 2021 02:23:48 -0700 (PDT) X-Gm-Message-State: wHFiMSuhrcJ1KY8OdEZGpNA1x1787277AA= X-Google-Smtp-Source: ABdhPJwyDc0fPrCPuqWKUfaJ78ME7SAh20dX1IVgIbHbAcT0bGzoPQSrNadD7kkLcE0whSMlWI9Adg== X-Received: by 2002:a63:3348:: with SMTP id z69mr43600465pgz.177.1636104227913; Fri, 05 Nov 2021 02:23:47 -0700 (PDT) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id v14sm8000353pfu.171.2021.11.05.02.23.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 02:23:47 -0700 (PDT) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [edk2-devel] [PATCH 3/5] [edk2-platforms] Silicon/SynQuacerPlatformFlashAccessLib: Fix the number of erase blocks Date: Fri, 5 Nov 2021 18:23:45 +0900 Message-Id: <163610422496.391624.6619000045636196996.stgit@localhost> In-Reply-To: <163610419943.391624.9289897029386201296.stgit@localhost> References: <163610419943.391624.9289897029386201296.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=1636104228; bh=RgwCqeC5bHqYv0B9Jy7xzHayVWD96QxVDwBX6iPPioY=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=ZdH1sAGmJdGVVx0X72Hmqlu3K6XLVwge3sK7WQ+FQ3hQ6mGhwzOuUgKEYY8NI+FBTw3 K/UarMrB9uDc64ykLfVS9JYPp4bNhunK/O9IEVrGykmwyolfq0VScXwbJ84+JK/aHdKtR qLf9lk9qbx4XBseJf1cBNfjY1IIuC6xC20E= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636104231805100001 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 (#83378): https://edk2.groups.io/g/devel/message/83378 Mute This Topic: https://groups.io/mt/86836380/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 Mon Apr 29 03:19:47 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+83379+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+83379+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1636104238; cv=none; d=zohomail.com; s=zohoarc; b=kYwek3XdkM04/Z6LE5n8q0HtArJLcFmod8OCX4A0AoB5AOUfSz0aTIG63tRzlGaisuD2TGev7Pkun87K1TS80MS0bG6O5NwPdFrBM2KngG20NB0/GVBggz+sySndxAaiDDMT8fm3igxS6XKSOsf8nCgpsHqzZII58RpDNouJPik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636104238; 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=nJhiyJMRRy5KNQOytrdSUxMh/QP8IeYxIFpxfRFuyAs=; b=Ccq/D+BDPfHCW9J7RRbOh36IuPQRdgHvYnDaPQafM9anoIuVZwULvV2PZzfHSG46HH4rDfxByLFoMsFhDWfABRzYf3GNE8IlZCwzH4s3bCIn2596jvxTfBbcQCCVEylmlnWsurhVfTEOKYmCr1+vXBKFnd4x5YE3yo09v5tW+yk= 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+83379+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 1636104238083497.5934985373199; Fri, 5 Nov 2021 02:23:58 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 7wyWYY1788612xLEWO4FBqes; Fri, 05 Nov 2021 02:23:57 -0700 X-Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mx.groups.io with SMTP id smtpd.web12.3125.1636104237320381422 for ; Fri, 05 Nov 2021 02:23:57 -0700 X-Received: by mail-pj1-f51.google.com with SMTP id t5-20020a17090a4e4500b001a0a284fcc2so2917529pjl.2 for ; Fri, 05 Nov 2021 02:23:57 -0700 (PDT) X-Gm-Message-State: rnKL7TpmboFzKCm51bK02ujRx1787277AA= X-Google-Smtp-Source: ABdhPJzEKz2gV+t1ZBOMEAIFbjseHuNyGXY1GQ7lFS6qaul05p02s5zehEtCCswA4i33gfmTkLsKfg== X-Received: by 2002:a17:902:b084:b0:141:f5f8:1c5a with SMTP id p4-20020a170902b08400b00141f5f81c5amr28325328plr.40.1636104236171; Fri, 05 Nov 2021 02:23:56 -0700 (PDT) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id y32sm7564401pfa.145.2021.11.05.02.23.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 02:23:55 -0700 (PDT) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [edk2-devel] [PATCH 4/5] [edk2-platforms] Silicon/SynQuacer: add DBG2 ACPI table Date: Fri, 5 Nov 2021 18:23:53 +0900 Message-Id: <163610423326.391624.7578010263371252647.stgit@localhost> In-Reply-To: <163610419943.391624.9289897029386201296.stgit@localhost> References: <163610419943.391624.9289897029386201296.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=1636104237; bh=w2abRIiOAigoMxtFFSLsgFQwKnO+rV4BeIdVrdm89Dw=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=HS6Fk1GxQV2oQo+Vieu2XJCsI7EreJU7672mz2zJoaeMq3YQgwkG8LJkiS83lY+936Z 14e2LLoTpiemB8RIWT0hB/PMXFtzCVGHS7q0pb058X16Q/TG/sXd8Xzf/SnCI3OdESeHI sHKh/Ht8ybXZ0wZIvDeDmTRc2rK1E662WqE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636104240403100001 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 --- .../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..3023206330 100644 --- a/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf +++ b/Silicon/Socionext/SynQuacer/AcpiTables/AcpiTables.inf @@ -22,6 +22,7 @@ Dsdt.asl Fadt.aslc Gtdt.aslc + Dbg2.aslc Iort.aslc Madt.aslc Mcfg.aslc diff --git a/Silicon/Socionext/SynQuacer/AcpiTables/Dbg2.aslc b/Silicon/Soc= ionext/SynQuacer/AcpiTables/Dbg2.aslc new file mode 100644 index 0000000000..027b3b658b --- /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_5_0_SYSTEM_MEMORY, 32, 0, EFI_ACPI_5_= 0_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 (#83379): https://edk2.groups.io/g/devel/message/83379 Mute This Topic: https://groups.io/mt/86836384/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 Mon Apr 29 03:19:47 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+83380+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+83380+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1636104246; cv=none; d=zohomail.com; s=zohoarc; b=fd2CKbmF+aWAvbLmkyN84TJYgRpw80gHFCSSMs7oCnw6tc8yBHRjRb9eygK8lZUvxEzbyQCIPGRGW8XSesISEL/EBR2zerVLx6SB9+TXTq3fb1wxqislS20S9DUulqrt+OMIhDGhBcBBwHgYiBhnhVlLKJuB9eLsb1kzwANBI0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636104246; 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=lbrdz+dwXKmbxcgAtfYalhZQeoeogSspiQvp3tPZqIg=; b=KIvBMapFTvymlVXWeN0wY/u96BanYfFjB1u2EjJxrLiZU3S9eLrD9jCNhts0a9xzoBIbiIZs2KsV8ffQJsMhZqlbBojiBL3QoCMs5pL3PGVSqgqToqO4pE1/inQyQu3IgQBsURQ80F/yWTFqFFS3B8GBl4YEnbQovOoqVjUWyJI= 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+83380+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 1636104246337877.9644313935381; Fri, 5 Nov 2021 02:24:06 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id jR4zYY1788612xWGCXvHd71f; Fri, 05 Nov 2021 02:24:06 -0700 X-Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mx.groups.io with SMTP id smtpd.web09.3129.1636104245406341914 for ; Fri, 05 Nov 2021 02:24:05 -0700 X-Received: by mail-pj1-f53.google.com with SMTP id o6-20020a17090a0a0600b001a64b9a11aeso2957262pjo.3 for ; Fri, 05 Nov 2021 02:24:05 -0700 (PDT) X-Gm-Message-State: snDgWulyjXHFHDcaS2yQCDysx1787277AA= X-Google-Smtp-Source: ABdhPJxLB5djxfpS46xEqhuA22mgLRQpnxAl3EwOae6lw+Ju0MlJ1pcSp4sfNT1/rst3O1x0WoXLBg== X-Received: by 2002:a17:90b:1bc3:: with SMTP id oa3mr28881048pjb.52.1636104244949; Fri, 05 Nov 2021 02:24:04 -0700 (PDT) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id v8sm6939131pfu.107.2021.11.05.02.24.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 02:24:04 -0700 (PDT) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm Cc: devel@edk2.groups.io, Kazuhiko Sakamoto , Masahisa Kojima Subject: [edk2-devel] [PATCH 5/5] [edk2-platforms] Platform/DeveloperBox: Expand NvStorage sizes Date: Fri, 5 Nov 2021 18:24:01 +0900 Message-Id: <163610424153.391624.15870608392900932158.stgit@localhost> In-Reply-To: <163610419943.391624.9289897029386201296.stgit@localhost> References: <163610419943.391624.9289897029386201296.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=1636104246; bh=9l3e/VitTlaVrlyOiFR1FgKRlBDZGVX1Bqlm1WIP+d4=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=ENcoD3m8Z8ElvPM+BEQrnVvl65nzBze2blFqOsog1dMan8vAwbfDe6IM+iXA4ZgGpWn dpRbu4V59nJc+ZSNGJfuIofAhjifXi3bJGG6IeEyX5j15EoH79vtqEzHuncKE0qoSovUt dAjwJnSIigpPAopdUsoi1+K+c7HC6Nxh1no= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636104246775100001 Expand NvStorage Variable size and FTW spare/working size for the DeveloperBox platform. Since the size of the NvStorage VariableSize is not enough large, FWTS uefirttime test, which updates the NV variables in runtime, failes. This expands the size to fix this issue. Signed-off-by: Masami Hiramatsu Reported-by: Kazuhiko Sakamoto --- .../Socionext/DeveloperBox/DeveloperBox.dsc.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc b/Platfor= m/Socionext/DeveloperBox/DeveloperBox.dsc.inc index 0a364bc457..3baf97ecc0 100644 --- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc +++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc.inc @@ -280,11 +280,11 @@ gFip006DxeTokenSpaceGuid.PcdFip006DxeMemBaseAddress|0x08000000 =20 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0x08400000 - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize|0x00010000 - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0x08410000 - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize|0x00010000 - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0x08420000 - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x00010000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize|0x00080000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0x08480000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize|0x00080000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0x08500000 + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x00080000 =20 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId|"SNI " gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId|0x52434155514e59= 53 # SYNQUACR -=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 (#83380): https://edk2.groups.io/g/devel/message/83380 Mute This Topic: https://groups.io/mt/86836385/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-