View Single Post
Old 06-12-2016, 09:39 PM   #11
pazos
cosiņeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,271
Karma: 2200049
Join Date: Apr 2014
Device: BQ Cervantes 4
I found a workaround for the "autoboot from environment" thing!

Just moving the offset where environment is placed (from 768 to 766). uboot finds crc corruption and boots with desired environment defined in board header (include/configs/mx50_rdp_mddr_512.h in case of my aura hd)

Attached bootlog of customized uboot with minimal environment (which prints itself during boot )

Code:
U-Boot 2009.08 (jun 13 2016 - 03:20:23)

CPU:   Freescale i.MX50 family 1.1V at 800 MHz
mx50 pll1: 800MHz
mx50 pll2: 400MHz
mx50 pll3: 216MHz
ipg clock     : 66666666Hz
ipg per clock : 66666666Hz
uart clock    : 24000000Hz
ahb clock     : 133333333Hz
axi_a clock   : 400000000Hz
axi_b clock   : 200000000Hz
weim_clock    : 100000000Hz
ddr clock     : 200000000Hz
esdhc1 clock  : 80000000Hz
esdhc2 clock  : 80000000Hz
esdhc3 clock  : 80000000Hz
esdhc4 clock  : 80000000Hz
Board: Kobo Aura HD
Boot Reason: [POR]
Boot Device: SD
I2C:   ready
DRAM:  512 MB
MMC:   FSL_ESDHC: 0, FSL_ESDHC: 1, FSL_ESDHC: 2
*** Warning - bad CRC or MMC, using default environment

In:    serial
Out:   serial
Err:   serial
[_get_sd_number] g_sd_number:2

MMC read: dev # 2, block # 1023, count 1 partition # 0 ... 
1 blocks read: OK

MMC read: dev # 2, block # 1024, count 1 partition # 0 ... 
1 blocks read: OK
ram p=70000000,size=536870912

MMC read: dev # 2, block # 18431, count 1 partition # 0 ... 
1 blocks read: OK
no "logo" bin header

MMC read: dev # 2, block # 14335, count 1 partition # 0 ... 
1 blocks read: OK

MMC read: dev # 2, block # 14336, count 2263 partition # 0 ... 
2263 blocks read: OK
Kernel RAM visiable size=510M->510M
init TPS65185 power ...
Relock PLL1 to 1GHz ...
mx50 pll1: 1000MHz
mx50 pll2: 400MHz
mx50 pll3: 216MHz
ipg clock     : 66666666Hz
ipg per clock : 66666666Hz
uart clock    : 24000000Hz
ahb clock     : 133333333Hz
axi_a clock   : 400000000Hz
axi_b clock   : 200000000Hz
weim_clock    : 100000000Hz
ddr clock     : 200000000Hz
esdhc1 clock  : 80000000Hz
esdhc2 clock  : 80000000Hz
esdhc3 clock  : 80000000Hz
esdhc4 clock  : 80000000Hz
Hit any key to stop autoboot:  1  0 
bootdelay=1
baudrate=115200
loadaddr=0x70800000
cmdline=setenv bootargs console=ttymxc0,115200 rootwait root=/dev/mmcblk0p1 rootfstype=ext2 rw quiet no_console_suspend lpj=3997696
bootcmd=printenv; run cmdline; load_ntxkernel; bootm
verify=no
stdin=serial
stdout=serial
stderr=serial

Environment size: 284/131068 bytes

MMC read: dev # 2, block # 2047, count 1 partition # 0 ... 
1 blocks read: OK
no kernel image signature !

MMC read: dev # 2, block # 2048, count 8192 partition # 0 ... 
8192 blocks read: OK
## Booting kernel from Legacy Image at 70800000 ...
   Image Name:   r6427_#1027 Mar 28 15:02:51
   Created:      2013-03-28   7:02:55 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1934696 Bytes =  1.8 MB
   Load Address: 70008000
   Entry Point:  70008000
   Loading Kernel Image ... OK
OK

Starting kernel ...
So, its time to find a way to ext2load a kernel from external sd and coding that in bootcmd. Something like

Code:
bootcmd=run cmdline_external; run load_custom_kernel; bootm; run cmdline; load_ntxkernel; bootm
This way if kernel is not found in external sdcard (or isn't a valid uImage file) the system will boot from internal partition.

I need to find some time to check The watchdog is killing me all the time :/

Last edited by pazos; 06-12-2016 at 09:43 PM.
pazos is offline   Reply With Quote