Problem using DOC with mtd
Niki Waibel
niki.waibel at newlogic.com
Wed Sep 17 10:38:09 EDT 2003
On 17-Sep-2003 Yves CLOUSIER wrote:
> Ok Niki,
>
> I made a mistake in the adressage of DOC. I think I have now a good dump of
> DOC, see attach file, but I have always 00 at 0xE0001000.
DoC seems to be in reset mode...
try this:
===
#define doc_read(base,reg) \
(*(volatile unsigned char *)(base + MSYSTEMS_DOC_R_##reg))
#define doc_write(data,base,reg) \
(*(volatile unsigned char *)(base + MSYSTEMS_DOC_W_##reg)) = data
#define doc_read_nop(base) \
doc_read(base, NOP)
#define doc_read_2nop(base) \
{ doc_read_nop(base); doc_read_nop(base); }
#define doc_read_4nop(base) \
{ doc_read_2nop(base); doc_read_2nop(base); }
#define MSYSTEMS_DOC_W__DOCControl 0x1002
#define MSYSTEMS_DOC_R_NOP 0x1020
#define MSYSTEMS_DOC_W_NOP 0x1020
#define DOC_MODE_RESET 0
#define DOC_MODE_NORMAL 1
#define DOC_MODE_WREN 0x04
#define DOC_CLR_ERR 0x80
{
/* sets reset mode (has to be done twice) */
doc_write(DOC_MODE_RESET|DOC_MODE_WREN|DOC_CLR_ERR, bios, _DOCControl);
doc_write(DOC_MODE_RESET|DOC_MODE_WREN|DOC_CLR_ERR, bios, _DOCControl);
/* wait */
doc_read_4nop(bios);
/* sets normal mode (has to be done twic) */
doc_write(DOC_MODE_NORMAL|DOC_MODE_WREN|DOC_CLR_ERR, bios, _DOCControl);
doc_write(DOC_MODE_NORMAL|DOC_MODE_WREN|DOC_CLR_ERR, bios, _DOCControl);
/* wait */
doc_read_4nop(bios);
if(doc_wait(bios, 5000))
return(-1);
}
static int
doc_wait(volatile char *bios, int timeout)
{
int i = 20;
unsigned char busy;
doc_read_4nop(bios);
while((busy=_doc_busy(bios)) && (i != 0))
{
usleep(timeout*1000/20);
i--;
}
doc_read_2nop(bios);
if(busy)
{
return(-1);
}
return(0);
} /* static int doc_wait(volatile char *bios, int timeout) */
===
> Any idea ?
the above code snippies should give you an idea how to
go out of the reset mode...
niki
> -----Message d'origine-----
> De : Niki Waibel [mailto:niki.waibel at newlogic.com]
> Envoyé : mercredi 17 septembre 2003 11:31
> À : Yves CLOUSIER
> Cc : uclinux-dev at uclinux.org; uclinux-dev at uclinux.org;
> linux-mtd at lists.infradead.org
> Objet : RE: Problem using DOC with mtd
>
>
> Doc dump at e0000000 : 55 55 aa aa 10 10 eb eb
> Doc dump at e0000008 : 3c 3c 00 00 00 00 28 28
> Doc dump at e0000010 : 43 43 29 29 4d 4d 2d 2d
> Doc dump at e0000018 : 53 53 79 79 73 73 74 74
> Doc dump at e0000020 : 65 65 6d 6d 73 73 31 31
>
> is somehow good, but you should have:
> Doc dump at e0000000 : 55 aa 10 eb 3c 00 00 28
> ...
> as well on
> Doc dump at e0001000 : 00 00 00 00 00 00 00 00
> there should be
> Doc dump at e0001000 : 30 ...
>
> maybe this is at e0002000 in your case and you have mixed up
> some address wires...
>
> niki
>
>
>
> On 17-Sep-2003 Yves CLOUSIER wrote:
>> Hi all,
>>
>> I have 5272 plateform with the 20030305-uclinux-dist.
>> In this plateform I have a disk-on-chip millenium module MD2802-D08. The
> DOC
>> is map at 0xE0000000.
>>
>> But during booting, I have the message :
>> Possible DiskOnChip with unknown ChipID 00 found at 0xe0000000
>> No recognised DiskOnChip devices found
>>
>> In the Doc_Check() fonction in probe.c I make a memory dump of the DOC
> (from
>> 0xE0000000 to 0xE0002000), see the attach file.
>> I think that the acces of the DOC is correct because I see the DOC bios
>> singature at 0xE0000000. But I don't understand why the mtd doesn't
>> recognised the DOC. So if you have an idea ......
>>
>>
>> Thanks.
>>
>>
>>
>>
>>
>> I configure the mtd like this :
>>
>>#
>># Memory Technology Devices (MTD)
>>#
>> CONFIG_MTD=y
>> CONFIG_MTD_DEBUG=y
>> CONFIG_MTD_DEBUG_VERBOSE=3
>># CONFIG_MTD_PARTITIONS is not set
>># CONFIG_MTD_CONCAT is not set
>>
>>#
>># User Modules And Translation Layers
>>#
>> CONFIG_MTD_CHAR=y
>> CONFIG_MTD_BLOCK=y
>># CONFIG_FTL is not set
>># CONFIG_NFTL is not set
>>
>>#
>># RAM/ROM/Flash chip drivers
>>#
>># CONFIG_MTD_CFI is not set
>># CONFIG_MTD_JEDECPROBE is not set
>># CONFIG_MTD_GEN_PROBE is not set
>># CONFIG_MTD_RAM is not set
>># CONFIG_MTD_ROM is not set
>># CONFIG_MTD_ABSENT is not set
>># CONFIG_MTD_OBSOLETE_CHIPS is not set
>>
>>#
>># Mapping drivers for chip access
>>#
>>
>>#
>># Self-contained MTD device drivers
>>#
>># CONFIG_MTD_SLRAM is not set
>># CONFIG_MTD_MTDRAM is not set
>># CONFIG_MTD_BLKMTD is not set
>>
>>#
>># Disk-On-Chip Device Drivers
>>#
>># CONFIG_MTD_DOC1000 is not set
>> CONFIG_MTD_DOC2000=y
>># CONFIG_MTD_DOC2001 is not set
>> CONFIG_MTD_DOCPROBE=y
>> CONFIG_MTD_DOCPROBE_ADVANCED=y
>> CONFIG_MTD_DOCPROBE_ADDRESS=e0000000
>># CONFIG_MTD_DOCPROBE_HIGH is not set
>># CONFIG_MTD_DOCPROBE_55AA is not set
>>
>>#
>># NAND Flash Device Drivers
>>#
>># CONFIG_MTD_NAND is not set
>>
>>
>>
>> <<dump.txt>>
>
> --
> niki w. waibel - system administrator @ newlogic technologies ag
>
>
--
niki w. waibel - system administrator @ newlogic technologies ag
More information about the linux-mtd
mailing list