From: Michael Grzeschik <mgr@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 4/4] mci: add MBR write and read function to block devices
Date: Wed, 26 Oct 2016 11:40:51 +0200 [thread overview]
Message-ID: <20161026094051.ph6wwuwl3qitxntg@pengutronix.de> (raw)
In-Reply-To: <20161026090933.qdzlqhv4blwx5idq@pengutronix.de>
On Wed, Oct 26, 2016 at 11:09:33AM +0200, Michael Grzeschik wrote:
> On Tue, Oct 18, 2016 at 08:23:22AM +0200, Sascha Hauer wrote:
> > On Mon, Oct 17, 2016 at 03:29:23PM +0200, Michael Grzeschik wrote:
> > > With this patch it is possible to write an mbr partition table to the
> > > mci block device. By setting the device property "dos_partitions" of the
> > > mmc device node, it is possible to write back the new partition layout
> > > in the common cmdlinepart notation. The property can also be read back.
> > >
> > > Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> > > ---
> > > drivers/mci/mci-core.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++++
> > > 1 file changed, 122 insertions(+)
> > >
> > > diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
> > > index 4e176f7..c0013a1 100644
> > > --- a/drivers/mci/mci-core.c
> > > +++ b/drivers/mci/mci-core.c
> > > @@ -33,9 +33,11 @@
> > > #include <asm-generic/div64.h>
> > > #include <asm/byteorder.h>
> > > #include <block.h>
> > > +#include <fcntl.h>
> > > #include <disks.h>
> > > #include <of.h>
> > > #include <linux/err.h>
> > > +#include <cmdlinepart.h>
> > >
> > > #define MAX_BUFFER_NUMBER 0xffffffff
> > >
> > > @@ -1527,6 +1529,122 @@ static void mci_info(struct device_d *dev)
> > > extract_mtd_year(mci));
> > > }
> > >
> > > +static char *print_size(uint64_t s)
> > > +{
> > > + if (!(s & ((1 << 20) - 1)))
> > > + return basprintf("%lldM", s >> 20);
> > > + if (!(s & ((1 << 10) - 1)))
> > > + return basprintf("%lldk", s >> 10);
> > > + return basprintf("0x%lld", s);
> >
> > s/lld/llx/
>
> Why that? This will break the typical layout compared
> to all other users of the kernelcmdline syntax.
As I now realize you only ment the last line, this sure makes
sense. I will fix it. But the mtd layer I copied this from
has the same issue. Will fix that aswell.
Thanks,
Michael
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2016-10-26 9:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-17 13:29 [PATCH 0/4] Add support to modify mbr partition layout Michael Grzeschik
2016-10-17 13:29 ` [PATCH 1/4] partitions: add DEVFS_PARTITION_IN_PT flag Michael Grzeschik
2016-10-17 13:29 ` [PATCH 2/4] cmdlinepart: add option to set " Michael Grzeschik
2016-10-17 13:29 ` [PATCH 3/4] partitions/dos: add function to write partition table Michael Grzeschik
2016-10-18 6:07 ` Sascha Hauer
2016-10-26 9:12 ` Michael Grzeschik
2016-10-17 13:29 ` [PATCH 4/4] mci: add MBR write and read function to block devices Michael Grzeschik
2016-10-18 6:23 ` Sascha Hauer
2016-10-26 9:09 ` Michael Grzeschik
2016-10-26 9:40 ` Michael Grzeschik [this message]
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=20161026094051.ph6wwuwl3qitxntg@pengutronix.de \
--to=mgr@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.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