From patchwork Tue Feb 13 01:51:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zev Weiss X-Patchwork-Id: 200175 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp276576dyb; Mon, 12 Feb 2024 17:53:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXb2IRu+IJDuROmyXE0ypgXUDw/ixNI01NAIPiy+d3QRkISVGHvkE+k4qvGL86ugItfmZ+gWNt9/otvo1uXjm1NbuJu7Q== X-Google-Smtp-Source: AGHT+IGKVbYuvOmGZpozApGes229F3LY/ROrhXwGGXZ3kTMOu2wQom4qqERW05JusdewZaPYIhYe X-Received: by 2002:a17:902:da90:b0:1d7:407e:418d with SMTP id j16-20020a170902da9000b001d7407e418dmr1732144plx.26.1707789197153; Mon, 12 Feb 2024 17:53:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707789197; cv=pass; d=google.com; s=arc-20160816; b=T2itBllLb/GinBbOgVFP2wGy7jDO+MGgzJ4WztclILR6IALMWoah1FOlw9NSjjgrzJ s82CMRsRdMMNEXdzMI5On6lUgVysSU67eE3Whn5VLwT9igDVw6XAozS16QPjPuooBQS6 szJD7dRba+n6Mj5E7Ew6Xmm9tpsWXtSq9nTW6mmPjgt89XBM8W+CM3enntQQUjOyPODI 5UE7OW8xdYJBGq16kvS8zu03HAvUCuDom647eG/m3ClWeL4tByE1GcdldTLtVJkPf+RF /Ho4rS6KeCNRLsp7BlNnFskPHgSfDpuRZo3uBvIMJbafgjCnzkiTAsrSkK7MjjSGnT47 wuHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=EU+GYVFoVSrVPFH+I5Rq0CxlWwOPwFjuP4K4HYrpXM4=; fh=wBUXCP0XE6sl4kR+yF0XwuZLknMpup37wgR/fOTU7ps=; b=cj5hORcD1GJiWuM/2s/IAcmELc8ppZU9MBlIA8eQyNcrmAx62oPieGGadPdpgzZkmO UZugFntO7XSyXMpY5l1K4IKE7A7+AS8ebYRDSkt5izNXjMGvoIbpDwkbkZ0llysgAazG /WYhxbJODNl9UB3MvH6KN7ejjGWZ3OOkfZg1mc9ZnNUILEn9n1eNwfrJC9iQqBUw0vQK zBZKkjE5IEcygoAfMU3ZbujRvFp4BRSj/qRwGCh/Bwj6ZIzdiC+PwdyiFqCUrOBUhbLM jz1ydH0PEKJagQEZE3Lf/HT+TDRJ2U63mudTPTRJkxlZXMSEwIPuyHMWOGD9Z3BDCqN1 wCqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bewilderbeest.net header.s=thorn header.b="cm+vuK/f"; arc=pass (i=1 spf=pass spfdomain=bewilderbeest.net dkim=pass dkdomain=bewilderbeest.net dmarc=pass fromdomain=bewilderbeest.net); spf=pass (google.com: domain of linux-kernel+bounces-62871-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62871-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=bewilderbeest.net X-Forwarded-Encrypted: i=2; AJvYcCUGT4V+JS4JbcKJbVHH11PkPMh0nGNGDMdFRyVJ3jW3+kn6thNXohU1drhzCe90sxEO1UFxOrBC44s+WmqX7eVL8nLmYA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u12-20020a170902b28c00b001d8ff334318si1149984plr.176.2024.02.12.17.53.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 17:53:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62871-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@bewilderbeest.net header.s=thorn header.b="cm+vuK/f"; arc=pass (i=1 spf=pass spfdomain=bewilderbeest.net dkim=pass dkdomain=bewilderbeest.net dmarc=pass fromdomain=bewilderbeest.net); spf=pass (google.com: domain of linux-kernel+bounces-62871-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62871-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=bewilderbeest.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E6189286C42 for ; Tue, 13 Feb 2024 01:53:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 578CBBA27; Tue, 13 Feb 2024 01:52:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=bewilderbeest.net header.i=@bewilderbeest.net header.b="cm+vuK/f" Received: from thorn.bewilderbeest.net (thorn.bewilderbeest.net [71.19.156.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A19DFA937; Tue, 13 Feb 2024 01:52:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=71.19.156.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707789123; cv=none; b=f8d4w/XTKaKSYSZ4zn6Z4r0zE3F3verk3zuJdoZuLX6N4A+1cfQskkFgFLugVK76aTd3rHy2wuoeImkTa9xVno/TWfoHMV5MAm6rc4CFIbPC8dzjSy/KV0d8ecXypm/lFepzAhlHrZ5GUh+E+LkgTCSHKfwmicijA4rFQsKThaA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707789123; c=relaxed/simple; bh=TWXO2hZBdIqovo/18+auLeZhmPNeyNftRZkYDtp07Kw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MbCCurC73vtgZ5w4N5T6hMsMZ1KTV2LJTsg8oFTXm3BYfXsph26SENjBfbpCxmTfBexMqsZbbA4pAaAnHm2yVH1fmVxqW998RcbS6zAyc1lNI3moXEVBS9TgvgbQK4IYQQHERer9IYz+OqrQ4w587KErq30ZuJbHUVidfWmhts8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bewilderbeest.net; spf=pass smtp.mailfrom=bewilderbeest.net; dkim=pass (1024-bit key) header.d=bewilderbeest.net header.i=@bewilderbeest.net header.b=cm+vuK/f; arc=none smtp.client-ip=71.19.156.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bewilderbeest.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bewilderbeest.net Received: from hatter.bewilderbeest.net (unknown [IPv6:2602:61:712b:6300::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id 07BABA15; Mon, 12 Feb 2024 17:51:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1707789115; bh=EU+GYVFoVSrVPFH+I5Rq0CxlWwOPwFjuP4K4HYrpXM4=; h=From:To:Cc:Subject:Date:From; b=cm+vuK/fGnBwBPyf2B1dtsj6Fmbr2traTegxGV8HfYLApU+8uRoVk+CP30oURWfcS LPkpSr8LYDvy8geca9x+pCT47R8ELbeZVUASM2AktntmXpnVDJ1fyg9McwLcVPw7US TavtV6qXQn+rSnvkc32hJBHfDlsT7lnRJXRNgE/4= From: Zev Weiss To: Joel Stanley , Andrew Jeffery , linux-aspeed@lists.ozlabs.org Cc: Zev Weiss , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org Subject: [PATCH] ARM: dts: aspeed: asrock: Add BIOS SPI flash chips Date: Mon, 12 Feb 2024 17:51:36 -0800 Message-ID: <20240213015138.12452-2-zev@bewilderbeest.net> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790746764837346839 X-GMAIL-MSGID: 1790746764837346839 On e3c246d4i, e3c256d4i, romed8hm3, and spc621d8hm3 the host firmware flash is accessible to the BMC via the AST2500 SPI1 interface with an external GPIO-controlled mux switching the flash chip between the host and the BMC. The default state of the mux GPIO leaves it connected to the host, so the BMC's attempt to bind a driver to it during its boot sequence will fail, but a write to a sysfs 'bind' file after toggling the mux GPIO (along with whatever other preparatory steps are required) can later allow it to be attached and accessed by the BMC. It's not an ideal arrangement, but in the absence of DT overlays or any other alternative it is at least a functional one, if somewhat clumsily so. Signed-off-by: Zev Weiss --- Note that this patch is based on Joel's for-next tree, since the e3c256d4i and spc621d8hm3 device-trees haven't been merged in mainline yet. .../boot/dts/aspeed/aspeed-bmc-asrock-e3c246d4i.dts | 12 ++++++++++++ .../boot/dts/aspeed/aspeed-bmc-asrock-e3c256d4i.dts | 12 ++++++++++++ .../boot/dts/aspeed/aspeed-bmc-asrock-romed8hm3.dts | 12 ++++++++++++ .../dts/aspeed/aspeed-bmc-asrock-spc621d8hm3.dts | 12 ++++++++++++ 4 files changed, 48 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-e3c246d4i.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-e3c246d4i.dts index c4b2efbfdf56..557ce20e305d 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-e3c246d4i.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-e3c246d4i.dts @@ -68,6 +68,18 @@ flash@0 { }; }; +&spi1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_spi1_default>; + flash@0 { + status = "okay"; + label = "bios"; + m25p,fast-read; + spi-max-frequency = <25000000>; /* 25 MHz */ + }; +}; + &uart5 { status = "okay"; }; diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-e3c256d4i.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-e3c256d4i.dts index 263fcc8106ff..bf752ff8204f 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-e3c256d4i.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-e3c256d4i.dts @@ -69,6 +69,18 @@ flash@0 { }; }; +&spi1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_spi1_default>; + flash@0 { + status = "okay"; + label = "bios"; + m25p,fast-read; + spi-max-frequency = <25000000>; /* 25 MHz */ + }; +}; + &uart1 { status = "okay"; }; diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-romed8hm3.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-romed8hm3.dts index 4554abf0c7cd..8dff2cbf042b 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-romed8hm3.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-romed8hm3.dts @@ -56,6 +56,18 @@ flash@0 { }; }; +&spi1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_spi1_default>; + flash@0 { + status = "okay"; + label = "bios"; + m25p,fast-read; + spi-max-frequency = <33000000>; /* 33 MHz */ + }; +}; + &uart5 { status = "okay"; }; diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-spc621d8hm3.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-spc621d8hm3.dts index 555485871e7a..54b40776c7e3 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-spc621d8hm3.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-spc621d8hm3.dts @@ -66,6 +66,18 @@ flash@0 { }; }; +&spi1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_spi1_default>; + flash@0 { + status = "okay"; + label = "bios"; + m25p,fast-read; + spi-max-frequency = <17000000>; /* 17 MHz */ + }; +}; + &uart5 { status = "okay"; };