From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEyeR-0006FB-D7 for qemu-devel@nongnu.org; Thu, 29 Aug 2013 05:36:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEyeM-0003Y1-GD for qemu-devel@nongnu.org; Thu, 29 Aug 2013 05:36:27 -0400 Received: from mail-lb0-x230.google.com ([2a00:1450:4010:c04::230]:42599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEyeM-0003Xq-1m for qemu-devel@nongnu.org; Thu, 29 Aug 2013 05:36:22 -0400 Received: by mail-lb0-f176.google.com with SMTP id y6so490713lbh.35 for ; Thu, 29 Aug 2013 02:36:21 -0700 (PDT) From: Antony Pavlov Date: Thu, 29 Aug 2013 13:33:50 +0400 Message-Id: <1377768833-11400-3-git-send-email-antonynpavlov@gmail.com> In-Reply-To: <1377768833-11400-1-git-send-email-antonynpavlov@gmail.com> References: <1377768833-11400-1-git-send-email-antonynpavlov@gmail.com> Subject: [Qemu-devel] [RFC 2/5] hw/arm: add very initial support for Canon DIGIC SoC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Paul Brook , Peter Crosthwaite , Peter Maydell , Alex Dumitrache , g3gg0 , Giovanni Condello Cc: qemu-devel@nongnu.org, Antony Pavlov DIGIC is Canon Inc.'s name for a family of SoC for digital cameras and camcorders. There is no publicly available specification for DIGIC chips. All information about DIGIC chip internals is based on reverse engineering efforts made by CHDK (http://chdk.wikia.com) and Magic Lantern (http://www.magiclantern.fm) projects contributors. Also this patch adds initial support for Canon PowerShot A1100 IS compact camera. Signed-off-by: Antony Pavlov --- default-configs/arm-softmmu.mak | 1 + hw/arm/Makefile.objs | 2 +- hw/arm/digic.c | 85 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 hw/arm/digic.c diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak index ac0815d..0d1d783 100644 --- a/default-configs/arm-softmmu.mak +++ b/default-configs/arm-softmmu.mak @@ -63,6 +63,7 @@ CONFIG_FRAMEBUFFER=y CONFIG_XILINX_SPIPS=y CONFIG_A9SCU=y +CONFIG_DIGIC=y CONFIG_MARVELL_88W8618=y CONFIG_OMAP=y CONFIG_TSC210X=y diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs index 3671b42..53d5ffd 100644 --- a/hw/arm/Makefile.objs +++ b/hw/arm/Makefile.objs @@ -1,4 +1,4 @@ -obj-y += boot.o collie.o exynos4_boards.o gumstix.o highbank.o +obj-y += boot.o collie.o digic.o exynos4_boards.o gumstix.o highbank.o obj-y += integratorcp.o kzm.o mainstone.o musicpal.o nseries.o obj-y += omap_sx1.o palm.o realview.o spitz.o stellaris.o obj-y += tosa.o versatilepb.o vexpress.o xilinx_zynq.o z2.o diff --git a/hw/arm/digic.c b/hw/arm/digic.c new file mode 100644 index 0000000..3259b38 --- /dev/null +++ b/hw/arm/digic.c @@ -0,0 +1,85 @@ +/* + * QEMU model of the Canon SoC. + * + * Copyright (C) 2013 Antony Pavlov + * + * This model is based on reverse engineering efforts + * made by CHDK (http://chdk.wikia.com) and + * Magic Lantern (http://www.magiclantern.fm) projects + * contributors. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see . + * + */ + +#include "exec/address-spaces.h" +#include "hw/sysbus.h" +#include "hw/boards.h" + +typedef struct { + ARMCPU *cpu; + MemoryRegion ram; +} DigicState; + +typedef struct { + hwaddr ram_size; +} DigicBoard; + +static DigicState *digic4_create(void) +{ + DigicState *s = g_new(DigicState, 1); + + s->cpu = cpu_arm_init("arm946e-s"); + if (!s->cpu) { + fprintf(stderr, "Unable to find CPU definition\n"); + exit(1); + } + + return s; +} + +static void digic4_setup_ram(DigicState *s, hwaddr ram_size) +{ + memory_region_init_ram(&s->ram, NULL, "ram", ram_size); + memory_region_add_subregion(get_system_memory(), 0, &s->ram); + vmstate_register_ram_global(&s->ram); +} + +static void init_digic4_board(DigicBoard *board) +{ + DigicState *s = digic4_create(); + + digic4_setup_ram(s, board->ram_size); +} + +static DigicBoard a1100_board = { + .ram_size = 64 * 1024 * 1024, +}; + +static void init_a1100(QEMUMachineInitArgs *args) +{ + init_digic4_board(&a1100_board); +} + +static QEMUMachine canon_a1100 = { + .name = "canon-a1100", + .desc = "Canon PowerShot A1100 IS", + .init = &init_a1100, +}; + +static void digic_machine_init(void) +{ + qemu_register_machine(&canon_a1100); +} +machine_init(digic_machine_init); -- 1.8.4.rc3