mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 7/9] mci: set partnames of eMMC boot partitions
Date: Wed, 10 Jul 2013 12:52:06 +0200	[thread overview]
Message-ID: <1373453528-3723-8-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1373453528-3723-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mci/mci-core.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 67668d5..02e6216 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -406,7 +406,7 @@ static int mci_calc_blk_cnt(uint64_t cap, unsigned shift)
 }
 
 static void mci_part_add(struct mci *mci, uint64_t size,
-                        unsigned int part_cfg, char *name, int idx, bool ro,
+                        unsigned int part_cfg, char *name, char *partname, int idx, bool ro,
                         int area_type)
 {
 	struct mci_part *part = &mci->part[mci->nr_parts];
@@ -414,6 +414,7 @@ static void mci_part_add(struct mci *mci, uint64_t size,
 	part->mci = mci;
 	part->size = size;
 	part->blk.cdev.name = name;
+	part->blk.cdev.partname = partname;
 	part->blk.blockbits = SECTOR_SHIFT;
 	part->blk.num_blocks = mci_calc_blk_cnt(size, part->blk.blockbits);
 	part->area_type = area_type;
@@ -482,13 +483,14 @@ static int mmc_change_freq(struct mci *mci)
 		unsigned int part_size;
 
 		for (idx = 0; idx < MMC_NUM_BOOT_PARTITION; idx++) {
-			char *name;
+			char *name, *partname;
 			part_size = mci->ext_csd[EXT_CSD_BOOT_MULT] << 17;
 
-			name = asprintf("%s.boot%d", mci->cdevname, idx);
+			partname = asprintf("boot%d", idx);
+			name = asprintf("%s.%s", mci->cdevname, partname);
 			mci_part_add(mci, part_size,
 					EXT_CSD_PART_CONFIG_ACC_BOOT0 + idx,
-					name, idx, true,
+					name, partname, idx, true,
 					MMC_BLK_DATA_AREA_BOOT);
 		}
 
@@ -1104,7 +1106,7 @@ static int mci_startup(struct mci *mci)
 	err = mci_set_blocklen(mci, mci->read_bl_len);
 
 	mci_part_add(mci, mci->capacity, 0,
-			mci->cdevname, 0, true,
+			mci->cdevname, NULL, 0, true,
 			MMC_BLK_DATA_AREA_MAIN);
 
 	return err;
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2013-07-10 10:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10 10:51 [PATCH] Allow configuration from the devicetree Sascha Hauer
2013-07-10 10:52 ` [PATCH 1/9] devfs: let devfs_add_partition return the new partition Sascha Hauer
2013-07-10 10:52 ` [PATCH 2/9] of: export of_default_bus_match_table Sascha Hauer
2013-07-10 10:52 ` [PATCH 3/9] of: partitions: factor out function to parse a single partition Sascha Hauer
2013-07-10 10:52 ` [PATCH 4/9] cdev: introduce partition names Sascha Hauer
2013-07-10 10:52 ` [PATCH 5/9] cdev: allow to open a struct cdev Sascha Hauer
2013-07-10 10:52 ` [PATCH 6/9] cdev: add device_find_partition Sascha Hauer
2013-07-10 10:52 ` Sascha Hauer [this message]
2013-07-10 10:52 ` [PATCH 8/9] Add configurability via devicetree Sascha Hauer
2013-07-10 13:17   ` Jean-Christophe PLAGNIOL-VILLARD
2013-07-10 13:34     ` Sascha Hauer
2013-07-10 14:33       ` Jean-Christophe PLAGNIOL-VILLARD
2013-07-10 14:42         ` Sascha Hauer
2013-07-10 15:50           ` Jean-Christophe PLAGNIOL-VILLARD
2013-07-10 20:17             ` Sascha Hauer
2013-07-15 10:11               ` Jean-Christophe PLAGNIOL-VILLARD
2013-07-16 14:27                 ` Sascha Hauer
2013-07-10 10:52 ` [PATCH 9/9] ARM: i.MX Datamodul edmqx6: configure environment from devicetree Sascha Hauer
2013-07-11  7:37 ` [PATCH] Allow configuration from the devicetree Sascha Hauer

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=1373453528-3723-8-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@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