Skip to contentSkip to conversation

add ST PSD4256G6V to table of supported legacy flashs

PATCH New Mike Frysinger 2 participants 4 messages Jul 31, 2012 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 add ST PSD4256G6V to table of supported legacy flashs

The BF533-EZKIT boards have this old ST flash.

---
 drivers/mtd/jedec_flash.c |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/mtd/jedec_flash.c +20 -0
index 2350f36..b6cb037 100644
@@ -30,6 +30,7 @@
 /*#define DEBUG*/
 
 #include <common.h>
+#include <mtd/cfi_flash.h>
 #include <asm/processor.h>
 #include <asm/io.h>
 #include <asm/byteorder.h>
@@ -58,6 +59,9 @@
 #define AM29F032B	0x0041
 #define AM29F002T	0x00B0
 
+/* ST - www.st.com */
+#define PSD4256G6V	0x00e9
+
 /* SST */
 #define SST39LF800	0x2781
 #define SST39LF160	0x2782
@@ -367,6 +371,22 @@ static const struct amd_flash_info jedec_table[] = {
 		}
 	},
 #endif
+#ifdef CONFIG_SYS_FLASH_LEGACY_1Mx16
+	{
+		.mfr_id		= (u16)STM_MANUFACT,
+		.dev_id		= 0xff00 | PSD4256G6V,
+		.name		= "ST PSD4256G6V",
+		.uaddr		= {
+			[1] = MTD_UADDR_0x0555_0x0AAA /* x16 */
+		},
+		.DevSize		= SIZE_1MiB,
+		.CmdSet			= CFI_CMDSET_AMD_STANDARD,
+		.NumEraseRegions	= 4,
+		.regions		= {
+			ERASEINFO(0x10000, 16),
+		}
+	},
+#endif
 };
 
 static inline void fill_info(flash_info_t *info, const struct amd_flash_info *jedec_entry, ulong base)
Signature · 1 line
1.7.9.7
#1 lore raw

PATCH 2/2 Blackfin: bf533-ezkit: convert to CFI flash driver

---
 board/bf533-ezkit/Makefile        |    2 +-
 board/bf533-ezkit/bf533-ezkit.c   |   22 +-
 board/bf533-ezkit/flash-defines.h |  124 ----------
 board/bf533-ezkit/flash.c         |  489 -------------------------------------
 include/configs/bf533-ezkit.h     |   14 +-
 5 files changed, 26 insertions(+), 625 deletions(-)
 delete mode 100644 board/bf533-ezkit/flash-defines.h
 delete mode 100644 board/bf533-ezkit/flash.c
board/bf533-ezkit/Makefile +1 -1
index 5fb51da..505a831 100644
@@ -29,7 +29,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).o
 
-COBJS-y	:= $(BOARD).o flash.o
+COBJS-y	:= $(BOARD).o
 
 SRCS	:= $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS-y))
board/bf533-ezkit/bf533-ezkit.c +15 -7
index b1aa7b7..c883815 100644
@@ -27,8 +27,8 @@
 
 #include <common.h>
 #include <netdev.h>
+#include <asm/io.h>
 #include "psd4256.h"
-#include "flash-defines.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -42,16 +42,24 @@ int checkboard(void)
 /* miscellaneous platform dependent initialisations */
 int misc_init_r(void)
 {
-	/* Set direction bits for Video en/decoder reset as output      */
-	*(volatile unsigned char *)(CONFIG_SYS_FLASH1_BASE + PSD_PORTA_DIR) =
-	    PSDA_VDEC_RST | PSDA_VENC_RST;
-	/* Deactivate Video en/decoder reset lines                      */
-	*(volatile unsigned char *)(CONFIG_SYS_FLASH1_BASE + PSD_PORTA_DOUT) =
-	    PSDA_VDEC_RST | PSDA_VENC_RST;
+	/* Set direction bits for Video en/decoder reset as output */
+	writeb(PSDA_VDEC_RST | PSDA_VENC_RST, 0x20200000 + PSD_PORTA_DIR);
+	/* Deactivate Video en/decoder reset lines */
+	writeb(PSDA_VDEC_RST | PSDA_VENC_RST, 0x20200000 + PSD_PORTA_DOUT);
 
 	return 0;
 }
 
+#ifdef CONFIG_FLASH_CFI_LEGACY
+ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
+{
+	info->portwidth = FLASH_CFI_16BIT;
+	info->chipwidth = 2;
+	info->interface = FLASH_CFI_X16;
+	return 1;
+}
+#endif
+
 #ifdef CONFIG_SMC91111
 int board_eth_init(bd_t *bis)
 {
board/bf533-ezkit/flash-defines.h deleted +0 -0
deleted file mode 100644
index eb0af94..0000000
board/bf533-ezkit/flash.c deleted +0 -0
deleted file mode 100644
index ab808d8..0000000
include/configs/bf533-ezkit.h +10 -4
index c1a5ecd..e32ba4c 100644
@@ -80,15 +80,21 @@
 
 
 /*
- * Flash Settings
+ * Flash Settings (PSD4256)
  */
+#define CONFIG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_LEGACY
+#define CONFIG_SYS_FLASH_LEGACY_1Mx16
 #define CONFIG_SYS_FLASH_BASE		0x20000000
-#define CONFIG_SYS_MAX_FLASH_BANKS	3
-#define CONFIG_SYS_MAX_FLASH_SECT	40
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_SYS_FLASH_CFI_AMD_RESET
+#define CONFIG_SYS_MAX_FLASH_BANKS	2
+#define CONFIG_SYS_MAX_FLASH_SECT	20
+#define CONFIG_SYS_FLASH_BANKS_LIST	{ 0x20000000, 0x20100000 }
+
 #define CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_ENV_ADDR		0x20030000
 #define CONFIG_ENV_SECT_SIZE	0x10000
-#define FLASH_TOT_SECT		40
 
 
 /*
Signature · 1 line
1.7.9.7
#3 lore raw

PATCH 1/2 add ST PSD4256G6V to table of supported legacy flashs

Quoted 9 lines · On Tuesday 31 July 2012 04:50:17 Stefan Roese wrote:
Quoted 3 lines · On Tuesday 31 July 2012 09:38:32 Mike Frysinger wrote:

The BF533-EZKIT boards have this old ST flash.

Mike, do you intend to push this via your blackfin repo? If yes, then please go ahead. Otherwise I'll queue it up for upstreaming.

will do, thanks!
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120731/50df9363/attachment.pgp>