Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4762874imm; Mon, 18 Jun 2018 22:41:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKO69F+jO11x/HgA1Y52hM8SEXJmkQoAoC1xuxPF6iNuwyqDDaUbYIHpOnONJ3E9bSVfrKt X-Received: by 2002:a65:5ac9:: with SMTP id d9-v6mr13539596pgt.238.1529386873748; Mon, 18 Jun 2018 22:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529386873; cv=none; d=google.com; s=arc-20160816; b=Zx+dn7ww0yeeGjrIGRSQT6zw1VahN0i5BvLs9mYHU8BMzY/SwTQdJyJyR/ECNmkro3 oeXBzXOXExMvZVZFkWnGTxEm6wsHTSRO22Z2I5zr5ss/Js4V47T+Kr1KgcgvetqRvIit vJVXCU10fSEOgPw97271XM5ED4tCGHX6AH5+N6Vgj9Xw32cEsdtZd5a1LbuDGxYM4RPw G2BaF6NWXGqMmP8cpihVH9iZZfv9TP20/2Dm5rLcbhmkuSe+qLw8yUfg2wWAJMPFtOxF BTUhm52tpoahgPWiVhmZ6vwfCQ547a8LzEueEQXsNlX/lXbLy4HgMCHwJrMHiis9kKys c+TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=GcvbaWlm4aYQ0/H4BOPY/9fEXO3nWJgnam69r9FcIxc=; b=Xhvg7vCC5WYSOKdOsIciVpm8iI2hMXfB3XSlMHjSdU3trAmMIBoFZ4uDbSa/IsAdDx +uGfSnINlGRz+zlpuZdoTAESUM7H87xPiZs1dWPCh5wchMVdGbGpPKGL7gsIj4G+E1qP KeHk7xwbYrmlfYaUadSzezFo9FA4zioj1Po3UME2tHWQzwMEWEEOLC4W9YCTmO6OVT0F 1ctivhf4f5VV7w9qSAEue0Oy+5xgyDFbz8Ow5cQ21y4CGMucqbsf49C+tutwfrVa+jmz rxBhKM2b0aLouu3bv0nOGcsUJt4QIu8Qaad5L9uDhTMBWwDzdGOipAOcOnN0pR0hZ/PQ VwJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=L8KqHwVe; dkim=pass header.i=@codeaurora.org header.s=default header.b=i4bsOKxU; 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 n15-v6si14308754pgf.45.2018.06.18.22.41.00; Mon, 18 Jun 2018 22:41:13 -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=@codeaurora.org header.s=default header.b=L8KqHwVe; dkim=pass header.i=@codeaurora.org header.s=default header.b=i4bsOKxU; 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 S965311AbeFSFjw (ORCPT + 99 others); Tue, 19 Jun 2018 01:39:52 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:58080 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964895AbeFSFjt (ORCPT ); Tue, 19 Jun 2018 01:39:49 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3F74160B23; Tue, 19 Jun 2018 05:39:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1529386788; bh=md5kESCjcLlRwmzrmU7heBVE64YZNDLtpAm/+EmX98o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L8KqHwVe/FQEKRUUQ3gmrT58WYCWoYim63TS8b8/E5KGfe5b4ULZZCwB2+GZAjzk7 HykxI/4eZ405Q098tvk3aogh+f9QcoYRB4rgtch43gMb9p/Q6q58UPcWUYyB3NQXmi 2qnwxH2+yCZt4T5Fgml/1ndFuV+he362m3WbEZoQ= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from hydcbspbld03.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vviswana@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id D123C60B22; Tue, 19 Jun 2018 05:39:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1529386787; bh=md5kESCjcLlRwmzrmU7heBVE64YZNDLtpAm/+EmX98o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i4bsOKxUt0+pvFbLpyZu1Yhp4kq0Znp8qjBfDGl/E4Ij3zY9ci0IXQbNxAovNyNjH EKQnSqfXEi920tq9l7GTCBQgZn2wl4+hjFiPNVvWedR7ZTpZSkkSj6ox89KTBKmpVk PxrsqP9cULdDypHncmmcxCk1uzmowFFDKOVO5MWY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D123C60B22 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vviswana@codeaurora.org From: Vijay Viswanath To: adrian.hunter@intel.com, ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, shawn.lin@rock-chips.com, linux-arm-msm@vger.kernel.org, georgi.djakov@linaro.org, devicetree@vger.kernel.org, asutoshd@codeaurora.org, stummala@codeaurora.org, venkatg@codeaurora.org, jeremymc@redhat.com, vviswana@codeaurora.org, bjorn.andersson@linaro.org, riteshh@codeaurora.org, vbadigan@codeaurora.org, dianders@google.com, sayalil@codeaurora.org Subject: [PATCH V3 1/4] mmc: sdhci-msm: Define new Register address map Date: Tue, 19 Jun 2018 11:09:18 +0530 Message-Id: <1529386761-4923-2-git-send-email-vviswana@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1529386761-4923-1-git-send-email-vviswana@codeaurora.org> References: <1529386761-4923-1-git-send-email-vviswana@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sayali Lokhande For SDCC version 5.0.0, MCI registers are removed from SDCC interface and some registers are moved to HC. Define a new data structure where we can statically define the address offsets for the registers in different SDCC versions. Signed-off-by: Sayali Lokhande Signed-off-by: Vijay Viswanath Reviewed-by: Evan Green Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-msm.c | 89 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index bb11916..4050c99 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -137,6 +137,95 @@ /* Timeout value to avoid infinite waiting for pwr_irq */ #define MSM_PWR_IRQ_TIMEOUT_MS 5000 +struct sdhci_msm_offset { + u32 core_hc_mode; + u32 core_mci_data_cnt; + u32 core_mci_status; + u32 core_mci_fifo_cnt; + u32 core_mci_version; + u32 core_generics; + u32 core_testbus_config; + u32 core_testbus_sel2_bit; + u32 core_testbus_ena; + u32 core_testbus_sel2; + u32 core_pwrctl_status; + u32 core_pwrctl_mask; + u32 core_pwrctl_clear; + u32 core_pwrctl_ctl; + u32 core_sdcc_debug_reg; + u32 core_dll_config; + u32 core_dll_status; + u32 core_vendor_spec; + u32 core_vendor_spec_adma_err_addr0; + u32 core_vendor_spec_adma_err_addr1; + u32 core_vendor_spec_func2; + u32 core_vendor_spec_capabilities0; + u32 core_ddr_200_cfg; + u32 core_vendor_spec3; + u32 core_dll_config_2; + u32 core_ddr_config; + u32 core_ddr_config_2; +}; + +static const struct sdhci_msm_offset sdhci_msm_v5_offset = { + .core_mci_data_cnt = 0x35c, + .core_mci_status = 0x324, + .core_mci_fifo_cnt = 0x308, + .core_mci_version = 0x318, + .core_generics = 0x320, + .core_testbus_config = 0x32c, + .core_testbus_sel2_bit = 3, + .core_testbus_ena = (1 << 31), + .core_testbus_sel2 = (1 << 3), + .core_pwrctl_status = 0x240, + .core_pwrctl_mask = 0x244, + .core_pwrctl_clear = 0x248, + .core_pwrctl_ctl = 0x24c, + .core_sdcc_debug_reg = 0x358, + .core_dll_config = 0x200, + .core_dll_status = 0x208, + .core_vendor_spec = 0x20c, + .core_vendor_spec_adma_err_addr0 = 0x214, + .core_vendor_spec_adma_err_addr1 = 0x218, + .core_vendor_spec_func2 = 0x210, + .core_vendor_spec_capabilities0 = 0x21c, + .core_ddr_200_cfg = 0x224, + .core_vendor_spec3 = 0x250, + .core_dll_config_2 = 0x254, + .core_ddr_config = 0x258, + .core_ddr_config_2 = 0x25c, +}; + +static const struct sdhci_msm_offset sdhci_msm_mci_offset = { + .core_hc_mode = 0x78, + .core_mci_data_cnt = 0x30, + .core_mci_status = 0x34, + .core_mci_fifo_cnt = 0x44, + .core_mci_version = 0x050, + .core_generics = 0x70, + .core_testbus_config = 0x0cc, + .core_testbus_sel2_bit = 4, + .core_testbus_ena = (1 << 3), + .core_testbus_sel2 = (1 << 4), + .core_pwrctl_status = 0xdc, + .core_pwrctl_mask = 0xe0, + .core_pwrctl_clear = 0xe4, + .core_pwrctl_ctl = 0xe8, + .core_sdcc_debug_reg = 0x124, + .core_dll_config = 0x100, + .core_dll_status = 0x108, + .core_vendor_spec = 0x10c, + .core_vendor_spec_adma_err_addr0 = 0x114, + .core_vendor_spec_adma_err_addr1 = 0x118, + .core_vendor_spec_func2 = 0x110, + .core_vendor_spec_capabilities0 = 0x11c, + .core_ddr_200_cfg = 0x184, + .core_vendor_spec3 = 0x1b0, + .core_dll_config_2 = 0x1b4, + .core_ddr_config = 0x1b8, + .core_ddr_config_2 = 0x1bc, +}; + struct sdhci_msm_host { struct platform_device *pdev; void __iomem *core_mem; /* MSM SDCC mapped address */ -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.