From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [edk2-devel] Additional configuration options on Armada/Cn913x To: Ard Biesheuvel ,devel@edk2.groups.io From: "Mark Kettenis" X-Originating-Location: Dalfsen, Provincie Overijssel, NL (83.163.83.176) X-Originating-Platform: Linux Chrome 83 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Thu, 11 Jun 2020 15:43:50 -0700 References: <7860963d-c540-1577-600c-106d7236f921@arm.com> In-Reply-To: <7860963d-c540-1577-600c-106d7236f921@arm.com> Message-ID: <14107.1591915430415249079@groups.io> Content-Type: multipart/alternative; boundary="J9iLXNo1qN8ynAFRwnkU" --J9iLXNo1qN8ynAFRwnkU Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 >>=20 >>> On 6/5/20 5:19 PM, Marcin Wojtas via groups.io wrote: >>>=20 >>>=20 >>>> Hi, >>>> I'd like to ask for comments before I develop the actual 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/74ec98a6498e78d2ae6c= 861db88487bf75f2e1a1 >>=20 >>=20 >> to make it work on FreeBSD. >=20 > Surely, they can't both be correct. Marcin? >=20 >=20 Assuming the serial port on Armada/Cn911x is the same as on Armada8k, the = following DT properties would be applicable: reg-shift =3D <2>; reg-io-width =3D <1> which means the registers are spaced 32-bits apart but have to be accessed= using 8-bit load/store instructions.=C2=A0 I'd say that means that the ACPI Generic Address Space should have RegisterBitWidth set= to 32 and AccessSize set to BYTE. In other words, I think that the current: #define MV_UART_AS32(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 32, 0, EFI_ACP= I_5_0_BYTE, Address } is correct.=C2=A0 That certainly is what works for OpenBSD. --J9iLXNo1qN8ynAFRwnkU Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 11, 2020 at 04:17 PM, Ard Biesheuvel wrote:
On 6/11/20 4:07 PM, greg@unrelenting.technology wrote:
June 11, 2020 4:19 PM, "Ard Biesheuvel" <ard.biesheuvel@arm= .com> wrote:

On 6/5/20 5:19 PM, Marcin Wojtas via groups.io wrote:
Hi,
I'd like to ask for comments before I develop the act= ual code - > currently we have 2 workarounds
done specifically for = Linux:
a. ECAM shift in PCIE
b. SPCR address space definition What does this mean?
The SPCR in upstream edk2 is set up to work around some Linux weirdness (?= ) and I have to do this:

https://github.com/myfreeweb/edk2-platforms/commit= /74ec98a6498e78d2ae6c861db88487bf75f2e1a1

to make it work on= FreeBSD.
Surely, they can't both be correct. Marcin?

Assuming the serial port on Armada/Cn911x is the same as on Armada8k, the = following DT properties would be applicable:

reg-shift =3D <2= >;
reg-io-width =3D <1>

which means the registers = are spaced 32-bits apart but have to be accessed using 8-bit load/store ins= tructions.  I'd say that
means that the ACPI Generic Address Spac= e should have RegisterBitWidth set to 32 and AccessSize set to BYTE.
I= n other words, I think that the current:

#define MV_UART_AS32(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 32, 0, EF= I_ACPI_5_0_BYTE, Address }

is correct.  That certainly is w= hat works for OpenBSD.
--J9iLXNo1qN8ynAFRwnkU--