fixed mmu and fpu detection, added reset handling for autoconf, added fpga update

This commit is contained in:
Claude
2020-11-21 10:12:43 +00:00
parent 93e7240968
commit 87786b6976
5 changed files with 22460 additions and 17 deletions

38
68new.cfg Normal file
View File

@@ -0,0 +1,38 @@
# this supports ECP5 Evaluation Board
reset_config none
interface bcm2835gpio
#bcm2835gpio_peripheral_base 0x20000000
bcm2835gpio_peripheral_base 0x3F000000
# Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET
# These depend on system clock, calibrated for stock 700MHz
# bcm2835gpio_speed SPEED_COEFF SPEED_OFFSET
#bcm2835gpio_speed_coeffs 146203 36
bcm2835gpio_speed_coeffs 194938 48
#bcm2835gpio_peripheral_base 0x3F000000
#bcm2835gpio_speed_coeffs 194938 48
reset_config none
adapter_khz 100
# JTAG tck tms tdi tdo
bcm2835gpio_jtag_nums 26 24 27 25
#meh dummy reset to make openocd happy, set to A0 on SMI
bcm2835gpio_srst_num 5
reset_config srst_only srst_open_drain
transport select jtag
jtag newtap max2 tap -irlen 11 -expected-id 0x020a20dd
init
svf bitstream.svf -quiet
sleep 200
shutdown

22397
bitstream.svf Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -54,11 +54,12 @@ do { \
#define FASTBASE 0x07FFFFFF
//#define FASTSIZE 0xFFFFFF
#define FASTSIZE 0xFFFFFFF
#define GAYLEBASE 0xD80000 //D7FFFF
#define GAYLESIZE 0x6FFFF
#define KICKBASE 0xF80000
#define KICKSIZE 0x7FFFF
int mem_fd;
int mem_fd_gpclk;
void *gpio_map;
@@ -291,7 +292,7 @@ const struct sched_param priority = {99};
usleep(1500);
m68k_init();
m68k_set_cpu_type(M68K_CPU_TYPE_68EC030);
m68k_set_cpu_type(M68K_CPU_TYPE_68030);
m68k_pulse_reset();
srdata2_old = read_reg();
printf("STATUS: %d\n", srdata2_old);
@@ -310,16 +311,16 @@ const struct sched_param priority = {99};
m68k_pulse_reset();
while(42) {
m68k_execute(150);
m68k_execute(50);
//usleep(1);
//printf("IRQ:0x%06x\n",CheckIrq());
/*
if (CheckIrq() == 1)
m68k_set_irq(2);
else
m68k_set_irq(0);
*/
if (GET_GPIO(1) == 0 || CheckIrq() == 1){
srdata = read_reg();
@@ -352,7 +353,9 @@ const struct sched_param priority = {99};
void cpu_pulse_reset(void){
write_reg(0x02);
usleep(10000);
write_reg(0x00);
}
@@ -377,10 +380,10 @@ unsigned int m68k_read_memory_8(unsigned int address){
}
if (maprom == 1){
if (ovl == 1 && address<0x07FFFF ){
if (ovl == 1 && address<KICKSIZE){
return g_kick[address];}
if (ovl == 0 && (address>0xF80000-1 && address<0xFFFFFF)){
return g_kick[address-0xF80000];}
if (ovl == 0 && (address>KICKBASE && address<KICKBASE + KICKSIZE)){
return g_kick[address-KICKBASE];}
}
if (address < 0xffffff){
@@ -403,12 +406,12 @@ unsigned int m68k_read_memory_16(unsigned int address){
}
if (maprom == 1){
if (ovl == 1 && address<0x07FFFF ){
if (ovl == 1 && address<KICKSIZE ){
uint16_t value = *(uint16_t*)&g_kick[address];
return (value << 8) | (value >> 8);}
if (ovl == 0 && (address>0xF80000-1 && address<0xFFFFFF)){
//printf("kread16/n");
uint16_t value = *(uint16_t*)&g_kick[address-0xF80000];
if (ovl == 0 && (address>KICKBASE && address<KICKBASE + KICKSIZE)){
//printf("kread16 addr: %x\n",address);
uint16_t value = *(uint16_t*)&g_kick[address-KICKBASE];
return (value << 8) | (value >> 8);}
}
@@ -432,14 +435,14 @@ unsigned int m68k_read_memory_32(unsigned int address){
}
if (maprom == 1){
if (ovl == 1 && address<0x07FFFF){
if (ovl == 1 && address<KICKSIZE){
uint32_t value = *(uint32_t*)&g_kick[address];
value = ((value << 8) & 0xFF00FF00 ) | ((value >> 8) & 0xFF00FF );
return value << 16 | value >> 16;}
if (ovl == 0 && (address>0xF80000-1 && address<0xFFFFFF)){
if (ovl == 0 && (address>KICKBASE && address<KICKBASE + KICKSIZE)){
//printf("kread32/n");
uint32_t value = *(uint32_t*)&g_kick[address-0xF80000];
uint32_t value = *(uint32_t*)&g_kick[address-KICKBASE];
value = ((value << 8) & 0xFF00FF00 ) | ((value >> 8) & 0xFF00FF );
return value << 16 | value >> 16;}
}
@@ -458,7 +461,7 @@ void m68k_write_memory_8(unsigned int address, unsigned int value){
if (address == 0xbfe001){
ovl = (value & (1<<0));
//printf("OVL:%x\n", ovl );
printf("OVL:%x\n", ovl );
}

View File

@@ -67,6 +67,7 @@
#define M68K_EMULATE_010 OPT_ON
#define M68K_EMULATE_EC020 OPT_ON
#define M68K_EMULATE_020 OPT_ON
#define M68K_EMULATE_030 OPT_ON
#define M68K_EMULATE_040 OPT_ON
@@ -184,6 +185,9 @@
#define M68K_LOG_FILEHANDLE some_file_handle
#define M68K_EMULATE_PMMU OPT_ON
/* ----------------------------- COMPATIBILITY ---------------------------- */
/* The following options set optimizations that violate the current ANSI

1
nprog.sh Executable file
View File

@@ -0,0 +1 @@
sudo openocd -f 68new.cfg