2 * Xilinx ZynqMP EP108 board
4 * Copyright (C) 2015 Xilinx Inc
5 * Written by Peter Crosthwaite <peter.crosthwaite@xilinx.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 #include "hw/arm/xlnx-zynqmp.h"
19 #include "hw/boards.h"
20 #include "qemu/error-report.h"
21 #include "exec/address-spaces.h"
23 typedef struct XlnxEP108
{
29 #define EP108_MAX_RAM_SIZE 0x80000000ull
31 static struct arm_boot_info xlnx_ep108_binfo
;
33 static void xlnx_ep108_init(MachineState
*machine
)
35 XlnxEP108
*s
= g_new0(XlnxEP108
, 1);
38 object_initialize(&s
->soc
, sizeof(s
->soc
), TYPE_XLNX_ZYNQMP
);
39 object_property_add_child(OBJECT(machine
), "soc", OBJECT(&s
->soc
),
42 object_property_set_bool(OBJECT(&s
->soc
), true, "realized", &err
);
44 error_report("%s", error_get_pretty(err
));
48 if (machine
->ram_size
> EP108_MAX_RAM_SIZE
) {
49 error_report("WARNING: RAM size " RAM_ADDR_FMT
" above max supported, "
50 "reduced to %llx", machine
->ram_size
, EP108_MAX_RAM_SIZE
);
51 machine
->ram_size
= EP108_MAX_RAM_SIZE
;
54 if (machine
->ram_size
<= 0x08000000) {
55 qemu_log("WARNING: RAM size " RAM_ADDR_FMT
" is small for EP108",
59 memory_region_allocate_system_memory(&s
->ddr_ram
, NULL
, "ddr-ram",
61 memory_region_add_subregion(get_system_memory(), 0, &s
->ddr_ram
);
63 xlnx_ep108_binfo
.ram_size
= machine
->ram_size
;
64 xlnx_ep108_binfo
.kernel_filename
= machine
->kernel_filename
;
65 xlnx_ep108_binfo
.kernel_cmdline
= machine
->kernel_cmdline
;
66 xlnx_ep108_binfo
.initrd_filename
= machine
->initrd_filename
;
67 xlnx_ep108_binfo
.loader_start
= 0;
68 arm_load_kernel(s
->soc
.boot_cpu_ptr
, &xlnx_ep108_binfo
);
71 static QEMUMachine xlnx_ep108_machine
= {
73 .desc
= "Xilinx ZynqMP EP108 board",
74 .init
= xlnx_ep108_init
,
77 static void xlnx_ep108_machine_init(void)
79 qemu_register_machine(&xlnx_ep108_machine
);
82 machine_init(xlnx_ep108_machine_init
);