xref: /aosp_15_r20/external/flashrom/sst49lfxxxc.c (revision 0d6140be3aa665ecc836e8907834fcd3e3b018fc)
1 /*
2  * This file is part of the flashrom project.
3  *
4  * Copyright (C) 2000 Silicon Integrated System Corporation
5  * Copyright (C) 2005-2007 coresystems GmbH
6  * Copyright (C) 2009 Sean Nelson <[email protected]>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  */
18 
19 #include "flash.h"
20 #include "chipdrivers.h"
21 
erase_sector_49lfxxxc(struct flashctx * flash,unsigned int address,unsigned int sector_size)22 int erase_sector_49lfxxxc(struct flashctx *flash, unsigned int address,
23 			  unsigned int sector_size)
24 {
25 	uint8_t status;
26 	chipaddr bios = flash->virtual_memory;
27 
28 	chip_writeb(flash, 0x30, bios);
29 	chip_writeb(flash, 0xD0, bios + address);
30 
31 	status = wait_82802ab(flash);
32 	print_status_82802ab(status);
33 
34 	/* FIXME: Check the status register for errors. */
35 	return 0;
36 }
37