From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.15934.1591951522610513937 for ; Fri, 12 Jun 2020 01:45:22 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3E9911F1; Fri, 12 Jun 2020 01:45:22 -0700 (PDT) Received: from [192.168.1.69] (unknown [10.37.8.184]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9467C3F73C; Fri, 12 Jun 2020 01:45:21 -0700 (PDT) Subject: Re: [edk2-devel] Additional configuration options on Armada/Cn913x To: mark.kettenis@xs4all.nl, devel@edk2.groups.io References: <7860963d-c540-1577-600c-106d7236f921@arm.com> <14107.1591915430415249079@groups.io> From: "Ard Biesheuvel" Message-ID: <1886d7a0-cc28-54ce-6d57-b42f3525d6e2@arm.com> Date: Fri, 12 Jun 2020 10:45:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <14107.1591915430415249079@groups.io> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/12/20 12:43 AM, Mark Kettenis via Groups.Io wrote: > On Thu, Jun 11, 2020 at 04:17 PM, Ard Biesheuvel wrote: >=20 > On 6/11/20 4:07 PM, greg@unrelenting.technology wrote: >=20 > June 11, 2020 4:19 PM, "Ard Biesheuvel" > wrote: >=20 > On 6/5/20 5:19 PM, Marcin Wojtas via groups.io wrote: >=20 > Hi, > I'd like to ask for comments before I develop the actua= l > code - > currently we have 2 workarounds > done specifically for Linux: > a. ECAM shift in PCIE > b. SPCR address space definition >=20 > What does this mean? >=20 > The SPCR in upstream edk2 is set up to work around some Linux > weirdness (?) and I have to do this: >=20 > https://github.com/myfreeweb/edk2-platforms/commit/74ec98a6498e= 78d2ae6c861db88487bf75f2e1a1 >=20 > to make it work on FreeBSD. >=20 > Surely, they can't both be correct. Marcin? >=20 > Assuming the serial port on Armada/Cn911x is the same as on Armada8k,=20 > the following DT properties would be applicable: >=20 > reg-shift =3D <2>; > reg-io-width =3D <1> >=20 > which means the registers are spaced 32-bits apart but have to be=20 > accessed using 8-bit load/store instructions.=C2=A0 I'd say that > means that the ACPI Generic Address Space should have RegisterBitWidth=20 > set to 32 and AccessSize set to BYTE. > In other words, I think that the current: >=20 > #define MV_UART_AS32(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 32, 0,=20 > EFI_ACPI_5_0_BYTE, Address } >=20 > is correct.=C2=A0 That certainly is what works for OpenBSD. Thanks Mark The struct type is defined as typedef struct { UINT8 AddressSpaceId; UINT8 RegisterBitWidth; UINT8 RegisterBitOffset; UINT8 AccessSize; UINT64 Address; } EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE; so I agree that the current definition matches a UART that requires byte=20 accesses on registers that are 32 bits apart. So why does FreeBSD deviate from this?