[U-Boot] [PATCHv1] ARM: Add Altera SOCFPGA Cyclone5

Stefan Roese stefan.roese at gmail.com
Thu Aug 23 13:18:41 CEST 2012


Hi Pavel,

On 08/23/2012 12:43 PM, Pavel Machek wrote:
>>>> +static unsigned long spl_parse_image_header(const struct image_header
>>>> *header) +{
>>>> +	/* checking for mkimage signature */
>>>> +	if (__be32_to_cpu(header->ih_magic) == IH_MAGIC) {
>>>> +		/* Valid image. Extract information out of header */
>>>> +		spl_image.size = __be32_to_cpu(header->ih_size);
>>>> +		spl_image.entry_point = __be32_to_cpu(header->ih_load);
>>>> +		spl_image.load_addr = __be32_to_cpu(header->ih_load);
>>>> +		spl_image.os = header->ih_os;
>>>> +		spl_image.name = (const char *)&header->ih_name;
>>>> +		spl_image.crc = __be32_to_cpu(header->ih_dcrc);
>>>> +		debug("Subsequent boot image info\n");
>>>> +		debug("   Image Name:   %.*s\n", IH_NMLEN, spl_image.name);
>>>> +		debug("   Data Size:    %d\n", spl_image.size);
>>>> +		debug("   Load Address: 0x%x\n", spl_image.load_addr);
>>>> +		debug("   Entry Point:  0x%X\n", spl_image.entry_point);
>>>> +	} else {
>>>> +		/* Not a valid image as mkimage signature not found */
>>>> +		printf("Error : mkimage signature not found - ih_magic = %x\n",
>>>> +			header->ih_magic);
>>>> +		return 1;
>>>> +	}
>>>> +
>>>> +	/* Checking image type. Do any customize stuff per image type here */
>>>> +	switch (spl_image.os) {
>>>> +	case IH_OS_U_BOOT:
>>>> +		debug("   Image Type:   U-Boot\n");
>>>> +		break;
>>>> +	default:
>>>> +		printf("   Image Type:   Unknown (%d)\n", spl_image.os);
>>>> +		;
>>>> +	}
>>>> +	return 0;
>>>> +}
>>>
>>> I think I don't even wanna know what's the purpose here :-)
>>
>> It's the omap-common/spl.c code with the bits for IH_OS_LINUX taken out
>> :)  Can you please re-do your series on top of the SPL series I just
>> posted that provides a common SPL framework?  Thanks!
> 
> I'll take a look. OTOH, ammount of code duplication here is quite low,
> and redoing it on top of SPL series will mean delaying merge, right?

Yes, that might happen. But we learned in the past that if we don't try
to do such code consolidations right from the beginning, it won't happen
at all (most of the time). So I'm also in favor of using the common SPL
framework now. Please take a look at Tom Rini's v3 series:

http://www.mail-archive.com/u-boot@lists.denx.de/msg91405.html

I also based my powerpc SPL NOR flash booting series on it:

http://www.mail-archive.com/u-boot@lists.denx.de/msg91443.html

Thanks,
Stefan




More information about the U-Boot mailing list