From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.groups.io with SMTP id smtpd.web12.25082.1574349804440252402 for ; Thu, 21 Nov 2019 07:23:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=WqVA2aDw; spf=pass (domain: linaro.org, ip: 209.85.221.67, mailfrom: leif.lindholm@linaro.org) Received: by mail-wr1-f67.google.com with SMTP id t1so4917752wrv.4 for ; Thu, 21 Nov 2019 07:23:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=NIwnAAiFgakc93ZE/R/mMu9lWtckJES5zCOEP0axnFU=; b=WqVA2aDwlmmWeDR+32HMUpkOLGRBvTLyJJzUDwJCnM+c+9lOwhJqs4qgW+t1WXHt5K ydOCJwvnzS4cVOi6/7Kugvkf8N8tjpr30/hECAeYGf5NcDXmzduJBS9VDUJwrE9lZG0K VQgA+nj444EBKz3QsmGvFmfoo1QG8pNZ5xS/RnxKgiipOAq6RgZ2gb33T85p97jrOKsx ruh5hNMtouCoYB6oFeyDoDkOXgbznm4FS46rwduNZbRcXY6Ig2vXO1LWXuvoVqKcyHg3 WZUI4L7q4qwQ3/PlKizfy5e4HrONaSKP535UvCpEqbDG1ELFaj+qwbzPGReoLSmjXixm 2aPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=NIwnAAiFgakc93ZE/R/mMu9lWtckJES5zCOEP0axnFU=; b=nvaPGTXHpNmdqwWnJ/hF/6xC9ial+kfpySfMHGgebgMlt/QGcTuEViy5Xqc6SIXwLx WAti6vMSxgAaaeEs//QzX4jOR2nyetSi+uP9uozZrTgaEpGDg/0dQ+J/tKZQeJazHzLm Y9FTV8NEytT2P3HuTheiExOG7ZMUp3Km/kyOvMc8Fd98t86ZtL6SwrrF96dj1aoX3YeP /PWGypRYiyQxDe8QHX031ljVoVnS5rkQU273qzgALanO+rYLhqFcJUAKmGLQ5gev9bip AXMmJDJQRl43k06vUKoyV5AH/DbWaChzbANO+a7dL8mw6jVezD6m/RGrjsklwrGlvQ6d 2JLw== X-Gm-Message-State: APjAAAXCwuQOKRBNNkirV2XOaON41sTyOqXt6YAQ4X5FdzPxpEpuEc9v tNpYHYNpjnUUh7sp75EkCXkL2Q== X-Google-Smtp-Source: APXvYqxfLalDX6iG8mXJ7djLuq9c6KbL84OtliS2LcPm1m4fLfUx1ouOasOHhV/CXSkjBNcpmqyBxA== X-Received: by 2002:a5d:5227:: with SMTP id i7mr11435662wra.277.1574349802827; Thu, 21 Nov 2019 07:23:22 -0800 (PST) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id f19sm3928665wrf.23.2019.11.21.07.23.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 07:23:22 -0800 (PST) Date: Thu, 21 Nov 2019 15:23:20 +0000 From: "Leif Lindholm" To: Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= Cc: devel@edk2.groups.io, sami.mujawar@arm.com, Alexei.Fedorov@arm.com, Matteo.Carlini@arm.com, nd@arm.com Subject: Re: [edk2-devel] [PATCH v1 10/19] DynamicTablesPkg: Serial debug port initialisation Message-ID: <20191121152320.GH7359@bivouac.eciton.net> References: <20190823105539.13260-1-sami.mujawar@arm.com> <20190823105539.13260-11-sami.mujawar@arm.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Thu, Nov 21, 2019 at 16:20:31 +0100, Philippe Mathieu-Daudé 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 | 27 ++++++++++++-------- > > 1 file changed, 17 insertions(+), 10 deletions(-) > > > > diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c > > index 346ab5b22f5402bf87c385558f68f080d1b454ed..51c843d25f75388104694855ce133b3d61860196 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? No. It's a compatible subset. So a PL011 can be used as an SBSA UART. / Leif > > @param [in] SerialPortInfo Pointer to the Serial Port Information. > > @@ -353,15 +353,22 @@ BuildDbg2Table ( > > AcpiDbg2.Dbg2DeviceInfo[DBG_PORT_INDEX_PORT1].Dbg2Device.PortSubtype = > > SerialPortInfo->PortSubtype; > > - // Initialize the serial port > > - Status = SetupDebugUart (SerialPortInfo); > > - if (EFI_ERROR (Status)) { > > - DEBUG (( > > - DEBUG_ERROR, > > - "ERROR: DBG2: Failed to configure debug serial port. Status = %r\n", > > - Status > > - )); > > - goto error_handler; > > + if ((SerialPortInfo->PortSubtype == > > + EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART) || > > + (SerialPortInfo->PortSubtype == > > + EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART_2X) || > > + (SerialPortInfo->PortSubtype == > > + EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART)) { > > + // Initialize the serial port > > + Status = SetupDebugUart (SerialPortInfo); > > + if (EFI_ERROR (Status)) { > > + DEBUG (( > > + DEBUG_ERROR, > > + "ERROR: DBG2: Failed to configure debug serial port. Status = %r\n", > > + Status > > + )); > > + goto error_handler; > > + } > > } > > *Table = (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiDbg2; > > >