CSRCS += devices.c main.c libc.c
DSRCS = ../dev/devdw.c ../dev/blkdev.c ../dev/devide.c \
- ../dev/devide_discard.c ../dev/mbr.c
+ ../dev/devide_discard.c ../dev/mbr.c \
+ ../dev/devsd.c ../dev/devsd_discard.c
-ASRCS = crt0.s dragon.s mem-nx32.s video.s ide.s
+ASRCS = crt0.s dragon.s mem-nx32.s video.s ide.s spi.s
ASRCS += tricks.s commonmem.s usermem_sam.s floppy.s drivewire.s
COBJS = $(CSRCS:.c=$(BINEXT))
../syscall_proc.o ../syscall_other.o ../mm.o ../swap.o \
../tty.o ../devsys.o ../usermem.o ../syscall_fs2.o ../syscall_exec16.o \
devlpr.o devtty.o libc.o ../vt.o video.o ../font8x8.o \
- devide.o blkdev.o ide.o devide_discard.o mbr.o
+ devide.o blkdev.o ide.o devide_discard.o mbr.o \
+ devsd.o devsd_discard.o spi.o
../tools/pad256 ../fuzix.bin
/* Permit large I/O requests to bypass cache and go direct to userspace */
#define CONFIG_LARGE_IO_DIRECT
-#define MAX_BLKDEV 2 /* 2 IDE drives */
-#define DEVICE_IDE /* enable if IDE interface present */
+#define MAX_BLKDEV 3 /* 2 IDE drives + 1 SPI */
+#define SD_DRIVE_COUNT 1 /* Could be higher with multiple CS used */
+#define DEVICE_IDE /* enable if IDE interface present */
#define IDE_REG_CS1_BASE 0xFF50
-#define IDE_IS_MMIO 1 /* MMIO IDE */
+#define IDE_IS_MMIO 1 /* MMIO IDE */
/* Video terminal, not a serial tty */
#define CONFIG_VT
#define __DEVICE_DOT_H__
extern uint8_t system_id;
+extern uint8_t mpi_present(void);
+extern uint8_t mpi_set_slot(uint8_t slot);
+extern uint16_t cart_hash(void);
+
+extern uint8_t spi_setup(void);
#endif /* __DEVICE_DOT_H__ */
#include <devtty.h>
#include <blkdev.h>
#include <devide.h>
+#include <devsd.h>
+#include <device.h>
struct devsw dev_tab[] = /* The device driver switch table */
{
void device_init(void)
{
+ if (spi_setup())
+ devsd_init();
devide_init();
}