From patchwork Tue Jul 28 02:55:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 11687937 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0BF5D912 for ; Tue, 28 Jul 2020 02:57:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D167C20825 for ; Tue, 28 Jul 2020 02:57:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aGSD5Dle"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KvkF5Wb4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D167C20825 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rdj1bGc/YEYo2dxXAESXj3hckhdr9gQ1ROfVHUEFhn4=; b=aGSD5Dle0pYTtga/27IrGR0WK a98E1xwJuQZHa/5hXsc7Hh5fX7re2vD4Z2h1iBb64bQ4VayNgwslK48bN8BFqON0eTAgNAeGoQDG8 O3p+o2/CZl49rRcmB+SihTAq8m9d6iH29+7/UuC+1OWDfh22hc2cwUlJur5HVtJ/3dyrITR+LnwG+ zT2nhLAKbKcDj/AqCl3PBVM6fteT5y3Gro9Rvj8DRIxm6aAdHYDLdOLiBL3+gJnuvuPTaD3t3Q0dm Q9/VNxYqYS81L0z+hfwjRYsDsM4o7MrAxvBCWnep2q1rY8PtMW3eYElRaAKhCIJiCyAu8YrEU4O5p vbiuG1eZw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0FmX-0003oZ-K3; Tue, 28 Jul 2020 02:55:57 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0FmQ-0003mV-7U for linux-arm-kernel@lists.infradead.org; Tue, 28 Jul 2020 02:55:51 +0000 Received: by mail-pg1-x544.google.com with SMTP id d4so11078184pgk.4 for ; Mon, 27 Jul 2020 19:55:49 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=etR2ncs18vgJbAdIWyCeb1uJq/TbjsZdQrwX72WYY3o=; b=KvkF5Wb4msJY05g+xyOomJxBfCmyXBjzZukMrcyHF3XWtg3jnGJuhFwC6qBmUquXiP QP4Fcx7xO7KtRj8f5akD29mJU4+M6DF/XJUE4CTVbpGe6p9VySOroq+AErRO/baRx5FW yNqnJlDMT8RaP9+7ci1OU1IHk/Yi+5kMOVxSzA8Cz7/O+zdUHTv/tZE71tE/2zoZ6e3S CMZ7rsG5Xuq9QUp75Ompge6vanhjHbE4+pb30tvJqGrKzBnHbcvz+mwKAUc02APecPbk pYsMM5L3fI5ujcccmgTzF8RvdJwXuD666JjFKHHbo5t7aqlURwXFi3tgPtvpfYuhkBKc weXg== 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:mime-version:content-transfer-encoding; bh=etR2ncs18vgJbAdIWyCeb1uJq/TbjsZdQrwX72WYY3o=; b=R/2VBYNHCQNZW3Y/0lK9h0SCynG2Kc08BllsIOzE3cZ+LKDr6LF7Vf9jnl23dYYE29 aY+WCt8+YmCjUF31teRAOWP4gtzDtwlERJM9fvk99AeHpCGkb1nWDurC0kASTpQoj3N6 tQUoilqHSi0Bgo2ofjzDKgPRXgQ/DcRoYjvAzfazg56eZrSvKb48T+gX2E91EIpm1H2n FjLT0axKk1mNuNdeR1ugFXjYLslZHT6A+Wnt7Flsi2WdQI7ZoRixZWzKTVtvIrji1L/9 e0QLppX5TrLptIIHNSvhTC6imW6JWQww/FrWumowLz/2+oTC/kYmloQq4fL3phiLl4pm x/5A== X-Gm-Message-State: AOAM531ywgiaYIbzsfT1N+EzEA+QhnSbJrQ5qbywjZKCOdxUG9PgBR+b dxaGl/oq9qOYQPL8G7PKzNw= X-Google-Smtp-Source: ABdhPJyqEI/lCzk4+OYvmGLKS68lPcaaIcW1M8qCySclFW71gCmiH/TXMYjvFFsY+PUkox3lfB21Tw== X-Received: by 2002:a65:4549:: with SMTP id x9mr21970729pgr.415.1595904948210; Mon, 27 Jul 2020 19:55:48 -0700 (PDT) Received: from localhost.localdomain ([45.124.203.15]) by smtp.gmail.com with ESMTPSA id w9sm15147407pfq.178.2020.07.27.19.55.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 19:55:47 -0700 (PDT) From: Joel Stanley To: linux-fsi@lists.ozlabs.org, Rob Herring Subject: [PATCH 3/5] fsi: aspeed: Run the bus at maximum speed Date: Tue, 28 Jul 2020 12:25:25 +0930 Message-Id: <20200728025527.174503-4-joel@jms.id.au> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200728025527.174503-1-joel@jms.id.au> References: <20200728025527.174503-1-joel@jms.id.au> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200727_225550_340198_1349EBCE X-CRM114-Status: GOOD ( 16.24 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [joel.stan[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , devicetree@vger.kernel.org, Eddie James , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Testing of Tacoma has shown that the ASPEED master can be run at maximum speed. The exception is when wired externally with a cable, in which case we use a divisor of two to ensure reliable operation. Reviewed-by: Eddie James Signed-off-by: Joel Stanley --- drivers/fsi/fsi-master-aspeed.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c index c282de76e6e7..f503f64ab32b 100644 --- a/drivers/fsi/fsi-master-aspeed.c +++ b/drivers/fsi/fsi-master-aspeed.c @@ -83,7 +83,11 @@ static const u32 fsi_base = 0xa0000000; #define FSI_LINK_ENABLE_SETUP_TIME 10 /* in mS */ -#define DEFAULT_DIVISOR 14 +/* Run the bus at maximum speed by default */ +#define FSI_DIVISOR_DEFAULT 1 +#define FSI_DIVISOR_CABLED 2 +static u16 aspeed_fsi_divisor = FSI_DIVISOR_DEFAULT; + #define OPB_POLL_TIMEOUT 10000 static int __opb_write(struct fsi_master_aspeed *aspeed, u32 addr, @@ -385,9 +389,11 @@ static int aspeed_master_init(struct fsi_master_aspeed *aspeed) opb_writel(aspeed, ctrl_base + FSI_MECTRL, reg); reg = cpu_to_be32(FSI_MMODE_ECRC | FSI_MMODE_EPC | FSI_MMODE_RELA - | fsi_mmode_crs0(DEFAULT_DIVISOR) - | fsi_mmode_crs1(DEFAULT_DIVISOR) + | fsi_mmode_crs0(aspeed_fsi_divisor) + | fsi_mmode_crs1(aspeed_fsi_divisor) | FSI_MMODE_P8_TO_LSB); + dev_info(aspeed->dev, "mmode set to %08x (divisor %d)\n", + be32_to_cpu(reg), aspeed_fsi_divisor); opb_writel(aspeed, ctrl_base + FSI_MMODE, reg); reg = cpu_to_be32(0xffff0000); @@ -446,6 +452,11 @@ static int tacoma_cabled_fsi_fixup(struct device *dev) /* If the routing GPIO is high we should set the mux to low. */ if (gpio) { + /* + * Cable signal integrity means we should run the bus + * slightly slower + */ + aspeed_fsi_divisor = FSI_DIVISOR_CABLED; gpiod_direction_output(mux_gpio, 0); dev_info(dev, "FSI configured for external cable\n"); } else {