From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by mx.groups.io with SMTP id smtpd.web11.24402.1591979555580851828 for ; Fri, 12 Jun 2020 09:32:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@unrelenting.technology header.s=default header.b=e0P4loi7; spf=pass (domain: unrelenting.technology, ip: 94.23.1.103, mailfrom: greg@unrelenting.technology) Date: Fri, 12 Jun 2020 16:32:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unrelenting.technology; s=default; t=1591979553; 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=KbH3eee0Z5S+vlEnU2xBRUDlMCAEwMKSwm4KG345lzE=; b=e0P4loi7yJkkV8gKZvAvofx3VcckVe3Evah3242atbjREF1Nt96VELOI+jhu7XHHmipWXE kHTSk+3Y/6a7UQTGuORtdx9Kjr5y5ehtGmwAI5st5x/KHMftVo4TsRflExlJBw9wgIzevC x76UcNa8tGbKqiXmFMjjNIQjZkk+pfI= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: greg@unrelenting.technology To: Marcin Wojtas CC: Mark Kettenis , edk2-devel-groups-io , Ard Biesheuvel Subject: Re: [edk2-devel] Additional configuration options on Armada/Cn913x In-Reply-To: References: <7860963d-c540-1577-600c-106d7236f921@arm.com> <14107.1591915430415249079@groups.io> <1886d7a0-cc28-54ce-6d57-b42f3525d6e2@arm.com> Message-ID: <3576864E-A42B-41B1-9D6D-289BE362AECC@unrelenting.technology> MIME-Version: 1.0 X-Spam-Score: -0.10 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On June 12, 2020 3:07:21 PM UTC, Marcin Wojtas wrote: >Hi, > >I see Greg was dropped in the meantime=2E > >pt=2E, 12 cze 2020 o 10:45 Ard Biesheuvel na= pisa=C5=82(a): >> >> On 6/12/20 12:43 AM, Mark Kettenis via Groups=2EIo wrote: >> > On Thu, Jun 11, 2020 at 04:17 PM, Ard Biesheuvel wrote: >> > >> > On 6/11/20 4:07 PM, greg@unrelenting=2Etechnology wrote: >> > >> > June 11, 2020 4:19 PM, "Ard Biesheuvel" >> > wrote: >> > >> > On 6/5/20 5:19 PM, Marcin Wojtas via groups=2Eio 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=2E ECAM shift in PCIE >> > b=2E 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=2Ecom/myfreeweb/edk2-platforms/commit/74ec98a6= 498e78d2ae6c861db88487bf75f2e1a1 >> > >> > to make it work on FreeBSD=2E >> > >> > Surely, they can't both be correct=2E 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 instructions=2E I'd say that >> > means that the ACPI Generic Address Space should have RegisterBitWidt= h >> > set to 32 and AccessSize set to BYTE=2E >> > In other words, I think that the current: >> > >> > #define MV_UART_AS32(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 32, 0, >> > EFI_ACPI_5_0_BYTE, Address } >> > >> > is correct=2E That certainly is what works for OpenBSD=2E >> >> 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 byt= e >> accesses on registers that are 32 bits apart=2E >> >> So why does FreeBSD deviate from this? > >Greg, can you please explain your concerns here? Yeah, looking at our code again, looks like we did screw it up, seems like= we are using register width as access width and vice versa :/