public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sergey Lapin <slapin@ossfans.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH][AT91] DataFlash: AT45DB021 fix and AT45DB081 support
Date: Fri,  8 Aug 2008 10:19:24 +0400	[thread overview]
Message-ID: <12181763643896-git-send-email-slapin@ossfans.org> (raw)

Fix for page size of AT45DB021. Also adding bigger AT45DB081
which comes with some newer boards.

Signed-off-by: Sergey Lapin <slapin@ossfans.org>
---
 drivers/mtd/dataflash.c |   15 ++++++++++++++-
 include/dataflash.h     |    3 ++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/dataflash.c b/drivers/mtd/dataflash.c
index 0ad48cd..049da69 100644
--- a/drivers/mtd/dataflash.c
+++ b/drivers/mtd/dataflash.c
@@ -56,7 +56,7 @@ int AT91F_DataflashInit (void)
 		switch (dfcode) {
 		case AT45DB021:
 			dataflash_info[i].Device.pages_number = 1024;
-			dataflash_info[i].Device.pages_size = 263;
+			dataflash_info[i].Device.pages_size = 264;
 			dataflash_info[i].Device.page_offset = 9;
 			dataflash_info[i].Device.byte_mask = 0x300;
 			dataflash_info[i].Device.cs = cs[i].cs;
@@ -65,6 +65,19 @@ int AT91F_DataflashInit (void)
 			dataflash_info[i].id = dfcode;
 			found[i] += dfcode;;
 			break;
+
+		case AT45DB081:
+			dataflash_info[i].Device.pages_number = 4096;
+			dataflash_info[i].Device.pages_size = 264;
+			dataflash_info[i].Device.page_offset = 9;
+			dataflash_info[i].Device.byte_mask = 0x300;
+			dataflash_info[i].Device.cs = cs[i].cs;
+			dataflash_info[i].Desc.DataFlash_state = IDLE;
+			dataflash_info[i].logical_address = cs[i].addr;
+			dataflash_info[i].id = dfcode;
+			found[i] += dfcode;;
+			break;
+
 		case AT45DB161:
 			dataflash_info[i].Device.pages_number = 4096;
 			dataflash_info[i].Device.pages_size = 528;
diff --git a/include/dataflash.h b/include/dataflash.h
index 11e5188..d75d9b6 100644
--- a/include/dataflash.h
+++ b/include/dataflash.h
@@ -135,6 +135,7 @@ struct dataflash_addr {
 	int cs;
 };
 /*-------------------------------------------------------------------------------------------------*/
+#define AT45DB081	0x24
 #define AT45DB161	0x2c
 #define AT45DB021	0x14
 #define AT45DB321	0x34
-- 
1.5.4.1

             reply	other threads:[~2008-08-08  6:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08  6:19 Sergey Lapin [this message]
2008-08-08  6:30 ` [U-Boot] [PATCH][AT91] DataFlash: AT45DB021 fix and AT45DB081 support Sergey Lapin
2008-08-08  9:29   ` Wolfgang Denk
2008-08-08 20:31   ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-08 21:37     ` Sergey Lapin
2008-08-08 22:35       ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-09 20:12         ` Sergey Lapin
2008-08-08 21:39     ` [U-Boot] [PATCH][AT91][Re-submit] " Sergey Lapin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12181763643896-git-send-email-slapin@ossfans.org \
    --to=slapin@ossfans.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox