From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web10.25300.1574350164442240929 for ; Thu, 21 Nov 2019 07:29:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RqLVkMNK; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574350163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c9F1DY2Ai9roljw8ookd+RtTytBrp1HMNUS/9rpU8iY=; b=RqLVkMNK2vyHvC9T6z5p0Nk5Mpkpy6Ql9m7CqgWax60mSf0mZZlUAcF4l7R9Kq4frS94/J LixHhkOwFiAIq6G9k9IlMKjLPC43gA6wAQ0y/9v7sI0vpvFVW+j4tDXNFxI/35HH5gHOTQ Yj/PIEmXOMiIJY+z4e5CdzYoXeWBVPc= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-334-vT4wHSn3N0Ogia0tEIZAvQ-1; Thu, 21 Nov 2019 10:29:21 -0500 Received: by mail-wr1-f69.google.com with SMTP id j12so2245567wrw.15 for ; Thu, 21 Nov 2019 07:29:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=DMGpKys5tYWY8Zd+EGUM0PrUgLe6sjdC2ffq7q/48p4=; b=tZsLCA/NmXwToAKFfBsLM28If95Jt7w3AV78vwiMQxMOJgtYTh6Ry51Qs/3bmBCHAS ELy5sJxHl+nZfArniDiEswF+nysaAoQPxPPHkwJKglnzpTtwSuAU/g6gEBXC5IqwsKYs 6jvNez6Z0Gloy79+iKScVm+jCMNADpWTBYyxgOVGWgS9r38fVrAP56s+gzy44KPqm3Q9 4Yl1exk2VMIGjz+gfpgpbdjxNJlTPAOpsWioVn2cvPV1ebIG59/xeNW0A2kWoUQEUJxJ USrRmtffHkql3iaURbqF9UMxCD2BQ2QbOyaatHBctkfK9ucJyhJSv62DS8LNgE8tdZO7 +NCA== X-Gm-Message-State: APjAAAWYYT38NSIM4wlrAW0DEq4rq5mrWJtwH1okKaFTBiQvsHaTiCs5 aaub3aR2zo1zD5pfnw5NU+knvOdRZJf13rwK5D8A3ns0pBBtNQ+fMahiLNppUDhEQYovANDGN/Z 29EwwuyHlbRiiVg== X-Received: by 2002:a7b:c055:: with SMTP id u21mr11002700wmc.55.1574350158173; Thu, 21 Nov 2019 07:29:18 -0800 (PST) X-Google-Smtp-Source: APXvYqyH2PBwx3vb3memDiBCeMy38/uLgUAVAk+cIO58eLy3BYW9hPbSFAgJrdzrosdbhkRPBT48fw== X-Received: by 2002:a7b:c055:: with SMTP id u21mr11002678wmc.55.1574350157930; Thu, 21 Nov 2019 07:29:17 -0800 (PST) Return-Path: Received: from [192.168.1.35] (131.red-88-21-102.staticip.rima-tde.net. [88.21.102.131]) by smtp.gmail.com with ESMTPSA id r2sm2623111wrm.71.2019.11.21.07.29.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Nov 2019 07:29:17 -0800 (PST) Subject: Re: [edk2-devel] [PATCH v1 10/19] DynamicTablesPkg: Serial debug port initialisation To: Leif Lindholm Cc: devel@edk2.groups.io, sami.mujawar@arm.com, Alexei.Fedorov@arm.com, Matteo.Carlini@arm.com, nd@arm.com References: <20190823105539.13260-1-sami.mujawar@arm.com> <20190823105539.13260-11-sami.mujawar@arm.com> <20191121152320.GH7359@bivouac.eciton.net> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: <90d963b6-4422-cdac-ed20-61f0e2329fe3@redhat.com> Date: Thu, 21 Nov 2019 16:29:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191121152320.GH7359@bivouac.eciton.net> X-MC-Unique: vT4wHSn3N0Ogia0tEIZAvQ-1 X-Mimecast-Spam-Score: 0 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 11/21/19 4:23 PM, Leif Lindholm wrote: > On Thu, Nov 21, 2019 at 16:20:31 +0100, Philippe Mathieu-Daud=C3=A9 wrote= : >> On 8/23/19 12:55 PM, Sami Mujawar wrote: >>> The ARM DCC serial port subtype is an option that is >>> supported by the DBG2 generator. However, the serial >>> port initialisation should only be done for PL011/SBSA >>> compatible UARTs. >>> >>> Add check to conditionally initialise the serial port. >>> >>> Signed-off-by: Sami Mujawar >>> --- >>> DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c | 2= 7 ++++++++++++-------- >>> 1 file changed, 17 insertions(+), 10 deletions(-) >>> >>> diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Gener= ator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c >>> index 346ab5b22f5402bf87c385558f68f080d1b454ed..51c843d25f7538810469485= 5ce133b3d61860196 100644 >>> --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c >>> +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c >>> @@ -175,7 +175,7 @@ GET_OBJECT_LIST ( >>> CM_ARM_SERIAL_PORT_INFO >>> ); >>> -/** Initialize the PL011 UART with the parameters obtained from >>> +/** Initialize the PL011/SBSA UART with the parameters obtained from >>> the Configuration Manager. >> >> Isn't the SBSA UART a PL011? >=20 > No. It's a compatible subset. > So a PL011 can be used as an SBSA UART. OK thanks. Can you update the comment? Maybe: "Initialize the PL011 compatible UART with the parameters ..." Regardless: Reviewed-by: Philippe Mathieu-Daude >=20 > / > Leif >=20 >>> @param [in] SerialPortInfo Pointer to the Serial Port Information= . >>> @@ -353,15 +353,22 @@ BuildDbg2Table ( >>> AcpiDbg2.Dbg2DeviceInfo[DBG_PORT_INDEX_PORT1].Dbg2Device.PortSubty= pe =3D >>> SerialPortInfo->PortSubtype; >>> - // Initialize the serial port >>> - Status =3D SetupDebugUart (SerialPortInfo); >>> - if (EFI_ERROR (Status)) { >>> - DEBUG (( >>> - DEBUG_ERROR, >>> - "ERROR: DBG2: Failed to configure debug serial port. Status =3D = %r\n", >>> - Status >>> - )); >>> - goto error_handler; >>> + if ((SerialPortInfo->PortSubtype =3D=3D >>> + EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART) || >>> + (SerialPortInfo->PortSubtype =3D=3D >>> + EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART_2X) || >>> + (SerialPortInfo->PortSubtype =3D=3D >>> + EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART)) { >>> + // Initialize the serial port >>> + Status =3D SetupDebugUart (SerialPortInfo); >>> + if (EFI_ERROR (Status)) { >>> + DEBUG (( >>> + DEBUG_ERROR, >>> + "ERROR: DBG2: Failed to configure debug serial port. Status = =3D %r\n", >>> + Status >>> + )); >>> + goto error_handler; >>> + } >>> } >>> *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiDbg2; >>> >> >=20