mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-26 14:18:20 +00:00
Added support for the Card Resource Register. The new probe routines
check for the presence of the DUART, SCC, and RTC. The SONIC check needs to be added in the future as the network driver is libchip'ed.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user