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 6A607C433EF for ; Fri, 22 Apr 2022 12:03:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 26EFF83D58; Fri, 22 Apr 2022 14:03:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fvJwQ4kF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5AFD583D5B; Fri, 22 Apr 2022 14:03:50 +0200 (CEST) Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7315D83D40 for ; Fri, 22 Apr 2022 14:03:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jh80.chung@gmail.com Received: by mail-pg1-x52e.google.com with SMTP id x191so7178816pgd.4 for ; Fri, 22 Apr 2022 05:03:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=VrXgCUj/PLB9Pr6y6PIhpxGETtBD8Y6KwExoFvm5CZQ=; b=fvJwQ4kFnTcOh2fBG12lRZBrqLSOp8SPKek7S+DMfIPzmWuqYJxVzNRYgf1MJR9U/7 HZTV+VmzCI8yITsxQQ+e5bW3I70wmDzegvf5Gv7Fczj5mbSGMs2IrztIaPF7MqEf98Pu JiT5dH5JXf40joXWoDAm/k3uF8w3Ks3E/1YkkQBD1Ia2HSZn9ohJB/LzTHJNCp9Qmymn tW/t8TuJit3wtiJaKSLK0iG5EKnzpzuPsVXVZz5lYGGAOQoAhz+KHLD9SCf8e8GvlNBr 4ua5HgiAuAiZV8tCv2rWejwDHBvBlwFKzfAAP0eSuwg76yRoGxM/dosI/vVOFZDECvoU f3eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=VrXgCUj/PLB9Pr6y6PIhpxGETtBD8Y6KwExoFvm5CZQ=; b=NkVtHjsUGxtqMkDTYI8M2zfg3ahcuJsoLkZ+06CIZsiFYbxVmGppS+XizIksqN53e+ dVn097yFPoYCg8mg3+6XRfeWHasy+yo3ZMg9HUg14YG7bP5dNjweFI5LIUtXXfR/UY9f a1X7HlqoULEpW1iUb7Zjo9YmhxR0cSzy5ttDHOxk/VXg4nW1l+nYOtQzNKbBh8EOETHM Iu1z4QEb51cr6NszHxbRE0pFDIaSc4xC+huaBUoZjdwi8ojkWHpOMiNaQasWiOT3cAwi 8XAg9jzSGpy3XohgMYF67rtzw2daZjSGCTjDLfQ0kTJ0KONBmcxRTD16yp8zliFHepFf xV8Q== X-Gm-Message-State: AOAM532ICQBlMqF4/ipJP27twKjh8lfLjqlvClQZi5ZDqC8f12VkqVIx 3xSCm4qHHe07AqYoDEaLzhe8AHSNLbs= X-Google-Smtp-Source: ABdhPJzBipPQqkxhE0INhFOfjrBlr+GoFZhwjavJlSobFqQ0dldGvkbsFc+r23W67UdDqOT111d3AA== X-Received: by 2002:a63:d454:0:b0:386:86:6aaa with SMTP id i20-20020a63d454000000b0038600866aaamr3662511pgj.60.1650629025168; Fri, 22 Apr 2022 05:03:45 -0700 (PDT) Received: from [192.168.0.19] ([183.99.112.216]) by smtp.gmail.com with ESMTPSA id p42-20020a056a0026ea00b0050ab776f6a2sm2479949pfw.103.2022.04.22.05.03.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Apr 2022 05:03:44 -0700 (PDT) Message-ID: <359b6bcd-5bbb-8efc-5e39-1b94add8a2c5@gmail.com> Date: Fri, 22 Apr 2022 21:03:41 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 3/4] mmc: Import some defines for R1 responses Content-Language: en-US To: Sean Anderson , u-boot@lists.denx.de Cc: Peng Fan , Simon Glass , Jaehoon Chung References: <20220330165446.438925-1-seanga2@gmail.com> <20220330165446.438925-4-seanga2@gmail.com> From: Jaehoon Chung In-Reply-To: <20220330165446.438925-4-seanga2@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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.5 at phobos.denx.de X-Virus-Status: Clean On 3/31/22 01:54, Sean Anderson wrote: > This imports defines for R1 responses from include/linux/mmc/mmc.h from > Linux 5.10. > > Signed-off-by: Sean Anderson Reviewed-by: Jaehoon Chung Best Regards, Jaehoon Chung > --- > Yes, this is an old version, but it's what I had checked out, and I don't think > there are any new fields we need to handle :) > > include/mmc.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 50 insertions(+), 2 deletions(-) > > diff --git a/include/mmc.h b/include/mmc.h > index 6bdcce881d..7304eee0d4 100644 > --- a/include/mmc.h > +++ b/include/mmc.h > @@ -311,8 +311,56 @@ static inline bool mmc_is_tuning_cmd(uint cmdidx) > #define EXT_CSD_WR_DATA_REL_USR (1 << 0) /* user data area WR_REL */ > #define EXT_CSD_WR_DATA_REL_GP(x) (1 << ((x)+1)) /* GP part (x+1) WR_REL */ > > -#define R1_ILLEGAL_COMMAND (1 << 22) > -#define R1_APP_CMD (1 << 5) > +/* > + MMC status in R1, for native mode (SPI bits are different) > + Type > + e : error bit > + s : status bit > + r : detected and set for the actual command response > + x : detected and set during command execution. the host must poll > + the card by sending status command in order to read these bits. > + Clear condition > + a : according to the card state > + b : always related to the previous command. Reception of > + a valid command will clear it (with a delay of one command) > + c : clear by read > + */ > + > +#define R1_OUT_OF_RANGE (1 << 31) /* er, c */ > +#define R1_ADDRESS_ERROR (1 << 30) /* erx, c */ > +#define R1_BLOCK_LEN_ERROR (1 << 29) /* er, c */ > +#define R1_ERASE_SEQ_ERROR (1 << 28) /* er, c */ > +#define R1_ERASE_PARAM (1 << 27) /* ex, c */ > +#define R1_WP_VIOLATION (1 << 26) /* erx, c */ > +#define R1_CARD_IS_LOCKED (1 << 25) /* sx, a */ > +#define R1_LOCK_UNLOCK_FAILED (1 << 24) /* erx, c */ > +#define R1_COM_CRC_ERROR (1 << 23) /* er, b */ > +#define R1_ILLEGAL_COMMAND (1 << 22) /* er, b */ > +#define R1_CARD_ECC_FAILED (1 << 21) /* ex, c */ > +#define R1_CC_ERROR (1 << 20) /* erx, c */ > +#define R1_ERROR (1 << 19) /* erx, c */ > +#define R1_UNDERRUN (1 << 18) /* ex, c */ > +#define R1_OVERRUN (1 << 17) /* ex, c */ > +#define R1_CID_CSD_OVERWRITE (1 << 16) /* erx, c, CID/CSD overwrite */ > +#define R1_WP_ERASE_SKIP (1 << 15) /* sx, c */ > +#define R1_CARD_ECC_DISABLED (1 << 14) /* sx, a */ > +#define R1_ERASE_RESET (1 << 13) /* sr, c */ > +#define R1_STATUS(x) (x & 0xFFF9A000) > +#define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */ > +#define R1_READY_FOR_DATA (1 << 8) /* sx, a */ > +#define R1_SWITCH_ERROR (1 << 7) /* sx, c */ > +#define R1_EXCEPTION_EVENT (1 << 6) /* sr, a */ > +#define R1_APP_CMD (1 << 5) /* sr, c */ > + > +#define R1_STATE_IDLE 0 > +#define R1_STATE_READY 1 > +#define R1_STATE_IDENT 2 > +#define R1_STATE_STBY 3 > +#define R1_STATE_TRAN 4 > +#define R1_STATE_DATA 5 > +#define R1_STATE_RCV 6 > +#define R1_STATE_PRG 7 > +#define R1_STATE_DIS 8 > > #define MMC_RSP_PRESENT (1 << 0) > #define MMC_RSP_136 (1 << 1) /* 136 bit response */