Changes between Version 19 and Version 20 of MMC


Ignore:
Timestamp:
09/27/2021 05:25:38 PM (3 years ago)
Author:
Tim Harvey
Comment:

added enhanced user area section

Legend:

Unmodified
Added
Removed
Modified
  • MMC

    v19 v20  
    105105
    106106
     107[=#emmc-enhanced-user-area]
     108=== eMMC Enhanced User Area and Pseudo SLC
     109The eMMC 4.4 standard introduced the concept of 'Enhanced User Area' in order to improve reliability, performance, and endurance. This allows a one-time configuration of the eMMC to configure all or some of the MLC NAND flash as Psuedo SLC (pSLC) where instead of 2 bits per cell it uses 1 bit per cell. This will reduce the available size of the eMMC as a trade-off for improved reliability, performance, and endurance.
     110
     111The specification for Enhanced User Area does not specify a particular implementation or require eMMC devices to even support Enhanced User Area.
     112
     113U-Boot has mmc commands that can be used to configure all or some of an eMMC as enhanced storage.
     114
     115Example: GW7301:
     116 * Use 'mmc info' to see current configuration
     117{{{#!bash
     118u-boot=> mmc list
     119FSL_SDHC: 0
     120FSL_SDHC: 1
     121FSL_SDHC: 2 (eMMC)
     122u-boot=> mmc dev 2
     123switch to partitions #0, OK
     124mmc2(part 0) is current device
     125u-boot=> mmc info
     126Device: FSL_SDHC
     127Manufacturer ID: 13
     128OEM: 14e
     129Name: S0J58
     130Bus Speed: 52000000
     131Mode: MMC High Speed (52MHz)
     132Rd Block Len: 512
     133MMC version 5.1
     134High Capacity: Yes
     135Capacity: 59.3 GiB
     136Bus Width: 8-bit
     137Erase Group Size: 512 KiB
     138HC WP Group Size: 16 MiB
     139User Capacity: 59.3 GiB WRREL
     140Boot Capacity: 31.5 MiB ENH
     141RPMB Capacity: 4 MiB ENH
     142Boot area 0 is not write protected
     143Boot area 1 is not write protected
     144}}}
     145  - The above shows that mmc device 2 is an eMMC with:
     146   * 59.3 GiB capacity in the User hardware partition with write reliability turned on (WRREL). Write reliability is a configuration that affects what happens during an unexpected power-cut; when enabled write operations are atomic and this is typically desired over the higher performance available when this is disabled.
     147   * 31.5 MiB capacity in the Boot hardware partition configured as enhanced user area (ENH)
     148   * 4 MiB capacity in the RPMB hardware partition configured as enhanced user area (ENH)
     149 * use 'mmc hwpartition' to see the current configuration:
     150{{{#!bash
     151u-boot=> mmc hwpartition
     152Partition configuration:
     153        No enhanced user data area
     154        No GP1 partition
     155        No GP2 partition
     156        No GP3 partition
     157        No GP4 partition
     158}}}
     159 * use 'mmc hwpartition user enh' to set enhanced storage with a starting block and a block count (512 byte blocks) which must be aligned with the 'HC WP group size' reported from the 'mmc info' command above. You can use the 'check' option to test the parameters before making it permanent. The 'mmc info' command does not show us the capacity in the number of 512 byte blocks but instead rounds it to GiB or MiB. You can boot to linux and look at /sys/class/block/mmcblk2/size to see the number of 512 byte blocks, which for this particular device is 124321792.
     160{{{#!bash
     161u-boot=> mmc hwpartition user enh 0 124321792 check
     162Partition configuration:
     163        User Enhanced Start: 0 Bytes
     164        User Enhanced Size: 59.3 GiB
     165        No GP1 partition
     166        No GP2 partition
     167        No GP3 partition
     168        No GP4 partition
     169Total enhanced size exceeds maximum (3794 > 1892)
     170Failed!
     171}}}
     172  - This failed due to this eMMC only allowing up to 1892 HC WP Group's. The 'mmc info' command showed us that 'HC WP Group Size' is 16MiB so that means the maximum size we can set to enhanced user area is 1892 * 16MiB = 30272MiB. Devide that by 512bytes gives us 61997056 blocks.
     173 * use 'mmc hwpartition user enh' again now that we know the max we can request.
     174{{{#!bash
     175u-boot=> mmc hwpartition user enh 0 61997056 wrrel on check
     176Partition configuration:
     177        User Enhanced Start: 0 Bytes
     178        User Enhanced Size: 29.6 GiB
     179        User partition write reliability: on
     180        No GP1 partition
     181        No GP2 partition
     182        No GP3 partition
     183        No GP4 partition
     184}}}
     185 * We see no errors now. Once you are satisfied with the offset, size, and capabilities you can add the 'complete' option:
     186{{{#!bash
     187u-boot=> mmc hwpartition user enh 0 61997056 wrrel on complete
     188Partition configuration:
     189        User Enhanced Start: 0 Bytes
     190        User Enhanced Size: 29.6 GiB
     191        User partition write reliability: on
     192        No GP1 partition
     193        No GP2 partition
     194        No GP3 partition
     195        No GP4 partition
     196Partitioning successful, power-cycle to make effective
     197}}}
     198 * After reprogramming eMMC (because we just re-configured the start of the user hardware partition where our boot firmware is) you see the results:
     199{{{#!bash
     200u-boot=> mmc dev 2
     201switch to partitions #0, OK
     202mmc2(part 0) is current device
     203u-boot=> mmc info
     204Device: FSL_SDHC
     205Manufacturer ID: 13
     206OEM: 14e
     207Name: S0J58
     208Bus Speed: 52000000
     209Mode: MMC High Speed (52MHz)
     210Rd Block Len: 512
     211MMC version 5.1
     212High Capacity: Yes
     213Capacity: 29.6 GiB
     214Bus Width: 8-bit
     215Erase Group Size: 512 KiB
     216HC WP Group Size: 16 MiB
     217User Capacity: 29.6 GiB ENH WRREL
     218User Enhanced Start: 0 Bytes
     219User Enhanced Size: 29.6 GiB
     220Boot Capacity: 31.5 MiB ENH
     221RPMB Capacity: 4 MiB ENH
     222Boot area 0 is not write protected
     223Boot area 1 is not write protected
     224}}}
     225 * Note User hardware partition is now half the size it was before but now is enhanced user area (ENH)
     226
     227** Important notes:**
     228- changing this is a one-time thing
     229- you only get one configuration of offset/size/mode
     230- if you change the configuration of your boot area you must re-program the eMMC via JTAG
     231
    107232[=#emmc-uboot]
    108233=== U-Boot Support ===
     
    183308Gateworks supports microSD (aka uSD) cards on several boards in the Newport, Ventana, and Laguna product families. A microSD card operates at 3.3V (with 3.3V or 1.8V I/O if the board allows it) and uses 4bit I/O. On most Ventana and Newport boards a dual function microSD/SIM connector is used. See the following link for how to load SIM and micoSD cards into this connector. http://trac.gateworks.com/wiki/ventana/simsd
    184309
    185 ==== MicroSD / uSD Size Limit
     310=== MicroSD / uSD Size Limit
    186311The Ventana, Newport and Venice support SDXC cards which can support up to 2TB.
    187312
     
    191316
    192317
    193 ==== MicroSD References
     318=== MicroSD References
    194319 * [wiki:linux/blockdev Gateworks BlockDev Wiki for Imaging MicroSD Cards]
    195320 * http://en.wikipedia.org/wiki/Secure_Digital