mirror of
				https://review.coreboot.org/flashrom.git
				synced 2025-11-04 07:00:39 +01:00 
			
		
		
		
	Unify write_39sf020() and write_49f002() functions
The write_39sf020() and write_49f002() functions are identical except for whitespace differences, so drop one of them. Corresponding to flashrom svn r497. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
		
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							@@ -30,7 +30,7 @@ endif
 | 
			
		||||
LDFLAGS += -lpci -lz
 | 
			
		||||
 | 
			
		||||
OBJS = chipset_enable.o board_enable.o udelay.o jedec.o stm50flw0x0x.o \
 | 
			
		||||
	sst28sf040.o am29f040b.o mx29f002.o sst39sf020.o m29f400bt.o \
 | 
			
		||||
	sst28sf040.o am29f040b.o mx29f002.o m29f400bt.o \
 | 
			
		||||
	w49f002u.o 82802ab.o pm49fl00x.o sst49lf040.o en29f002a.o \
 | 
			
		||||
	sst49lfxxxc.o sst_fwhub.o layout.o cbtable.o flashchips.o physmap.o \
 | 
			
		||||
	flashrom.o w39v080fa.o sharplhf00l04.o w29ee011.o spi.o it87spi.o \
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										24
									
								
								flashchips.c
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								flashchips.c
									
									
									
									
									
								
							@@ -1322,7 +1322,7 @@ struct flashchip flashchips[] = {
 | 
			
		||||
		.tested		= TEST_OK_PREW,
 | 
			
		||||
		.probe		= probe_jedec,
 | 
			
		||||
		.erase		= erase_chip_jedec,
 | 
			
		||||
		.write		= write_39sf020,
 | 
			
		||||
		.write		= write_49f002,
 | 
			
		||||
		.read		= read_memmapped,
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
@@ -1336,7 +1336,7 @@ struct flashchip flashchips[] = {
 | 
			
		||||
		.tested		= TEST_OK_PREW,
 | 
			
		||||
		.probe		= probe_jedec,
 | 
			
		||||
		.erase		= erase_chip_jedec,
 | 
			
		||||
		.write		= write_39sf020,
 | 
			
		||||
		.write		= write_49f002,
 | 
			
		||||
		.read		= read_memmapped,
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
@@ -1350,7 +1350,7 @@ struct flashchip flashchips[] = {
 | 
			
		||||
		.tested		= TEST_OK_PREW,
 | 
			
		||||
		.probe		= probe_jedec,
 | 
			
		||||
		.erase		= erase_chip_jedec,
 | 
			
		||||
		.write		= write_39sf020,
 | 
			
		||||
		.write		= write_49f002,
 | 
			
		||||
		.read		= read_memmapped,
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
@@ -1364,7 +1364,7 @@ struct flashchip flashchips[] = {
 | 
			
		||||
		.tested		= TEST_UNTESTED,
 | 
			
		||||
		.probe		= probe_jedec,
 | 
			
		||||
		.erase		= erase_chip_jedec,
 | 
			
		||||
		.write		= write_39sf020,
 | 
			
		||||
		.write		= write_49f002,
 | 
			
		||||
		.read		= read_memmapped,
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
@@ -1378,7 +1378,7 @@ struct flashchip flashchips[] = {
 | 
			
		||||
		.tested		= TEST_UNTESTED,
 | 
			
		||||
		.probe		= probe_jedec,
 | 
			
		||||
		.erase		= erase_chip_jedec,
 | 
			
		||||
		.write		= write_39sf020,
 | 
			
		||||
		.write		= write_49f002,
 | 
			
		||||
		.read		= read_memmapped,
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
@@ -1392,7 +1392,7 @@ struct flashchip flashchips[] = {
 | 
			
		||||
		.tested		= TEST_OK_PREW,
 | 
			
		||||
		.probe		= probe_jedec,
 | 
			
		||||
		.erase		= erase_chip_jedec,
 | 
			
		||||
		.write		= write_39sf020,
 | 
			
		||||
		.write		= write_49f002,
 | 
			
		||||
		.read		= read_memmapped,
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
@@ -1406,7 +1406,7 @@ struct flashchip flashchips[] = {
 | 
			
		||||
		.tested		= TEST_OK_PROBE,
 | 
			
		||||
		.probe		= probe_jedec,
 | 
			
		||||
		.erase		= erase_chip_jedec,
 | 
			
		||||
		.write		= write_39sf020,
 | 
			
		||||
		.write		= write_49f002,
 | 
			
		||||
		.read		= read_memmapped,
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
@@ -1420,7 +1420,7 @@ struct flashchip flashchips[] = {
 | 
			
		||||
		.tested		= TEST_UNTESTED,
 | 
			
		||||
		.probe		= probe_jedec,
 | 
			
		||||
		.erase		= erase_chip_jedec,
 | 
			
		||||
		.write		= write_39sf020,
 | 
			
		||||
		.write		= write_49f002,
 | 
			
		||||
		.read		= read_memmapped,
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
@@ -2134,7 +2134,7 @@ struct flashchip flashchips[] = {
 | 
			
		||||
		.tested		= TEST_UNTESTED,
 | 
			
		||||
		.probe		= probe_jedec,
 | 
			
		||||
		.erase		= erase_chip_jedec,
 | 
			
		||||
		.write		= write_39sf020,
 | 
			
		||||
		.write		= write_49f002,
 | 
			
		||||
		.read		= read_memmapped,
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
@@ -2148,7 +2148,7 @@ struct flashchip flashchips[] = {
 | 
			
		||||
		.tested		= TEST_OK_PREW,
 | 
			
		||||
		.probe		= probe_jedec,
 | 
			
		||||
		.erase		= erase_chip_jedec,
 | 
			
		||||
		.write		= write_39sf020,
 | 
			
		||||
		.write		= write_49f002,
 | 
			
		||||
		.read		= read_memmapped,
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
@@ -2176,7 +2176,7 @@ struct flashchip flashchips[] = {
 | 
			
		||||
		.tested		= TEST_OK_PREW,
 | 
			
		||||
		.probe		= probe_jedec,
 | 
			
		||||
		.erase		= erase_chip_jedec,
 | 
			
		||||
		.write		= write_39sf020,
 | 
			
		||||
		.write		= write_49f002,
 | 
			
		||||
		.read		= read_memmapped,
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
@@ -2190,7 +2190,7 @@ struct flashchip flashchips[] = {
 | 
			
		||||
		.tested		= TEST_OK_PREW,
 | 
			
		||||
		.probe		= probe_jedec,
 | 
			
		||||
		.erase		= erase_chip_jedec,
 | 
			
		||||
		.write		= write_39sf020,
 | 
			
		||||
		.write		= write_49f002,
 | 
			
		||||
		.read		= read_memmapped,
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										46
									
								
								sst39sf020.c
									
									
									
									
									
								
							
							
						
						
									
										46
									
								
								sst39sf020.c
									
									
									
									
									
								
							@@ -1,46 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * This file is part of the flashrom project.
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2000 Silicon Integrated System Corporation
 | 
			
		||||
 *
 | 
			
		||||
 * 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.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program; if not, write to the Free Software
 | 
			
		||||
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
#include "flash.h"
 | 
			
		||||
 | 
			
		||||
int write_39sf020(struct flashchip *flash, uint8_t *buf)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
	int total_size = flash->total_size * 1024;
 | 
			
		||||
	int page_size = flash->page_size;
 | 
			
		||||
	volatile uint8_t *bios = flash->virtual_memory;
 | 
			
		||||
 | 
			
		||||
	erase_chip_jedec(flash);
 | 
			
		||||
 | 
			
		||||
	printf("Programming page: ");
 | 
			
		||||
	for (i = 0; i < total_size / page_size; i++) {
 | 
			
		||||
		/* write to the sector */
 | 
			
		||||
		printf("%04d at address: 0x%08x", i, i * page_size);
 | 
			
		||||
		write_sector_jedec(bios, buf + i * page_size,
 | 
			
		||||
				   bios + i * page_size, page_size);
 | 
			
		||||
		printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
 | 
			
		||||
		fflush(stdout);
 | 
			
		||||
	}
 | 
			
		||||
	printf("\n");
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -32,8 +32,8 @@ int write_49f002(struct flashchip *flash, uint8_t *buf)
 | 
			
		||||
 | 
			
		||||
	printf("Programming page: ");
 | 
			
		||||
	for (i = 0; i < total_size / page_size; i++) {
 | 
			
		||||
		/* write to the sector */
 | 
			
		||||
		printf("%04d at address: 0x%08x ", i, i * page_size);
 | 
			
		||||
		/* Byte-wise writing of 'page_size' bytes. */
 | 
			
		||||
		write_sector_jedec(bios, buf + i * page_size,
 | 
			
		||||
				   bios + i * page_size, page_size);
 | 
			
		||||
		printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user