All of lore.kernel.org
 help / color / mirror / Atom feed
* Boot on eMMC
@ 2015-04-14 14:12 Shanx
  2015-04-14 14:28 ` Otavio Salvador
  0 siblings, 1 reply; 12+ messages in thread
From: Shanx @ 2015-04-14 14:12 UTC (permalink / raw)
  To: meta-freescale

[-- Attachment #1: Type: text/plain, Size: 380 bytes --]

Hello,
I've tried a lot of things, but I can't boot on eMMC. I've flashed it from
u-boot, or from the system (booted from the sdcard). For exemple, I've
tried : dd if=rootfs.sdcard of=/dev/mmcblk3
I've also tried to flash only u-boot.imx (with dd and seek=2)

When booting on eMMC (with the boot switch setup given on the Linux User
Guide), nothing append. Any idea why ?

[-- Attachment #2: Type: text/html, Size: 474 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Boot on eMMC
  2015-04-14 14:12 Boot on eMMC Shanx
@ 2015-04-14 14:28 ` Otavio Salvador
  2015-04-14 14:58   ` Gary Thomas
  0 siblings, 1 reply; 12+ messages in thread
From: Otavio Salvador @ 2015-04-14 14:28 UTC (permalink / raw)
  To: Shanx; +Cc: meta-freescale@yoctoproject.org

On Tue, Apr 14, 2015 at 11:12 AM, Shanx <shanx@legtux.org> wrote:
> Hello,
> I've tried a lot of things, but I can't boot on eMMC. I've flashed it from
> u-boot, or from the system (booted from the sdcard). For exemple, I've tried
> : dd if=rootfs.sdcard of=/dev/mmcblk3
> I've also tried to flash only u-boot.imx (with dd and seek=2)
>
> When booting on eMMC (with the boot switch setup given on the Linux User
> Guide), nothing append. Any idea why ?

eMMC has some details which differ from the uSD normal usage. Mainly
regarding the use of Boot Partitions. So you must to write it to the
boot partition otherwise it won't work.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Boot on eMMC
  2015-04-14 14:28 ` Otavio Salvador
@ 2015-04-14 14:58   ` Gary Thomas
  2015-04-14 15:00     ` Otavio Salvador
  2015-04-15 10:17     ` Thomas
  0 siblings, 2 replies; 12+ messages in thread
From: Gary Thomas @ 2015-04-14 14:58 UTC (permalink / raw)
  To: meta-freescale

On 2015-04-14 08:28, Otavio Salvador wrote:
> On Tue, Apr 14, 2015 at 11:12 AM, Shanx <shanx@legtux.org> wrote:
>> Hello,
>> I've tried a lot of things, but I can't boot on eMMC. I've flashed it from
>> u-boot, or from the system (booted from the sdcard). For exemple, I've tried
>> : dd if=rootfs.sdcard of=/dev/mmcblk3
>> I've also tried to flash only u-boot.imx (with dd and seek=2)
>>
>> When booting on eMMC (with the boot switch setup given on the Linux User
>> Guide), nothing append. Any idea why ?
>
> eMMC has some details which differ from the uSD normal usage. Mainly
> regarding the use of Boot Partitions. So you must to write it to the
> boot partition otherwise it won't work.
>

I'm not sure this is correct.  I have an i.MX6Q board which has
eMMC on SD4 and SD on SD3 and I can boot from either, using the
same command to install U-Boot
   dd if=/tmp/disk/${UBOOT_NAME} of=${DISK} seek=2 bs=512 conv=notrunc

Maybe it's a difference in the eMMC device (mine is Sandisk SDIN5 (or7)C2-32G-L)

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Boot on eMMC
  2015-04-14 14:58   ` Gary Thomas
@ 2015-04-14 15:00     ` Otavio Salvador
  2015-04-14 15:04       ` Gary Thomas
  2015-04-15 10:17     ` Thomas
  1 sibling, 1 reply; 12+ messages in thread
From: Otavio Salvador @ 2015-04-14 15:00 UTC (permalink / raw)
  To: Gary Thomas; +Cc: meta-freescale@yoctoproject.org

On Tue, Apr 14, 2015 at 11:58 AM, Gary Thomas <gary@mlbassoc.com> wrote:
> On 2015-04-14 08:28, Otavio Salvador wrote:
>>
>> On Tue, Apr 14, 2015 at 11:12 AM, Shanx <shanx@legtux.org> wrote:
>>>
>>> Hello,
>>> I've tried a lot of things, but I can't boot on eMMC. I've flashed it
>>> from
>>> u-boot, or from the system (booted from the sdcard). For exemple, I've
>>> tried
>>> : dd if=rootfs.sdcard of=/dev/mmcblk3
>>> I've also tried to flash only u-boot.imx (with dd and seek=2)
>>>
>>> When booting on eMMC (with the boot switch setup given on the Linux User
>>> Guide), nothing append. Any idea why ?
>>
>>
>> eMMC has some details which differ from the uSD normal usage. Mainly
>> regarding the use of Boot Partitions. So you must to write it to the
>> boot partition otherwise it won't work.
>>
>
> I'm not sure this is correct.  I have an i.MX6Q board which has
> eMMC on SD4 and SD on SD3 and I can boot from either, using the
> same command to install U-Boot
>   dd if=/tmp/disk/${UBOOT_NAME} of=${DISK} seek=2 bs=512 conv=notrunc
>
> Maybe it's a difference in the eMMC device (mine is Sandisk SDIN5
> (or7)C2-32G-L)

It depends if Boot Partition is enabled or not.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Boot on eMMC
  2015-04-14 15:00     ` Otavio Salvador
@ 2015-04-14 15:04       ` Gary Thomas
  2015-04-14 15:05         ` Otavio Salvador
  0 siblings, 1 reply; 12+ messages in thread
From: Gary Thomas @ 2015-04-14 15:04 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: meta-freescale@yoctoproject.org

On 2015-04-14 09:00, Otavio Salvador wrote:
> On Tue, Apr 14, 2015 at 11:58 AM, Gary Thomas <gary@mlbassoc.com> wrote:
>> On 2015-04-14 08:28, Otavio Salvador wrote:
>>>
>>> On Tue, Apr 14, 2015 at 11:12 AM, Shanx <shanx@legtux.org> wrote:
>>>>
>>>> Hello,
>>>> I've tried a lot of things, but I can't boot on eMMC. I've flashed it
>>>> from
>>>> u-boot, or from the system (booted from the sdcard). For exemple, I've
>>>> tried
>>>> : dd if=rootfs.sdcard of=/dev/mmcblk3
>>>> I've also tried to flash only u-boot.imx (with dd and seek=2)
>>>>
>>>> When booting on eMMC (with the boot switch setup given on the Linux User
>>>> Guide), nothing append. Any idea why ?
>>>
>>>
>>> eMMC has some details which differ from the uSD normal usage. Mainly
>>> regarding the use of Boot Partitions. So you must to write it to the
>>> boot partition otherwise it won't work.
>>>
>>
>> I'm not sure this is correct.  I have an i.MX6Q board which has
>> eMMC on SD4 and SD on SD3 and I can boot from either, using the
>> same command to install U-Boot
>>    dd if=/tmp/disk/${UBOOT_NAME} of=${DISK} seek=2 bs=512 conv=notrunc
>>
>> Maybe it's a difference in the eMMC device (mine is Sandisk SDIN5
>> (or7)C2-32G-L)
>
> It depends if Boot Partition is enabled or not.
>

Is that an i.MX6 setting?

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Boot on eMMC
  2015-04-14 15:04       ` Gary Thomas
@ 2015-04-14 15:05         ` Otavio Salvador
  2015-04-14 15:11           ` Gary Thomas
  0 siblings, 1 reply; 12+ messages in thread
From: Otavio Salvador @ 2015-04-14 15:05 UTC (permalink / raw)
  To: Gary Thomas; +Cc: meta-freescale@yoctoproject.org

On Tue, Apr 14, 2015 at 12:04 PM, Gary Thomas <gary@mlbassoc.com> wrote:
> On 2015-04-14 09:00, Otavio Salvador wrote:
>>
>> On Tue, Apr 14, 2015 at 11:58 AM, Gary Thomas <gary@mlbassoc.com> wrote:
>>>
>>> On 2015-04-14 08:28, Otavio Salvador wrote:
>>>>
>>>>
>>>> On Tue, Apr 14, 2015 at 11:12 AM, Shanx <shanx@legtux.org> wrote:
>>>>>
>>>>>
>>>>> Hello,
>>>>> I've tried a lot of things, but I can't boot on eMMC. I've flashed it
>>>>> from
>>>>> u-boot, or from the system (booted from the sdcard). For exemple, I've
>>>>> tried
>>>>> : dd if=rootfs.sdcard of=/dev/mmcblk3
>>>>> I've also tried to flash only u-boot.imx (with dd and seek=2)
>>>>>
>>>>> When booting on eMMC (with the boot switch setup given on the Linux
>>>>> User
>>>>> Guide), nothing append. Any idea why ?
>>>>
>>>>
>>>>
>>>> eMMC has some details which differ from the uSD normal usage. Mainly
>>>> regarding the use of Boot Partitions. So you must to write it to the
>>>> boot partition otherwise it won't work.
>>>>
>>>
>>> I'm not sure this is correct.  I have an i.MX6Q board which has
>>> eMMC on SD4 and SD on SD3 and I can boot from either, using the
>>> same command to install U-Boot
>>>    dd if=/tmp/disk/${UBOOT_NAME} of=${DISK} seek=2 bs=512 conv=notrunc
>>>
>>> Maybe it's a difference in the eMMC device (mine is Sandisk SDIN5
>>> (or7)C2-32G-L)
>>
>>
>> It depends if Boot Partition is enabled or not.
>>
>
> Is that an i.MX6 setting?

No; it is eMMC 4.41 (or later) one if IIRC. There are some fields
exposed in sysfs and also a mmc-utils package at meta-oe.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Boot on eMMC
  2015-04-14 15:05         ` Otavio Salvador
@ 2015-04-14 15:11           ` Gary Thomas
  2015-04-15 11:55             ` Shanx
  0 siblings, 1 reply; 12+ messages in thread
From: Gary Thomas @ 2015-04-14 15:11 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: meta-freescale@yoctoproject.org

On 2015-04-14 09:05, Otavio Salvador wrote:
> On Tue, Apr 14, 2015 at 12:04 PM, Gary Thomas <gary@mlbassoc.com> wrote:
>> On 2015-04-14 09:00, Otavio Salvador wrote:
>>>
>>> On Tue, Apr 14, 2015 at 11:58 AM, Gary Thomas <gary@mlbassoc.com> wrote:
>>>>
>>>> On 2015-04-14 08:28, Otavio Salvador wrote:
>>>>>
>>>>>
>>>>> On Tue, Apr 14, 2015 at 11:12 AM, Shanx <shanx@legtux.org> wrote:
>>>>>>
>>>>>>
>>>>>> Hello,
>>>>>> I've tried a lot of things, but I can't boot on eMMC. I've flashed it
>>>>>> from
>>>>>> u-boot, or from the system (booted from the sdcard). For exemple, I've
>>>>>> tried
>>>>>> : dd if=rootfs.sdcard of=/dev/mmcblk3
>>>>>> I've also tried to flash only u-boot.imx (with dd and seek=2)
>>>>>>
>>>>>> When booting on eMMC (with the boot switch setup given on the Linux
>>>>>> User
>>>>>> Guide), nothing append. Any idea why ?
>>>>>
>>>>>
>>>>>
>>>>> eMMC has some details which differ from the uSD normal usage. Mainly
>>>>> regarding the use of Boot Partitions. So you must to write it to the
>>>>> boot partition otherwise it won't work.
>>>>>
>>>>
>>>> I'm not sure this is correct.  I have an i.MX6Q board which has
>>>> eMMC on SD4 and SD on SD3 and I can boot from either, using the
>>>> same command to install U-Boot
>>>>     dd if=/tmp/disk/${UBOOT_NAME} of=${DISK} seek=2 bs=512 conv=notrunc
>>>>
>>>> Maybe it's a difference in the eMMC device (mine is Sandisk SDIN5
>>>> (or7)C2-32G-L)
>>>
>>>
>>> It depends if Boot Partition is enabled or not.
>>>
>>
>> Is that an i.MX6 setting?
>
> No; it is eMMC 4.41 (or later) one if IIRC. There are some fields
> exposed in sysfs and also a mmc-utils package at meta-oe.
>

Interesting, I'll look at this but my boards have boot partitions:

mmc0: new high speed DDR MMC card at address 0001
mmcblk0: mmc0:0001 SEM32G 29.1 GiB
mmcblk0boot0: mmc0:0001 SEM32G partition 1 4.00 MiB
mmcblk0boot1: mmc0:0001 SEM32G partition 2 4.00 MiB
usb 1-1: new high-speed USB device number 2 using ci_hdrc
mmcblk0rpmb: mmc0:0001 SEM32G partition 3 4.00 MiB
  mmcblk0: p1 p2
  mmcblk0boot1: unknown partition table
  mmcblk0boot0: unknown partition table

As I said, I install U-Boot directly to block 2 of the device,
not to any of the "boot" partitions.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Boot on eMMC
  2015-04-14 14:58   ` Gary Thomas
  2015-04-14 15:00     ` Otavio Salvador
@ 2015-04-15 10:17     ` Thomas
  2015-04-15 12:16       ` Gary Thomas
  1 sibling, 1 reply; 12+ messages in thread
From: Thomas @ 2015-04-15 10:17 UTC (permalink / raw)
  To: meta-freescale

Gary Thomas <gary@...> writes:

> 
> On 2015-04-14 08:28, Otavio Salvador wrote:
> > On Tue, Apr 14, 2015 at 11:12 AM, Shanx <shanx@...> wrote:
> >> Hello,
> >> I've tried a lot of things, but I can't boot on eMMC. I've flashed it 
from
> >> u-boot, or from the system (booted from the sdcard). For exemple, I've 
tried
> >> : dd if=rootfs.sdcard of=/dev/mmcblk3
> >> I've also tried to flash only u-boot.imx (with dd and seek=2)
> >>
> >> When booting on eMMC (with the boot switch setup given on the Linux 
User
> >> Guide), nothing append. Any idea why ?
> >
> > eMMC has some details which differ from the uSD normal usage. Mainly
> > regarding the use of Boot Partitions. So you must to write it to the
> > boot partition otherwise it won't work.
> >
> 
> I'm not sure this is correct.  I have an i.MX6Q board which has
> eMMC on SD4 and SD on SD3 and I can boot from either, using the
> same command to install U-Boot
>    dd if=/tmp/disk/${UBOOT_NAME} of=${DISK} seek=2 bs=512 conv=notrunc
> 
> Maybe it's a difference in the eMMC device (mine is Sandisk SDIN5 (or7)C2-
32G-L)
> 
Then you're actually booting in SD fallback mode (if your board is 
configured for emmc boot). To boot in emmc mode place u-boot on one of the 
boot partitions and enable the correct boot partition for boot via sysfs.

First enable write to boot partition:
echo 0 > /sys/block/mmcblk0boot0/force_ro

Write uboot:
dd if=u-boot.imx of=/dev/mmcblk0boot0 bs=512 seek=2

Re-enable read-only access to the boot partition:
echo 1 > /sys/block/mmcblk0boot0/force_ro

Then boot partition (here 0) must be activated e.g. like this:
echo 8 > /sys/devices/platform/sdhci-esdhc-
imx.1/mmc_host/mmc0/mmc0:0001/boot_config

Then set the fuses/gpio for emmc boot.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Boot on eMMC
  2015-04-14 15:11           ` Gary Thomas
@ 2015-04-15 11:55             ` Shanx
  2015-04-15 12:06               ` Gary Thomas
  0 siblings, 1 reply; 12+ messages in thread
From: Shanx @ 2015-04-15 11:55 UTC (permalink / raw)
  To: meta-freescale@yoctoproject.org

[-- Attachment #1: Type: text/plain, Size: 3673 bytes --]

I'he successfly booted from the eMMC. To do that, I've boot from the
sdcard, and I have written u-boot on mmcbl3boot0 (mmcblk3 is the eMMC)
using :

echo 0 > /sys/block/mmcblk3boot0/force_ro
dd if=uboot.imx of=/dev/mmcblk3boot0 bs=512 seek=2 skip=2

(the first line ables to write on mmcblk3boot0)

I've tried to write the system on the eMMC, using :

dd if=rootfs.sdcard of=/dev/mmcblk3

After that, I can see the rootfs in mmcblk3p2 and the kernel and dtb files
in mmcblk3p1.

When booting, I access to u-boot, but it can't boot because it doesn't find
the kernel. But setting the bootargs with root=/dev/mmcblk3p2, and booting
using a downloaded kernel (stored in RAM) works.
Any idea how I can use the system written on the eMMC to boot ?

2015-04-14 17:11 GMT+02:00 Gary Thomas <gary@mlbassoc.com>:

> On 2015-04-14 09:05, Otavio Salvador wrote:
>
>> On Tue, Apr 14, 2015 at 12:04 PM, Gary Thomas <gary@mlbassoc.com> wrote:
>>
>>> On 2015-04-14 09:00, Otavio Salvador wrote:
>>>
>>>>
>>>> On Tue, Apr 14, 2015 at 11:58 AM, Gary Thomas <gary@mlbassoc.com>
>>>> wrote:
>>>>
>>>>>
>>>>> On 2015-04-14 08:28, Otavio Salvador wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, Apr 14, 2015 at 11:12 AM, Shanx <shanx@legtux.org> wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Hello,
>>>>>>> I've tried a lot of things, but I can't boot on eMMC. I've flashed it
>>>>>>> from
>>>>>>> u-boot, or from the system (booted from the sdcard). For exemple,
>>>>>>> I've
>>>>>>> tried
>>>>>>> : dd if=rootfs.sdcard of=/dev/mmcblk3
>>>>>>> I've also tried to flash only u-boot.imx (with dd and seek=2)
>>>>>>>
>>>>>>> When booting on eMMC (with the boot switch setup given on the Linux
>>>>>>> User
>>>>>>> Guide), nothing append. Any idea why ?
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> eMMC has some details which differ from the uSD normal usage. Mainly
>>>>>> regarding the use of Boot Partitions. So you must to write it to the
>>>>>> boot partition otherwise it won't work.
>>>>>>
>>>>>>
>>>>> I'm not sure this is correct.  I have an i.MX6Q board which has
>>>>> eMMC on SD4 and SD on SD3 and I can boot from either, using the
>>>>> same command to install U-Boot
>>>>>     dd if=/tmp/disk/${UBOOT_NAME} of=${DISK} seek=2 bs=512 conv=notrunc
>>>>>
>>>>> Maybe it's a difference in the eMMC device (mine is Sandisk SDIN5
>>>>> (or7)C2-32G-L)
>>>>>
>>>>
>>>>
>>>> It depends if Boot Partition is enabled or not.
>>>>
>>>>
>>> Is that an i.MX6 setting?
>>>
>>
>> No; it is eMMC 4.41 (or later) one if IIRC. There are some fields
>> exposed in sysfs and also a mmc-utils package at meta-oe.
>>
>>
> Interesting, I'll look at this but my boards have boot partitions:
>
> mmc0: new high speed DDR MMC card at address 0001
> mmcblk0: mmc0:0001 SEM32G 29.1 GiB
> mmcblk0boot0: mmc0:0001 SEM32G partition 1 4.00 MiB
> mmcblk0boot1: mmc0:0001 SEM32G partition 2 4.00 MiB
> usb 1-1: new high-speed USB device number 2 using ci_hdrc
> mmcblk0rpmb: mmc0:0001 SEM32G partition 3 4.00 MiB
>  mmcblk0: p1 p2
>  mmcblk0boot1: unknown partition table
>  mmcblk0boot0: unknown partition table
>
> As I said, I install U-Boot directly to block 2 of the device,
> not to any of the "boot" partitions.
>
> --
> ------------------------------------------------------------
> Gary Thomas                 |  Consulting for the
> MLB Associates              |    Embedded world
> ------------------------------------------------------------
> --
> _______________________________________________
> meta-freescale mailing list
> meta-freescale@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-freescale
>

[-- Attachment #2: Type: text/html, Size: 5227 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Boot on eMMC
  2015-04-15 11:55             ` Shanx
@ 2015-04-15 12:06               ` Gary Thomas
  2015-04-15 14:19                 ` Shanx
  0 siblings, 1 reply; 12+ messages in thread
From: Gary Thomas @ 2015-04-15 12:06 UTC (permalink / raw)
  To: meta-freescale

On 2015-04-15 05:55, Shanx wrote:
> I'he successfly booted from the eMMC. To do that, I've boot from the sdcard, and I have written u-boot on mmcbl3boot0 (mmcblk3 is the eMMC) using :
>
> echo 0 > /sys/block/mmcblk3boot0/force_ro
>
> dd if=uboot.imx of=/dev/mmcblk3boot0 bs=512 seek=2 skip=2
>
> (the first line ables to write on mmcblk3boot0)
>
> I've tried to write the system on the eMMC, using :
>
> dd if=rootfs.sdcard of=/dev/mmcblk3
>
> After that, I can see the rootfs in mmcblk3p2 and the kernel and dtb files in mmcblk3p1.
>
> When booting, I access to u-boot, but it can't boot because it doesn't find the kernel. But setting the bootargs with root=/dev/mmcblk3p2, and booting using a downloaded kernel
> (stored in RAM) works.

What are the commands being used to boot in U-Boot?
What are the errors?
Have you tried running these commands by hand?

The most likely problem is that U-Boot is trying to find your kernel
on the wrong MMC device.

>
> Any idea how I can use the system written on the eMMC to boot ?
>
> 2015-04-14 17:11 GMT+02:00 Gary Thomas <gary@mlbassoc.com <mailto:gary@mlbassoc.com>>:
>
>     On 2015-04-14 09:05, Otavio Salvador wrote:
>
>         On Tue, Apr 14, 2015 at 12:04 PM, Gary Thomas <gary@mlbassoc.com <mailto:gary@mlbassoc.com>> wrote:
>
>             On 2015-04-14 09:00, Otavio Salvador wrote:
>
>
>                 On Tue, Apr 14, 2015 at 11:58 AM, Gary Thomas <gary@mlbassoc.com <mailto:gary@mlbassoc.com>> wrote:
>
>
>                     On 2015-04-14 08:28, Otavio Salvador wrote:
>
>
>
>                         On Tue, Apr 14, 2015 at 11:12 AM, Shanx <shanx@legtux.org <mailto:shanx@legtux.org>> wrote:
>
>
>
>                             Hello,
>                             I've tried a lot of things, but I can't boot on eMMC. I've flashed it
>                             from
>                             u-boot, or from the system (booted from the sdcard). For exemple, I've
>                             tried
>                             : dd if=rootfs.sdcard of=/dev/mmcblk3
>                             I've also tried to flash only u-boot.imx (with dd and seek=2)
>
>                             When booting on eMMC (with the boot switch setup given on the Linux
>                             User
>                             Guide), nothing append. Any idea why ?
>
>
>
>
>                         eMMC has some details which differ from the uSD normal usage. Mainly
>                         regarding the use of Boot Partitions. So you must to write it to the
>                         boot partition otherwise it won't work.
>
>
>                     I'm not sure this is correct.  I have an i.MX6Q board which has
>                     eMMC on SD4 and SD on SD3 and I can boot from either, using the
>                     same command to install U-Boot
>                          dd if=/tmp/disk/${UBOOT_NAME} of=${DISK} seek=2 bs=512 conv=notrunc
>
>                     Maybe it's a difference in the eMMC device (mine is Sandisk SDIN5
>                     (or7)C2-32G-L)
>
>
>
>                 It depends if Boot Partition is enabled or not.
>
>
>             Is that an i.MX6 setting?
>
>
>         No; it is eMMC 4.41 (or later) one if IIRC. There are some fields
>         exposed in sysfs and also a mmc-utils package at meta-oe.
>
>
>     Interesting, I'll look at this but my boards have boot partitions:
>
>     mmc0: new high speed DDR MMC card at address 0001
>     mmcblk0: mmc0:0001 SEM32G 29.1 GiB
>     mmcblk0boot0: mmc0:0001 SEM32G partition 1 4.00 MiB
>     mmcblk0boot1: mmc0:0001 SEM32G partition 2 4.00 MiB
>     usb 1-1: new high-speed USB device number 2 using ci_hdrc
>     mmcblk0rpmb: mmc0:0001 SEM32G partition 3 4.00 MiB
>       mmcblk0: p1 p2
>       mmcblk0boot1: unknown partition table
>       mmcblk0boot0: unknown partition table
>
>     As I said, I install U-Boot directly to block 2 of the device,
>     not to any of the "boot" partitions.
>
>     --
>     ------------------------------__------------------------------
>     Gary Thomas                 |  Consulting for the
>     MLB Associates              |    Embedded world
>     ------------------------------__------------------------------
>     --
>     _________________________________________________
>     meta-freescale mailing list
>     meta-freescale@yoctoproject.__org <mailto:meta-freescale@yoctoproject.org>
>     https://lists.yoctoproject.__org/listinfo/meta-freescale <https://lists.yoctoproject.org/listinfo/meta-freescale>
>
>
>
>

-- 
Please keep your replies on the mailing list(s) so that all
may benefit.  Private support is available under contract
from various agents, including MLB Associates.  Private
email to me without a contract will be ignored.

------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Boot on eMMC
  2015-04-15 10:17     ` Thomas
@ 2015-04-15 12:16       ` Gary Thomas
  0 siblings, 0 replies; 12+ messages in thread
From: Gary Thomas @ 2015-04-15 12:16 UTC (permalink / raw)
  To: meta-freescale

On 2015-04-15 04:17, Thomas wrote:
> Gary Thomas <gary@...> writes:
>
>>
>> On 2015-04-14 08:28, Otavio Salvador wrote:
>>> On Tue, Apr 14, 2015 at 11:12 AM, Shanx <shanx@...> wrote:
>>>> Hello,
>>>> I've tried a lot of things, but I can't boot on eMMC. I've flashed it
> from
>>>> u-boot, or from the system (booted from the sdcard). For exemple, I've
> tried
>>>> : dd if=rootfs.sdcard of=/dev/mmcblk3
>>>> I've also tried to flash only u-boot.imx (with dd and seek=2)
>>>>
>>>> When booting on eMMC (with the boot switch setup given on the Linux
> User
>>>> Guide), nothing append. Any idea why ?
>>>
>>> eMMC has some details which differ from the uSD normal usage. Mainly
>>> regarding the use of Boot Partitions. So you must to write it to the
>>> boot partition otherwise it won't work.
>>>
>>
>> I'm not sure this is correct.  I have an i.MX6Q board which has
>> eMMC on SD4 and SD on SD3 and I can boot from either, using the
>> same command to install U-Boot
>>     dd if=/tmp/disk/${UBOOT_NAME} of=${DISK} seek=2 bs=512 conv=notrunc
>>
>> Maybe it's a difference in the eMMC device (mine is Sandisk SDIN5 (or7)C2-
> 32G-L)
>>
> Then you're actually booting in SD fallback mode (if your board is
> configured for emmc boot). To boot in emmc mode place u-boot on one of the
> boot partitions and enable the correct boot partition for boot via sysfs.
>
> First enable write to boot partition:
> echo 0 > /sys/block/mmcblk0boot0/force_ro
>
> Write uboot:
> dd if=u-boot.imx of=/dev/mmcblk0boot0 bs=512 seek=2
>
> Re-enable read-only access to the boot partition:
> echo 1 > /sys/block/mmcblk0boot0/force_ro
>
> Then boot partition (here 0) must be activated e.g. like this:
> echo 8 > /sys/devices/platform/sdhci-esdhc-
> imx.1/mmc_host/mmc0/mmc0:0001/boot_config
>
> Then set the fuses/gpio for emmc boot.
>
>

What is the advantage of this vs just using the SD fallback
method which seems to work just fine?  It seems to just make
life more complicated, especially my process for installing
the software to the unit.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Boot on eMMC
  2015-04-15 12:06               ` Gary Thomas
@ 2015-04-15 14:19                 ` Shanx
  0 siblings, 0 replies; 12+ messages in thread
From: Shanx @ 2015-04-15 14:19 UTC (permalink / raw)
  To: meta-freescale

[-- Attachment #1: Type: text/plain, Size: 6457 bytes --]

My eMMC is mmcblk3. mmcblk3boot0 contains u-boot.imx, mmcbl3p1 contains the
zImage and dtb files, and mmcblk3p2 contains the rootfs. When booting, I
use the u-boot of mmcblk3boot0. To use the system of the eMMC, I've tried
this command in u-boot :

fatload mmc 2:1 0x12000000 zImage ; fatload mmc 2:1 0x18000000
imx6q-sabresd-ldo.dtb ; setenv bootargs console=ttymxc0,115200
root=/dev/mmcblk3p2 ; bootz 0x12000000 - 0x18000000

It works well, but it seems that the rootfs is loaded in RAM (after a
reboot, all modifications are lost, and mount gives no indication of
mmcbl3p2 being mounted). But if I boot without root=/dev/mmcblk3p2, I have
a kernel panic because the kernel doesn't find the rootfs. I don't
understand. Does the kernel read the rootfs in en eMMC and load it in RAM ?
It's illogical, and it's not what I want. Where am I wrong ?


2015-04-15 14:06 GMT+02:00 Gary Thomas <gary@mlbassoc.com>:

> On 2015-04-15 05:55, Shanx wrote:
>
>> I'he successfly booted from the eMMC. To do that, I've boot from the
>> sdcard, and I have written u-boot on mmcbl3boot0 (mmcblk3 is the eMMC)
>> using :
>>
>> echo 0 > /sys/block/mmcblk3boot0/force_ro
>>
>> dd if=uboot.imx of=/dev/mmcblk3boot0 bs=512 seek=2 skip=2
>>
>> (the first line ables to write on mmcblk3boot0)
>>
>> I've tried to write the system on the eMMC, using :
>>
>> dd if=rootfs.sdcard of=/dev/mmcblk3
>>
>> After that, I can see the rootfs in mmcblk3p2 and the kernel and dtb
>> files in mmcblk3p1.
>>
>> When booting, I access to u-boot, but it can't boot because it doesn't
>> find the kernel. But setting the bootargs with root=/dev/mmcblk3p2, and
>> booting using a downloaded kernel
>> (stored in RAM) works.
>>
>
> What are the commands being used to boot in U-Boot?
> What are the errors?
> Have you tried running these commands by hand?
>
> The most likely problem is that U-Boot is trying to find your kernel
> on the wrong MMC device.
>
>
>> Any idea how I can use the system written on the eMMC to boot ?
>>
>> 2015-04-14 17:11 GMT+02:00 Gary Thomas <gary@mlbassoc.com <mailto:
>> gary@mlbassoc.com>>:
>>
>>     On 2015-04-14 09:05, Otavio Salvador wrote:
>>
>>         On Tue, Apr 14, 2015 at 12:04 PM, Gary Thomas <gary@mlbassoc.com
>> <mailto:gary@mlbassoc.com>> wrote:
>>
>>             On 2015-04-14 09:00, Otavio Salvador wrote:
>>
>>
>>                 On Tue, Apr 14, 2015 at 11:58 AM, Gary Thomas <
>> gary@mlbassoc.com <mailto:gary@mlbassoc.com>> wrote:
>>
>>
>>                     On 2015-04-14 08:28, Otavio Salvador wrote:
>>
>>
>>
>>                         On Tue, Apr 14, 2015 at 11:12 AM, Shanx <
>> shanx@legtux.org <mailto:shanx@legtux.org>> wrote:
>>
>>
>>
>>                             Hello,
>>                             I've tried a lot of things, but I can't boot
>> on eMMC. I've flashed it
>>                             from
>>                             u-boot, or from the system (booted from the
>> sdcard). For exemple, I've
>>                             tried
>>                             : dd if=rootfs.sdcard of=/dev/mmcblk3
>>                             I've also tried to flash only u-boot.imx
>> (with dd and seek=2)
>>
>>                             When booting on eMMC (with the boot switch
>> setup given on the Linux
>>                             User
>>                             Guide), nothing append. Any idea why ?
>>
>>
>>
>>
>>                         eMMC has some details which differ from the uSD
>> normal usage. Mainly
>>                         regarding the use of Boot Partitions. So you must
>> to write it to the
>>                         boot partition otherwise it won't work.
>>
>>
>>                     I'm not sure this is correct.  I have an i.MX6Q board
>> which has
>>                     eMMC on SD4 and SD on SD3 and I can boot from either,
>> using the
>>                     same command to install U-Boot
>>                          dd if=/tmp/disk/${UBOOT_NAME} of=${DISK} seek=2
>> bs=512 conv=notrunc
>>
>>                     Maybe it's a difference in the eMMC device (mine is
>> Sandisk SDIN5
>>                     (or7)C2-32G-L)
>>
>>
>>
>>                 It depends if Boot Partition is enabled or not.
>>
>>
>>             Is that an i.MX6 setting?
>>
>>
>>         No; it is eMMC 4.41 (or later) one if IIRC. There are some fields
>>         exposed in sysfs and also a mmc-utils package at meta-oe.
>>
>>
>>     Interesting, I'll look at this but my boards have boot partitions:
>>
>>     mmc0: new high speed DDR MMC card at address 0001
>>     mmcblk0: mmc0:0001 SEM32G 29.1 GiB
>>     mmcblk0boot0: mmc0:0001 SEM32G partition 1 4.00 MiB
>>     mmcblk0boot1: mmc0:0001 SEM32G partition 2 4.00 MiB
>>     usb 1-1: new high-speed USB device number 2 using ci_hdrc
>>     mmcblk0rpmb: mmc0:0001 SEM32G partition 3 4.00 MiB
>>       mmcblk0: p1 p2
>>       mmcblk0boot1: unknown partition table
>>       mmcblk0boot0: unknown partition table
>>
>>     As I said, I install U-Boot directly to block 2 of the device,
>>     not to any of the "boot" partitions.
>>
>>     --
>>     ------------------------------__------------------------------
>>     Gary Thomas                 |  Consulting for the
>>     MLB Associates              |    Embedded world
>>     ------------------------------__------------------------------
>>     --
>>     _________________________________________________
>>     meta-freescale mailing list
>>     meta-freescale@yoctoproject.__org <mailto:meta-freescale@
>> yoctoproject.org>
>>     https://lists.yoctoproject.__org/listinfo/meta-freescale <
>> https://lists.yoctoproject.org/listinfo/meta-freescale>
>>
>>
>>
>>
>>
> --
> Please keep your replies on the mailing list(s) so that all
> may benefit.  Private support is available under contract
> from various agents, including MLB Associates.  Private
> email to me without a contract will be ignored.
>
>
> ------------------------------------------------------------
> Gary Thomas                 |  Consulting for the
> MLB Associates              |    Embedded world
> ------------------------------------------------------------
>
>
> --
> _______________________________________________
> meta-freescale mailing list
> meta-freescale@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-freescale
>

[-- Attachment #2: Type: text/html, Size: 8958 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-04-15 14:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-14 14:12 Boot on eMMC Shanx
2015-04-14 14:28 ` Otavio Salvador
2015-04-14 14:58   ` Gary Thomas
2015-04-14 15:00     ` Otavio Salvador
2015-04-14 15:04       ` Gary Thomas
2015-04-14 15:05         ` Otavio Salvador
2015-04-14 15:11           ` Gary Thomas
2015-04-15 11:55             ` Shanx
2015-04-15 12:06               ` Gary Thomas
2015-04-15 14:19                 ` Shanx
2015-04-15 10:17     ` Thomas
2015-04-15 12:16       ` Gary Thomas

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.