codesnake / OpenELEC.tv

Port of the OpenELEC for Amlogic-based TV boxes
http://openelec.tv
62 stars 70 forks source link

wiped u-boot enviroment #137

Open xhpohanka opened 8 years ago

xhpohanka commented 8 years ago

Hi Codesnake, thank you for your work on OpenELEC.

I have unbranded g18 board (same as Matricom MX2) and I got it with erased nand flash. I have build openelec from source and flashed it using sd card recovery. Unfortunately I see on serial line that there is some problem with booting. It seems to me, that u-boot does not know partition names (logo, boot, etc.) - mtdparts variable is not defined. Is it normal?

I'm able to boot openelec manually by loading kernel from sd card and running bootm command. Can you please share what u-boot enviroment variables has to be set?

regards Jan

codesnake commented 8 years ago

NAND partition table is not stored in u-boot environment variables. It is defined in kernel device tree.

codesnake commented 8 years ago

At each boot kernel reads NAND partition layout from device tree and updates it in NAND environment area. During firmware install first time this is performed by recovery's kernel. Then u-boot reads parition layout from NAND environment area and boots from boot partition.

xhpohanka commented 8 years ago

Then I do not understand why my device does not boot with clean install. Maybe there are some bad blocks around env area.

I'm getting big number of similar warnings during kernel booting

[    4.942949@0] ########aml_nand_read_oob 3583 read oob failed here at at page:23040, blk:90 chip[0]
[    4.946311@0] aml_ops_read_page failed: 8400000 66 0
[    4.951230@0] unkown page 0 spare data 22,22,22,22
[    4.956035@0] block: 66 page: 1 occured unusual
[    4.962899@0] ########aml_nand_read_oob 3583 read oob failed here at at page:23041, blk:90 chip[0]
[    4.969476@0] aml_ops_read_page failed: 8402000 66 1
[    4.974437@0] unkown page 0 spare data 22,22,22,22
[    4.979181@0] block: 66 page: 2 occured unusual
[    4.985685@0] ########aml_nand_read_oob 3583 read oob failed here at at page:23042, blk:90 chip[0]
[    4.992684@0] aml_ops_read_page failed: 8404000 66 2
[    4.997582@0] unkown page 0 spare data 22,22,22,22
[    5.002378@0] block: 66 page: 3 occured unusual
[    5.008836@0] ########aml_nand_read_oob 3583 read oob failed here at at page:23043, blk:90 chip[0]
[    5.015856@0] aml_ops_read_page failed: 8406000 66 3
[    5.020756@0] unkown page 0 spare data 22,22,22,22
[    5.025552@0] block: 66 page: 4 occured unusual
[    5.032553@0] ########aml_nand_read_oob 3583 read oob failed here at at page:23044, blk:90 chip[0]
[    5.039002@0] aml_ops_read_page failed: 8408000 66 4
[    5.043955@0] unkown page 0 spare data 22,22,22,22
[    5.048708@0] block: 66 page: 5 occured unusual
[    5.055646@0] ########aml_nand_read_oob 3583 read oob failed here at at page:23045, blk:90 chip[0]
[    5.062212@0] aml_ops_read_page failed: 840a000 66 5
[    5.067106@0] unkown page 0 spare data 22,22,22,22
[    5.071879@0] block: 66 page: 6 occured unusual
[    5.079121@0] ########aml_nand_read_oob 3583 read oob failed here at at page:23046, blk:90 chip[0]
[    5.085377@0] aml_ops_read_page failed: 840c000 66 6
[    5.090282@0] unkown page 0 spare data 22,22,22,22
[    5.095086@0] block: 66 page: 7 occured unusual
[    5.102141@0] ########aml_nand_read_oob 3583 read oob failed here at at page:23047, blk:90 chip[0]
[    5.108529@0] aml_ops_read_page failed: 840e000 66 7
[    5.113486@0] unkown page 0 spare data 22,22,22,22
[    5.118231@0] block: 66 page: 8 occured unusual

And this is what u-boot says

aml_rtc_init
aml rtc init first time!
clr h-ram
DRAM:  1 GiB
relocation Offset is: 105e0000
MMC:   [mmc_register] add mmc dev_num=0, port=1, if_type=6
[mmc_register] add mmc dev_num=1, port=2, if_type=6
SDIO Port B: 0, SDIO Port C: 1
NAND:  Amlogic nand flash uboot driver, Version U1.06.020 (c) 2010 Amlogic Inc.
NAND BOOT : nand_init 1133 
No NAND device found!!!
NAND device id: 2c 64 44 4b a9 0 
NAND device: Manufacturer ID: 0x2c, Chip ID: 0x2c (Micron B revision NAND 8GiB MT29F64G08CBABA)
#####aml_nand_init, with RB pins and chip->chip_delay:20
bus_cycle=5, bus_timing=6, start_cycle=6, end_cycle=7,system=5.0ns
m3:###aml_chip->boot_oob_fill_cnt =-1524
oob size is not enough for selected bch mode: NAND_BCH60_1K_MODE force bch to mode: NAND_BCH40_1K_MODE
aml_chip->oob_fill_cnt =168,aml_chip->oob_size =744,bch_bytes =70
Creating 1 MTD partitions on "nandboot":
0x000000000000-0x000000800000 : "nandboot"
nandboot initialized ok
detect mx chiprevD :1 and nand_type: 40
NAND BOOT : nand_init 1133 
No NAND device found!!!
NAND device id: 2c 64 44 4b a9 0 
NAND device: Manufacturer ID: 0x2c, Chip ID: 0x2c (Micron B revision NAND 8GiB MT29F64G08CBABA)
1 NAND chips detected
#####aml_nand_init, with RB pins and chip->chip_delay:20
bus_cycle=5, bus_timing=6, start_cycle=6, end_cycle=7,system=5.0ns
oob size is not enough for selected bch mode: NAND_BCH60_1K_MODE force bch to mode: NAND_BCH40_1K_MODE
aml_chip->oob_fill_cnt =168,aml_chip->oob_size =744,bch_bytes =70
multi plane error for selected plane mode: NAND_TWO_PLANE_MODE force plane to : NAND_SINGLE_PLANE_MODE
aml_nand_init:oobmul =1,chip->ecc.layout->oobfree[0].length=16,aml_chip->oob_size=744
########aml_nand_read_page_hwecc 3474 read ecc failed here at at page:1280, blk:5 chip[0]
aml_nand_env_init:6035,offset =a00000
########aml_nand_read_page_hwecc 3474 read ecc failed here at at page:1536, blk:6 chip[0]
aml_nand_env_init:6035,offset =c00000
########aml_nand_read_page_hwecc 3474 read ecc failed here at at page:1792, blk:7 chip[0]
aml_nand_env_init:6035,offset =e00000
aml nand env valid addr: 820000 ,status =0
key start_blk=4088,end_blk=4095,aml_nand_key_init:684
########aml_nand_read_page_hwecc 3474 read ecc failed here at at page:1046528, blk:4088 chip[0]
blk check good but read failed: 1ff000000, -74
########aml_nand_read_page_hwecc 3474 read ecc failed here at at page:1046784, blk:4089 chip[0]
blk check good but read failed: 1ff200000, -74
########aml_nand_read_page_hwecc 3474 read ecc failed here at at page:1047046, blk:4090 chip[0]
blk check good but read failed: 1ff40c000, -74
aml nand key valid addr: 1ff400000 
aml nand key valid addr: 1ff600000 
aml nand key valid addr: 1ff800000 
CONFIG_KEYSIZE=0x10000; KEYSIZE=0xfffc; bbt=0x1330; default_keyironment_size=0xeccc
i=0,register --- nand_key
Creating 5 MTD partitions on "nandnormal":
0x000001000000-0x000001800000 : "mtd1"
0x000001800000-0x000002000000 : "mtd2"
0x000002000000-0x000002800000 : "mtd3"
0x000002800000-0x000003000000 : "mtd4"
0x000003000000-0x00000a000000 : "mtd5"
nandnormal initialized ok
detect mx chiprevD :1 and nand_type: 40
nand_curr_device =1
NAND BOOT,nand_env_relocate_spec : env_relocate_spec 49 
In:    serial
Out:   serial
Err:   serial
register usb cfg[0][1] = 9fe85ad0
Net:   Meson_Ethernet
init suspend firmware done. (ret:0)
detect_storage
nand exist return 0
setenv storage nand
reboot_mode=charging
wipe_data=success
ir init
Hit Enter key to stop autoboot -- :  1 tstc enter