Skip to contentSkip to conversation

No nandflash found if CONFIG_CMD_UBI is enabled.

U-Boot Anders Darander 2 participants 2 messages Jun 2, 2009 Arm/Microchip (AT91) SoC support

lore
Share & tools
lore
#0 lore raw

Hi!

I'm trying to enable the UBI-support in U-Boot (later intending to also enable the UBIFS-support). This is on a AT91SAM9260-based system. I've verified the same behaviour using both the at91sam9260ek_nandflash_config and a forward-ported patch for the Olimex sam9_l9260 board. Currently I'm concentrating on the at91sam9260ek_nandflash_config, as this one is in the U-Boot repository.

However, once I enable the UBI-support, the nand-flash chip is not detected... I've tried to trace the problem, and I've found that it is timer-related. It seems that once I enable CONFIG_CMD_UBI, the timer does not work (the debug-printf in the get_ticks()-function in the supplied patch is not printing). If I comment out CONFIG_CMD_UBI, U-Boot continously prints stuff like:
Debug: timestamp=6
Debug: timestamp=10215
Debug: timestamp=21556
which is expected.

I'm compiling by running:
make clean
make at91sam9260ek_nandflash_config
make
and then flashing u-boot.bin to the board.

The supplied patch works, unless the '#define CONFIG_CMD_UBI 1'
is uncommented, in which case the get_ticks function in cpu/arm926ejs/at91/timer.c never seems to be called. I've sofar been unable to understand why.

The U-Boot versions used are from the u-boot.git and u-boot-at91.git repositories, as check out yesterday and today:
U-Boot, with the latest commit 5520ab1f7685721314dcfb7cdcc7c15e6571473f U-Boot-at91, with the latest commit f8ddcd58221cab63dd25c2324dd2032487f748b1

I've also verifed the same behaviour with both the CodeSourcery's toolchain (Sourcery G++ Lite 2008q1-126, gcc 4.2.3), as well as my own build through buildroot (gcc 4.3.3).

Regards,
Anders

The modifications I've done, as produced by 'git diff':

cpu/arm926ejs/at91/timer.c +1 -0
index c84cb5e..a0a409e 100644
@@ -91,6 +91,7 @@ unsigned long long get_ticks(void)
 	else			/* we have rollover of incrementer */
 		timestamp += (0xFFFFFFFF - lastinc) + now;
 	lastinc = now;
+	printf("Debug: timestamp=%lu\n", timestamp);
 	return timestamp;
 }
 
include/configs/at91sam9260ek.h +16 -3
index e46c9d6..e32de31 100644
@@ -85,11 +85,14 @@
 #undef CONFIG_CMD_IMLS
 #undef CONFIG_CMD_LOADS
 #undef CONFIG_CMD_SOURCE
+#undef CONFIG_CMD_FLASH
 
 #define CONFIG_CMD_PING		1
 #define CONFIG_CMD_DHCP		1
 #define CONFIG_CMD_NAND		1
 #define CONFIG_CMD_USB		1
+#define CONFIG_CMD_MTDPARTS     1
+//#define CONFIG_CMD_UBI          1
 
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS		1
@@ -126,6 +129,17 @@
 #define CONFIG_SYS_NAND_READY_PIN		AT91_PIN_PC13
 #endif
 
+/* Ubi */
+#define CONFIG_SYS_USE_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_PARTITIONS
+#define MTDIDS_DEFAULT		"nand0=at_nand"
+#define MTDPARTS_DEFAULT	"mtdparts=at91_nand:128k(bootstrap),"	\
+					"256k(U-Boot),"			\
+					"128k(U-Bootenv1),"		\
+					"128k(U-Bootenv2),"		\
+					"-(ubifs)"
+
 /* NOR flash - no real flash on this board */
 #define CONFIG_SYS_NO_FLASH			1
 
@@ -189,11 +203,10 @@
 #define CONFIG_ENV_SIZE		0x20000		/* 1 sector = 128 kB */
 #define CONFIG_BOOTCOMMAND	"nand read 0x22000000 0xA0000 0x200000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
-				"root=/dev/mtdblock5 "			\
 				"mtdparts=at91_nand:128k(bootstrap)ro,"	\
 				"256k(uboot)ro,128k(env1)ro,"		\
-				"128k(env2)ro,2M(linux),-(root) "	\
-				"rw rootfstype=jffs2"
+				"128k(env2)ro,-(ubifs) "	\
+				"ubi.mtd=4"
 
 #endif
 
Signature · 1 line
Anders Darander
#1 lore raw

Hi Anders,

Quoted 11 lines · On Tuesday 02 June 2009 09:08:38 Anders Darander wrote:

I'm trying to enable the UBI-support in U-Boot (later intending to also enable the UBIFS-support). This is on a AT91SAM9260-based system. I've verified the same behaviour using both the at91sam9260ek_nandflash_config and a forward-ported patch for the Olimex sam9_l9260 board. Currently I'm concentrating on the at91sam9260ek_nandflash_config, as this one is in the U-Boot repository.

However, once I enable the UBI-support, the nand-flash chip is not detected... I've tried to trace the problem, and I've found that it is timer-related.

Which options did you define to enable UBI? apollon.h should be helpful as an example here.

Ah, I see them in your patch below. Looks ok on first glance.

Quoted 15 lines

It seems that once I enable CONFIG_CMD_UBI, the timer does not work (the debug-printf in the get_ticks()-function in the supplied patch is not printing). If I comment out CONFIG_CMD_UBI, U-Boot continously prints stuff like:
Debug: timestamp=6
Debug: timestamp=10215
Debug: timestamp=21556
which is expected.

I'm compiling by running:
make clean
make at91sam9260ek_nandflash_config
make
and then flashing u-boot.bin to the board.

Quoted 4 lines

The supplied patch works, unless the '#define CONFIG_CMD_UBI 1'
is uncommented, in which case the get_ticks function in cpu/arm926ejs/at91/timer.c never seems to be called. I've sofar been unable to understand why.

Strange. This should have nothing to do with UBI at all. Sorry I have no clue where this problem is coming from. Perhaps a "sleeping" issue that is triggered by larger image size?

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================