All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug in mmc.c  == stops eMMC toshiba from working - sector check not good
@ 2010-03-05  5:01 Philip Rakity
  2010-03-05  5:05 ` Philip Rakity
  0 siblings, 1 reply; 2+ messages in thread
From: Philip Rakity @ 2010-03-05  5:01 UTC (permalink / raw)
  To: linux-mmc; +Cc: Lennert Buijtenhek, Nicolas Pitre


Folks

Toshiba part eMMC -- 2GB fails in standard linux.  The part is NOT sector addressable yet linux tries to do this.  See incorrect code below in mmc.c and notes below

The tosbiha part HAS  ext_csd.sectors

from mmc.c
static int mmc_read_ext_csd(struct mmc_card *card)

if (card->ext_csd.rev >= 2) {
card->ext_csd.sectors =
ext_csd[EXT_CSD_SEC_CNT + 0] << 0 |
ext_csd[EXT_CSD_SEC_CNT + 1] << 8 |
ext_csd[EXT_CSD_SEC_CNT + 2] << 16 |
ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
if (card->ext_csd.sectors)
mmc_card_set_blockaddr(card);
}

when set cause code in block.c to not make address byte oriented

static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
.....
                brq.cmd.arg = blk_rq_pos(req);
                if (!mmc_card_blockaddr(card))
                        brq.cmd.arg <<= 9;


The Toshiba card HAS ext_csd.sectors even though the CMD1 response says it does not do sector addressing -- returning the ocr register.

The Simplified Physical Layer Spec defines for the OCR register
bit 29 as reserved and bit 30 as CCS -- High Capacity Card

The JEDEC Standard No. 84-A43 defines the OCR register Table 31 (OCR Register)
bits 29 and 30
00 == byte mode
10 == sector mode


I can change the code to save the ocr on the CMD1 and use the value of bit 30 to select Sector Mode IF there is a sector table.   

Are there any other thoughts ?

regards,

Philip

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: Bug in mmc.c  == stops eMMC toshiba from working - sector check not good
  2010-03-05  5:01 Bug in mmc.c == stops eMMC toshiba from working - sector check not good Philip Rakity
@ 2010-03-05  5:05 ` Philip Rakity
  0 siblings, 0 replies; 2+ messages in thread
From: Philip Rakity @ 2010-03-05  5:05 UTC (permalink / raw)
  To: linux-mmc; +Cc: Lennert Buijtenhek, Nicolas Pitre, Philip Rakity


________________________________________
From: Philip Rakity
Sent: Thursday, March 04, 2010 9:01 PM
To: linux-mmc@vger.kernel.org
Cc: Lennert Buijtenhek; Nicolas Pitre
Subject: Bug in mmc.c  == stops eMMC toshiba from working - sector check not good

Folks

Toshiba part eMMC -- 2GB fails in standard linux.  The part is NOT sector addressable yet linux tries to do this.  See incorrect code below in mmc.c and notes below

The tosbiha part HAS  ext_csd.sectors

from mmc.c
static int mmc_read_ext_csd(struct mmc_card *card)

if (card->ext_csd.rev >= 2) {
card->ext_csd.sectors =
ext_csd[EXT_CSD_SEC_CNT + 0] << 0 |
ext_csd[EXT_CSD_SEC_CNT + 1] << 8 |
ext_csd[EXT_CSD_SEC_CNT + 2] << 16 |
ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
if (card->ext_csd.sectors)
mmc_card_set_blockaddr(card);
}

when set cause code in block.c to not make address byte oriented

static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
.....
                brq.cmd.arg = blk_rq_pos(req);
                if (!mmc_card_blockaddr(card))
                        brq.cmd.arg <<= 9;


The Toshiba card HAS ext_csd.sectors even though the CMD1 response says it does not do sector addressing -- returning the ocr register.

The Simplified Physical Layer Spec defines for the OCR register
bit 29 as reserved and bit 30 as CCS -- High Capacity Card

The JEDEC Standard No. 84-A43 defines the OCR register Table 31 (OCR Register)
bits 29 and 30
00 == byte mode
10 == sector mode


I can change the code to save the ocr on the CMD1 and use the value of bit 30 to select Sector Mode IF there is a sector table.

Are there any other thoughts ?

regards,

Philip

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-05  5:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-05  5:01 Bug in mmc.c == stops eMMC toshiba from working - sector check not good Philip Rakity
2010-03-05  5:05 ` Philip Rakity

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.