From patchwork Tue Jul 28 02:55:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 247205 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp150783ilg; Mon, 27 Jul 2020 19:55:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhzHRkILzC5DvooM0Y631Lz6llLSYSt0aZUvD3+BGEloKbHi9jnKL8aptTyLwfhTen2g7e X-Received: by 2002:a50:d8c2:: with SMTP id y2mr23899196edj.114.1595904953753; Mon, 27 Jul 2020 19:55:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595904953; cv=none; d=google.com; s=arc-20160816; b=KaFqa2dpHtSLC6G3+/4lS8cjREW38+a5zIMDcfZA33FmpRBFUR2ed7eC/RSN1SIiRP 2HDe3nnIZK6MFwOFcXoACl9Q8OIYhx9/s1/UxlRVgcYLbPkoTshaknRaD68zBovR/BnM vrR10MKJI25YLxvmqm8+cDF5kB4V44Hh/YWBaBxkWNSqRc1Ag76ZWqxLQPqIbsaGjESH kjuK9e9K00RdZ5QSUzZUGVxrnnZiMvnZV+mGqJHJFwqbdOmK/AfFjwSO0E1tmusnXzPo XL8X5wWY7J8FCrT0hxH1iprjvz4sU7nxqudwvl1XiLvWrFEL5JAeRkAZhUgpi4pTRnNr ujZQ== 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=LSKd0G5Txp3QCoH0wblOaMdjCRcT0SQZyQIDSr/GeGM=; b=paeyooyw1horkJFjbaWnp4pdqgt5LfkL7rehe8i9kW8JN/6mLlk/minbhwLU4KtK/7 6KC1Lcv2K747rv/S9vcUB3ABaiqIEwjZF1ztSP/2kRmJWrfLnEoUQIwqgxi9LDn4KLYW Jw5064D4IwGUC+txYd2hXnlqWUgpQ3fhI2cOh4Weh9t8aeh8JCal8kws2BKP0UdDsnFu woifXpaZGIT9faNxd491LbXjYZROmEeUMu+3U/kbjykyfYgXKY1YF6+A8yr0enhAGVdE ZYKDfQhrPR7z8Tg5Ax9jJbmcN9wvRKbJvMXE5iQ1sGi2HB0cpsYfZ6r1sFg184O4yJiN 3kdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ozzO8Eqz; 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.53; Mon, 27 Jul 2020 19:55:53 -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=ozzO8Eqz; 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 S1726826AbgG1Czx (ORCPT + 6 others); Mon, 27 Jul 2020 22:55:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726410AbgG1Czw (ORCPT ); Mon, 27 Jul 2020 22:55:52 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1AF3C061794 for ; Mon, 27 Jul 2020 19:55:52 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id f185so5209909pfg.10 for ; Mon, 27 Jul 2020 19:55:52 -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=LSKd0G5Txp3QCoH0wblOaMdjCRcT0SQZyQIDSr/GeGM=; b=ozzO8EqzqybbL7ON31QioltDqBbDlQAkv8dbA2uiGm7Z7h8yLUFqMHddmxSsQuoUIn twUEUjYyNeesMrtzbv/MqY5JKwjrwl3+zT3pPyHxH0lXBPMPG30ZxrqZA00Op3EapAST /H8gkAZhQKHzXg1uZSTC8cbadi/94tGJ3nMzpfXJMOSL59OHoBPU1RMLCUJk+uBQVDEu uBrkJyjBnn7kw3VCf/3qoh9kmEu9EOOc9lIzabEIdBeEO0Tpau2Zd5g3y2QikOgRzGID gqlnX9fKazhPZK28L+dPlLYEvm8wp4irfELCrzBXQhW/E+S2PFAoI0blh0617tUiPcha LhqA== 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=LSKd0G5Txp3QCoH0wblOaMdjCRcT0SQZyQIDSr/GeGM=; b=bsYpBApdZ/xrZFM6OBvzM25oFMqgXTWyiXK4HI5BHzQ4M+mwGsm50pMO5rkExsuy9P uEF4HIY4aco5xbhE2v2XUpSaZs0OTFDEXT4Y3MDVk0U4PRxbgwA+8BRyd/zV4iYSm6cl i/yUv+bTXIc6azHJnRaIciqkFwg9Y8nZwz+HXlJIl7/LNlvmVWUEQxSFlzeZt3WsQhdc MXldEmNoajNxn2Vj4gnkyvh7yZg1MSifxE3SCGxDjabBj5QeZwYsU/+pWmdzx3673s51 Ewi275CXFwBYx2pzw2PnDK5jZ5DwG5fuOwgdfcchf1rzV1aC1F+N1ZB3r1w7XDzbbfWC 3B2A== X-Gm-Message-State: AOAM530xs7WUaqNQdvBtgahKj3lYeSiQLUkiTcnwy0mXnyKqkZX/dhPZ uZaJCw75mT5pwJ6UETt30VA= X-Received: by 2002:a63:7cd:: with SMTP id 196mr22043450pgh.230.1595904952308; Mon, 27 Jul 2020 19:55:52 -0700 (PDT) Received: from localhost.localdomain ([45.124.203.15]) by smtp.gmail.com with ESMTPSA id w9sm15147407pfq.178.2020.07.27.19.55.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 19:55:51 -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 4/5] fsi: aspeed: Add module param for bus divisor Date: Tue, 28 Jul 2020 12:25:26 +0930 Message-Id: <20200728025527.174503-5-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 For testing and hardware debugging a user may wish to override the divisor at runtime. By setting fsi_master_aspeed.bus_div=N, the divisor will be set to N, if 0 < N <= 0x3ff. This is a module parameter and not a device tree option as it will only need to be set when testing or debugging. Reviewed-by: Eddie James Signed-off-by: Joel Stanley --- drivers/fsi/fsi-master-aspeed.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.27.0 diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c index f503f64ab32b..2531e826ba8b 100644 --- a/drivers/fsi/fsi-master-aspeed.c +++ b/drivers/fsi/fsi-master-aspeed.c @@ -87,6 +87,7 @@ static const u32 fsi_base = 0xa0000000; #define FSI_DIVISOR_DEFAULT 1 #define FSI_DIVISOR_CABLED 2 static u16 aspeed_fsi_divisor = FSI_DIVISOR_DEFAULT; +module_param_named(bus_div,aspeed_fsi_divisor, ushort, 0); #define OPB_POLL_TIMEOUT 10000 @@ -454,9 +455,12 @@ static int tacoma_cabled_fsi_fixup(struct device *dev) if (gpio) { /* * Cable signal integrity means we should run the bus - * slightly slower + * slightly slower. Do not override if a kernel param + * has already overridden. */ - aspeed_fsi_divisor = FSI_DIVISOR_CABLED; + if (aspeed_fsi_divisor == FSI_DIVISOR_DEFAULT) + aspeed_fsi_divisor = FSI_DIVISOR_CABLED; + gpiod_direction_output(mux_gpio, 0); dev_info(dev, "FSI configured for external cable\n"); } else {