Fix for ISSUE 344: migrate DEVICE_xx to CONFIG_xx, change DRIVE_COUNT
authorNeal Andrew Crook <neal@pippaluk.org.uk>
Sat, 21 May 2016 15:06:33 +0000 (16:06 +0100)
committerNeal Andrew Crook <neal@pippaluk.org.uk>
Sat, 21 May 2016 15:06:33 +0000 (16:06 +0100)
to IDE_DRIVE_COUNT (for consistency with SD_DRIVE_COUNT), rename
CONFIG_SDC to CONFIG_COCOSDC.

12 files changed:
Kernel/PORTING
Kernel/dev/devide.h
Kernel/dev/devide_discard.c
Kernel/dev/devsd.h
Kernel/platform-coco3/config.h
Kernel/platform-coco3/devices.c
Kernel/platform-dragon-nx32/config.h
Kernel/platform-msx2/config.h
Kernel/platform-msx2/devmegasd.c
Kernel/platform-n8vem-mark4/config.h
Kernel/platform-p112/config.h
Kernel/platform-zeta-v2/config.h

index ae994f6..318b030 100644 (file)
@@ -105,6 +105,22 @@ Porting Fuzix to a new Z80 based machine generally requires the following
  If you need to put your MBR elsewhere, use this. Even with this defined,
  block 0 is still checked first and a valid MBR there is used in preference.
 
+ CONFIG_IDE, IDE_DRIVE_COUNT
+ CONFIG_SD, SD_DRIVE_COUNT
+ CONFIG_FLOPPY
+ CONFIG_P112_FLOPPY
+ CONFIG_COCOSDC (Darren Atkinson's "CoCoSDC" floppy emulator cartridge)
+ The common kernel files don't provide any support for these different block
+ devices. Support for block devices is provided per-platform by the
+ platform-specific Makefile (ie, by pulling in IDE support code from
+ Kernel/dev or from platform-specific source files) and by entries in the
+ device driver switch table and calls in device_init(). Examine devices.c
+ for a few different platforms to get the idea. You might use (eg) CONFIG_SD
+ in your platform code in order to allow a build with and without SD support.
+
+ MAX_BLKDEV is the total number of block devices. Current examples include
+ IDE, FLOPPY, SD, COCOSDC, SCSI, ROM and RAM disks.
+
 - Set the basic system parameters
 
  TICKSPERSEC   -       clock rate
index 206f6b2..9d9e556 100644 (file)
@@ -5,8 +5,11 @@
 #include "platform_ide.h"
 
 /* IDE Drive Configuration (in config.h)
-   Define DEVICE_IDE if IDE hardware is present on your platform.
+
+   Define CONFIG_IDE if IDE hardware is present on your platform.
+
+   Define IDE_DRIVE_COUNT to the number of IDE drives your hardware
+   supports (at most 16) - defaults to 2 if undefined.
 
    Define IDE_8BIT_ONLY if the system implements only half of the 16-bit data
    bus (eg n8vem-mark4).
@@ -14,7 +17,7 @@
    Define IDE_REG_INDIRECT if the IDE registers are not directly addressable on
    your platform. If you do not define IDE_REG_INDIRECT then IDE registers
    should be directly addressable by CPU I/O operations.
-   
+
    If IDE_REG_INDIRECT is defined you will need to provide devide_readb() and
    devide_writeb() to access the IDE registers. You will need to define
    suitable values for each register (ide_reg_data, ide_reg_error etc) to be
@@ -90,8 +93,8 @@ void devide_writeb(uint8_t regaddr, uint8_t value);
 
 #ifdef _IDE_PRIVATE
 
-#ifndef DRIVE_COUNT
-#define DRIVE_COUNT 2           /* at most 16 drives without adjusting DRIVE_NR_MASK */
+#ifndef IDE_DRIVE_COUNT
+#define IDE_DRIVE_COUNT 2       /* at most 16 drives without adjusting DRIVE_NR_MASK */
 #endif
 
 /* we use the bits in the driver_data field of blkdev_t as follows: */
index 271870a..c8ad993 100644 (file)
@@ -144,6 +144,6 @@ void devide_init(void)
     devide_reset();
 #endif
 
-    for(d=0; d < DRIVE_COUNT; d++)
+    for(d=0; d < IDE_DRIVE_COUNT; d++)
         devide_init_drive(d);
 }
index f679c3f..99970bc 100644 (file)
@@ -3,7 +3,7 @@
 
 /* SD Configuration (in config.h)
 
-   Define DEVICE_SD if SD hardware is present on your platform.
+   Define CONFIG_SD if SD hardware is present on your platform.
 
    Define SD_DRIVE_COUNT to the number of SD cards your hardware
    supports (at most 16)
index 52a9303..d7bd563 100644 (file)
@@ -86,5 +86,6 @@ extern unsigned char vt_map( unsigned char c );
 
 /* Block device define */
 #define MAX_BLKDEV  4     /* 2 IDE + 2 SDC */
-#define DEVICE_IDE        /* enable if IDE interface present */
+#undef  CONFIG_COCOSDC    /* Darren Atkinson's "CoCoSDC" cartridge */
+#define CONFIG_IDE        /* enable if IDE interface present */
 
index f0486a9..5923b2d 100644 (file)
@@ -44,7 +44,7 @@ bool validdev(uint16_t dev)
 void device_init(void)
 {
        devide_init( );
-#ifdef CONFIG_SDC
+#ifdef CONFIG_COCOSDC
        devsdc_init( );
 #endif
 }
index c8a5867..4ddcd70 100644 (file)
@@ -30,7 +30,8 @@
 
 #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 CONFIG_SD               /* enable if SD  interface present */
+#define CONFIG_IDE              /* enable if IDE interface present */
 
 /* Video terminal, not a serial tty */
 #define CONFIG_VT
index c895b9f..48bfea4 100644 (file)
@@ -43,7 +43,7 @@
 #define NBUFS    10       /* Number of block buffers */
 #define NMOUNTS         4        /* Number of mounts at a time */
 
-#define DEVICE_SD
+#define CONFIG_SD
 #define SD_DRIVE_COUNT 1
 
 #define MAX_BLKDEV 1      /* Single SD drive */
index 73858b9..e0bb3dc 100644 (file)
@@ -36,7 +36,7 @@
 #define readb(x)            *((volatile uint8_t *)x)
 #define writeb(val,x)       *((volatile uint8_t *)x) = val
 
-#ifdef DEVICE_SD
+#ifdef CONFIG_SD
 
 
 /* slot and subslot containing the sd interface */
index d22b5bd..ae2d343 100644 (file)
 
 #define MAX_BLKDEV 3       /* 2 IDE drives, 1 SD drive */
 
-#define DEVICE_IDE
+#define CONFIG_IDE
 #define IDE_REG_BASE       MARK4_IO_BASE
 #define IDE_8BIT_ONLY
 #define IDE_REG_CS1_FIRST
 
 /* On-board SD on Mark IV */
-#define DEVICE_SD
+#define CONFIG_SD
 #define SD_DRIVE_COUNT 1
 
 /* On-board DS1302 on Mark IV, we can read the time of day from it */
index f184f43..b3736b4 100644 (file)
@@ -43,7 +43,7 @@
 
 #define MAX_BLKDEV  2              /* 2 IDE drives */
 
-#define DEVICE_IDE                  /* enable if IDE interface present */
+#define CONFIG_IDE                  /* enable if IDE interface present */
 
 /* We have a DS1302, we can read the time of day from it */
 #define CONFIG_RTC
index fe90175..df016d7 100644 (file)
@@ -64,7 +64,7 @@
 
 #ifdef CONFIG_PPP
        /* SD card in ParPortProp */
-       #define DEVICE_SD
+       #define CONFIG_SD
         #define SD_DRIVE_COUNT 1
        #define NUM_DEV_TTY 2