All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] No nandflash found if CONFIG_CMD_UBI is enabled.
@ 2009-06-02  7:08 Anders Darander
  2009-06-02  7:27 ` Stefan Roese
  0 siblings, 1 reply; 2+ messages in thread
From: Anders Darander @ 2009-06-02  7:08 UTC (permalink / raw)
  To: u-boot

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':
diff --git a/cpu/arm926ejs/at91/timer.c b/cpu/arm926ejs/at91/timer.c
index c84cb5e..a0a409e 100644
--- a/cpu/arm926ejs/at91/timer.c
+++ b/cpu/arm926ejs/at91/timer.c
@@ -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;
 }

diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h
index e46c9d6..e32de31 100644
--- a/include/configs/at91sam9260ek.h
+++ b/include/configs/at91sam9260ek.h
@@ -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


-- 
Anders Darander

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] No nandflash found if CONFIG_CMD_UBI is enabled.
  2009-06-02  7:08 [U-Boot] No nandflash found if CONFIG_CMD_UBI is enabled Anders Darander
@ 2009-06-02  7:27 ` Stefan Roese
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Roese @ 2009-06-02  7:27 UTC (permalink / raw)
  To: u-boot

Hi Anders,

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.

> 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.

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
=====================================================================

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-02  7:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-02  7:08 [U-Boot] No nandflash found if CONFIG_CMD_UBI is enabled Anders Darander
2009-06-02  7:27 ` Stefan Roese

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.