Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp529994ybh; Thu, 12 Mar 2020 06:33:28 -0700 (PDT) X-Google-Smtp-Source: ADFU+vujDF1ezCVMPPAhRy/7srDT4HaGqNwYERUaEv3nKb3/56z07mAlzmuwzBAfMbDWD8V4BuVW X-Received: by 2002:aca:ea46:: with SMTP id i67mr2514776oih.149.1584020008326; Thu, 12 Mar 2020 06:33:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584020008; cv=none; d=google.com; s=arc-20160816; b=Ks2kVKaNCG4kklqNlN2U83qTBWWbeo+FDIU6+KP3pKvh/JrFTKxAuGkoqBsWfJ8rGA MMTb8pv4LKrrb3Zc40DtAccQDDlMHbHxUZzrF1OJjttRLXE5nXb2+oN4EQX3ut/ROI91 l4ovJW+egkaYGhRh399f6v7gvU6cTUuEp3LNwBuTu15b49+dy8CluI9d/v5dPBUIkFYT /jPznZYQXwec9uyE+nSqAenb+C27glCsbi7PiXrE0vHgm0v8swNAB+O13P4W2Sl2BELZ i/IgYVdNG9DH6iGBp+op5k6WjGiVCrjwmtU71qG1mmg7b46huu5w6SsvdCH0RscC7W5E 8+kA== 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=WSxwbrvkTLQhCnvQXX1HjNSZff7G2HPoi6i2nBxHFtc=; b=Tj3C2fxZRntlGBcCUnMT/uLuZYhBY5Y0TkuKlDoGjMEApx8mQ8d5x9lgdHntCthW4l XduApis/CSWMlAiOIsS6PwCCS4dsCMcgHgM4LzecPYzUkINCKj+wahZ/mGZLRS7148WI DBhLhFPPiI93+haHXFuSyT1364kwkcie/26++ixd64wMfhqVWSDvfKVk92KHrACgwpVS BNxeIo77GWkfgaTAGkqWiH7p4sQ46mhHBXqXucVRKKDplgMcvujCMHT7QnXbQRTIkZM2 zrx2DSx/0PNdfSWsTQydQqvjt4MB3BW3YMh+Q7HoCMxFD/NkJ9kpvhrNxwXkXEff7Sp5 7d1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=YulRMKVU; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g15si2917885otr.90.2020.03.12.06.33.15; Thu, 12 Mar 2020 06:33:28 -0700 (PDT) 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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=YulRMKVU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727447AbgCLNbn (ORCPT + 99 others); Thu, 12 Mar 2020 09:31:43 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:56103 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727426AbgCLNbl (ORCPT ); Thu, 12 Mar 2020 09:31:41 -0400 Received: by mail-wm1-f68.google.com with SMTP id 6so6100659wmi.5 for ; Thu, 12 Mar 2020 06:31:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WSxwbrvkTLQhCnvQXX1HjNSZff7G2HPoi6i2nBxHFtc=; b=YulRMKVUILMBNhdYGtTrxVJ+7BW7AY4paeNn1T/pfY9D9nSoD8fqGuY045sjsbxU5h hQ0pixA54oUGhTR0jYQB9S5danxRYtlzUqJyDZYZsoYUx0X+efvsf0OdsCg/D1aImZRN 8axNItGQjFv2xvXC8Z2fQbZQOC4Feqijr7BfKcZpHm6nbZIhiZ8Xuhyg4zw3/6UbsuAo KLt30d5dY5soGBfrQOsshd8nQwIvKOsYdwNkij/OGVux17s15SGHzo8bB+irZX4Mbg79 8GW8UhcUsBjWj1fWPAgTmfugsrl2NLfjlNX69Zxf2MqaT58r5tU81vWCQ+QNFl5x36Uj 1tiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WSxwbrvkTLQhCnvQXX1HjNSZff7G2HPoi6i2nBxHFtc=; b=tNcsdCjWYiuF1nxGdyBaqQy1R05knDIWsnzKdJWU0is8m1B4dYWnZ25dLssTmxPqgx T0gw9l+flWBqY/yqNeqB203sTN5D8efuHUoMUHFzh0GYJqGx1koppNe4UcujpU337C5b lTadOwaSRjXi17uOjD6RWti1YMwhgu/ydkUkWsXoRgOUlotXAJxecVRr80nx0UUgiIrz nPXlAoakvi/NnkRiRO7zfGbEWGF74KrXh7zhR1vurGGEYopFjDsGl4gV9XsrMNeK/JfJ F6xpxLb+KEJ4T4XTX/oT+62BVm/m6nk85xgs4Dh0cdtpWhBBtdIhEokpI6yaOnSW8m/c rD8Q== X-Gm-Message-State: ANhLgQ0xDEM0d34ERufRAsfoKE98Bbf2iuXerCmG4qECFhciCpj/CoE3 5UNxAWQDd2QkoVhyUN8SMDcnSw== X-Received: by 2002:a1c:1d15:: with SMTP id d21mr4854913wmd.101.1584019898516; Thu, 12 Mar 2020 06:31:38 -0700 (PDT) Received: from bender.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id m21sm12242885wmi.27.2020.03.12.06.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 06:31:37 -0700 (PDT) From: Neil Armstrong To: broonie@kernel.org Cc: Neil Armstrong , linux-spi@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sunny Luo , Yixun Lan Subject: [PATCH 4/9] spi: meson-spicc: support max 80MHz clock Date: Thu, 12 Mar 2020 14:31:26 +0100 Message-Id: <20200312133131.26430-5-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20200312133131.26430-1-narmstrong@baylibre.com> References: <20200312133131.26430-1-narmstrong@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The SPICC controller in Meson-AXG is capable of running at 80M clock. The ASIC IP is improved and the clock is actually running higher than previous old SoCs. Signed-off-by: Sunny Luo Signed-off-by: Yixun Lan Signed-off-by: Neil Armstrong --- drivers/spi/spi-meson-spicc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c index bd434d9055d9..710b4e780daa 100644 --- a/drivers/spi/spi-meson-spicc.c +++ b/drivers/spi/spi-meson-spicc.c @@ -35,7 +35,6 @@ * to have a CS go down over the full transfer */ -#define SPICC_MAX_FREQ 30000000 #define SPICC_MAX_BURST 128 /* Register Map */ @@ -132,6 +131,7 @@ #define SPICC_FIFO_HALF 10 struct meson_spicc_data { + unsigned int max_speed_hz; bool has_oen; bool has_enhance_clk_div; }; @@ -693,11 +693,9 @@ static int meson_spicc_probe(struct platform_device *pdev) master->transfer_one = meson_spicc_transfer_one; master->use_gpio_descriptors = true; - /* Setup max rate according to the Meson GX datasheet */ - if ((rate >> 2) > SPICC_MAX_FREQ) - master->max_speed_hz = SPICC_MAX_FREQ; - else - master->max_speed_hz = rate >> 2; + /* Setup max rate according to the Meson datasheet */ + master->max_speed_hz = min_t(unsigned int, rate >> 1, + spicc->data->max_speed_hz); meson_spicc_oen_enable(spicc); @@ -737,9 +735,11 @@ static int meson_spicc_remove(struct platform_device *pdev) } static const struct meson_spicc_data meson_spicc_gx_data = { + .max_speed_hz = 30000000, }; static const struct meson_spicc_data meson_spicc_axg_data = { + .max_speed_hz = 80000000, .has_oen = true, .has_enhance_clk_div = true, }; -- 2.22.0