public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* TC58FVT160 question
@ 2001-11-09  8:17 Der Herr Hofrat
  2001-11-09  9:42 ` David Woodhouse
  0 siblings, 1 reply; 3+ messages in thread
From: Der Herr Hofrat @ 2001-11-09  8:17 UTC (permalink / raw)
  To: linux-mtd

HI !

 as I can find the TC58FVT160 chip (a 2MB - 16*1024 chip) in amd_flash.c 
 cfi_jedec.c and jedec_probe.c I'm kind of confused at what driver I 
 actually should be configuring for this chip.

 any hint apreaciated.

thx !
hofrat

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

* Re: TC58FVT160 question
  2001-11-09  8:17 TC58FVT160 question Der Herr Hofrat
@ 2001-11-09  9:42 ` David Woodhouse
  0 siblings, 0 replies; 3+ messages in thread
From: David Woodhouse @ 2001-11-09  9:42 UTC (permalink / raw)
  To: Der Herr Hofrat; +Cc: linux-mtd


der.herr@hofr.at said:
> 
>  as I can find the TC58FVT160 chip (a 2MB - 16*1024 chip) in
> amd_flash.c cfi_jedec.c and jedec_probe.c I'm kind of confused at
> what driver I actually should be configuring for this chip. 

Er, cfi_jedec.c doesn't actually exist any more. I assume you mean jedec.c?
You should be using the new jedec_probe.c

CONFIG_MTD_JEDECPROBE=y
CONFIG_MTD_CFI_ADV_OPTIONS=n
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_OBSOLETE_CHIPS=n (which stops it from asking you about 
the CONFIG_MTD_AMDSTD and CONFIG_MTD_JEDEC options).



--
dwmw2

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

* RE: TC58FVT160 question
@ 2001-11-09 12:59 Jonas Holmberg
  0 siblings, 0 replies; 3+ messages in thread
From: Jonas Holmberg @ 2001-11-09 12:59 UTC (permalink / raw)
  To: 'David Woodhouse'; +Cc: linux-mtd

The patch you gave me for mtdram was pretty useful. Do you want to commit it?

(I added "+ to" compared to your version so use the patch below if you commit)

/Jonas



 static int ram_write(struct mtd_info *mtd, loff_t to, size_t len,
              size_t *retlen, const u_char *buf)
 {
+  size_t c;
+  unsigned char *storage = (char *)mtd->priv + to;
+
   DEBUG(MTD_DEBUG_LEVEL2, "ram_write(pos:%ld, len:%ld)\n", (long)to, (long)len);   if (to + len > mtd->size) {
     DEBUG(MTD_DEBUG_LEVEL1, "ram_write() out of bounds (%ld > %ld)\n", (long)(to + len), (long)mtd->size);
     return -EINVAL;
   }
 
-  memcpy ((char *)mtd->priv + to, buf, len);
+  for (c = 0; c < len; c++) {
+    if ((storage[c] & buf[c]) != buf[c]) {
+      /* We're trying to set bits which weren't set before */
+      printk(KERN_WARNING "mtdram write at 0x%08x tried to set bits "
+             "(from %02x to %02x)\n", to + c, storage[c], buf[c]);
+      *retlen = c;
+      return -EIO;
+    }
+    storage[c] &= buf[c];
+  }
 
   *retlen=len;
   return 0;

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

end of thread, other threads:[~2001-11-09 12:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-09  8:17 TC58FVT160 question Der Herr Hofrat
2001-11-09  9:42 ` David Woodhouse
  -- strict thread matches above, loose matches on Subject: below --
2001-11-09 12:59 Jonas Holmberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox