From: "Christian Löhle" <CLoehle@hyperstone.com>
To: Avri Altman <Avri.Altman@wdc.com>,
"ulf.hansson@linaro.org" <ulf.hansson@linaro.org>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: RE: [PATCH] mmc-utils: Implement alternative boot operation
Date: Tue, 25 Oct 2022 14:14:17 +0000 [thread overview]
Message-ID: <ae6767a4abef41cd9068c467947646c9@hyperstone.com> (raw)
In-Reply-To: <DM6PR04MB6575BC99A106EE2D430CA9BAFC319@DM6PR04MB6575.namprd04.prod.outlook.com>
>> @@ -255,6 +255,18 @@ static struct Command commands[] = {
>> "Issues a CMD0 GO_PRE_IDLE",
>> NULL
>> },
>> + { do_alt_boot_op, -1,
>> + "boot_operation", "<boot_data_file> <boot_blocks> <device>\n"
>> + "Does the alternative boot operation and writes the
>> + specified starting
>> blocks of boot data into the requested file.\n\n"
>> + "Note some limitations\n:"
>> + "1. The boot operation must be configured, e.g. for legacy speed:\n"
>> + "mmc-utils bootbus set single_backward retain x8 /dev/mmcblk2\n"
>> + "mmc-utils bootpart enable 1 0 /dev/mmcblk2\n"
>> + "2. The MMC must currently be running at the bus mode that
>> + is
>> configured for the boot operation (HS200 and HS400 not supported at all).\n"
>> + "3. Most hosts cannot do transfers of the typical size of
>> + the boot partition,
>> adjust <boot_blocks> accordingly.\n"
> A redundant arg?
> Since blksz is 512, Maybe just set it to be ext_csd[226] * 256?
As the help above explains this will not work on most hosts.
Limitations of maximum transfers of like 512K to a couple MB are very common.
One could just read the max, but I found it less misleading that way.
>> + mioc->num_of_cmds = 2;
>> + mioc->cmds[0].opcode = MMC_GO_IDLE_STATE;
>> + mioc->cmds[0].arg = MMC_GO_PRE_IDLE_STATE_ARG;
>> + mioc->cmds[0].flags = MMC_RSP_NONE | MMC_CMD_AC;
>> + mioc->cmds[0].write_flag = 0;
>> +
>> + mioc->cmds[1].opcode = MMC_GO_IDLE_STATE;
>> + mioc->cmds[1].arg = MMC_BOOT_INITIATION_ARG;
>> + mioc->cmds[1].flags = MMC_RSP_NONE | MMC_CMD_ADTC;
>> + mioc->cmds[1].write_flag = 0;
>> + mioc->cmds[1].blksz = 512;
>> + mioc->cmds[1].blocks = boot_blocks;
>> + /* Access time of boot part differs wildly, spec mandates 1s */
>> + mioc->cmds[1].data_timeout_ns = 2 * 1000 * 1000 * 1000;
>> + mmc_ioc_cmd_set_data(mioc->cmds[1], boot_buf);
> Don't you get "010" prior to the boot content?
> Most cards have their EXT_CSD_PART_CONFIG_ACC_ACK bit set.
> So you need to eliminate it from the boot file?
> But your compare show that the files are identical - how so?
By configuring the card to not send BOOT ACK.
With it enabled there is unfortunately no way to get the transfer through from userspace.
(The host will sample part of the ACK, CRC wont match and so on)
I will address the rest of you comments in v2.
Regards,
Christian
Hyperstone GmbH | Reichenaustr. 39a | 78467 Konstanz
Managing Director: Dr. Jan Peter Berns.
Commercial register of local courts: Freiburg HRB381782
next prev parent reply other threads:[~2022-10-25 14:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-24 17:35 [PATCH] mmc-utils: Implement alternative boot operation Christian Löhle
2022-10-25 12:40 ` Avri Altman
2022-10-25 14:14 ` Christian Löhle [this message]
2022-10-25 17:25 ` Avri Altman
2022-10-25 17:38 ` Christian Löhle
2022-10-25 19:15 ` Avri Altman
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=ae6767a4abef41cd9068c467947646c9@hyperstone.com \
--to=cloehle@hyperstone.com \
--cc=Avri.Altman@wdc.com \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.