From: Leith Bade <leith@bade.nz>
To: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com,
frank-w@public-files.de
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, didi.debian@cknow.org,
Leith Bade <leith@bade.nz>
Subject: [PATCH 2/4] arm64: dts: mediatek: mt7986: add gpio-hog for boot mode switch on BPI-R3
Date: Thu, 27 Jun 2024 17:58:54 +1000 [thread overview]
Message-ID: <20240627075856.2314804-3-leith@bade.nz> (raw)
In-Reply-To: <20240627075856.2314804-1-leith@bade.nz>
To avoid future pin conflicts with the boot mode dip switch (SW1), add
a gpio-hog to document the two GPIOs it is connected to. If another device
attempts to then claim the pins a log message will get printed.
The BPI-R3 has a four position DIP switch (labelled SW1), that is used to
configure the boot mode. The first two positions (labelled A & B)
configure two bootstrap pins on the MT7986 that select which flash chip
the boot ROM will load the second stage bootloader from. The third
position toggles chip select lines to select between the NOR or NAND chip
on the SPI0 bus. The fourth position toggles chip select lines to select
between the eMMC chip or SD card on the MMC0 bus.
Only the first two positions are connected to GPIO pins on the MT7986. In
the public schematic for the BPI-R3 (titled "BPI-R3-MT7986A",
revision "V1.1", sheet 4), these are the MT7986 (U1E) pins GPIO_0 (GPIO5)
and GPIO_1 (GPIO6). This gpio-hog configures the two boot mode pins as
inputs.
Signed-off-by: Leith Bade <leith@bade.nz>
---
arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
index 951612ea1e66..2cccbec39d34 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
@@ -235,6 +235,13 @@ &pcie_phy {
};
&pio {
+ boot_mode_hog: boot-mode-hog {
+ gpio-hog;
+ gpios = <5 GPIO_ACTIVE_HIGH>,
+ <6 GPIO_ACTIVE_HIGH>;
+ input;
+ };
+
i2c_pins: i2c-pins {
mux {
function = "i2c";
--
2.25.1
next prev parent reply other threads:[~2024-06-27 7:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-27 7:58 [PATCH 0/4] fix up pin definitions for BPI-R3 board Leith Bade
2024-06-27 7:58 ` [PATCH 1/4] arm64: dts: mediatek: mt7986: fix the switch reset line on BPI-R3 Leith Bade
2024-07-30 9:18 ` AngeloGioacchino Del Regno
2024-06-27 7:58 ` Leith Bade [this message]
2024-07-03 11:39 ` [PATCH 2/4] arm64: dts: mediatek: mt7986: add gpio-hog for boot mode switch " kernel test robot
2024-07-04 7:41 ` Krzysztof Kozlowski
2024-07-04 8:56 ` Philip Li
2024-06-27 7:58 ` [PATCH 3/4] arm64: dts: mediatek: mt7986: add missing pin groups to BPI-R3 Leith Bade
2024-06-27 7:58 ` [PATCH 4/4] arm64: dts: mediatek: mt7986: add missing UART1 CTS/RTS pins in BPI-R3 Leith Bade
2024-07-30 9:18 ` AngeloGioacchino Del Regno
2024-06-27 14:48 ` [PATCH 0/4] fix up pin definitions for BPI-R3 board Rob Herring (Arm)
2024-06-29 23:06 ` Leith Bade
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240627075856.2314804-3-leith@bade.nz \
--to=leith@bade.nz \
--cc=angelogioacchino.delregno@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=didi.debian@cknow.org \
--cc=frank-w@public-files.de \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox