aboutsummaryrefslogtreecommitdiff
path: root/contrib/firmware/angie/c/Makefile
diff options
context:
space:
mode:
authorAhmed BOUDJELIDA <aboudjelida@nanoxplore.com>2023-06-16 23:19:05 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2023-08-12 16:42:19 +0000
commit9c91ce8d24d0789a0f25affb73201c9e0a6b89d8 (patch)
tree7782a66ae9474632384136dac1c6723332d0c488 /contrib/firmware/angie/c/Makefile
parent3b78b5c1db68841fdc18ee48b6011f4affff2bfd (diff)
downloadriscv-openocd-9c91ce8d24d0789a0f25affb73201c9e0a6b89d8.zip
riscv-openocd-9c91ce8d24d0789a0f25affb73201c9e0a6b89d8.tar.gz
riscv-openocd-9c91ce8d24d0789a0f25affb73201c9e0a6b89d8.tar.bz2
contrib/firmware: add new adapter ANGIE's firmware/bitstream code
This is ANGIE's firmware and bitstream code. The 'Embeded C' code is based on the openULINK project. The hdl bitstream source code is for the spartan-6 FPGA included in ANGIE. Since ANGIE has a different microcontroller (EZ-USB FX2) than openULINK (EZ-USB AN2131), the registers file (reg_ezusb.h) has been changed completely, so are the descriptors, interruptions and the endpoints configuration. Change-Id: I70590c7c58bac6f1939c5ffba57e87d86850664d Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7701 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'contrib/firmware/angie/c/Makefile')
-rw-r--r--contrib/firmware/angie/c/Makefile75
1 files changed, 75 insertions, 0 deletions
diff --git a/contrib/firmware/angie/c/Makefile b/contrib/firmware/angie/c/Makefile
new file mode 100644
index 0000000..80e8cbe
--- /dev/null
+++ b/contrib/firmware/angie/c/Makefile
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+#****************************************************************************
+# File : Makefile *
+# Contents : Code for NanoXplore USB-JTAG ANGIE adapter hardware. *
+# Based on openULINK project by: Martin Schmoelzer. *
+# Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS. *
+# <aboudjelida@nanoxplore.com> *
+# <ahmederrachedbjld@gmail.com> *
+# ***************************************************************************/
+
+# Define the name of tools.
+PREFIX =
+
+# Small Device C Compiler: http://sdcc.sourceforge.net/
+CC = $(PREFIX)sdcc
+
+# 8051 assembler, part of the SDCC software package.
+AS = $(PREFIX)sdas8051
+
+# SDCC produces quite messy Intel HEX files. This tool is be used to re-format
+# those files. It is not required for the firmware download functionality in
+# the OpenOCD driver, but the resulting file is smaller.
+PACKIHX = $(PREFIX)packihx
+
+# GNU binutils size. Used to print the size of the IHX file generated by SDCC.
+SIZE = size
+
+# Source and header directories.
+SRC_DIR = src
+INCLUDE_DIR = include
+
+CODE_SIZE = 0x3C00
+XRAM_LOC = 0x3C00
+XRAM_SIZE = 0x0400
+
+CFLAGS = --std-sdcc99 --opt-code-size --model-small
+LDFLAGS = --code-loc 0x0000 --code-size $(CODE_SIZE) --xram-loc $(XRAM_LOC) \
+ --xram-size $(XRAM_SIZE) --iram-size 256 --model-small
+
+# list of base object files
+OBJECTS = main.rel usb.rel protocol.rel jtag.rel delay.rel USBJmpTb.rel serial.rel gpif.rel
+HEADERS = $(INCLUDE_DIR)/usb.h \
+ $(INCLUDE_DIR)/protocol.h \
+ $(INCLUDE_DIR)/jtag.h \
+ $(INCLUDE_DIR)/delay.h \
+ $(INCLUDE_DIR)/reg_ezusb.h \
+ $(INCLUDE_DIR)/io.h \
+ $(INCLUDE_DIR)/serial.h \
+ $(INCLUDE_DIR)/fx2macros.h \
+ $(INCLUDE_DIR)/msgtypes.h
+
+# Disable all built-in rules.
+.SUFFIXES:
+
+# Targets which are executed even when identically named file is present.
+.PHONY: all, clean
+
+all: angie_firmware.ihx
+ $(SIZE) angie_firmware.ihx
+
+angie_firmware.ihx: $(OBJECTS)
+ $(CC) -mmcs51 $(LDFLAGS) -o $@ $^
+
+# Rebuild every C module (there are only 5 of them) if any header changes.
+%.rel: $(SRC_DIR)/%.c $(HEADERS)
+ $(CC) -c $(CFLAGS) -mmcs51 -I$(INCLUDE_DIR) -o $@ $<
+
+%.rel: $(SRC_DIR)/%.a51
+ $(AS) -lsgo $@ $<
+
+clean:
+ rm -f *.asm *.lst *.rel *.rst *.sym *.ihx *.lk *.map *.mem
+
+bin: angie_firmware.ihx
+ makebin -p angie_firmware.ihx angie_firmware.bin