From: Haiying Wang Date: Wed, 2 Feb 2011 12:53:21 -0500 Subject: [U-Boot] [PATCH] powerpc: Add cpu_late_init_r to allow for initialization post env setup In-Reply-To: <1296667676-11642-1-git-send-email-galak@kernel.crashing.org> References: <1296667676-11642-1-git-send-email-galak@kernel.crashing.org> Message-ID: <1296669201.2011.40.camel@haiying-laptop> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 2011-02-02 at 11:27 -0600, Kumar Gala wrote: > +void cpu_late_init_r(void) > +{ > +#ifdef CONFIG_QE > + uint qe_base = CONFIG_SYS_IMMR + 0x00080000; /* QE immr base */ > + qe_init(qe_base); > + qe_reset(); > +#endif > +} You did not move qe_reset() inside qe_init() as you recommended.:) For NAND boot case, the microcode needs to be read from nand flash via nand_read first, so you might add some more code like: +void cpu_late_init_r(void) +{ +#ifdef CONFIG_QE +#ifdef CONFIG_SYS_QE_FW_IN_NAND + int ret; + size_t fw_length = CONFIG_SYS_QE_FW_LENGTH; + /* load QE firmware from NAND flash to DDR first */ + ret = nand_read(&nand_info[0],(loff_t)CONFIG_SYS_QE_FW_IN_NAND, + &fw_length, (u_char *)CONFIG_SYS_QE_FW_ADDR); + if (ret && ret == -EUCLEAN) { + printf ("NAND read for QE firmware at offset %x failed % d\n", + CONFIG_SYS_QE_FW_IN_NAND, ret); + } +#endif + uint qe_base = CONFIG_SYS_IMMR + 0x00080000; /* QE immr base */ + qe_init(qe_base); + qe_reset(); +#endif +} Haiying