From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeroen Hofstee Date: Fri, 20 Jun 2014 22:33:46 +0200 Subject: [U-Boot] [Patch v8 4/5] armv8/fsl-lsch3: Add support to load and start MC Firmware In-Reply-To: <1403290017-22838-4-git-send-email-yorksun@freescale.com> References: <1403290017-22838-1-git-send-email-yorksun@freescale.com> <1403290017-22838-4-git-send-email-yorksun@freescale.com> Message-ID: <53A49AAA.9050507@myspectrum.nl> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi York, On 20-06-14 20:46, York Sun wrote: > From: "J. German Rivera" > > Adding support to load and start the Layerscape Management Complex (MC) > firmware. First, the MC GCR register is set to 0 to reset all cores. MC > firmware and DPL images are copied from their location in NOR flash to > DDR. MC registers are updated with the location of these images. > Deasserting the reset bit of MC GCR register releases core 0 to run. > Core 1 will be released by MC firmware. Stop bits are not touched for > this step. U-boot waits for MC until it boots up. In case of a failure, > device tree is updated accordingly. The MC firmware image uses FIT format. > > > +int parse_mc_firmware_fit_image(const void **raw_image_addr, > + size_t *raw_image_size) > +{ > + int format; > + void *fit_hdr; > + int node_offset; > + const void *data; > + size_t size; > + const char *uname = "firmware"; > + > + /* Check if the image is in NOR flash*/ > +#ifdef CONFIG_SYS_LS_MC_FW_IN_NOR > + fit_hdr = (void *)CONFIG_SYS_LS_MC_FW_ADDR; > +#else > +#error "No CONFIG_SYS_LS_MC_FW_IN_xxx defined" > +#endif > + > + /* Check if Image is in FIT format */ > + format = genimg_get_format(fit_hdr); > + > + if (format != IMAGE_FORMAT_FIT) { > + debug("Not a FIT image\n"); > + return 1; > + } > + > + if (!fit_check_format(fit_hdr)) { > + debug("Bad FIT image format\n"); > + return 1; > + } > + > + /* Find node offset of MC Firmware image */ > + if (uname == NULL) { > + debug("FIT subimage unit name not provided"); > + return 1; > + } > + I don't see how uname can ever be NULL here, since it is assigned above. Regards, Jeroen