diff options
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/powerpc/dmv177/console/config.c | 30 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c | 30 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h | 11 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/dmv177/tod/config.c | 22 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c | 22 |
5 files changed, 107 insertions, 8 deletions
diff --git a/c/src/lib/libbsp/powerpc/dmv177/console/config.c b/c/src/lib/libbsp/powerpc/dmv177/console/config.c index 80b7828e29..b092e14c37 100644 --- a/c/src/lib/libbsp/powerpc/dmv177/console/config.c +++ b/c/src/lib/libbsp/powerpc/dmv177/console/config.c @@ -142,13 +142,14 @@ mc68681_baud_t #endif boolean dmv177_z85c30_probe(int minor); +boolean dmv177_mc68681_probe(int minor); console_tbl Console_Port_Tbl[] = { { "/dev/com0", /* sDeviceName */ SERIAL_MC68681, /* deviceType */ MC68681_FUNCTIONS, /* pDeviceFns */ - NULL, /* deviceProbe */ + dmv177_mc68681_probe, /* deviceProbe */ NULL, /* pDeviceFlow */ 16, /* ulMargin */ 8, /* ulHysteresis */ @@ -167,7 +168,7 @@ console_tbl Console_Port_Tbl[] = { "/dev/com1", /* sDeviceName */ SERIAL_MC68681, /* deviceType */ MC68681_FUNCTIONS, /* pDeviceFns */ - NULL, /* deviceProbe */ + dmv177_mc68681_probe, /* deviceProbe */ NULL, /* pDeviceFlow */ 16, /* ulMargin */ 8, /* ulHysteresis */ @@ -234,15 +235,26 @@ console_data Console_Port_Data[NUM_CONSOLE_PORTS]; rtems_device_minor_number Console_Port_Minor; +/* + * Hopefully, by checking the card resource register, this BSP + * will be able to operate on the DMV171, DMV176, or DMV177. + */ + boolean dmv177_z85c30_probe(int minor) { volatile unsigned32 *dma_control_status_reg; + volatile unsigned32 *card_resource_reg; + + card_resource_reg = (volatile unsigned32 *) DMV170_CARD_RESORCE_REG; + + if ( !(*card_resource_reg & DMV170_DUART_PRESENT_BIT) ) + return FALSE; /* * Figure out the clock speed of the Z85C30 SCC */ - dma_control_status_reg = DMV170_DMA_CONTROL_STATUS_REG; + dma_control_status_reg = (volatile unsigned32 *)DMV170_DMA_CONTROL_STATUS_REG; if ( *dma_control_status_reg & DMV170_SCC_10MHZ ) Console_Port_Tbl[minor].ulClock = Z85C30_CLOCK_10; @@ -251,3 +263,15 @@ boolean dmv177_z85c30_probe(int minor) return TRUE; } + +boolean dmv177_mc68681_probe(int minor) +{ + volatile unsigned32 *card_resource_reg; + + card_resource_reg = (volatile unsigned32 *) DMV170_CARD_RESORCE_REG; + + if ( *card_resource_reg & DMV170_DUART_PRESENT_BIT ) + return TRUE; + + return FALSE; +} diff --git a/c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c b/c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c index 80b7828e29..b092e14c37 100644 --- a/c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c +++ b/c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c @@ -142,13 +142,14 @@ mc68681_baud_t #endif boolean dmv177_z85c30_probe(int minor); +boolean dmv177_mc68681_probe(int minor); console_tbl Console_Port_Tbl[] = { { "/dev/com0", /* sDeviceName */ SERIAL_MC68681, /* deviceType */ MC68681_FUNCTIONS, /* pDeviceFns */ - NULL, /* deviceProbe */ + dmv177_mc68681_probe, /* deviceProbe */ NULL, /* pDeviceFlow */ 16, /* ulMargin */ 8, /* ulHysteresis */ @@ -167,7 +168,7 @@ console_tbl Console_Port_Tbl[] = { "/dev/com1", /* sDeviceName */ SERIAL_MC68681, /* deviceType */ MC68681_FUNCTIONS, /* pDeviceFns */ - NULL, /* deviceProbe */ + dmv177_mc68681_probe, /* deviceProbe */ NULL, /* pDeviceFlow */ 16, /* ulMargin */ 8, /* ulHysteresis */ @@ -234,15 +235,26 @@ console_data Console_Port_Data[NUM_CONSOLE_PORTS]; rtems_device_minor_number Console_Port_Minor; +/* + * Hopefully, by checking the card resource register, this BSP + * will be able to operate on the DMV171, DMV176, or DMV177. + */ + boolean dmv177_z85c30_probe(int minor) { volatile unsigned32 *dma_control_status_reg; + volatile unsigned32 *card_resource_reg; + + card_resource_reg = (volatile unsigned32 *) DMV170_CARD_RESORCE_REG; + + if ( !(*card_resource_reg & DMV170_DUART_PRESENT_BIT) ) + return FALSE; /* * Figure out the clock speed of the Z85C30 SCC */ - dma_control_status_reg = DMV170_DMA_CONTROL_STATUS_REG; + dma_control_status_reg = (volatile unsigned32 *)DMV170_DMA_CONTROL_STATUS_REG; if ( *dma_control_status_reg & DMV170_SCC_10MHZ ) Console_Port_Tbl[minor].ulClock = Z85C30_CLOCK_10; @@ -251,3 +263,15 @@ boolean dmv177_z85c30_probe(int minor) return TRUE; } + +boolean dmv177_mc68681_probe(int minor) +{ + volatile unsigned32 *card_resource_reg; + + card_resource_reg = (volatile unsigned32 *) DMV170_CARD_RESORCE_REG; + + if ( *card_resource_reg & DMV170_DUART_PRESENT_BIT ) + return TRUE; + + return FALSE; +} diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h b/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h index 06e69393a2..e5019b4392 100644 --- a/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h +++ b/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h @@ -272,6 +272,17 @@ extern "C" { #define SCV64_Is_IRQ4( _status ) (_status&0x10) #define SCV64_Is_IRQ5( _status ) (_status&0x20) + +/* + * Card Resource Register Constants + */ + +#define DMV170_DUART_PRESENT_BIT 0x0100 +#define DMV170_SONIC_PRESENT_BIT 0x0200 +#define DMV170_16MBYTES_FLASH_BIT 0x0400 +#define DMV170_SCC_PRESENT_BIT 0x0800 +#define DMV170_RTC_PRESENT_BIT 0x1000 + /* * scv64.c */ diff --git a/c/src/lib/libbsp/powerpc/dmv177/tod/config.c b/c/src/lib/libbsp/powerpc/dmv177/tod/config.c index 50f8d34fdb..1a94bc3da5 100644 --- a/c/src/lib/libbsp/powerpc/dmv177/tod/config.c +++ b/c/src/lib/libbsp/powerpc/dmv177/tod/config.c @@ -31,12 +31,14 @@ * all others being given the name indicated. */ +boolean dmv177_icm7170_probe(int minor); + rtc_tbl RTC_Table[] = { { "/dev/rtc0", /* sDeviceName */ RTC_ICM7170, /* deviceType */ &icm7170_fns, /* pDeviceFns */ - rtc_probe, /* deviceProbe */ + dmv177_icm7170_probe, /* deviceProbe */ (void *) ICM7170_AT_1_MHZ, /* pDeviceParams */ DMV170_RTC_ADDRESS, /* ulCtrlPort1 */ NULL, /* ulDataPort */ @@ -54,3 +56,21 @@ rtc_tbl RTC_Table[] = { unsigned long RTC_Count = NUM_RTCS; rtems_device_minor_number RTC_Minor; + +/* + * Hopefully, by checking the card resource register, this BSP + * will be able to operate on the DMV171, DMV176, or DMV177. + */ + +boolean dmv177_icm7170_probe(int minor) +{ + volatile unsigned32 *card_resource_reg; + + card_resource_reg = (volatile unsigned32 *) DMV170_CARD_RESORCE_REG; + + if ( *card_resource_reg & DMV170_RTC_PRESENT_BIT ) + return TRUE; + + return FALSE; +} + diff --git a/c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c b/c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c index 50f8d34fdb..1a94bc3da5 100644 --- a/c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c +++ b/c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c @@ -31,12 +31,14 @@ * all others being given the name indicated. */ +boolean dmv177_icm7170_probe(int minor); + rtc_tbl RTC_Table[] = { { "/dev/rtc0", /* sDeviceName */ RTC_ICM7170, /* deviceType */ &icm7170_fns, /* pDeviceFns */ - rtc_probe, /* deviceProbe */ + dmv177_icm7170_probe, /* deviceProbe */ (void *) ICM7170_AT_1_MHZ, /* pDeviceParams */ DMV170_RTC_ADDRESS, /* ulCtrlPort1 */ NULL, /* ulDataPort */ @@ -54,3 +56,21 @@ rtc_tbl RTC_Table[] = { unsigned long RTC_Count = NUM_RTCS; rtems_device_minor_number RTC_Minor; + +/* + * Hopefully, by checking the card resource register, this BSP + * will be able to operate on the DMV171, DMV176, or DMV177. + */ + +boolean dmv177_icm7170_probe(int minor) +{ + volatile unsigned32 *card_resource_reg; + + card_resource_reg = (volatile unsigned32 *) DMV170_CARD_RESORCE_REG; + + if ( *card_resource_reg & DMV170_RTC_PRESENT_BIT ) + return TRUE; + + return FALSE; +} + |