summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/dmv177/console
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-08-06 00:24:52 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-08-06 00:24:52 +0000
commit308e18c397d4d90ee521144e1d55620b6a710049 (patch)
tree7b4c06c5fe6efdd082a68d585b1409f0fe7965a7 /c/src/lib/libbsp/powerpc/dmv177/console
parentCommented out the code which yields the CPU when the serial controller is (diff)
downloadrtems-308e18c397d4d90ee521144e1d55620b6a710049.tar.bz2
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.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/dmv177/console')
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/console/config.c30
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c30
2 files changed, 54 insertions, 6 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;
+}