modified jtagwait to allow to set reset start address when renamed to .TTP

This commit is contained in:
Markus Fröschle
2014-08-10 14:39:06 +00:00
parent 1134454984
commit 852bf8928f
6 changed files with 93 additions and 47 deletions

View File

@@ -156,12 +156,15 @@ LIBBAS=libbas.a
LIBS=$(patsubst %,%/$(LIBBAS),$(TRGTDIRS))
all: fls ram bfl lib
all: fls ram bfl lib tos
fls: $(patsubst %,%/$(FLASH_EXEC),$(TRGTDIRS))
ram: $(patsubst %,%/$(RAM_EXEC),$(TRGTDIRS))
bfl: $(patsubst %,%/$(BASFLASH_EXEC),$(TRGTDIRS))
lib: $(LIBS)
.PHONY: tos
tos:
(cd tos; make)
.PHONY: clean
clean:

View File

@@ -79,7 +79,7 @@ void config_gpio_for_jtag_config(void)
MCF_GPIO_PDDR_FEC1L_PDDR_FEC1L4; /* bit 4 = LED => output */
/* all other bits = input */
/*
* unfortunately, the GPIO module cannot trigger interrupts. That means FPGA_CONFIG needs to be polled to detect
* unfortunately, the GPIO module cannot trigger interrupts. That means CONF_DONE needs to be polled to detect
* external FPGA (re)configuration and reset the system in that case. Could be done from the OS as well...
*/
}

View File

@@ -1089,6 +1089,9 @@ void initialize_hardware(void)
#endif
, MAJOR_VERSION, MINOR_VERSION, __DATE__, __TIME__);
extern char *rom_header;
xprintf("running from %p\r\n\r\n", &rom_header);
/*
* Determine cause(s) of Reset
*/

11
BaS_gcc/tos/Makefile Normal file
View File

@@ -0,0 +1,11 @@
.PHONY: tos
.PHONY: jtagwait
.PHONY: mcdcook
tos: jtagwait mcdcook
jtagwait:
(cd $@; make)
mcdcook:
(cd $@; make)

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.0.1, 2014-08-09T06:49:40. -->
<!-- Written by QtCreator 3.0.1, 2014-08-10T15:03:49. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>

View File

@@ -15,6 +15,8 @@ extern long _FPGA_JTAG_VALID;
#define FPGA_CONFIG (1 << 2)
#define FPGA_CONF_DONE (1 << 5)
long bas_start = 0xe0000000;
void wait_for_jtag(void)
{
int i;
@@ -63,8 +65,10 @@ void wait_for_jtag(void)
for (i = 0; i < 1000000; i++);
__asm__ __volatile__(
" jmp 0xe0000000\n\t"
: : :
" jmp (%[bas_start])\n\t"
: /* no output */
: [bas_start] "a" (bas_start)
: /* clobber not needed */
);
}
@@ -73,6 +77,31 @@ int main(int argc, char *argv[])
printf("\033E\r\nFPGA JTAG configuration support\r\n");
printf("You may now savely load a new FPGA configuration through the JTAG interface\r\n"
"and your Firebee will reboot once finished using that new configuration.\r\n");
if (argc == 2)
{
/*
* we got an argument. This is supposed to be the address that we need to jump to after JTAG
* configuration has been finished. Meant to support BaS in RAM testing
*/
char *addr_str = argv[1];
char *addr = NULL;
char *end = NULL;
addr = (char *) strtol(addr_str, &end, 16);
if (addr != NULL && addr <= (char *) 0xe0000000 && addr >= (char *) 0x10000000)
{
/*
* seems to be a valid address
*/
bas_start = (long) addr;
printf("BaS start address set to %p\r\n", addr);
}
else
{
printf("\r\nNote: BaS start address %p not valid. Stick to %p.\r\n", addr, (void *) bas_start);
}
}
Supexec(wait_for_jtag);
return 0; /* just to make the compiler happy, we will never return */