From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::235; helo=mail-it0-x235.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AC9FF20955F07 for ; Tue, 27 Feb 2018 01:16:59 -0800 (PST) Received: by mail-it0-x235.google.com with SMTP id a75so14334275itd.0 for ; Tue, 27 Feb 2018 01:23:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rzRgHz5M3avkQPIwpDd/2Zwi4aQvMSWx0iRbyg8xt8s=; b=X21HUZ++khvQoeerhwkxwZ51NOPx/0f4C3ZDy5wRDU/wTpKTeMTyAC0X+m3HyBNIjd tYwU96vZUMq2qTIm8dNP3VmPPOFE9EcDMr+E/9qY1yUwXfvfWWWgFqPA+Xt9N7Q+nbsI IBtZEKmOtHoVFMcS6azfjKUk6Xi8qVSJ+s5d4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=rzRgHz5M3avkQPIwpDd/2Zwi4aQvMSWx0iRbyg8xt8s=; b=fhfgCimLPfHfQUDQSEGlqyqLV7deGapl/peQ4ZQRPT5xE8jI6Jh+MG6pUX3HAg7yau 32I9fyB8Zul3hXm3kPndd2fkbAJulKj4DL318FWN7KpnV4QZ/m5eTcbQjA9wJj2WB+1p TccO5GNgEEJ3tnVJhFIGtP/ARUDfVVQRARNRLMeRNbnCM1ViUVMK+BX4x5O+5U0aj6Y3 wvCIj8y+9iWKinpYGYcqj7fZ9k+9/bRQFkE8I6kuAx907J6CJPZOVlDXCOWsVKMGJisr 9mhMg8UJskTLe9T8l4EkB4kZkB3W7qKZwAmSFfnU7zre7upd/EjD1dGW7O1x1GRISlts qyYA== X-Gm-Message-State: APf1xPDzq7iw7Nafskm24VtY+lkXjY6WbtG0LWTzwpmqgJ+3FDSEwKMs 6t26U4ovEXTYd9CWApmSY9V+2jynClngUg1wcMKxaQ== X-Google-Smtp-Source: AH8x227jZ73Z1uaGwK7kMdieqARMy3w1Usmvm+C0DPLLZ6xvRZ5D9F+d/u1/j6Ox44TSSAg8ATD6JXycWpkBlLNILrs= X-Received: by 10.36.217.22 with SMTP id p22mr15854110itg.106.1519723384952; Tue, 27 Feb 2018 01:23:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.138.209 with HTTP; Tue, 27 Feb 2018 01:23:04 -0800 (PST) In-Reply-To: <20180227015036.GC2261@SZX1000114654> References: <20180224142515.461-1-ard.biesheuvel@linaro.org> <20180227015036.GC2261@SZX1000114654> From: Ard Biesheuvel Date: Tue, 27 Feb 2018 09:23:04 +0000 Message-ID: To: Guo Heyi Cc: "edk2-devel@lists.01.org" , Laszlo Ersek , Leif Lindholm Subject: Re: [PATCH edk2-platforms 1/2] Platform, Silicon: use DxeRuntimeDebugLibSerialPort for runtime DXE drivers X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2018 09:17:00 -0000 Content-Type: text/plain; charset="UTF-8" On 27 February 2018 at 01:50, Guo Heyi wrote: > Hi Ard, > > Sorry for the late of seeing this patch. I have one question: why don't we > implement a runtime serial port lib, which will switch UART base address in > virtual address map change? I think this will be useful when we want to debug > runtime driver in OS stage. And if we have a runtime version of SerialPortLib, > then we don't need a runtime version of DebugLib which just disable touching > serial port. > Well, only if the serial port is not exposed to the OS as well. The Linux PL011 driver is especially easy to confuse, and having both the firmware and the OS control it at the same time is likely to cause problems. However, I do agree that having the ability to assign a UART to DEBUG at runtime is useful, and so I do intend to create a runtime version of the PL011 library, in which case DxeRuntimeDebugLibSerialPort can be replaced with BaseDebugLibSerialPort for DXE_RUNTIME_DRIVER modules.