[U-boot] Implementing changes in SD interface | Custom Sabreauto based board

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

[U-boot] Implementing changes in SD interface | Custom Sabreauto based board

Jump to solution
5,726 Views
soorajs
Contributor III

Difference in SD-card interference between Sabreauto and our custom board [Vdash]

  1. Sabreauto SD interference


    sd.jpg

    In Sabreauto reference board, NANDF_CS2 is using as the “Card detect” pin of SD card.


  2. Vdash SD Interference

    sd-vdash.jpg

    In our design, we are using micro SD card. In micro-SD “Card Detect” pin is multiplexed with DAT3 pin of SD card.


    sd-vdash1.jpg

    REQUIRED CHANGES

    1. Card Detect function need to remove from the program, or set the SD3_DAT3 pin initially as Card detect and then as DATA3 of SD card interface.

    2. Set the SD interface program for single bit communication

    3. Confirm that GPIO_2 pin is in logic high state.

    Here is the diff of changes i made  to "board/freescale/mx6qsabreauto/mx6qsabreauto.c" https://pastebin.com/raw/5bvyxmSN , Please ignore changes to usdhc2_pads its for emmc interference . After this change the Error
    "MMC: no card present"
    vanished . Now new error
    mmc_init: -110 timeout: 1456.
    Now i had to make this change https://pastebin.com/raw/YYGfDaaV  in "drivers/mmc/mmc.c" to make it go away, i noticed

    cmd.cmdidx = SD_CMD_APP_SD_STATUS;


    was causing the last error mmc_init: -110 SD_CMD_APP_SD_STATUS value is 13.

    current u-boot log
    U-Boot 2017.03-nxp/imx_v2017.03_4.9.11_1.0.0_ga+ga2fea67 (Dec 27 2017 - 12:21:58 +0530)

    CPU:   Freescale i.MX6Q rev1.2 996 MHz (running at 792 MHz)
    CPU:   Automotive temperature grade (-40C to 125C) at 47C
    Reset cause: POR
    Model: Freescale i.MX6 Quad SABRE Automotive Board
    Board Revision : 0
    Board: MX6Q-Sabreauto rev B
    DRAM:  2 GiB
    PMIC: PFUZE100! DEV_ID=0x10 REV_ID=0x21
    MMC:   FSL_SDHC: 0, FSL_SDHC: 1
    *** Warning - read failed, using default environment

    No panel detected: default to Hannstar-XGA
    Display: Hannstar-XGA (1024x768)
    In:    serial
    Out:   serial
    Err:   serial
    switch to partitions #0, OK
    mmc1 is current device
    Net:   No ethernet found.
    Boot from USB for mfgtools
    Use default environment for                  mfgtools
    Run bootcmd_mfg: run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
    Hit any key to stop autoboot:  0
    Bad Linux ARM zImage magic!
    => mmc info
    Device: FSL_SDHC
    Manufacturer ID: 3
    OEM: 5344
    Name: SS16G
    Tran Speed: 50000000
    Rd Block Len: 512
    SD version 3.0
    High Capacity: Yes
    Capacity: 14.8 GiB
    Bus Width: 4-bit
    Erase Group Size: 512 Bytes
    => mmc list
    FSL_SDHC: 0
    FSL_SDHC: 1 (SD)
    =>


   Our SD-card interference doesn't require voltage switching its using 3.3v always

  I flashed u-boot.imx binary to SD-card using Linux machine

sudo dd if=u-boot.imx of=/dev/mmcblk0 bs=512 seek=2 && sync

  and in boot configuration i select SD-card , Internal Boot and  Boot Configuration and now i do not get u-boot on booting        the boot , the Kermit console is completely blank.
 
   On using mgftool the log https://pastebin.com/raw/7MUaH7NX , it surely loads u-boot , kernel, ramdisk and dtb but after this its not able to connect SD-card to pc in mass storage mode  .

Is there something iam missing ?

Labels (4)
0 Kudos
1 Solution
4,083 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sooraj

 if SD-card interference doesn't require voltage switching and always using 3.3v
one can follow Sabre-SD design (and its uboot image), spf-27392 p.6

Schematics (1)
i.MX6_SABRE_SDP_DESIGNFILES

SABRE Platform for Smart Devices|NXP 

Voltage selection during boot is described in sect.8.5.3.3 SD, eSD, and SDXC

i.MX6DQ Reference Manual

http://www.nxp.com/docs/en/reference-manual/IMX6DQRM.pdf

SD ver.3.0 cards may use _vselect, please try ver.2.0 sd cards.

Best regards
igor

View solution in original post

0 Kudos
8 Replies
4,083 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sooraj

sd3 does not require cd signal for boot according to Table 8-17. SD/MMC IOMUX pin configuration

i.MX6DQ Reference Manual
http://cache.nxp.com/files/soft_dev_tools/doc/support_info/iMX6DQRM.pdf

Supported linux "cd" options are described in sect.32.2.3 Devicetree Binding

attached Linux Manual.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
4,083 Views
soorajs
Contributor III

Okay Thanks , but then why was uboot.imx not boot when i dd to sdcard ,why is mfgtool not able to flash to sdcard .
Is my uboot working fine ? i just have to edit device tree now ?
This change https://pastebin.com/raw/YYGfDaaV  will not cause future issues ? , any chance i could fix this ?
Is it possible to perform mmc write from uboot console ? i mean to write uboot to sdcard ? or kernel to sdcard?
Note mmc dev 1 is sdcard , 0x12000000 is where i load kernel using kermit .

0 Kudos
4,084 Views
igorpadykov
NXP Employee
NXP Employee

had you run ddr test on board

i.MX6/7 DDR Stress Test Tool V2.70 

and modified uboot dcd header ( ..board/freescale//mx6qsabreauto/*.cfg file)

with new calibration settings found from test

Best regards
igor

0 Kudos
4,084 Views
soorajs
Contributor III

Hello Igor ,

Thanks for pointing me to the right direction https://hastebin.com/raw/zatiyadawu major changes are to ( Write leveling calibration, Read DQS Gating calibration, Read calibration, Write calibration). Its now booting from sdcard .
It doesn't work on completely power off the board / Unplug and reinsert the SD-card and try reset
But it only work when i do these steps .
* power on the board and load u-boot.imx to Ram using imx_usb_loader
     i now see an error

Card did not respond to voltage select!
mmc_init: -95, time 47

* Unplug and reinsert the SD-card now try reset the board the u-boot from SD-card will be loaded .

Any idea why u-boot not load when power off the board / remove SD-card and try reset .
Any idea why error Card did not respond to voltage select!
Our SD-card interference doesn't require voltage switching its using 3.3v always

0 Kudos
4,083 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sooraj

one can follow sect.4.3.4 Copying a bootloader image attached Linux Guide.

imx_usb_loader is not used in nxp bsps and issues with it can be posted on

 meta-fsl-arm mailing list, so that someone familiar with it could try to assist you.
https://lists.yoctoproject.org/listinfo/meta-freescale

Best regards
igor

0 Kudos
4,083 Views
soorajs
Contributor III

Hello Igor ,
i followed sect.4.3.4 Copying a bootloader image as per that document but still uboot would not boot untill i peform the same steps i do on last post its same if i use sb_loader to load u-boot to ram. Voltage selection needs to be implemented on your platform ? could this be due to sd3_vselect ? Does SD3.0 require 1.8 V for signal voltage .

0 Kudos
4,084 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sooraj

 if SD-card interference doesn't require voltage switching and always using 3.3v
one can follow Sabre-SD design (and its uboot image), spf-27392 p.6

Schematics (1)
i.MX6_SABRE_SDP_DESIGNFILES

SABRE Platform for Smart Devices|NXP 

Voltage selection during boot is described in sect.8.5.3.3 SD, eSD, and SDXC

i.MX6DQ Reference Manual

http://www.nxp.com/docs/en/reference-manual/IMX6DQRM.pdf

SD ver.3.0 cards may use _vselect, please try ver.2.0 sd cards.

Best regards
igor

0 Kudos
4,083 Views
soorajs
Contributor III

Hello Igor,

The issue was resolved it was a design flaw ,
here is where iam stuck now .
https://community.nxp.com/message/976728 

0 Kudos