From: Michael Olbrich <m.olbrich@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Michael Olbrich <m.olbrich@pengutronix.de>
Subject: [PATCH] mtd: make sure address-cells/size-cells are set when adding partition nodes
Date: Thu, 15 Sep 2016 08:03:26 +0200 [thread overview]
Message-ID: <1473919406-19038-1-git-send-email-m.olbrich@pengutronix.de> (raw)
address-cells/size-cells can either be set to 1 or 2 for 32 or 63 bit
addresses respectively. Barebox currently writes 32 bit addresses.
This makes sure that address-cells/size-cells are both set and have the
correct value.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
Hi,
this is just a minor fix. What is really needed it support for 64 bit
addressing. Also, the bindings documentation says that all partitions
should be in a 'partitions' sub node. The main question here is probably
which kernel version introduced these features and what should be supported
by barebox.
Michael
drivers/mtd/core.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index 6d04b8855387..8d0e83415ae7 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -575,6 +575,14 @@ static int of_mtd_fixup(struct device_node *root, void *ctx)
of_delete_node(part);
}
+ ret = of_property_write_u32(np, "#address-cells", 1);
+ if (ret)
+ return ret;
+
+ ret = of_property_write_u32(np, "#size-cells", 1);
+ if (ret)
+ return ret;
+
list_for_each_entry(partmtd, &mtd->partitions, partitions_entry) {
int na, ns, len = 0;
char *name = basprintf("partition@%0llx",
--
2.8.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2016-09-15 6:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-15 6:03 Michael Olbrich [this message]
2016-09-16 8:03 ` Sascha Hauer
2016-09-19 10:55 ` Uwe Kleine-König
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=1473919406-19038-1-git-send-email-m.olbrich@pengutronix.de \
--to=m.olbrich@pengutronix.de \
--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