From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web09.25255.1574349639242279838 for ; Thu, 21 Nov 2019 07:20:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZCZgFcmc; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574349638; 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=l5M5aXS3mgZOGUy3DnDkt5AfVUkWykL91xpynMplazo=; b=ZCZgFcmc6DYZKTZmRBRoWI56FWNQyITgBzLgGkCXTD4ABXCVDcYh5bv4SpQWnjdKB+T7Gp 8XNK0WY61XXv8ScWHrF3w/LRBGjktA/xQFw4XdbKl+YeTa5tqG68O88JaPJKEabXUC/g+w VhvNvyXC2CdSyD2PFPVXhI06S2QFPQk= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-87-lqM300aFMGylwFlRIsuIOw-1; Thu, 21 Nov 2019 10:20:36 -0500 Received: by mail-wm1-f72.google.com with SMTP id h191so1961347wme.5 for ; Thu, 21 Nov 2019 07:20:36 -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=60LstX6uNMj1CarY2YHpf13iAmbrPFLMzIxZLWgf+6g=; b=kqZlH8Htce4nzo2mrlfch+Q+5ZKrRw0+VcPOwgiUsgU6b5zqkzEztK59eBjis33tYq 6cPUAHfWDoluXlJdfv2azRyNeqIIBnVlsdyvYKHHv3arfXDosmBn2EkNGqnAQb1zJyiw rZC7OuRpaXcAIwFh7N7BtcGOq/vpNTNZx5zlxkH94E0YKButarH5xyaiEyqGow+rqVTs TSbdf4O5Px1Wgu/N4KRtmZxG3wOdytwExzuhd7FXYIPM6qYvHCUO0ZM0dmCTYQNHJ570 3hCSAgF1hFNPpkb/lr/WL8cL3ZLDjC8jy8I7yAZRqaINMzXRDjap+MxD36xuRnuE66Sl d/cw== X-Gm-Message-State: APjAAAWQxGKU4N6IiLcqDJDD7J1v5GRwGesXgyB/+R/+G8Ql1gFMJHeh oY0B/CbMOLzV41qo/xXYm1DqsvBI+8abWAQQo4qbaC8jy14I0C0q/RBzRofYENTnZuv+0QaRkBV 9yZAQqVziLh9BrA== X-Received: by 2002:adf:a551:: with SMTP id j17mr10502747wrb.18.1574349634545; Thu, 21 Nov 2019 07:20:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwz+74e1HiS0gUweBGyqRo0bYqV3kwXPtrrJcJvxiJVScMfAOoSR7pOuICvwOnEftVkAFU1bA== X-Received: by 2002:adf:a551:: with SMTP id j17mr10502715wrb.18.1574349634307; Thu, 21 Nov 2019 07:20:34 -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 x13sm3181500wmc.19.2019.11.21.07.20.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Nov 2019 07:20:33 -0800 (PST) Subject: Re: [edk2-devel] [PATCH v1 10/19] DynamicTablesPkg: Serial debug port initialisation To: devel@edk2.groups.io, sami.mujawar@arm.com Cc: Alexei.Fedorov@arm.com, leif.lindholm@linaro.org, Matteo.Carlini@arm.com, nd@arm.com References: <20190823105539.13260-1-sami.mujawar@arm.com> <20190823105539.13260-11-sami.mujawar@arm.com> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: Date: Thu, 21 Nov 2019 16:20:31 +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: <20190823105539.13260-11-sami.mujawar@arm.com> X-MC-Unique: lqM300aFMGylwFlRIsuIOw-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 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. >=20 > Add check to conditionally initialise the serial port. >=20 > Signed-off-by: Sami Mujawar > --- > DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c | 27 += +++++++++++-------- > 1 file changed, 17 insertions(+), 10 deletions(-) >=20 > diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generat= or.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c > index 346ab5b22f5402bf87c385558f68f080d1b454ed..51c843d25f75388104694855c= e133b3d61860196 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 > ); > =20 > -/** 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 > @param [in] SerialPortInfo Pointer to the Serial Port Information. > @@ -353,15 +353,22 @@ BuildDbg2Table ( > AcpiDbg2.Dbg2DeviceInfo[DBG_PORT_INDEX_PORT1].Dbg2Device.PortSubtype = =3D > SerialPortInfo->PortSubtype; > =20 > - // 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; > + } > } > =20 > *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiDbg2; >=20