Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp926345imj; Sat, 9 Feb 2019 10:58:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ9VNyfcSizlKqBhcpahNgKMO+jL1Te05hzE7ivpI9Lv2YaYOsBTJ+myJ8U78uRhhei7pKi X-Received: by 2002:a17:902:6681:: with SMTP id e1mr11781227plk.98.1549738720841; Sat, 09 Feb 2019 10:58:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549738720; cv=none; d=google.com; s=arc-20160816; b=VuZ/I2+5iRysr/EAboB8i8E7f+c/ny5QTh4NHXGRKayS9z1k9DFug1xp31cPu4vlSf 4M1RYsrCukrygNMb+MIO7BIbhbSdfdtrEM3b/VuRgwYWj+Emce8J88LaDGQrVllfOBBR UZ5Un7xKwLBuu91RqBFpW05xmqv1sxsW1COcpnKRdl/UdMOUBNl1BpShebYxDlCIp70g 58EtdRfmUjpNsg/FL12Dq5F4dMV2g6DNnD1BXBTdVvHL5yZSK8Z6wwZt1J8ytAEJv9zq E03jObETiMGBtqqr4auugynMw2iZPywdhCyfHdJr9PQALBAYYzqMWdSTQ83Qso2lgHgj rT+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=goHu38Nw6roDmTqhjQLlPrTwNpJ+Mj1kubWerofccNc=; b=ybkMQih/GSoLQorGhZrC0mGPb0Ix2+vxLMQb4HNWKHBIawhuwgfXqovxrLytgNBV+e JI/GWQ2t53akHmXmTzIMNbeSDnJD/NpJeKadvg21Mycm93dLICubNeOabC8y8lBR+22W eMW8wuoAf+PL6UqfsWXCFG3lO1+F2CGLvQWh1eRHD4IktKH89tnTMcNFdaWe6nAFEqke M6HuvIGTC9Qtd+fOvsCJ3C8tAUlZdcbL3q2mVv3g4Ov3P/GYATay5RJVuSKyQ7lIKU/b B6Y1MfxFdvDU7TY48p/gBF69ltZuRvwvFf9x+Y/kl40bAfc7GHXqeJDDnkWWMCNoA4Oo vMNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SxwwkvdB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4si6249039pfg.280.2019.02.09.10.58.25; Sat, 09 Feb 2019 10:58:40 -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; dkim=pass header.i=@kernel.org header.s=default header.b=SxwwkvdB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727803AbfBIS5m (ORCPT + 99 others); Sat, 9 Feb 2019 13:57:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:60290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727308AbfBISrm (ORCPT ); Sat, 9 Feb 2019 13:47:42 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (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 ADD6221939; Sat, 9 Feb 2019 18:47:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549738062; bh=+AaSc3mP8aLvi3K6rcsiNSVM3WVxFfwC9zxuymUd+bI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SxwwkvdBvqWk/njTNZre/S9BUjY6kUZbmbkLBLeIXwsz9viIKrbWU64mTCogMZfAg AXLurTNUyeEe91O0i2OkHitgesnXxLOhGQsk+ifQhpMcX2pmPx/DVo8LPoBBRB+AMr WgB1rNeX1vGrReozl6XJVyo0AjN+gTAejATZ6xLk= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Biju Das , Simon Horman , Sasha Levin Subject: [PATCH AUTOSEL 4.20 06/42] soc: renesas: r8a774c0-sysc: Fix initialization order of 3DG-{A,B} Date: Sat, 9 Feb 2019 13:46:58 -0500 Message-Id: <20190209184734.125935-6-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190209184734.125935-1-sashal@kernel.org> References: <20190209184734.125935-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Biju Das [ Upstream commit a64597227d0de5610407fcc95dc835745a53f5d0 ] The workaround for the wrong hierarchy of the 3DG-{A,B} power domains on RZ/G2E ES1.0 corrected the parent domains. However, the 3DG-{A,B} power domains were still initialized and powered in the wrong order, causing 3DG operation to fail. Fix this by changing the order in the table at runtime, when running on an affected SoC. This work is based on the work done by Geert for R-Car E3. Fixes: f37d211c687588328 ("soc: renesas: rcar-sysc: Add r8a774c0 support") Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman Signed-off-by: Sasha Levin --- drivers/soc/renesas/r8a774c0-sysc.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/soc/renesas/r8a774c0-sysc.c b/drivers/soc/renesas/r8a774c0-sysc.c index e1ac4c0f6640..11050e17ea81 100644 --- a/drivers/soc/renesas/r8a774c0-sysc.c +++ b/drivers/soc/renesas/r8a774c0-sysc.c @@ -28,19 +28,6 @@ static struct rcar_sysc_area r8a774c0_areas[] __initdata = { { "3dg-b", 0x100, 1, R8A774C0_PD_3DG_B, R8A774C0_PD_3DG_A }, }; -static void __init rcar_sysc_fix_parent(struct rcar_sysc_area *areas, - unsigned int num_areas, u8 id, - int new_parent) -{ - unsigned int i; - - for (i = 0; i < num_areas; i++) - if (areas[i].isr_bit == id) { - areas[i].parent = new_parent; - return; - } -} - /* Fixups for RZ/G2E ES1.0 revision */ static const struct soc_device_attribute r8a774c0[] __initconst = { { .soc_id = "r8a774c0", .revision = "ES1.0" }, @@ -50,12 +37,10 @@ static const struct soc_device_attribute r8a774c0[] __initconst = { static int __init r8a774c0_sysc_init(void) { if (soc_device_match(r8a774c0)) { - rcar_sysc_fix_parent(r8a774c0_areas, - ARRAY_SIZE(r8a774c0_areas), - R8A774C0_PD_3DG_A, R8A774C0_PD_3DG_B); - rcar_sysc_fix_parent(r8a774c0_areas, - ARRAY_SIZE(r8a774c0_areas), - R8A774C0_PD_3DG_B, R8A774C0_PD_ALWAYS_ON); + /* Fix incorrect 3DG hierarchy */ + swap(r8a774c0_areas[6], r8a774c0_areas[7]); + r8a774c0_areas[6].parent = R8A774C0_PD_ALWAYS_ON; + r8a774c0_areas[7].parent = R8A774C0_PD_3DG_B; } return 0; -- 2.19.1