From nobody Sat Nov 30 02:51:45 2024 Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EF041BD01E for ; Thu, 12 Sep 2024 17:39:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726162750; cv=none; b=MOoP0xRL3jVVtpms+dLxoPD7WKMfcKfWIqsdLnUy2+nm4muMdE1LXyvSWXNOua8VhvZ0yp9vlr8wPM6x5XjHu0JezTkjM1lv75gVMpHSknkWO+3v/WnYoWkqQaKXPPOccZUZRYPEHhKmKy8yfEWxQOjoBl/V8dupug8sOmur7xk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726162750; c=relaxed/simple; bh=trPHxilhW2oQjHu87GszVwwwDkweNgsvTDl73YHBlYM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p0LEiOGHhJ8EhBPqnnmQeBmCMgiOHvoX1xlh9nMzy24Be0/koxgn1+zOzxVRDncDzfw34YOgkUVm9k+6acaq09SKt5PuPXXIh3kP8XLNw+eMAbagFujxqUQtjpd2PyvJGxZDP2qdegk0tF1+1nFq26hGORscGLP6UrTTnIBjLO0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=i4b0atWb; arc=none smtp.client-ip=209.85.166.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="i4b0atWb" Received: by mail-il1-f178.google.com with SMTP id e9e14a558f8ab-3a0220c2c6bso5546725ab.0 for ; Thu, 12 Sep 2024 10:39:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726162747; x=1726767547; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Sf/bniYlfRZYtTAiPueeb667UzLVb/sHpgqtAEqZ4pY=; b=i4b0atWb4UH/DYTK80I8JccIpQUzFG8s8vX71cSawAuw6p6hOXOZ7jQOrVIN6DITpv GqlUX5XYVMjXPIzu73kU9jsPQBxN3j80omSu5zLpcpDWQB7rEmjpwMR38oSIWVxl99Yt CbGlv+FrswpNvaTbjyWDQEWW3hA97nQVQ2tTM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726162747; x=1726767547; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Sf/bniYlfRZYtTAiPueeb667UzLVb/sHpgqtAEqZ4pY=; b=ruT/nm83UvwT3/29bbNchXKs690ICO1yFzHhoyXYHaBOGCU4e4Uvn904qX5Q4nQJ3D GjLbG3lK94KbCc1nu6pgWd+/rTnfiSd44lfmiwYkI8+10OV4rC2KfQ0B9QKVqfHAcXma bJUkUBfGqRbU2Y1prVnC2YcaW2Zas8iLAZ+ZdJf5NsGLNDlnd1mog66Coi+y0uFr3T1j EtmBd5Ofsj0jtzg+RrWhO9Ui1ZutJki+UoybhundQpYsG2Zv9OQfA0yh0+QkJChoURyt mSzI7fKmwZY3EAUOf5TadvXVk9smbaH/V4q6xVrD7VTh5kiqAI5P9MBwe6lU57lR8nK0 f76w== X-Forwarded-Encrypted: i=1; AJvYcCUmu4fG/u6s4lTC8Z+NTZzhsOVAXKlBoRRhZ0f/1J5N073X61zyTbu1KLwSrul8wpUrK7DgaRIpZgl6b7w=@vger.kernel.org X-Gm-Message-State: AOJu0YyLms2FhreWMFBsGgiFjmKe1qKUM3dOi2it1ppMQPuE6c/WyaY2 1Zq2rwy43q948c+UIxm9SD1KVoynlnYDqFY4uO6En1nofgECXfaE/3r+mPs74Q== X-Google-Smtp-Source: AGHT+IExDtgB/Ne9u3i8tSQpAY6TV0WOITGF0nQgTQhik+IHprM4Ev1fywxaGsBdNhJ6OdksXiIa1g== X-Received: by 2002:a05:6e02:164f:b0:39b:330b:bb25 with SMTP id e9e14a558f8ab-3a0848f7e52mr36649725ab.12.1726162747309; Thu, 12 Sep 2024 10:39:07 -0700 (PDT) Received: from rrangel920.bld.corp.google.com (h24-56-189-226.arvdco.broadband.dynamic.tds.net. [24.56.189.226]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3a05900e618sm32570135ab.55.2024.09.12.10.39.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 10:39:06 -0700 (PDT) From: Raul E Rangel To: linux-serial@vger.kernel.org Cc: pmladek@suse.com, rafael.j.wysocki@intel.com, ribalda@chromium.org, Raul E Rangel , Adrian Ratiu , "Borislav Petkov (AMD)" , Ingo Molnar , Jonathan Corbet , Josh Poimboeuf , "Paul E. McKenney" , Thomas Gleixner , Xiongwei Song , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] Documentation: kernel-parameters: Add uartclk to console=uart Date: Thu, 12 Sep 2024 11:36:19 -0600 Message-ID: <20240912113616.1.Ic8770cb6e660110359b245808105e5310d3fa528@changeid> X-Mailer: git-send-email 2.46.0.662.g92d0881bb0-goog In-Reply-To: <20240912173901.3969597-1-rrangel@chromium.org> References: <20240912173901.3969597-1-rrangel@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The console=3DuartXXXXX parameter is just an alias for earlycon=3DuartXXXX. This means it also accepts the uartclk parameter. Signed-off-by: Raul E Rangel Reviewed-by: Petr Mladek --- Documentation/admin-guide/kernel-parameters.txt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentatio= n/admin-guide/kernel-parameters.txt index bc1036e73bc0b4..cd3d44db60457d 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -788,20 +788,16 @@ Documentation/networking/netconsole.rst for an alternative. =20 - uart[8250],io,[,options] - uart[8250],mmio,[,options] - uart[8250],mmio16,[,options] - uart[8250],mmio32,[,options] + uart[8250],io,[,options[,uartclk]] + uart[8250],mmio,[,options[,uartclk]] + uart[8250],mmio16,[,options[,uartclk]] + uart[8250],mmio32,[,options[,uartclk]] uart[8250],0x[,options] Start an early, polled-mode console on the 8250/16550 UART at the specified I/O port or MMIO address, switching to the matching ttyS device later. - MMIO inter-register address stride is either 8-bit - (mmio), 16-bit (mmio16), or 32-bit (mmio32). - If none of [io|mmio|mmio16|mmio32], is assumed - to be equivalent to 'mmio'. 'options' are specified in - the same format described for ttyS above; if unspecified, - the h/w is not re-initialized. + + See the documentation for earlycon=3Duart =20 hvc Use the hypervisor console device . This is for both Xen and PowerPC hypervisors. --=20 2.46.0.662.g92d0881bb0-goog From nobody Sat Nov 30 02:51:45 2024 Received: from mail-il1-f171.google.com (mail-il1-f171.google.com [209.85.166.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F3FF1BF7F8 for ; Thu, 12 Sep 2024 17:39:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726162751; cv=none; b=rZrpzT/9ra7q8i5DbDzr02/jI/TTVkXaRq0CRII+/dxc8zPnRRiNwfdu6Uleji1vO1FcwH0B42rj7J2ouBp5EOLlljATrxVEX/e9R0O0+oLRLr3MudpA9quCxakAZbz7Lp9iRe0qL9WbLb7zh55oDjCA8f7F1nPMJjJICe2sKSA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726162751; c=relaxed/simple; bh=0j+r3D4/vHRDqFdTBnrhpTncxEtjKeJFxIg/Fe+um0k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Gq9iHreiMNuF938Qpifq+DAoq2LnKhYdaFpaQq5say+LXFz1OdwLhauyz+hocut46F2gBTvHRfs1xHqKFbvzzIyWP/6uMbafur801YgbZLSX2ACxrsQn+z8TUP0EHLIguzNVbP5Vn1Pnl6NOzeCme1fsgVIIt75toB/NocILQNY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=RqaS7sMy; arc=none smtp.client-ip=209.85.166.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="RqaS7sMy" Received: by mail-il1-f171.google.com with SMTP id e9e14a558f8ab-3a043390078so5742045ab.2 for ; Thu, 12 Sep 2024 10:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726162749; x=1726767549; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RYt+A7Qz0DxrKrXBCekZqUkGqVOmvoE4JK6g0PIC+r4=; b=RqaS7sMydEkCYOirmNM7Whci/GTagfhO2yq4vhK5viG6xyd6gubbCr8W8H82GTx+RP GG75kX3nweaodVvlQWZcNNttBSDQAuj1aLigluu27a9tAFab3zvxdtCCzeTltO5fa8sk vA7gA/2GQayUeFs0JwDLYUzCsBrNUGn4x2cm8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726162749; x=1726767549; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RYt+A7Qz0DxrKrXBCekZqUkGqVOmvoE4JK6g0PIC+r4=; b=dBHY6/y5ZlaWBltIJdGniqIdsPKp6jTCdCf7ugefKftATdFwxc0B9H9Dr7ZtlSCdTZ NAzvDEF5hCxMw0rfHEDA/QrtE91uY7qf95z92/Y1vIiY6ysQwSx9JS0Nh+fc0Ap5RkNP NCNQW+52EOD9pv9cXwLbQjQO6zhkeoJtBYitXW//JOH/CB/i06/UfSQ178YqTrEzN7tf cmlQse94tyiL0HFx7a5bEJv3Yfn6ceQlEtpVGALy7S4DXO8Tw/zPwbr4bohBatQfk+Gm 0KL5Yoo4jwv0qt/yGffIH2cBpodGOTAzgS3k4aAzARhmwj0vPi0P8xH9YQkFp6Nq2Ghl oS6A== X-Forwarded-Encrypted: i=1; AJvYcCXI20aoJJoMQhG7DHjMzv3rtDiSy5hXuat9B8ryRjIqa36t1dHfSs2WuevVi/DtHj9FVnWl/GROq1sOhLE=@vger.kernel.org X-Gm-Message-State: AOJu0YwNNvUkeZAiGQ7Bv6WJ96kGs8Ul+G8+w2U1YyhAP/3HmccBsNLs g6LFF6I4TzJPOMubwM6sxHNns9Tkq5p2+IegXIlIJKuIi5qZITBTKQXr9VkIXw== X-Google-Smtp-Source: AGHT+IEqzTdHtHBgFzNgHRzsE01wHflT3gH7y3dm6Xqs8f94BX69hzCdMeg7I8pPaKSZ66QnBGr95A== X-Received: by 2002:a05:6e02:1d01:b0:3a0:4e2b:9ab9 with SMTP id e9e14a558f8ab-3a0848ac8efmr41082335ab.5.1726162749028; Thu, 12 Sep 2024 10:39:09 -0700 (PDT) Received: from rrangel920.bld.corp.google.com (h24-56-189-226.arvdco.broadband.dynamic.tds.net. [24.56.189.226]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3a05900e618sm32570135ab.55.2024.09.12.10.39.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 10:39:08 -0700 (PDT) From: Raul E Rangel To: linux-serial@vger.kernel.org Cc: pmladek@suse.com, rafael.j.wysocki@intel.com, ribalda@chromium.org, Raul E Rangel , Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] earlycon: Print a notice when uartclk is unknown Date: Thu, 12 Sep 2024 11:36:20 -0600 Message-ID: <20240912113616.2.Id2235082fc6c2d238789dfc3ee923492e9ed7387@changeid> X-Mailer: git-send-email 2.46.0.662.g92d0881bb0-goog In-Reply-To: <20240912173901.3969597-1-rrangel@chromium.org> References: <20240912173901.3969597-1-rrangel@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When trying to construct an earlycon=3Duart parameter it's hard to debug why it's not working. In my specific case it was because the default uartclk earlycon assumes doesn't match my hardware. This change adds a notice so that the user is made aware of that this assumption is being made. This should hopefully lead to them adding a option to their earlycon parameter. Booting with `console=3Duart,mmio32,0xfedc9000,115200n8`: [ 0.000000] earlycon: uart: Unknown uartclk, assuming 1843200hz [ 0.000000] earlycon: uart0 at MMIO32 0x00000000fedc9000 (options '11520= 0n8') Signed-off-by: Raul E Rangel Acked-by: Greg Kroah-Hartman Reviewed-by: Petr Mladek --- drivers/tty/serial/earlycon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index ab9af37f6cda35..5a8fe0cb3b1986 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -145,8 +145,12 @@ static int __init register_earlycon(char *buf, const s= truct earlycon_id *match) buf =3D NULL; =20 spin_lock_init(&port->lock); - if (!port->uartclk) + if (!port->uartclk) { port->uartclk =3D BASE_BAUD * 16; + if (early_console_dev.baud) + pr_notice("%s: Unknown uartclk, assuming %dhz", + match->name, port->uartclk); + } if (port->mapbase) port->membase =3D earlycon_map(port->mapbase, 64); =20 --=20 2.46.0.662.g92d0881bb0-goog From nobody Sat Nov 30 02:51:45 2024 Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 780151BF80D for ; Thu, 12 Sep 2024 17:39:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726162753; cv=none; b=OBNDnEm+HgRWMr/GnT4/Q/p3l52ZCPg0+XofpIROBDBn4Hxi3dQnl5k9EzQlHHYBnKQ4lxEMx0HdPGsfMv7SzE7IVwLcrJpq4Gyv7xFaQ72hDxcgjaAV/nuPbyC1q3s8m5uJE3I9YEyMGHr4Gmm+v0fdRTXWdxSVGv1m60p2exE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726162753; c=relaxed/simple; bh=sdvuNJYXbnl+iyClqdVA5O83W4ftzy+TWXXAq64uN7o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dHVPNd7IeG20NNGBOQopXP6203m16AlQ3CmS9cXTRZtH203o/gxh1BDGD0qYg4Leczi2+ivzxIR8925NJZplSJ9WiNAOf0wMXwbVCdfxI5Mv/vE3YU0IwGWmUnt5Zupe6gHnQ4dKVM7E/3qbeDyO7fSvmRH/2LSIH9wMNm99SBM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=U1Y3vEOI; arc=none smtp.client-ip=209.85.166.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="U1Y3vEOI" Received: by mail-il1-f182.google.com with SMTP id e9e14a558f8ab-39f49600297so5076515ab.1 for ; Thu, 12 Sep 2024 10:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1726162750; x=1726767550; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qECmHjc9dK1dFT5mGpczd6pcWBHqdXTgofYQGynhgPc=; b=U1Y3vEOItKe8tEuj3rwDpOKtrApa7FG5bxRYPzR0tof42evGHKbnPzFBXaUQsS6KTT znu39CIx0KyRHwig0KURQgTIhGoccC4LB8vDWMzuInXsTft2w3Ggc+qjLR+fzAwEQsgi pj+O5eR0jv35WqhXYJX0RAUKTjBJeN4f1nVCY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726162750; x=1726767550; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qECmHjc9dK1dFT5mGpczd6pcWBHqdXTgofYQGynhgPc=; b=LbWOKYeqMw3E+H2ONdrZkeKVGNXY4qaDrTSxKSDxUqdf3NTa1JfuE7uXPSLJsK60Oy aG17jK80+1QKoMKcibBkE777Y+4oIGGiiLvs7GP31EC3qsnDjSkGrSMBhVvYNq+vsW5+ gxGl/zIob4U4Yy0fEZVyKP4trPqwsn70Rlo3VdfVj6QrbHgy5R2dr88ETVZ968BSdnw9 YYgowFj3I4nwekAsbq+OcibYVukSoN/SZQLSpetngqabpKgU1lByCqvavhhhdLtgE8tm zNtVJReco/BJhB+4tzc5tzmkTxLtawmYSe4OtojwNDC2Gr4aLtBp+ZQLJBJjtVprnn+4 8lHw== X-Forwarded-Encrypted: i=1; AJvYcCVjKJI32DObioVNoJPycwDT/40pudnv9SZ5qhLPqO/gwvi8tOYJ0hUUTkuyjohnPlCu/XNcwiI6VTmXmn8=@vger.kernel.org X-Gm-Message-State: AOJu0YyjTH46JX4VQKSa9IfqciUr7mvLjJIS0iH5z/UbLQPixuFjhBWH XVpkYE2/P7fELo+FBxmaMeOPO5X6KYjbDLenzjwVLYMgaddN2f26mNFDmb9hlg== X-Google-Smtp-Source: AGHT+IHL4MH+QIKEB9bCMel4ROL7d0o5CwGYlEvbEC0U2AMuWF6C9AaGEEJwAGhel0XN8qNUrPvZtg== X-Received: by 2002:a92:c24d:0:b0:39f:6fcc:fcc with SMTP id e9e14a558f8ab-3a0848ae8c0mr36173705ab.4.1726162750451; Thu, 12 Sep 2024 10:39:10 -0700 (PDT) Received: from rrangel920.bld.corp.google.com (h24-56-189-226.arvdco.broadband.dynamic.tds.net. [24.56.189.226]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3a05900e618sm32570135ab.55.2024.09.12.10.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 10:39:09 -0700 (PDT) From: Raul E Rangel To: linux-serial@vger.kernel.org Cc: pmladek@suse.com, rafael.j.wysocki@intel.com, ribalda@chromium.org, Raul E Rangel , Len Brown , "Rafael J. Wysocki" , Robert Moore , acpica-devel@lists.linux.dev, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] ACPI: SPCR: Add support for rev 3 Date: Thu, 12 Sep 2024 11:36:21 -0600 Message-ID: <20240912113616.3.I1b7a5033a2191cb0cdbadc2d51666a97f16cc663@changeid> X-Mailer: git-send-email 2.46.0.662.g92d0881bb0-goog In-Reply-To: <20240912173901.3969597-1-rrangel@chromium.org> References: <20240912173901.3969597-1-rrangel@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Revision 3 supports specifying the UART input clock. This allows for proper computation of the UART divisor when the baud rate is specified. The earlycon code can accept the following format (See `parse_options` in `earlycon.c`.): * ,io|mmio|mmio32|mmio32be,,,, This change makes it so the uartclk is passed along if it's defined in the SPCR table. Booting with `earlycon` and a SPCR v3 table that has the uartclk and baud defined: [ 0.028251] ACPI: SPCR: console: uart,mmio32,0xfedc9000,115200,48000000 [ 0.028267] earlycon: uart0 at MMIO32 0x00000000fedc9000 (options '11520= 0,48000000') [ 0.028272] printk: legacy bootconsole [uart0] enabled Link: https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/s= erial-port-console-redirection-table Signed-off-by: Raul E Rangel Reviewed-by: Petr Mladek --- drivers/acpi/spcr.c | 5 ++++- include/acpi/actbl3.h | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c index cd36a97b0ea2c7..67ae42afcc59ef 100644 --- a/drivers/acpi/spcr.c +++ b/drivers/acpi/spcr.c @@ -209,9 +209,12 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool = enable_console) if (!baud_rate) { snprintf(opts, sizeof(opts), "%s,%s,0x%llx", uart, iotype, table->serial_port.address); - } else { + } else if (table->header.revision <=3D 2 || !table->uartclk) { snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype, table->serial_port.address, baud_rate); + } else { + snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d,%d", uart, iotype, + table->serial_port.address, baud_rate, table->uartclk); } =20 pr_info("console: %s\n", opts); diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h index 8f775e3a08fdfb..afe45a2379866a 100644 --- a/include/acpi/actbl3.h +++ b/include/acpi/actbl3.h @@ -92,10 +92,10 @@ struct acpi_table_slit { /*************************************************************************= ****** * * SPCR - Serial Port Console Redirection table - * Version 2 + * Version 3 * * Conforms to "Serial Port Console Redirection Table", - * Version 1.03, August 10, 2015 + * Version 1.08, October 7, 2021 * *************************************************************************= *****/ =20 @@ -120,7 +120,7 @@ struct acpi_table_spcr { u8 pci_function; u32 pci_flags; u8 pci_segment; - u32 reserved2; + u32 uartclk; }; =20 /* Masks for pci_flags field above */ --=20 2.46.0.662.g92d0881bb0-goog