mpc8260 libcpu and mpc6260ads BSP: Fix warnings

This commit is contained in:
Joel Sherrill
2014-10-15 09:31:41 -05:00
parent 4af55a83f1
commit 7ec9bd5917
7 changed files with 118 additions and 160 deletions

View File

@@ -1,6 +1,4 @@
/* /*
* console.c
*
* This file contains the MBX8xx termios serial I/O package. * This file contains the MBX8xx termios serial I/O package.
* Only asynchronous I/O is supported. * Only asynchronous I/O is supported.
* *
@@ -14,6 +12,16 @@
* SCC3 /dev/tty3 4 * SCC3 /dev/tty3 4
* SCC4 /dev/tty4 5 * SCC4 /dev/tty4 5
* *
* The SCCs and SMCs on the eval board are assigned as follows
*
* Channel Device Minor Termios
* SMC1 /dev/tty3 4 no
* SMC2 /dev/tty4 5 no
* SCC1 /dev/tty0 0 no
* SCC2 /dev/console 1 yes
* SCC3 /dev/tty1 2 no * USED FOR NETWORK I/F
* SCC4 /dev/tty2 3 no * USED FOR NETWORK I/F
*
* All ports support termios. The use of termios is recommended for real-time * All ports support termios. The use of termios is recommended for real-time
* applications. Termios provides buffering and input processing. When not * applications. Termios provides buffering and input processing. When not
* using termios, processing is limited to the substitution of LF for CR on * using termios, processing is limited to the substitution of LF for CR on
@@ -64,7 +72,9 @@
* the sub-devices using minor device numbers. It is not possible to have * the sub-devices using minor device numbers. It is not possible to have
* other protocols running on the other ports when this driver is used as * other protocols running on the other ports when this driver is used as
* currently written. * currently written.
* */
/*
* Based on code (alloc860.c in eth_comm port) by * Based on code (alloc860.c in eth_comm port) by
* Jay Monkman (jmonkman@frasca.com), * Jay Monkman (jmonkman@frasca.com),
* Copyright (C) 1998 by Frasca International, Inc. * Copyright (C) 1998 by Frasca International, Inc.
@@ -75,17 +85,6 @@
* *
* Modifications by Andy Dachs <iwe@fsmal.net> for MPC8260 * Modifications by Andy Dachs <iwe@fsmal.net> for MPC8260
* support. * support.
*
* The SCCs and SMCs on the eval board are assigned as follows
*
* Channel Device Minor Termios
* SMC1 /dev/tty3 4 no
* SMC2 /dev/tty4 5 no
* SCC1 /dev/tty0 0 no
* SCC2 /dev/console 1 yes
* SCC3 /dev/tty1 2 no * USED FOR NETWORK I/F
* SCC4 /dev/tty2 3 no * USED FOR NETWORK I/F
*
*/ */
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
@@ -451,7 +450,6 @@ rtems_device_driver console_control(
/* /*
* Support routine for console-generic * Support routine for console-generic
*/ */
int mbx8xx_console_get_configuration(void) int mbx8xx_console_get_configuration(void)
{ {
#if UARTS_IO_MODE == 1 #if UARTS_IO_MODE == 1

View File

@@ -1,10 +1,9 @@
/* bsp.h /*
*
* This include file contains all board IO definitions. * This include file contains all board IO definitions.
* */
* XXX : put yours in here
* /*
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-2014.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -46,12 +45,6 @@ typedef struct bcsr
} BCSR; } BCSR;
#define UART1_E 0x02000002 /* bit 6 of BCSR1 */
#define UART2_E 0x01000001 /* bit 7 of BCSR1 */
#define GP0_LED 0x02000002 /* bit 6 of BCSR0 */
#define GP1_LED 0x01000001 /* bit 7 of BCSR0 */
/* /*
* Network driver configuration * Network driver configuration
*/ */
@@ -84,6 +77,9 @@ extern char M8260DefaultWatchdogFeeder;
* Prototypes for items shared across file boundaries in the BSP * Prototypes for items shared across file boundaries in the BSP
*/ */
extern uint32_t bsp_serial_per_sec; extern uint32_t bsp_serial_per_sec;
void *bsp_idle_thread( uintptr_t ignored );
void cpu_init(void);
int mbx8xx_console_get_configuration(void);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -211,7 +211,7 @@ volatile unsigned int maxLoop = 0;
/* /*
* High level IRQ handler called from shared_raw_irq_code_entry * High level IRQ handler called from shared_raw_irq_code_entry
*/ */
int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned excNum) static int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned excNum)
{ {
register unsigned int irq; register unsigned int irq;
#if 0 #if 0
@@ -310,7 +310,7 @@ int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned excNum)
/* /*
* Initialize CPM interrupt management * Initialize CPM interrupt management
*/ */
void static void
BSP_CPM_irq_init(void) BSP_CPM_irq_init(void)
{ {
m8260.simr_l = 0; m8260.simr_l = 0;

View File

@@ -49,6 +49,12 @@
#include <string.h> #include <string.h>
#define UART1_E 0x02000002 /* bit 6 of BCSR1 */
#define UART2_E 0x01000001 /* bit 7 of BCSR1 */
#define GP0_LED 0x02000002 /* bit 6 of BCSR0 */
#define GP1_LED 0x01000001 /* bit 7 of BCSR0 */
SPR_RW(SPRG1) SPR_RW(SPRG1)
/* /*
@@ -66,13 +72,37 @@ uint32_t bsp_timer_average_overhead; /* Average overhead of timer in ticks */
uint32_t bsp_timer_least_valid; /* Least valid number from timer */ uint32_t bsp_timer_least_valid; /* Least valid number from timer */
bool bsp_timer_internal_clock; /* TRUE, when timer runs with CPU clk */ bool bsp_timer_internal_clock; /* TRUE, when timer runs with CPU clk */
void _BSP_GPLED1_on(void);
void _BSP_GPLED0_on(void);
void cpu_init(void);
extern char IntrStack_start []; extern char IntrStack_start [];
extern char intrStack []; extern char intrStack [];
static void _BSP_GPLED0_on(void)
{
BCSR *csr;
csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
csr->bcsr0 &= ~GP0_LED; /* Turn on GP0 LED */
}
static void _BSP_GPLED0_off(void)
{
BCSR *csr;
csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
csr->bcsr0 |= GP0_LED; /* Turn off GP0 LED */
}
static void _BSP_GPLED1_on(void)
{
BCSR *csr;
csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
csr->bcsr0 &= ~GP1_LED; /* Turn on GP1 LED */
}
static void _BSP_GPLED1_off(void)
{
BCSR *csr;
csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
csr->bcsr0 |= GP1_LED; /* Turn off GP1 LED */
}
void BSP_panic(char *s) void BSP_panic(char *s)
{ {
_BSP_GPLED1_on(); _BSP_GPLED1_on();
@@ -88,63 +118,20 @@ void _BSP_Fatal_error(unsigned int v)
__asm__ __volatile ("sc"); __asm__ __volatile ("sc");
} }
void _BSP_GPLED0_on(void) static void _BSP_Uart1_enable(void)
{
BCSR *csr;
csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
csr->bcsr0 &= ~GP0_LED; /* Turn on GP0 LED */
}
void _BSP_GPLED0_off(void)
{
BCSR *csr;
csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
csr->bcsr0 |= GP0_LED; /* Turn off GP0 LED */
}
void _BSP_GPLED1_on(void)
{
BCSR *csr;
csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
csr->bcsr0 &= ~GP1_LED; /* Turn on GP1 LED */
}
void _BSP_GPLED1_off(void)
{
BCSR *csr;
csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
csr->bcsr0 |= GP1_LED; /* Turn off GP1 LED */
}
void _BSP_Uart1_enable(void)
{ {
BCSR *csr; BCSR *csr;
csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000); csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
csr->bcsr1 &= ~UART1_E; /* Enable Uart1 */ csr->bcsr1 &= ~UART1_E; /* Enable Uart1 */
} }
void _BSP_Uart1_disable(void) static void _BSP_Uart2_enable(void)
{
BCSR *csr;
csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
csr->bcsr1 |= UART1_E; /* Disable Uart1 */
}
void _BSP_Uart2_enable(void)
{ {
BCSR *csr; BCSR *csr;
csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000); csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
csr->bcsr1 &= ~UART2_E; /* Enable Uart2 */ csr->bcsr1 &= ~UART2_E; /* Enable Uart2 */
} }
void _BSP_Uart2_disable(void)
{
BCSR *csr;
csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
csr->bcsr1 |= UART2_E; /* Disable Uart2 */
}
void bsp_start(void) void bsp_start(void)
{ {
/* Set MPC8260ADS board LEDS and Uart enable lines */ /* Set MPC8260ADS board LEDS and Uart enable lines */

View File

@@ -1,6 +1,8 @@
/* /*
* Moved to libbsp/powerpc/shared by Joel Sherrill (9 Sept 09). * Moved to libbsp/powerpc/shared by Joel Sherrill (9 Sept 09).
* */
/*
* The MPC860 specific stuff was written by Jay Monkman (jmonkman@frasca.com) * The MPC860 specific stuff was written by Jay Monkman (jmonkman@frasca.com)
* *
* Modified for the MPC8260ADS board by Andy Dachs <a.dachs@sstl.co.uk> * Modified for the MPC8260ADS board by Andy Dachs <a.dachs@sstl.co.uk>

View File

@@ -20,6 +20,9 @@
* BRG2 * BRG2
* BRG3 * BRG3
* BRG4 * BRG4
*/
/*
* Author: Jay Monkman (jmonkman@frasca.com) * Author: Jay Monkman (jmonkman@frasca.com)
* Copyright (C) 1998 by Frasca International, Inc. * Copyright (C) 1998 by Frasca International, Inc.
* *
@@ -59,12 +62,9 @@
#include <bsp/irq.h> #include <bsp/irq.h>
#include <rtems/bspIo.h> /* for printk */ #include <rtems/bspIo.h> /* for printk */
/* BSP supplied routine */ /* BSP supplied routine */
extern int mbx8xx_console_get_configuration(void); extern int mbx8xx_console_get_configuration(void);
/* /*
* Interrupt-driven input buffer * Interrupt-driven input buffer
*/ */
@@ -83,8 +83,6 @@ static volatile char txBuf[NUM_PORTS];
/* SCC/SMC buffer descriptors */ /* SCC/SMC buffer descriptors */
static volatile m8260BufferDescriptor_t *RxBd[NUM_PORTS], *TxBd[NUM_PORTS]; static volatile m8260BufferDescriptor_t *RxBd[NUM_PORTS], *TxBd[NUM_PORTS];
/* Used to track termios private data for callbacks */ /* Used to track termios private data for callbacks */
struct rtems_termios_tty *ttyp[NUM_PORTS]; struct rtems_termios_tty *ttyp[NUM_PORTS];
@@ -105,8 +103,6 @@ static rtems_isr m8xx_scc2_interrupt_handler(rtems_irq_hdl_param unused);
static rtems_isr m8xx_scc3_interrupt_handler(rtems_irq_hdl_param unused); static rtems_isr m8xx_scc3_interrupt_handler(rtems_irq_hdl_param unused);
static rtems_isr m8xx_scc4_interrupt_handler(rtems_irq_hdl_param unused); static rtems_isr m8xx_scc4_interrupt_handler(rtems_irq_hdl_param unused);
/* /*
* Hardware-dependent portion of tcsetattr(). * Hardware-dependent portion of tcsetattr().
*/ */
@@ -223,7 +219,6 @@ m8xx_smc_set_attributes (int minor, const struct termios *t)
return 0; return 0;
} }
static int static int
m8xx_scc_set_attributes (int minor, const struct termios *t) m8xx_scc_set_attributes (int minor, const struct termios *t)
{ {
@@ -315,7 +310,6 @@ m8xx_scc_set_attributes (int minor, const struct termios *t)
return 0; return 0;
} }
int int
m8xx_uart_setAttributes( m8xx_uart_setAttributes(
int minor, int minor,
@@ -342,11 +336,9 @@ m8xx_uart_setAttributes(
return 0; return 0;
} }
/* /*
* Interrupt handlers * Interrupt handlers
*/ */
static void static void
m8xx_scc1_interrupt_handler (rtems_irq_hdl_param unused) m8xx_scc1_interrupt_handler (rtems_irq_hdl_param unused)
{ {
@@ -431,7 +423,6 @@ m8xx_scc2_interrupt_handler (rtems_irq_hdl_param unused)
#endif #endif
} }
static void static void
m8xx_scc3_interrupt_handler (rtems_irq_hdl_param unused) m8xx_scc3_interrupt_handler (rtems_irq_hdl_param unused)
{ {
@@ -475,7 +466,6 @@ m8xx_scc3_interrupt_handler (rtems_irq_hdl_param unused)
#endif #endif
} }
static void static void
m8xx_scc4_interrupt_handler (rtems_irq_hdl_param unused) m8xx_scc4_interrupt_handler (rtems_irq_hdl_param unused)
{ {
@@ -560,7 +550,6 @@ m8xx_smc1_interrupt_handler (rtems_irq_hdl_param unused)
#endif #endif
} }
static void static void
m8xx_smc2_interrupt_handler (rtems_irq_hdl_param unused) m8xx_smc2_interrupt_handler (rtems_irq_hdl_param unused)
{ {
@@ -603,8 +592,7 @@ m8xx_smc2_interrupt_handler (rtems_irq_hdl_param unused)
#endif #endif
} }
static void m8xx_scc_enable(const rtems_irq_connect_data* ptr)
void m8xx_scc_enable(const rtems_irq_connect_data* ptr)
{ {
volatile m8260SCCRegisters_t *sccregs = 0; volatile m8260SCCRegisters_t *sccregs = 0;
switch (ptr->name) { switch (ptr->name) {
@@ -630,7 +618,7 @@ void m8xx_scc_enable(const rtems_irq_connect_data* ptr)
sccregs->sccm = 3; sccregs->sccm = 3;
} }
void m8xx_scc_disable(const rtems_irq_connect_data* ptr) static void m8xx_scc_disable(const rtems_irq_connect_data* ptr)
{ {
volatile m8260SCCRegisters_t *sccregs = 0; volatile m8260SCCRegisters_t *sccregs = 0;
switch (ptr->name) { switch (ptr->name) {
@@ -652,7 +640,7 @@ void m8xx_scc_disable(const rtems_irq_connect_data* ptr)
sccregs->sccm &= (~3); sccregs->sccm &= (~3);
} }
int m8xx_scc_isOn(const rtems_irq_connect_data* ptr) static int m8xx_scc_isOn(const rtems_irq_connect_data* ptr)
{ {
return BSP_irq_enabled_at_cpm (ptr->name); return BSP_irq_enabled_at_cpm (ptr->name);
} }
@@ -667,7 +655,6 @@ static rtems_irq_connect_data consoleIrqData =
(rtems_irq_is_enabled) m8xx_scc_isOn (rtems_irq_is_enabled) m8xx_scc_isOn
}; };
void void
m8xx_uart_scc_initialize (int minor) m8xx_uart_scc_initialize (int minor)
{ {
@@ -729,9 +716,6 @@ m8xx_uart_scc_initialize (int minor)
sccparms->rbase = (char *)RxBd[minor] - (char *)&m8260; sccparms->rbase = (char *)RxBd[minor] - (char *)&m8260;
sccparms->tbase = (char *)TxBd[minor] - (char *)&m8260; sccparms->tbase = (char *)TxBd[minor] - (char *)&m8260;
sccparms->rfcr = M8260_RFCR_MOT | M8260_RFCR_60X_BUS; sccparms->rfcr = M8260_RFCR_MOT | M8260_RFCR_60X_BUS;
sccparms->tfcr = M8260_TFCR_MOT | M8260_TFCR_60X_BUS; sccparms->tfcr = M8260_TFCR_MOT | M8260_TFCR_60X_BUS;
if ( (mbx8xx_console_get_configuration() & 0x06) == 0x02 ) if ( (mbx8xx_console_get_configuration() & 0x06) == 0x02 )
@@ -759,7 +743,6 @@ m8xx_uart_scc_initialize (int minor)
sccparms->un.uart.character[6] = 0x8000; /* Entry is invalid */ sccparms->un.uart.character[6] = 0x8000; /* Entry is invalid */
sccparms->un.uart.character[7] = 0x8000; /* Entry is invalid */ sccparms->un.uart.character[7] = 0x8000; /* Entry is invalid */
sccparms->un.uart.rccm = 0xc0ff; /* No masking */ sccparms->un.uart.rccm = 0xc0ff; /* No masking */
/* /*
@@ -831,9 +814,7 @@ m8xx_uart_scc_initialize (int minor)
} }
} }
static void m8xx_smc_enable(const rtems_irq_connect_data* ptr)
void m8xx_smc_enable(const rtems_irq_connect_data* ptr)
{ {
volatile m8260SMCRegisters_t *smcregs = 0; volatile m8260SMCRegisters_t *smcregs = 0;
switch (ptr->name) { switch (ptr->name) {
@@ -849,7 +830,7 @@ void m8xx_smc_enable(const rtems_irq_connect_data* ptr)
smcregs->smcm = 3; smcregs->smcm = 3;
} }
void m8xx_smc_disable(const rtems_irq_connect_data* ptr) static void m8xx_smc_disable(const rtems_irq_connect_data* ptr)
{ {
volatile m8260SMCRegisters_t *smcregs = 0; volatile m8260SMCRegisters_t *smcregs = 0;
switch (ptr->name) { switch (ptr->name) {
@@ -865,12 +846,11 @@ void m8xx_smc_disable(const rtems_irq_connect_data* ptr)
smcregs->smcm &= (~3); smcregs->smcm &= (~3);
} }
int m8xx_smc_isOn(const rtems_irq_connect_data* ptr) static int m8xx_smc_isOn(const rtems_irq_connect_data* ptr)
{ {
return BSP_irq_enabled_at_cpm (ptr->name); return BSP_irq_enabled_at_cpm (ptr->name);
} }
void void
m8xx_uart_smc_initialize (int minor) m8xx_uart_smc_initialize (int minor)
{ {
@@ -889,6 +869,7 @@ m8xx_uart_smc_initialize (int minor)
brg = m8xx_get_brg(M8260_SMC1_BRGS, 9600*16); brg = m8xx_get_brg(M8260_SMC1_BRGS, 9600*16);
else else
brg = m8xx_get_brg(M8260_SMC2_BRGS, 9600*16); brg = m8xx_get_brg(M8260_SMC2_BRGS, 9600*16);
(void) brg; /* avoid set but not used warning */
/* /*
* Allocate buffer descriptors * Allocate buffer descriptors
@@ -1036,10 +1017,8 @@ m8xx_uart_smc_initialize (int minor)
void void
m8xx_uart_initialize(void) m8xx_uart_initialize(void)
{ {
} }
void void
m8xx_uart_interrupts_initialize(void) m8xx_uart_interrupts_initialize(void)
{ {
@@ -1055,11 +1034,9 @@ m8xx_uart_interrupts_initialize(void)
m8xx.cicr = 0x00043F80; /* SCaP=SCC1, SCbP=SCC2, IRL=1, HP=PC15, IEN=1 */ m8xx.cicr = 0x00043F80; /* SCaP=SCC1, SCbP=SCC2, IRL=1, HP=PC15, IEN=1 */
#endif #endif
m8xx.simask |= M8xx_SIMASK_LVM1; /* Enable level interrupts */ m8xx.simask |= M8xx_SIMASK_LVM1; /* Enable level interrupts */
#endif #endif
} }
int int
m8xx_uart_pollRead( m8xx_uart_pollRead(
int minor int minor
@@ -1079,7 +1056,6 @@ m8xx_uart_pollRead(
return c; return c;
} }
/* /*
* TODO: Get a free buffer and set it up. * TODO: Get a free buffer and set it up.
*/ */
@@ -1102,7 +1078,6 @@ m8xx_uart_write(
return 0; return 0;
} }
ssize_t ssize_t
m8xx_uart_pollWrite( m8xx_uart_pollWrite(
int minor, int minor,

View File

@@ -10,7 +10,9 @@
* *
* *** All attempts to allocate a BRG or CLK line should be made via * *** All attempts to allocate a BRG or CLK line should be made via
* calls to these routines or they simply won't work. * calls to these routines or they simply won't work.
* */
/*
* Author: Andy Dachs <a.dachs@sstl.co.uk> * Author: Andy Dachs <a.dachs@sstl.co.uk>
* Copyright Surrey Satellite Technology Limited (SSTL), 2001 * Copyright Surrey Satellite Technology Limited (SSTL), 2001
* *
@@ -30,7 +32,7 @@
* http://www.rtems.org/license/LICENSE. * http://www.rtems.org/license/LICENSE.
*/ */
#include <rtems.h> #include <bsp.h>
#include <mpc8260.h> #include <mpc8260.h>
#include <mpc8260/cpm.h> #include <mpc8260/cpm.h>
#include <rtems/bspIo.h> #include <rtems/bspIo.h>
@@ -43,7 +45,6 @@
static unsigned long brg_spd[NUM_BRGS]; static unsigned long brg_spd[NUM_BRGS];
static unsigned int brg_use_count[NUM_BRGS]; static unsigned int brg_use_count[NUM_BRGS];
/* Used to track the usage of the clock inputs */ /* Used to track the usage of the clock inputs */
/* (initialised to zeros) */ /* (initialised to zeros) */
static unsigned int clk_use_count[NUM_BRGS]; static unsigned int clk_use_count[NUM_BRGS];
@@ -66,7 +67,6 @@ m8xx_get_brg_cd (int baud)
((divisor - 1) << 1) | div16; ((divisor - 1) << 1) | div16;
} }
/* /*
* Allocates an existing brg if one is already programmed for the same * Allocates an existing brg if one is already programmed for the same
* baud rate. Otherwise a new brg is assigned * baud rate. Otherwise a new brg is assigned
@@ -80,7 +80,7 @@ m8xx_get_brg(unsigned brgmask, int baud)
/* first try to find a BRG that is already at the right speed */ /* first try to find a BRG that is already at the right speed */
for ( i = 0; i < NUM_BRGS; i++ ) { for ( i = 0; i < NUM_BRGS; i++ ) {
if( (1 << i) & brgmask ) /* is this brg allowed? */ if ( (1 << i) & brgmask ) /* is this brg allowed? */
if ( brg_spd[i] == baud ) { if ( brg_spd[i] == baud ) {
break; break;
} }
@@ -147,19 +147,19 @@ m8xx_get_brg(unsigned brgmask, int baud)
void void
m8xx_free_brg( int brg_num ) m8xx_free_brg( int brg_num )
{ {
if( (brg_num>=0) && (brg_num<NUM_BRGS) ) if ( (brg_num>=0) && (brg_num<NUM_BRGS) )
if(brg_use_count[brg_num] > 0 ) if (brg_use_count[brg_num] > 0 )
brg_use_count[brg_num]--; brg_use_count[brg_num]--;
} }
#ifdef DEBUG_BRG
void m8xx_dump_brgs( void ) static void m8xx_dump_brgs( void )
{ {
int i; int i;
for(i=0; i<NUM_BRGS; i++ ) for (i=0; i<NUM_BRGS; i++ )
printk( "Brg[%d]: %d %d\n", i, brg_use_count[i], brg_spd[i] ); printk( "Brg[%d]: %d %d\n", i, brg_use_count[i], brg_spd[i] );
} }
#endif
/* /*
* Reserve one of a range of clock inputs * Reserve one of a range of clock inputs
@@ -192,7 +192,7 @@ m8xx_get_clk( unsigned clkmask )
void void
m8xx_free_clk( int clk_num ) m8xx_free_clk( int clk_num )
{ {
if( (clk_num>=0) && (clk_num<NUM_BRGS) ) if ( (clk_num>=0) && (clk_num<NUM_BRGS) )
if(clk_use_count[clk_num] > 0 ) if (clk_use_count[clk_num] > 0 )
clk_use_count[clk_num]--; clk_use_count[clk_num]--;
} }