Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1627507 > unrolled thread

Re: MMC block addressing mode.

Started byUlf Hansson <ulf.hansson@linaro.org>
First post2017-04-20 16:20 +0200
Last post2017-04-21 10:30 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: MMC block addressing mode. Ulf Hansson <ulf.hansson@linaro.org> - 2017-04-20 16:20 +0200
    Re: MMC block addressing mode. Ulf Hansson <ulf.hansson@linaro.org> - 2017-04-21 10:30 +0200

#1627507 — Re: MMC block addressing mode.

FromUlf Hansson <ulf.hansson@linaro.org>
Date2017-04-20 16:20 +0200
SubjectRe: MMC block addressing mode.
Message-ID<tyl6a-1yM-25@gated-at.bofh.it>
On 13 April 2017 at 21:49, Steven J. Hill <Steven.Hill@cavium.com> wrote:
> Uffe,
>
> The Cavium hardware requires knowledge of the card addressing mode.
> We need to either restore mmc_card_blockaddr(), or create another
> way to generate the same information. You previously suggested use
> of the 'blksz' value, however, it has the same value regardless of
> the card capacity. What would you suggest? Cheers.

Right. Can you explain what the Cavium hardware need it for?

Kind regards
Uffe

[toc] | [next] | [standalone]


#1628037

FromUlf Hansson <ulf.hansson@linaro.org>
Date2017-04-21 10:30 +0200
Message-ID<tyC6Z-3xY-13@gated-at.bofh.it>
In reply to#1627507
On 20 April 2017 at 23:28, Steven J. Hill <Steven.Hill@cavium.com> wrote:
> On 04/20/2017 04:24 PM, Steven J. Hill wrote:
>> On 04/20/2017 12:12 PM, David Daney wrote:
>>>
>>> Steven and Jan:  Can we get around this requirement by:
>>>
>>> - Always set MIO_EMM_DMA[MULTI] = 1;  This way by SECTOR mode may be unimportant.
>>>
>>> - Always set MIO_EMM_DMA[SECTOR] = SUITABLE_CONSTANT.
>>>
>> No, this does not work. The 1.88GB card plugged into my 78xx
>> board gives the output below. We cannot just blindly set the
>> MULTI bit for all cards. These results are identical for all
>> four combinations of SECTOR and MULTI values hardcoded.
>>
> ...for 3 of the 4 combinations. Obviously the correct one works.

I get it, thanks for the clarifications!

I have cooked a patch below, providing you with the API I think you
need. If it works, please fold in the patch in the series when you
post you updated Cavium driver(s).

Kind regards
Uffe

From: Ulf Hansson <ulf.hansson@linaro.org>
Date: Fri, 21 Apr 2017 08:31:15 +0200
Subject: [PATCH] mmc: core: Export API to allow hosts to get the card address
 mode

Some hosts controllers, like Cavium, needs to know whether the card
operates in byte- or block-address mode. Therefore export a new API,
mmc_card_is_blockaddr(), which provides this information.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/core/core.c  | 6 ++++++
 include/linux/mmc/card.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 0bb3979..f053ef5 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2558,6 +2558,12 @@ unsigned int mmc_calc_max_discard(struct mmc_card *card)
 }
 EXPORT_SYMBOL(mmc_calc_max_discard);

+bool mmc_card_is_blockaddr(struct mmc_card *card)
+{
+       return card ? mmc_card_blockaddr(card) : false;
+}
+EXPORT_SYMBOL(mmc_card_is_blockaddr);
+
 int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen)
 {
        struct mmc_command cmd = {};
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 85b5f2b..aad015e 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -315,6 +315,8 @@ static inline bool mmc_large_sector(struct mmc_card *card)
        return card->ext_csd.data_sector_size == 4096;
 }

+bool mmc_card_is_blockaddr(struct mmc_card *card);
+
 #define mmc_card_mmc(c)                ((c)->type == MMC_TYPE_MMC)
 #define mmc_card_sd(c)         ((c)->type == MMC_TYPE_SD)
 #define mmc_card_sdio(c)       ((c)->type == MMC_TYPE_SDIO)
-- 
2.7.4

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web