Am 05.01.2012 21:02, schrieb Mark Langsdorf:
> From: Rob Herring <[email protected]>
>
> Adds support for Calxeda's Highbank SoC.
>
> Signed-off-by: Rob Herring <[email protected]>
> Signed-off-by: Mark Langsdorf <[email protected]>
> ---
> diff --git a/hw/highbank.c b/hw/highbank.c
> new file mode 100644
> index 0000000..73b6564
> --- /dev/null
> +++ b/hw/highbank.c
> + sysram = g_new(MemoryRegion, 1);
> + memory_region_init_ram(sysram, "highbank.sysram", 0x8000);
> + memory_region_add_subregion(sysmem, 0xfff88000, sysram);
> + if (load_image_targphys("sysram.bin", 0xfff88000, 0x8000) < 0) {
> + fprintf(stderr, "Unable to load sysram.bin\n");
> + }
This should be something like:
char* filename;
if (bios_name == NULL) {
bios_name = "sysram.bin";
}
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
if (filename != NULL) {
load_image_targpyhs(filename, ...);
g_free(filename);
}
Not knowing ARM boot well myself, you might also want to check and use
get_image_size(filename) rather than hardcoding 0x8000?
Also I'm wondering what the use case here is. I can imagine two scenarios:
1) User wants to boot a -bios, which in turn may at runtime search for a
kernel on the emulated storage, like it would on real hardware. Then
loading a too large or missing BIOS should fail.
2) User wants to boot a -kernel. Then this should probably not complain
about issues with -bios at all, unless explicitly specified by the user.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg