From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web11.835.1609785873177662169 for ; Mon, 04 Jan 2021 10:44:33 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=V0hlkkNx; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609785872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Rs6f3fPG2nWFuNdHNm1/Ulwdr8jwTi6uWgc6oFdP8uQ=; b=V0hlkkNxHcihF3Okky8CRUvNalYfjSH0oNjh5uXmwOCZFtdsG1LksUuLPMVGnN5K4Draza vflYHUwe+f800euzEgqSIfrSy62ZIDWDY6WAaSusFmgVpoICfuQDjv4lEgTG64NM3xFcuc LOio3H6LwYiMi/kigi+wYsGZ+W8qA0Y= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-407-V5K9pCaMNGK3SDrOP7j0LA-1; Mon, 04 Jan 2021 13:44:30 -0500 X-MC-Unique: V5K9pCaMNGK3SDrOP7j0LA-1 Received: by mail-wm1-f72.google.com with SMTP id w204so77262wmb.1 for ; Mon, 04 Jan 2021 10:44:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Rs6f3fPG2nWFuNdHNm1/Ulwdr8jwTi6uWgc6oFdP8uQ=; b=M2O2WaYXhZkthW2eluIv0P058cRQW0b5PfUaOo1B95mrpllE0F7z30ihhDaS2m507j Sqtqvb7/fBkNdwo73pxdQlQkcymr25kI539ypIP4YRnHjnTwLYCqvOjlVk5vz8+CJYje aTRH8uXD7xdMv4Ymh+JP8U8jjRks7cw+THwKHOBoZymYCCWzFfEgFwMQUuVyje/w3gTY ZTD7jpgptlwb4HaMUltnMjazJEoJ/FtxJI3rPe3D8zsHsShV/aKLNRJ8ggEpQdCqV2R+ 9Ns8UlUQ4p5Zlb8xBE0SJH5l9czQAoBbgnsVWu7XgKst/srCMVnpVk/bAlx5OWYKqFBF oLUQ== X-Gm-Message-State: AOAM532+skYULH7Mz3yLeTdhO34UgHMW3/CdB9h8lcd5El1Q9VJ3Gqcz NeoEvM2dLJyJzjQek00wILOPB/rIRDuKMAuXeRojWDRPuenp4EK0uKS7Mefdvqa1AAUJpzahGG7 QpnuKkC6GBLvX2g== X-Received: by 2002:a1c:4684:: with SMTP id t126mr190930wma.165.1609785869165; Mon, 04 Jan 2021 10:44:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPog7OHM+6QdhqGbtVtya6duu/db7jrTMUi2hGMTRqM21puGm9eMPlnMEjD/4H8HkaJh41Zw== X-Received: by 2002:a1c:4684:: with SMTP id t126mr190908wma.165.1609785868914; Mon, 04 Jan 2021 10:44:28 -0800 (PST) Return-Path: Received: from [192.168.1.36] (241.red-88-10-103.dynamicip.rima-tde.net. [88.10.103.241]) by smtp.gmail.com with ESMTPSA id c20sm289961wmb.38.2021.01.04.10.44.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Jan 2021 10:44:28 -0800 (PST) Subject: Re: [edk2-devel] [PATCH v3 6/7] Platform/RaspberryPi: Power up sd, and tweak GPIOs To: devel@edk2.groups.io, jeremy.linton@arm.com Cc: ard.biesheuvel@arm.com, leif@nuviainc.com, pete@akeo.ie, samer.el-haj-mahmoud@arm.com, Andrei Warkentin References: <20210104173731.1413044-1-jeremy.linton@arm.com> <20210104173731.1413044-7-jeremy.linton@arm.com> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: <97584144-c3ac-8e91-83bd-2d63921bdc9d@redhat.com> Date: Mon, 4 Jan 2021 19:44:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210104173731.1413044-7-jeremy.linton@arm.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 1/4/21 6:37 PM, Jeremy Linton wrote: > It seems we should be powering up the sd cards, and possibly > the clocks as well to assure they are setup properly before > we attempt to access the controller. > > Signed-off-by: Jeremy Linton > Reviewed-by: Andrei Warkentin > --- > Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > index 28f57438c5..e55ed63efa 100644 > --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > @@ -552,6 +552,16 @@ ApplyVariables ( > GpioPinFuncSet (37, GPIO_FSEL_ALT3); > GpioPinFuncSet (38, GPIO_FSEL_ALT3); > GpioPinFuncSet (39, GPIO_FSEL_ALT3); > + > + /* > + * power and clock everything by default Isn't this comment a bit exaggerated? You only power the minimum required to use the SD controller to access the card. > + */ > + Status = mFwProtocol->SetPowerState (RPI_MBOX_POWER_STATE_SDHCI, > + TRUE, TRUE); //SD on with wait > + Status = mFwProtocol->SetGpioConfig (RPI_EXP_GPIO_SD_VOLT, > + RPI_EXP_GPIO_DIR_OUT, TRUE); //3.3v > + Status = mFwProtocol->SetClockState (RPI_MBOX_CLOCK_RATE_EMMC2, TRUE); > + Status = mFwProtocol->SetClockState (RPI_MBOX_CLOCK_RATE_EMMC, TRUE); > } > } else { > DEBUG ((DEBUG_ERROR, "Model Family %d not supported...\n", mModelFamily)); >