How to boot imx7s form UBoot while cortex M4 is running

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

How to boot imx7s form UBoot while cortex M4 is running

Jump to solution
1,152 Views
erikfriedel
Contributor III

Hello

I got the problem that, after successfully running the hello_world example from FreeRTOS, I want to try out the pingpong_freertos example. Launching it in the M4 is not problem. But when I try to start the A7 (after launching the M4) it just shows "Starting kernel ..."

In the devicetree I disabled the used uart, and the used wdog and enabled the rpmsg.

My env looks like this:

addcma=setenv bootargs ${bootargs} cma=${cma_size}
addip=if test "${ipmode}" != static; then run addip_dynamic; else run addip_static; fi
addip_dynamic=setenv bootargs ${bootargs} ip=dhcp
addip_static=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off
addmmc=setenv bootargs ${bootargs} root=/dev/mmcblk${mmcblkdev}p${mmcpart} ${rootfsmode} rootwait
addnfs=setenv bootargs ${bootargs} root=/dev/nfs rw nfsroot=${serverip}:${rootpath},v3,tcp;
addqspi=setenv bootargs ${bootargs} root=ubi0:root ${rootfsmode} rootfstype=ubifs ubi.mtd=${rootfs_mtddev}
addtty=setenv bootargs ${bootargs} console=${console},${baudrate} consoleblank=0
autoload=no
baudrate=115200
board=tqma7
board_name=TQMa7S
boot_dev=mmc
boot_type=bootz
bootargs=root=/dev/nfs rw nfsroot=10.20.228.5:/nfs,v3,tcp ip=10.20.228.129:10.20.228.5::::eth0:off console=ttymxc5,115200 consoleblank=0 cma=32M
bootcmd=run mmcboot; run netboot; run panicboot
bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
bootdelay=3
bootfile=linuximage
cma_size=32M
console=ttymxc5
ethact=FEC0
ethaddr=00:d0:93:3E:83:F2
ethprime=FEC
fdt_addr=0x88000000
fdt_file=imx7s-mba7.dtb
fdt_high=0xffffffff
fdt_m4=fdt addr $fdt_addr; fdt resize; fdt set /soc/aips-bus@30800000/spba-bus/serial@30880000 status "disabled"; fdt set /soc/aips-bus@30800000/rpmsg status "okay"; fdt set /soc/aips-bus@30000000/wdog@302a0000 status "disabled";  fdt set /soc/aips-bus@30800000/mu@30aa0000/ status "disabled"
fdt_mtdpart=DTB
fdtaddr=88000000
fileaddr=88000000
filesize=9c80
firmwarepart=1
getcmd=tftp
goon=bootz $loadaddr - $fdt_addr
initrd_addr=0x89000000
initrd_high=0xffffffff
ipaddr=10.20.228.129
ipmode=static
kernel=linuximage
kernel_mtdpart=Linux
kernel_name=if test "${boot_type}" != bootz; then setenv kernel ${uimage}; else setenv kernel ${zimage}; fi
loadaddr=0x82000000
loadfdt=load mmc ${mmcdev}:${firmwarepart} ${fdt_addr} ${fdt_file}
loadimage=run kernel_name; load mmc ${mmcdev}:${firmwarepart} ${loadaddr} ${kernel}
loadm4image=fatload mmc ${mmcdev}:${mmcpart} 0x7F8000 ${m4image}
loadn4image=tftp 0x7f8000 ${n4image}
m4_boot=setenv bootargs; run netargs; run m4_load; run fdt_m4; bootz $loadaddr - $fdt_addr
m4_load=run n4boot; tftp $zimage; tftp $fdt_addr $fdt_file
m4boot=run loadm4image; bootaux 0x7F8000
m4image=hello_world.bin
mfgtool_args=setenv bootargs console=ttymxc5,115200 rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.file=/fat g_mass_storage.ro=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber="" enable_wait_mode=off
mmcargs=run addmmc addtty addcma
mmcblkdev=0
mmcboot=echo Booting from mmc ...; setenv bootargs; run mmcargs; if run loadimage; then if run loadfdt; then echo boot device tree kernel ...; ${boot_type} ${loadaddr} - ${fdt_addr}; fi; else ${boot_type}; fi;
mmcdev=0
mmcpart=1
mtdparts=mtdparts=nor0:832k@0k(U-Boot),64k@832k(ENV1),64k@896k(ENV2),64k@960k(DTB),7M@1M(Linux),56M@8M(RootFS)
n4boot=run loadn4image; bootaux 0x7f8000
n4image=hello_world.bin
netargs=run addnfs addip addtty addcma
netboot=echo Booting from net ...; run kernel_name; run set_getcmd; setenv bootargs; run netargs; if ${getcmd} ${fdt_addr} ${fdt_file}; then if ${getcmd} ${loadaddr} ${kernel}; then ${boot_type} ${loadaddr} - ${fdt_addr}; fi; fi; echo ... failed
netdev=eth0
panicboot=echo No boot device !!! reset
prep=setenv bootargs; run netargs; run m4_load; run fdt_m4
qspiargs=run addqspi addtty addcma
qspiboot=echo Booting from qspi ...; setenv bootargs; run qspiargs; if run loadimage; then if run loadfdt; then echo boot device tree kernel ...; ${boot_type} ${loadaddr} - ${fdt_addr}; fi; else ${boot_type}; fi;
rootfs_mtddev=5
rootfs_mtdpart=RootFS
rootfsmode=ro
rootpath=/nfs
run_m4_tcm=if run loadn4image; then cp.b ${loadaddr} 0x7f8000 0x8000; bootaux 0x7f8000; fi
serial#=???
serverip=10.20.228.5
set_getcmd=if test "${ipmode}" != static; then setenv getcmd dhcp; setenv autoload yes; else setenv getcmd tftp; setenv autoload no; fi
uboot=u-boot.imx
uboot_mtdpart=U-Boot
uboot_size=0x7fe
uboot_start=0x2
uimage=uImage
update_fdt=run set_getcmd; if ${getcmd} ${fdt_file}; then if itest ${filesize} > 0; then mmc dev ${mmcdev}; mmc rescan; echo Write fdt image to mmc ${mmcdev}:${firmwarepart}...; save mmc ${mmcdev}:${firmwarepart} ${loadaddr} ${fdt_file} ${filesize}; fi; fi; setenv filesize; setenv getcmd
update_kernel=run kernel_name; run set_getcmd; if ${getcmd} ${kernel}; then if itest ${filesize} > 0; then mmc dev ${mmcdev}; mmc rescan; echo Write kernel image to mmc ${mmcdev}:${firmwarepart}...; save mmc ${mmcdev}:${firmwarepart} ${loadaddr} ${kernel} ${filesize}; fi; fi; setenv filesize; setenv getcmd
update_uboot=run set_getcmd; if ${getcmd} ${uboot}; then if itest ${filesize} > 0; then mmc dev ${mmcdev}; mmc rescan; setexpr blkc ${filesize} + 0x1ff; setexpr blkc ${blkc} / 0x200; if itest ${blkc} <= ${uboot_size}; then mmc write ${loadaddr} ${uboot_start} ${blkc}; fi; fi; fi; setenv filesize; setenv blkc; setenv getcmd
zimage=linuximage

And I start all with run m4_boot

Please help me

Erik

Labels (1)
0 Kudos
1 Solution
851 Views
erikfriedel
Contributor III

Solved.

I just needed to edit the devicetree and made following changes:

/ {

      memory {
      linux,usable-memory = <0x80000000 0x1ff00000>;

      };

      m4_tcm: tcml@007f8000 {
      compatible = "fsl, m4_tcml";
      reg = <0x007f8000 0x8000>;
      };
};      

      &ocram {
      reg = <0x00901000 0xf000>;
};   

      &uart3 {
      status = "disabled";
};   

      &wdog3 {
      status = "disabled";
};

After copying the freshly compiled dtb file to the board I was able to start the m4 and after that the Linux os.

Regrads

Erik

View solution in original post

0 Kudos
1 Reply
852 Views
erikfriedel
Contributor III

Solved.

I just needed to edit the devicetree and made following changes:

/ {

      memory {
      linux,usable-memory = <0x80000000 0x1ff00000>;

      };

      m4_tcm: tcml@007f8000 {
      compatible = "fsl, m4_tcml";
      reg = <0x007f8000 0x8000>;
      };
};      

      &ocram {
      reg = <0x00901000 0xf000>;
};   

      &uart3 {
      status = "disabled";
};   

      &wdog3 {
      status = "disabled";
};

After copying the freshly compiled dtb file to the board I was able to start the m4 and after that the Linux os.

Regrads

Erik

0 Kudos