Changeset 308e18c in rtems


Ignore:
Timestamp:
Aug 6, 1998, 12:24:52 AM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
c23118b
Parents:
0eb85ae
Message:

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.

Location:
c/src/lib/libbsp/powerpc/dmv177
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/dmv177/console/config.c

    r0eb85ae r308e18c  
    143143
    144144boolean dmv177_z85c30_probe(int minor);
     145boolean dmv177_mc68681_probe(int minor);
    145146
    146147console_tbl     Console_Port_Tbl[] = {
     
    149150                SERIAL_MC68681,                 /* deviceType */
    150151                MC68681_FUNCTIONS,              /* pDeviceFns */
    151                 NULL,                           /* deviceProbe */
     152                dmv177_mc68681_probe,           /* deviceProbe */
    152153                NULL,                           /* pDeviceFlow */
    153154                16,                             /* ulMargin */
     
    168169                SERIAL_MC68681,                 /* deviceType */
    169170                MC68681_FUNCTIONS,              /* pDeviceFns */
    170                 NULL,                           /* deviceProbe */
     171                dmv177_mc68681_probe,           /* deviceProbe */
    171172                NULL,                           /* pDeviceFlow */
    172173                16,                             /* ulMargin */
     
    235236rtems_device_minor_number  Console_Port_Minor;
    236237
     238/*
     239 *  Hopefully, by checking the card resource register, this BSP
     240 *  will be able to operate on the DMV171, DMV176, or DMV177.
     241 */
     242
    237243boolean dmv177_z85c30_probe(int minor)
    238244{
    239245  volatile unsigned32 *dma_control_status_reg;
     246  volatile unsigned32 *card_resource_reg;
     247
     248  card_resource_reg = (volatile unsigned32 *) DMV170_CARD_RESORCE_REG;
     249
     250  if ( !(*card_resource_reg & DMV170_DUART_PRESENT_BIT) )
     251    return FALSE;
    240252
    241253  /*
     
    243255   */
    244256
    245   dma_control_status_reg = DMV170_DMA_CONTROL_STATUS_REG;
     257  dma_control_status_reg = (volatile unsigned32 *)DMV170_DMA_CONTROL_STATUS_REG;
    246258
    247259  if ( *dma_control_status_reg & DMV170_SCC_10MHZ )
     
    252264  return TRUE;
    253265}
     266
     267boolean dmv177_mc68681_probe(int minor)
     268{
     269  volatile unsigned32 *card_resource_reg;
     270
     271  card_resource_reg = (volatile unsigned32 *) DMV170_CARD_RESORCE_REG;
     272
     273  if ( *card_resource_reg & DMV170_DUART_PRESENT_BIT )
     274    return TRUE;
     275
     276  return FALSE;
     277}
  • c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c

    r0eb85ae r308e18c  
    143143
    144144boolean dmv177_z85c30_probe(int minor);
     145boolean dmv177_mc68681_probe(int minor);
    145146
    146147console_tbl     Console_Port_Tbl[] = {
     
    149150                SERIAL_MC68681,                 /* deviceType */
    150151                MC68681_FUNCTIONS,              /* pDeviceFns */
    151                 NULL,                           /* deviceProbe */
     152                dmv177_mc68681_probe,           /* deviceProbe */
    152153                NULL,                           /* pDeviceFlow */
    153154                16,                             /* ulMargin */
     
    168169                SERIAL_MC68681,                 /* deviceType */
    169170                MC68681_FUNCTIONS,              /* pDeviceFns */
    170                 NULL,                           /* deviceProbe */
     171                dmv177_mc68681_probe,           /* deviceProbe */
    171172                NULL,                           /* pDeviceFlow */
    172173                16,                             /* ulMargin */
     
    235236rtems_device_minor_number  Console_Port_Minor;
    236237
     238/*
     239 *  Hopefully, by checking the card resource register, this BSP
     240 *  will be able to operate on the DMV171, DMV176, or DMV177.
     241 */
     242
    237243boolean dmv177_z85c30_probe(int minor)
    238244{
    239245  volatile unsigned32 *dma_control_status_reg;
     246  volatile unsigned32 *card_resource_reg;
     247
     248  card_resource_reg = (volatile unsigned32 *) DMV170_CARD_RESORCE_REG;
     249
     250  if ( !(*card_resource_reg & DMV170_DUART_PRESENT_BIT) )
     251    return FALSE;
    240252
    241253  /*
     
    243255   */
    244256
    245   dma_control_status_reg = DMV170_DMA_CONTROL_STATUS_REG;
     257  dma_control_status_reg = (volatile unsigned32 *)DMV170_DMA_CONTROL_STATUS_REG;
    246258
    247259  if ( *dma_control_status_reg & DMV170_SCC_10MHZ )
     
    252264  return TRUE;
    253265}
     266
     267boolean dmv177_mc68681_probe(int minor)
     268{
     269  volatile unsigned32 *card_resource_reg;
     270
     271  card_resource_reg = (volatile unsigned32 *) DMV170_CARD_RESORCE_REG;
     272
     273  if ( *card_resource_reg & DMV170_DUART_PRESENT_BIT )
     274    return TRUE;
     275
     276  return FALSE;
     277}
  • c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h

    r0eb85ae r308e18c  
    273273#define SCV64_Is_IRQ5( _status ) (_status&0x20)
    274274
     275
     276/*
     277 *  Card Resource Register Constants
     278 */
     279
     280#define DMV170_DUART_PRESENT_BIT  0x0100
     281#define DMV170_SONIC_PRESENT_BIT  0x0200
     282#define DMV170_16MBYTES_FLASH_BIT 0x0400
     283#define DMV170_SCC_PRESENT_BIT    0x0800
     284#define DMV170_RTC_PRESENT_BIT    0x1000
     285
    275286/*
    276287 *  scv64.c
  • c/src/lib/libbsp/powerpc/dmv177/tod/config.c

    r0eb85ae r308e18c  
    3232 */
    3333
     34boolean dmv177_icm7170_probe(int minor);
     35
    3436rtc_tbl RTC_Table[] = {
    3537        {
     
    3739                RTC_ICM7170,                    /* deviceType */
    3840                &icm7170_fns,                   /* pDeviceFns */
    39                 rtc_probe,                      /* deviceProbe */
     41                dmv177_icm7170_probe,           /* deviceProbe */
    4042                (void *) ICM7170_AT_1_MHZ,      /* pDeviceParams */
    4143                DMV170_RTC_ADDRESS,             /* ulCtrlPort1 */
     
    5557
    5658rtems_device_minor_number  RTC_Minor;
     59
     60/*
     61 *  Hopefully, by checking the card resource register, this BSP
     62 *  will be able to operate on the DMV171, DMV176, or DMV177.
     63 */
     64
     65boolean dmv177_icm7170_probe(int minor)
     66{
     67  volatile unsigned32 *card_resource_reg;
     68
     69  card_resource_reg = (volatile unsigned32 *) DMV170_CARD_RESORCE_REG;
     70
     71  if ( *card_resource_reg & DMV170_RTC_PRESENT_BIT )
     72    return TRUE;
     73
     74  return FALSE;
     75}
     76
  • c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c

    r0eb85ae r308e18c  
    3232 */
    3333
     34boolean dmv177_icm7170_probe(int minor);
     35
    3436rtc_tbl RTC_Table[] = {
    3537        {
     
    3739                RTC_ICM7170,                    /* deviceType */
    3840                &icm7170_fns,                   /* pDeviceFns */
    39                 rtc_probe,                      /* deviceProbe */
     41                dmv177_icm7170_probe,           /* deviceProbe */
    4042                (void *) ICM7170_AT_1_MHZ,      /* pDeviceParams */
    4143                DMV170_RTC_ADDRESS,             /* ulCtrlPort1 */
     
    5557
    5658rtems_device_minor_number  RTC_Minor;
     59
     60/*
     61 *  Hopefully, by checking the card resource register, this BSP
     62 *  will be able to operate on the DMV171, DMV176, or DMV177.
     63 */
     64
     65boolean dmv177_icm7170_probe(int minor)
     66{
     67  volatile unsigned32 *card_resource_reg;
     68
     69  card_resource_reg = (volatile unsigned32 *) DMV170_CARD_RESORCE_REG;
     70
     71  if ( *card_resource_reg & DMV170_RTC_PRESENT_BIT )
     72    return TRUE;
     73
     74  return FALSE;
     75}
     76
Note: See TracChangeset for help on using the changeset viewer.