From patchwork Mon Jan 25 08:29:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 60273 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1220611lbb; Mon, 25 Jan 2016 00:30:12 -0800 (PST) X-Received: by 10.98.14.157 with SMTP id 29mr24090855pfo.35.1453710612531; Mon, 25 Jan 2016 00:30:12 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fa4si32122537pab.87.2016.01.25.00.30.12; Mon, 25 Jan 2016 00:30:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755565AbcAYIaK (ORCPT + 30 others); Mon, 25 Jan 2016 03:30:10 -0500 Received: from mail-lf0-f53.google.com ([209.85.215.53]:34372 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751094AbcAYIaG (ORCPT ); Mon, 25 Jan 2016 03:30:06 -0500 Received: by mail-lf0-f53.google.com with SMTP id 17so79715516lfz.1 for ; Mon, 25 Jan 2016 00:30:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=AA0BTzaGUsfauNEsQJVw968jPCd+MTBwtBxCaoBiqfA=; b=bu9R2SuuWEQhV6s7ARipM+onx+HtZHzTVZ4N3BXD3NoGQdp/CFubjVKd+RE84z0cAp HrV1CRXByVfy/ycT/gWmLP5W9ntXouaLBgQAZcrccDfu96u+KEfXhKG0HkVb9KtvACsj 4yE6u5UaFmbF4ikXrYl/Ok1iQHjg9ACi2kasI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AA0BTzaGUsfauNEsQJVw968jPCd+MTBwtBxCaoBiqfA=; b=DbRljr7I4Vum1vubNVBMrV7/Y3eZBE8MsF3jz8Bcl2OeNZ4eNV4UwdVrI6ApB3md8D rGTftwK0L+7msKowmSo+50octigrET4bRR8E5cc4t1zn4H0Ra/DJepKQC2v782DertOU dGBqyRKHsjv1g/f4ecz+cmRi3r5wR4PSS8h4xfVAfXwp3UCBmFM2mzOqagFETaxGs8wD lO5fGuTjjP7md5R1AftgfTh33K6HsClm0YI9yQlZJp6Eyb2pdp08z6HAukTWrlc1r/uu SQMvYGhjg+RK4uxEd7PigFitFv3MCaSjmM3eKTTBkeoHfuuN12+5H77BXb/U5I4WU6yl o08Q== X-Gm-Message-State: AG10YOSixmahXJfE1Fyk4enOS8c4aQ5r2GDBes7X574o2CYs0Jtd/eiwx0ebK9BdcuLZvoSE X-Received: by 10.25.207.3 with SMTP id f3mr6099652lfg.20.1453710603103; Mon, 25 Jan 2016 00:30:03 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id ug1sm2551113lbb.43.2016.01.25.00.30.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jan 2016 00:30:02 -0800 (PST) From: Linus Walleij To: Sebastian Reichel , Dmitry Eremin-Solenikov , linux-kernel@vger.kernel.org Cc: David Woodhouse , Linus Walleij , Rob Herring Subject: [PATCH 1/2] power/reset: versatile: support the actual versatile Date: Mon, 25 Jan 2016 09:29:53 +0100 Message-Id: <1453710593-14189-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While this driver is named after the Versatile family of boards (ARM reference designs) the machine actually called Versatile was not supported. This patch makes the driver handle also that machine. We augment the register names for the reset to *VERSATILE* as well since it is the same register offsets for Versatile and RealView. Cc: Rob Herring Signed-off-by: Linus Walleij --- Hi Power folks, since this is orthogonal to the corresponding device tree changes it's best of this is just merged into the power tree and I'll merge the required device tree and board file changes into the ARM SoC tree. --- drivers/power/reset/arm-versatile-reboot.c | 39 +++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 12 deletions(-) -- 2.4.3 diff --git a/drivers/power/reset/arm-versatile-reboot.c b/drivers/power/reset/arm-versatile-reboot.c index b208073c887d..06d34ab47df5 100644 --- a/drivers/power/reset/arm-versatile-reboot.c +++ b/drivers/power/reset/arm-versatile-reboot.c @@ -18,8 +18,8 @@ #define INTEGRATOR_HDR_LOCK_OFFSET 0x14 #define INTEGRATOR_CM_CTRL_RESET (1 << 3) -#define REALVIEW_SYS_LOCK_OFFSET 0x20 -#define REALVIEW_SYS_RESETCTL_OFFSET 0x40 +#define VERSATILE_SYS_LOCK_OFFSET 0x20 +#define VERSATILE_SYS_RESETCTL_OFFSET 0x40 /* Magic unlocking token used on all Versatile boards */ #define VERSATILE_LOCK_VAL 0xA05F @@ -29,6 +29,7 @@ */ enum versatile_reboot { INTEGRATOR_REBOOT_CM, + VERSATILE_REBOOT_CM, REALVIEW_REBOOT_EB, REALVIEW_REBOOT_PB1176, REALVIEW_REBOOT_PB11MP, @@ -46,6 +47,10 @@ static const struct of_device_id versatile_reboot_of_match[] = { .data = (void *)INTEGRATOR_REBOOT_CM }, { + .compatible = "arm,core-module-versatile", + .data = (void *)VERSATILE_REBOOT_CM, + }, + { .compatible = "arm,realview-eb-syscon", .data = (void *)REALVIEW_REBOOT_EB, }, @@ -82,33 +87,43 @@ static int versatile_reboot(struct notifier_block *this, unsigned long mode, INTEGRATOR_CM_CTRL_RESET, INTEGRATOR_CM_CTRL_RESET); break; + case VERSATILE_REBOOT_CM: + regmap_write(syscon_regmap, VERSATILE_SYS_LOCK_OFFSET, + VERSATILE_LOCK_VAL); + regmap_update_bits(syscon_regmap, + VERSATILE_SYS_RESETCTL_OFFSET, + 0x0107, + 0x0105); + regmap_write(syscon_regmap, VERSATILE_SYS_LOCK_OFFSET, + 0); + break; case REALVIEW_REBOOT_EB: - regmap_write(syscon_regmap, REALVIEW_SYS_LOCK_OFFSET, + regmap_write(syscon_regmap, VERSATILE_SYS_LOCK_OFFSET, VERSATILE_LOCK_VAL); regmap_write(syscon_regmap, - REALVIEW_SYS_RESETCTL_OFFSET, 0x0008); + VERSATILE_SYS_RESETCTL_OFFSET, 0x0008); break; case REALVIEW_REBOOT_PB1176: - regmap_write(syscon_regmap, REALVIEW_SYS_LOCK_OFFSET, + regmap_write(syscon_regmap, VERSATILE_SYS_LOCK_OFFSET, VERSATILE_LOCK_VAL); regmap_write(syscon_regmap, - REALVIEW_SYS_RESETCTL_OFFSET, 0x0100); + VERSATILE_SYS_RESETCTL_OFFSET, 0x0100); break; case REALVIEW_REBOOT_PB11MP: case REALVIEW_REBOOT_PBA8: - regmap_write(syscon_regmap, REALVIEW_SYS_LOCK_OFFSET, + regmap_write(syscon_regmap, VERSATILE_SYS_LOCK_OFFSET, VERSATILE_LOCK_VAL); - regmap_write(syscon_regmap, REALVIEW_SYS_RESETCTL_OFFSET, + regmap_write(syscon_regmap, VERSATILE_SYS_RESETCTL_OFFSET, 0x0000); - regmap_write(syscon_regmap, REALVIEW_SYS_RESETCTL_OFFSET, + regmap_write(syscon_regmap, VERSATILE_SYS_RESETCTL_OFFSET, 0x0004); break; case REALVIEW_REBOOT_PBX: - regmap_write(syscon_regmap, REALVIEW_SYS_LOCK_OFFSET, + regmap_write(syscon_regmap, VERSATILE_SYS_LOCK_OFFSET, VERSATILE_LOCK_VAL); - regmap_write(syscon_regmap, REALVIEW_SYS_RESETCTL_OFFSET, + regmap_write(syscon_regmap, VERSATILE_SYS_RESETCTL_OFFSET, 0x00f0); - regmap_write(syscon_regmap, REALVIEW_SYS_RESETCTL_OFFSET, + regmap_write(syscon_regmap, VERSATILE_SYS_RESETCTL_OFFSET, 0x00f4); break; }