forked from openocd-org/openocd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- dummy flash driver for KC705/ML605 - experimental updates to board .cfg file - flash erase, write support w/ 32-byte buffering (LX) - algo support manually verified (NX) Signed-off-by: ianst <ianst@cadence.com>
- Loading branch information
Showing
8 changed files
with
511 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
BIN2C = ../../../../src/helper/bin2char.sh | ||
|
||
CROSS_COMPILE ?= xt- | ||
|
||
CC=$(CROSS_COMPILE)clang | ||
OBJCOPY=$(CROSS_COMPILE)objcopy | ||
OBJDUMP=$(CROSS_COMPILE)objdump | ||
|
||
AFLAGS = -c -static -nostartfiles -mlittle-endian -mtext-section-literals | ||
CFLAGS = -c -nostdlib -nostartfiles -Os -g -fPIC | ||
|
||
all: xtkcml705fl.inc | ||
|
||
.PHONY: clean | ||
|
||
%.elf: %.S | ||
$(CC) $(AFLAGS) $< -o $@ | ||
|
||
%.lst: %.elf | ||
$(OBJDUMP) -S $< > $@ | ||
|
||
%.bin: %.elf | ||
$(OBJCOPY) -Obinary $< $@ | ||
|
||
%.inc: %.bin | ||
$(BIN2C) < $< > $@ | ||
|
||
clean: | ||
-rm -f *.elf *.lst *.bin *.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-or-later */ | ||
|
||
/*************************************************************************** | ||
* Xtensa flasher for KC705/ML605 platforms | ||
* Copyright (C) 2023 Cadence Design Systems | ||
***************************************************************************/ | ||
|
||
/* | ||
* Parameters: | ||
* a10 = flash base (in), status (out) | ||
* a11 = count (halfword-16bit) | ||
* a12 = buffer start | ||
* a13 = buffer end / scratch register | ||
* a14 = target address | ||
* | ||
* NOTE: if count does not indicate a multiple of 32 bytes, this logic | ||
* will round up to and program the next multiple of 32 bytes. | ||
*/ | ||
.text | ||
|
||
.align 4 | ||
_flash_prog_start: | ||
j _flash_prog | ||
|
||
.align 4 | ||
.literal_position | ||
|
||
_flash_prog: | ||
movi a13, 0x50 /* clear flash status register */ | ||
s16i a13, a10, 0 | ||
|
||
_flash_prog_loop: | ||
movi a13, 0xe8 /* set flash into buffer program mode */ | ||
s16i a13, a14, 0 | ||
movi a13, 31 /* always program chunks of N=32 bytes (write N-1) */ | ||
s16i a13, a14, 0 | ||
.set i, 0 | ||
.rept 32 | ||
l16ui a13, a12, i | ||
s16i a13, a14, i | ||
.set i, i+2 | ||
.endr | ||
movi a13, 32 | ||
sub a11, a11, a13 /* increment half-word count */ | ||
add a13, a13, a13 /* double a13 for incrementing buffer/target addresses */ | ||
add a12, a12, a13 | ||
add a14, a14, a13 | ||
movi a13, 0xd0 /* end buffer program mode */ | ||
s16i a13, a14, 0 | ||
_flash_prog_status_check: | ||
l16ui a13, a10, 0 | ||
bbci a13, 7, _flash_prog_status_check | ||
extui a13, a13, 0, 7 | ||
bnez a13, _flash_prog_error | ||
bgei a11, 1, _flash_prog_loop | ||
|
||
_flash_prog_done: | ||
/* TODO: set program mode size of -1? */ | ||
movi a13, 0x50 /* clear status register */ | ||
s16i a13, a10, 0 | ||
movi a13, 0xff /* restore read array (normal) mode */ | ||
s16i a13, a10, 0 | ||
movi a10, 0 | ||
break 0, 0 /* Coded breakpoint at end of algo */ | ||
_flash_prog_error: | ||
movi a10, -4 | ||
break 0, 0 /* Coded breakpoint at end of algo */ | ||
|
||
_idle_loop: | ||
j _idle_loop | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* Autogenerated with ../../../../src/helper/bin2char.sh */ | ||
0x06,0x00,0x00,0x00,0x5c,0x0d,0xd2,0x5a,0x00,0xd2,0xa0,0xe8,0xd2,0x5e,0x00,0x1c, | ||
0xfd,0xd2,0x5e,0x00,0xd2,0x1c,0x00,0xd2,0x5e,0x00,0xd2,0x1c,0x01,0xd2,0x5e,0x01, | ||
0xd2,0x1c,0x02,0xd2,0x5e,0x02,0xd2,0x1c,0x03,0xd2,0x5e,0x03,0xd2,0x1c,0x04,0xd2, | ||
0x5e,0x04,0xd2,0x1c,0x05,0xd2,0x5e,0x05,0xd2,0x1c,0x06,0xd2,0x5e,0x06,0xd2,0x1c, | ||
0x07,0xd2,0x5e,0x07,0xd2,0x1c,0x08,0xd2,0x5e,0x08,0xd2,0x1c,0x09,0xd2,0x5e,0x09, | ||
0xd2,0x1c,0x0a,0xd2,0x5e,0x0a,0xd2,0x1c,0x0b,0xd2,0x5e,0x0b,0xd2,0x1c,0x0c,0xd2, | ||
0x5e,0x0c,0xd2,0x1c,0x0d,0xd2,0x5e,0x0d,0xd2,0x1c,0x0e,0xd2,0x5e,0x0e,0xd2,0x1c, | ||
0x0f,0xd2,0x5e,0x0f,0xd2,0x1c,0x10,0xd2,0x5e,0x10,0xd2,0x1c,0x11,0xd2,0x5e,0x11, | ||
0xd2,0x1c,0x12,0xd2,0x5e,0x12,0xd2,0x1c,0x13,0xd2,0x5e,0x13,0xd2,0x1c,0x14,0xd2, | ||
0x5e,0x14,0xd2,0x1c,0x15,0xd2,0x5e,0x15,0xd2,0x1c,0x16,0xd2,0x5e,0x16,0xd2,0x1c, | ||
0x17,0xd2,0x5e,0x17,0xd2,0x1c,0x18,0xd2,0x5e,0x18,0xd2,0x1c,0x19,0xd2,0x5e,0x19, | ||
0xd2,0x1c,0x1a,0xd2,0x5e,0x1a,0xd2,0x1c,0x1b,0xd2,0x5e,0x1b,0xd2,0x1c,0x1c,0xd2, | ||
0x5e,0x1c,0xd2,0x1c,0x1d,0xd2,0x5e,0x1d,0xd2,0x1c,0x1e,0xd2,0x5e,0x1e,0xd2,0x1c, | ||
0x1f,0xd2,0x5e,0x1f,0x2c,0x0d,0xd0,0xbb,0xc0,0xda,0xdd,0xda,0xcc,0xda,0xee,0xd2, | ||
0xa0,0xd0,0xd2,0x5e,0x00,0xd2,0x1a,0x00,0x77,0x6d,0xf9,0xd0,0xd0,0x64,0xdc,0x4d, | ||
0xa6,0x1b,0x02,0x86,0xc4,0xff,0x5c,0x0d,0xd2,0x5a,0x00,0xd2,0xa0,0xff,0xd2,0x5a, | ||
0x00,0x0c,0x0a,0x00,0x40,0x00,0x7c,0xca,0x00,0x40,0x00,0x06,0xff,0xff, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.