[U-Boot] [PATCH 2/2] Blackfin: bf533-ezkit: convert to CFI flash driver

Mike Frysinger vapier at gentoo.org
Tue Jul 31 09:40:35 CEST 2012


Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 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

diff --git a/board/bf533-ezkit/Makefile b/board/bf533-ezkit/Makefile
index 5fb51da..505a831 100644
--- a/board/bf533-ezkit/Makefile
+++ b/board/bf533-ezkit/Makefile
@@ -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))
diff --git a/board/bf533-ezkit/bf533-ezkit.c b/board/bf533-ezkit/bf533-ezkit.c
index b1aa7b7..c883815 100644
--- a/board/bf533-ezkit/bf533-ezkit.c
+++ b/board/bf533-ezkit/bf533-ezkit.c
@@ -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)
 {
diff --git a/board/bf533-ezkit/flash-defines.h b/board/bf533-ezkit/flash-defines.h
deleted file mode 100644
index eb0af94..0000000
diff --git a/board/bf533-ezkit/flash.c b/board/bf533-ezkit/flash.c
deleted file mode 100644
index ab808d8..0000000
diff --git a/include/configs/bf533-ezkit.h b/include/configs/bf533-ezkit.h
index c1a5ecd..e32ba4c 100644
--- a/include/configs/bf533-ezkit.h
+++ b/include/configs/bf533-ezkit.h
@@ -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
 
 
 /*
-- 
1.7.9.7



More information about the U-Boot mailing list