From nobody Mon Nov 10 17:34:30 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1558388834; cv=none; d=zoho.com; s=zohoarc; b=FR9+1n/ohTnG/iT5uDu78Xdm8+iSowOqZcQrNkQa1CegD9wybU2fR64AWKx6ePrmELgSjPQLWINWj3pQkbZOcjnGA4hexZ6qHV+cNE4MfdBJ0kUhY0EPK1Da+lRacOZlsh0ni0tZ8l+2dmEMBSOBT79c3h6coOhRJGugy8QZwA4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558388834; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Q1p8jgR0wliheF4QJsEl7JrYA6nTekOo5YiIUGHR+lU=; b=MJi8hC8Od4a1LNCurx0Ic9QpjrR0IiweMnfOI6D/QejzfLamtlJyNWisT0r302DfhagASyFaQUkRM5dO39JsZKt91Kf49dqKoUp+y2AzJXIx2psQJnn1qCCRiPtGj9pDlFG9iDsGj5sgCMUnsunNJPA+TFhhEsZIBSPj+LggtKI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558388834566218.46005268354338; Mon, 20 May 2019 14:47:14 -0700 (PDT) Received: from localhost ([127.0.0.1]:42391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSq7f-00013u-J1 for importer@patchew.org; Mon, 20 May 2019 17:47:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSq4c-0007Pu-MI for qemu-devel@nongnu.org; Mon, 20 May 2019 17:44:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSq4b-00008Q-Rj for qemu-devel@nongnu.org; Mon, 20 May 2019 17:43:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59072) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hSq4Z-00006K-P2; Mon, 20 May 2019 17:43:55 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 09CA030842A0; Mon, 20 May 2019 21:43:55 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-28.brq.redhat.com [10.40.204.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 12B8F1001E6C; Mon, 20 May 2019 21:43:51 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Mon, 20 May 2019 23:43:39 +0200 Message-Id: <20190520214342.13709-2-philmd@redhat.com> In-Reply-To: <20190520214342.13709-1-philmd@redhat.com> References: <20190520214342.13709-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 20 May 2019 21:43:55 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/4] hw/arm/exynos4: Remove unuseful debug code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Guenter Roeck Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis --- hw/arm/exynos4_boards.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c index ea8100f65a8..f0c24b7992e 100644 --- a/hw/arm/exynos4_boards.c +++ b/hw/arm/exynos4_boards.c @@ -35,20 +35,6 @@ #include "hw/net/lan9118.h" #include "hw/boards.h" =20 -#undef DEBUG - -//#define DEBUG - -#ifdef DEBUG - #undef PRINT_DEBUG - #define PRINT_DEBUG(fmt, args...) \ - do { \ - fprintf(stderr, " [%s:%d] "fmt, __func__, __LINE__, ##args)= ; \ - } while (0) -#else - #define PRINT_DEBUG(fmt, args...) do {} while (0) -#endif - #define SMDK_LAN9118_BASE_ADDR 0x05000000 =20 typedef enum Exynos4BoardType { @@ -140,16 +126,6 @@ exynos4_boards_init_common(MachineState *machine, exynos4_board_binfo.gic_cpu_if_addr =3D EXYNOS4210_SMP_PRIVATE_BASE_ADDR + 0x100; =20 - PRINT_DEBUG("\n ram_size: %luMiB [0x%08lx]\n" - " kernel_filename: %s\n" - " kernel_cmdline: %s\n" - " initrd_filename: %s\n", - exynos4_board_ram_size[board_type] / 1048576, - exynos4_board_ram_size[board_type], - machine->kernel_filename, - machine->kernel_cmdline, - machine->initrd_filename); - exynos4_boards_init_ram(s, get_system_memory(), exynos4_board_ram_size[board_type]); =20 --=20 2.20.1 From nobody Mon Nov 10 17:34:30 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1558389050; cv=none; d=zoho.com; s=zohoarc; b=jX1yqdCYkq20RT4obRT/+MGn4Ih1+ghY+p5tKTm35QMg02nsi3Sj7EcybB99QpPG41WcAsbs7p5joJWiOV0PRs08aaG3CGbrDISSvQmug9vQwwqYcs7ytrcB/DzQkCoaIasQVydx3pdFrRjJaSekN5OEoY+uomBv60XbnxgsjmI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558389050; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=JDwz3F2xr+8UcE0jEjnfiyWiljU3Q6hyC6le2MTCT+E=; b=OrXSiHioaNv2e4nycU1UapOcuskcjICT853VGJy+Ro5oZtikbCDQaBtcFIbO/Jk3o61UMOa6CB7HY8vC7TisnXvGUepEi4IIAIoNR4vF7J2PUkprTnyOXLNZcr2oJX/aXAZFRTreSiP4sqkoGrhROSF3tIcww/C0S2CWE7btBJ8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558389050268297.14498329289563; Mon, 20 May 2019 14:50:50 -0700 (PDT) Received: from localhost ([127.0.0.1]:42430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSqBA-0003S1-8R for importer@patchew.org; Mon, 20 May 2019 17:50:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSq4g-0007Sd-Eb for qemu-devel@nongnu.org; Mon, 20 May 2019 17:44:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSq4f-0000BM-Ix for qemu-devel@nongnu.org; Mon, 20 May 2019 17:44:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55574) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hSq4d-00009M-JL; Mon, 20 May 2019 17:43:59 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D7029308220B; Mon, 20 May 2019 21:43:58 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-28.brq.redhat.com [10.40.204.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8819D1001E6C; Mon, 20 May 2019 21:43:55 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Mon, 20 May 2019 23:43:40 +0200 Message-Id: <20190520214342.13709-3-philmd@redhat.com> In-Reply-To: <20190520214342.13709-1-philmd@redhat.com> References: <20190520214342.13709-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 20 May 2019 21:43:58 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/4] hw/arm/exynos4: Use the IEC binary prefix definitions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Guenter Roeck Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" It eases code review, unit is explicit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis --- hw/arm/exynos4_boards.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c index f0c24b7992e..f824eef0d36 100644 --- a/hw/arm/exynos4_boards.c +++ b/hw/arm/exynos4_boards.c @@ -22,6 +22,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu-common.h" @@ -60,8 +61,8 @@ static int exynos4_board_smp_bootreg_addr[EXYNOS4_NUM_OF_= BOARDS] =3D { }; =20 static unsigned long exynos4_board_ram_size[EXYNOS4_NUM_OF_BOARDS] =3D { - [EXYNOS4_BOARD_NURI] =3D 0x40000000, - [EXYNOS4_BOARD_SMDKC210] =3D 0x40000000, + [EXYNOS4_BOARD_NURI] =3D 1 * GiB, + [EXYNOS4_BOARD_SMDKC210] =3D 1 * GiB, }; =20 static struct arm_boot_info exynos4_board_binfo =3D { --=20 2.20.1 From nobody Mon Nov 10 17:34:30 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1558388786; cv=none; d=zoho.com; s=zohoarc; b=ARYfT2Fy71EVxLHJIsOtTM+laztsWhh27dhfGH4CuiEpWPbgXD25RBn5k7/1QTv8hSZN0B2sZXZjLCjIAxCVJkk4SI9T/o8aUoqDGo9XFwQBtbWUI7zdXSuROwj2myZvEFymh2qAuEN45gXkmt3bo9uPTq2dechXRUlT0OQWwiE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558388786; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=f7IplBlIrfbeEgdtB6c1dXvzuwfQ6iOKxgq7aZY0bqg=; b=EdowGnvC8abUDy8gyVU4Hs2V7e5382QOjlB5Seb2n3tgGGJ6WclM6s0v1zUmoGHYPq0Firtf0owftIZXkGzBWzdyj38Lnl1pv9GUBeWjzhjcbYOZokdMtl1sEc5qN+ddk3Ah8yvvcZc8T6i/h2z0Z/gE6aQEU+Y7jCjVXyAzA9A= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558388786960329.0172739943031; Mon, 20 May 2019 14:46:26 -0700 (PDT) Received: from localhost ([127.0.0.1]:42375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSq6t-0000Wj-Ry for importer@patchew.org; Mon, 20 May 2019 17:46:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSq4q-0007eB-SF for qemu-devel@nongnu.org; Mon, 20 May 2019 17:44:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSq4p-0000K5-LW for qemu-devel@nongnu.org; Mon, 20 May 2019 17:44:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34878) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hSq4m-0000GS-VX; Mon, 20 May 2019 17:44:09 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 294D3F74A0; Mon, 20 May 2019 21:44:03 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-28.brq.redhat.com [10.40.204.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 813CE1001E6C; Mon, 20 May 2019 21:43:59 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Mon, 20 May 2019 23:43:41 +0200 Message-Id: <20190520214342.13709-4-philmd@redhat.com> In-Reply-To: <20190520214342.13709-1-philmd@redhat.com> References: <20190520214342.13709-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 20 May 2019 21:44:03 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/4] hw/arm/exynos4210: Add DMA support for the Exynos4210 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , qemu-arm@nongnu.org, Alistair Francis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Guenter Roeck Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Guenter Roeck QEMU already supports pl330. Instantiate it for Exynos4210. Relevant part of Linux arch/arm/boot/dts/exynos4.dtsi: / { soc: soc { amba { pdma0: pdma@12680000 { compatible =3D "arm,pl330", "arm,primecell"; reg =3D <0x12680000 0x1000>; interrupts =3D ; clocks =3D <&clock CLK_PDMA0>; clock-names =3D "apb_pclk"; #dma-cells =3D <1>; #dma-channels =3D <8>; #dma-requests =3D <32>; }; pdma1: pdma@12690000 { compatible =3D "arm,pl330", "arm,primecell"; reg =3D <0x12690000 0x1000>; interrupts =3D ; clocks =3D <&clock CLK_PDMA1>; clock-names =3D "apb_pclk"; #dma-cells =3D <1>; #dma-channels =3D <8>; #dma-requests =3D <32>; }; mdma1: mdma@12850000 { compatible =3D "arm,pl330", "arm,primecell"; reg =3D <0x12850000 0x1000>; interrupts =3D ; clocks =3D <&clock CLK_MDMA>; clock-names =3D "apb_pclk"; #dma-cells =3D <1>; #dma-channels =3D <8>; #dma-requests =3D <1>; }; }; }; }; Signed-off-by: Guenter Roeck Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis [PMD: Do not set default qdev properties, create the controllers in the SoC rather than the board (Peter Maydell), add dtsi in commit message] Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- No SoC datasheet available, Guenter got it working using the "look into the Linux kernel code and then play with parameters until it magically starts working" method. --- hw/arm/exynos4210.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index af82e955421..19009b76e7c 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -96,6 +96,11 @@ /* EHCI */ #define EXYNOS4210_EHCI_BASE_ADDR 0x12580000 =20 +/* DMA */ +#define EXYNOS4210_PL330_BASE0_ADDR 0x12680000 +#define EXYNOS4210_PL330_BASE1_ADDR 0x12690000 +#define EXYNOS4210_PL330_BASE2_ADDR 0x12850000 + static uint8_t chipid_and_omr[] =3D { 0x11, 0x02, 0x21, 0x43, 0x09, 0x00, 0x00, 0x00 }; =20 @@ -160,6 +165,19 @@ static uint64_t exynos4210_calc_affinity(int cpu) return (0x9 << ARM_AFF1_SHIFT) | cpu; } =20 +static void pl330_create(uint32_t base, qemu_irq irq, int nreq) +{ + SysBusDevice *busdev; + DeviceState *dev; + + dev =3D qdev_create(NULL, "pl330"); + qdev_prop_set_uint8(dev, "num_periph_req", nreq); + qdev_init_nofail(dev); + busdev =3D SYS_BUS_DEVICE(dev); + sysbus_mmio_map(busdev, 0, base); + sysbus_connect_irq(busdev, 0, irq); +} + Exynos4210State *exynos4210_init(MemoryRegion *system_mem) { Exynos4210State *s =3D g_new0(Exynos4210State, 1); @@ -410,5 +428,13 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_= mem) sysbus_create_simple(TYPE_EXYNOS4210_EHCI, EXYNOS4210_EHCI_BASE_ADDR, s->irq_table[exynos4210_get_irq(28, 3)]); =20 + /*** DMA controllers ***/ + pl330_create(EXYNOS4210_PL330_BASE0_ADDR, + qemu_irq_invert(s->irq_table[exynos4210_get_irq(35, 1)]),= 32); + pl330_create(EXYNOS4210_PL330_BASE1_ADDR, + qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]),= 32); + pl330_create(EXYNOS4210_PL330_BASE2_ADDR, + qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]),= 1); + return s; } --=20 2.20.1 From nobody Mon Nov 10 17:34:30 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1558389010; cv=none; d=zoho.com; s=zohoarc; b=B4cs3XiGmlVFORnPsCzQRhW8NYpRoDLhhlILSxpWzk0eEawki70AHaCipHdVxUd84GOCTjR78XuXTLHi1Do+qkO8x7u5tQt2FOCxGRQEEMOM+kd3KISX13dWjiLRYKa6tTGUm/AJsyDzaLBye+8MS5+kHiwz703WKNAdJ0/UUqc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558389010; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=t43OENVR4obMrRcvlgCh7UeKPxoDm64MUIhRm/dnleA=; b=Ja+N3Ovv5F5QWaNpVOUbpqf5vPnUOAVZC+SAijwP3T/bHOucEaQWHctdymHWVpZhSQY5YoK4f4ZlfTaebhem+TaEAD8KU5nlbmidInKVYmtUjOT6w9PEJI59ICpql8BzJYoyqNiyr737WI11+DHRFsrLoXZStS0wwUEnOzbvF8k= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558389010920742.6993976240763; Mon, 20 May 2019 14:50:10 -0700 (PDT) Received: from localhost ([127.0.0.1]:42413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSqAW-0002xo-KI for importer@patchew.org; Mon, 20 May 2019 17:50:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSq4v-0007j2-Rz for qemu-devel@nongnu.org; Mon, 20 May 2019 17:44:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSq4u-0000QN-H7 for qemu-devel@nongnu.org; Mon, 20 May 2019 17:44:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58226) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hSq4r-0000M7-Vc; Mon, 20 May 2019 17:44:14 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D29B980F6D; Mon, 20 May 2019 21:44:10 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-28.brq.redhat.com [10.40.204.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD6481001E6C; Mon, 20 May 2019 21:44:03 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Mon, 20 May 2019 23:43:42 +0200 Message-Id: <20190520214342.13709-5-philmd@redhat.com> In-Reply-To: <20190520214342.13709-1-philmd@redhat.com> References: <20190520214342.13709-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 20 May 2019 21:44:10 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 4/4] hw/arm/exynos4210: QOM'ify the Exynos4210 SoC X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Guenter Roeck Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis --- hw/arm/exynos4210.c | 26 +++++++++++++++++++++++--- hw/arm/exynos4_boards.c | 9 ++++++--- include/hw/arm/exynos4210.h | 9 +++++++-- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index 19009b76e7c..0b09129eff8 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -178,9 +178,10 @@ static void pl330_create(uint32_t base, qemu_irq irq, = int nreq) sysbus_connect_irq(busdev, 0, irq); } =20 -Exynos4210State *exynos4210_init(MemoryRegion *system_mem) +static void exynos4210_realize(DeviceState *socdev, Error **errp) { - Exynos4210State *s =3D g_new0(Exynos4210State, 1); + Exynos4210State *s =3D EXYNOS4210_SOC(socdev); + MemoryRegion *system_mem =3D get_system_memory(); qemu_irq gate_irq[EXYNOS4210_NCPUS][EXYNOS4210_IRQ_GATE_NINPUTS]; SysBusDevice *busdev; DeviceState *dev; @@ -435,6 +436,25 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_= mem) qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]),= 32); pl330_create(EXYNOS4210_PL330_BASE2_ADDR, qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]),= 1); +} + +static void exynos4210_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); =20 - return s; + dc->realize =3D exynos4210_realize; } + +static const TypeInfo exynos4210_info =3D { + .name =3D TYPE_EXYNOS4210_SOC, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(Exynos4210State), + .class_init =3D exynos4210_class_init, +}; + +static void exynos4210_register_types(void) +{ + type_register_static(&exynos4210_info); +} + +type_init(exynos4210_register_types) diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c index f824eef0d36..700e90d6671 100644 --- a/hw/arm/exynos4_boards.c +++ b/hw/arm/exynos4_boards.c @@ -45,7 +45,7 @@ typedef enum Exynos4BoardType { } Exynos4BoardType; =20 typedef struct Exynos4BoardState { - Exynos4210State *soc; + Exynos4210State soc; MemoryRegion dram0_mem; MemoryRegion dram1_mem; } Exynos4BoardState; @@ -130,7 +130,10 @@ exynos4_boards_init_common(MachineState *machine, exynos4_boards_init_ram(s, get_system_memory(), exynos4_board_ram_size[board_type]); =20 - s->soc =3D exynos4210_init(get_system_memory()); + object_initialize(&s->soc, sizeof(s->soc), TYPE_EXYNOS4210_SOC); + qdev_set_parent_bus(DEVICE(&s->soc), sysbus_get_default()); + object_property_set_bool(OBJECT(&s->soc), true, "realized", + &error_fatal); =20 return s; } @@ -148,7 +151,7 @@ static void smdkc210_init(MachineState *machine) EXYNOS4_BOARD_SMDKC2= 10); =20 lan9215_init(SMDK_LAN9118_BASE_ADDR, - qemu_irq_invert(s->soc->irq_table[exynos4210_get_irq(37, 1)])); + qemu_irq_invert(s->soc.irq_table[exynos4210_get_irq(37, 1)])); arm_load_kernel(ARM_CPU(first_cpu), &exynos4_board_binfo); } =20 diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h index 098a69ec73d..27c684e851d 100644 --- a/include/hw/arm/exynos4210.h +++ b/include/hw/arm/exynos4210.h @@ -85,6 +85,9 @@ typedef struct Exynos4210Irq { } Exynos4210Irq; =20 typedef struct Exynos4210State { + /*< private >*/ + SysBusDevice parent_obj; + /*< public >*/ ARMCPU *cpu[EXYNOS4210_NCPUS]; Exynos4210Irq irqs; qemu_irq *irq_table; @@ -98,11 +101,13 @@ typedef struct Exynos4210State { I2CBus *i2c_if[EXYNOS4210_I2C_NUMBER]; } Exynos4210State; =20 +#define TYPE_EXYNOS4210_SOC "exynos4210" +#define EXYNOS4210_SOC(obj) \ + OBJECT_CHECK(Exynos4210State, obj, TYPE_EXYNOS4210_SOC) + void exynos4210_write_secondary(ARMCPU *cpu, const struct arm_boot_info *info); =20 -Exynos4210State *exynos4210_init(MemoryRegion *system_mem); - /* Initialize exynos4210 IRQ subsystem stub */ qemu_irq *exynos4210_init_irq(Exynos4210Irq *env); =20 --=20 2.20.1