using eMMC on i.MX6SL EVK

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

using eMMC on i.MX6SL EVK

10,353 Views
kathywright
Contributor II

I'm trying to use MFG tool program an eMMC that we added to the EVK.  I've tried adjusting the boot dip switches to no avail.  It appears to write the uBoot and kernel image (though I doubt this is really happening) but then fails when it goes to write to the file system.

1.  I see that on the Mfg Tools for the i.MX6DL that it has separate lists for the eMMC configuration, with additional steps for the eMMC.  I take it I should be doing the same additional steps here for the i.MX6SL?

2.  Do I need to build updated uBoot and kernel images to use the eMMC or is that already in the BSP?

I should add that this device does not even appear to be visible (ie showing up in system folder).

Thanks in advance

Kathy

Labels (1)
Tags (1)
13 Replies

2,214 Views
benbirdsall
Contributor II

Kathy,

I have been trying to boot and put an image on an eMMC device on the footprint for the past few weeks, and I finally found my solution. As long as I had anything in the SD2 slot it would work. At the end of the slot is a little tab that the SD card will push into the SD frame. I held this shut with a pair of tweezers, and I was able to both boot from the eMMC and load an image on without changing anything else in the kernel or on the board.   This might be your problem.  If it is, I don't know if there is something that actually fixes this, but you could solder it closed if you have to.

If you are using a revision 6 eMMC device, then you will need to change the kernel to support it.

Hope this helps,

Ben

Message was edited by: Benjamin Birdsall If you have the kernel source code, you can go to arch/arm/mach-mx6/board-mx6sl_evk.c Go to where it says static const struct esdhc_platform_data mx6_evk_sd2_data __initconst = { add ".always_present = 1," as the first line of the struct and it should work with that. I think that this should only be done when using eMMC devices. Then recompile the kernel for both the manufacturing tool and for booting.

2,214 Views
kathywright
Contributor II

Hi Ben - thanks,  that was helpful.  I'd figured that it was related to the card being detected.

I had tried adding .always_present = 1  and .cd_type =  ESDHC_CD_PERMANENT to the struct esdh_platform_data  and removing .cd_gpio and .wp_gpio) with some success, but haven't gotten back to that yet. 

I went back to the 'stock' image 2.1.0 and tried what you said (toothpick is my 'tool' of choice) and it partially worked.  It did see the eMMC and recognized that it was a 4G chip, and then the errors began, since it tried partitioning the eMMC with an address beyond the EndOfDevice - the first of many errors.  I would have expected the size to be self-discovering and then make adjustment, but perhaps that's naive of me. 

Did yours work with an 8G device (like the SD card it shipped with) or another size?

Kathy

0 Kudos

2,214 Views
benbirdsall
Contributor II

Kathy,

I was able to build an image on a 4GB part. However, I don't know if you are building android or Linux. I was putting android on my board, and the shell script for making an sd card for android does look at the size of the device that you are using. I haven't really looked at how it will prepare the card for linux.

Ben

Message was edited by: Benjamin Birdsall What List in the xml file are you using in your config file for the manufacturing tool?

0 Kudos

2,214 Views
kathywright
Contributor II

Ben,

There is no separate List in the xml file for the eMMC, unlike the Sabre Board.  The primary difference is that there are couple of extra steps for accessing the boot partition.

Right now I'm using MFG Tool to write to SD3, then booting from SD3, then add the toothpick to SD2 slot so it will detect the eMMC.  (have to wait until after it's booted or else it will try to boot from eMMC since' its the first one - this way,  SD3 is mmcblk0 and eMMC is mmcblk1)

It does see it, but with errors:

~ # mmc1: new high speed DDR MMC card at address 0001

mmcblk1: mmc1:0001 MMC04G 3.52 GiB

mmcblk1boot0: mmc1:0001 MMC04G partition 1 16.0 MiB

mmcblk1boot1: mmc1:0001 MMC04G partition 2 16.0 MiB

mmcblk1: unknown partition table

mmcblk1boot1: unknown partition table

mmcblk1boot0: p1

mmcblk1boot0: p1 size 15503360 extends beyond EOD, truncated


It seems to show up fine, and I see attribute files for the cid and csd registers, but not for the ECSD/EXT_CSD.


I seem to be able to dd the u-boot and uImage , but then go to set up to partition the device and run into trouble:


/sys/devices/platform/sdhci-esdhc-imx.1/mmc_host/mmc1/mmc1:0001 # fdisk -l /dev/mmcblk1

Disk /dev/mmcblk1: 4 MB, 4642304 bytes                               WAY TOO SMALL

255 heads, 63 sectors/track, 0 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/mmcblk1 doesn't contain a valid partition table

/sys/devices/platform/sdhci-esdhc-imx.1/mmc_host/mmc1/mmc1:0001 # echo 8 > boot_config

mmc1: unable to read EXT_CSD.

sh: write error: Connection timed out

/sys/devices/platform/sdhci-esdhc-imx.1/mmc_host/mmc1/mmc1:0001 #



When it first detected the eMMC it  know the total size, which I think requires reading the EXT_CSD, so I don't yet understand why it's having trouble here.  Also I'm not sure why it appears so small using fdisk -l, but I'm guessing the fact that it can't see the user partitions when it's accessing the boot partitions.


Kathy



0 Kudos

2,214 Views
benbirdsall
Contributor II

Kathy,

When I tried to put an image on my part using the linux instructions, it went smoothly.

My config file looked like this.

[profiles]

chip = MX6SL Linux Update

[platform]

board = EVK-SD

[LIST]

name = EVK-SD

I didn't modify the xml file at all, I didn't need any other lines. The only difference was that I was using the uImage that I made for the manufacturing part that supports revision 6 eMMC and didn't need the SD card in SD2.

The script file that the EVK-SD List uses looks like it makes one partition at 10 MB and and formats the rest of the card in ext3, I think. So if you are using the mksdcard.sh, the partition table shouldn't be running over the ends.  That's the best I can do without knowing the config file and xml setup that you are using. If I think of anything else, I'll edit this post.

Ben

0 Kudos

2,214 Views
kathywright
Contributor II

HI Ben --

I've tried loading the Android image as well, since that worked for you.  It loads fine on an SD card, but does not load on my eMMC card.  I tried with and without the the toothpick to hold the SD2 CD (ie make it visible) and I'm attach the log files from each of these runs.

Since all else seems to be the same , I'd think perhaps it's a difference in the eMMC.  I'd think these would all work the same ads long as they adhere to the JEDEC standard, but I also see bits and pieces where folks modify the kernel to work with specific manufactures.   We're using a Micron 4GB part.

The only difference was that I was using the uImage that I made for the manufacturing part that supports revision 6 eMMC and didn't need the SD card in SD2.

Sounds like I'm gonna need to do this.  the sfdisk doesn't seem to be creating the partition table like it should.  I haven't been able to this successfully manually either by booting from an SD card and then using fdisk.  Iv'e tried copying the from the SD card, I've tried  writing zeros in the first 1K , but I still don't seem to be able to partition successfully.  Even so this requires the expert commands and I'[m certainly no expert at this.

What did you have to change?  Are you using LTIB or another tool?

Thanks for all your help so far.

Kathy

0 Kudos

2,214 Views
benbirdsall
Contributor II

Kathy,

From looking at the output of your traces, the problem doesn't appear to be an unsupported eMMC device. The kernel appears to find it just fine.  So the revisions that I made to the kernel wouldn't fix those errors that you had with the toothpick, they would just take away the need for the toothpick.  I am wondering if it could be a problem with the device itself. I don't know if you have another eMMC part to test it with, but you could try that. It could be a problem with write prtection or something like that. I don't know how much you can pull from your eMMC, but if you can look at the CSD, you might check to see if any of the bits 10-12 are set. I also am not sure what the error code 110 means, so you might look into that, too. Sorry I can't give more helpful suggestions. That's what comes to mind.

Ben

0 Kudos

2,214 Views
robby
NXP Employee
NXP Employee

For #1,

You can just use the SD configuration ( 'EVK-SD' in cfg.ini file) for eMMC.


For #2,

You can just use same Image. It has no dependency on media.

I wonder if you already set the proper boot switcher.

You can refer to "Table. MMC/eMMC Boot Fusemap" in IC reference manual.


or refer to the following table:

SW3 CFG1

01234567
Use L2 Cache as OCRAM11Fast Boot:
0 - Regular;
1 - Fast Boot
Speed:
0 - Normal (25MHz);
1 - High Speed (50MHz)
Fast Boot Ack:
0 - Ack Enable;
1 - Ack Disable
Power Cycle Enable:
0 - No power cycle;
1 - Enabled via USDHC_RST pad (SD3 & SD4 only)
SD Loopback Clock Source Sel:
0 - through SD pad;
1 - direct

SW4 CFG2

0 - 23 - 4567
Bus Width:
000 - 1-bit
001 - 4-bit
010 - 8-bit
101 - 4-bit DDR (MMC 4.4)
110 - 8-bit DDR (MMC 4.4)
Else - reserved.
Port Select:
00 - eSDHC1
01 - eSDHC2
10 - eSDHC3
11 - eSDHC4
Boot Frequencies
(ARM/DDR) :
0 - 792 / 400 MHz
1 - 528 / 307 MHz
SD2 VOLTAGE SELECTION:
0 - 3.3V
1 - 1.8V
Reserved

For example, eMMC on SD2 slot.

SW3[1:8] = 01100000

SW4[1:8] = 00101000

2,214 Views
jtobias
Contributor III

Hello all,

I tried the following settings below, it works if I put my eMMC card to SD1 slot. The uboot were able to list the file (fatls mmc 0) inside of the card.

But, when I used SD2 slot for my eMMC, the mx6slevk eval board were able to find it  and load the uboot. But, the problem is that, I couldn't read data (fatls mmc 1) on the said slot. But, if I eject the eMMC and replace with SD card (mmc dev 1; fatls mmc 1), the slot is working correctly.

SW3[1:8] = 01100000  

SW4[1:8] = 00001000 / 00101000 / 01001000 

The strange thing is that, if I boot my linux, I was able to mount my eMMC card.

I use the Transcend card http://www.betasoft-srl.com.ar/DS/Transcend/TS2GMMC4.pdf.

Any idea?.

Regards,

John

0 Kudos

2,214 Views
benbirdsall
Contributor II

Are you trying to boot Android? Does it do a full boot from the SD1 slot? If you are booting android, and you can't get all the way to android, it seems like you are trying to use a revision of eMMC it doesn't support. The ICS kernel doesn't like any revision of eMMC past revision 5. If you have the code, try going to kernel/drivers/mmc/core/mmc.c, search the word "revision" or "rev", then change the if statement to "> 6" from "> 5". It might be in core.c, but I think it is mmc.c.

-Ben

0 Kudos

2,214 Views
kathywright
Contributor II

Thanks Dongjun,

For #1 -  I wondered about that because in the instructions for others in the i.MX6 family, they use different instructions when using the eMMC, specifically these two:

<CMD state="Updater" type="push" body="$ echo 1 > /sys/devices/platform/sdhci-esdhc-imx.3/mmc_host/mmc0/mmc0:0001/boot_config">access boot partition 1</CMD>

<CMD state="Updater" type="push" body="$ echo 8 > /sys/devices/platform/sdhci-esdhc-imx.3/mmc_host/mmc0/mmc0:0001/boot_config">access user partition and enable boot partion 1 to boot</CMD>

(I wonder if those would actually work -- shouldn't the mmc0 be mmc3 ?)

For #2

Thanks - that's helpful.  I have a feeling that there's a problem with the image itself, since the board is designed for an eMMC but doesn't ship with one ..

As for the jumpers, I'm pretty sure I'm doing that right but there are a lot of options to be set for the eMMC (more than for the SD) and I haven't tried every possible combination.  But your notes above are somewhat confusing, because the order of the bits is reversed from how it 'looks' on the board.

For the SD2, the default that came with the board (and works):

SW3[8:1] = CFG1[0:7] = 00000010

SW4[8:1] = CFG2[0:7] = 00110100

So for eMMC on SD2 slot:

  normal speed, normal boot

  SW3[8:1] = CFG1[0:7] = 00010110

  use default PAD, MMC Boot Ack En, DLL Boot ROM Defaults, Bus Width 4 bit DDR

  SW4[8:1] = CFG2[0:7] = 00010101

I've tried many other combinations as well.

I understand that these get read at startup (under certain conditions) - does MFG Tool also read these?  Or does it rely on the initial reading from bootrom loader?

I think the real problem is more closely related to #1, because I don't see the following directory:

/sys/devices/platform/sdhci-esdhc-imx.1/mmc_host/mmc1/mmc1:0001/boot_config

Kathy

0 Kudos

2,213 Views
kathywright
Contributor II

Freescale had released an update earlier this week.  The u-boot code did not change but the uImage did  (L3.0.35_2.1.0). 

I am now able to at least boot to the eMMC through u-boot (cannot load kernel) with the following switch settings:

So for eMMC on SD2 slot:

  SW3[8:1] = CFG1[0:7] = 0000 0110 or 0001 0110

  SW4[8:1] = CFG2[0:7] = 00010100

note that:

1- these are in same order as you see looking at the board

2 - this is for 4 bit bus.  8 bit does not work and 4 bit DDR does not work -- at least not without modifying code.

Kathy

0 Kudos

2,213 Views
kathywright
Contributor II

Update:

I can indeed see the eMMC in uBoot (I had to boot from NOR or another SD slot), and get a good response using mmcinfo. 

After the provided image gets loaded, I don't see it under /sys/devices/platform/sdhci-esdhc-imx.1/mmc_host.

0 Kudos