Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752546AbbKIOlB (ORCPT ); Mon, 9 Nov 2015 09:41:01 -0500 Received: from eusmtp01.atmel.com ([212.144.249.242]:37467 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752125AbbKIOk5 (ORCPT ); Mon, 9 Nov 2015 09:40:57 -0500 Date: Mon, 9 Nov 2015 15:40:30 +0100 From: Ludovic Desroches To: Ulf Hansson CC: Nicolas Ferre , Alexandre Belloni , linux-mmc , "linux-kernel@vger.kernel.org" , Jean-Christophe Plagniol-Villard , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , , Ludovic Desroches Subject: Re: [PATCH 1/2] mmc: sdhci: set bus voltage before enabling bus power Message-ID: <20151109144030.GD15706@odux.rfo.atmel.com> Mail-Followup-To: Ulf Hansson , Nicolas Ferre , Alexandre Belloni , linux-mmc , "linux-kernel@vger.kernel.org" , Jean-Christophe Plagniol-Villard , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , pierre.samat@atmel.com References: <1446825570-30029-1-git-send-email-ludovic.desroches@atmel.com> <1446825570-30029-2-git-send-email-ludovic.desroches@atmel.com> <20151109132305.GC15706@odux.rfo.atmel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2953 Lines: 74 On Mon, Nov 09, 2015 at 03:12:46PM +0100, Ulf Hansson wrote: > On 9 November 2015 at 14:23, Ludovic Desroches > wrote: > > On Fri, Nov 06, 2015 at 04:59:29PM +0100, Ludovic Desroches wrote: > >> When there is a vmmc regulator, only SD Bus Power is set to 1 in the > >> Power Control Register. It means SD Bus Voltage Select field is set to 0 > >> that is a reserved value. The SD Host Controller specification says: > >> 'SD Bus Power: Before setting this bit, the SD Host Driver shall set SD > >> Bus Voltage Select.' and 'If the Host Driver selects an unsupported > >> voltage in the SD B?us Voltage Select field, the Host Controller may > >> ignore writes to SD Bus Power and keep its value at zero." > >> > >> Having an external regulator means the SD Bus Voltage Select is useless > >> but if the Host Controller strictly follows the specification then we > >> need to set a valid value. > > > > Ulf, > > > > What is your opinion about this patch? > > > > If the 'no regulator found' message is turned in debug message, I can get > > rid of my vmmc regulator but I really think that writing only > > I expect you mean vqmmc? I don't mean vmmc. In the sdhci_set_power function, we are using vmmc. I feel not confortable with it because the power control register contains 'SD Bus' fields so it should depend on vqmmc not vmmc. > > > SDHCI_POWER_ON is opposite to the sdhci spec. I would say that not > > setting the bus voltage is a quirk! > > I don't really follow. > > I read the SDHCI spec and the section for the Power Control Register. > Bit 0 needs to be set when communicating with the card as it will for > example enables the clock. Before setting bit0 you must decide what > signal level to use, which is done by writing to bit 1->3. > Right. But when having vmmc supply we do: sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL) or sdhci_writeb(host, 0, SDHCI_POWER_CONTROL) so we loose the signal level, isn't it? > If SDHCI monitors the power state (MMC_POWER_UP|ON|OFF) when its > ->set_ios() callback are invoked and in combination of using the > ->start_signal_voltage_switch() callback to change the signal voltage > level, this *should* work out nicely. > It is my turn to not follow! We write into the Power Control Register only in sdhci_set_power(). May I miss a callback or something else? sdhci_do_start_signal_voltage_switch doesn't modify the Power Control Register. > Now, looking at the related code in sdhci, I am kind of surprised that > it works. :-) Though, again I don't have the in-depth knowledge about > sdhci. > Me too, I am starting to dig into the sdhci spec and some points are not crystal clear. Regards Ludovic -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/