Boot from eMMC mmcblk3boot0 or mmcblk3boot1.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Boot from eMMC mmcblk3boot0 or mmcblk3boot1.

17,412 Views
alexberenshtein
Contributor III

Hi.

We use i.mx6 ( IMX6DL ).

We configured boot from eMMC   flash. From   mmcblk3boot0  or  mmcblk3boot1.

At first we use   Linux kernel  3.10.53.

In the File System  we see files: boot_bus_config ,  boot_config , boot_info .

By this files we change boot . From mmcblk3boot0 or mmcblk3boot1.

This boot from mmcblk3boot0 .

echo 8 > /sys/devices/soc0/soc.0/2100000.aips-bus/219c000.usdhc/mmc_host/mmc3/mmc3:0001/boot_config

This boot from mmcblk3boot1 .

echo 16 > /sys/devices/soc0/soc.0/2100000.aips-bus/219c000.usdhc/mmc_host/mmc3/mmc3:0001/boot_config

Now we use Linux kernel 4.1.15.

We have a problem . We not see files: boot_bus_config ,  boot_config , boot_info .(??????)

How we can configure our system for boot from eMMC from  mmcblk3boot0  or  mmcblk3boot1.

Best regards.


15 Replies

7,862 Views
seanhsu
Contributor II

Hi all:

I also have a problem updating u-boot image to eMMC. It works fine in 3.14.28, but does not work for 4.1.15. I realized that there is no "boot_config" in 4.1.15. So I follow the instruction to install "mmc-utils" in 4.1.15 and use mmc tool but it still does not work. Please see below command and reply if any of you guys knows the solution of it. Thanks.

<For 3.14.28>

Update u-boot image to eMMC from USB memory

Step1.copy u-boot-imx6qsabresd.imx to USB memory (on PC)

Step2.SD Card boot SNW

Step3.plug USB memory to SNW USB port

Step4. clear u-boot arg

root@imx6qsabresd:~#dd if=/dev/zero of=/dev/mmcblk3 bs=1k seek=384 conv=fsync count=129

Step5. access boot partition 1

root@imx6qsabresd:~#echo 0 > /sys/block/mmcblk3boot0/force_ro

Step6. write U-Boot to emmc

root@imx6qsabresd:~#dd if=/run/media/sda1/u-boot-imx6qsabresd.imx of=/dev/mmcblk3boot0 bs=512 seek=2

Step7. re-enable read-only access

root@imx6qsabresd:~#echo 1 > /sys/block/mmcblk3boot0/force_ro

Step8. enable boot partion 1 to boot

root@imx6qsabresd:~#echo 8 > /sys/block/mmcblk3/device/boot_config--->this works for 3.14.28, for 4.1.15 I use the following command to replace this command

root@imx6qsabresd:~#mmc bootpart enable 1 1 /dev/mmcblk3boot0----->4.1.15 does not work

Thanks for replying

0 Kudos

7,862 Views
nickbedbury
Contributor III

Hi Sean,

It's unclear from your post if the "mmc bootpart" command did or did not work with 4.1.15.  Can you clarify if you ever got it working? 

I'm running into the same issue (no "boot_config" file with a recent BSP) and unsure how to address it.

Thanks

0 Kudos

7,862 Views
aliismail
Contributor IV

Hi Nick,

I have the save issue. The problem with mmc bootpart is that it does not modify all of the PARTITION_CONFIG register.

Thanks!

0 Kudos

7,862 Views
Yuri
NXP Employee
NXP Employee

Is sysfs enabled for kernel 4 by the same way as for 3.10 ?

~Yuri.

0 Kudos

7,862 Views
alexberenshtein
Contributor III

Hi.

Yuri , send me please you tel. ( for support ) , if you can.

Best regard.

Alex Berenshtein.

Unitronics , Israel.

0 Kudos

7,862 Views
Yuri
NXP Employee
NXP Employee

Hello,

   I will send contact information via Your FAE (Yan).

Regards,

Yuri.

0 Kudos

7,862 Views
alexberenshtein
Contributor III

Hi.

Please see /drivers/mmc/core/mmc.c in kernel 3.10.53. &

Please see /drivers/mmc/core/mmc.c in kernel 4.1.15.

Missing parts:

Boot_info , boot_config , boot_bus_config

I think kernel 4.1.15 could not work.

Best regards.

0 Kudos

7,862 Views
alexberenshtein
Contributor III

Yes , this enable .

In kernel 3.10.53 & 4.1.15

Best regards.

0 Kudos

7,862 Views
Yuri
NXP Employee
NXP Employee

Hello,

It is suggested using mmc-utils on kernel 4.1.15.

-----

root@imx6qsabresd:~# mmc extcsd read --help

Usage:

        mmc extcsd read <device>

                Print extcsd data from <device>.

root@imx6qsabresd:~# mmc bootpart enable --help

Usage:

        mmc bootpart enable <boot_partition> <send_ack> <device>

                Enable the boot partition for the <device>.

                To receive acknowledgment of boot from the card set <send_ack>

                to 1, else set it to 0.

-----

In order to install mmc-utils using yocto, add in conf/local.conf the following line:

CORE_IMAGE_EXTRA_INSTALL += "mmc-utils"

If it works for you, you can use the attached rmp.


Also, take a look on mmc-utils command and usage:

---

root@imx6qsabresd:~# mmc

Usage:

        mmc extcsd read <device>

                Print extcsd data from <device>.

        mmc writeprotect get <device>

                Determine the eMMC writeprotect status of <device>.

        mmc writeprotect set <device>

                Set the eMMC writeprotect status of <device>.

                This sets the eMMC to be write-protected until next boot.

        mmc disable 512B emulation <device>

                Set the eMMC data sector size to 4KB by disabling emulation on

                <device>.

        mmc gp create <-y|-n> <length KiB> <partition> <enh_attr> <ext_attr> <device>

                create general purpose partition for the <device>.

                Dry-run only unless -y is passed.

                NOTE!  This is a one-time programmable (unreversible) change.

                To set enhanced attribute to general partition being created set

                 <enh_attr> to 1 else set it to 0.

                To set extended attribute to general partition

                 set <ext_attr> to 1,2 else set it to 0

        mmc enh_area set <-y|-n> <start KiB> <length KiB> <device>

                Enable the enhanced user area for the <device>.

                Dry-run only unless -y is passed.

                NOTE!  This is a one-time programmable (unreversible) change.

        mmc write_reliability set <-y|-n> <partition> <device>

                Enable write reliability per partition for the <device>.

                Dry-run only unless -y is passed.

                NOTE!  This is a one-time programmable (unreversible) change.

        mmc status get <device>

                Print the response to STATUS_SEND (CMD13).

        mmc bootpart enable <boot_partition> <send_ack> <device>

                Enable the boot partition for the <device>.

                To receive acknowledgment of boot from the card set <send_ack>

                to 1, else set it to 0.

        mmc bootbus set <boot_mode> <reset_boot_bus_conditions> <boot_bus_width> <device>

                Set Boot Bus Conditions.

                <boot_mode> must be "single_backward|single_hs|dual"

                <reset_boot_bus_conditions> must be "x1|retain"

                <boot_bus_width> must be "x1|x4|x8"

        mmc bkops enable <device>

                Enable the eMMC BKOPS feature on <device>.

                NOTE!  This is a one-time programmable (unreversible) change.

        mmc hwreset enable <device>

                Permanently enable the eMMC H/W Reset feature on <device>.

                NOTE!  This is a one-time programmable (unreversible) change.

        mmc hwreset disable <device>

                Permanently disable the eMMC H/W Reset feature on <device>.

                NOTE!  This is a one-time programmable (unreversible) change.

        mmc sanitize <device>

                Send Sanitize command to the <device>.

                This will delete the unmapped memory region of the device.

        mmc rpmb write-key <rpmb device> <key file>

                Program authentication key which is 32 bytes length and stored

                in the specified file. Also you can specify '-' instead of

                key file path to read the key from stdin.

                NOTE!  This is a one-time programmable (unreversible) change.

                Example:

                  $ echo -n AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHH | \

                    mmc rpmb write-key /dev/mmcblk0rpmb -

        mmc rpmb read-counter <rpmb device>

                Counter value for the <rpmb device> will be read to stdout.

        mmc rpmb read-block <rpmb device> <address> <blocks count> <output file> [key file]

                Blocks of 256 bytes will be read from <rpmb device> to output

                file or stdout if '-' is specified. If key is specified - read

                data will be verified. Instead of regular path you can specify

                '-' to read key from stdin.

                Example:

                  $ echo -n AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHH | \

                    mmc rpmb read-block /dev/mmcblk0rpmb 0x02 2 /tmp/block -

                or read two blocks without verification

                  $ mmc rpmb read-block /dev/mmcblk0rpmb 0x02 2 /tmp/block

        mmc rpmb write-block <rpmb device> <address> <256 byte data file> <key file>

                Block of 256 bytes will be written from data file to

                <rpmb device>. Also you can specify '-' instead of key

                file path or data file to read the data from stdin.

                Example:

                  $ (awk 'BEGIN {while (c++<256) printf "a"}' | \

                    echo -n AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHH) | \

                    mmc rpmb write-block /dev/mmcblk0rpmb 0x02 - -

        mmc cache enable <device>

                Enable the eMMC cache feature on <device>.

                NOTE! The cache is an optional feature on devices >= eMMC4.5.

        mmc cache disable <device>

                Disable the eMMC cache feature on <device>.

                NOTE! The cache is an optional feature on devices >= eMMC4.5.

        mmc help|--help|-h

                Show the help.

        mmc <cmd> --help

                Show detailed help for a command or subset of commands.

---

Regards,

Yuri.

7,862 Views
matthewmckay-da
Contributor II

Hi Yuri,

Thanks for your post. The dump of "mmc -h" was very useful. I stumbled upon this issue today whilst updating the MfgTool kernel and rootfs from 3.14.28 to 4.9.11. In my case in addition to setting the PARTITION_CONFIG byte to enable boot using:

mmc bootpart enable 1 1 /dev/mmcblk3boot0 

I also needed to configure the BOOT_BUS_CONDITIONS byte to match the HW using:

mmc bootbus set single_backward x1 x8 /dev/mmcblk3boot0

There is information about each of these bytes in the JEDEC specification JESD84-B451.

Best regards,

Matthew

0 Kudos

7,862 Views
alexberenshtein
Contributor III

Юрий , здравствуйте.

Извините за вопрос- Ваша компания занимается поддержкой программного обеспечения Freescale (NXP) ?

Всего хорошего.

0 Kudos

7,862 Views
Yuri
NXP Employee
NXP Employee

Привет !

 

    Если вопрос про ТЕКНО - пусть организационные тонкости не смущают Вас.
Главное - значок Employee.

Удачи.

Юрий.

0 Kudos

7,862 Views
Yuri
NXP Employee
NXP Employee

Hello,

  Is it NXP BSP - Linux 3.10.53 ?

Regards,

Yuri.

0 Kudos

7,862 Views
alexberenshtein
Contributor III

Hi.

Please see /drivers/mmc/core/mmc.c in kernel 3.10.53. &

Please see /drivers/mmc/core/mmc.c in kernel 4.1.15.

Missing parts:

Boot_info , boot_config , boot_bus_config

I think kernel 4.1.15 could not work.

Best regards.

0 Kudos

7,862 Views
alexberenshtein
Contributor III

Hi.

Yes.

All from NXP .

Best regards.

0 Kudos