mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-26 22:52:34 +02:00
Move SPI declarations from flash.h to spi.h
As a consecuence, some of the files that used to include flash.h no longer need to do so. For this reason, flash.h includes are also deleted in this commit. Change-Id: I794a71536a3b85fde39f83c802fa0f5dd8d428e0 Signed-off-by: Antonio Vázquez Blanco <antoniovazquezblanco@gmail.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/85539 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: David Reguera Garcia (Dreg) <regueragarciadavid@gmail.com> Reviewed-by: Matti Finder <matti.finder@gmail.com>
This commit is contained in:
parent
971ea27d16
commit
ce825859c4
@ -15,7 +15,6 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "flash.h"
|
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "hwaccess_x86_io.h"
|
#include "hwaccess_x86_io.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
|
1
at45db.c
1
at45db.c
@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "chipdrivers.h"
|
#include "chipdrivers.h"
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <libusb.h>
|
#include <libusb.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "chipdrivers.h"
|
#include "chipdrivers.h"
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "chipdrivers.h"
|
#include "chipdrivers.h"
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "flashchips.h"
|
#include "flashchips.h"
|
||||||
|
2
edi.c
2
edi.c
@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "flash.h"
|
#include "spi.h"
|
||||||
#include "chipdrivers.h"
|
#include "chipdrivers.h"
|
||||||
#include "ene.h"
|
#include "ene.h"
|
||||||
#include "edi.h"
|
#include "edi.h"
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
#include <ftdi.h>
|
#include <ftdi.h>
|
||||||
|
1
ichspi.c
1
ichspi.c
@ -22,7 +22,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "hwaccess_physmap.h"
|
#include "hwaccess_physmap.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#define __CLI_OUTPUT_H__
|
#define __CLI_OUTPUT_H__
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <flash.h>
|
#include "flash.h"
|
||||||
|
|
||||||
extern enum flashrom_log_level verbose_screen;
|
extern enum flashrom_log_level verbose_screen;
|
||||||
extern enum flashrom_log_level verbose_logfile;
|
extern enum flashrom_log_level verbose_logfile;
|
||||||
|
@ -758,15 +758,4 @@ __attribute__((format(printf, 2, 3)));
|
|||||||
void init_progress(struct flashctx *flash, enum flashrom_progress_stage stage, size_t total);
|
void init_progress(struct flashctx *flash, enum flashrom_progress_stage stage, size_t total);
|
||||||
void update_progress(struct flashctx *flash, enum flashrom_progress_stage stage, size_t increment);
|
void update_progress(struct flashctx *flash, enum flashrom_progress_stage stage, size_t increment);
|
||||||
|
|
||||||
/* spi.c */
|
|
||||||
struct spi_command {
|
|
||||||
unsigned int writecnt;
|
|
||||||
unsigned int readcnt;
|
|
||||||
const unsigned char *writearr;
|
|
||||||
unsigned char *readarr;
|
|
||||||
};
|
|
||||||
#define NULL_SPI_CMD { 0, 0, NULL, NULL, }
|
|
||||||
int spi_send_command(const struct flashctx *flash, unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr);
|
|
||||||
int spi_send_multicommand(const struct flashctx *flash, struct spi_command *cmds);
|
|
||||||
|
|
||||||
#endif /* !__FLASH_H__ */
|
#endif /* !__FLASH_H__ */
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "flash.h" /* for chipaddr and flashctx */
|
#include "spi.h"
|
||||||
|
|
||||||
enum programmer_type {
|
enum programmer_type {
|
||||||
PCI = 1, /* to detect uninitialized values */
|
PCI = 1, /* to detect uninitialized values */
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
#ifndef __SPI_H__
|
#ifndef __SPI_H__
|
||||||
#define __SPI_H__ 1
|
#define __SPI_H__ 1
|
||||||
|
|
||||||
|
#include "flash.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Contains the generic SPI headers
|
* Contains the generic SPI headers
|
||||||
*/
|
*/
|
||||||
@ -235,6 +237,16 @@
|
|||||||
#define SPI_FLASHROM_BUG -5
|
#define SPI_FLASHROM_BUG -5
|
||||||
#define SPI_PROGRAMMER_ERROR -6
|
#define SPI_PROGRAMMER_ERROR -6
|
||||||
|
|
||||||
|
struct spi_command {
|
||||||
|
unsigned int writecnt;
|
||||||
|
unsigned int readcnt;
|
||||||
|
const unsigned char *writearr;
|
||||||
|
unsigned char *readarr;
|
||||||
|
};
|
||||||
|
#define NULL_SPI_CMD { 0, 0, NULL, NULL, }
|
||||||
|
int spi_send_command(const struct flashctx *flash, unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr);
|
||||||
|
int spi_send_multicommand(const struct flashctx *flash, struct spi_command *cmds);
|
||||||
|
|
||||||
void clear_spi_id_cache(void);
|
void clear_spi_id_cache(void);
|
||||||
|
|
||||||
#endif /* !__SPI_H__ */
|
#endif /* !__SPI_H__ */
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "chipdrivers.h"
|
#include "chipdrivers.h"
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "hwaccess_physmap.h"
|
#include "hwaccess_physmap.h"
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <libjaylink/libjaylink.h>
|
#include <libjaylink/libjaylink.h>
|
||||||
|
|
||||||
#include "flash.h"
|
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "chipdrivers.h"
|
#include "chipdrivers.h"
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "flash.h"
|
|
||||||
#include "i2c_helper.h"
|
#include "i2c_helper.h"
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <linux/i2c-dev.h>
|
#include <linux/i2c-dev.h>
|
||||||
#include <linux/i2c.h>
|
#include <linux/i2c.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
|
|
||||||
|
@ -29,8 +29,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ni845x.h>
|
#include <ni845x.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "flash.h"
|
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "hwaccess_physmap.h"
|
#include "hwaccess_physmap.h"
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <libusb.h>
|
#include <libusb.h>
|
||||||
|
|
||||||
#include "flash.h"
|
|
||||||
#include "chipdrivers.h"
|
#include "chipdrivers.h"
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
|
2
rpmc.c
2
rpmc.c
@ -15,7 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "rpmc.h"
|
#include "rpmc.h"
|
||||||
#include "flash.h"
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -23,6 +22,7 @@
|
|||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "spi.h"
|
||||||
|
|
||||||
// OP1 commands
|
// OP1 commands
|
||||||
#define RPMC_WRITE_ROOT_KEY_MSG_LENGTH (RPMC_OP1_MSG_HEADER_LENGTH + RPMC_HMAC_KEY_LENGTH + RPMC_TRUNCATED_SIG_LENGTH)
|
#define RPMC_WRITE_ROOT_KEY_MSG_LENGTH (RPMC_OP1_MSG_HEADER_LENGTH + RPMC_HMAC_KEY_LENGTH + RPMC_TRUNCATED_SIG_LENGTH)
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "hwaccess_physmap.h"
|
#include "hwaccess_physmap.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
|
1
sfdp.c
1
sfdp.c
@ -16,7 +16,6 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
#include "chipdrivers.h"
|
#include "chipdrivers.h"
|
||||||
|
|
||||||
|
4
spi.c
4
spi.c
@ -18,13 +18,13 @@
|
|||||||
* Contains the generic SPI framework
|
* Contains the generic SPI framework
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "spi.h"
|
||||||
|
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "flashchips.h"
|
#include "flashchips.h"
|
||||||
#include "chipdrivers.h"
|
#include "chipdrivers.h"
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "spi.h"
|
|
||||||
|
|
||||||
static int default_spi_send_command(const struct flashctx *flash, unsigned int writecnt,
|
static int default_spi_send_command(const struct flashctx *flash, unsigned int writecnt,
|
||||||
unsigned int readcnt,
|
unsigned int readcnt,
|
||||||
|
1
spi25.c
1
spi25.c
@ -21,7 +21,6 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "flashchips.h"
|
#include "flashchips.h"
|
||||||
#include "chipdrivers.h"
|
#include "chipdrivers.h"
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "flash.h"
|
|
||||||
#include "chipdrivers.h"
|
#include "chipdrivers.h"
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
* https://www.st.com/en/development-tools/stlink-v3-bridge.html
|
* https://www.st.com/en/development-tools/stlink-v3-bridge.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "flash.h"
|
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
#include "usbdev.h"
|
#include "usbdev.h"
|
||||||
|
@ -35,7 +35,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <ftdi.h>
|
#include <ftdi.h>
|
||||||
#include "flash.h"
|
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "flash.h"
|
|
||||||
#include "chipdrivers.h"
|
#include "chipdrivers.h"
|
||||||
#include "programmer.h"
|
#include "programmer.h"
|
||||||
#include "hwaccess_physmap.h"
|
#include "hwaccess_physmap.h"
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
#include "flash.h"
|
|
||||||
#include "libflashrom.h"
|
#include "libflashrom.h"
|
||||||
#include "chipdrivers.h"
|
#include "chipdrivers.h"
|
||||||
#include "writeprotect.h"
|
#include "writeprotect.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user