mirror of
https://github.com/mist-devel/mist-firmware.git
synced 2026-02-17 04:37:00 +00:00
DMA/ACSI handling cleanups
This commit is contained in:
4
debug.h
4
debug.h
@@ -26,13 +26,13 @@
|
||||
|
||||
// -------------- TOS debugging --------------
|
||||
|
||||
#if 1
|
||||
#if 0
|
||||
#define tos_debugf(...) iprintf(__VA_ARGS__)
|
||||
#else
|
||||
#define tos_debugf(...)
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
#if 0
|
||||
// ikbd debug output in red
|
||||
#define ikbd_debugf(a, ...) iprintf("\033[1;31mIKBD: " a "\033[0m\n", ##__VA_ARGS__)
|
||||
#else
|
||||
|
||||
17
tos.c
17
tos.c
@@ -93,7 +93,15 @@ static void hexdump(void *data, unsigned long size, unsigned long offset) {
|
||||
}
|
||||
}
|
||||
|
||||
static void mist_bus_request(char req) {
|
||||
EnableFpga();
|
||||
SPI(req?MIST_BUS_REQ:MIST_BUS_REL);
|
||||
DisableFpga();
|
||||
}
|
||||
|
||||
static void mist_memory_read(char *data, unsigned long words) {
|
||||
mist_bus_request(1);
|
||||
|
||||
EnableFpga();
|
||||
SPI(MIST_READ_MEMORY);
|
||||
|
||||
@@ -105,6 +113,7 @@ static void mist_memory_read(char *data, unsigned long words) {
|
||||
|
||||
DisableFpga();
|
||||
|
||||
mist_bus_request(0);
|
||||
}
|
||||
|
||||
static void mist_memory_read_block(char *data) {
|
||||
@@ -117,6 +126,8 @@ static void mist_memory_read_block(char *data) {
|
||||
}
|
||||
|
||||
static void mist_memory_write(char *data, unsigned long words) {
|
||||
mist_bus_request(1);
|
||||
|
||||
EnableFpga();
|
||||
SPI(MIST_WRITE_MEMORY);
|
||||
|
||||
@@ -126,6 +137,8 @@ static void mist_memory_write(char *data, unsigned long words) {
|
||||
}
|
||||
|
||||
DisableFpga();
|
||||
|
||||
mist_bus_request(0);
|
||||
}
|
||||
|
||||
static void mist_memory_write_block(char *data) {
|
||||
@@ -284,10 +297,6 @@ static void handle_fdc(unsigned char *buffer) {
|
||||
SPI(MIST_ACK_DMA);
|
||||
DisableFpga();
|
||||
}
|
||||
} else {
|
||||
EnableFpga();
|
||||
SPI(MIST_NAK_DMA);
|
||||
DisableFpga();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
3
tos.h
3
tos.h
@@ -13,7 +13,8 @@
|
||||
#define MIST_SET_CONTROL 0x04
|
||||
#define MIST_GET_DMASTATE 0x05 // reads state of dma and floppy controller
|
||||
#define MIST_ACK_DMA 0x06 // acknowledges a dma command
|
||||
#define MIST_NAK_DMA 0x07 // don't acknowledge a dma command, but release bus
|
||||
#define MIST_BUS_REQ 0x07 // request bus
|
||||
#define MIST_BUS_REL 0x08 // release bus
|
||||
|
||||
// tos sysconfig bits:
|
||||
// 0 - RESET
|
||||
|
||||
Reference in New Issue
Block a user