From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oTGka-0003n6-PQ for mharc-grub-devel@gnu.org; Wed, 31 Aug 2022 01:58:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTGkZ-0003mj-7r for grub-devel@gnu.org; Wed, 31 Aug 2022 01:58:55 -0400 Received: from gate.crashing.org ([63.228.1.57]:46204) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTGkX-0000rt-BP for grub-devel@gnu.org; Wed, 31 Aug 2022 01:58:54 -0400 Received: from [IPv6:::1] (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 27V5uWcF007363; Wed, 31 Aug 2022 00:56:33 -0500 Message-ID: Subject: Re: [PATCH 3/5] ns8250: Add base support for MMIO UARTs From: Benjamin Herrenschmidt To: Sven Anderson Cc: Matthias Lange , The development of GNU GRUB Date: Wed, 31 Aug 2022 15:56:05 +1000 In-Reply-To: References: <20210318220728.495970-1-benh@kernel.crashing.org> <20210318220728.495970-4-benh@kernel.crashing.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.1-0ubuntu1 MIME-Version: 1.0 Received-SPF: pass client-ip=63.228.1.57; envelope-from=benh@kernel.crashing.org; helo=gate.crashing.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2022 05:58:55 -0000 On Mon, 2022-05-23 at 19:11 +0200, Sven Anderson wrote: >=20 > I had a couple of sleepless nights trying to find out why this didn't > work for my MMIO UART (Intel Cannon Lake PCH=C2=A0Intel=C2=A0C246), so I > thought I would share my findings with others in a similar=C2=A0situation= . > (See below.) > =C2=A0 .../... >=20 > This code assumes that the registers are only 8 bit wide. Apparently > for my chipset they are 32 bits wide, so it only (finally) worked > when I rewrote this code to address=C2=A0and write full grub_uint32_t > values, like this:=C2=A0 >=20 > ------ > =C2=A0 volatile grub_uint32_t* p =3D (void*)(port->mmio_base); > =C2=A0 *(p + reg) =3D (grub_uint32_t)(value); > ------ Sorry, I dopped the ball on this for a while. Getting back to it and will re-submit the patches. Can you send me a dump of your SPCR table ? I'd like to see if it properly says "32-bit" there to auto-detect this. Cheers, Ben.