From patchwork Thu Feb 8 05:37:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 870748 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zcRp32Dndz9t2f for ; Thu, 8 Feb 2018 16:39:07 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WH1GQCPJ"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zcRp30VT5zF15R for ; Thu, 8 Feb 2018 16:39:07 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WH1GQCPJ"; dkim-atps=neutral X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::243; helo=mail-pl0-x243.google.com; envelope-from=joel.stan@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WH1GQCPJ"; dkim-atps=neutral Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zcRmp6NSzzF17c for ; Thu, 8 Feb 2018 16:38:02 +1100 (AEDT) Received: by mail-pl0-x243.google.com with SMTP id 13-v6so1537487plb.5 for ; Wed, 07 Feb 2018 21:38:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Mg631pgN8w6ZU1/VUhMJsXM7cmzP86Ihc69UpeAeoTg=; b=WH1GQCPJ9iWMeWpdZjc1Wf7hkhCe5mQsCU/qJ3sdbZnvFS9YwEhr15alD6oAWTBTx0 TGgSJxhjWrhfoAlO5luVcUnD/NVzgXuY/VNXZAKYkAB58/c97SFX5zc384sVWLBRWUC3 T8/d705ipPWN8e8gxT5S6YWZOEDNVvUvuqWubX0E0PwQ8BOZ83Fztxaj5wUXLfpO2iE+ oQL6ISrJJd07jPkuaZ2y/fKOhE80npte5k0wLCyennHMOvWvbaf3HBDl4i2SDAVhDnMd 2YvP+MYBSVLqB9jgFos+Wnhz1lC3vDhTvPvgaBaOfhTlHE1OuJwQQHzT/3LAX+EIRlaq rzrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Mg631pgN8w6ZU1/VUhMJsXM7cmzP86Ihc69UpeAeoTg=; b=ACd5mQr0zBj4mYzNIvrds0v3+6JFJ4zMupE55R37tKLxm74YJOZHtGcKm+bhcO0bLO QMEQ5qDulol7I2PX39uxZy/SsWpHrEb3o1Ve02ySx6qbaiFgFY88LISMyiZue5X4+xk+ hz0hKmKyRAntq6vMFlb1TIQDErCtC8tmWpBGBe5bgWeqHDMXXGle+JOreoQxwxKEq022 Uo8ccO3zNOF18Z0JSuzjkPY64VgO1kFXpMM+jFXvbGJdALwdAMzXeJ5QouHeXF5178Jb ZrL9LIEjOEBs3jUjadN678nw81z8vjZYjYaAxdKUZ8PPcCtVBp+s7MvtBVXnbQhr2IPr y3xQ== X-Gm-Message-State: APf1xPCmldgoO8EYJwnEUyTrju+Ty+a5MQ5eY61h96EMn87j9aiJv9jm /DcKt8b57ZDkqqpNGxAmFmrwrIfN X-Google-Smtp-Source: AH8x224gIrBNLX192KpIANc3HvLwmIX/11T/PQHD6UdVQ5J581C52Pe4D3u3t2RuuNH5yIb5tX0q6Q== X-Received: by 2002:a17:902:b60b:: with SMTP id b11-v6mr8413805pls.210.1518068280121; Wed, 07 Feb 2018 21:38:00 -0800 (PST) Received: from aurora.jms.id.au ([203.0.153.9]) by smtp.gmail.com with ESMTPSA id c185sm7573964pfb.146.2018.02.07.21.37.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Feb 2018 21:37:59 -0800 (PST) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Thu, 08 Feb 2018 16:07:53 +1030 From: Joel Stanley To: openbmc@lists.ozlabs.org Subject: [PATCH linux dev-4.13 1/3] ARM: dts: aspeed: Add LPC clock phandles Date: Thu, 8 Feb 2018 16:07:43 +1030 Message-Id: <20180208053745.31254-2-joel@jms.id.au> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180208053745.31254-1-joel@jms.id.au> References: <20180208053745.31254-1-joel@jms.id.au> X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , Cyril Bur Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" The LPC device uses LCLK. Signed-off-by: Joel Stanley Reviewed-by: Andrew Jeffery --- arch/arm/boot/dts/aspeed-g4.dtsi | 1 + arch/arm/boot/dts/aspeed-g5.dtsi | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/aspeed-g4.dtsi b/arch/arm/boot/dts/aspeed-g4.dtsi index 1fb5b410917a..d697380f2f39 100644 --- a/arch/arm/boot/dts/aspeed-g4.dtsi +++ b/arch/arm/boot/dts/aspeed-g4.dtsi @@ -233,6 +233,7 @@ lpc_ctrl: lpc-ctrl@0 { compatible = "aspeed,ast2400-lpc-ctrl"; reg = <0x0 0x80>; + clocks = <&syscon ASPEED_CLK_GATE_LCLK>; status = "disabled"; }; diff --git a/arch/arm/boot/dts/aspeed-g5.dtsi b/arch/arm/boot/dts/aspeed-g5.dtsi index 77d6d98d24a0..89ef960c4ef3 100644 --- a/arch/arm/boot/dts/aspeed-g5.dtsi +++ b/arch/arm/boot/dts/aspeed-g5.dtsi @@ -283,6 +283,7 @@ lpc_ctrl: lpc-ctrl@0 { compatible = "aspeed,ast2500-lpc-ctrl"; reg = <0x0 0x80>; + clocks = <&syscon ASPEED_CLK_GATE_LCLK>; status = "disabled"; }; From patchwork Thu Feb 8 05:37:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 870749 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zcRpp5rY1z9t2f for ; Thu, 8 Feb 2018 16:39:46 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uz1Kdp0Z"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zcRpp39byzF17b for ; Thu, 8 Feb 2018 16:39:46 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uz1Kdp0Z"; dkim-atps=neutral X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::242; helo=mail-pl0-x242.google.com; envelope-from=joel.stan@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uz1Kdp0Z"; dkim-atps=neutral Received: from mail-pl0-x242.google.com (mail-pl0-x242.google.com [IPv6:2607:f8b0:400e:c01::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zcRmx2XQ1zF17Y for ; Thu, 8 Feb 2018 16:38:09 +1100 (AEDT) Received: by mail-pl0-x242.google.com with SMTP id f8-v6so1530934plk.11 for ; Wed, 07 Feb 2018 21:38:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=wbzyafGsH0Zt2dadXuSoP1bis2zIdmUwqKrzF296bG4=; b=uz1Kdp0ZiA4ZAOAtNFLQfPlXejLPHLekOj7pbE9O7jCiIgQRIOKwXnzDQMPMXRiEBW iEPWPygMgHjf6Z2NwiNvy6Mwb/uA6YMZ9CINu7m+crPKbjxGv5x20kx/Jpd5/S5rR1Dm 4uu09+n8gebORIdFZGlIID7JQv8VPD6qZVMg/mx5RUy8goQveX1eTS/gpbC7ew0BKYgI ZKExBH81pCg4AALPEv3mw0fmuvZE9U4Jl6wyU+nEQx7KGbbfzPW3aifYZybfcVQswE5J asJ0hD90PEDsLP7gVSDKCARBsH+eZfRzeGrWoumHYLZSqGl1vW1wYMzl43NsH6FbjDaj ZK5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=wbzyafGsH0Zt2dadXuSoP1bis2zIdmUwqKrzF296bG4=; b=eHjFsZcaUq9+zMRlbHDAD/C2SaIg6ix9ihTTHwAoRcsI7qWx7/+z8QmXahOlyGnSji eucz8qK8R/3YnKsVIQt9rs1vUSSzGntwM8Ct4B48cpei+IcJfCpijNKsKe0ETIerdBxn vihmrZeuAZG0WboOZoZE3kIhiQSdpUGgmqo+gmjeLrBoqpWWX/QmyCy2s4DB7rWXCW29 4HJZNxkkkDWvwPDIzvChqun8K6NCNpKZ59qzFbbw+1A2x7EUQ/GYbkTCgENVaJpp04XB B7iYsOiplPEEYw/8O9H+tf1JM+HuHiRnnViPONiDJPkoK55imkbrctemJ68qdRYW6SyH TKVA== X-Gm-Message-State: APf1xPBe+bQLAMYlE7ldMkQ0ZhyKPj67qGMKW3e2HHnTZcPs567JaNNP 32nnI1jPVeCfoSSAZyMrepxRRc0u X-Google-Smtp-Source: AH8x227ZceSx62eiO72n1f8VjvsJkqsOZ7Geh5/w7FxcjWL6DbZV/0NIOXqSh35QTQhEVbM+VmYq1g== X-Received: by 2002:a17:902:64d6:: with SMTP id y22-v6mr8483804pli.444.1518068286883; Wed, 07 Feb 2018 21:38:06 -0800 (PST) Received: from aurora.jms.id.au ([203.0.153.9]) by smtp.gmail.com with ESMTPSA id c8sm7125764pfm.130.2018.02.07.21.38.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Feb 2018 21:38:06 -0800 (PST) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Thu, 08 Feb 2018 16:08:00 +1030 From: Joel Stanley To: openbmc@lists.ozlabs.org Subject: [PATCH linux dev-4.13 2/3] misc: aspeed-lpc: Enable clock Date: Thu, 8 Feb 2018 16:07:44 +1030 Message-Id: <20180208053745.31254-3-joel@jms.id.au> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180208053745.31254-1-joel@jms.id.au> References: <20180208053745.31254-1-joel@jms.id.au> X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , Cyril Bur Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" The LPC device needs to ensure it's clock is enabled before it can do anything. Signed-off-by: Joel Stanley Reviewed-by: Andrew Jeffery --- drivers/misc/aspeed-lpc-ctrl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/misc/aspeed-lpc-ctrl.c b/drivers/misc/aspeed-lpc-ctrl.c index b5439643f54b..4a818ad3827e 100644 --- a/drivers/misc/aspeed-lpc-ctrl.c +++ b/drivers/misc/aspeed-lpc-ctrl.c @@ -7,6 +7,7 @@ * 2 of the License, or (at your option) any later version. */ +#include #include #include #include @@ -26,6 +27,7 @@ struct aspeed_lpc_ctrl { struct miscdevice miscdev; struct regmap *regmap; + struct clk *clk; phys_addr_t mem_base; resource_size_t mem_size; u32 pnor_size; @@ -180,6 +182,17 @@ static int aspeed_lpc_ctrl_probe(struct platform_device *pdev) if (!lpc_ctrl) return -ENOMEM; + lpc_ctrl->clk = devm_clk_get(dev, NULL); + if (IS_ERR(lpc_ctrl->clk)) { + dev_err(dev, "couldn't get clock\n"); + return PTR_ERR(lpc_ctrl->clk); + } + rc = clk_prepare_enable(lpc_ctrl->clk); + if (rc) { + dev_err(dev, "couldn't enable clock\n"); + return rc; + } + node = of_parse_phandle(dev->of_node, "flash", 0); if (!node) { dev_err(dev, "Didn't find host pnor flash node\n"); @@ -239,6 +252,7 @@ static int aspeed_lpc_ctrl_remove(struct platform_device *pdev) struct aspeed_lpc_ctrl *lpc_ctrl = dev_get_drvdata(&pdev->dev); misc_deregister(&lpc_ctrl->miscdev); + clk_disable_unprepare(lpc_ctrl->clk); return 0; } From patchwork Thu Feb 8 05:37:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 870750 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zcRqZ6Q8vz9t2f for ; Thu, 8 Feb 2018 16:40:26 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="C2/p6Psb"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zcRqZ4c0wzF12V for ; Thu, 8 Feb 2018 16:40:26 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="C2/p6Psb"; dkim-atps=neutral X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c00::243; helo=mail-pf0-x243.google.com; envelope-from=joel.stan@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="C2/p6Psb"; dkim-atps=neutral Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zcRn34X6vzF17f for ; Thu, 8 Feb 2018 16:38:15 +1100 (AEDT) Received: by mail-pf0-x243.google.com with SMTP id w83so1343908pfi.12 for ; Wed, 07 Feb 2018 21:38:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Y/EGYfzR0yUElDYex4MZhp0kO66LybID4+bmxILOiiI=; b=C2/p6PsbEIqH59XMvF46PZkPguidPcmTeLvP/Doik9d/u+u6xqd0nwX3+zTo0iPT3Q tmtLLOn0thhiO+uA/m0PL5q5p/mjCQdO++UaAYz5CzybBTxz2FHNiOOnPtRmqKVH9V87 3pJiTjTZfeTPa7kyDvW/tdMMZrmp1utmTQ17ySOTMrisvA2F0a5Ay+oosKhzfvmplBpe N223NJOoQsMpm+OwQGkyyoadukSPT+OoshmpK/3Kc6iA0xbPch32g6yQG1WD7yPJqrkC nAPDeYUFnFJ2z84gpt1PhhSzp+kwk+0MQRLdLI9gJtqPiDB4uQc5MIvAegmWscyHrQKU q29g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Y/EGYfzR0yUElDYex4MZhp0kO66LybID4+bmxILOiiI=; b=OeaEDdRrzItSL/VAcPIPmtFj2958vyaxrSFUmqp0J6YcwokBKMQ58IG1873aBZ/EvT U9VU1mv6OrZ09meHaVRflPKguBui9WC9w/Zv1Uls0IflAs8QnnzkXcKshIqo4B0UDZ5Y UvS1851mJtTH8Jd+81QJlvQBhKN9/LLUqx6phESdO9DkgBm85TSnZ28TWE8p/zYLuRHs vivv+XEJZ6ge4iAH84t9uMHtySZxLeOBnLUZUUyVLo0OCsGJmVNWiiH+KQ6+TwFCGvBy lZZ9SJIau434ezFBP4sByzkixJRvUwfS+lLavWhA0SewbpV80qwDsldDZFoKpCmyz3Fq 77TQ== X-Gm-Message-State: APf1xPBkfBih9B/aeYVkGQ54U6rBn6+U1jMmXcAIH+TFN/m+OfBJi3Ng xbs64IZ90CzzmnTyXJQ3rlAyQxeL X-Google-Smtp-Source: AH8x227cLN9vh+8isxFQNE6m1VYxcLOhmn978unre+70AIRjryGcA+n5yXA6pQyrc16SEBv2Va27Jw== X-Received: by 10.99.110.10 with SMTP id j10mr6811069pgc.72.1518068293497; Wed, 07 Feb 2018 21:38:13 -0800 (PST) Received: from aurora.jms.id.au ([203.0.153.9]) by smtp.gmail.com with ESMTPSA id x185sm6968501pfd.186.2018.02.07.21.38.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Feb 2018 21:38:12 -0800 (PST) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Thu, 08 Feb 2018 16:08:07 +1030 From: Joel Stanley To: openbmc@lists.ozlabs.org Subject: [PATCH linux dev-4.13 3/3] soc: aspeed-lpc-ctrl: Enable FWH cycles Date: Thu, 8 Feb 2018 16:07:45 +1030 Message-Id: <20180208053745.31254-4-joel@jms.id.au> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180208053745.31254-1-joel@jms.id.au> References: <20180208053745.31254-1-joel@jms.id.au> X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , Cyril Bur Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" To date this driver has relied on prevous BMC state in order to have the host be able to access data over the LPC bus. Now we explicitly enable the FWH cycles from when the user first configures the address to map. We chose to do this then as before that time there is no way for the kernel to know where it is safe to point the LPC window. Signed-off-by: Joel Stanley --- drivers/misc/aspeed-lpc-ctrl.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/misc/aspeed-lpc-ctrl.c b/drivers/misc/aspeed-lpc-ctrl.c index 4a818ad3827e..21b4ee9d0a38 100644 --- a/drivers/misc/aspeed-lpc-ctrl.c +++ b/drivers/misc/aspeed-lpc-ctrl.c @@ -21,6 +21,10 @@ #define DEVICE_NAME "aspeed-lpc-ctrl" +#define HICR5 0x0 +#define HICR5_ENL2H BIT(8) +#define HICR5_ENFWH BIT(10) + #define HICR7 0x8 #define HICR8 0xc @@ -155,8 +159,17 @@ static long aspeed_lpc_ctrl_ioctl(struct file *file, unsigned int cmd, if (rc) return rc; - return regmap_write(lpc_ctrl->regmap, HICR8, - (~(map.size - 1)) | ((map.size >> 16) - 1)); + rc = regmap_write(lpc_ctrl->regmap, HICR8, + (~(map.size - 1)) | ((map.size >> 16) - 1)); + if (rc) + return rc; + + /* + * Enable LPC FHW cycles. This is required for the host to + * access the regions specified. + */ + return regmap_update_bits(lpc_ctrl->regmap, HICR5, + HICR5_ENFWH, HICR5_ENFWH); } return -EINVAL;