From patchwork Fri Jan 11 18:04:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1023712 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="DAbGB/wY"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43brQZ1v3bz9sDX for ; Sat, 12 Jan 2019 05:06:14 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id DC292C22218; Fri, 11 Jan 2019 18:05:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 24E52C221C6; Fri, 11 Jan 2019 18:04:56 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6A6A2C22220; Fri, 11 Jan 2019 18:04:53 +0000 (UTC) Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by lists.denx.de (Postfix) with ESMTPS id BFD93C221DE for ; Fri, 11 Jan 2019 18:04:50 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id b5so7089629plr.4 for ; Fri, 11 Jan 2019 10:04:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iRQDnlE+DNrIm/2YUMYPMORIBnw8OEEYi6L8wTPdl28=; b=DAbGB/wYfcSFhbpIcOoUtPrQ2trCQAbcCm8pxPVHM0gIWwSjm0bMqU2Jw2ek1ogYEt mjb5j+pHl6Ev91qEsMmornbnyJu9efvgc8zE1ZJM3P9SzAAMiXRhvW3dBPndmi8RtJcy cMehXckDnKgXTjDPsvsKt5kRmRK/krP+1leqU= 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=iRQDnlE+DNrIm/2YUMYPMORIBnw8OEEYi6L8wTPdl28=; b=WCFqXip3sUp4rrozNg0LY9AyjQify8IODocGwOapHT4MCeANoSAjr7covm8dsRb2bY JxenFItD4TKSdhOUKiChCUtbvfTHOTRcnKx7RT59RVmXotKafNvJ3D3+r7g8Lgenubx7 b7Q9pxuN1j5sz8qrpbo9s+q1p9EiDGvXX925IQOsbD+FWekbBgEMCu6r5XqGa9L3d1WH 3jBd2UnWNnEfurefMmRTZPiuQaTDQI4thMJPyH0StuW23SYIdcofthF2tN9aCOoDXg+v aGH33taFjmbsEQMkt9e3Xx5aPzMyq06nThKF0bq9NNNcJcr0a+21NoYpctvaYm0a/Zyz 63Fg== X-Gm-Message-State: AJcUukfxTF6Zr0iLTb3Il/NiIkgxtyDtza7y/AYnHODHfipvvYRqtkq3 UWr2W+3b9L6lkGzPaqQ0eCYhng== X-Google-Smtp-Source: ALg8bN5ufi8HDP0F/fE7Loy9m5ICx5U5l2LjRR9PAfY5LnJWUmnd4AHsA4OhhvKzduKYnMsztIrVmw== X-Received: by 2002:a17:902:a6:: with SMTP id a35mr15666086pla.201.1547229889400; Fri, 11 Jan 2019 10:04:49 -0800 (PST) Received: from localhost.localdomain ([49.206.202.55]) by smtp.gmail.com with ESMTPSA id 186sm156638146pga.36.2019.01.11.10.04.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Jan 2019 10:04:48 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Andre Przywara , Chen-Yu Tsai , Simon Glass , Tom Rini , u-boot@lists.denx.de, linux-sunxi@googlegroups.com, Priit Laes , linux-amarula@amarulasolutions.com Date: Fri, 11 Jan 2019 23:34:11 +0530 Message-Id: <20190111180414.1563-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190111180414.1563-1-jagan@amarulasolutions.com> References: <20190111180414.1563-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 4/7] mmc: sunxi: Add DM_MMC support for H6 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" Unlike other Allwinner SoC's, H6 comes with different clock and reset control offset values. So support them via driver data. Signed-off-by: Jagan Teki --- .../arm/include/asm/arch-sunxi/clock_sun50i_h6.h | 3 +++ drivers/mmc/sunxi_mmc.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h b/arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h index e36937059b..baf9b2e6e2 100644 --- a/arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h +++ b/arch/arm/include/asm/arch-sunxi/clock_sun50i_h6.h @@ -301,6 +301,9 @@ struct sunxi_ccm_reg { #define DRAM_CLK_SRC_PLL5 (0 << 24) #define DRAM_CLK_M(m) (((m)-1) << 0) +/* MMC ahb clock bit field */ +#define AHB_GATE_OFFSET_MMC(n) ((n)) + /* MMC clock bit field */ #define CCM_MMC_CTRL_M(x) ((x) - 1) #define CCM_MMC_CTRL_N(x) ((x) << 8) diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c index b50d70645a..05f15838a8 100644 --- a/drivers/mmc/sunxi_mmc.c +++ b/drivers/mmc/sunxi_mmc.c @@ -697,6 +697,14 @@ static const struct sunxi_mmc_variant sun7i_a20_variant = { .reset_start_bit = 8, }; +static const struct sunxi_mmc_variant sun50i_h6_variant = { + .has_reset = true, + .gate_offset = 0x84c, + .mclk_offset = 0x830, + .reset_offset = 0x84c, + .reset_start_bit = 16, +}; + static const struct udevice_id sunxi_mmc_ids[] = { { .compatible = "allwinner,sun4i-a10-mmc", @@ -722,6 +730,14 @@ static const struct udevice_id sunxi_mmc_ids[] = { .compatible = "allwinner,sun50i-a64-emmc", .data = (ulong)&sun7i_a20_variant, }, + { + .compatible = "allwinner,sun50i-h6-mmc", + .data = (ulong)&sun50i_h6_variant, + }, + { + .compatible = "allwinner,sun50i-h6-emmc", + .data = (ulong)&sun50i_h6_variant, + }, { /* sentinel */ } };