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: 247204 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp150763ilg; Mon, 27 Jul 2020 19:55:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbtvpoFwaAud5jgkQBcIb6iaLECbIPptT8zEKjA9LUcw/OAm2SE+9IaRNUpVc21GvcB2ay X-Received: by 2002:a17:906:c56:: with SMTP id t22mr24983121ejf.50.1595904949551; Mon, 27 Jul 2020 19:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595904949; cv=none; d=google.com; s=arc-20160816; b=WT0oBFtKL7AowgXite7D04R+KHR0ZNkdxkfGgAfW6E3c2yig8ACntDypAqFCe6ySkw B6aW7fpk/0PGKr8pa3bAQuzHe6aHidgfNPcLjgqgSzdzVjMJr9DnPZhuF7w0LRDzTkhg aDxn7KA12lmKFi68A8xYExOsXGzLw7wJ3ExkUTpnVtZOnjtfCoCRP8DHHIy7KgRGPDHW IqDvNwt1x8Q5S96OXbgHH1r835ufN01QC64Mpf+lD4hrfZPVKWMwhcLbfge/vPXpjUrK soxOCkS1F8P4WhduN1Kld0NkaSea8cY0O6R0VPUC4+ombox3aTUfdg7Mi6HMzqASdEi/ 0FGg== 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=etR2ncs18vgJbAdIWyCeb1uJq/TbjsZdQrwX72WYY3o=; b=TLW77AEmODZR2l6/c+v6l5/7RyXdppFyGx+cnvQyU2Lvt+23mn5OA3Zdw5Aoi091Kx eJBiiG8O6PgWXTL/OIMaotdV6aqrsL5fSR/vrIwVeO047e9TMSoazXvIweUI9BP/32bV vVm4Se/I6TwTGZc5AyFRY/SNc3d5BwUz/7QfsYU521iE5F0bLWKXPVwhbUQXJ011otsd e5tlQXIbnfcENlFu7Pq5rexgfzm5ptwKriN7DZeK0paxoWIZ1NJ1FupDl8jsYHPEcZNs FmQlPYh2EIIxNS4A5inlGysBYshaL3Bf/Kf2GovjyCGWJaGxVZqT0uQp178tCiU71zxR vEqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=KvkF5Wb4; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c26si6714678edy.599.2020.07.27.19.55.49; Mon, 27 Jul 2020 19:55:49 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=KvkF5Wb4; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbgG1Czt (ORCPT + 6 others); Mon, 27 Jul 2020 22:55:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726410AbgG1Czs (ORCPT ); Mon, 27 Jul 2020 22:55:48 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DC06C061794 for ; Mon, 27 Jul 2020 19:55:48 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id o13so11091722pgf.0 for ; Mon, 27 Jul 2020 19:55:48 -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=DeWsR0xTb208t1MfdZ7eMaydcvlLMcVUZINmdbB6hh76N7lMkZEyjjH9EbgEoTReh7 W5c9cF05WT8izq6CUtYWRaKIrWdTR6HywcWdOjf1gQPm6ShYficl4zMdIwiaZF7w2Y8u 34ORWhFa56jBxvSg2QC5BZeCrhPR0r+wI5++IlLfKA3gUAPW5rm9Lju0XqlKKPAZqB2V 6g0+fai5hOf34tXHnMmbemy7mS230i9xSnsmf8iGW7Zx3vLy0bY4x/3CNZxaGkWM5t/G Aqb4Z0zMWQ5LYllWAf51FZ/bqFc1LDZZWP3zEu84FU1GH/VOK+TdAuscXh3ClBWjZWPq FprA== X-Gm-Message-State: AOAM532gPCKT6faaYC75wKzZhJZU84MPN27PmCJAnngT1bA0tScYah/0 hSu2ryzCZFiavDBzkzPi7HkHnpRH83A= 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 Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Andrew Jeffery , Eddie James 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 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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(-) -- 2.27.0 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 {