mirror of
https://git.code.sf.net/p/openocd/code
synced 2025-02-07 05:39:50 +00:00
eb6f2745b7
Driver for DesignWare SPI controller, found on many SoCs (see compatible list in Linux device tree bindings Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml). This implementation only supports MIPS as it was the only one available for the tests, however, adding support for other architectures should require only few adjustments. Driver relies on flash/nor/spi.h to find Flash chip info. Driver internal functions support 24bit addressing mode, but due to limitations of flash/nor/spi.h, it is not used. The reported writing speed is about 60kb/s. Lint, sanitizer and valgrind reported warnings were not related to the driver. Change-Id: Id3df5626ab88055f034f74f274823051dedefeb1 Signed-off-by: Sergey Matsievskiy <matsievskiysv@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8400 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
36 lines
668 B
Makefile
36 lines
668 B
Makefile
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
TOOLCHAIN:=mipsel-linux-gnu-
|
|
CC:=$(TOOLCHAIN)gcc
|
|
OBJCOPY:=$(TOOLCHAIN)objcopy
|
|
CFLAGS:=-O2 -Wall -Wextra -fpic -Wno-int-to-pointer-cast
|
|
SRC=dw-spi.c
|
|
OBJ=$(patsubst %.c, %.o,$(SRC))
|
|
|
|
# sparx-iv
|
|
ifeq ($(TOOLCHAIN),mipsel-linux-gnu-)
|
|
CFLAGS+= -march=24kec
|
|
endif
|
|
|
|
all: \
|
|
$(TOOLCHAIN)transaction.inc \
|
|
$(TOOLCHAIN)erase.inc \
|
|
$(TOOLCHAIN)check_fill.inc \
|
|
$(TOOLCHAIN)program.inc \
|
|
$(TOOLCHAIN)read.inc
|
|
|
|
$(TOOLCHAIN)%.bin: $(OBJ)
|
|
$(OBJCOPY) --dump-section .$*=$@ $<
|
|
|
|
%.inc: %.bin
|
|
xxd -i > $@ < $<
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf .ccls-cache
|
|
find . \( \
|
|
-iname "*.o" \
|
|
-o -iname "*.bin" \
|
|
-o -iname "*.inc" \
|
|
\) -delete
|