From: Pascal Vizeli <pvizeli@syshack.ch>
To: barebox@lists.infradead.org
Cc: Pascal Vizeli <pvizeli@syshack.ch>
Subject: [PATCH 1/1] common: state: allow to overlay state backend
Date: Sat, 2 Jun 2018 22:39:04 +0000 [thread overview]
Message-ID: <20180602223904.29018-1-pvizeli@syshack.ch> (raw)
This allow to use overlay for state backends. I.e. on raspberry you need
use barebox with SDHCI (slow) and after linux boot it will use SDHOST driver.
But the problem now is, that the state is on SDHCI and dt-utils need it on
SDHOST. Actual it is not possible to overwrite this.
Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
---
common/state/state.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/common/state/state.c b/common/state/state.c
index 25d950211..e6259043f 100644
--- a/common/state/state.c
+++ b/common/state/state.c
@@ -494,8 +494,17 @@ static int of_state_fixup(struct device_node *root, void *ctx)
}
/* backend phandle */
- backend_node = of_find_node_by_reproducible_name(root,
- state->backend_reproducible_name);
+ if (node) {
+ ret = of_property_read_u32(node, "backend", &phandle);
+ if (ret)
+ goto out;
+
+ backend_node = of_find_node_by_phandle_from(phandle, root);
+ } else {
+ backend_node = of_find_node_by_reproducible_name(root,
+ state->backend_reproducible_name);
+ }
+
if (!backend_node) {
ret = -ENODEV;
goto out;
--
2.17.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
reply other threads:[~2018-06-02 22:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20180602223904.29018-1-pvizeli@syshack.ch \
--to=pvizeli@syshack.ch \
--cc=barebox@lists.infradead.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