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.
Tool/software: Linux
hello everyone.
I make a core-board with AM3352, and the hardware design is refer to the BeagleBone Black. When I set the sysboot [15:0] with 01 00 00 0 0 10 0 10111, the MLO and uboot can run good, but when I set sysboot[15:0] with 01 00 00 0 0 10 0 10011, the console serial port only has CCCC.
I know console print CCCC means sysboot mode error or there is no MLO in nand flash. I use CCS and JTAG to read 0x44e10040 memory, the result is 00400393, it means my sysboot mode setting OK isn't it? when sysboot[15:0] is 01 00 00 0 0 10 0 10011, the board also can start from MMC0 when the MMC0 has a SD card, and in uboot shell, useing nand dump 0 command to read flash page 0, there is date in it:
U-Boot# nand dump 0
Page 00000000 dump:
40 00 00 00 0c 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 43 48 53 45 54 54 49 4e 47 53 00 00
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
c1 c0 c0 c0 00 01 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ad 80 01 00 00 04 2f 40 14 00 00 ea 14 f0 9f e5
14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5
14 f0 9f e5 14 f0 9f e5 20 04 2f 40 24 04 2f 40
28 04 2f 40 2c 04 2f 40 30 04 2f 40 34 04 2f 40
38 04 2f 40 78 56 34 12 00 00 80 80 00 fc d0 3f
the date reading from nand page 0 is same with MLO file, it means the MLO has writen into the flash. I also write uimage and ubi.img into the flash, then int uboot shell run nandboot, board can read uimage and ubi.img from flash and run good.
But the board can not start from nand flash, the console only print CCCC……what is the problem with my board?
The nand flash is S34ML02G200TFI000, and whether I need modify uboot code?cypress(2G-S34ML02G200TFI000).pdf
hello Biser
The page of my nand flash is 2048 bytes, and the OOB is 128 bytes, ECC is BCH8, following message is from nand flash datasheet:
– Input / Output Bus Width: 8 bits
– Page size:
– ×8:
2 Gb / 4 Gb: (2048 + 128) bytes; 128-byte spare area
This is the schematic diagram:
I used to modify uboot code with 128 bytes:
am335x_evm.h:
#define CONFIG_SYS_NAND_OOBSIZE 128//64
omap_gpmc.h:
#define GPMC_NAND_HW_BCH8_ECC_LAYOUT {\
.eccbytes = 56,\
.eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\
28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,\
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\
52, 53, 54, 55, 56, 57},\
.oobfree = {\
{.offset = 58,\
.length = 70/*6*/ } } \
}
in drivers\mtd\nand\nand_base.c file, modify nand_get_flash_type function:
/* Calc blocksize */
mtd->erasesize = (128 * 1024) <<
(((extid >> 1) & 0x04) | (extid & 0x03));
busw = 0;
} else {
/* Calc pagesize */
mtd->writesize = 1024 << (extid & 0x03);
extid >>= 2;
/* Calc oobsize */
//mtd->oobsize = (8 << (extid & 0x01)) *
// (mtd->writesize >> 9);
mtd->oobsize = 128; //force oob size with 128
extid >>= 2;
/* Calc blocksize. Blocksize is multiples of 64KiB */
mtd->erasesize = (64 * 1024) << (extid & 0x03);
extid >>= 2;
/* Get buswidth information */
busw = (extid & 0x01) ? NAND_BUSWIDTH_16 : 0;
}
with those modification, there is no effect.
I use u-boot-2013.01.01-psp06.00.00.00
hello Biser
How does the Rom Code recognize the OOB size? Is it by reading ID?
hello Biser
I use a new SDK: am335x-evm-linux-sdk-arago-src-04.00.00.04.tar
The function of starting from nand is ok now, but during kernel start up, there is an error with [ 2.102321] omap2-nand omap2-nand.0: uncorrectable bit-flips found, I have checked the kernel code, it found an error_uncorrectable:
in file drivers\mtd\nand\omap2.c:
for (i = 0; i < eccsteps; i++) {
if (err_vec[i].error_uncorrectable) {
dev_err(&info->pdev->dev,
"uncorrectable bit-flips found\n");
err = -EBADMSG;
}
and in the file drivers/mtd/nand/omap_elm.c, err_vec[i].error_uncorrectable will be set to true when read ELM_LOCATION_STATUS error in elm_error_correction function:
static void elm_error_correction(struct elm_info *info,
struct elm_errorvec *err_vec)
{
int i, j, errors = 0;
int offset;
u32 reg_val;
for (i = 0; i < info->ecc_steps; i++) {
/* Check error reported */
if (err_vec[i].error_reported) {
offset = ELM_LOCATION_STATUS + ERROR_LOCATION_SIZE * i;
reg_val = elm_read_reg(info, offset);
/* Check correctable error or not */
if (reg_val & ECC_CORRECTABLE_MASK) {
offset = ELM_ERROR_LOCATION_0 +
ERROR_LOCATION_SIZE * i;
/* Read count of correctable errors */
err_vec[i].error_count = reg_val &
ECC_NB_ERRORS_MASK;
/* Update the error locations in error vector */
for (j = 0; j < err_vec[i].error_count; j++) {
reg_val = elm_read_reg(info, offset);
err_vec[i].error_loc[j] = reg_val &
ECC_ERROR_LOCATION_MASK;
/* Update error location register */
offset += 4;
}
errors += err_vec[i].error_count;
} else {
err_vec[i].error_uncorrectable = true;
}
/* Clearing interrupts for processed error vectors */
elm_write_reg(info, ELM_IRQSTATUS, BIT(i));
/* Disable page mode */
elm_configure_page_mode(info, i, false);
}
}
}
why my ELM_LOCATION_STATUS register error? How can I solve this problem?