From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=p3jt15O4; spf=pass (domain: linaro.org, ip: 209.85.128.68, mailfrom: leif.lindholm@linaro.org) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by groups.io with SMTP; Tue, 28 May 2019 10:37:37 -0700 Received: by mail-wm1-f68.google.com with SMTP id u78so3888288wmu.5 for ; Tue, 28 May 2019 10:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+d1t/cYAa3QvYWEtW0gv8iw3GQi5weoo766tH73Pa8g=; b=p3jt15O4gWfMPPqf1uTopXLqPW3DgDW+6mrZ4dLCP97uggH2LUOn50G7Wxah5NqrbY Ti3r2L60cM3SEVfuTqGjzyYy9EQNia7cujU5YtspUVRUCqAxTengAXLlE0ZOG0hdfYTu LYhpG29CiPySegdaTjobyLGCtB4kKZ/ks3UtTPMpM0/i684Kq/K93l6HjQycdA5ffmDO 78HpuODtukD9mTuGBJJnFHTuRBPcZmMETtjyU62uE1IMGlDGBp4kgKtxn3WkaHv/gwDm lLDIqokQRC931BAhj3ZLYxszQgSiU2WV8ieWc8vkBN+EKn+Hr74s9gIMkhRiyMrhSzmO SuHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+d1t/cYAa3QvYWEtW0gv8iw3GQi5weoo766tH73Pa8g=; b=s1etVzFG26MS+rG/5HhaldQYnWspHQZFSSs08z1MST5CkTm2QY8DTg9osAi5/m4uL1 jfAxgxZddkBRJBxjVmn9wWWn6eMiG5QS/9yQxB/0wZVjb1a3oU6JW/b3sbpioYofKIXl iKG52sxqeAZLvI0SWNdgwJwyy16T88sxPZ9LTnTwa221k+aTsEU0T8O/5z9M1B6PpYF0 ZvX1HTvNKpymNIJaBIBqwuUvDOFNakmSbsllcB+PGi1+E6pc0WElwsLNtd0oTCgOS3UF J1TDL0KfBuppcxKRVhgeoKcb2QUYZTCQ4ieCUwxRFtdjUhVkdSNfyboFmG7zCg44PAHT Mxhg== X-Gm-Message-State: APjAAAXO7xz6PK2dwk+rjVshBb2H/BgODG2n8q5KBu/83uqP4DXb5Yi1 bBnqEEbKHWUlD03zRFIfbQD+5w== X-Google-Smtp-Source: APXvYqzQV2/OQEXpZQ/uCjpjGt7udIqygdU4kC9nZ8mWtgZuiLhLeOlRMbJdqj58uwmJAplRgw9EiQ== X-Received: by 2002:a1c:a002:: with SMTP id j2mr3983207wme.131.1559065055850; Tue, 28 May 2019 10:37:35 -0700 (PDT) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id z193sm5429158wmc.20.2019.05.28.10.37.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 May 2019 10:37:34 -0700 (PDT) Date: Tue, 28 May 2019 18:37:33 +0100 From: "Leif Lindholm" To: tien.hock.loh@intel.com Cc: devel@edk2.groups.io, thloh85@gmail.com, Ard Biesheuvel Subject: Re: [PATCH v2 1/7] EmbeddedPkg: Add SD command support for DwEmmc Message-ID: <20190528173733.ecjlbmtyuz7ial36@bivouac.eciton.net> References: <1558949428-190715-1-git-send-email-tien.hock.loh@intel.com> <1558949428-190715-2-git-send-email-tien.hock.loh@intel.com> MIME-Version: 1.0 In-Reply-To: <1558949428-190715-2-git-send-email-tien.hock.loh@intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Tien Hock, Thanks for resubmitting this. On Mon, May 27, 2019 at 05:30:22PM +0800, tien.hock.loh@intel.com wrote: > From: "TIen Hock, Loh" > > Added ACMD6 for SD support. For SD, after CMD55 is sent, the next > command should be an application command, which should not expect > data > > Signed-off-by: "Tien Hock, Loh" > Cc: Leif Lindholm > Cc: Ard Biesheuvel > > -- > v2: > - Move IsACmd as a local static variable in function > - Fix some coding standard issue with spacing > --- > EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c > index 68c523a99f..420487757d 100644 > --- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c > +++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c > @@ -307,6 +307,7 @@ DwEmmcSendCommand ( > { > UINT32 Cmd = 0; > EFI_STATUS Status = EFI_SUCCESS; > + STATIC BOOLEAN IsACmd = FALSE; > > switch (MMC_GET_INDX(MmcCmd)) { > case MMC_INDX(0): > @@ -323,6 +324,15 @@ DwEmmcSendCommand ( > Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC | > BIT_CMD_SEND_INIT; > break; > + case MMC_INDX (6): > + if(IsACmd) { > + Cmd = BIT_CMD_RESPONSE_EXPECT; > + } > + else { I remarked last time that the else should be on the same line as }. > + Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_DATA_EXPECTED | > + BIT_CMD_READ; > + } > + break; > case MMC_INDX(7): > if (Argument) > Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC; > @@ -367,12 +377,22 @@ DwEmmcSendCommand ( > Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC | > BIT_CMD_DATA_EXPECTED; > break; > + case MMC_INDX (51): > + Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_DATA_EXPECTED | > + BIT_CMD_READ | BIT_CMD_WAIT_PRVDATA_COMPLETE; > + break; > default: > Cmd = BIT_CMD_RESPONSE_EXPECT | BIT_CMD_CHECK_RESPONSE_CRC; > break; > } > > Cmd |= MMC_GET_INDX(MmcCmd) | BIT_CMD_USE_HOLD_REG | BIT_CMD_START; > + > + if(MMC_INDX (55) == MMC_GET_INDX (MmcCmd)) Space after if. > + IsACmd = TRUE; > + else > + IsACmd = FALSE; Even though some code in this file takes liberties with the use of { and }, please add them for both if and else. / Leif > + > if (IsPendingReadCommand (Cmd) || IsPendingWriteCommand (Cmd)) { > mDwEmmcCommand = Cmd; > mDwEmmcArgument = Argument; > -- > 2.19.0 >