icE1usb fw: Add support for the ICE1USB_DEV_GET_FW_BUILD control request
This was already defined but not implemented Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: Id65734153c92ef87bc9ecf967447e9bf11804f24
This commit is contained in:
parent
caf8cf94e1
commit
2c33f6d5bb
|
@ -10,11 +10,12 @@ ICEPROG = iceprog
|
||||||
DFU_UTIL = dfu-util
|
DFU_UTIL = dfu-util
|
||||||
|
|
||||||
TAG_PREFIX = icE1usb-fw
|
TAG_PREFIX = icE1usb-fw
|
||||||
GITVER = $(shell git describe --match '$(TAG_PREFIX)*')
|
GITVER = $(shell git describe --match '$(TAG_PREFIX)*' --dirty)
|
||||||
TARGET = $(GITVER)
|
TARGET = $(GITVER)
|
||||||
|
|
||||||
BOARD_DEFINE=BOARD_$(shell echo $(BOARD) | tr a-z\- A-Z_)
|
BOARD_DEFINE=BOARD_$(shell echo $(BOARD) | tr a-z\- A-Z_)
|
||||||
CFLAGS=-Wall -Wextra -Wno-unused-parameter -Os -march=rv32i -mabi=ilp32 -ffreestanding -flto -nostartfiles -fomit-frame-pointer -Wl,--gc-section --specs=nano.specs -D$(BOARD_DEFINE) -I. -I../common
|
CFLAGS=-Wall -Wextra -Wno-unused-parameter -Os -march=rv32i -mabi=ilp32 -ffreestanding -flto -nostartfiles -fomit-frame-pointer -Wl,--gc-section --specs=nano.specs -D$(BOARD_DEFINE) -I. -I../common
|
||||||
|
CFLAGS += -DBUILD_INFO="\"$(GITVER) built $(shell date) on $(shell hostname)\""
|
||||||
|
|
||||||
NO2USB_FW_VERSION=0
|
NO2USB_FW_VERSION=0
|
||||||
include ../../../gateware/cores/no2usb/fw/fw.mk
|
include ../../../gateware/cores/no2usb/fw/fw.mk
|
||||||
|
|
|
@ -69,7 +69,7 @@ void main()
|
||||||
|
|
||||||
/* Init console IO */
|
/* Init console IO */
|
||||||
console_init();
|
console_init();
|
||||||
puts("Booting App image..\n");
|
printf("\n\nBooting %s\n", fw_build_str);
|
||||||
|
|
||||||
/* LED */
|
/* LED */
|
||||||
led_init();
|
led_init();
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <no2usb/usb.h>
|
#include <no2usb/usb.h>
|
||||||
#include <no2usb/usb_proto.h>
|
#include <no2usb/usb_proto.h>
|
||||||
|
@ -16,6 +17,9 @@
|
||||||
#include "ice1usb_proto.h"
|
#include "ice1usb_proto.h"
|
||||||
|
|
||||||
|
|
||||||
|
const char *fw_build_str = BUILD_INFO;
|
||||||
|
|
||||||
|
|
||||||
static enum usb_fnd_resp
|
static enum usb_fnd_resp
|
||||||
_usb_dev_ctrl_req(struct usb_ctrl_req *req, struct usb_xfer *xfer)
|
_usb_dev_ctrl_req(struct usb_ctrl_req *req, struct usb_xfer *xfer)
|
||||||
{
|
{
|
||||||
|
@ -29,6 +33,10 @@ _usb_dev_ctrl_req(struct usb_ctrl_req *req, struct usb_xfer *xfer)
|
||||||
xfer->data[0] = (1 << ICE1USB_DEV_CAP_GPSDO);
|
xfer->data[0] = (1 << ICE1USB_DEV_CAP_GPSDO);
|
||||||
xfer->len = 1;
|
xfer->len = 1;
|
||||||
break;
|
break;
|
||||||
|
case ICE1USB_DEV_GET_FW_BUILD:
|
||||||
|
xfer->data = (void*) fw_build_str;
|
||||||
|
xfer->len = strlen(fw_build_str);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return USB_FND_ERROR;
|
return USB_FND_ERROR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,4 +7,6 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
extern const char *fw_build_str;
|
||||||
|
|
||||||
void usb_dev_init(void);
|
void usb_dev_init(void);
|
||||||
|
|
Loading…
Reference in New Issue