-ASRCS = crt0.s tricks.s commonmem.s linc80.s
-CSRCS = devices.c main.c devtty.c
+ASRCS = crt0.s tricks.s commonmem.s linc80.s piospi.s
+CSRCS = devices.c main.c devtty.c sd.c
DISCARD_CSRCS = discard.c
-DISCARD_DSRCS = ../dev/devide_discard.c
-DSRCS = ../dev/devide.c ../dev/mbr.c ../dev/blkdev.c
+DISCARD_DSRCS = ../dev/devide_discard.c ../dev/devsd_discard.c
+DSRCS = ../dev/devide.c ../dev/mbr.c ../dev/blkdev.c ../dev/devsd.c
NSRCS =
AOBJS = $(ASRCS:.s=.rel)
sdldz80 -i loader.rel
makebin -s 65536 loader.ihx loader.tmp
dd if=loader.tmp bs=256 skip=208 of=loader.bin
+
+piospi.rel: ../dev/z80softspi.s
#define NBUFS 4 /* Number of block buffers, keep in line with space reserved in zeta-v2.s */
#define NMOUNTS 2 /* Number of mounts at a time */
-#define MAX_BLKDEV 1 /* 1 IDE for now */
+#define MAX_BLKDEV 3 /* 3 IDE + 2 x SD for now */
/* IDE/CF support */
#define CONFIG_IDE
+#define CONFIG_SD
+
+#define SD_DRIVE_COUNT 2
/* Device parameters */
#define NUM_DEV_TTY 2
#define TTYDEV BOOT_TTY /* Device used by kernel for messages, panics */
#define platform_copyright()
+
+#define SD_SPI_CALLTYPE __z88dk_fastcall
#include <kdata.h>
#include <printf.h>
#include <devtty.h>
-#include <ds1302.h>
#include <devide.h>
+#include <devsd.h>
#include <blkdev.h>
#include "config.h"
+extern void pio_setup(void);
+
void map_init(void)
{
}
void device_init(void)
{
+ pio_setup();
#ifdef CONFIG_IDE
devide_init();
#endif
+#ifdef CONFIG_SD
+ devsd_init();
+#endif
}
platform-linc80/blkdev.rel
platform-linc80/devide.rel
platform-linc80/devide_discard.rel
+platform-linc80/devsd.rel
+platform-linc80/devsd_discard.rel
+platform-linc80/sd.rel
+platform-linc80/piospi.rel
-e
NBUFS .equ 4
+SPI_DATA .equ 0x04
+SPI_CLOCK .equ 0x02