From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BF864C433FE for ; Mon, 17 Oct 2022 05:51:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0B7A184F51; Mon, 17 Oct 2022 07:51:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="HADbj8tt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2C84584F4E; Mon, 17 Oct 2022 07:51:28 +0200 (CEST) Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2780584F50 for ; Mon, 17 Oct 2022 07:51:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jh80.chung@samsung.com Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20221017055121epoutp04ef67044dfa8a5ac9da84f94145609642~exVUWMmOK2091020910epoutp04a for ; Mon, 17 Oct 2022 05:51:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20221017055121epoutp04ef67044dfa8a5ac9da84f94145609642~exVUWMmOK2091020910epoutp04a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1665985881; bh=5V+QUzQfwVs2XU4jP85JFIT1DviCy1+l41DE7rUWn7c=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=HADbj8ttDOqZh0hOd94rnQmuZXW2x/8xocIjJPSHjBeac/l32qx5+oQRrr5BMFnGD +2kXvWsN+Z1VBW/9gI3NVcVQLOLFh1pjH7B0ZcCPyK6EiyaM4fuVIijSWEXIzvpWFu Mhe9hWAKMIQzKMcfwcSlIedFdayAv0mo/Qx3xkWk= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20221017055121epcas1p3b6e7af862e7f7918cd4f7cf6ec5b3220~exVUIijXt0739807398epcas1p3m; Mon, 17 Oct 2022 05:51:21 +0000 (GMT) Received: from epsmges1p2.samsung.com (unknown [182.195.38.232]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4MrR201vFMz4x9Q0; Mon, 17 Oct 2022 05:51:20 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 60.46.51827.85DEC436; Mon, 17 Oct 2022 14:51:20 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20221017055119epcas1p239c112b6f410de78c514a765f905b1cc~exVSzfX9V0873808738epcas1p2h; Mon, 17 Oct 2022 05:51:19 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20221017055119epsmtrp25c33befd1b75162e9f3787c0295bbf7b~exVSyuXzK0613006130epsmtrp24; Mon, 17 Oct 2022 05:51:19 +0000 (GMT) X-AuditID: b6c32a36-72a32a800000ca73-02-634ced58e187 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id E2.41.18644.75DEC436; Mon, 17 Oct 2022 14:51:19 +0900 (KST) Received: from jh80chung01 (unknown [10.113.111.84]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20221017055119epsmtip17aab675494a7a1f0ee009ea5526645c4~exVSmp1XH1270712707epsmtip1O; Mon, 17 Oct 2022 05:51:19 +0000 (GMT) From: =?ks_c_5601-1987?B?waTA58jG?= To: "'Simon Glass'" , "'U-Boot Mailing List'" Cc: "'Tom Rini'" , "'Marek Vasut'" , "'Pavel Herrmann'" , "'Peng Fan'" In-Reply-To: <20221013122927.636867-23-sjg@chromium.org> Subject: RE: [PATCH v2 22/45] dm: mmc: Allow sandbox emulator to build without writes Date: Mon, 17 Oct 2022 14:51:19 +0900 Message-ID: <112301d8e1ec$7abf79d0$703e6d70$@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset="ks_c_5601-1987" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQJexruUiF8NTVnZFA8d7sH1UWaWzAI8gVRmAcHltBus5lg2YA== Content-Language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNJsWRmVeSWpSXmKPExsWy7bCmrm7EW59kg6creCzetDUyWuxonsZk 8WPVF1aLb1u2MVpMnbSZ3eLt3k52BzaP2Q0XWTzmzTrB4rFz1l12j1cHVrF7nL2zg9Fj47sd TAFsUdk2GamJKalFCql5yfkpmXnptkrewfHO8aZmBoa6hpYW5koKeYm5qbZKLj4Bum6ZOUB3 KCmUJeaUAoUCEouLlfTtbIryS0tSFTLyi0tslVILUnIKTAv0ihNzi0vz0vXyUkusDA0MjEyB ChOyMzqa7jIXrBWqeNp2nK2B8TVfFyMHh4SAicSc13JdjFwcQgI7GCWWL+tmh3A+MUpcbDnA AuF8ZpR4cGATUIYTrGPa8oNQVbsYJZ4sngBV9ZJRYvfE64wgVWwCNhIN2w4ygewQEYiQOHvD DyTMLDCTUeLukiIQm1PAQmJ+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dD1DxnlHjzZCMLSA2bgI1Ew7aDTCC2iECExNxfi5hA ipgFZjNKzP/zig2iYwujxN7L2xlBqjgFLCTmd55mBbGFBUIl7uzaA7aNRUBV4vXLt2A2r4Cl xOdVdxghbEGJkzOfgG1jBjq18XA3lC0vsf3tHGaISxUkdn86ygpxhZPE7dnLoGpEJGZ3tjFP YBSehWTULCSjZiEZNQtJywJGllWMkqkFxbnpucWGBUZ5qeV6xYm5xaV56XrJ+bmbGMExpaW1 g3HPqg96hxiZOBgPMUpwMCuJ8Oa+8U4W4k1JrKxKLcqPLyrNSS0+xCjNwaIkznuh62S8kEB6 YklqdmpqQWoRTJaJg1Oqgen8rOrH+Zvt7F7rJXcdO50sYWeo2Mh77/EbZ41zs3QD/5twN3Hc r4t8v3n75NkR13S/urNylvmG+xXWLs8MP7Es/3Sd2b6Fp398uCrl9X8z/zx+BdbLXffCK/7l XXqcvLBSrIp13fWdfhd/+vO/8QsOXfzjwbespE6X/JMZnr8lntQp7WS4d1TxdI9a6Hp31snd UVeyJxbndKgw7M5PUbvZxzP3SpJdwvzbF+bOuGR9OX5OofvMSYtXf7rCIHWcLefrTLYEls5J d7fN1bhUV9BtIj/v2VWXrTPM5k2bf6NYbP0Djt9fOvcubr+XdiXUPO0WU6XvE4dW+WrzoCuq rleYX+mtVnshHrL9rpJH518lluKMREMt5qLiRADAoli6GAMAAA== X-CMS-MailID: 20221017055119epcas1p239c112b6f410de78c514a765f905b1cc X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221013123033epcas1p1942267d8a287b0848b5c816937e0c668 References: <20221013122927.636867-1-sjg@chromium.org> <20221013122927.636867-23-sjg@chromium.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean > -----Original Message----- > From: Simon Glass [mailto:sjg@chromium.org] > Sent: Thursday, October 13, 2022 9:29 PM > To: U-Boot Mailing List > Cc: Tom Rini ; Simon Glass ; Jaehoon Chung > ; Marek Vasut ; Pavel Herrmann ; > Peng Fan > Subject: [PATCH v2 22/45] dm: mmc: Allow sandbox emulator to build without writes > > When MMC_WRITE is disabled this driver produced a build error. Fix this. > > Also update a comment while we are here. > > Signed-off-by: Simon Glass Reviewed-by: Jaehoon Chung Best Regards, Jaehoon Chung > --- > > (no changes since v1) > > drivers/mmc/sandbox_mmc.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/sandbox_mmc.c b/drivers/mmc/sandbox_mmc.c > index 451fe4a4e5a..ba79a5565c3 100644 > --- a/drivers/mmc/sandbox_mmc.c > +++ b/drivers/mmc/sandbox_mmc.c > @@ -23,6 +23,8 @@ struct sandbox_mmc_plat { > #define MMC_CMULT 8 /* 8 because the card is high-capacity */ > #define MMC_BL_LEN_SHIFT 10 > #define MMC_BL_LEN BIT(MMC_BL_LEN_SHIFT) > + > +/* Granularity of priv->csize - this is 1MB */ > #define SIZE_MULTIPLE ((1 << (MMC_CMULT + 2)) * MMC_BL_LEN) > > struct sandbox_mmc_priv { > @@ -41,7 +43,6 @@ static int sandbox_mmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, > struct mmc_data *data) > { > struct sandbox_mmc_priv *priv = dev_get_priv(dev); > - struct mmc *mmc = mmc_get_mmc_dev(dev); > static ulong erase_start, erase_end; > > switch (cmd->cmdidx) { > @@ -95,10 +96,15 @@ static int sandbox_mmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, > case SD_CMD_ERASE_WR_BLK_END: > erase_end = cmd->cmdarg; > break; > - case MMC_CMD_ERASE: > +#if CONFIG_IS_ENABLED(MMC_WRITE) > + case MMC_CMD_ERASE: { > + struct mmc *mmc = mmc_get_mmc_dev(dev); > + > memset(&priv->buf[erase_start * mmc->write_bl_len], '\0', > (erase_end - erase_start + 1) * mmc->write_bl_len); > break; > + } > +#endif > case SD_CMD_APP_SEND_OP_COND: > cmd->response[0] = OCR_BUSY | OCR_HCS; > cmd->response[1] = 0; > -- > 2.38.0.rc1.362.ged0d419d3c-goog