Author: uwe Date: 2009-05-17 00:05:42 +0200 (Sun, 17 May 2009) New Revision: 521
Modified: trunk/82802ab.c trunk/am29f040b.c trunk/board_enable.c trunk/cbtable.c trunk/chipset_enable.c trunk/coreboot_tables.h trunk/dummyflasher.c trunk/en29f002a.c trunk/flash.h trunk/flashrom.c trunk/ichspi.c trunk/internal.c trunk/it87spi.c trunk/jedec.c trunk/layout.c trunk/mx29f002.c trunk/pm49fl00x.c trunk/sb600spi.c trunk/sharplhf00l04.c trunk/spi.c trunk/sst28sf040.c trunk/sst49lf040.c trunk/sst49lfxxxc.c trunk/sst_fwhub.c trunk/stm50flw0x0x.c trunk/udelay.c trunk/w39v040c.c trunk/w39v080fa.c trunk/w49f002u.c trunk/wbsio_spi.c Log: Drop unused/duplicated #includes and some dead code (trivial).
Build-tested on 32bit x86.
Signed-off-by: Uwe Hermann uwe@hermann-uwe.de Acked-by: Uwe Hermann uwe@hermann-uwe.de
Modified: trunk/82802ab.c =================================================================== --- trunk/82802ab.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/82802ab.c 2009-05-16 22:05:42 UTC (rev 521) @@ -26,9 +26,7 @@ * - Order number: 290658-004 */
-#include <stdio.h> #include <string.h> -#include <stdint.h> #include "flash.h"
// I need that Berkeley bit-map printer
Modified: trunk/am29f040b.c =================================================================== --- trunk/am29f040b.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/am29f040b.c 2009-05-16 22:05:42 UTC (rev 521) @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdio.h> -#include <stdint.h> #include "flash.h"
static __inline__ int erase_sector_29f040b(chipaddr bios,
Modified: trunk/board_enable.c =================================================================== --- trunk/board_enable.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/board_enable.c 2009-05-16 22:05:42 UTC (rev 521) @@ -24,9 +24,6 @@ * Contains the board specific flash enables. */
-#include <stdio.h> -#include <pci/pci.h> -#include <stdint.h> #include <string.h> #include <fcntl.h> #include "flash.h"
Modified: trunk/cbtable.c =================================================================== --- trunk/cbtable.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/cbtable.c 2009-05-16 22:05:42 UTC (rev 521) @@ -21,11 +21,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdio.h> -#include <stdint.h> #include <stdlib.h> #include <fcntl.h> -#include <unistd.h> #include <sys/types.h> #include <string.h> #include <errno.h>
Modified: trunk/chipset_enable.c =================================================================== --- trunk/chipset_enable.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/chipset_enable.c 2009-05-16 22:05:42 UTC (rev 521) @@ -25,14 +25,11 @@
#define _LARGEFILE64_SOURCE
-#include <stdio.h> -#include <pci/pci.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/mman.h> #include <fcntl.h> -#include <unistd.h> #include "flash.h"
unsigned long flashbase = 0;
Modified: trunk/coreboot_tables.h =================================================================== --- trunk/coreboot_tables.h 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/coreboot_tables.h 2009-05-16 22:05:42 UTC (rev 521) @@ -48,22 +48,6 @@ uint32_t hi; };
-static inline uint64_t unpack_lb64(struct lb_uint64 value) -{ - uint64_t result; - result = value.hi; - result = (result << 32) + value.lo; - return result; -} - -static inline struct lb_uint64 pack_lb64(uint64_t value) -{ - struct lb_uint64 result; - result.lo = (value >> 0) & 0xffffffff; - result.hi = (value >> 32) & 0xffffffff; - return result; -} - struct lb_header { uint8_t signature[4]; /* LBIO */ uint32_t header_bytes; @@ -142,76 +126,4 @@ uint64_t forward; };
-/* The following structures are for the cmos definitions table */ -#define LB_TAG_CMOS_OPTION_TABLE 200 -/* cmos header record */ -struct cmos_option_table { - uint32_t tag; /* CMOS definitions table type */ - uint32_t size; /* size of the entire table */ - uint32_t header_length; /* length of header */ -}; - -/* cmos entry record - This record is variable length. The name field may be - shorter than CMOS_MAX_NAME_LENGTH. The entry may start - anywhere in the byte, but can not span bytes unless it - starts at the beginning of the byte and the length is - fills complete bytes. -*/ -#define LB_TAG_OPTION 201 -struct cmos_entries { - uint32_t tag; /* entry type */ - uint32_t size; /* length of this record */ - uint32_t bit; /* starting bit from start of image */ - uint32_t length; /* length of field in bits */ - uint32_t config; /* e=enumeration, h=hex, r=reserved */ - uint32_t config_id; /* a number linking to an enumeration record */ -#define CMOS_MAX_NAME_LENGTH 32 - uint8_t name[CMOS_MAX_NAME_LENGTH]; /* name of entry in ascii, - variable length int aligned */ -}; - -/* cmos enumerations record - This record is variable length. The text field may be - shorter than CMOS_MAX_TEXT_LENGTH. -*/ -#define LB_TAG_OPTION_ENUM 202 -struct cmos_enums { - uint32_t tag; /* enumeration type */ - uint32_t size; /* length of this record */ - uint32_t config_id; /* a number identifying the config id */ - uint32_t value; /* the value associated with the text */ -#define CMOS_MAX_TEXT_LENGTH 32 - uint8_t text[CMOS_MAX_TEXT_LENGTH]; /* enum description in ascii, - variable length int aligned */ -}; - -/* cmos defaults record - This record contains default settings for the cmos ram. -*/ -#define LB_TAG_OPTION_DEFAULTS 203 -struct cmos_defaults { - uint32_t tag; /* default type */ - uint32_t size; /* length of this record */ - uint32_t name_length; /* length of the following name field */ - uint8_t name[CMOS_MAX_NAME_LENGTH]; /* name identifying the default */ -#define CMOS_IMAGE_BUFFER_SIZE 128 - uint8_t default_set[CMOS_IMAGE_BUFFER_SIZE]; /* default settings */ -}; - -#define LB_TAG_OPTION_CHECKSUM 204 -struct cmos_checksum { - uint32_t tag; - uint32_t size; - /* In practice everything is byte aligned, but things are measured - * in bits to be consistent. - */ - uint32_t range_start; /* First bit that is checksummed (byte aligned) */ - uint32_t range_end; /* Last bit that is checksummed (byte aligned) */ - uint32_t location; /* First bit of the checksum (byte aligned) */ - uint32_t type; /* Checksum algorithm that is used */ -#define CHECKSUM_NONE 0 -#define CHECKSUM_PCBIOS 1 -}; - #endif /* COREBOOT_TABLES_H */
Modified: trunk/dummyflasher.c =================================================================== --- trunk/dummyflasher.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/dummyflasher.c 2009-05-16 22:05:42 UTC (rev 521) @@ -18,14 +18,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdint.h> #include <string.h> #include <stdlib.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #include <errno.h> -#include <pci/pci.h> #include "flash.h"
int dummy_init(void)
Modified: trunk/en29f002a.c =================================================================== --- trunk/en29f002a.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/en29f002a.c 2009-05-16 22:05:42 UTC (rev 521) @@ -26,8 +26,6 @@ * EN29LV040(A) has 1C,4F and uses short F0 reset sequence */
-#include <stdio.h> -#include <stdint.h> #include "flash.h"
int probe_en29f512(struct flashchip *flash)
Modified: trunk/flash.h =================================================================== --- trunk/flash.h 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/flash.h 2009-05-16 22:05:42 UTC (rev 521) @@ -548,13 +548,6 @@ void myusec_delay(int time); void myusec_calibrate_delay(void);
-/* PCI handling for board/chipset_enable */ -struct pci_access *pacc; -struct pci_dev *pci_dev_find_filter(struct pci_filter filter); -struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device); -struct pci_dev *pci_card_find(uint16_t vendor, uint16_t device, - uint16_t card_vendor, uint16_t card_device); - /* pcidev.c */ #define PCI_OK 0 #define PCI_NT 1 /* Not tested */ @@ -607,6 +600,10 @@ void physunmap(void *virt_addr, size_t len);
/* internal.c */ +struct pci_dev *pci_dev_find_filter(struct pci_filter filter); +struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device); +struct pci_dev *pci_card_find(uint16_t vendor, uint16_t device, + uint16_t card_vendor, uint16_t card_device); void get_io_perms(void); int internal_init(void); int internal_shutdown(void);
Modified: trunk/flashrom.c =================================================================== --- trunk/flashrom.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/flashrom.c 2009-05-16 22:05:42 UTC (rev 521) @@ -24,8 +24,6 @@ #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> -#include <unistd.h> -#include <stdio.h> #include <string.h> #include <stdlib.h> #include <getopt.h>
Modified: trunk/ichspi.c =================================================================== --- trunk/ichspi.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/ichspi.c 2009-05-16 22:05:42 UTC (rev 521) @@ -32,11 +32,8 @@ * */
-#include <stdio.h> #include <string.h> -#include <stdint.h> #include <sys/mman.h> -#include <pci/pci.h> #include "flash.h" #include "spi.h"
Modified: trunk/internal.c =================================================================== --- trunk/internal.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/internal.c 2009-05-16 22:05:42 UTC (rev 521) @@ -25,15 +25,12 @@ #include <sys/types.h> #include <sys/stat.h> #include <errno.h> -#include <pci/pci.h> #include "flash.h"
#if defined(__FreeBSD__) || defined(__DragonFly__) int io_fd; #endif
-struct pci_access *pacc; /* For board and chipset_enable */ - struct pci_dev *pci_dev_find_filter(struct pci_filter filter) { struct pci_dev *temp;
Modified: trunk/it87spi.c =================================================================== --- trunk/it87spi.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/it87spi.c 2009-05-16 22:05:42 UTC (rev 521) @@ -23,9 +23,6 @@ * Contains the ITE IT87* SPI specific routines */
-#include <stdio.h> -#include <pci/pci.h> -#include <stdint.h> #include <string.h> #include "flash.h" #include "spi.h"
Modified: trunk/jedec.c =================================================================== --- trunk/jedec.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/jedec.c 2009-05-16 22:05:42 UTC (rev 521) @@ -21,8 +21,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdio.h> -#include <stdint.h> #include "flash.h"
#define MAX_REFLASH_TRIES 0x10
Modified: trunk/layout.c =================================================================== --- trunk/layout.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/layout.c 2009-05-16 22:05:42 UTC (rev 521) @@ -18,11 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> -#include <stdint.h> #include "flash.h"
char *mainboard_vendor = NULL;
Modified: trunk/mx29f002.c =================================================================== --- trunk/mx29f002.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/mx29f002.c 2009-05-16 22:05:42 UTC (rev 521) @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdio.h> -#include <stdint.h> #include "flash.h"
int probe_29f002(struct flashchip *flash)
Modified: trunk/pm49fl00x.c =================================================================== --- trunk/pm49fl00x.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/pm49fl00x.c 2009-05-16 22:05:42 UTC (rev 521) @@ -20,7 +20,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdio.h> #include "flash.h"
extern int exclude_start_page, exclude_end_page;
Modified: trunk/sb600spi.c =================================================================== --- trunk/sb600spi.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/sb600spi.c 2009-05-16 22:05:42 UTC (rev 521) @@ -20,11 +20,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdio.h> #include <string.h> -#include <stdint.h> #include <sys/mman.h> -#include <pci/pci.h> #include "flash.h" #include "spi.h"
Modified: trunk/sharplhf00l04.c =================================================================== --- trunk/sharplhf00l04.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/sharplhf00l04.c 2009-05-16 22:05:42 UTC (rev 521) @@ -18,7 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdio.h> #include <stdlib.h> #include "flash.h"
Modified: trunk/spi.c =================================================================== --- trunk/spi.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/spi.c 2009-05-16 22:05:42 UTC (rev 521) @@ -22,9 +22,6 @@ * Contains the generic SPI framework */
-#include <stdio.h> -#include <pci/pci.h> -#include <stdint.h> #include <string.h> #include "flash.h" #include "spi.h"
Modified: trunk/sst28sf040.c =================================================================== --- trunk/sst28sf040.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/sst28sf040.c 2009-05-16 22:05:42 UTC (rev 521) @@ -19,8 +19,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdio.h> -#include <stdint.h> #include "flash.h"
#define AUTO_PG_ERASE1 0x20
Modified: trunk/sst49lf040.c =================================================================== --- trunk/sst49lf040.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/sst49lf040.c 2009-05-16 22:05:42 UTC (rev 521) @@ -18,7 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdio.h> #include "flash.h"
int erase_49lf040(struct flashchip *flash)
Modified: trunk/sst49lfxxxc.c =================================================================== --- trunk/sst49lfxxxc.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/sst49lfxxxc.c 2009-05-16 22:05:42 UTC (rev 521) @@ -22,10 +22,7 @@ #include <errno.h> #include <fcntl.h> #include <sys/mman.h> -#include <unistd.h> -#include <stdio.h> #include <stdlib.h> -#include <stdint.h> #include "flash.h"
#define SECTOR_ERASE 0x30
Modified: trunk/sst_fwhub.c =================================================================== --- trunk/sst_fwhub.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/sst_fwhub.c 2009-05-16 22:05:42 UTC (rev 521) @@ -20,7 +20,6 @@
/* Adapted from the Intel FW hub stuff for 82802ax parts. */
-#include <stdio.h> #include "flash.h"
// I need that Berkeley bit-map printer
Modified: trunk/stm50flw0x0x.c =================================================================== --- trunk/stm50flw0x0x.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/stm50flw0x0x.c 2009-05-16 22:05:42 UTC (rev 521) @@ -26,9 +26,7 @@ * ST M50FLW080B (not yet tested) */
-#include <stdio.h> #include <string.h> -#include <stdint.h> #include "flash.h"
void protect_stm50flw0x0x(chipaddr bios)
Modified: trunk/udelay.c =================================================================== --- trunk/udelay.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/udelay.c 2009-05-16 22:05:42 UTC (rev 521) @@ -19,7 +19,6 @@ */
#include <sys/time.h> -#include <stdio.h> #include "flash.h"
// count to a billion. Time it. If it's < 1 sec, count to 10B, etc.
Modified: trunk/w39v040c.c =================================================================== --- trunk/w39v040c.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/w39v040c.c 2009-05-16 22:05:42 UTC (rev 521) @@ -18,7 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdio.h> #include "flash.h"
int probe_w39v040c(struct flashchip *flash)
Modified: trunk/w39v080fa.c =================================================================== --- trunk/w39v080fa.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/w39v080fa.c 2009-05-16 22:05:42 UTC (rev 521) @@ -18,7 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdio.h> #include "flash.h"
int probe_winbond_fwhub(struct flashchip *flash)
Modified: trunk/w49f002u.c =================================================================== --- trunk/w49f002u.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/w49f002u.c 2009-05-16 22:05:42 UTC (rev 521) @@ -18,7 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdio.h> #include "flash.h"
int write_49f002(struct flashchip *flash, uint8_t *buf)
Modified: trunk/wbsio_spi.c =================================================================== --- trunk/wbsio_spi.c 2009-05-16 21:39:19 UTC (rev 520) +++ trunk/wbsio_spi.c 2009-05-16 22:05:42 UTC (rev 521) @@ -17,9 +17,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include <stdio.h> -#include <pci/pci.h> -#include <stdint.h> #include <string.h> #include "flash.h" #include "spi.h"