From: "Marty E. Plummer" <hanetzer@startmail.com>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Simon Glass <sjg@chromium.org>,
Kever Yang <kever.yang@rock-chips.com>,
Philipp Tomsich <philipp.tomsich@theobroma-systems.com>,
"Marty E. Plummer" <hanetzer@startmail.com>,
Artem Lapkin <email2tema@gmail.com>,
Philipp Tomsich <philipp.tomsich@vrull.eu>,
Quentin Schulz <quentin.schulz@theobroma-systems.com>,
Xavier Drudis Ferran <xdrudis@tinet.cat>,
linux-rockchip@lists.infradead.org
Subject: [RFC PATCH 4/4] rockchip: rk3399: attempt to redirect uart2dbga to sdcard
Date: Thu, 22 Sep 2022 01:47:03 -0500 [thread overview]
Message-ID: <20220922064704.1740759-5-hanetzer@startmail.com> (raw)
In-Reply-To: <20220922064704.1740759-1-hanetzer@startmail.com>
The meat of my problem. rk3399 has the ability to redirect uart2 to
sdcard pins. This setup half works; I can push input into the uart, but
not see output.
Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
---
arch/arm/dts/rk3399-gru.dtsi | 7 ++-----
arch/arm/dts/rk3399.dtsi | 4 ++--
.../arm/include/asm/arch-rockchip/grf_rk3399.h | 3 +++
arch/arm/mach-rockchip/rk3399/rk3399.c | 18 +++++++++---------
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi
index b80f19066b..8c87c1cf19 100644
--- a/arch/arm/dts/rk3399-gru.dtsi
+++ b/arch/arm/dts/rk3399-gru.dtsi
@@ -510,7 +510,7 @@ ap_i2c_audio: &i2c8 {
};
&sdmmc {
- status = "okay";
+ status = "disabled";
/*
* Note: configure "sdmmc_cd" as card detect even though it's actually
@@ -520,14 +520,11 @@ ap_i2c_audio: &i2c8 {
* turned on that the system will still make sure the port is
* configured as SDMMC and not JTAG.
*/
- pinctrl-names = "default";
- pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_cd_pin
- &sdmmc_bus4>;
bus-width = <4>;
cap-mmc-highspeed;
cap-sd-highspeed;
- cd-gpios = <&gpio4 24 GPIO_ACTIVE_LOW>;
+ // cd-gpios = <&gpio4 24 GPIO_ACTIVE_LOW>;
disable-wp;
sd-uhs-sdr12;
sd-uhs-sdr25;
diff --git a/arch/arm/dts/rk3399.dtsi b/arch/arm/dts/rk3399.dtsi
index 3871c7fd83..55d5ee15be 100644
--- a/arch/arm/dts/rk3399.dtsi
+++ b/arch/arm/dts/rk3399.dtsi
@@ -638,7 +638,7 @@
reg-shift = <2>;
reg-io-width = <4>;
pinctrl-names = "default";
- pinctrl-0 = <&uart2c_xfer>;
+ pinctrl-0 = <&uart2a_xfer>;
status = "disabled";
};
@@ -2571,7 +2571,7 @@
uart2a_xfer: uart2a-xfer {
rockchip,pins =
<4 RK_PB0 2 &pcfg_pull_up>,
- <4 RK_PB1 2 &pcfg_pull_none>;
+ <4 RK_PB1 2 &pcfg_pull_up>;
};
};
diff --git a/arch/arm/include/asm/arch-rockchip/grf_rk3399.h b/arch/arm/include/asm/arch-rockchip/grf_rk3399.h
index 658cc0dfc4..e1bfa31af7 100644
--- a/arch/arm/include/asm/arch-rockchip/grf_rk3399.h
+++ b/arch/arm/include/asm/arch-rockchip/grf_rk3399.h
@@ -554,6 +554,9 @@ enum {
/* GRF_SOC_CON7 */
GRF_UART_DBG_SEL_SHIFT = 10,
GRF_UART_DBG_SEL_MASK = 3 << GRF_UART_DBG_SEL_SHIFT,
+ // assumptions, none of this is documented in the TRM as far as I can see
+ GRF_UART_DBG_SEL_A = 0,
+ GRF_UART_DBG_SEL_B = 1,
GRF_UART_DBG_SEL_C = 2,
/* GRF_SOC_CON20 */
diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c
index 21db03b961..7d35e524dc 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -157,17 +157,17 @@ void board_debug_uart_init(void)
GPIO_PULL_NORMAL);
}
- /* Enable early UART2 channel C on the RK3399 */
- rk_clrsetreg(&grf->gpio4c_iomux,
- GRF_GPIO4C3_SEL_MASK,
- GRF_UART2DGBC_SIN << GRF_GPIO4C3_SEL_SHIFT);
- rk_clrsetreg(&grf->gpio4c_iomux,
- GRF_GPIO4C4_SEL_MASK,
- GRF_UART2DBGC_SOUT << GRF_GPIO4C4_SEL_SHIFT);
- /* Set channel C as UART2 input */
+ /* Enable early UART2 channel A on the RK3399 */
+ rk_clrsetreg(&grf->gpio4b_iomux,
+ GRF_GPIO4B0_SEL_MASK,
+ GRF_UART2DBGA_SIN << GRF_GPIO4B0_SEL_SHIFT);
+ rk_clrsetreg(&grf->gpio4b_iomux,
+ GRF_GPIO4B1_SEL_MASK,
+ GRF_UART2DBGA_SOUT << GRF_GPIO4B0_SEL_SHIFT);
+ /* Set channel A as UART2 input */
rk_clrsetreg(&grf->soc_con7,
GRF_UART_DBG_SEL_MASK,
- GRF_UART_DBG_SEL_C << GRF_UART_DBG_SEL_SHIFT);
+ GRF_UART_DBG_SEL_A << GRF_UART_DBG_SEL_SHIFT);
#endif
}
#endif
--
2.37.3
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2022-09-22 6:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-22 6:46 [RFC PATCH 0/4] Alternative debug outputs for rockchip devices Marty E. Plummer
2022-09-22 6:47 ` [RFC PATCH 1/4] rockchip: rk3288: enable u-boot.rom for speedy Marty E. Plummer
2022-09-28 10:20 ` Simon Glass
2022-09-22 6:47 ` [RFC PATCH 2/4] rockchip: rk3288: enable uart2->usb redirection Marty E. Plummer
2022-09-28 10:20 ` Simon Glass
2022-09-22 6:47 ` [RFC PATCH 3/4] rockchip: rk3399: fix typo in grf file Marty E. Plummer
2022-09-28 10:20 ` Simon Glass
2022-09-22 6:47 ` Marty E. Plummer [this message]
2022-09-28 10:20 ` [RFC PATCH 4/4] rockchip: rk3399: attempt to redirect uart2dbga to sdcard Simon Glass
2022-09-29 3:24 ` Marty E. Plummer
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=20220922064704.1740759-5-hanetzer@startmail.com \
--to=hanetzer@startmail.com \
--cc=email2tema@gmail.com \
--cc=kever.yang@rock-chips.com \
--cc=linux-rockchip@lists.infradead.org \
--cc=philipp.tomsich@theobroma-systems.com \
--cc=philipp.tomsich@vrull.eu \
--cc=quentin.schulz@theobroma-systems.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
--cc=xdrudis@tinet.cat \
/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;
as well as URLs for NNTP newsgroup(s).