From patchwork Tue Sep 14 18:19:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Fazio X-Patchwork-Id: 1528189 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=xes-inc.com header.i=@xes-inc.com header.a=rsa-sha256 header.s=mail header.b=IrC9ZPPm; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H8NR655HXz9svs for ; Wed, 15 Sep 2021 11:48:34 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B284180608; Wed, 15 Sep 2021 03:48:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xes-inc.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=xes-inc.com header.i=@xes-inc.com header.b="IrC9ZPPm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 03D4680612; Tue, 14 Sep 2021 20:19:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.xes-mad.com (mail.xes-mad.com [162.248.234.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 78E9D82999 for ; Tue, 14 Sep 2021 20:19:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=xes-inc.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=vfazio@xes-inc.com Received: from vfazio2.xes-mad.com (vfazio2.xes-mad.com [10.52.16.113]) by mail.xes-mad.com (Postfix) with ESMTP id 7D8F520253; Tue, 14 Sep 2021 13:19:35 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xes-inc.com; s=mail; t=1631643575; bh=KFmuBtAF52zehXuYmUpdEKrCLDMe9aHEEfbEgNXmvSI=; h=From:To:Cc:Subject:Date:From; b=IrC9ZPPmwu+ZABvoscpMmOMGN6CnsP0nRCvSIvqp4FSMiPV9eLKe+jN/uyKkfuPAn p9D1EbLLTa+lXfyQgZsT6ly9XL7uRq5cqe61wxGorUAUaF2UxJA3TcxM/GlTJgd4S4 OhPyZw680/kF0tBItm/N2Q02/1J8YCNtLxiSGDN4= From: Vincent Fazio To: u-boot@lists.denx.de Cc: Matthias Brugger , Jaehoon Chung , Peng Fan , Vincent Fazio Subject: [PATCH 0/2] mmc: bcm2835_sdhost: use fallback clock rate Date: Tue, 14 Sep 2021 13:19:17 -0500 Message-Id: <20210914181919.584951-1-vfazio@xes-inc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 15 Sep 2021 03:48:23 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Recent raspberry pi firmware has modified the behavior of GET_CLOCK_RATE to return zero (0) when there is no previous call to SET_CLOCK_RATE. This affects callers of bcm2835_get_mmc_clock and can lead to degraded MMC performance. Now, return the result of GET_MAX_CLOCK_RATE if GET_CLOCK_RATE is zero. Additionally, let the firmware manage SDCDIV when possible. Vincent Fazio (2): arm: rpi: fallback to max clock rate for MMC clock mmc: bcm2835-host: let firmware manage the clock divisor arch/arm/mach-bcm283x/include/mach/mbox.h | 18 ++++++++ arch/arm/mach-bcm283x/include/mach/msg.h | 10 +++++ arch/arm/mach-bcm283x/msg.c | 47 +++++++++++++++++++- drivers/mmc/bcm2835_sdhost.c | 53 ++++++++++++++--------- 4 files changed, 106 insertions(+), 22 deletions(-)