How can i check BOOT_CFG values at boot?

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

How can i check BOOT_CFG values at boot?

1,224 Views
paulroy
Contributor I

Hello

I´m trying to boot from a new NAND on MX53. I can boot with serial download, and use my NAND,but I can´t boot from it.

I know I have to put correct bytes on flash header at NAND first bytes, and I know my BOOT_CFG1,2,3 bytes must contain correct parameters for my NAND (ECC bit number,nand page size...etc) but the only way I have too boot is from seriual downloader, so ,once I´m at U-Boot> prompt, I´d like to check if thos BOOT_CFG and BT_FUSE_SEL bits are the correct ones.

Could I check that with uboot (and how: md.b <address> ? ) or, as I have booted from serial downloader the values I see are somehow overwritten?.

I´ve already tried kobs-ng and MFGTools as suggested (https://community.nxp.com/thread/462965)

In order to create the valid flash-header, MFGTools seems to use a kobs-ng binary (check ucl.xml file) inside a preconfigured loaded Linux image and it seems difficult to configure, so in fact I think is of no much value if i can execute my own kobs-ng once I´ve boot with serial downloader  from my Linux image because it seems the same method.     

So I download and compile kobs-ng,but...my kobs-ng does not work:

root# ./kobs-ng init -v -x /root/uboot.bin                                                                  
MTD CONFIG:
  chip_0_device_path = "/dev/mtd0"
  chip_1_device_path = "(null)"
  search_exponent = 2
  data_setup_time = 80
  data_hold_time = 60
  address_setup_time = 25
  data_sample_time = 6
  row_address_size = 3
  column_address_size = 2
  read_command_code1 = 0
  read_command_code2 = 48
  boot_stream_major_version = 1
  boot_stream_minor_version = 0
  boot_stream_sub_version = 0
  ncb_version = 3
  boot_stream_1_address = 0
  boot_stream_2_address = 0
         -- We add the 1k-padding to the uboot.
.tmp_kobs_ng: verifying using key '00000000000000000000000000000000'
.tmp_kobs_ng: is a valid bootstream for key '00000000000000000000000000000000'
mtd: opening: "/dev/mtd0"
NFC geometry :
        ECC Strength       : 2
        Page Size in Bytes : 2112
        Metadata size      : 10
        ECC Chunk Size in byte : 512
        ECC Chunk count        : 4
        Block Mark Byte Offset : 1999
        Block Mark Bit Offset  : 0
====================================================
mtd: opened '/dev/mtd0' - '(null)'
mtd: max_boot_stream_size_in_bytes = 0
mtd: boot_stream_size_in_bytes = 231840
mtd: bootstream too large
mtd_init failed!  

I think this is due to kobs-ng not been able to correctly read in /sys my NAND parameters and calculate right sizes from it, so I´m stuck...

Edit: The maths for my 2K+64, ECC 4bit NAND  are:

mtd_size=1048576 erase_size=131072 writesize=2048
So max_boot_stream_size_in_bytes=0 (1048576 - 524288*2)/2

And obviously, boot_stream_size_in_bytes >= 0 --> Failure

Anyway, lets start from the beginning: how do I check BT_FUSE_SEL and BOOT_CFG parameters from uboot? Or should I use JTAG?

Thank you

Labels (2)
Tags (2)
0 Kudos
Reply
2 Replies

872 Views
b36401
NXP Employee
NXP Employee

You can read eFuse with "iim read" u-boot command. Type "iim help" for the details.

Have a great day,
Victor

0 Kudos
Reply

872 Views
paulroy
Contributor I

Ok, I can read those values from UBoot when i boot using dserial downloader. They are part of SCR_SBMR register at 0x53FD_0004. (last 3 bytes)

Also, as I can use serial to boot,a Linux image, I read them with devmem also.

But , I don´t know if this values are set by Serial Downloader UBoot or taken from NAND during boot process.

0 Kudos
Reply