[U-Boot] [PATCH 1/2] add ST PSD4256G6V to table of supported legacy flashs

The BF533-EZKIT boards have this old ST flash.
Signed-off-by: Mike Frysinger vapier@gentoo.org --- drivers/mtd/jedec_flash.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/drivers/mtd/jedec_flash.c b/drivers/mtd/jedec_flash.c index 2350f36..b6cb037 100644 --- a/drivers/mtd/jedec_flash.c +++ b/drivers/mtd/jedec_flash.c @@ -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)

Signed-off-by: Mike Frysinger vapier@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
/*

On Tuesday 31 July 2012 09:38:32 Mike Frysinger wrote:
The BF533-EZKIT boards have this old ST flash.
Signed-off-by: Mike Frysinger vapier@gentoo.org
Acked-by: Stefan Roese sr@denx.de
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.
Thanks, Stefan

On Tuesday 31 July 2012 04:50:17 Stefan Roese wrote:
On Tuesday 31 July 2012 09:38:32 Mike Frysinger wrote:
The BF533-EZKIT boards have this old ST flash.
Signed-off-by: Mike Frysinger vapier@gentoo.org
Acked-by: Stefan Roese sr@denx.de
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
participants (2)
-
Mike Frysinger
-
Stefan Roese