Enable SPI

Discussion in 'Kernels' started by cyrilf, Aug 24, 2015.

  1. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    167
    Likes Received:
    47
    Hello,

    I want to use the spi1 communication with Linux. I downloaded the kernel available on GitHub and I edited the header file board-mx6qd_seco_UDOO.h before cross-compilation:

    Code:
    ...
       MX6Q_PAD_DISP0_DAT20__ECSPI1_SCLK, 
         // MX6Q_PAD_DISP0_DAT21__GPIO_5_15,           // pin 37
       MX6Q_PAD_DISP0_DAT21__ECSPI1_MOSI,
       MX6Q_PAD_EIM_A16__GPIO_2_22,               // pin 38
       MX6Q_PAD_GPIO_18__GPIO_7_13,               // pin 39
       MX6Q_PAD_NANDF_D0__GPIO_2_0,               // pin 40
         // MX6Q_PAD_NANDF_D0__USDHC1_DAT4,
       MX6Q_PAD_NANDF_D3__GPIO_2_3,               // pin 41
         // MX6Q_PAD_NANDF_D3__USDHC1_DAT7,
       MX6Q_PAD_NANDF_D2__GPIO_2_2,               // pin 42
         // MX6Q_PAD_NANDF_D2__USDHC1_DAT6,
       MX6Q_PAD_NANDF_D1__GPIO_2_1,               // pin 43
         // MX6Q_PAD_NANDF_D1__USDHC1_DAT5,
       MX6Q_PAD_GPIO_19__GPIO_4_5,                 // pin 44
         // MX6Q_PAD_GPIO_19__SPDIF_OUT1,
         // MX6Q_PAD_GPIO_19__CCM_CLKO, 
         // MX6Q_PAD_DISP0_DAT22__GPIO_5_16,           // pin 45
       MX6Q_PAD_DISP0_DAT22__ECSPI1_MISO,
         // MX6Q_PAD_DISP0_DAT23__GPIO_5_17,           // pin 46
       MX6Q_PAD_DISP0_DAT23__ECSPI1_SS0,
       MX6Q_PAD_EIM_D25__GPIO_3_25,               // pin 47
         // MX6Q_PAD_EIM_D25__UART3_RXD,
       MX6Q_PAD_KEY_ROW1__GPIO_4_9,               // pin 48
         // MX6Q_PAD_KEY_ROW1__UART5_RXD,
       MX6Q_PAD_KEY_COL1__GPIO_4_8,               // pin 49
         // MX6Q_PAD_KEY_COL1__UART5_TXD, 
         // MX6Q_PAD_KEY_COL1__USDHC1_VSELECT,
       MX6Q_PAD_EIM_OE__GPIO_2_25,                 // pin 50
         // MX6Q_PAD_EIM_OE__ECSPI2_MISO,
       MX6Q_PAD_EIM_CS1__GPIO_2_24,               // pin 51
         // MX6Q_PAD_EIM_CS1__ECSPI2_MOSI,
       MX6Q_PAD_EIM_CS0__GPIO_2_23,                // pin 52
         // MX6Q_PAD_EIM_CS0__ECSPI2_SCLK,
         // MX6Q_PAD_EIM_D24__GPIO_3_24,             // pin 53
       MX6Q_PAD_EIM_D24__ECSPI2_SS2,
        ...
        MX6Q_PAD_DISP0_DAT18__GPIO_MODE,
        MX6Q_PAD_DISP0_DAT19__GPIO_MODE,
        //MX6Q_PAD_DISP0_DAT20__GPIO_MODE, disable GPIO for SPI communication
        //MX6Q_PAD_DISP0_DAT21__GPIO_MODE, disable GPIO for SPI communication
        MX6Q_PAD_EIM_A16__GPIO_MODE,
     
        MX6Q_PAD_GPIO_18__GPIO_MODE,  
        MX6Q_PAD_NANDF_D0__GPIO_MODE,        
        MX6Q_PAD_NANDF_D1__GPIO_MODE,
        MX6Q_PAD_NANDF_D2__GPIO_MODE,
        MX6Q_PAD_NANDF_D3__GPIO_MODE,
       
        MX6Q_PAD_GPIO_19__GPIO_MODE,        
        //MX6Q_PAD_DISP0_DAT22__GPIO_MODE, disable GPIO for SPI communication
        //MX6Q_PAD_DISP0_DAT23__GPIO_MODE, disable GPIO for SPI communication
        MX6Q_PAD_EIM_D25__GPIO_MODE,        
        MX6Q_PAD_KEY_ROW1__GPIO_MODE,
         
        MX6Q_PAD_KEY_COL1__GPIO_MODE,   
        MX6Q_PAD_EIM_OE__GPIO_MODE,    
        MX6Q_PAD_EIM_CS1__GPIO_MODE,    
        MX6Q_PAD_EIM_CS0__GPIO_MODE,         
        //MX6Q_PAD_EIM_D24__GPIO_MODE, disable GPIO for SPI communication
        ...
    but now I cannot figure out where to test the SPI communication in the rootfs. Is it one of the /dev/ttymxc<X> ? Which one?

    Thank you for your help.
    Cyril
     
    Last edited: Sep 7, 2015
  2. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
  3. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    167
    Likes Received:
    47
    Last edited: Aug 25, 2015
  4. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    167
    Likes Received:
    47
    I have enabled in the kernel:
    • Device Drivers ---> SPI support ---> Utilities for Bitbanking SPI masters
    • Device Drivers ---> SPI support ---> Freescale i.MX SPI controllers
    • Device Drivers ---> SPI support ---> User mode SPI device driver support
    Does anyone have ever used SPI communication with the UDOO? That should be simple to enable.

    Edit : I found a better explanation here but it is specific to an other board with the right kernel files : http://armbedded.eu/node/318
     
    Last edited: Aug 25, 2015
  5. patrykk

    patrykk Member

    Joined:
    Dec 10, 2014
    Messages:
    52
    Likes Received:
    9
  6. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    167
    Likes Received:
    47
    Thank you for your reply :)

    The board-mx6_seco_UDOO.c and board-mx6qd_seco_UDOO.h files haven't been updated since January 2013 on the official UDOO GitHub repository. It's a been a long time so I cannot rely on it for up to time kernel sources.

    I'd like to compile your sources but do you have a UDOO_deconfig file or should I use the official one? I cannot find a march-mx6/ directory in arch/arm/. Where does the make imx6q-udoo.dtb command find the sources to manage UDOO specific hardware? There is no Freescale i.MX SPI controllers option in Device Drivers ---> SPI support in the kernel config menu. Which driver is related to the UDOO SPI com?

    Thank you.
     
    Last edited: Sep 7, 2015
  7. patrykk

    patrykk Member

    Joined:
    Dec 10, 2014
    Messages:
    52
    Likes Received:
    9
  8. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    167
    Likes Received:
    47
    Hi,

    Neither your kernel (with config-4.2 file) or the official one (with udoo_quad_defconfig) do compile with the arm-fsl-linux-gnueabi- toolchain.

    With your kernel I did:
    Code:
    cd linux-udoo
    cp ../config-4.2 .config
    make -j4 ARCH=arm CROSS_COMPILE=arm-fsl-linux-gnueabi- uImage LOADADDR=0x10008000 modules
    and I got:
    Code:
    {standard input}: Assembler messages:
    {standard input}:150: Error: garbage following instruction -- `dmb ish'
    {standard input}:157: Error: garbage following instruction -- `dsb ishst'
    scripts/Makefile.build:258: recipe for target 'arch/arm/kernel/irq.o' failed
    make[1]: *** [arch/arm/kernel/irq.o] Error 1
    Makefile:949: recipe for target 'arch/arm/kernel' failed
    make: *** [arch/arm/kernel] Error 2
    make: *** Waiting for unfinished jobs....
      CC      arch/arm/vfp/vfpdouble.o
      CC      init/do_mounts_rd.o
      CC      init/do_mounts_initrd.o
      CC      init/initramfs.o
      CC      init/calibrate.o
      CC      init/init_task.o
      CC      init/version.o
      LD      arch/arm/vfp/vfp.o
      LD      arch/arm/vfp/built-in.o
      LD      init/mounts.o
      LD      init/built-in.o
    With the official one:
    Code:
    cd linux_kernel
    make ARCH=arm CROSS_COMPILE=arm-fsl-linux-gnueabi- udoo_quad_defconfig
    make -j4 ARCH=arm CROSS_COMPILE=arm-fsl-linux-gnueabi- uImage
    and I got:
    Code:
    {standard input}: Assembler messages:
    {standard input}:83: Error: garbage following instruction -- `dmb ish'
    {standard input}:96: Error: garbage following instruction -- `dmb ish'
    {standard input}:112: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:113: Error: bad instruction `pldw [r4,#0]'
    scripts/Makefile.build:308: recipe for target 'arch/arm/mach-imx/cpuidle-imx6q.o' failed
    make[1]: *** [arch/arm/mach-imx/cpuidle-imx6q.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    Makefile:843: recipe for target 'arch/arm/mach-imx' failed
    make: *** [arch/arm/mach-imx] Error 2
    {standard input}: Assembler messages:
    {standard input}:216: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:217: Error: bad instruction `pldw [r3,#0]'
    {standard input}:794: Error: garbage following instruction -- `dmb ish'
    {standard input}:805: Error: garbage following instruction -- `dmb ish'
    {standard input}:860: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:861: Error: bad instruction `pldw [r3,#0]'
    {standard input}:919: Error: garbage following instruction -- `dmb ish'
    {standard input}:930: Error: garbage following instruction -- `dmb ish'
    {standard input}:1061: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:1062: Error: bad instruction `pldw [r3,#0]'
    {standard input}:1172: Error: garbage following instruction -- `dmb ish'
    {standard input}:1185: Error: garbage following instruction -- `dmb ish'
    {standard input}:1222: Error: garbage following instruction -- `dmb ish'
    {standard input}:1235: Error: garbage following instruction -- `dmb ish'
    {standard input}:1547: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:1548: Error: bad instruction `pldw [r1,#0]'
    {standard input}:1616: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:1617: Error: bad instruction `pldw [r0,#0]'
    {standard input}:1702: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:1703: Error: bad instruction `pldw [r3,#0]'
    {standard input}:1744: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:1745: Error: bad instruction `pldw [r3,#0]'
    {standard input}:1798: Error: garbage following instruction -- `dmb ishst'
    {standard input}:1975: Error: garbage following instruction -- `dmb ish'
    {standard input}:1988: Error: garbage following instruction -- `dmb ish'
    {standard input}:2010: Error: garbage following instruction -- `dmb ishst'
    {standard input}:2072: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:2073: Error: bad instruction `pldw [r2,#0]'
    {standard input}:2095: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:2096: Error: bad instruction `pldw [r3,#0]'
    {standard input}:2118: Error: garbage following instruction -- `dmb ishst'
    {standard input}:2130: Error: garbage following instruction -- `dmb ishst'
    {standard input}:2248: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:2249: Error: bad instruction `pldw [ip,#0]'
    {standard input}:2354: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:2355: Error: bad instruction `pldw [r0,#0]'
    {standard input}:2376: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:2377: Error: bad instruction `pldw [r3,#0]'
    {standard input}:2719: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:2720: Error: bad instruction `pldw [r3,#0]'
    {standard input}:2736: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:2737: Error: bad instruction `pldw [r2,#0]'
    {standard input}:2759: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:2760: Error: bad instruction `pldw [r2,#0]'
    {standard input}:2931: Error: unknown pseudo-op: `.arch_extension'
    {standard input}:2932: Error: bad instruction `pldw [r3,#0]'
    {standard input}:2965: Error: garbage following instruction -- `dmb ish'
    {standard input}:2978: Error: garbage following instruction -- `dmb ish'
    {standard input}:2991: Error: garbage following instruction -- `dmb ish'
    scripts/Makefile.build:308: recipe for target 'kernel/fork.o' failed
    make[1]: *** [kernel/fork.o] Error 1
    Makefile:843: recipe for target 'kernel' failed
    make: *** [kernel] Error 2
     
  9. vpeter

    vpeter Active Member

    Joined:
    Nov 29, 2014
    Messages:
    303
    Likes Received:
    62
    Try using Linaro toolchain: https://releases.linaro.org/14.09/c...-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz

    More instructions here.

    The only problem is this:

    CC drivers/media/platform/mxc/capture/mxc_v4l2_capture.o
    drivers/media/platform/mxc/capture/mxc_v4l2_capture.c:2514:2: error: unknown field ‘ioctl’ specified in initializer
    .ioctl = mxc_v4l_ioctl,
    ^
    drivers/media/platform/mxc/capture/mxc_v4l2_capture.c:2514:11: warning: initialization from incompatible pointer type
    .ioctl = mxc_v4l_ioctl,
    ^
    drivers/media/platform/mxc/capture/mxc_v4l2_capture.c:2514:11: warning: (near initialization for ‘mxc_v4l_fops.write’)
     
    Last edited: Sep 7, 2015
  10. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    167
    Likes Received:
    47
    OK thank you!

    Now it compiles, but the kernel doesn't boot. I use U-Boot but I cannot figure out the value of LOADADDR (before it was not mandatory at compile time). If I try 0x10008000 it blocks at "Starting kernel...".

    Code:
    mmc0 is current device
    reading uImage
    4268024 bytes read in 232 ms (17.5 MiB/s)
    ## Booting kernel from Legacy Image at 12000000 ...
       Image Name:   Linux-3.14.28-ga2000f0
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    4267960 Bytes = 4.1 MiB
       Load Address: 10008000
       Entry Point:  10008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    
    Starting kernel ...
    
     
    Last edited: Sep 7, 2015
  11. vpeter

    vpeter Active Member

    Joined:
    Nov 29, 2014
    Messages:
    303
    Likes Received:
    62
    Maybe you are missing console device in u-boot.
     
  12. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    167
    Likes Received:
    47
    It works perfeclty with that kernel : https://github.com/UDOOboard/Kernel_Unico
    I downloaded U-Boot on the UDOO website : http://download.udoo.org/files/UDOO_Unico/u-Boot_Quad/u-boot-q.imx

    I use to configure U-Boot like this:
    Code:
    mmc dev 0; mmc rescan; fatload mmc 0:1 ${loadaddr} boot.scr; source
    At boot, I get this in my console:
    Code:
    U-Boot 2013.10-rc3 (Jan 20 2014 - 13:33:34)
    
    CPU:   Freescale i.MX6Q rev1.2 at 792 MHz
    Reset cause: POR
    Board: UDOO
    DRAM:  1 GiB
    MMC:   FSL_SDHC: 0
    No panel detected: default to LDB-WVGA
    Display: LDB-WVGA (800x480)
    In:    serial
    Out:   serial
    Err:   serial
    Net:   using phy at 6
    FEC [PRIME]
    Hit any key to stop autoboot:  0
    mmc0 is current device
    reading uImage
    4357260 bytes read in 239 ms (17.4 MiB/s)
    ## Booting kernel from Legacy Image at 12000000 ...
       Image Name:   Linux-3.0.35
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    4357196 Bytes = 4.2 MiB
       Load Address: 10008000
       Entry Point:  10008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    
    Starting kernel ...
    
    ... and the kernel starts normally.
    With the new kernel, the kernel doesn't start and it stays on "Starting kernel..."
     
  13. patrykk

    patrykk Member

    Joined:
    Dec 10, 2014
    Messages:
    52
    Likes Received:
    9
    Last edited: Sep 7, 2015
  14. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    167
    Likes Received:
    47
    Hi,

    Yes your kernel compiles now with the Linaro toolchain. But it doesn't solves my problem to boot the kernel. Here is the output I get:

    Code:
    U-Boot 2013.10-rc3 (Jan 20 2014 - 13:33:34)
    
    CPU:   Freescale i.MX6Q rev1.2 at 792 MHz
    Reset cause: POR
    Board: UDOO
    DRAM:  1 GiB
    MMC:   FSL_SDHC: 0
    *** Warning - bad CRC, using default environment
    
    No panel detected: default to LDB-WVGA
    Display: LDB-WVGA (800x480)
    In:    serial
    Out:   serial
    Err:   serial
    Net:   using phy at 6
    FEC [PRIME]
    Hit any key to stop autoboot:  0
    UDOO board => mmc dev 0; mmc rescan; fatload mmc 0:1 ${loadaddr} boot.scr; source
    mmc0 is current device
    reading boot.scr
    551 bytes read in 14 ms (38.1 KiB/s)
    ## Executing script at 12000000
    Saving Environment to MMC...
    Writing to MMC(0)... done
    UDOO board => boot
    mmc0 is current device
    reading uImage
    4367032 bytes read in 239 ms (17.4 MiB/s)
    ## Booting kernel from Legacy Image at 12000000 ...
       Image Name:   Linux-4.2.0-gec528f1
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    4366968 Bytes = 4.2 MiB
       Load Address: 10008000
       Entry Point:  10008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    
    Starting kernel ...
    
     
  15. patrykk

    patrykk Member

    Joined:
    Dec 10, 2014
    Messages:
    52
    Likes Received:
    9
    Please paste your output from "env print"
     
  16. patrykk

    patrykk Member

    Joined:
    Dec 10, 2014
    Messages:
    52
    Likes Received:
    9
    my udoo configuration:
    please check options:
    fdt_addr=0x12000000 and loadaddr=10800000

    =>
    baudrate=115200
    boot_fdt=try
    bootargs=console=ttymxc1,115200 root=/dev/sda1 rw mem=1024M video=mxcfb1:dev=ldb,LDB-WVGA,if=RGB666,bpp=32 video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32 panic=10
    bootcmd=mmc dev ${mmcdev};if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootenv; then run importbootenv;fi;echo Checking if uenvcmd is set ...;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;echo Running default loaduimage ...;if run loaduimage; then run mmcbootm;fi;echo Running defau;
    bootdelay=15
    bootscript=echo Running bootscript from mmc ...; source
    console=ttymxc1
    debug=user_debug=7
    ethact=FEC
    ethaddr=00:c0:08:88:19:e1
    ethprime=FEC
    fdt_addr=0x12000000
    fdt_file=/boot/imx6q-udoo.dtb-4.2
    fdt_high=0xffffffff
    filesize=863b
    image=zImage
    importbootenv=echo Importing environment from mmc (uEnv.txt)...; env import -t $loadaddr $filesize
    init=init=/usr/lib/systemd/systemd
    initrd_high=0xffffffff
    ip_dyn=yes
    loadaddr=10800000
    loadbootenv=sata init; load sata ${satadev}:${satapart} ${loadaddr} ${uenv}
    loadbootscript=fatload sata ${mmcdev}:${mmcpart} ${loadaddr} ${script};
    loadfdt=load sata ${satadev}:${satapart} ${fdt_addr} ${fdt_file}
    loaduimage=load sata ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}; load sata ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
    loadzimage=load sata ${mmcdev}:${mmcpart} ${loadaddr} ${zimage}
    memory=mem=1024M
    mmcargs=setenv bootargs console=${console},${baudrate} ${optargs} root=${mmcroot} ${memory} video=${video7} video=${video} ${panic}
    mmcbootm=echo Booting from mmc ...; run mmcargs; bootm ${loadaddr} - ${fdt_addr};
    mmcbootz=echo Booting from mmc ...; run mmcargs; bootz ${loadaddr} - ${fdt_addr};
    mmcdev=0
    mmcpart=1
    mmcroot=/dev/sda1 rw
    netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
    netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${image}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then boot;
    panic=panic=10
    satadev=0
    satapart=1
    script=boot.scr
    splashpos=m,m
    stderr=serial
    stdin=serial
    stdout=serial
    uenv=/boot/uEnv.txt
    uimage=/boot/uImage-4.2
    update_sd_firmware=if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; if mmc dev ${mmcdev}; then if ${get_cmd} ${update_sd_firmware_filename}; then setexpr fw_sz ${filesize} / 0x200; setexpr fw_sz ${fw_sz} + 1; mmc write ${loadaddr} 0x2 ${fw_sz}; fi; fi
    update_sd_firmware_filename=u-boot.imx
    video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32
    video7=mxcfb1:dev=ldb,LDB-WVGA,if=RGB666,bpp=32
    zimage=/boot/zImage-disable

    Environment size: 2979/8188 bytes
     
  17. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    167
    Likes Received:
    47
    Here is my output:
    Code:
    UDOO board => env print
    baudrate=115200
    boot_fdt=try
    bootcmd=mmc dev ${mmcdev};if mmc rescan; then if run loaduimage; then run mmcboot;else run netboot;fi;else run netboot; fi
    bootdelay=5
    bootscript=echo Running bootscript from mmc ...; source
    console=ttymxc1
    ethact=FEC
    ethaddr=00:c0:08:88:9e:cc
    ethprime=FEC
    fdt_addr=0x11000000
    fdt_file=imx6q-udoo.dtb
    fdt_high=0xffffffff
    filesize=227
    initrd_high=0xffffffff
    ip_dyn=yes
    loadaddr=0x12000000
    loadbootscript=ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
    loadfdt=ext2load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
    loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}
    mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot} ${hdmi_patch} fbmem=24M video=mxcfb0:dev=ldb,LDB-WVGA,if=RGB666,bpp=32
    mmcboot=run mmcargs; bootm ${loadaddr}
    mmcdev=0
    mmcpart=1
    mmcroot=/dev/mmcblk0p2 rootwait rw
    netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ${hdmi_patch} ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
    netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${uimage}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then bootm ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootm; else echo WARN: Cannot load the DT; fi; fi; else bootm; fi;
    script=boot.scr
    splashpos=m,m
    uimage=uImage
    update_sd_firmware=if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; if mmc dev ${mmcdev}; then if ${get_cmd} ${update_sd_firmware_filename}; then setexpr fw_sz ${filesize} / 0x200; setexpr fw_sz ${fw_sz} + 1; mmc write ${loadaddr} 0x2 ${fw_sz}; fi; fi
    update_sd_firmware_filename=u-boot.imx
    
    Environment size: 1805/8188 bytes
     
  18. patrykk

    patrykk Member

    Joined:
    Dec 10, 2014
    Messages:
    52
    Likes Received:
    9
    Hi,
    Please change
    fdt_addr=0x12000000
    loadaddr=10800000
    and kernel will probably boot.
     
  19. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    167
    Likes Received:
    47
    Here is what I did :
    Code:
    UDOO board => setenv fdt_addr 0x12000000
    UDOO board => setenv loadaddr 0x10800000
    UDOO board => boot
    mmc0 is current device
    reading uImage
    4367032 bytes read in 239 ms (17.4 MiB/s)
    ## Booting kernel from Legacy Image at 10800000 ...
      Image Name:  Linux-4.2.0-gec528f1
      Image Type:  ARM Linux Kernel Image (uncompressed)
      Data Size:  4366968 Bytes = 4.2 MiB
      Load Address: 10008000
      Entry Point:  10008000
      Verifying Checksum ... OK
      Loading Kernel Image ... OK
    
    Starting kernel ...
    
    
    but it stil doesnt boot :(
     
  20. vpeter

    vpeter Active Member

    Joined:
    Nov 29, 2014
    Messages:
    303
    Likes Received:
    62
    I think you don't load and use device tree file?
    Code:
    run loadfdt
    run loaduimage
    bootm ${loadaddr} - ${fdt_addr};
    You have to see something like this
    Code:
    ## Booting kernel from Legacy Image at 10800000 ...
       Image Name:   Linux-3.10.52
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    6783864 Bytes = 6.5 MiB
       Load Address: 10008000
       Entry Point:  10008000
       Verifying Checksum ... OK
    ## Flattened Device Tree blob at 12000000
       Booting using the fdt blob at 0x12000000
       Loading Kernel Image ... OK
       Using Device Tree in place at 12000000, end 1200c9a2
     

Share This Page