From nobody Wed May 8 14:47:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494157123470389.44029942390296; Sun, 7 May 2017 04:38:43 -0700 (PDT) Received: from localhost ([::1]:54558 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7KWQ-00014u-24 for importer@patchew.org; Sun, 07 May 2017 07:38:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7KTm-0007fZ-Fh for qemu-devel@nongnu.org; Sun, 07 May 2017 07:35:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7KTl-0004W5-Bo for qemu-devel@nongnu.org; Sun, 07 May 2017 07:35:58 -0400 Received: from mail.kernel.org ([198.145.29.136]:56202) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d7KTh-0004Ub-O8; Sun, 07 May 2017 07:35:53 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 870122037F; Sun, 7 May 2017 11:35:51 +0000 (UTC) Received: from kozik-lap.dzcmts001-cpe-001.datazug.ch (pub082136089155.dh-hfc.datazug.ch [82.136.89.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F01DB20377; Sun, 7 May 2017 11:35:48 +0000 (UTC) From: Krzysztof Kozlowski To: Igor Mitsyanko , Peter Maydell , qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Sun, 7 May 2017 13:35:38 +0200 Message-Id: <20170507113540.8687-2-krzk@kernel.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170507113540.8687-1-krzk@kernel.org> References: <20170507113540.8687-1-krzk@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 198.145.29.136 Subject: [Qemu-devel] [PATCH 1/3] hw/arm/exynos: Use type define instead of hard-coded a9mpcore_priv string 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Krzysztof Kozlowski Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use a define for a9mpcore_priv device type name instead of hard-coded string. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/exynos4210.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index 034fc8be9d76..a9e221c5b7fe 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -26,6 +26,7 @@ #include "qemu-common.h" #include "qemu/log.h" #include "cpu.h" +#include "hw/cpu/a9mpcore.h" #include "hw/boards.h" #include "sysemu/sysemu.h" #include "hw/sysbus.h" @@ -212,7 +213,7 @@ static void exynos4210_init(Object *obj) } =20 /* Private memory region and Internal GIC */ - dev =3D qdev_create(NULL, "a9mpcore_priv"); + dev =3D qdev_create(NULL, TYPE_A9MPCORE_PRIV); qdev_prop_set_uint32(dev, "num-cpu", EXYNOS4210_NCPUS); qdev_init_nofail(dev); busdev =3D SYS_BUS_DEVICE(dev); --=20 2.9.3 From nobody Wed May 8 14:47:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494157068954163.79521525284076; Sun, 7 May 2017 04:37:48 -0700 (PDT) Received: from localhost ([::1]:54557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7KVX-0000NF-Mi for importer@patchew.org; Sun, 07 May 2017 07:37:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7KTn-0007fz-2D for qemu-devel@nongnu.org; Sun, 07 May 2017 07:36:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7KTl-0004WQ-S3 for qemu-devel@nongnu.org; Sun, 07 May 2017 07:35:58 -0400 Received: from mail.kernel.org ([198.145.29.136]:56228) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d7KTj-0004Uy-Mm; Sun, 07 May 2017 07:35:55 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2964420361; Sun, 7 May 2017 11:35:54 +0000 (UTC) Received: from kozik-lap.dzcmts001-cpe-001.datazug.ch (pub082136089155.dh-hfc.datazug.ch [82.136.89.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0AAAB20392; Sun, 7 May 2017 11:35:51 +0000 (UTC) From: Krzysztof Kozlowski To: Igor Mitsyanko , Peter Maydell , qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Sun, 7 May 2017 13:35:39 +0200 Message-Id: <20170507113540.8687-3-krzk@kernel.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170507113540.8687-1-krzk@kernel.org> References: <20170507113540.8687-1-krzk@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 198.145.29.136 Subject: [Qemu-devel] [PATCH 2/3] hw/intc/exynos: Constify array of combiner interrupts 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Krzysztof Kozlowski Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The static array of interrupt combiner mappings is not modified so it can be made const for code safeness. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/intc/exynos4210_gic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/intc/exynos4210_gic.c b/hw/intc/exynos4210_gic.c index 222cfd6c6387..636dc6dbc1f9 100644 --- a/hw/intc/exynos4210_gic.c +++ b/hw/intc/exynos4210_gic.c @@ -116,7 +116,7 @@ enum ExtInt { * which is INTG16 in Internal Interrupt Combiner. */ =20 -static uint32_t +static const uint32_t combiner_grp_to_gic_id[64-EXYNOS4210_MAX_EXT_COMBINER_OUT_IRQ][8] =3D { /* int combiner groups 16-19 */ { }, { }, { }, { }, --=20 2.9.3 From nobody Wed May 8 14:47:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494157065800495.3010754932874; Sun, 7 May 2017 04:37:45 -0700 (PDT) Received: from localhost ([::1]:54556 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7KVT-0000If-Sy for importer@patchew.org; Sun, 07 May 2017 07:37:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7KTp-0007jB-Pg for qemu-devel@nongnu.org; Sun, 07 May 2017 07:36:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7KTo-0004Xw-UF for qemu-devel@nongnu.org; Sun, 07 May 2017 07:36:01 -0400 Received: from mail.kernel.org ([198.145.29.136]:56278) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d7KTm-0004WI-D0; Sun, 07 May 2017 07:35:58 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F7F420392; Sun, 7 May 2017 11:35:56 +0000 (UTC) Received: from kozik-lap.dzcmts001-cpe-001.datazug.ch (pub082136089155.dh-hfc.datazug.ch [82.136.89.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9348220373; Sun, 7 May 2017 11:35:54 +0000 (UTC) From: Krzysztof Kozlowski To: Igor Mitsyanko , Peter Maydell , qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Sun, 7 May 2017 13:35:40 +0200 Message-Id: <20170507113540.8687-4-krzk@kernel.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170507113540.8687-1-krzk@kernel.org> References: <20170507113540.8687-1-krzk@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 198.145.29.136 Subject: [Qemu-devel] [PATCH 3/3] hw/arm/exynos: Add support for system poweroff 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Krzysztof Kozlowski Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" On all Exynos-based boards, the system powers down itself by driving PS_HOLD signal low. Handle writing to respective PMU register to fix power off failure: reboot: Power down Unable to poweroff system shutdown: 31 output lines suppressed due to ratelimiting Kernel panic - not syncing: Attempted to kill init! exitcode=3D0x000000= 00 CPU: 0 PID: 1 Comm: shutdown Not tainted 4.11.0-rc8 #846 Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0x88/0x9c) [] (dump_stack) from [] (panic+0xdc/0x268) [] (panic) from [] (do_exit+0xa90/0xab4) [] (do_exit) from [] (SyS_reboot+0x164/0x1d0) [] (SyS_reboot) from [] (ret_fast_syscall+0x0/0x3c) Signed-off-by: Krzysztof Kozlowski Reviewed-by: Peter Maydell --- hw/misc/exynos4210_pmu.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hw/misc/exynos4210_pmu.c b/hw/misc/exynos4210_pmu.c index 63a8ccd35559..2046e6313f10 100644 --- a/hw/misc/exynos4210_pmu.c +++ b/hw/misc/exynos4210_pmu.c @@ -26,6 +26,7 @@ =20 #include "qemu/osdep.h" #include "hw/sysbus.h" +#include "sysemu/sysemu.h" =20 #ifndef DEBUG_PMU #define DEBUG_PMU 0 @@ -397,6 +398,12 @@ typedef struct Exynos4210PmuState { uint32_t reg[PMU_NUM_OF_REGISTERS]; } Exynos4210PmuState; =20 +static void exynos4210_pmu_poweroff(void) +{ + PRINT_DEBUG("QEMU PMU: PS_HOLD bit down, powering off\n"); + qemu_system_shutdown_request(); +} + static uint64_t exynos4210_pmu_read(void *opaque, hwaddr offset, unsigned size) { @@ -428,6 +435,13 @@ static void exynos4210_pmu_write(void *opaque, hwaddr = offset, PRINT_DEBUG_EXTEND("%s <0x%04x> <- 0x%04x\n", reg_p->name, (uint32_t)offset, (uint32_t)val); s->reg[i] =3D val; + if ((offset =3D=3D PS_HOLD_CONTROL) && ((val & BIT(8)) =3D=3D = 0)) { + /* + * We are interested only in setting data bit + * of PS_HOLD_CONTROL register to indicate power off reque= st. + */ + exynos4210_pmu_poweroff(); + } return; } reg_p++; --=20 2.9.3