This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

u-boot-2015.01-rc1, generic machine, and device trees

I'm trying to make some changes to the latest (as of now) upstream u-boot for the da850evm (for now).  One trivial, one less so.


The trivial change is getting rid of the warning about not using the new "Generic Board" framework.  Adding

#define CONFIG_SYS_GENERIC_BOARD

to da850evm.h gets rid of that with no obvious bad effects.  Has anyone else enabled that and seen any problems?

The less trivial change is enabling device tree support.  Enabling it is easy enough, by adding

#define CONFIG_OF_LIBFDT


And bootm suddenly handles a separate fdt.  However, doing so also wrecks the environment.  On first boot you get the not-unexpected "bad CRC" warning.  But if I save the environment, the next (and subsequent boots) don't work properly - e.g.

U-Boot SPL 2015.01-rc1 (Nov 27 2014 - 14:30:26)                                 
                                                                                
                                                                                
U-Boot 2015.01-rc1 (Nov 27 2014 - 14:30:26)                                     
                                                                                
I2C:   ready                                                                    
DRAM:  64 MiB                                                                   
WARNING: Caches not enabled                                                     
MMC:   davinci: 0                                                               
SF: Detected M25P64 with page size 256 Bytes, erase size 64 KiB, total 8 MiB    
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
SF: Detected M25P64 with page size 256 Bytes, erase size 64 KiB, total 8 MiB    
Warning: Invalid MAC address read from SPI flash                                
Net:   DaVinci-EMAC                                                             
Error: DaVinci-EMAC address not set.                                            
                                                                                
U-Boot > help                                                                   
data abort                                                                      
pc : [<c108ffd8>]          lr : [<c10900b4>]                                    
sp : c3e5f838  ip : 00000000     fp : c3e5fda4                                  
r10: c10b1f28  r9 : c3e5ff08     r8 : 0000000e                                  
r7 : c10b22c4  r6 : c10aa2a0     r5 : 00000000  r4 : 0000001b                   
r3 : c10b8f70  r2 : 00000001     r1 : c3e5f840  r0 : ffffffff                   
Flags: Nzcv  IRQs off  FIQs off  Mode SVC_32                                    
Resetting CPU ...                                                               
                                                                                
resetting ... 

Anyone have any insight into what's going wrong?

  • A clarification.  If I do not save the environment (just manually edit it each time) the problem doesn't occur - but I have to modify the environment manually each boot.

  • Hi Peter,

    What  problem are you facing after you saved the environment "saveenv" ?

    Are you getting "Bad data CRC" for kernel ?

  • Restating in a hopefully simpler form:

    Start with: a new build of u-boot-2015-01-rc1 with both CONFIG_SYS_GENERIC_BOARD and CONFIG_OF_LIBFDT defined.

    • Boot to u-boot prompt.  you get the "bad CRC" warning, but everything works fine.  You can edit the (default) environment, load a linux kernel and separate device tree and boot them via bootm.
    • You can also reboot to u-boot prompt with no problem (still getting the "bad CRC" warning and being presented with the default environment again).
    • If, you saveenv and reboot to u-boot prompt, just about everything breaks.  As shown above, simply typing "help" gives a data abort.  So does printenv, and most other commands.  This behaviour remains for further reboots to u-boot prompt.  The only way I've found to fix it is to flash and boot with a u-boot build which does not have CONFIG_OF_LIBFDT defined.   That brings you back to the starting point.

    I've also found since the original post that defining CONFIG_OF_LIBFDT without defining CONFIG_SYS_GENERIC_BOARD gives a "lesser" version of the same problem - less commands cause a data abort after saveenv and reboot, but it's still not useable.