1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-10-17 15:51:53 +02:00

parallel.h: Extract parallel declarations to a separate header

This patch moves all the declarations relevant to parallel into their own
header in include/parallel.h
The corresponding functions implementations are already in parallel.c,
so the declarations naturally can be in parallel.h
Currently, most of the declarations reside in flash.h making it difficult
to really understand file dependency.

Change-Id: I69f6e224a7ece373fbd6606e802930a52da1dd85
Signed-off-by: Antonio Vázquez <antoniovazquezblanco@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/89503
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Antonio Vázquez
2025-10-09 21:47:26 +02:00
committed by Anastasia Klimchuk
parent 3461f65b23
commit 08d9c383ac
14 changed files with 33 additions and 11 deletions

View File

@@ -24,6 +24,7 @@
#include <stdbool.h>
#include "flash.h"
#include "parallel.h"
#include "chipdrivers.h"
void print_status_82802ab(uint8_t status)

View File

@@ -16,6 +16,7 @@
*/
#include "flash.h"
#include "parallel.h"
#include "chipdrivers.h"
/*

View File

@@ -30,6 +30,7 @@
#include <ctype.h>
#include "flash.h"
#include "parallel.h"
#include "flashchips.h"
#include "programmer.h"
#include "hwaccess_physmap.h"

View File

@@ -645,16 +645,6 @@ struct flashrom_flashctx {
extern const struct flashchip flashchips[];
extern const unsigned int flashchips_size;
/* parallel.c */
void chip_writeb(const struct flashctx *flash, uint8_t val, chipaddr addr);
void chip_writew(const struct flashctx *flash, uint16_t val, chipaddr addr);
void chip_writel(const struct flashctx *flash, uint32_t val, chipaddr addr);
void chip_writen(const struct flashctx *flash, const uint8_t *buf, chipaddr addr, size_t len);
uint8_t chip_readb(const struct flashctx *flash, const chipaddr addr);
uint16_t chip_readw(const struct flashctx *flash, const chipaddr addr);
uint32_t chip_readl(const struct flashctx *flash, const chipaddr addr);
void chip_readn(const struct flashctx *flash, uint8_t *buf, const chipaddr addr, size_t len);
/* print.c */
int print_supported(void);

21
include/parallel.h Normal file
View File

@@ -0,0 +1,21 @@
/*
* This file is part of the flashrom project.
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef __PARALLEL_H__
#define __PARALLEL_H__ 1
#include "flash.h"
void chip_writeb(const struct flashctx *flash, uint8_t val, chipaddr addr);
void chip_writew(const struct flashctx *flash, uint16_t val, chipaddr addr);
void chip_writel(const struct flashctx *flash, uint32_t val, chipaddr addr);
void chip_writen(const struct flashctx *flash, const uint8_t *buf, chipaddr addr, size_t len);
uint8_t chip_readb(const struct flashctx *flash, const chipaddr addr);
uint16_t chip_readw(const struct flashctx *flash, const chipaddr addr);
uint32_t chip_readl(const struct flashctx *flash, const chipaddr addr);
void chip_readn(const struct flashctx *flash, uint8_t *buf, const chipaddr addr, size_t len);
#endif /* !__PARALLEL_H__ */

View File

@@ -20,6 +20,7 @@
*/
#include "flash.h"
#include "parallel.h"
#include "chipdrivers.h"
#define MAX_REFLASH_TRIES 0x10

View File

@@ -19,7 +19,7 @@
* GNU General Public License for more details.
*/
#include "flash.h"
#include "parallel.h"
#include "programmer.h"
void chip_writeb(const struct flashctx *flash, uint8_t val, chipaddr addr)

View File

@@ -20,6 +20,7 @@
*/
#include "flash.h"
#include "parallel.h"
#include "chipdrivers.h"

View File

@@ -17,6 +17,7 @@
*/
#include "flash.h"
#include "parallel.h"
#include "chipdrivers.h"
#define AUTO_PG_ERASE1 0x20

View File

@@ -17,6 +17,7 @@
*/
#include "flash.h"
#include "parallel.h"
#include "chipdrivers.h"
int erase_sector_49lfxxxc(struct flashctx *flash, unsigned int address,

View File

@@ -19,6 +19,7 @@
/* Adapted from the Intel FW hub stuff for 82802ax parts. */
#include "flash.h"
#include "parallel.h"
#include "chipdrivers.h"
static int check_sst_fwhub_block_lock(struct flashctx *flash, unsigned int offset)

View File

@@ -23,6 +23,7 @@
*/
#include "flash.h"
#include "parallel.h"
#include "chipdrivers.h"
static int stm50_erase_sector(struct flashctx *flash, unsigned int addr)

View File

@@ -18,6 +18,7 @@
#include <stdbool.h>
#include "flash.h"
#include "parallel.h"
#include "chipdrivers.h"
bool w29ee011_can_override(const char *const chip_name, const char *const override_chip)

1
w39.c
View File

@@ -16,6 +16,7 @@
*/
#include "flash.h"
#include "parallel.h"
#include "chipdrivers.h"
static uint8_t w39_idmode_readb(struct flashctx *flash, unsigned int offset)