From 0c9d361cb12b38a6e6407a6ab6608726b32c3fff Mon Sep 17 00:00:00 2001 From: Mingjun Date: Fri, 1 Feb 2013 19:43:47 +0800 Subject: mtd: hs sfc: remove dead code and fix code style issue remove dead code and fix code style issues, still need to rewrite the dma wait looping to wait event timeout. Signed-off-by: Mingjun --- drivers/mtd/devices/hs_sfc/flash_info.h | 95 ++++++++++----------------------- 1 file changed, 27 insertions(+), 68 deletions(-) (limited to 'drivers/mtd/devices/hs_sfc/flash_info.h') diff --git a/drivers/mtd/devices/hs_sfc/flash_info.h b/drivers/mtd/devices/hs_sfc/flash_info.h index 19b71165a3db..755e077adffa 100644 --- a/drivers/mtd/devices/hs_sfc/flash_info.h +++ b/drivers/mtd/devices/hs_sfc/flash_info.h @@ -1,48 +1,18 @@ -/****************************************************************************** - * Copyright (c) 2009-2010 HiC. - * All rights reserved. - * *** - * HiC 2010-12-18 +/* + * Hisilicon SFC supported flash chip list + * Copyright © 2012-2013 Linaro Ltd. * - ******************************************************************************/ + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + */ #ifndef _FLASH_INFO_H #define _FLASH_INFO_H #include - -/*****************************************************************************/ -#define _1K (0x400) -#define _2K (0x800) - -#define _4K (0x1000) -#define _8K (0x2000) -#define _16K (0x4000) -#define _32K (0x8000) - -#define _64K (0x10000) -#define _128K (0x20000) -#define _256K (0x40000) -#define _512K (0x80000) - -#define _1M (0x100000) -#define _2M (0x200000) -#define _4M (0x400000) -#define _8M (0x800000) - -#define _16M (0x1000000) -#define _32M (0x2000000) - -#define INFINITE (0xFFFFFFFF) -/*****************************************************************************/ -/* sector erase, 64K */ -#define SPI_IF_ERASE_SECTOR (0x01) -/* chip erase */ -#define SPI_IF_ERASE_CHIP (0x02) -/* 4K */ -#define SPI_IF_ERASE_4K (0x04) -/* 8K */ -#define SPI_IF_ERASE_8K (0x08) /*****************************************************************************/ /* Write Enable */ #define SPI_CMD_WREN 0x06 @@ -95,28 +65,16 @@ /* exit 4 bytes mode and clear 4 byte bit as '0' */ #define SPI_CMD_EX4B 0xE9 /*---------------------------------------------------------------------------*/ -enum { - HISFC_IFTYPE_STD, -#define HISFC_IFTYPE_STD HISFC_IFTYPE_STD - HISFC_IFTYPE_FAST, -#define HISFC_IFTYPE_FAST HISFC_IFTYPE_FAST - HISFC_IFTYPE_DUAL, -#define HISFC_IFTYPE_DUAL HISFC_IFTYPE_DUAL - HISFC_IFTYPE_DUAL_ADDR, -#define HISFC_IFTYPE_DUAL_ADDR HISFC_IFTYPE_DUAL_ADDR - HISFC_IFTYPE_DUAL_CMD, -#define HISFC_IFTYPE_DUAL_CMD HISFC_IFTYPE_DUAL_CMD - HISFC_IFTYPE_QUAD, -#define HISFC_IFTYPE_QUAD HISFC_IFTYPE_QUAD - HISFC_IFTYPE_QUAD_ADDR, -#define HISFC_IFTYPE_QUAD_ADDR HISFC_IFTYPE_QUAD_ADDR - HISFC_IFTYPE_QUAD_CMD, -#define HISFC_IFTYPE_QUAD_CMD HISFC_IFTYPE_QUAD_CMD - HISFC_IFTYPE_INVALID, -#define HISFC_IFTYPE_INVALID HISFC_IFTYPE_INVALID - HISFC_IFTYPE_MAX, -#define HISFC_IFTYPE_MAX HISFC_IFTYPE_MAX -}; +#define HISFC_IFTYPE_STD 0 +#define HISFC_IFTYPE_FAST 1 +#define HISFC_IFTYPE_DUAL 2 +#define HISFC_IFTYPE_DUAL_ADDR 3 +#define HISFC_IFTYPE_DUAL_CMD 4 +#define HISFC_IFTYPE_QUAD 5 +#define HISFC_IFTYPE_QUAD_ADDR 6 +#define HISFC_IFTYPE_QUAD_CMD 7 +#define HISFC_IFTYPE_INVALID 8 +#define HISFC_IFTYPE_MAX 9 #define RD(iftype, dummy, clk) \ { HISFC_IFTYPE_##iftype, SPI_CMD_READ_##iftype, dummy, clk } @@ -130,10 +88,10 @@ enum { /*****************************************************************************/ struct sfc_operation { - unsigned char iftype; - unsigned char cmd; - unsigned char dummy; - unsigned int clock; + u8 iftype; + u8 cmd; + u8 dummy; + u32 clock; }; struct flash_info { @@ -146,8 +104,9 @@ struct flash_info { u16 ext_id; u16 addr_width; - unsigned long erase_size; - unsigned long chip_size; + + u32 sector_size; /* erase size */ + u16 nr_sectors; struct sfc_operation read; struct sfc_operation write; @@ -156,6 +115,6 @@ struct flash_info { extern const struct flash_info hisfc_ids_table[]; -char *hisfc_get_iftype_str(int iftype); +extern char *hisfc_get_iftype_str(int iftype); /******************************************************************************/ #endif -- cgit v1.2.3