Include serprog.h and BUS_SPI
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
This commit is contained in:
parent
6ae16a672a
commit
eeaf99974a
4
Makefile
4
Makefile
|
@ -104,7 +104,7 @@ $(DMP): $(ELF)
|
|||
%.bin: %.elf
|
||||
$(OBJCOPY) -S -O binary $< $@
|
||||
|
||||
%.o: %.c board.h $(LIBOPENCM3) flashrom/serprog.h flashrom/flash.h
|
||||
%.o: %.c board.h $(LIBOPENCM3) serprog.h flash.h
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
%.html: %.md
|
||||
|
@ -115,7 +115,7 @@ $(LIBOPENCM3):
|
|||
git submodule update libopencm3
|
||||
CFLAGS="$(CFLAGS)" $(MAKE) -C libopencm3 $(OPENCM3_MK) PREFIX=$(patsubst %,%,$(CROSS)) V=1
|
||||
|
||||
flashrom/flashrom flashrom/serprog.h flashrom/flash.h:
|
||||
flashrom/flashrom:
|
||||
git submodule init
|
||||
git submodule update flashrom
|
||||
$(MAKE) -C flashrom
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* This file is part of the flashrom project.
|
||||
*
|
||||
* Copyright (C) 2009, 2011 Urja Rannikko <urjaman@gmail.com>
|
||||
* Copyright (C) 2009 Carl-Daniel Hailfinger
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* According to Serial Flasher Protocol Specification - version 1 */
|
||||
#define S_ACK 0x06
|
||||
#define S_NAK 0x15
|
||||
#define S_CMD_NOP 0x00 /* No operation */
|
||||
#define S_CMD_Q_IFACE 0x01 /* Query interface version */
|
||||
#define S_CMD_Q_CMDMAP 0x02 /* Query supported commands bitmap */
|
||||
#define S_CMD_Q_PGMNAME 0x03 /* Query programmer name */
|
||||
#define S_CMD_Q_SERBUF 0x04 /* Query Serial Buffer Size */
|
||||
#define S_CMD_Q_BUSTYPE 0x05 /* Query supported bustypes */
|
||||
#define S_CMD_Q_CHIPSIZE 0x06 /* Query supported chipsize (2^n format) */
|
||||
#define S_CMD_Q_OPBUF 0x07 /* Query operation buffer size */
|
||||
#define S_CMD_Q_WRNMAXLEN 0x08 /* Query Write to opbuf: Write-N maximum length */
|
||||
#define S_CMD_R_BYTE 0x09 /* Read a single byte */
|
||||
#define S_CMD_R_NBYTES 0x0A /* Read n bytes */
|
||||
#define S_CMD_O_INIT 0x0B /* Initialize operation buffer */
|
||||
#define S_CMD_O_WRITEB 0x0C /* Write opbuf: Write byte with address */
|
||||
#define S_CMD_O_WRITEN 0x0D /* Write to opbuf: Write-N */
|
||||
#define S_CMD_O_DELAY 0x0E /* Write opbuf: udelay */
|
||||
#define S_CMD_O_EXEC 0x0F /* Execute operation buffer */
|
||||
#define S_CMD_SYNCNOP 0x10 /* Special no-operation that returns NAK+ACK */
|
||||
#define S_CMD_Q_RDNMAXLEN 0x11 /* Query read-n maximum length */
|
||||
#define S_CMD_S_BUSTYPE 0x12 /* Set used bustype(s). */
|
||||
#define S_CMD_O_SPIOP 0x13 /* Perform SPI operation. */
|
||||
#define S_CMD_S_SPI_FREQ 0x14 /* Set SPI clock frequency */
|
||||
#define S_CMD_S_PIN_STATE 0x15 /* Enable/disable output drivers */
|
|
@ -9,8 +9,8 @@
|
|||
#include <libopencm3/stm32/syscfg.h>
|
||||
#endif /* STM32F0 */
|
||||
|
||||
#include "flashrom/serprog.h"
|
||||
#include "flashrom/flash.h" /* For bus type */
|
||||
#include "serprog.h"
|
||||
#define BUS_SPI (1 << 3)
|
||||
|
||||
#include "board.h"
|
||||
#include "usbcdc.h"
|
||||
|
|
Loading…
Reference in New Issue