mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 15:12:36 +02:00
rayer_spi.c: Remove forward-declarations
Reorder functions to avoid forward-declarations. This was aimed to be done for all spi masters in the earlier patch however this file was missed. BUG=b:140394053 TEST=builds Change-Id: I0e3c82967a169d6a2512ffa17d1e0c78eafb2797 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/51555 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
51ae724a08
commit
5e0a9eadd2
99
rayer_spi.c
99
rayer_spi.c
@ -31,6 +31,11 @@
|
||||
#include "programmer.h"
|
||||
#include "hwaccess.h"
|
||||
|
||||
static uint16_t lpt_iobase;
|
||||
|
||||
/* Cached value of last byte sent. */
|
||||
static uint8_t lpt_outbyte;
|
||||
|
||||
/* We have two sets of pins, out and in. The numbers for both sets are
|
||||
* independent and are bitshift values, not real pin numbers.
|
||||
* Default settings are for the RayeR hardware.
|
||||
@ -59,8 +64,20 @@ static const struct rayer_pinout rayer_spipgm = {
|
||||
.miso_bit = 6,
|
||||
};
|
||||
|
||||
static void dlc5_preinit(const void *);
|
||||
static int dlc5_shutdown(void *);
|
||||
static void dlc5_preinit(const void *data) {
|
||||
msg_pdbg("dlc5_preinit\n");
|
||||
/* Assert pin 6 to receive MISO. */
|
||||
lpt_outbyte |= (1<<4);
|
||||
OUTB(lpt_outbyte, lpt_iobase);
|
||||
}
|
||||
|
||||
static int dlc5_shutdown(void *data) {
|
||||
msg_pdbg("dlc5_shutdown\n");
|
||||
/* De-assert pin 6 to force MISO low. */
|
||||
lpt_outbyte &= ~(1<<4);
|
||||
OUTB(lpt_outbyte, lpt_iobase);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct rayer_pinout xilinx_dlc5 = {
|
||||
.cs_bit = 2,
|
||||
@ -71,8 +88,18 @@ static const struct rayer_pinout xilinx_dlc5 = {
|
||||
.shutdown = dlc5_shutdown,
|
||||
};
|
||||
|
||||
static void byteblaster_preinit(const void *);
|
||||
static int byteblaster_shutdown(void *);
|
||||
static void byteblaster_preinit(const void *data){
|
||||
msg_pdbg("byteblaster_preinit\n");
|
||||
/* Assert #EN signal. */
|
||||
OUTB(2, lpt_iobase + 2 );
|
||||
}
|
||||
|
||||
static int byteblaster_shutdown(void *data){
|
||||
msg_pdbg("byteblaster_shutdown\n");
|
||||
/* De-Assert #EN signal. */
|
||||
OUTB(0, lpt_iobase + 2 );
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct rayer_pinout altera_byteblastermv = {
|
||||
.cs_bit = 1,
|
||||
@ -83,8 +110,20 @@ static const struct rayer_pinout altera_byteblastermv = {
|
||||
.shutdown = byteblaster_shutdown,
|
||||
};
|
||||
|
||||
static void stk200_preinit(const void *);
|
||||
static int stk200_shutdown(void *);
|
||||
static void stk200_preinit(const void *data) {
|
||||
msg_pdbg("stk200_init\n");
|
||||
/* Assert #EN signals, set LED signal. */
|
||||
lpt_outbyte = (1 << 6) ;
|
||||
OUTB(lpt_outbyte, lpt_iobase);
|
||||
}
|
||||
|
||||
static int stk200_shutdown(void *data) {
|
||||
msg_pdbg("stk200_shutdown\n");
|
||||
/* Assert #EN signals, clear LED signal. */
|
||||
lpt_outbyte = (1 << 2) | (1 << 3);
|
||||
OUTB(lpt_outbyte, lpt_iobase);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct rayer_pinout atmel_stk200 = {
|
||||
.cs_bit = 7,
|
||||
@ -121,11 +160,6 @@ static const struct rayer_programmer rayer_spi_types[] = {
|
||||
|
||||
static const struct rayer_pinout *pinout = NULL;
|
||||
|
||||
static uint16_t lpt_iobase;
|
||||
|
||||
/* Cached value of last byte sent. */
|
||||
static uint8_t lpt_outbyte;
|
||||
|
||||
static void rayer_bitbang_set_cs(int val)
|
||||
{
|
||||
lpt_outbyte &= ~(1 << pinout->cs_bit);
|
||||
@ -237,49 +271,6 @@ int rayer_spi_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void byteblaster_preinit(const void *data){
|
||||
msg_pdbg("byteblaster_preinit\n");
|
||||
/* Assert #EN signal. */
|
||||
OUTB(2, lpt_iobase + 2 );
|
||||
}
|
||||
|
||||
static int byteblaster_shutdown(void *data){
|
||||
msg_pdbg("byteblaster_shutdown\n");
|
||||
/* De-Assert #EN signal. */
|
||||
OUTB(0, lpt_iobase + 2 );
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void stk200_preinit(const void *data) {
|
||||
msg_pdbg("stk200_init\n");
|
||||
/* Assert #EN signals, set LED signal. */
|
||||
lpt_outbyte = (1 << 6) ;
|
||||
OUTB(lpt_outbyte, lpt_iobase);
|
||||
}
|
||||
|
||||
static int stk200_shutdown(void *data) {
|
||||
msg_pdbg("stk200_shutdown\n");
|
||||
/* Assert #EN signals, clear LED signal. */
|
||||
lpt_outbyte = (1 << 2) | (1 << 3);
|
||||
OUTB(lpt_outbyte, lpt_iobase);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dlc5_preinit(const void *data) {
|
||||
msg_pdbg("dlc5_preinit\n");
|
||||
/* Assert pin 6 to receive MISO. */
|
||||
lpt_outbyte |= (1<<4);
|
||||
OUTB(lpt_outbyte, lpt_iobase);
|
||||
}
|
||||
|
||||
static int dlc5_shutdown(void *data) {
|
||||
msg_pdbg("dlc5_shutdown\n");
|
||||
/* De-assert pin 6 to force MISO low. */
|
||||
lpt_outbyte &= ~(1<<4);
|
||||
OUTB(lpt_outbyte, lpt_iobase);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
#error PCI port I/O access is not supported on this architecture yet.
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user