@@ -45,6 +45,32 @@ static const int realview_board_id[] = {
0x76d
};
+static inline void realview_init_cpu_props(Object *obj, hwaddr reset_cbar,
+ bool do_reset_cbar)
+{
+ Error *err = NULL;
+
+ /* By default A9,A15 and ARM1176 CPUs have EL3 enabled. This board
+ * does not currently support EL3 so the CPU EL3 property is disabled
+ * before realization.
+ */
+ if (object_property_find(obj, "has_el3", NULL)) {
+ object_property_set_bool(obj, false, "has_el3", &err);
+ if (err) {
+ error_report_err(err);
+ exit(1);
+ }
+ }
+
+ if (do_reset_cbar) {
+ object_property_set_int(obj, reset_cbar, "reset-cbar", &err);
+ if (err) {
+ error_report_err(err);
+ exit(1);
+ }
+ }
+}
+
static void realview_init(MachineState *machine,
enum realview_board_type board_type)
{
@@ -101,25 +127,7 @@ static void realview_init(MachineState *machine,
Object *cpuobj = object_new(object_class_get_name(cpu_oc));
Error *err = NULL;
- /* By default A9,A15 and ARM1176 CPUs have EL3 enabled. This board
- * does not currently support EL3 so the CPU EL3 property is disabled
- * before realization.
- */
- if (object_property_find(cpuobj, "has_el3", NULL)) {
- object_property_set_bool(cpuobj, false, "has_el3", &err);
- if (err) {
- error_report_err(err);
- exit(1);
- }
- }
-
- if (is_pb && is_mpcore) {
- object_property_set_int(cpuobj, periphbase, "reset-cbar", &err);
- if (err) {
- error_report_err(err);
- exit(1);
- }
- }
+ realview_init_cpu_props(cpuobj, periphbase, is_pb && is_mpcore);
object_property_set_bool(cpuobj, true, "realized", &err);
if (err) {
Into its own function. This prepares support for cpu-inclusive MPCores which may need to have these props set for them as well. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> --- hw/arm/realview.c | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-)