From: Josua Mayer <josua@solid-run.com>
To: u-boot@lists.denx.de
Cc: alvaro.karsz@solid-run.com, Josua Mayer <josua@solid-run.com>,
Baruch Siach <baruch@tkos.co.il>,
Fabio Estevam <festevam@gmail.com>
Subject: [PATCH] mx6cuboxi: fix board detection while patching device-tree phy nodes
Date: Thu, 16 Jun 2022 11:40:15 +0300 [thread overview]
Message-ID: <20220616084015.13932-1-josua@solid-run.com> (raw)
ft_board_setup relies on the board_type() function to optimize which phy
nodes need to be enabled for Linux.
Add calls to setup and release the board-detect GPIOs.
Also fix the switch-case statement to only enable phy address 4 for
Cubox and unknown devices.
Fixes: 741ce308 ("mx6cuboxi: fixup dtb ethernet phy nodes before booting an OS")
Signed-off-by: Josua Mayer <josua@solid-run.com>
---
board/solidrun/mx6cuboxi/mx6cuboxi.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c
index 42aa5cb63c..debf4f6a3b 100644
--- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
+++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
@@ -449,15 +449,26 @@ int ft_board_setup(void *fdt, struct bd_info *bd)
int node_phy0, node_phy1, node_phy4;
int ret, phy;
bool enable_phy0 = false, enable_phy1 = false, enable_phy4 = false;
+ enum board_type board;
+
+ // detect device
+ request_detect_gpios();
+ board = board_type();
+ free_detect_gpios();
// detect phy
phy = find_ethernet_phy();
if (phy == 0 || phy == 4) {
enable_phy0 = true;
- switch (board_type()) {
+ switch (board) {
+ case HUMMINGBOARD:
+ case HUMMINGBOARD2:
+ /* atheros phy may appear only at address 0 */
+ break;
case CUBOXI:
case UNKNOWN:
default:
+ /* atheros phy may appear at either address 0 or 4 */
enable_phy4 = true;
}
} else if (phy == 1) {
--
2.35.3
next reply other threads:[~2022-06-16 8:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-16 8:40 Josua Mayer [this message]
2022-07-25 16:41 ` [PATCH] mx6cuboxi: fix board detection while patching device-tree phy nodes sbabic
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=20220616084015.13932-1-josua@solid-run.com \
--to=josua@solid-run.com \
--cc=alvaro.karsz@solid-run.com \
--cc=baruch@tkos.co.il \
--cc=festevam@gmail.com \
--cc=u-boot@lists.denx.de \
/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