From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753230AbcEWIBQ (ORCPT ); Mon, 23 May 2016 04:01:16 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:48780 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752936AbcEWIBO (ORCPT ); Mon, 23 May 2016 04:01:14 -0400 Subject: Re: [RFC PATCH 2/3] mmc: host: omap_hsmmc: Enable ADMA2 To: Felipe Balbi , Tony Lindgren , Peter Ujfalusi References: <1463561115-31798-1-git-send-email-kishon@ti.com> <1463561115-31798-3-git-send-email-kishon@ti.com> <20160518193028.GT5995@atomide.com> <0d463add-9fa5-a768-2ba6-34c4126c7817@ti.com> <20160519145745.GU5995@atomide.com> <87shxdlws6.fsf@linux.intel.com> <5742A189.4060803@ti.com> <874m9pgs2p.fsf@linux.intel.com> CC: , , , , , , , , , , , , , , From: Kishon Vijay Abraham I Message-ID: <5742B892.2070904@ti.com> Date: Mon, 23 May 2016 13:30:18 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <874m9pgs2p.fsf@linux.intel.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Felipe, On Monday 23 May 2016 12:48 PM, Felipe Balbi wrote: > > Hi Kishon, > > Kishon Vijay Abraham I writes: >> Hi Felipe, >> >> On Friday 20 May 2016 12:06 AM, Felipe Balbi wrote: >>> >>> Hi, >>> >>> Tony Lindgren writes: >>>> * Peter Ujfalusi [160519 01:10]: >>>>> On 05/18/2016 10:30 PM, Tony Lindgren wrote: >>>>>> Ideally the adma support would be a separate loadable module, >>>>>> similar how the cppi41dma is a child of the OTG controller. >>>>> >>>>> The Master DMA is part of the hsmmc IP block. If the same ADMA module is >>>>> present on other IPs it might be beneficial to have a helper library to handle >>>>> it (allocating the descriptor pool, wrinting, updating descriptors, etc). >>>> >>>> OK. Yeah if it's part of the MMC controller it makes no sense to >>>> separate it. So then the conecrns are using alternate DMA >>>> implementations and keeping PM runtime working :) >>>> >>>> BTW, Felipe mentioned that the best thing to do in the long run would >>>> be to set up sdhci-omap.c operating in ADMA mode. >>>> >>>> Felipe, care to summarize what you had in mind? >>> >>> yeah, just write a new sdhci-omap.c to start moving away from >>> omap-hsmmc.c, just like it was done for 8250-omap. >>> >>> At the beginning, it could be just the bare minimum to get it working >>> and slowly move over stuff like pm runtime, dmaengine, PIO. Move more >>> platforms over to that driver and, eventually, get rid of omap-hsmmc.c >>> altogether. >>> >>> That way, development can be focussed on generic layers (SDHCI) to which >>> OMAP MMC controller is compliant (apart from the VERSION register >>> quirk). >> >> About an year back, when I tried using SDHCI for OMAP I ran into >> issues and was not able to get it working. IIRC SDHCI_PRESENT_STATE >> (or OMAP_HSMMC_PSTATE) was not showing the correct state for card >> present and is unable to raise an interrupt when a card is inserted. I >> didn't debug this further. > > I'd say this is a bug in hsmmc. I remember seeing some bits in some > TI-specific register (before SDHCI address space starts) which can be > used to keep parts of SDHCI powered on exactly so normal WP and CD pins > work as expected. > > In any case, adding support for GPIO-based card detect to generic SDHCI > shouldn't be too difficult :-) > >> It also kept me wondering why gpio interrupt was always used for card >> detect instead of using mmci_sdcd line of the controller. > > Probably a really, really old bug which nobody ever debugged properly ;-) > > ps: you don't need that ADMA2 DT property, btw. There's a bit in another > register which you can check if $this controller was configured with > ADMA2 support or not. IIRC, OMAP5's TRM describes them. hmm yeah.. Should be the MADMA_EN in MMCHS_HL_HWINFO. Thanks Kishon