X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Fflash.h;h=70ab43519955ec8187f908a01dc67e69fd4de3b4;hb=56730706cc6842e852fb6d2c6fd90d07786c2ecf;hp=2a5e13a13d380b9c131a74c97900e4663d11e7b0;hpb=30fd42cba6e7d4147e2dd4e9dbe9728efbcd24fe;p=oweals%2Fu-boot.git diff --git a/include/flash.h b/include/flash.h index 2a5e13a13d..70ab435199 100644 --- a/include/flash.h +++ b/include/flash.h @@ -1,8 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * (C) Copyright 2000-2005 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. - * - * SPDX-License-Identifier: GPL-2.0+ */ #ifndef _FLASH_H_ @@ -42,11 +41,16 @@ typedef struct { ushort cfi_offset; /* offset for cfi query */ ulong addr_unlock1; /* unlock address 1 for AMD flash roms */ ulong addr_unlock2; /* unlock address 2 for AMD flash roms */ + uchar sr_supported; /* status register supported */ const char *name; /* human-readable name */ #endif #ifdef CONFIG_MTD struct mtd_info *mtd; #endif +#ifdef CONFIG_CFI_FLASH /* DM-specific parts */ + struct udevice *dev; + phys_addr_t base; +#endif } flash_info_t; extern flash_info_t flash_info[]; /* info for FLASH chips */ @@ -67,8 +71,6 @@ typedef unsigned long flash_sect_t; #define FLASH_CFI_BY16 0x02 #define FLASH_CFI_BY32 0x04 #define FLASH_CFI_BY64 0x08 -/* convert between bit value and numeric value */ -#define CFI_FLASH_SHIFT_WIDTH 3 /* * Values for the flash device interface */ @@ -83,7 +85,6 @@ typedef unsigned long flash_sect_t; /* Prototypes */ extern unsigned long flash_init (void); -extern void flash_protect_default(void); extern void flash_print_info (flash_info_t *); extern int flash_erase (flash_info_t *, int, int); extern int flash_sect_erase (ulong addr_first, ulong addr_last); @@ -116,15 +117,11 @@ extern int jedec_flash_match(flash_info_t *info, ulong base); #define CFI_CMDSET_AMD_LEGACY 0xFFF0 #endif -#if defined(CONFIG_SYS_FLASH_CFI) -extern flash_info_t *flash_get_info(ulong base); -#endif - /*----------------------------------------------------------------------- * return codes from flash_write(): */ #define ERR_OK 0 -#define ERR_TIMOUT 1 +#define ERR_TIMEOUT 1 #define ERR_NOT_ERASED 2 #define ERR_PROTECTED 4 #define ERR_INVAL 8 @@ -469,7 +466,6 @@ extern flash_info_t *flash_get_info(ulong base); #define FLASH_S29GL128N 0x00F1 /* Spansion S29GL128N */ #define FLASH_STM32 0x00F2 /* STM32 Embedded Flash */ -#define FLASH_STM32F1 0x00F3 /* STM32F1 Embedded Flash */ #define FLASH_UNKNOWN 0xFFFF /* unknown flash type */