From: Magnus Lilja Date: Thu, 30 Apr 2009 18:05:06 +0200 Subject: [U-Boot] U-boot -printk kernel crash dump using md on PDK In-Reply-To: <528f13590904291636w1005c7e5o4de701f0153cc401@mail.gmail.com> References: <528f13590904262208s66b17bdekac218fba7994d177@mail.gmail.com> <528f13590904281018k7d1d7c41oef711c3d39648898@mail.gmail.com> <59b21cf20904281031y1a81448dw2e750d335473d183@mail.gmail.com> <528f13590904281102k3a90e220n865dba306ee9fb@mail.gmail.com> <59b21cf20904281325x77290c67kf701ffee717e21e3@mail.gmail.com> <528f13590904281403g330e29a0r39278a99575fe064@mail.gmail.com> <59b21cf20904282312m4b5e5442k26d67f42c3fe433d@mail.gmail.com> <528f13590904290948g23609a6et634913c2542fabaf@mail.gmail.com> <59b21cf20904291052p4ec69d38g3b3414a9435ea48d@mail.gmail.com> <528f13590904291636w1005c7e5o4de701f0153cc401@mail.gmail.com> Message-ID: <59b21cf20904300905o1abcbaccmdaa28d32316208cb@mail.gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi 2009/4/30 alfred steele : > Hi Magnus, > > >> The mainline u-boot + my patches from early April does not contain any >> driver for the i.MX31 NAND flash controller so that can't autodetect >> any flash part at all. > How does it boot out of NAND then? I am getting confused. By > detection, i meant the basic ?init of the NFC and the NFCBUF and the > associated initiliazation to pool the SPL off the NAND which further > hand over to the uboot. I realize I wasn't clear. U-boot NAND booting is done in several steps. For the i.MX31 the following steps are involved: 1. i.MX31 reads the first 2048 bytes from NAND. This is the SPL. 2. The SPL contains lowlevel-init and sets up the SDRAM (in assembler). SPL is compiled without SKIP_LOWLEVEL_INIT and without SKIP_RELOATE_UBOOT. 3. The SPL copies the rest of U-boot, a predefined number of blocks, from NAND to SDRAM (nand_boot_mx31.c). This is currently done without run-time detection of the NAND type.CFG_NAND_CHIP_SIZE/CFG_NAND_PAGE_SIZE and others control this. 4. After copying, SPL jumps to U-boot 5. U-boot starts executing (cpu/arm1136/start.S) 6. SKIP_LOWLEVEL_INIT and SKIP_RELOCATE_UBOOT are defined when compiling U-boot since the SDRAM has already been setup by SPL and SPL has already placed U-boot at the correct address (i.e. no relocation needed). 7. Eventually board/freescale/mx31pdk/mx31pdk.c:board_init is called. 8. U-boot main loop is entered. (I hope I got the above right) If U-boot had full NAND support for i.MX31, NAND would be detected somewhere between steps 7 and 8. Remember that there are two separate applications involved above, SPL which is built in nand_spl, and U-boot. The two applications are concatenated into one binary. What's may be confusing is that the same config-file is used both when compiling SPL and U-boot, but config.h is modified a bit. >> CONFIG_NAND_SPL is defined in >> nand_spl/board/freescale/mx31pdk/Makefile when it builds the second >> phase loader. > CONFIG_NAND_SPL ?is fine but ?CONFIG_SKIP_LOWLEVEL_INIT and > CONFIG_SKIP_RELOCATE_UBOOT should not be defined in case we are > booting out of NAND, right? See my explanation above. CONFIG_SKIP* is defined when compiling U-boot, but not when compiling SPL. /Magnus