From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Fri, 18 Feb 2011 12:54:58 -0600 Subject: [U-Boot] Reading from NAND In-Reply-To: References: Message-ID: <20110218125458.62beea47@schlenkerla> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, 18 Feb 2011 08:29:45 -0500 D Kesselring wrote: > Hello, > I am trying to add some code to U-Boot that will read a NAND location > to determine how to setup some environment variables. I am using a > LogicPD SOM board with an OMAP3503 (very similar to Zoom). I have > found the code that handles the user nand commands and am trying to > use ?nand_read_skip_bad?. This needs a ?nand_info_t*? which I was > trying to get from the global ?nand_info[]? but it does not seem to be > initialized. My questions are (1) is the the best way to do this and > (2) if so, how do I get ?nand_info[]? initialized. As Wolfgang pointed out, the best way is probably using scripting (and certainly not by hacking up main_loop()), and thus you won't be calling nand_raed_skip_bad() directly. But that still requires NAND to have been initialized. You need a NAND controller driver. This driver supplies board_nand_init(), or in some cases may be called by board_nand_init() that platform code supplies. I'm not familiar with OMAP chips, but perhaps drivers/mtd/nand/omap_gpmc.c is the driver you want? In which case your board config file needs to define CONFIG_NAND_OMAP_GPMC, as well as any driver-specific defines there may be. -Scott