Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lN0or-0005hH-EG for mharc-grub-devel@gnu.org; Thu, 18 Mar 2021 18:08:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lN0oq-0005g9-Da for grub-devel@gnu.org; Thu, 18 Mar 2021 18:08:40 -0400 Received: from gate.crashing.org ([63.228.1.57]:56736) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lN0oo-0007FR-5g for grub-devel@gnu.org; Thu, 18 Mar 2021 18:08:40 -0400 Received: from u11bb3cc8ece954.lan (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 12IM7UMp005587; Thu, 18 Mar 2021 17:07:32 -0500 From: Benjamin Herrenschmidt To: grub-devel@gnu.org Cc: Matthias Lange Subject: [PATCH 0/5] serial: Add MMIO & SPCR support for AWS EC2 metal instances Date: Fri, 19 Mar 2021 09:07:23 +1100 Message-Id: <20210318220728.495970-1-benh@kernel.crashing.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: permerror 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, T_SPF_HELO_PERMERROR=0.01, T_SPF_PERMERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2021 22:08:40 -0000 (Apologies if that got sent twice, there was an issue with my setup yesterday causing it to be sent with the wrong From: line) This series adds support for the serial console of AWS EC2 "metal" x86 instances to grub. This requires two improvements: - Support for MMIO accesses to the 8250 serial port. This adds the basic plumbing, a function to register an MMIO based port, and support for configuring an MMIO port by using the string "mmio" followed by a hex address for the --port directive. [Q: Should we instead add a --mmio directive ? Can we make two such options mutually exclusive with the current infrastructure ?] - Support for setting up a default port using the ACPI SPCR table if present. This series will make this happen if the command "serial" is used without arguments. In that case, SPCR will be used if present, otherwise grub will revert to com0 with default settings as before. This work started originally from Matthias Lange series https://marc.info/?l=grub-devel&m=148775823217022&w=2 However, I ended up rewriting most of it using a different approach which I felt was less invasive and simpler, as I don't expect we will be collecting more 'backends' for ns8250.c among other things. I did not keep Matthias original support for OXSEMI PCI uart. This can be fairly easily added on top, however, I believe a better approach would be to define a syntax to the "serial" command to define a PCI UART by seg/bus/dev/fn with options to set the base clock. We could also add a table of "known" ones as we go based in vid/did similar to what Linux does. None of this was necessary for my purpose and I lack the ability/time to test this setup, but it would be easy to add it on top of this series. This was tested using SPCR on an actual c5.metal instance, and using explicit instanciation via serial -p mmioXXXXXXXX on a modified qemu hacked to create MMIO PCI serial ports.