Whitespace removal.

This commit is contained in:
Ralf Corsepius
2009-11-30 03:49:08 +00:00
parent b1274bd94c
commit 3495c57d11
50 changed files with 593 additions and 593 deletions

View File

@@ -14,12 +14,12 @@
*/ */
/* configuration information */ /* configuration information */
#define CONFIGURE_MP_APPLICATION #define CONFIGURE_MP_APPLICATION
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_TASKS 2
#define CONFIGURE_POSIX_INIT_THREAD_TABLE #define CONFIGURE_POSIX_INIT_THREAD_TABLE

View File

@@ -1,4 +1,4 @@
/* /*
* COPYRIGHT (c) 1989-2007 * COPYRIGHT (c) 1989-2007
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *

View File

@@ -1,5 +1,5 @@
/* Console driver for bf537Stamp /* Console driver for bf537Stamp
* *
* Copyright (c) 2008 Kallisti Labs, Los Gatos, CA, USA * Copyright (c) 2008 Kallisti Labs, Los Gatos, CA, USA
* written by Allan Hessenflow <allanh@kallisti.com> * written by Allan Hessenflow <allanh@kallisti.com>
* *
@@ -9,7 +9,7 @@
* *
* $Id$ * $Id$
*/ */
#include <rtems.h> #include <rtems.h>
#include <rtems/libio.h> #include <rtems/libio.h>

View File

@@ -1,5 +1,5 @@
/* bsp.h /* bsp.h
* *
* This include file contains all board IO definitions for bf537Stamp. * This include file contains all board IO definitions for bf537Stamp.
* *
* Copyright (c) 2006 by Atos Automacao Industrial Ltda. * Copyright (c) 2006 by Atos Automacao Industrial Ltda.
@@ -12,7 +12,7 @@
* *
* $Id$ * $Id$
*/ */
#ifndef _BSP_H #ifndef _BSP_H
#define _BSP_H #define _BSP_H
@@ -34,7 +34,7 @@ extern "C" {
#define BSP_DATA_CACHE_CONFIG (3 << DMEM_CONTROL_DMC_SHIFT) #define BSP_DATA_CACHE_CONFIG (3 << DMEM_CONTROL_DMC_SHIFT)
/* /*
* PLL and clock setup values: * PLL and clock setup values:
*/ */

View File

@@ -59,30 +59,30 @@ __start:
p0.l = start; p0.l = start;
p1.h = HI(CEC_EVT15); p1.h = HI(CEC_EVT15);
p1.l = LO(CEC_EVT15); p1.l = LO(CEC_EVT15);
[p1] = p0; [p1] = p0;
r0 = 0x8000 (z); r0 = 0x8000 (z);
sti r0; sti r0;
raise 15; raise 15;
p0.h = wait; p0.h = wait;
p0.l = wait; p0.l = wait;
reti = p0; reti = p0;
rti; rti;
/* wait for event 15 */ /* wait for event 15 */
wait: wait:
jump wait; jump wait;
start: start:
[--sp] = reti; /* allow us to process interrupts later */ [--sp] = reti; /* allow us to process interrupts later */
/* mask interrupts for now */ /* mask interrupts for now */
cli r0; cli r0;
p0.h = _bss_start; p0.h = _bss_start;
p0.l = _bss_start; p0.l = _bss_start;
p1.h = _end; p1.h = _end;
@@ -90,7 +90,7 @@ start:
r0 = p0; r0 = p0;
r1 = p1; r1 = p1;
r1 = r1 - r0; r1 = r1 - r0;
p1 = r1; p1 = r1;
r0 = 0; r0 = 0;
/* Set _bss_start until _end to zero */ /* Set _bss_start until _end to zero */

View File

@@ -4,7 +4,7 @@
* board, and monitor specific initialization and configuration. * board, and monitor specific initialization and configuration.
* The generic CPU dependent initialization has been performed * The generic CPU dependent initialization has been performed
* before this routine is invoked. * before this routine is invoked.
* *
* Copyright (c) 2006 by Atos Automacao Industrial Ltda. * Copyright (c) 2006 by Atos Automacao Industrial Ltda.
* written by Alain Schaefer <alain.schaefer@easc.ch> * written by Alain Schaefer <alain.schaefer@easc.ch>
* and Antonio Giovanini <antonio@atos.com.br> * and Antonio Giovanini <antonio@atos.com.br>
@@ -105,16 +105,16 @@ void bsp_start(void)
/* /*
* initPLL * initPLL
* *
* Routine to initialize the PLL. The BF537 Stamp uses a 27 Mhz XTAL. BISON * Routine to initialize the PLL. The BF537 Stamp uses a 27 Mhz XTAL. BISON
* See "../bf537Stamp/include/bsp.h" for more information. * See "../bf537Stamp/include/bsp.h" for more information.
*/ */
static void initPLL(void) { static void initPLL(void) {
#ifdef BISON #ifdef BISON
unsigned int n; unsigned int n;
/* Configure PLL registers */ /* Configure PLL registers */
*((uint16_t*)PLL_LOCKCNT) = 0x1000; *((uint16_t*)PLL_LOCKCNT) = 0x1000;
*((uint16_t*)PLL_DIV) = PLL_CSEL|PLL_SSEL; *((uint16_t*)PLL_DIV) = PLL_CSEL|PLL_SSEL;
@@ -124,16 +124,16 @@ static void initPLL(void) {
asm("cli r0;"); asm("cli r0;");
asm("idle;"); asm("idle;");
asm("sti r0;"); asm("sti r0;");
/* Delay for PLL stabilization */ /* Delay for PLL stabilization */
for (n=0; n<200; n++) {} for (n=0; n<200; n++) {}
#endif #endif
} }
/* /*
* initEBIU * initEBIU
* *
* Configure extern memory * Configure extern memory
*/ */
@@ -153,8 +153,8 @@ static void initEBIU(void) {
*((uint32_t*)EBIU_AMBCTL0) = 0x7bb07bb0L; *((uint32_t*)EBIU_AMBCTL0) = 0x7bb07bb0L;
*((uint32_t*)EBIU_AMBCTL1) = 0x7bb07bb0L; *((uint32_t*)EBIU_AMBCTL1) = 0x7bb07bb0L;
*((uint16_t*)EBIU_AMGCTL) = 0x000f; *((uint16_t*)EBIU_AMGCTL) = 0x000f;
/* Configure SDRAM /* Configure SDRAM
*((uint32_t*)EBIU_SDGCTL) = 0x0091998d; *((uint32_t*)EBIU_SDGCTL) = 0x0091998d;
*((uint16_t*)EBIU_SDBCTL) = 0x0013; *((uint16_t*)EBIU_SDBCTL) = 0x0013;
*((uint16_t*)EBIU_SDRRC) = 0x0817; *((uint16_t*)EBIU_SDRRC) = 0x0817;
@@ -164,7 +164,7 @@ static void initEBIU(void) {
/* /*
* initGPIO * initGPIO
* *
* Enable LEDs port * Enable LEDs port
*/ */
static void initGPIO(void) { static void initGPIO(void) {

View File

@@ -1,5 +1,5 @@
/* console-io.c /* console-io.c
* *
* This file contains the hardware specific portions of the TTY driver * This file contains the hardware specific portions of the TTY driver
* for the serial ports for ezkit533. * for the serial ports for ezkit533.
* *
@@ -13,7 +13,7 @@
* *
* $Id$ * $Id$
*/ */
#include <rtems.h> #include <rtems.h>
#include <rtems/libio.h> #include <rtems/libio.h>

View File

@@ -1,5 +1,5 @@
/* bsp.h /* bsp.h
* *
* This include file contains all board IO definitions for eZKit533. * This include file contains all board IO definitions for eZKit533.
* *
* Copyright (c) 2006 by Atos Automacao Industrial Ltda. * Copyright (c) 2006 by Atos Automacao Industrial Ltda.
@@ -12,7 +12,7 @@
* *
* $Id$ * $Id$
*/ */
#ifndef _BSP_H #ifndef _BSP_H
#define _BSP_H #define _BSP_H
@@ -29,9 +29,9 @@ extern "C" {
#include <rtems/console.h> #include <rtems/console.h>
#include <rtems/clockdrv.h> #include <rtems/clockdrv.h>
#include <rtems/score/bfin.h> #include <rtems/score/bfin.h>
#include <rtems/bfin/bf533.h> #include <rtems/bfin/bf533.h>
/* /*
* PLL and clock setup values: * PLL and clock setup values:
*/ */

View File

@@ -1,5 +1,5 @@
/* cplb.h /* cplb.h
* *
* Copyright (c) 2006 by Atos Automacao Industrial Ltda. * Copyright (c) 2006 by Atos Automacao Industrial Ltda.
* written by Alain Schaefer <alain.schaefer@easc.ch> * written by Alain Schaefer <alain.schaefer@easc.ch>
* *
@@ -14,7 +14,7 @@
/* CPLB configurations */ /* CPLB configurations */
#define CPLB_DEF_CACHE_WT CPLB_L1_CHBL | CPLB_WT #define CPLB_DEF_CACHE_WT CPLB_L1_CHBL | CPLB_WT
#define CPLB_DEF_CACHE_WB CPLB_L1_CHBL #define CPLB_DEF_CACHE_WB CPLB_L1_CHBL
#define CPLB_CACHE_ENABLED CPLB_L1_CHBL | CPLB_DIRTY #define CPLB_CACHE_ENABLED CPLB_L1_CHBL | CPLB_DIRTY
#define CPLB_DEF_CACHE CPLB_L1_CHBL | CPLB_WT #define CPLB_DEF_CACHE CPLB_L1_CHBL | CPLB_WT

View File

@@ -4,7 +4,7 @@
* board, and monitor specific initialization and configuration. * board, and monitor specific initialization and configuration.
* The generic CPU dependent initialization has been performed * The generic CPU dependent initialization has been performed
* before this routine is invoked. * before this routine is invoked.
* *
* Copyright (c) 2006 by Atos Automacao Industrial Ltda. * Copyright (c) 2006 by Atos Automacao Industrial Ltda.
* written by Alain Schaefer <alain.schaefer@easc.ch> * written by Alain Schaefer <alain.schaefer@easc.ch>
* and Antonio Giovanini <antonio@atos.com.br> * and Antonio Giovanini <antonio@atos.com.br>
@@ -21,7 +21,7 @@
#include <cplb.h> #include <cplb.h>
#include <libcpu/interrupt.h> #include <libcpu/interrupt.h>
const unsigned int dcplbs_table[16][2] = { const unsigned int dcplbs_table[16][2] = {
{ 0xFFA00000, (PAGE_SIZE_1MB | CPLB_D_PAGE_MGMT | CPLB_WT) }, { 0xFFA00000, (PAGE_SIZE_1MB | CPLB_D_PAGE_MGMT | CPLB_WT) },
{ 0xFF900000, (PAGE_SIZE_1MB | CPLB_D_PAGE_MGMT | CPLB_WT) }, /* L1 Data B */ { 0xFF900000, (PAGE_SIZE_1MB | CPLB_D_PAGE_MGMT | CPLB_WT) }, /* L1 Data B */
{ 0xFF800000, (PAGE_SIZE_1MB | CPLB_D_PAGE_MGMT | CPLB_WT) }, /* L1 Data A */ { 0xFF800000, (PAGE_SIZE_1MB | CPLB_D_PAGE_MGMT | CPLB_WT) }, /* L1 Data A */
@@ -42,10 +42,10 @@ const unsigned int dcplbs_table[16][2] = {
}; };
const unsigned int _icplbs_table[16][2] = { const unsigned int _icplbs_table[16][2] = {
{ 0xFFA00000, (PAGE_SIZE_1MB | CPLB_I_PAGE_MGMT | CPLB_I_PAGE_MGMT | 0x4) }, /* L1 Code */ { 0xFFA00000, (PAGE_SIZE_1MB | CPLB_I_PAGE_MGMT | CPLB_I_PAGE_MGMT | 0x4) }, /* L1 Code */
{ 0xEF000000, (PAGE_SIZE_1MB | CPLB_INOCACHE) }, /* AREA DE BOOT */ { 0xEF000000, (PAGE_SIZE_1MB | CPLB_INOCACHE) }, /* AREA DE BOOT */
{ 0xFFB00000, (PAGE_SIZE_1MB | CPLB_INOCACHE) }, { 0xFFB00000, (PAGE_SIZE_1MB | CPLB_INOCACHE) },
{ 0x20300000, (PAGE_SIZE_1MB | CPLB_INOCACHE) }, /* Async Memory Bank 3 */ { 0x20300000, (PAGE_SIZE_1MB | CPLB_INOCACHE) }, /* Async Memory Bank 3 */
{ 0x20200000, (PAGE_SIZE_1MB | CPLB_INOCACHE) }, /* Async Memory Bank 2 (Secnd) */ { 0x20200000, (PAGE_SIZE_1MB | CPLB_INOCACHE) }, /* Async Memory Bank 2 (Secnd) */
{ 0x20100000, (PAGE_SIZE_1MB | CPLB_INOCACHE) }, /* Async Memory Bank 1 (Prim B) */ { 0x20100000, (PAGE_SIZE_1MB | CPLB_INOCACHE) }, /* Async Memory Bank 1 (Prim B) */
@@ -91,7 +91,7 @@ void bsp_pretasking_hook(void)
void bsp_start( void ) void bsp_start( void )
{ {
/* BSP Hardware Initialization*/ /* BSP Hardware Initialization*/
Init_RTC(); /* Blackfin Real Time Clock initialization */ Init_RTC(); /* Blackfin Real Time Clock initialization */
Init_PLL(); /* PLL initialization */ Init_PLL(); /* PLL initialization */
Init_EBIU(); /* EBIU initialization */ Init_EBIU(); /* EBIU initialization */
Init_Flags(); /* GPIO initialization */ Init_Flags(); /* GPIO initialization */
@@ -104,14 +104,14 @@ void bsp_start( void )
/* /*
* Init_PLL * Init_PLL
* *
* Routine to initialize the PLL. The Ezkit uses a 27 Mhz XTAL. * Routine to initialize the PLL. The Ezkit uses a 27 Mhz XTAL.
* See "../eZKit533/include/bsp.h" for more information. * See "../eZKit533/include/bsp.h" for more information.
*/ */
void Init_PLL (void) void Init_PLL (void)
{ {
unsigned int n; unsigned int n;
/* Configure PLL registers */ /* Configure PLL registers */
*((uint16_t*)PLL_LOCKCNT) = 0x1000; *((uint16_t*)PLL_LOCKCNT) = 0x1000;
*((uint16_t*)PLL_DIV) = PLL_CSEL|PLL_SSEL; *((uint16_t*)PLL_DIV) = PLL_CSEL|PLL_SSEL;
@@ -121,14 +121,14 @@ void Init_PLL (void)
asm("cli r0;"); asm("cli r0;");
asm("idle;"); asm("idle;");
asm("sti r0;"); asm("sti r0;");
/* Delay for PLL stabilization */ /* Delay for PLL stabilization */
for (n=0; n<200; n++) {} for (n=0; n<200; n++) {}
} }
/* /*
* Init_EBIU * Init_EBIU
* *
* Configure extern memory * Configure extern memory
*/ */
@@ -138,8 +138,8 @@ void Init_EBIU (void)
*((uint32_t*)EBIU_AMBCTL0) = 0x7bb07bb0L; *((uint32_t*)EBIU_AMBCTL0) = 0x7bb07bb0L;
*((uint32_t*)EBIU_AMBCTL1) = 0x7bb07bb0L; *((uint32_t*)EBIU_AMBCTL1) = 0x7bb07bb0L;
*((uint16_t*)EBIU_AMGCTL) = 0x000f; *((uint16_t*)EBIU_AMGCTL) = 0x000f;
/* Configure SDRAM /* Configure SDRAM
*((uint32_t*)EBIU_SDGCTL) = 0x0091998d; *((uint32_t*)EBIU_SDGCTL) = 0x0091998d;
*((uint16_t*)EBIU_SDBCTL) = 0x0013; *((uint16_t*)EBIU_SDBCTL) = 0x0013;
*((uint16_t*)EBIU_SDRRC) = 0x0817; *((uint16_t*)EBIU_SDRRC) = 0x0817;
@@ -148,7 +148,7 @@ void Init_EBIU (void)
/* /*
* Init_Flags * Init_Flags
* *
* Enable LEDs port * Enable LEDs port
*/ */
void Init_Flags(void) void Init_Flags(void)
@@ -157,9 +157,9 @@ void Init_Flags(void)
*((uint16_t*)FIO_DIR) = 0x0000; *((uint16_t*)FIO_DIR) = 0x0000;
*((uint16_t*)FIO_EDGE) = 0x0100; *((uint16_t*)FIO_EDGE) = 0x0100;
*((uint16_t*)FIO_MASKA_D) = 0x0100; *((uint16_t*)FIO_MASKA_D) = 0x0100;
*((uint8_t*)FlashA_PortB_Dir) = 0x3f; *((uint8_t*)FlashA_PortB_Dir) = 0x3f;
*((uint8_t*)FlashA_PortB_Data) = 0x00; *((uint8_t*)FlashA_PortB_Data) = 0x00;
} }
/* /*
@@ -168,7 +168,7 @@ void Init_Flags(void)
*/ */
void setLED (uint8_t value) void setLED (uint8_t value)
{ {
*((uint8_t*)FlashA_PortB_Data) = value; *((uint8_t*)FlashA_PortB_Data) = value;
} }
/* /*
@@ -193,5 +193,5 @@ void initCPLB(void)
*data = dcplbs_table[i][1]; *data = dcplbs_table[i][1];
addr++; addr++;
data++; data++;
} }
} }

View File

@@ -1,6 +1,6 @@
#include <rtems/bfin/bfin.h> #include <rtems/bfin/bfin.h>
#include <bspopts.h> #include <bspopts.h>
@@ -39,7 +39,7 @@ __start:
/* Start by setting up a stack */ /* Start by setting up a stack */
sp.h = 0xFFB0; sp.h = 0xFFB0;
sp.l = 0x0F00; sp.l = 0x0F00;
/* Maybe we should zero the memory in the .bss section. */ /* Maybe we should zero the memory in the .bss section. */
/* This changes to the supervisor mode */ /* This changes to the supervisor mode */
@@ -47,34 +47,34 @@ __start:
p0.h = START; p0.h = START;
p1.l = LO(EVT15); p1.l = LO(EVT15);
p1.h = HI(EVT15); p1.h = HI(EVT15);
[P1] = P0; [P1] = P0;
P0.h = HI(IMASK); P0.h = HI(IMASK);
P0.l = LO(IMASK); P0.l = LO(IMASK);
R0 = [P0]; R0 = [P0];
/* R1.l = EVT_IVG15 & 0xFFFF; */ /* R1.l = EVT_IVG15 & 0xFFFF; */
R1.l = 0x8000; R1.l = 0x8000;
R0 = R0 | R1; R0 = R0 | R1;
[P0] = R0; [P0] = R0;
RAISE 15; RAISE 15;
P0.l = WAIT; P0.l = WAIT;
P0.h = WAIT; P0.h = WAIT;
RETI = P0; RETI = P0;
RTI; RTI;
/* endless loop to wait */ /* endless loop to wait */
WAIT: WAIT:
jump WAIT; jump WAIT;
START: START:
[--SP] = RETI; [--SP] = RETI;
p0.h = _bss_start; p0.h = _bss_start;
p0.l = _bss_start; p0.l = _bss_start;
p1.h = _end; p1.h = _end;
@@ -82,7 +82,7 @@ __start:
r0 = p0; r0 = p0;
r1 = p1; r1 = p1;
r1 = r1 - r0; r1 = r1 - r0;
p1 = r1; p1 = r1;
r0 = 0; r0 = 0;
/* Set _bss_start until _end to zero */ /* Set _bss_start until _end to zero */
@@ -96,8 +96,8 @@ __start:
call (p0); call (p0);
p0.l = _exit; p0.l = _exit;
p0.h = _exit; p0.h = _exit;
P3 = P4; P3 = P4;
jump (p0) /* Should not return. */ jump (p0) /* Should not return. */
.global _null_isr .global _null_isr

View File

@@ -28,7 +28,7 @@
#define FRM_SIZ (16+512) #define FRM_SIZ (16+512)
#define SSE_OFF 16 #define SSE_OFF 16
#else #else
#define FRM_SIZ 16 #define FRM_SIZ 16
#endif #endif
BEGIN_CODE BEGIN_CODE
@@ -137,7 +137,7 @@ SYM (_ISR_Handler):
/* /*
* We want to insure that the old stack pointer is in ebp * We want to insure that the old stack pointer is in ebp
* By saving it on every interrupt, all we have to do is * By saving it on every interrupt, all we have to do is
* movl ebp->esp near the end of every interrupt. * movl ebp->esp near the end of every interrupt.
*/ */

View File

@@ -544,7 +544,7 @@ BSP_pci_read_config_byte(
unsigned char fun, unsigned char fun,
unsigned char offset, unsigned char offset,
unsigned char *val unsigned char *val
) )
{ {
int sig; int sig;
@@ -560,7 +560,7 @@ BSP_pci_read_config_word(
unsigned char fun, unsigned char fun,
unsigned char offset, unsigned char offset,
unsigned short *val unsigned short *val
) )
{ {
int sig; int sig;
@@ -576,7 +576,7 @@ BSP_pci_read_config_dword(
unsigned char fun, unsigned char fun,
unsigned char offset, unsigned char offset,
uint32_t *val uint32_t *val
) )
{ {
int sig; int sig;
@@ -592,7 +592,7 @@ BSP_pci_write_config_byte(
unsigned char fun, unsigned char fun,
unsigned char offset, unsigned char offset,
unsigned char val unsigned char val
) )
{ {
int sig; int sig;
@@ -608,7 +608,7 @@ BSP_pci_write_config_word(
unsigned char fun, unsigned char fun,
unsigned char offset, unsigned char offset,
unsigned short val unsigned short val
) )
{ {
int sig; int sig;
@@ -624,7 +624,7 @@ BSP_pci_write_config_dword(
unsigned char fun, unsigned char fun,
unsigned char offset, unsigned char offset,
uint32_t val uint32_t val
) )
{ {
int sig; int sig;

View File

@@ -538,7 +538,7 @@ serial_init(void)
bd_t *bd; bd_t *bd;
#if NVRAM_CONFIGURE == 1 #if NVRAM_CONFIGURE == 1
if ( ((nvram->console_mode & 0x06) != 0x04 ) || if ( ((nvram->console_mode & 0x06) != 0x04 ) ||
((nvram->console_mode & 0x30) != 0x20 )) { ((nvram->console_mode & 0x30) != 0x20 )) {
/* /*
* FIXME: refine this condition... * FIXME: refine this condition...

View File

@@ -218,8 +218,8 @@ int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned int excNum)
ppc_cached_irq_mask |= (1 << (31 - BSP_CPM_INTERRUPT)); ppc_cached_irq_mask |= (1 << (31 - BSP_CPM_INTERRUPT));
((volatile immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask = ppc_cached_irq_mask; ((volatile immap_t *)IMAP_ADDR)->im_siu_conf.sc_simask = ppc_cached_irq_mask;
} }
/* /*
* make sure, that the masking operations in * make sure, that the masking operations in
* ICTL and MSR are executed in order * ICTL and MSR are executed in order
*/ */
asm volatile("sync":::"memory"); asm volatile("sync":::"memory");
@@ -232,8 +232,8 @@ int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned int excNum)
_CPU_MSR_SET(msr); _CPU_MSR_SET(msr);
/* /*
* make sure, that the masking operations in * make sure, that the masking operations in
* ICTL and MSR are executed in order * ICTL and MSR are executed in order
*/ */
asm volatile("sync":::"memory"); asm volatile("sync":::"memory");

View File

@@ -51,7 +51,7 @@
#warning The call is "void boot_card(const char* cmdline);" #warning The call is "void boot_card(const char* cmdline);"
#warning You need to pass a NULL. #warning You need to pass a NULL.
#warning Please check and remove these warnings. #warning Please check and remove these warnings.
#include <rtems/asm.h> #include <rtems/asm.h>
/* /*
@@ -246,16 +246,16 @@ spin:
/* /*
* test function: blink orange led once * test function: blink orange led once
*/ */
#define LEDBLINK_DELAY (5*1000*1000) #define LEDBLINK_DELAY (5*1000*1000)
#define LEDPORT 0xFA100001 #define LEDPORT 0xFA100001
#define LEDMASK 0xf0 #define LEDMASK 0xf0
#define LEDON 0x00 #define LEDON 0x00
#define LEDOFF 0x08 #define LEDOFF 0x08
PUBLIC_VAR(ledblink) PUBLIC_VAR(ledblink)
SYM(ledblink): SYM(ledblink):
lis r3,LEDBLINK_DELAY>>16 lis r3,LEDBLINK_DELAY>>16
ledblink1: ledblink1:
subi r3,r3,1 subi r3,r3,1
cmpi 0,1,r3,0 cmpi 0,1,r3,0
bne ledblink1 bne ledblink1
@@ -267,9 +267,9 @@ ledblink1:
andi. r0,r0,LEDMASK andi. r0,r0,LEDMASK
ori r0,r0,LEDOFF ori r0,r0,LEDOFF
stb r0,LEDPORT@l(r3) stb r0,LEDPORT@l(r3)
lis r3,LEDBLINK_DELAY>>16 lis r3,LEDBLINK_DELAY>>16
ledblink2: ledblink2:
subi r3,r3,1 subi r3,r3,1
cmpi 0,1,r3,0 cmpi 0,1,r3,0
bne ledblink2 bne ledblink2
@@ -281,8 +281,8 @@ ledblink2:
andi. r0,r0,LEDMASK andi. r0,r0,LEDMASK
ori r0,r0,LEDON ori r0,r0,LEDON
stb r0,LEDPORT@l(r3) stb r0,LEDPORT@l(r3)
blr blr
/* /*
* #define LOADED_BY_EPPCBUG * #define LOADED_BY_EPPCBUG
*/ */

View File

@@ -30,8 +30,8 @@ typedef int8_t disp_font_dimen;
struct disp_font_bounding_box struct disp_font_bounding_box
{ {
disp_font_dimen w, h, x, y; disp_font_dimen w, h, x, y;
}; };
struct disp_font_glyph struct disp_font_glyph
{ {

View File

@@ -82,7 +82,7 @@ static rtems_status_code disp_hcms29xx_font_struct_size
| rtems_status_code | | rtems_status_code |
\*=========================================================================*/ \*=========================================================================*/
{ {
rtems_status_code rc = RTEMS_SUCCESSFUL; rtems_status_code rc = RTEMS_SUCCESSFUL;
size_t font_size = 0; size_t font_size = 0;
size_t glyph_idx; size_t glyph_idx;
@@ -94,7 +94,7 @@ static rtems_status_code disp_hcms29xx_font_struct_size
rc = RTEMS_INVALID_ADDRESS; rc = RTEMS_INVALID_ADDRESS;
} }
if (rc == RTEMS_SUCCESSFUL) { if (rc == RTEMS_SUCCESSFUL) {
font_size = font_size =
sizeof(*src); /* font_base structure */ sizeof(*src); /* font_base structure */
} }
glyph_idx = 0; glyph_idx = 0;
@@ -105,9 +105,9 @@ static rtems_status_code disp_hcms29xx_font_struct_size
+ (size_t) src->latin1[glyph_idx]->bb.w; + (size_t) src->latin1[glyph_idx]->bb.w;
} }
glyph_idx++; glyph_idx++;
} }
*dst_size = font_size; *dst_size = font_size;
return rc; return rc;
} }
@@ -122,7 +122,7 @@ static inline unsigned char disp_hcms29xx_bitswap
+---------------------------------------------------------------------------+ +---------------------------------------------------------------------------+
| Input Parameters: | | Input Parameters: |
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
unsigned char byte unsigned char byte
) )
/*-------------------------------------------------------------------------*\ /*-------------------------------------------------------------------------*\
| Return Value: | | Return Value: |
@@ -132,7 +132,7 @@ static inline unsigned char disp_hcms29xx_bitswap
unsigned char result = 0; unsigned char result = 0;
int smsk,dmsk; int smsk,dmsk;
for (smsk = 0x01,dmsk=0x80; for (smsk = 0x01,dmsk=0x80;
smsk < 0x100; smsk < 0x100;
smsk<<=1 ,dmsk>>=1) { smsk<<=1 ,dmsk>>=1) {
if ((byte & smsk) != 0) { if ((byte & smsk) != 0) {
result |= (unsigned char) dmsk; result |= (unsigned char) dmsk;
@@ -162,7 +162,7 @@ static rtems_status_code disp_hcms29xx_copy_font
| rtems_status_code | | rtems_status_code |
\*=========================================================================*/ \*=========================================================================*/
{ {
rtems_status_code rc = RTEMS_SUCCESSFUL; rtems_status_code rc = RTEMS_SUCCESSFUL;
char *alloc_next = (char *)dst; char *alloc_next = (char *)dst;
size_t glyph_idx = 0; size_t glyph_idx = 0;
@@ -173,7 +173,7 @@ static rtems_status_code disp_hcms29xx_copy_font
/* /*
* check parameters * check parameters
*/ */
if ((rc == RTEMS_SUCCESSFUL) && if ((rc == RTEMS_SUCCESSFUL) &&
((src == NULL) || ((src == NULL) ||
(dst == NULL))) { (dst == NULL))) {
rc = RTEMS_INVALID_ADDRESS; rc = RTEMS_INVALID_ADDRESS;
@@ -198,18 +198,18 @@ static rtems_status_code disp_hcms29xx_copy_font
dst->latin1[glyph_idx] = (struct disp_font_glyph *)alloc_next; dst->latin1[glyph_idx] = (struct disp_font_glyph *)alloc_next;
alloc_next += sizeof(*(dst->latin1[glyph_idx])); alloc_next += sizeof(*(dst->latin1[glyph_idx]));
/* /*
* copy source values. * copy source values.
* Note: bitmap will be reassigned later * Note: bitmap will be reassigned later
*/ */
*(struct disp_font_glyph *)(dst->latin1[glyph_idx]) = *(struct disp_font_glyph *)(dst->latin1[glyph_idx]) =
*(src->latin1[glyph_idx]); *(src->latin1[glyph_idx]);
} }
else { else {
dst->latin1[glyph_idx] = NULL; dst->latin1[glyph_idx] = NULL;
} }
glyph_idx++; glyph_idx++;
} }
/* /*
* for all glyphs: reassign bitmap * for all glyphs: reassign bitmap
*/ */
@@ -240,11 +240,11 @@ static rtems_status_code disp_hcms29xx_copy_font
else if (shift_cnt > 0) { else if (shift_cnt > 0) {
byte = byte >> shift_cnt; byte = byte >> shift_cnt;
} }
((unsigned char *)(dst->latin1[glyph_idx]->bitmap))[bcnt] = byte; ((unsigned char *)(dst->latin1[glyph_idx]->bitmap))[bcnt] = byte;
} }
} }
glyph_idx++; glyph_idx++;
} }
return rc; return rc;
} }
@@ -269,13 +269,13 @@ static rtems_status_code disp_hcms29xx_alloc_copy_font
| rtems_status_code | | rtems_status_code |
\*=========================================================================*/ \*=========================================================================*/
{ {
rtems_status_code rc = RTEMS_SUCCESSFUL; rtems_status_code rc = RTEMS_SUCCESSFUL;
size_t src_size = 0; size_t src_size = 0;
/* /*
* check parameters * check parameters
*/ */
if ((rc == RTEMS_SUCCESSFUL) && if ((rc == RTEMS_SUCCESSFUL) &&
((src == NULL) ((src == NULL)
|| (dst == NULL))) { || (dst == NULL))) {
rc = RTEMS_INVALID_ADDRESS; rc = RTEMS_INVALID_ADDRESS;
@@ -361,15 +361,15 @@ static rtems_status_code disp_hcms29xx_send_to_display
* send data * send data
*/ */
if (rc == RTEMS_SUCCESSFUL) { if (rc == RTEMS_SUCCESSFUL) {
curr_font = curr_font =
softc_ptr->disp_param.rotate softc_ptr->disp_param.rotate
? disp_hcms29xx_font_rotate ? disp_hcms29xx_font_rotate
: disp_hcms29xx_font_normal; : disp_hcms29xx_font_normal;
char_avail = true; char_avail = true;
/* /*
* FIXME: for rotated display, write last character first... * FIXME: for rotated display, write last character first...
* maybe we should copy everything to a common buffer and use * maybe we should copy everything to a common buffer and use
* ONE SPI transfer? * ONE SPI transfer?
*/ */
for (i = 0; for (i = 0;
@@ -381,15 +381,15 @@ static rtems_status_code disp_hcms29xx_send_to_display
if (char_avail && (c == '\0')) { if (char_avail && (c == '\0')) {
char_avail = false; char_avail = false;
} }
glyph_ptr = (char_avail glyph_ptr = (char_avail
? curr_font->latin1[c] ? curr_font->latin1[c]
: NULL); : NULL);
if (glyph_ptr == NULL) { if (glyph_ptr == NULL) {
glyph_ptr = curr_font->latin1[' ']; glyph_ptr = curr_font->latin1[' '];
} }
digit = (softc_ptr->disp_param.rotate digit = (softc_ptr->disp_param.rotate
? DISP_HCMS29XX_DIGIT_CNT-1-i ? DISP_HCMS29XX_DIGIT_CNT-1-i
: i); : i);
/* /*
* send 5 bytes from (char *)glyph_ptr->bitmap to SPI * send 5 bytes from (char *)glyph_ptr->bitmap to SPI
@@ -447,15 +447,15 @@ static rtems_status_code disp_hcms29xx_send_to_control
run++) { run++) {
if (rc == RTEMS_SUCCESSFUL) { if (rc == RTEMS_SUCCESSFUL) {
if (run == 0) { if (run == 0) {
ctrl_buffer = ctrl_buffer =
(0 << 7) | (0 << 7) |
((sleep & 0x01) << 6) | ((sleep & 0x01) << 6) |
((peak & 0x03) << 4) | ((peak & 0x03) << 4) |
((pwm & 0x0f) << 0); ((pwm & 0x0f) << 0);
} }
else { else {
ctrl_buffer = ctrl_buffer =
(1 << 7) | (1 << 7) |
((div & 0x01) << 1) | ((div & 0x01) << 1) |
((chain & 0x01) << 0); ((chain & 0x01) << 0);
} }
@@ -525,7 +525,7 @@ static rtems_timer_service_routine disp_hcms29xx_timer_sr
{ {
rtems_status_code rc = RTEMS_SUCCESSFUL; rtems_status_code rc = RTEMS_SUCCESSFUL;
disp_hcms29xx_drv_t *softc_ptr = arg; disp_hcms29xx_drv_t *softc_ptr = arg;
if (rc == RTEMS_SUCCESSFUL) { if (rc == RTEMS_SUCCESSFUL) {
rc = rtems_event_send(softc_ptr->disp_param.task_id, rc = rtems_event_send(softc_ptr->disp_param.task_id,
@@ -568,7 +568,7 @@ static rtems_task disp_hcms29xx_update_task
rc = disp_hcms29xx_send_to_control(softc_ptr, rc = disp_hcms29xx_send_to_control(softc_ptr,
14,3,1,0,0);/* pwm/peak/nosleep/div/chain */ 14,3,1,0,0);/* pwm/peak/nosleep/div/chain */
} }
/* /*
* set display to blank * set display to blank
*/ */
@@ -596,7 +596,7 @@ static rtems_task disp_hcms29xx_update_task
&my_events); &my_events);
if (my_events & DISP_HCMS29XX_EVENT_NEWSTR) { if (my_events & DISP_HCMS29XX_EVENT_NEWSTR) {
/* /*
* fetch new string consistently into local buffer * fetch new string consistently into local buffer
*/ */
if (rc == RTEMS_SUCCESSFUL) { if (rc == RTEMS_SUCCESSFUL) {
rc = rtems_semaphore_obtain(softc_ptr->disp_param.trns_sema_id, rc = rtems_semaphore_obtain(softc_ptr->disp_param.trns_sema_id,
@@ -608,12 +608,12 @@ static rtems_task disp_hcms29xx_update_task
sizeof(softc_ptr->disp_param.disp_buffer)); sizeof(softc_ptr->disp_param.disp_buffer));
softc_ptr->disp_param.disp_buffer[sizeof(softc_ptr->disp_param.disp_buffer)-1] = '\0'; softc_ptr->disp_param.disp_buffer[sizeof(softc_ptr->disp_param.disp_buffer)-1] = '\0';
softc_ptr->disp_param.disp_buf_cnt = softc_ptr->disp_param.disp_buf_cnt =
(int) strlen(softc_ptr->disp_param.disp_buffer); (int) strlen(softc_ptr->disp_param.disp_buffer);
} }
if (rc == RTEMS_SUCCESSFUL) { if (rc == RTEMS_SUCCESSFUL) {
rc = rtems_semaphore_release(softc_ptr->disp_param.trns_sema_id); rc = rtems_semaphore_release(softc_ptr->disp_param.trns_sema_id);
} }
/* /*
* set initial offset to negative value * set initial offset to negative value
* to make string static for some ticks * to make string static for some ticks
*/ */
@@ -639,7 +639,7 @@ static rtems_task disp_hcms29xx_update_task
rc = disp_hcms29xx_send_to_display(softc_ptr, rc = disp_hcms29xx_send_to_display(softc_ptr,
softc_ptr->disp_param.disp_buffer); softc_ptr->disp_param.disp_buffer);
} }
else if (disp_offset else if (disp_offset
< (softc_ptr->disp_param.disp_buf_cnt - DISP_HCMS29XX_DIGIT_CNT)) { < (softc_ptr->disp_param.disp_buf_cnt - DISP_HCMS29XX_DIGIT_CNT)) {
rc = disp_hcms29xx_send_to_display(softc_ptr, rc = disp_hcms29xx_send_to_display(softc_ptr,
softc_ptr->disp_param.disp_buffer+disp_offset); softc_ptr->disp_param.disp_buffer+disp_offset);
@@ -650,7 +650,7 @@ static rtems_task disp_hcms29xx_update_task
+ softc_ptr->disp_param.disp_buf_cnt + softc_ptr->disp_param.disp_buf_cnt
- DISP_HCMS29XX_DIGIT_CNT); - DISP_HCMS29XX_DIGIT_CNT);
} }
/* /*
* activate timer, if needed * activate timer, if needed
*/ */
if (rc == RTEMS_SUCCESSFUL) { if (rc == RTEMS_SUCCESSFUL) {
@@ -664,9 +664,9 @@ static rtems_task disp_hcms29xx_update_task
rc = rtems_timer_cancel(disp_hcms29xx_timer_id); rc = rtems_timer_cancel(disp_hcms29xx_timer_id);
} }
} }
} }
/* /*
* FIXME: display task is dead... * FIXME: display task is dead...
*/ */
} }
@@ -690,7 +690,7 @@ static rtems_status_code disp_hcms29xx_update
\*=========================================================================*/ \*=========================================================================*/
{ {
rtems_status_code rc = RTEMS_SUCCESSFUL; rtems_status_code rc = RTEMS_SUCCESSFUL;
/* /*
* obtain trns semaphore * obtain trns semaphore
*/ */
@@ -719,7 +719,7 @@ static rtems_status_code disp_hcms29xx_update
rc = rtems_event_send(softc_ptr->disp_param.task_id, rc = rtems_event_send(softc_ptr->disp_param.task_id,
DISP_HCMS29XX_EVENT_NEWSTR); DISP_HCMS29XX_EVENT_NEWSTR);
} }
return rc; return rc;
} }
@@ -758,10 +758,10 @@ rtems_device_driver disp_hcms29xx_dev_initialize
* initialize font management * initialize font management
* FIXME: check, that default glyph exists * FIXME: check, that default glyph exists
* FIXME: check font size to be 5x7 * FIXME: check font size to be 5x7
*/ */
/* /*
* translate font according to direction/baseline * translate font according to direction/baseline
*/ */
if (rc == RTEMS_SUCCESSFUL) { if (rc == RTEMS_SUCCESSFUL) {
rc = disp_hcms29xx_alloc_copy_font( rc = disp_hcms29xx_alloc_copy_font(
&FONT_BASE, &FONT_BASE,
@@ -789,7 +789,7 @@ rtems_device_driver disp_hcms29xx_dev_initialize
0, 0,
&softc_ptr->disp_param.trns_sema_id); &softc_ptr->disp_param.trns_sema_id);
} }
/* /*
* create and start display task * create and start display task
*/ */
@@ -802,7 +802,7 @@ rtems_device_driver disp_hcms29xx_dev_initialize
&softc_ptr->disp_param.task_id); &softc_ptr->disp_param.task_id);
} }
if (rc == RTEMS_SUCCESSFUL) { if (rc == RTEMS_SUCCESSFUL) {
rc = rtems_task_start(softc_ptr->disp_param.task_id, rc = rtems_task_start(softc_ptr->disp_param.task_id,
disp_hcms29xx_update_task, 0 ); disp_hcms29xx_update_task, 0 );
} }
/* /*
@@ -812,7 +812,7 @@ rtems_device_driver disp_hcms29xx_dev_initialize
rc = rtems_io_register_name (devname, major, 0); rc = rtems_io_register_name (devname, major, 0);
} }
return rc; return rc;
} }
/*=========================================================================*\ /*=========================================================================*\
| Function: | | Function: |
@@ -838,14 +838,14 @@ rtems_device_driver disp_hcms29xx_dev_open
/* /*
* FIXME: get softc_ptr * FIXME: get softc_ptr
*/ */
/* /*
* ensure, that disp_hcms29xx device is assumed to be empty * ensure, that disp_hcms29xx device is assumed to be empty
*/ */
softc_ptr->disp_param.dev_buf_cnt = 0; softc_ptr->disp_param.dev_buf_cnt = 0;
return RTEMS_SUCCESSFUL; return RTEMS_SUCCESSFUL;
} }
/*=========================================================================*\ /*=========================================================================*\
| Function: | | Function: |
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
@@ -875,27 +875,27 @@ rtems_device_driver disp_hcms29xx_dev_write
for (cnt = 0;cnt < args->count;cnt++) { for (cnt = 0;cnt < args->count;cnt++) {
/* /*
* accumulate characters written into display dev buffer * accumulate characters written into display dev buffer
*/ */
if (((softc_ptr->disp_param.dev_buf_cnt > 0) if (((softc_ptr->disp_param.dev_buf_cnt > 0)
&&((args->buffer[cnt] == '\n') &&((args->buffer[cnt] == '\n')
|| (args->buffer[cnt] == '\0')) || (args->buffer[cnt] == '\0'))
) )
||( softc_ptr->disp_param.dev_buf_cnt >= ||( softc_ptr->disp_param.dev_buf_cnt >=
(int) sizeof(softc_ptr->disp_param.dev_buffer) - 1)) { (int) sizeof(softc_ptr->disp_param.dev_buffer) - 1)) {
softc_ptr->disp_param.dev_buffer[softc_ptr->disp_param.dev_buf_cnt] = '\0'; softc_ptr->disp_param.dev_buffer[softc_ptr->disp_param.dev_buf_cnt] = '\0';
/* /*
* transfer string to display string, redisplay it... * transfer string to display string, redisplay it...
*/ */
disp_hcms29xx_update(softc_ptr,softc_ptr->disp_param.dev_buffer); disp_hcms29xx_update(softc_ptr,softc_ptr->disp_param.dev_buffer);
softc_ptr->disp_param.dev_buf_cnt = 0; softc_ptr->disp_param.dev_buf_cnt = 0;
} }
/* /*
* write to dev_buf, if '\n' occured or display device buffer is full * write to dev_buf, if '\n' occured or display device buffer is full
*/ */
if ((args->buffer[cnt] != '\n') && if ((args->buffer[cnt] != '\n') &&
(args->buffer[cnt] != '\0')) { (args->buffer[cnt] != '\0')) {
softc_ptr->disp_param.dev_buffer[softc_ptr->disp_param.dev_buf_cnt++] = softc_ptr->disp_param.dev_buffer[softc_ptr->disp_param.dev_buf_cnt++] =
args->buffer[cnt]; args->buffer[cnt];
} }
} }
@@ -933,13 +933,13 @@ rtems_device_driver disp_hcms29xx_dev_close
/* flush buffer, if not empty */ /* flush buffer, if not empty */
if (softc_ptr->disp_param.dev_buf_cnt > 0) { if (softc_ptr->disp_param.dev_buf_cnt > 0) {
softc_ptr->disp_param.dev_buffer[softc_ptr->disp_param.dev_buf_cnt] = softc_ptr->disp_param.dev_buffer[softc_ptr->disp_param.dev_buf_cnt] =
'\0'; '\0';
/* /*
* transfer string to display string, redisplay it... * transfer string to display string, redisplay it...
*/ */
disp_hcms29xx_update(softc_ptr,softc_ptr->disp_param.dev_buffer); disp_hcms29xx_update(softc_ptr,softc_ptr->disp_param.dev_buffer);
softc_ptr->disp_param.dev_buf_cnt = 0; softc_ptr->disp_param.dev_buf_cnt = 0;
} }
return RTEMS_SUCCESSFUL; return RTEMS_SUCCESSFUL;
} }

View File

@@ -33,21 +33,21 @@ extern "C" {
typedef struct { typedef struct {
rtems_device_major_number minor; /* minor device number */ rtems_device_major_number minor; /* minor device number */
/* /*
* in the disp_buffer, the string to be displayed is placed * in the disp_buffer, the string to be displayed is placed
*/ */
char disp_buffer[DISP_HCMS29XX_TEXT_CNT]; char disp_buffer[DISP_HCMS29XX_TEXT_CNT];
int disp_buf_cnt; /* number of valid chars in disp_buffer */ int disp_buf_cnt; /* number of valid chars in disp_buffer */
/* /*
* in the trns buffer the string is transfered to display task * in the trns buffer the string is transfered to display task
*/ */
char trns_buffer[DISP_HCMS29XX_TEXT_CNT]; char trns_buffer[DISP_HCMS29XX_TEXT_CNT];
/* /*
* in the dev_buffer, characters will be accumulated before display... * in the dev_buffer, characters will be accumulated before display...
*/ */
char dev_buffer[DISP_HCMS29XX_TEXT_CNT]; char dev_buffer[DISP_HCMS29XX_TEXT_CNT];
int dev_buf_cnt; /* number of valid chars in dev_buffer */ int dev_buf_cnt; /* number of valid chars in dev_buffer */
rtems_id trns_sema_id; /* ID of disp trns buffer sema */ rtems_id trns_sema_id; /* ID of disp trns buffer sema */
rtems_id task_id; /* ID of disp task */ rtems_id task_id; /* ID of disp task */
bool rotate; /* FLAG: display is upside down */ bool rotate; /* FLAG: display is upside down */
@@ -58,10 +58,10 @@ extern "C" {
spi_disp_hcms29xx_param_t disp_param; spi_disp_hcms29xx_param_t disp_param;
} disp_hcms29xx_drv_t; } disp_hcms29xx_drv_t;
/* /*
* pass this descriptor pointer to rtems_libi2c_register_drv * pass this descriptor pointer to rtems_libi2c_register_drv
*/ */
extern rtems_libi2c_drv_t *disp_hcms29xx__driver_descriptor; extern rtems_libi2c_drv_t *disp_hcms29xx__driver_descriptor;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@@ -99,7 +99,7 @@ rtems_am29lv160_blank (const rtems_fdisk_segment_desc* sd,
offset += sd->offset + (segment - sd->segment) * sd->size; offset += sd->offset + (segment - sd->segment) * sd->size;
seg_8 += offset; seg_8 += offset;
count = offset & (sizeof (uint32_t) - 1); count = offset & (sizeof (uint32_t) - 1);
size -= count; size -= count;
@@ -112,12 +112,12 @@ rtems_am29lv160_blank (const rtems_fdisk_segment_desc* sd,
#endif #endif
return EIO; return EIO;
} }
seg_32 = (volatile uint32_t*) seg_8; seg_32 = (volatile uint32_t*) seg_8;
count = size / sizeof (uint32_t); count = size / sizeof (uint32_t);
size -= count * sizeof (uint32_t); size -= count * sizeof (uint32_t);
while (count--) while (count--)
if (*seg_32++ != 0xffffffff) if (*seg_32++ != 0xffffffff)
{ {
@@ -127,7 +127,7 @@ rtems_am29lv160_blank (const rtems_fdisk_segment_desc* sd,
#endif #endif
return EIO; return EIO;
} }
seg_8 = (volatile uint8_t*) seg_32; seg_8 = (volatile uint8_t*) seg_32;
while (size--) while (size--)
@@ -139,7 +139,7 @@ rtems_am29lv160_blank (const rtems_fdisk_segment_desc* sd,
#endif #endif
return EIO; return EIO;
} }
return 0; return 0;
} }
@@ -153,7 +153,7 @@ rtems_am29lv160_verify (const rtems_fdisk_segment_desc* sd,
{ {
const rtems_am29lv160_config* ac = &rtems_am29lv160_configuration[device]; const rtems_am29lv160_config* ac = &rtems_am29lv160_configuration[device];
const uint8_t* addr = ac->base; const uint8_t* addr = ac->base;
addr += (sd->offset + (segment - sd->segment) * sd->size) + offset; addr += (sd->offset + (segment - sd->segment) * sd->size) + offset;
if (memcmp (addr, buffer, size) != 0) if (memcmp (addr, buffer, size) != 0)
@@ -180,7 +180,7 @@ rtems_am29lv160_toggle_wait_8 (volatile uint8_t* status)
if (((status1 ^ status2) & (1 << 6)) == 0) if (((status1 ^ status2) & (1 << 6)) == 0)
return 0; return 0;
#if AM26LV160_ERROR_TRACE #if AM26LV160_ERROR_TRACE
printf ("AM26LV160: error bit detected: %p = 0x%04x\n", printf ("AM26LV160: error bit detected: %p = 0x%04x\n",
status, status1); status, status1);
@@ -230,19 +230,19 @@ rtems_am29lv160_write_data_8 (volatile uint8_t* base,
{ {
volatile uint8_t* seg = base + offset; volatile uint8_t* seg = base + offset;
rtems_interrupt_level level; rtems_interrupt_level level;
/* /*
* Issue a reset. * Issue a reset.
*/ */
*base = 0xf0; *base = 0xf0;
while (size) while (size)
{ {
rtems_interrupt_disable (level); rtems_interrupt_disable (level);
*(base + 0xaaa) = 0xaa; *(base + 0xaaa) = 0xaa;
*(base + 0x555) = 0x55; *(base + 0x555) = 0x55;
*(base + 0xaaa) = 0xa0; *(base + 0xaaa) = 0xa0;
*seg = *data++; *seg = *data++;
rtems_interrupt_enable (level); rtems_interrupt_enable (level);
if (rtems_am29lv160_toggle_wait_8 (seg++) != 0) if (rtems_am29lv160_toggle_wait_8 (seg++) != 0)
return EIO; return EIO;
@@ -267,12 +267,12 @@ rtems_am29lv160_write_data_16 (volatile uint16_t* base,
rtems_interrupt_level level; rtems_interrupt_level level;
size /= 2; size /= 2;
/* /*
* Issue a reset. * Issue a reset.
*/ */
*base = 0xf0; *base = 0xf0;
while (size) while (size)
{ {
rtems_interrupt_disable (level); rtems_interrupt_disable (level);
@@ -289,7 +289,7 @@ rtems_am29lv160_write_data_16 (volatile uint16_t* base,
/* /*
* Issue a reset. * Issue a reset.
*/ */
*base = 0xf0; *base = 0xf0;
return 0; return 0;
} }
@@ -375,12 +375,12 @@ rtems_am29lv160_erase (const rtems_fdisk_segment_desc* sd,
{ {
volatile uint8_t* base = ac->base; volatile uint8_t* base = ac->base;
volatile uint8_t* seg = base + offset; volatile uint8_t* seg = base + offset;
/* /*
* Issue a reset. * Issue a reset.
*/ */
rtems_interrupt_disable (level); rtems_interrupt_disable (level);
*base = 0xf0; *base = 0xf0;
*(base + 0xaaa) = 0xaa; *(base + 0xaaa) = 0xaa;
*(base + 0x555) = 0x55; *(base + 0x555) = 0x55;
*(base + 0xaaa) = 0x80; *(base + 0xaaa) = 0x80;
@@ -388,7 +388,7 @@ rtems_am29lv160_erase (const rtems_fdisk_segment_desc* sd,
*(base + 0x555) = 0x55; *(base + 0x555) = 0x55;
*seg = 0x30; *seg = 0x30;
rtems_interrupt_enable (level); rtems_interrupt_enable (level);
ret = rtems_am29lv160_toggle_wait_8 (seg); ret = rtems_am29lv160_toggle_wait_8 (seg);
/* /*
@@ -413,7 +413,7 @@ rtems_am29lv160_erase (const rtems_fdisk_segment_desc* sd,
*(base + 0x2aa) = 0x55; *(base + 0x2aa) = 0x55;
*seg = 0x30; *seg = 0x30;
rtems_interrupt_enable (level); rtems_interrupt_enable (level);
ret = rtems_am29lv160_toggle_wait_16 (seg); ret = rtems_am29lv160_toggle_wait_16 (seg);
/* /*
@@ -447,7 +447,7 @@ rtems_am29lv160_erase_device (const rtems_fdisk_device_desc* dd,
for (segment = 0; segment < dd->segment_count; segment++) for (segment = 0; segment < dd->segment_count; segment++)
{ {
uint32_t seg_segment; uint32_t seg_segment;
for (seg_segment = 0; for (seg_segment = 0;
seg_segment < dd->segments[segment].count; seg_segment < dd->segments[segment].count;
seg_segment++) seg_segment++)
@@ -459,7 +459,7 @@ rtems_am29lv160_erase_device (const rtems_fdisk_device_desc* dd,
return ret; return ret;
} }
} }
return 0; return 0;
} }

View File

@@ -5,19 +5,19 @@
* read operations slurp data from there... * read operations slurp data from there...
*/ */
/* /*
* Authorship * Authorship
* ---------- * ----------
* This software was created by * This software was created by
* Till Straumann <strauman@slac.stanford.edu>, 2005, * Till Straumann <strauman@slac.stanford.edu>, 2005,
* Stanford Linear Accelerator Center, Stanford University. * Stanford Linear Accelerator Center, Stanford University.
* *
* Acknowledgement of sponsorship * Acknowledgement of sponsorship
* ------------------------------ * ------------------------------
* This software was produced by * This software was produced by
* the Stanford Linear Accelerator Center, Stanford University, * the Stanford Linear Accelerator Center, Stanford University,
* under Contract DE-AC03-76SFO0515 with the Department of Energy. * under Contract DE-AC03-76SFO0515 with the Department of Energy.
* *
* Government disclaimer of liability * Government disclaimer of liability
* ---------------------------------- * ----------------------------------
* Neither the United States nor the United States Department of Energy, * Neither the United States nor the United States Department of Energy,
@@ -26,18 +26,18 @@
* completeness, or usefulness of any data, apparatus, product, or process * completeness, or usefulness of any data, apparatus, product, or process
* disclosed, or represents that its use would not infringe privately owned * disclosed, or represents that its use would not infringe privately owned
* rights. * rights.
* *
* Stanford disclaimer of liability * Stanford disclaimer of liability
* -------------------------------- * --------------------------------
* Stanford University makes no representations or warranties, express or * Stanford University makes no representations or warranties, express or
* implied, nor assumes any liability for the use of this software. * implied, nor assumes any liability for the use of this software.
* *
* Stanford disclaimer of copyright * Stanford disclaimer of copyright
* -------------------------------- * --------------------------------
* Stanford University, owner of the copyright, hereby disclaims its * Stanford University, owner of the copyright, hereby disclaims its
* copyright and all other rights in this software. Hence, anyone may * copyright and all other rights in this software. Hence, anyone may
* freely use it for any purpose without restriction. * freely use it for any purpose without restriction.
* *
* Maintenance of notices * Maintenance of notices
* ---------------------- * ----------------------
* In the interest of clarity regarding the origin and status of this * In the interest of clarity regarding the origin and status of this
@@ -46,9 +46,9 @@
* or distributed by the recipient and are to be affixed to any copy of * or distributed by the recipient and are to be affixed to any copy of
* software made or distributed by the recipient that contains a copy or * software made or distributed by the recipient that contains a copy or
* derivative of this software. * derivative of this software.
* *
* ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
*/ */
#include <rtems.h> #include <rtems.h>

View File

@@ -7,19 +7,19 @@
* read/write operations slurp/write data from there... * read/write operations slurp/write data from there...
*/ */
/* /*
* Authorship * Authorship
* ---------- * ----------
* This software was created by * This software was created by
* Till Straumann <strauman@slac.stanford.edu>, 2005, * Till Straumann <strauman@slac.stanford.edu>, 2005,
* Stanford Linear Accelerator Center, Stanford University. * Stanford Linear Accelerator Center, Stanford University.
* *
* Acknowledgement of sponsorship * Acknowledgement of sponsorship
* ------------------------------ * ------------------------------
* This software was produced by * This software was produced by
* the Stanford Linear Accelerator Center, Stanford University, * the Stanford Linear Accelerator Center, Stanford University,
* under Contract DE-AC03-76SFO0515 with the Department of Energy. * under Contract DE-AC03-76SFO0515 with the Department of Energy.
* *
* Government disclaimer of liability * Government disclaimer of liability
* ---------------------------------- * ----------------------------------
* Neither the United States nor the United States Department of Energy, * Neither the United States nor the United States Department of Energy,
@@ -28,18 +28,18 @@
* completeness, or usefulness of any data, apparatus, product, or process * completeness, or usefulness of any data, apparatus, product, or process
* disclosed, or represents that its use would not infringe privately owned * disclosed, or represents that its use would not infringe privately owned
* rights. * rights.
* *
* Stanford disclaimer of liability * Stanford disclaimer of liability
* -------------------------------- * --------------------------------
* Stanford University makes no representations or warranties, express or * Stanford University makes no representations or warranties, express or
* implied, nor assumes any liability for the use of this software. * implied, nor assumes any liability for the use of this software.
* *
* Stanford disclaimer of copyright * Stanford disclaimer of copyright
* -------------------------------- * --------------------------------
* Stanford University, owner of the copyright, hereby disclaims its * Stanford University, owner of the copyright, hereby disclaims its
* copyright and all other rights in this software. Hence, anyone may * copyright and all other rights in this software. Hence, anyone may
* freely use it for any purpose without restriction. * freely use it for any purpose without restriction.
* *
* Maintenance of notices * Maintenance of notices
* ---------------------- * ----------------------
* In the interest of clarity regarding the origin and status of this * In the interest of clarity regarding the origin and status of this
@@ -48,9 +48,9 @@
* or distributed by the recipient and are to be affixed to any copy of * or distributed by the recipient and are to be affixed to any copy of
* software made or distributed by the recipient that contains a copy or * software made or distributed by the recipient that contains a copy or
* derivative of this software. * derivative of this software.
* *
* ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
*/ */
#include <rtems.h> #include <rtems.h>

View File

@@ -6,19 +6,19 @@
* Demonstrates the implementation of a i2c high-level driver. * Demonstrates the implementation of a i2c high-level driver.
*/ */
/* /*
* Authorship * Authorship
* ---------- * ----------
* This software was created by * This software was created by
* Till Straumann <strauman@slac.stanford.edu>, 2005, * Till Straumann <strauman@slac.stanford.edu>, 2005,
* Stanford Linear Accelerator Center, Stanford University. * Stanford Linear Accelerator Center, Stanford University.
* *
* Acknowledgement of sponsorship * Acknowledgement of sponsorship
* ------------------------------ * ------------------------------
* This software was produced by * This software was produced by
* the Stanford Linear Accelerator Center, Stanford University, * the Stanford Linear Accelerator Center, Stanford University,
* under Contract DE-AC03-76SFO0515 with the Department of Energy. * under Contract DE-AC03-76SFO0515 with the Department of Energy.
* *
* Government disclaimer of liability * Government disclaimer of liability
* ---------------------------------- * ----------------------------------
* Neither the United States nor the United States Department of Energy, * Neither the United States nor the United States Department of Energy,
@@ -27,18 +27,18 @@
* completeness, or usefulness of any data, apparatus, product, or process * completeness, or usefulness of any data, apparatus, product, or process
* disclosed, or represents that its use would not infringe privately owned * disclosed, or represents that its use would not infringe privately owned
* rights. * rights.
* *
* Stanford disclaimer of liability * Stanford disclaimer of liability
* -------------------------------- * --------------------------------
* Stanford University makes no representations or warranties, express or * Stanford University makes no representations or warranties, express or
* implied, nor assumes any liability for the use of this software. * implied, nor assumes any liability for the use of this software.
* *
* Stanford disclaimer of copyright * Stanford disclaimer of copyright
* -------------------------------- * --------------------------------
* Stanford University, owner of the copyright, hereby disclaims its * Stanford University, owner of the copyright, hereby disclaims its
* copyright and all other rights in this software. Hence, anyone may * copyright and all other rights in this software. Hence, anyone may
* freely use it for any purpose without restriction. * freely use it for any purpose without restriction.
* *
* Maintenance of notices * Maintenance of notices
* ---------------------- * ----------------------
* In the interest of clarity regarding the origin and status of this * In the interest of clarity regarding the origin and status of this
@@ -47,9 +47,9 @@
* or distributed by the recipient and are to be affixed to any copy of * or distributed by the recipient and are to be affixed to any copy of
* software made or distributed by the recipient that contains a copy or * software made or distributed by the recipient that contains a copy or
* derivative of this software. * derivative of this software.
* *
* ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
*/ */
#include <rtems.h> #include <rtems.h>
#include <rtems/libi2c.h> #include <rtems/libi2c.h>

View File

@@ -8,19 +8,19 @@
* Demonstrates the implementation of a i2c high-level driver. * Demonstrates the implementation of a i2c high-level driver.
*/ */
/* /*
* Authorship * Authorship
* ---------- * ----------
* This software was created by * This software was created by
* Till Straumann <strauman@slac.stanford.edu>, 2005, * Till Straumann <strauman@slac.stanford.edu>, 2005,
* Stanford Linear Accelerator Center, Stanford University. * Stanford Linear Accelerator Center, Stanford University.
* *
* Acknowledgement of sponsorship * Acknowledgement of sponsorship
* ------------------------------ * ------------------------------
* This software was produced by * This software was produced by
* the Stanford Linear Accelerator Center, Stanford University, * the Stanford Linear Accelerator Center, Stanford University,
* under Contract DE-AC03-76SFO0515 with the Department of Energy. * under Contract DE-AC03-76SFO0515 with the Department of Energy.
* *
* Government disclaimer of liability * Government disclaimer of liability
* ---------------------------------- * ----------------------------------
* Neither the United States nor the United States Department of Energy, * Neither the United States nor the United States Department of Energy,
@@ -29,18 +29,18 @@
* completeness, or usefulness of any data, apparatus, product, or process * completeness, or usefulness of any data, apparatus, product, or process
* disclosed, or represents that its use would not infringe privately owned * disclosed, or represents that its use would not infringe privately owned
* rights. * rights.
* *
* Stanford disclaimer of liability * Stanford disclaimer of liability
* -------------------------------- * --------------------------------
* Stanford University makes no representations or warranties, express or * Stanford University makes no representations or warranties, express or
* implied, nor assumes any liability for the use of this software. * implied, nor assumes any liability for the use of this software.
* *
* Stanford disclaimer of copyright * Stanford disclaimer of copyright
* -------------------------------- * --------------------------------
* Stanford University, owner of the copyright, hereby disclaims its * Stanford University, owner of the copyright, hereby disclaims its
* copyright and all other rights in this software. Hence, anyone may * copyright and all other rights in this software. Hence, anyone may
* freely use it for any purpose without restriction. * freely use it for any purpose without restriction.
* *
* Maintenance of notices * Maintenance of notices
* ---------------------- * ----------------------
* In the interest of clarity regarding the origin and status of this * In the interest of clarity regarding the origin and status of this
@@ -49,9 +49,9 @@
* or distributed by the recipient and are to be affixed to any copy of * or distributed by the recipient and are to be affixed to any copy of
* software made or distributed by the recipient that contains a copy or * software made or distributed by the recipient that contains a copy or
* derivative of this software. * derivative of this software.
* *
* ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
*/ */
#define DS1621_CMD_READ_TEMP 0xaa #define DS1621_CMD_READ_TEMP 0xaa
#define DS1621_CMD_CSR_ACCESS 0xac #define DS1621_CMD_CSR_ACCESS 0xac

View File

@@ -38,7 +38,7 @@ static spi_memdrv_t spi_flash_m25p40_rw_drv_t = {
} }
}; };
rtems_libi2c_drv_t *spi_flash_m25p40_rw_driver_descriptor = rtems_libi2c_drv_t *spi_flash_m25p40_rw_driver_descriptor =
&spi_flash_m25p40_rw_drv_t.libi2c_drv_entry; &spi_flash_m25p40_rw_drv_t.libi2c_drv_entry;
static spi_memdrv_t spi_flash_m25p40_ro_drv_t = { static spi_memdrv_t spi_flash_m25p40_ro_drv_t = {
@@ -56,5 +56,5 @@ static spi_memdrv_t spi_flash_m25p40_ro_drv_t = {
} }
}; };
rtems_libi2c_drv_t *spi_flash_m25p40_ro_driver_descriptor = rtems_libi2c_drv_t *spi_flash_m25p40_ro_driver_descriptor =
&spi_flash_m25p40_ro_drv_t.libi2c_drv_entry; &spi_flash_m25p40_ro_drv_t.libi2c_drv_entry;

View File

@@ -21,8 +21,8 @@
*/ */
#ifndef _LIBCHIP_SPI_FLASH_M25P40_H #ifndef _LIBCHIP_SPI_FLASH_M25P40_H
#define _LIBCHIP_SPI_FLASH_M25P40_H #define _LIBCHIP_SPI_FLASH_M25P40_H
#include <libchip/spi-memdrv.h> #include <libchip/spi-memdrv.h>
@@ -31,7 +31,7 @@ extern "C" {
#endif #endif
/* /*
* pass one of these descriptor pointers to rtems_libi2c_register_drv * pass one of these descriptor pointers to rtems_libi2c_register_drv
*/ */
extern rtems_libi2c_drv_t *spi_flash_m25p40_rw_driver_descriptor; extern rtems_libi2c_drv_t *spi_flash_m25p40_rw_driver_descriptor;

View File

@@ -38,7 +38,7 @@ static spi_memdrv_t spi_fram_fm25l256_rw_drv_t = {
} }
}; };
rtems_libi2c_drv_t *spi_fram_fm25l256_rw_driver_descriptor = rtems_libi2c_drv_t *spi_fram_fm25l256_rw_driver_descriptor =
&spi_fram_fm25l256_rw_drv_t.libi2c_drv_entry; &spi_fram_fm25l256_rw_drv_t.libi2c_drv_entry;
static spi_memdrv_t spi_fram_fm25l256_ro_drv_t = { static spi_memdrv_t spi_fram_fm25l256_ro_drv_t = {
@@ -56,5 +56,5 @@ static spi_memdrv_t spi_fram_fm25l256_ro_drv_t = {
} }
}; };
rtems_libi2c_drv_t *spi_fram_fm25l256_ro_driver_descriptor = rtems_libi2c_drv_t *spi_fram_fm25l256_ro_driver_descriptor =
&spi_fram_fm25l256_ro_drv_t.libi2c_drv_entry; &spi_fram_fm25l256_ro_drv_t.libi2c_drv_entry;

View File

@@ -21,8 +21,8 @@
*/ */
#ifndef _LIBCHIP_SPI_FRAM_FM25L256_H #ifndef _LIBCHIP_SPI_FRAM_FM25L256_H
#define _LIBCHIP_SPI_FRAM_FM25L256_H #define _LIBCHIP_SPI_FRAM_FM25L256_H
#include <libchip/spi-memdrv.h> #include <libchip/spi-memdrv.h>
@@ -31,7 +31,7 @@ extern "C" {
#endif #endif
/* /*
* pass one of these descriptor pointers to rtems_libi2c_register_drv * pass one of these descriptor pointers to rtems_libi2c_register_drv
*/ */
extern rtems_libi2c_drv_t *spi_fram_fm25l256_rw_driver_descriptor; extern rtems_libi2c_drv_t *spi_fram_fm25l256_rw_driver_descriptor;

View File

@@ -162,11 +162,11 @@ rtems_status_code spi_memdrv_write
rc = RTEMS_INVALID_ADDRESS; rc = RTEMS_INVALID_ADDRESS;
} }
} }
while ((rc == RTEMS_SUCCESSFUL) && while ((rc == RTEMS_SUCCESSFUL) &&
(cnt > bytes_sent)) { (cnt > bytes_sent)) {
curr_cnt = cnt - bytes_sent; curr_cnt = cnt - bytes_sent;
if ((mem_param_ptr->page_size > 0) && if ((mem_param_ptr->page_size > 0) &&
(off / mem_param_ptr->page_size) != (off / mem_param_ptr->page_size) !=
((off+curr_cnt+1) / mem_param_ptr->page_size)) { ((off+curr_cnt+1) / mem_param_ptr->page_size)) {
curr_cnt = mem_param_ptr->page_size - (off % mem_param_ptr->page_size); curr_cnt = mem_param_ptr->page_size - (off % mem_param_ptr->page_size);
} }
@@ -185,7 +185,7 @@ rtems_status_code spi_memdrv_write
RTEMS_LIBI2C_IOCTL_SET_TFRMODE, RTEMS_LIBI2C_IOCTL_SET_TFRMODE,
&tfr_mode); &tfr_mode);
} }
/* /*
* address device * address device
*/ */
@@ -369,7 +369,7 @@ rtems_status_code spi_memdrv_read
} }
if (off >= mem_param_ptr->mem_size) { if (off >= mem_param_ptr->mem_size) {
/* /*
* HACK: beyond size of memory array? then read status register instead * HACK: beyond size of memory array? then read status register instead
*/ */
/* /*
@@ -411,7 +411,7 @@ rtems_status_code spi_memdrv_read
} }
} }
/* /*
* fetch read data * fetch read data
*/ */
if (rc == RTEMS_SUCCESSFUL) { if (rc == RTEMS_SUCCESSFUL) {
ret_cnt = rtems_libi2c_read_bytes (minor,buf,cnt); ret_cnt = rtems_libi2c_read_bytes (minor,buf,cnt);
@@ -419,7 +419,7 @@ rtems_status_code spi_memdrv_read
rc = -ret_cnt; rc = -ret_cnt;
} }
} }
/* /*
* terminate transfer * terminate transfer
*/ */

View File

@@ -17,8 +17,8 @@
\*===============================================================*/ \*===============================================================*/
#ifndef _LIBCHIP_SPI_MEMDRV_H #ifndef _LIBCHIP_SPI_MEMDRV_H
#define _LIBCHIP_SPI_MEMDRV_H #define _LIBCHIP_SPI_MEMDRV_H
#include <rtems/libi2c.h> #include <rtems/libi2c.h>

View File

@@ -674,8 +674,8 @@ static rtems_status_code sd_card_init( sd_card_driver_entry *e)
* HCS (> 2G capacity). SD spec requires the correct CRC7 be sent even * HCS (> 2G capacity). SD spec requires the correct CRC7 be sent even
* when in SPI mode. So this will just change the default CRC7 and * when in SPI mode. So this will just change the default CRC7 and
* keep it there for all subsequent commands (which just require a do * keep it there for all subsequent commands (which just require a do
* not care CRC byte). * not care CRC byte).
*/ */
SD_CARD_COMMAND_SET_CRC7( e->command, 0x43U); SD_CARD_COMMAND_SET_CRC7( e->command, 0x43U);
rv = sd_card_send_register_command( e, SD_CARD_CMD_SEND_IF_COND, if_cond_reg, &if_cond_reg); rv = sd_card_send_register_command( e, SD_CARD_CMD_SEND_IF_COND, if_cond_reg, &if_cond_reg);
@@ -686,9 +686,9 @@ static rtems_status_code sd_card_init( sd_card_driver_entry *e)
* fail. * fail.
*/ */
if (rv < 0) { if (rv < 0) {
/* Failed CMD8, so SD 1.x or MMC */ /* Failed CMD8, so SD 1.x or MMC */
cmd_arg = 0; cmd_arg = 0;
} else { } else {
cmd_arg = SD_CARD_FLAG_HCS; cmd_arg = SD_CARD_FLAG_HCS;
} }
@@ -729,7 +729,7 @@ static rtems_status_code sd_card_init( sd_card_driver_entry *e)
} }
} }
} else { } else {
/* /*
* Does not seem to be SD card. Do init for MMC. * Does not seem to be SD card. Do init for MMC.
* First send CMD58 once to enable check for HCS * First send CMD58 once to enable check for HCS
* (similar to CMD8 of SD) with bits 30:29 set to 10b. * (similar to CMD8 of SD) with bits 30:29 set to 10b.
@@ -763,7 +763,7 @@ static rtems_status_code sd_card_init( sd_card_driver_entry *e)
RTEMS_CLEANUP_RV_SC( rv, sc, sd_card_driver_init_cleanup, "Failed to initialize MMC"); RTEMS_CLEANUP_RV_SC( rv, sc, sd_card_driver_init_cleanup, "Failed to initialize MMC");
} }
} }
/* /*
* Not idle? * Not idle?
* *
@@ -802,14 +802,14 @@ static rtems_status_code sd_card_init( sd_card_driver_entry *e)
/* /*
* Card is MMC. Unless already proven to be not HCS (< 4.2) * Card is MMC. Unless already proven to be not HCS (< 4.2)
* must do CMD58 again to check the OCR bits 30:29. * must do CMD58 again to check the OCR bits 30:29.
*/ */
if (high_capacity) { if (high_capacity) {
uint32_t reg = 0; uint32_t reg = 0;
/* /*
* The argument should still be correct since was never * The argument should still be correct since was never
* set to 0 * set to 0
*/ */
rv = sd_card_send_register_command( e, SD_CARD_CMD_READ_OCR, cmd_arg, &reg); rv = sd_card_send_register_command( e, SD_CARD_CMD_READ_OCR, cmd_arg, &reg);
RTEMS_CLEANUP_RV_SC( rv, sc, sd_card_driver_init_cleanup, "Failed CMD58 for MMC 4.2"); RTEMS_CLEANUP_RV_SC( rv, sc, sd_card_driver_init_cleanup, "Failed CMD58 for MMC 4.2");
@@ -906,7 +906,7 @@ static rtems_status_code sd_card_init( sd_card_driver_entry *e)
/* For high capacity cards the address is in blocks */ /* For high capacity cards the address is in blocks */
e->block_size_shift = 0; e->block_size_shift = 0;
} else if (e->block_size_shift == 10) { } else if (e->block_size_shift == 10) {
/* /*
* Low capacity 2GByte cards with reported block size of 1024 * Low capacity 2GByte cards with reported block size of 1024
* need to be set back to block size of 512 per 'Simplified * need to be set back to block size of 512 per 'Simplified
* Physical Layer Specification Version 2.0' section 4.3.2. * Physical Layer Specification Version 2.0' section 4.3.2.

View File

@@ -61,7 +61,7 @@ typedef struct {
uint8_t command [SD_CARD_COMMAND_SIZE]; uint8_t command [SD_CARD_COMMAND_SIZE];
uint8_t response [SD_CARD_COMMAND_SIZE]; uint8_t response [SD_CARD_COMMAND_SIZE];
int response_index; int response_index;
uint32_t n_ac_max; uint32_t n_ac_max;
uint32_t block_number; uint32_t block_number;
uint32_t block_size; uint32_t block_size;
uint32_t block_size_shift; uint32_t block_size_shift;

View File

@@ -246,7 +246,7 @@ ata_io_data_request(dev_t device, rtems_blkdev_request *req)
ata_printf("ata_io_data_request: type: READ: %lu, %lu cmd:%02x\n", ata_printf("ata_io_data_request: type: READ: %lu, %lu cmd:%02x\n",
req->bufs[0].block, req->bufnum, req->bufs[0].block, req->bufnum,
areq->regs.regs[IDE_REGISTER_COMMAND]); areq->regs.regs[IDE_REGISTER_COMMAND]);
#endif #endif
} }
else else
{ {
@@ -256,7 +256,7 @@ ata_io_data_request(dev_t device, rtems_blkdev_request *req)
ata_printf("ata_io_data_request: type: WRITE: %lu, %lu cmd:%02x\n", ata_printf("ata_io_data_request: type: WRITE: %lu, %lu cmd:%02x\n",
req->bufs[0].block, req->bufnum, req->bufs[0].block, req->bufnum,
areq->regs.regs[IDE_REGISTER_COMMAND]); areq->regs.regs[IDE_REGISTER_COMMAND]);
#endif #endif
} }
} }
@@ -302,7 +302,7 @@ ata_io_data_request(dev_t device, rtems_blkdev_request *req)
/* add request to the queue of awaiting requests to the controller */ /* add request to the queue of awaiting requests to the controller */
ata_add_to_controller_queue(ctrl_minor, areq); ata_add_to_controller_queue(ctrl_minor, areq);
return RTEMS_SUCCESSFUL; return RTEMS_SUCCESSFUL;
} }
@@ -447,7 +447,7 @@ ata_process_request(rtems_device_minor_number ctrl_minor)
uint8_t i, dev; uint8_t i, dev;
uint16_t val; uint16_t val;
ISR_Level level; ISR_Level level;
/* if no requests to controller then do nothing */ /* if no requests to controller then do nothing */
if (rtems_chain_is_empty(&ata_ide_ctrls[ctrl_minor].reqs)) if (rtems_chain_is_empty(&ata_ide_ctrls[ctrl_minor].reqs))
return; return;
@@ -481,7 +481,7 @@ ata_process_request(rtems_device_minor_number ctrl_minor)
#if ATA_DEBUG #if ATA_DEBUG
ata_printf("ata_process_request: type: %d\n", areq->type); ata_printf("ata_process_request: type: %d\n", areq->type);
#endif #endif
/* continue to execute ATA protocols depending on type of request */ /* continue to execute ATA protocols depending on type of request */
if (areq->type == ATA_COMMAND_TYPE_PIO_OUT) if (areq->type == ATA_COMMAND_TYPE_PIO_OUT)
{ {
@@ -553,19 +553,19 @@ ata_request_done(ata_req_t *areq, rtems_device_minor_number ctrl_minor,
#if ATA_DEBUG #if ATA_DEBUG
ata_printf("ata_request_done: entry\n"); ata_printf("ata_request_done: entry\n");
#endif #endif
ATA_EXEC_CALLBACK(areq, status, error); ATA_EXEC_CALLBACK(areq, status, error);
rtems_chain_extract(&areq->link); rtems_chain_extract(&areq->link);
if (!rtems_chain_is_empty(&ata_ide_ctrls[ctrl_minor].reqs)) if (!rtems_chain_is_empty(&ata_ide_ctrls[ctrl_minor].reqs))
{ {
free(areq); free(areq);
ata_process_request(ctrl_minor); ata_process_request(ctrl_minor);
return; return;
} }
free(areq); free(areq);
#if ATA_DEBUG #if ATA_DEBUG
ata_printf("ata_request_done: exit\n"); ata_printf("ata_request_done: exit\n");
#endif #endif
@@ -591,7 +591,7 @@ ata_non_data_request_done(ata_req_t *areq,
#if ATA_DEBUG #if ATA_DEBUG
ata_printf("ata_non_data_request_done: entry\n"); ata_printf("ata_non_data_request_done: entry\n");
#endif #endif
areq->status = status; areq->status = status;
areq->error = error; areq->error = error;
rtems_semaphore_release(areq->sema); rtems_semaphore_release(areq->sema);
@@ -613,9 +613,9 @@ ata_add_to_controller_queue(rtems_device_minor_number ctrl_minor,
ata_req_t *areq) ata_req_t *areq)
{ {
PREEMPTION_KEY(key); PREEMPTION_KEY(key);
DISABLE_PREEMPTION(key); DISABLE_PREEMPTION(key);
rtems_chain_append(&ata_ide_ctrls[ctrl_minor].reqs, &areq->link); rtems_chain_append(&ata_ide_ctrls[ctrl_minor].reqs, &areq->link);
if (rtems_chain_has_only_one_node(&ata_ide_ctrls[ctrl_minor].reqs)) if (rtems_chain_has_only_one_node(&ata_ide_ctrls[ctrl_minor].reqs))
{ {
@@ -781,7 +781,7 @@ ata_pio_in_protocol(rtems_device_minor_number ctrl_minor, ata_req_t *areq)
ccbuf = areq->cbuf - ccbuf; ccbuf = areq->cbuf - ccbuf;
areq->cnt -= ccbuf; areq->cnt -= ccbuf;
} }
if (areq->cnt == 0) if (areq->cnt == 0)
{ {
ata_request_done(areq, ctrl_minor, RTEMS_SUCCESSFUL, RTEMS_SUCCESSFUL); ata_request_done(areq, ctrl_minor, RTEMS_SUCCESSFUL, RTEMS_SUCCESSFUL);
@@ -816,7 +816,7 @@ ata_pio_out_protocol(rtems_device_minor_number ctrl_minor, ata_req_t *areq)
#if ATA_DEBUG #if ATA_DEBUG
ata_printf("ata_pio_out_protocol:\n"); ata_printf("ata_pio_out_protocol:\n");
#endif #endif
dev = areq->regs.regs[IDE_REGISTER_DEVICE_HEAD] & dev = areq->regs.regs[IDE_REGISTER_DEVICE_HEAD] &
IDE_REGISTER_DEVICE_HEAD_DEV; IDE_REGISTER_DEVICE_HEAD_DEV;
@@ -871,15 +871,15 @@ ata_queue_task(rtems_task_argument arg)
uint16_t val1; uint16_t val1;
rtems_status_code rc; rtems_status_code rc;
ISR_Level level; ISR_Level level;
PREEMPTION_KEY(key); PREEMPTION_KEY(key);
DISABLE_PREEMPTION(key); DISABLE_PREEMPTION(key);
while (1) while (1)
{ {
ENABLE_PREEMPTION(key); ENABLE_PREEMPTION(key);
/* get event which has happend */ /* get event which has happend */
rc = rtems_message_queue_receive(ata_queue_id, &msg, &size, RTEMS_WAIT, rc = rtems_message_queue_receive(ata_queue_id, &msg, &size, RTEMS_WAIT,
RTEMS_NO_TIMEOUT); RTEMS_NO_TIMEOUT);
@@ -890,12 +890,12 @@ ata_queue_task(rtems_task_argument arg)
ctrl_minor = msg.ctrl_minor; ctrl_minor = msg.ctrl_minor;
DISABLE_PREEMPTION(key); DISABLE_PREEMPTION(key);
/* get current request to the controller */ /* get current request to the controller */
_ISR_Disable(level); _ISR_Disable(level);
areq = (ata_req_t *)(ata_ide_ctrls[ctrl_minor].reqs.first); areq = (ata_req_t *)(ata_ide_ctrls[ctrl_minor].reqs.first);
_ISR_Enable(level); _ISR_Enable(level);
switch(msg.type) switch(msg.type)
{ {
case ATA_MSG_PROCESS_NEXT_EVT: case ATA_MSG_PROCESS_NEXT_EVT:
@@ -1012,7 +1012,7 @@ ata_ioctl(rtems_disk_device *dd, uint32_t cmd, void *argp)
dev_t device = rtems_disk_physical_device_number(dd); dev_t device = rtems_disk_physical_device_number(dd);
rtems_status_code status; rtems_status_code status;
rtems_device_minor_number rel_minor; rtems_device_minor_number rel_minor;
rel_minor = (rtems_filesystem_dev_minor_t(device)) / rel_minor = (rtems_filesystem_dev_minor_t(device)) /
ATA_MINOR_NUM_RESERVED_PER_ATA_DEVICE; ATA_MINOR_NUM_RESERVED_PER_ATA_DEVICE;
@@ -1040,7 +1040,7 @@ ata_ioctl(rtems_disk_device *dd, uint32_t cmd, void *argp)
*((uint32_t*) argp) = RTEMS_BLKDEV_CAP_MULTISECTOR_CONT; *((uint32_t*) argp) = RTEMS_BLKDEV_CAP_MULTISECTOR_CONT;
status = RTEMS_SUCCESSFUL; status = RTEMS_SUCCESSFUL;
break; break;
default: default:
return rtems_blkdev_ioctl (dd, cmd, argp); return rtems_blkdev_ioctl (dd, cmd, argp);
break; break;
@@ -1108,7 +1108,7 @@ rtems_ata_initialize(rtems_device_major_number major,
return status; return status;
#endif #endif
#endif #endif
/* create queue for asynchronous requests handling */ /* create queue for asynchronous requests handling */
status = rtems_message_queue_create( status = rtems_message_queue_create(
rtems_build_name('A', 'T', 'A', 'Q'), rtems_build_name('A', 'T', 'A', 'Q'),
@@ -1128,7 +1128,7 @@ rtems_ata_initialize(rtems_device_major_number major,
*/ */
status = rtems_task_create( status = rtems_task_create(
rtems_build_name ('A', 'T', 'A', 'T'), rtems_build_name ('A', 'T', 'A', 'T'),
((rtems_ata_driver_task_priority > 0) ((rtems_ata_driver_task_priority > 0)
? rtems_ata_driver_task_priority ? rtems_ata_driver_task_priority
: ATA_DRIVER_TASK_DEFAULT_PRIORITY), : ATA_DRIVER_TASK_DEFAULT_PRIORITY),
ATA_DRIVER_TASK_STACK_SIZE, ATA_DRIVER_TASK_STACK_SIZE,
@@ -1362,7 +1362,7 @@ rtems_ata_initialize(rtems_device_major_number major,
ATA_DEV_INFO(ctrl_minor, 0).present = true; ATA_DEV_INFO(ctrl_minor, 0).present = true;
ATA_DEV_INFO(ctrl_minor,1).present = true; ATA_DEV_INFO(ctrl_minor,1).present = true;
} }
/* for each found ATA device obtain it configuration */ /* for each found ATA device obtain it configuration */
for (dev = 0; dev < 2; dev++) for (dev = 0; dev < 2; dev++)
if (ATA_DEV_INFO(ctrl_minor, dev).present) if (ATA_DEV_INFO(ctrl_minor, dev).present)
@@ -1405,7 +1405,7 @@ rtems_ata_initialize(rtems_device_major_number major,
CF_LE_W(buffer[ATA_IDENT_WORD_NUM_OF_CURR_LOG_HEADS]); CF_LE_W(buffer[ATA_IDENT_WORD_NUM_OF_CURR_LOG_HEADS]);
ATA_DEV_INFO(ctrl_minor, dev).sectors = ATA_DEV_INFO(ctrl_minor, dev).sectors =
CF_LE_W(buffer[ATA_IDENT_WORD_NUM_OF_CURR_LOG_SECS]); CF_LE_W(buffer[ATA_IDENT_WORD_NUM_OF_CURR_LOG_SECS]);
ATA_DEV_INFO(ctrl_minor, dev).lba_sectors = ATA_DEV_INFO(ctrl_minor, dev).lba_sectors =
CF_LE_W(buffer[ATA_IDENT_WORD_NUM_OF_USR_SECS1]); CF_LE_W(buffer[ATA_IDENT_WORD_NUM_OF_USR_SECS1]);
ATA_DEV_INFO(ctrl_minor, dev).lba_sectors <<= 16; ATA_DEV_INFO(ctrl_minor, dev).lba_sectors <<= 16;
ATA_DEV_INFO(ctrl_minor, dev).lba_sectors += CF_LE_W(buffer[ATA_IDENT_WORD_NUM_OF_USR_SECS0]); ATA_DEV_INFO(ctrl_minor, dev).lba_sectors += CF_LE_W(buffer[ATA_IDENT_WORD_NUM_OF_USR_SECS0]);
@@ -1498,7 +1498,7 @@ ata_process_request_on_init_phase(rtems_device_minor_number ctrl_minor,
uint8_t i, dev; uint8_t i, dev;
uint16_t val, val1; uint16_t val, val1;
volatile unsigned retries; volatile unsigned retries;
assert(areq); assert(areq);
dev = areq->regs.regs[IDE_REGISTER_DEVICE_HEAD] & dev = areq->regs.regs[IDE_REGISTER_DEVICE_HEAD] &

View File

@@ -60,7 +60,7 @@ ide_controller_initialize(rtems_device_major_number major,
if ((IDE_Controller_Table[minor].probe == NULL || if ((IDE_Controller_Table[minor].probe == NULL ||
IDE_Controller_Table[minor].probe(minor)) && IDE_Controller_Table[minor].probe(minor)) &&
(IDE_Controller_Table[minor].fns->ctrl_probe == NULL || (IDE_Controller_Table[minor].fns->ctrl_probe == NULL ||
IDE_Controller_Table[minor].fns->ctrl_probe(minor))) IDE_Controller_Table[minor].fns->ctrl_probe(minor)))
{ {
status = rtems_io_register_name(IDE_Controller_Table[minor].name, status = rtems_io_register_name(IDE_Controller_Table[minor].name,

View File

@@ -1,7 +1,7 @@
/* /*
* ide_ctrl_cfg.h * ide_ctrl_cfg.h
* *
* LibChip library IDE controller header file - structures used for * LibChip library IDE controller header file - structures used for
* configuration and plugin interface definition. * configuration and plugin interface definition.
* *
* Copyright (C) 2002 OKTET Ltd., St.-Petersburg, Russia * Copyright (C) 2002 OKTET Ltd., St.-Petersburg, Russia

View File

@@ -1248,7 +1248,7 @@ xl_mii_writereg(
static int static int
xl_miibus_readreg( xl_miibus_readreg(
struct elnk_softc *sc, struct elnk_softc *sc,
int phy, int phy,
int reg ) int reg )
{ {
struct xl_mii_frame frame; struct xl_mii_frame frame;
@@ -1278,8 +1278,8 @@ xl_miibus_readreg(
static int static int
xl_miibus_writereg( xl_miibus_writereg(
struct elnk_softc *sc, struct elnk_softc *sc,
int phy, int phy,
int reg, int reg,
int data ) int data )
{ {
struct xl_mii_frame frame; struct xl_mii_frame frame;
@@ -2657,7 +2657,7 @@ elnk_init (void *arg)
xl_miibus_writereg(sc, 0x18, MII_ANAR, ANAR_10 | ANAR_TX | ANAR_10_FD | ANAR_TX_FD ); /* ANAR_T4 */ xl_miibus_writereg(sc, 0x18, MII_ANAR, ANAR_10 | ANAR_TX | ANAR_10_FD | ANAR_TX_FD ); /* ANAR_T4 */
xl_miibus_writereg(sc, 0x18, MII_BMCR, BMCR_STARTNEG | BMCR_AUTOEN ); xl_miibus_writereg(sc, 0x18, MII_BMCR, BMCR_STARTNEG | BMCR_AUTOEN );
for (i=0; ((sr = xl_miibus_readreg(sc, 0x18, MII_BMSR)) & BMSR_ACOMP) == 0 && i < 20; i++) for (i=0; ((sr = xl_miibus_readreg(sc, 0x18, MII_BMSR)) & BMSR_ACOMP) == 0 && i < 20; i++)
DELAY(10000); DELAY(10000);
} }

View File

@@ -114,13 +114,13 @@ struct greth_softc
{ {
struct arpcom arpcom; struct arpcom arpcom;
greth_regs *regs; greth_regs *regs;
int acceptBroadcast; int acceptBroadcast;
rtems_id rxDaemonTid; rtems_id rxDaemonTid;
rtems_id txDaemonTid; rtems_id txDaemonTid;
unsigned int tx_ptr; unsigned int tx_ptr;
unsigned int tx_dptr; unsigned int tx_dptr;
unsigned int tx_cnt; unsigned int tx_cnt;
@@ -132,7 +132,7 @@ struct greth_softc
struct mbuf **rxmbuf; struct mbuf **rxmbuf;
struct mbuf **txmbuf; struct mbuf **txmbuf;
rtems_vector_number vector; rtems_vector_number vector;
/*Status*/ /*Status*/
struct phy_device_info phydev; struct phy_device_info phydev;
int fd; int fd;
@@ -141,20 +141,20 @@ struct greth_softc
int gbit_mac; int gbit_mac;
int auto_neg; int auto_neg;
unsigned int auto_neg_time; unsigned int auto_neg_time;
/* /*
* Statistics * Statistics
*/ */
unsigned long rxInterrupts; unsigned long rxInterrupts;
unsigned long rxPackets; unsigned long rxPackets;
unsigned long rxLengthError; unsigned long rxLengthError;
unsigned long rxNonOctet; unsigned long rxNonOctet;
unsigned long rxBadCRC; unsigned long rxBadCRC;
unsigned long rxOverrun; unsigned long rxOverrun;
unsigned long txInterrupts; unsigned long txInterrupts;
unsigned long txDeferred; unsigned long txDeferred;
unsigned long txHeartbeat; unsigned long txHeartbeat;
unsigned long txLateCollision; unsigned long txLateCollision;
@@ -180,10 +180,10 @@ greth_interrupt_handler (rtems_vector_number v)
{ {
uint32_t status; uint32_t status;
/* read and clear interrupt cause */ /* read and clear interrupt cause */
status = greth.regs->status; status = greth.regs->status;
greth.regs->status = status; greth.regs->status = status;
/* Frame received? */ /* Frame received? */
if (status & (GRETH_STATUS_RXERR | GRETH_STATUS_RXIRQ)) if (status & (GRETH_STATUS_RXERR | GRETH_STATUS_RXIRQ))
{ {
@@ -225,7 +225,7 @@ static void write_mii(uint32_t phy_addr, uint32_t reg_addr, uint32_t data)
while (greth.regs->mdio_ctrl & GRETH_MDIO_BUSY) {} while (greth.regs->mdio_ctrl & GRETH_MDIO_BUSY) {}
} }
static void print_init_info(struct greth_softc *sc) static void print_init_info(struct greth_softc *sc)
{ {
printf("greth: driver attached\n"); printf("greth: driver attached\n");
printf("**** PHY ****\n"); printf("**** PHY ****\n");
@@ -270,7 +270,7 @@ greth_initialize_hardware (struct greth_softc *sc)
greth_regs *regs; greth_regs *regs;
regs = sc->regs; regs = sc->regs;
/* Reset the controller. */ /* Reset the controller. */
greth.rxInterrupts = 0; greth.rxInterrupts = 0;
greth.rxPackets = 0; greth.rxPackets = 0;
@@ -278,23 +278,23 @@ greth_initialize_hardware (struct greth_softc *sc)
regs->ctrl = 0; regs->ctrl = 0;
regs->ctrl = GRETH_CTRL_RST; /* Reset ON */ regs->ctrl = GRETH_CTRL_RST; /* Reset ON */
regs->ctrl = 0; /* Reset OFF */ regs->ctrl = 0; /* Reset OFF */
/* Check if mac is gbit capable*/ /* Check if mac is gbit capable*/
sc->gbit_mac = (regs->ctrl >> 27) & 1; sc->gbit_mac = (regs->ctrl >> 27) & 1;
/* Get the phy address which assumed to have been set /* Get the phy address which assumed to have been set
correctly with the reset value in hardware*/ correctly with the reset value in hardware*/
phyaddr = (regs->mdio_ctrl >> 11) & 0x1F; phyaddr = (regs->mdio_ctrl >> 11) & 0x1F;
/* get phy control register default values */ /* get phy control register default values */
while ((phyctrl = read_mii(phyaddr, 0)) & 0x8000) {} while ((phyctrl = read_mii(phyaddr, 0)) & 0x8000) {}
/* reset PHY and wait for completion */ /* reset PHY and wait for completion */
write_mii(phyaddr, 0, 0x8000 | phyctrl); write_mii(phyaddr, 0, 0x8000 | phyctrl);
while ((read_mii(phyaddr, 0)) & 0x8000) {} while ((read_mii(phyaddr, 0)) & 0x8000) {}
/* Check if PHY is autoneg capable and then determine operating mode, /* Check if PHY is autoneg capable and then determine operating mode,
otherwise force it to 10 Mbit halfduplex */ otherwise force it to 10 Mbit halfduplex */
sc->gb = 0; sc->gb = 0;
sc->fd = 0; sc->fd = 0;
@@ -374,9 +374,9 @@ auto_neg_done:
sc->phydev.device = 0; sc->phydev.device = 0;
sc->phydev.rev = 0; sc->phydev.rev = 0;
phystatus = read_mii(phyaddr, 1); phystatus = read_mii(phyaddr, 1);
/*Read out PHY info if extended registers are available */ /*Read out PHY info if extended registers are available */
if (phystatus & 1) { if (phystatus & 1) {
tmp1 = read_mii(phyaddr, 2); tmp1 = read_mii(phyaddr, 2);
tmp2 = read_mii(phyaddr, 3); tmp2 = read_mii(phyaddr, 3);
@@ -418,7 +418,7 @@ auto_neg_done:
sc->rx_ptr = 0; sc->rx_ptr = 0;
regs->txdesc = (int) sc->txdesc; regs->txdesc = (int) sc->txdesc;
regs->rxdesc = (int) sc->rxdesc; regs->rxdesc = (int) sc->rxdesc;
sc->rxmbuf = calloc(sc->rxbufs, sizeof(*sc->rxmbuf)); sc->rxmbuf = calloc(sc->rxbufs, sizeof(*sc->rxmbuf));
sc->txmbuf = calloc(sc->txbufs, sizeof(*sc->txmbuf)); sc->txmbuf = calloc(sc->txbufs, sizeof(*sc->txmbuf));
@@ -450,9 +450,9 @@ auto_neg_done:
sc->rxdesc[sc->rxbufs - 1].ctrl |= GRETH_RXD_WRAP; sc->rxdesc[sc->rxbufs - 1].ctrl |= GRETH_RXD_WRAP;
/* set ethernet address. */ /* set ethernet address. */
regs->mac_addr_msb = regs->mac_addr_msb =
sc->arpcom.ac_enaddr[0] << 8 | sc->arpcom.ac_enaddr[1]; sc->arpcom.ac_enaddr[0] << 8 | sc->arpcom.ac_enaddr[1];
regs->mac_addr_lsb = regs->mac_addr_lsb =
sc->arpcom.ac_enaddr[2] << 24 | sc->arpcom.ac_enaddr[3] << 16 | sc->arpcom.ac_enaddr[2] << 24 | sc->arpcom.ac_enaddr[3] << 16 |
sc->arpcom.ac_enaddr[4] << 8 | sc->arpcom.ac_enaddr[5]; sc->arpcom.ac_enaddr[4] << 8 | sc->arpcom.ac_enaddr[5];
@@ -481,13 +481,13 @@ greth_rxDaemon (void *arg)
struct mbuf *m; struct mbuf *m;
unsigned int len, len_status, bad; unsigned int len, len_status, bad;
rtems_event_set events; rtems_event_set events;
for (;;) for (;;)
{ {
rtems_bsdnet_event_receive (INTERRUPT_EVENT, rtems_bsdnet_event_receive (INTERRUPT_EVENT,
RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_WAIT | RTEMS_EVENT_ANY,
RTEMS_NO_TIMEOUT, &events); RTEMS_NO_TIMEOUT, &events);
#ifdef GRETH_ETH_DEBUG #ifdef GRETH_ETH_DEBUG
printf ("r\n"); printf ("r\n");
#endif #endif
@@ -562,7 +562,7 @@ greth_rxDaemon (void *arg)
dp->rx_ptr = (dp->rx_ptr + 1) % dp->rxbufs; dp->rx_ptr = (dp->rx_ptr + 1) % dp->rxbufs;
} }
} }
} }
static int inside = 0; static int inside = 0;
@@ -573,7 +573,7 @@ sendpacket (struct ifnet *ifp, struct mbuf *m)
unsigned char *temp; unsigned char *temp;
struct mbuf *n; struct mbuf *n;
unsigned int len; unsigned int len;
/*printf("Send packet entered\n");*/ /*printf("Send packet entered\n");*/
if (inside) printf ("error: sendpacket re-entered!!\n"); if (inside) printf ("error: sendpacket re-entered!!\n");
inside = 1; inside = 1;
@@ -614,16 +614,16 @@ sendpacket (struct ifnet *ifp, struct mbuf *m)
if ((m = m->m_next) == NULL) if ((m = m->m_next) == NULL)
break; break;
} }
m_freem (n); m_freem (n);
/* don't send long packets */ /* don't send long packets */
if (len <= GRETH_MAXBUF_LEN) { if (len <= GRETH_MAXBUF_LEN) {
if (dp->tx_ptr < dp->txbufs-1) { if (dp->tx_ptr < dp->txbufs-1) {
dp->txdesc[dp->tx_ptr].ctrl = GRETH_TXD_ENABLE | len; dp->txdesc[dp->tx_ptr].ctrl = GRETH_TXD_ENABLE | len;
} else { } else {
dp->txdesc[dp->tx_ptr].ctrl = dp->txdesc[dp->tx_ptr].ctrl =
GRETH_TXD_WRAP | GRETH_TXD_ENABLE | len; GRETH_TXD_WRAP | GRETH_TXD_ENABLE | len;
} }
dp->regs->ctrl = dp->regs->ctrl | GRETH_CTRL_TXEN; dp->regs->ctrl = dp->regs->ctrl | GRETH_CTRL_TXEN;
@@ -645,7 +645,7 @@ sendpacket_gbit (struct ifnet *ifp, struct mbuf *m)
/* /*
* Waiting for Transmitter ready * Waiting for Transmitter ready
*/ */
len = 0; len = 0;
#ifdef GRETH_DEBUG #ifdef GRETH_DEBUG
printf("TXD: 0x%08x\n", (int) m->m_data); printf("TXD: 0x%08x\n", (int) m->m_data);
@@ -674,17 +674,17 @@ sendpacket_gbit (struct ifnet *ifp, struct mbuf *m)
if (dp->tx_ptr < dp->txbufs-1) { if (dp->tx_ptr < dp->txbufs-1) {
if ((m->m_next) == NULL) { if ((m->m_next) == NULL) {
dp->txdesc[dp->tx_ptr].ctrl = GRETH_TXD_ENABLE | GRETH_TXD_CS | m->m_len; dp->txdesc[dp->tx_ptr].ctrl = GRETH_TXD_ENABLE | GRETH_TXD_CS | m->m_len;
break; break;
} else { } else {
dp->txdesc[dp->tx_ptr].ctrl = GRETH_TXD_ENABLE | GRETH_TXD_MORE | GRETH_TXD_CS | m->m_len; dp->txdesc[dp->tx_ptr].ctrl = GRETH_TXD_ENABLE | GRETH_TXD_MORE | GRETH_TXD_CS | m->m_len;
} }
} else { } else {
if ((m->m_next) == NULL) { if ((m->m_next) == NULL) {
dp->txdesc[dp->tx_ptr].ctrl = dp->txdesc[dp->tx_ptr].ctrl =
GRETH_TXD_WRAP | GRETH_TXD_ENABLE | GRETH_TXD_CS | m->m_len; GRETH_TXD_WRAP | GRETH_TXD_ENABLE | GRETH_TXD_CS | m->m_len;
break; break;
} else { } else {
dp->txdesc[dp->tx_ptr].ctrl = dp->txdesc[dp->tx_ptr].ctrl =
GRETH_TXD_WRAP | GRETH_TXD_ENABLE | GRETH_TXD_MORE | GRETH_TXD_CS | m->m_len; GRETH_TXD_WRAP | GRETH_TXD_ENABLE | GRETH_TXD_MORE | GRETH_TXD_CS | m->m_len;
} }
} }
@@ -692,7 +692,7 @@ sendpacket_gbit (struct ifnet *ifp, struct mbuf *m)
dp->tx_ptr = (dp->tx_ptr + 1) % dp->txbufs; dp->tx_ptr = (dp->tx_ptr + 1) % dp->txbufs;
dp->tx_cnt++; dp->tx_cnt++;
m = m->m_next; m = m->m_next;
} }
dp->txmbuf[dp->tx_ptr] = m; dp->txmbuf[dp->tx_ptr] = m;
dp->tx_cnt++; dp->tx_cnt++;
@@ -711,25 +711,25 @@ greth_txDaemon (void *arg)
struct ifnet *ifp = &sc->arpcom.ac_if; struct ifnet *ifp = &sc->arpcom.ac_if;
struct mbuf *m; struct mbuf *m;
rtems_event_set events; rtems_event_set events;
for (;;) for (;;)
{ {
/* /*
* Wait for packet * Wait for packet
*/ */
rtems_bsdnet_event_receive (START_TRANSMIT_EVENT, rtems_bsdnet_event_receive (START_TRANSMIT_EVENT,
RTEMS_EVENT_ANY | RTEMS_WAIT, RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT, &events); RTEMS_NO_TIMEOUT, &events);
#ifdef GRETH_DEBUG #ifdef GRETH_DEBUG
printf ("t\n"); printf ("t\n");
#endif #endif
/* /*
* Send packets till queue is empty * Send packets till queue is empty
*/ */
for (;;) for (;;)
{ {
/* /*
@@ -754,20 +754,20 @@ greth_txDaemon_gbit (void *arg)
struct ifnet *ifp = &sc->arpcom.ac_if; struct ifnet *ifp = &sc->arpcom.ac_if;
struct mbuf *m; struct mbuf *m;
rtems_event_set events; rtems_event_set events;
for (;;) for (;;)
{ {
/* /*
* Wait for packet * Wait for packet
*/ */
rtems_bsdnet_event_receive (START_TRANSMIT_EVENT, rtems_bsdnet_event_receive (START_TRANSMIT_EVENT,
RTEMS_EVENT_ANY | RTEMS_WAIT, RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT, &events); RTEMS_NO_TIMEOUT, &events);
#ifdef GRETH_DEBUG #ifdef GRETH_DEBUG
printf ("t\n"); printf ("t\n");
#endif #endif
/* /*
* Send packets till queue is empty * Send packets till queue is empty
*/ */
@@ -795,10 +795,10 @@ static void
greth_start (struct ifnet *ifp) greth_start (struct ifnet *ifp)
{ {
struct greth_softc *sc = ifp->if_softc; struct greth_softc *sc = ifp->if_softc;
ifp->if_flags |= IFF_OACTIVE; ifp->if_flags |= IFF_OACTIVE;
rtems_event_send (sc->txDaemonTid, START_TRANSMIT_EVENT); rtems_event_send (sc->txDaemonTid, START_TRANSMIT_EVENT);
} }
/* /*
@@ -830,7 +830,7 @@ greth_init (void *arg)
sc->txDaemonTid = rtems_bsdnet_newproc ("DCtx", 4096, sc->txDaemonTid = rtems_bsdnet_newproc ("DCtx", 4096,
greth_txDaemon, sc); greth_txDaemon, sc);
} }
} }
/* /*
@@ -963,7 +963,7 @@ rtems_greth_driver_attach (struct rtems_bsdnet_ifconfig *config,
sc->vector = chip->vector; sc->vector = chip->vector;
sc->txbufs = chip->txd_count; sc->txbufs = chip->txd_count;
sc->rxbufs = chip->rxd_count; sc->rxbufs = chip->rxd_count;
/* /*
* Set up network interface values * Set up network interface values
*/ */

View File

@@ -37,8 +37,8 @@ typedef struct _greth_regs {
#define GRETH_TOTAL_BD 128 #define GRETH_TOTAL_BD 128
#define GRETH_MAXBUF_LEN 1520 #define GRETH_MAXBUF_LEN 1520
/* Tx BD */ /* Tx BD */
#define GRETH_TXD_ENABLE 0x0800 /* Tx BD Enable */ #define GRETH_TXD_ENABLE 0x0800 /* Tx BD Enable */
#define GRETH_TXD_WRAP 0x1000 /* Tx BD Wrap (last BD) */ #define GRETH_TXD_WRAP 0x1000 /* Tx BD Wrap (last BD) */
#define GRETH_TXD_IRQ 0x2000 /* Tx BD IRQ Enable */ #define GRETH_TXD_IRQ 0x2000 /* Tx BD IRQ Enable */
@@ -58,13 +58,13 @@ typedef struct _greth_regs {
#define GRETH_TXD_CS (GRETH_TXD_IPCS | \ #define GRETH_TXD_CS (GRETH_TXD_IPCS | \
GRETH_TXD_TCPCS | \ GRETH_TXD_TCPCS | \
GRETH_TXD_UDPCS) GRETH_TXD_UDPCS)
/* Rx BD */ /* Rx BD */
#define GRETH_RXD_ENABLE 0x0800 /* Rx BD Enable */ #define GRETH_RXD_ENABLE 0x0800 /* Rx BD Enable */
#define GRETH_RXD_WRAP 0x1000 /* Rx BD Wrap (last BD) */ #define GRETH_RXD_WRAP 0x1000 /* Rx BD Wrap (last BD) */
#define GRETH_RXD_IRQ 0x2000 /* Rx BD IRQ Enable */ #define GRETH_RXD_IRQ 0x2000 /* Rx BD IRQ Enable */
#define GRETH_RXD_DRIBBLE 0x4000 /* Rx BD Dribble Nibble Status */ #define GRETH_RXD_DRIBBLE 0x4000 /* Rx BD Dribble Nibble Status */
#define GRETH_RXD_TOOLONG 0x8000 /* Rx BD Too Long Status */ #define GRETH_RXD_TOOLONG 0x8000 /* Rx BD Too Long Status */
#define GRETH_RXD_CRCERR 0x10000 /* Rx BD CRC Error Status */ #define GRETH_RXD_CRCERR 0x10000 /* Rx BD CRC Error Status */
#define GRETH_RXD_OVERRUN 0x20000 /* Rx BD Overrun Status */ #define GRETH_RXD_OVERRUN 0x20000 /* Rx BD Overrun Status */
@@ -131,12 +131,12 @@ int rtems_greth_driver_attach (
); );
/* PHY data */ /* PHY data */
struct phy_device_info struct phy_device_info
{ {
int vendor; int vendor;
int device; int device;
int rev; int rev;
int adv; int adv;
int part; int part;

View File

@@ -2,10 +2,10 @@
* *
* Ported from FreeBSD --> RTEMS, december 03. * Ported from FreeBSD --> RTEMS, december 03.
* Daron Chabot <daron@nucleus.usask.ca> * Daron Chabot <daron@nucleus.usask.ca>
* -- only tested with i386 bsp. * -- only tested with i386 bsp.
* -- supports *one* card (until the PCI & IRQ APIs get sorted out ;-)) * -- supports *one* card (until the PCI & IRQ APIs get sorted out ;-))
* *
* *
* Copyright (c) 1997, 1998, 1999 * Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
* *
@@ -112,7 +112,7 @@
#define DRIVER_SUPPORTED #define DRIVER_SUPPORTED
#warning The if_dc driver is untested on the PPC platform !!! #warning The if_dc driver is untested on the PPC platform !!!
#endif #endif
#if defined(DRIVER_SUPPORTED) /* this covers the file "globally"... */ #if defined(DRIVER_SUPPORTED) /* this covers the file "globally"... */
#include <bsp.h> #include <bsp.h>
@@ -135,7 +135,7 @@
#include <sys/malloc.h> #include <sys/malloc.h>
#include <sys/systm.h> #include <sys/systm.h>
#include <bsp.h> #include <bsp.h>
/* moved to cpukit/include/rtems in CVS current ! */ /* moved to cpukit/include/rtems in CVS current ! */
/*#include "if_media.h" */ /*#include "if_media.h" */
/*#include "pci.h" */ /*#include "pci.h" */
@@ -151,10 +151,10 @@
#if defined(__i386__) #if defined(__i386__)
#define vtophys(p) (u_int32_t)(p) #define vtophys(p) (u_int32_t)(p)
#else #else
#define vtophys(p) vtophys(p) #define vtophys(p) vtophys(p)
#endif #endif
/* /*
#include <net/if_arp.h> #include <net/if_arp.h>
#include <net/if_vlan_var.h> #include <net/if_vlan_var.h>
@@ -179,17 +179,17 @@
#include <pci/pcivar.h> #include <pci/pcivar.h>
#endif #endif
/* NOTE: use mem space mapping (for now ...) /* NOTE: use mem space mapping (for now ...)
#define DC_USEIOSPACE #define DC_USEIOSPACE
*/ */
#ifdef __alpha__ #ifdef __alpha__
#define SRM_MEDIA #define SRM_MEDIA
#endif #endif
#include <bsp/irq.h> #include <bsp/irq.h>
#include "if_dcreg.h" #include "if_dcreg.h"
@@ -205,15 +205,15 @@ static struct dc_softc dc_softc_devs[NDRIVER];
#include "miibus_if.h" #include "miibus_if.h"
#ifndef lint #ifndef lint
static const char rcsid[] = static const char rcsid[] =
"$FreeBSD: src/sys/pci/if_dc.c,v 1.9.2.41 2003/03/05 18:42:33 njl Exp $"; "$FreeBSD: src/sys/pci/if_dc.c,v 1.9.2.41 2003/03/05 18:42:33 njl Exp $";
#endif #endif
#endif #endif
/* /*
* Various supported device vendors/types and their names. * Various supported device vendors/types and their names.
* NOTE: * NOTE:
@@ -417,8 +417,8 @@ DRIVER_MODULE(miibus, dc, miibus_driver, miibus_devclass, 0, 0);
/* XXX Fixme: rtems_bsp_delay( ) for the pc386 BSP (at least) /* XXX Fixme: rtems_bsp_delay( ) for the pc386 BSP (at least)
* needs work... see pc386/include/bsp.h. * needs work... see pc386/include/bsp.h.
* I have "a" solution, utilizing the 2nd i8254 timer, * I have "a" solution, utilizing the 2nd i8254 timer,
* if anyone is interested (first timer is used for clock_tick ISR)... * if anyone is interested (first timer is used for clock_tick ISR)...
*/ */
#ifdef __i386__ #ifdef __i386__
extern void Wait_X_ms( unsigned int ); extern void Wait_X_ms( unsigned int );
@@ -754,7 +754,7 @@ static void dc_mii_send(sc, bits, cnt)
static int dc_mii_readreg(sc, frame) static int dc_mii_readreg(sc, frame)
struct dc_softc *sc; struct dc_softc *sc;
struct dc_mii_frame *frame; struct dc_mii_frame *frame;
{ {
int i, ack, s; int i, ack, s;
@@ -766,7 +766,7 @@ static int dc_mii_readreg(sc, frame)
frame->mii_opcode = DC_MII_READOP; frame->mii_opcode = DC_MII_READOP;
frame->mii_turnaround = 0; frame->mii_turnaround = 0;
frame->mii_data = 0; frame->mii_data = 0;
/* /*
* Sync the PHYs. * Sync the PHYs.
*/ */
@@ -824,7 +824,7 @@ fail:
static int dc_mii_writereg(sc, frame) static int dc_mii_writereg(sc, frame)
struct dc_softc *sc; struct dc_softc *sc;
struct dc_mii_frame *frame; struct dc_mii_frame *frame;
{ {
int s; int s;
@@ -838,7 +838,7 @@ static int dc_mii_writereg(sc, frame)
/* /*
* Sync the PHYs. * Sync the PHYs.
*/ */
dc_mii_sync(sc); dc_mii_sync(sc);
dc_mii_send(sc, frame->mii_stdelim, 2); dc_mii_send(sc, frame->mii_stdelim, 2);
@@ -1227,7 +1227,7 @@ void dc_setfilt_21143(sc)
sp[h >> 4] |= 1 << (h & 0xF); sp[h >> 4] |= 1 << (h & 0xF);
} }
#endif #endif
if (ifp->if_flags & IFF_BROADCAST) { if (ifp->if_flags & IFF_BROADCAST) {
h = dc_crc_le(sc, (caddr_t)&etherbroadcastaddr); h = dc_crc_le(sc, (caddr_t)&etherbroadcastaddr);
sp[h >> 4] |= 1 << (h & 0xF); sp[h >> 4] |= 1 << (h & 0xF);
@@ -1332,7 +1332,7 @@ void dc_setfilt_asix(sc)
CSR_WRITE_4(sc, DC_AX_FILTIDX, DC_AX_FILTIDX_PAR0); CSR_WRITE_4(sc, DC_AX_FILTIDX, DC_AX_FILTIDX_PAR0);
ac_enaddr = (u_int32_t *)&sc->arpcom.ac_enaddr[0]; ac_enaddr = (u_int32_t *)&sc->arpcom.ac_enaddr[0];
CSR_WRITE_4(sc, DC_AX_FILTDATA, *ac_enaddr); CSR_WRITE_4(sc, DC_AX_FILTDATA, *ac_enaddr);
CSR_WRITE_4(sc, DC_AX_FILTIDX, DC_AX_FILTIDX_PAR1); CSR_WRITE_4(sc, DC_AX_FILTIDX, DC_AX_FILTIDX_PAR1);
ac_enaddr = (u_int32_t *)&sc->arpcom.ac_enaddr[4]; ac_enaddr = (u_int32_t *)&sc->arpcom.ac_enaddr[4];
@@ -1546,7 +1546,7 @@ static void dc_setcfg(sc, media)
DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL); DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL);
} }
} }
#endif #endif
if ((media & IFM_GMASK) == IFM_FDX) { if ((media & IFM_GMASK) == IFM_FDX) {
DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_FULLDUPLEX); DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_FULLDUPLEX);
@@ -1615,7 +1615,7 @@ struct dc_type *dc_devtype( int unitnum )
uint32_t rev; uint32_t rev;
int rc; int rc;
t = dc_devs; t = dc_devs;
while(t->dc_name != NULL) { while(t->dc_name != NULL) {
@@ -1627,7 +1627,7 @@ struct dc_type *dc_devtype( int unitnum )
pci_read_config_dword(t->dc_bus,t->dc_dev,t->dc_fun,\ pci_read_config_dword(t->dc_bus,t->dc_dev,t->dc_fun,\
DC_PCI_CFRV, &rev); DC_PCI_CFRV, &rev);
rev &= 0xFF; rev &= 0xFF;
if (t->dc_did == DC_DEVICEID_98713 && if (t->dc_did == DC_DEVICEID_98713 &&
rev >= DC_REVISION_98713A) rev >= DC_REVISION_98713A)
t++; t++;
@@ -1901,7 +1901,7 @@ decISON(const rtems_irq_connect_data* irq)
{ {
return (BSP_irq_enabled_at_i8259s(irq->name)); return (BSP_irq_enabled_at_i8259s(irq->name));
} }
/* /*
* Attach the interface. Allocate softc structures, do ifmedia * Attach the interface. Allocate softc structures, do ifmedia
@@ -1910,12 +1910,12 @@ decISON(const rtems_irq_connect_data* irq)
int int
rtems_dc_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching) rtems_dc_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
{ {
int rc; int rc;
u_char eaddr[ETHER_ADDR_LEN]; u_char eaddr[ETHER_ADDR_LEN];
char *unitName; char *unitName;
int unitNumber; int unitNumber;
uint32_t command; uint32_t command;
struct dc_softc *sc; struct dc_softc *sc;
struct ifnet *ifp; struct ifnet *ifp;
@@ -1923,7 +1923,7 @@ rtems_dc_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
uint32_t revision; uint32_t revision;
int error = 0, mac_offset; int error = 0, mac_offset;
uint32_t value; uint32_t value;
/* /*
* Get the instance number for the board we're going to configure * Get the instance number for the board we're going to configure
* from the user. * from the user.
@@ -1947,11 +1947,11 @@ rtems_dc_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
return (0); return (0);
} }
memset(sc, 0, sizeof(struct dc_softc)); memset(sc, 0, sizeof(struct dc_softc));
/*unit = device_get_unit(dev);*/ /*unit = device_get_unit(dev);*/
sc->dc_unit = unitNumber; sc->dc_unit = unitNumber;
sc->dc_name = unitName; sc->dc_name = unitName;
/* /*
* Handle power management nonsense. * Handle power management nonsense.
* *
@@ -1965,7 +1965,7 @@ rtems_dc_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
} }
t = sc->dc_info; t = sc->dc_info;
/* /*
* Map control/status registers. * Map control/status registers.
*/ */
@@ -2014,20 +2014,20 @@ rtems_dc_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
pci_read_config_dword(t->dc_bus,t->dc_dev,t->dc_fun,\ pci_read_config_dword(t->dc_bus,t->dc_dev,t->dc_fun,\
DC_PCI_CFBMA, &value); DC_PCI_CFBMA, &value);
sc->membase = value; sc->membase = value;
/* Allocate interrupt */ /* Allocate interrupt */
memset(&sc->irqInfo, 0, sizeof(rtems_irq_connect_data)); memset(&sc->irqInfo, 0, sizeof(rtems_irq_connect_data));
/*pcib_conf_read32(sig, DC_PCI_CFIT, &value); */ /*pcib_conf_read32(sig, DC_PCI_CFIT, &value); */
pci_read_config_dword(t->dc_bus,t->dc_dev,t->dc_fun,\ pci_read_config_dword(t->dc_bus,t->dc_dev,t->dc_fun,\
DC_PCI_CFIT, &value); DC_PCI_CFIT, &value);
sc->irqInfo.name = value & 0xFF; sc->irqInfo.name = value & 0xFF;
sc->irqInfo.hdl = (rtems_irq_hdl)dc_intr; sc->irqInfo.hdl = (rtems_irq_hdl)dc_intr;
sc->irqInfo.handle = (void *)sc; /* new parameter */ sc->irqInfo.handle = (void *)sc; /* new parameter */
sc->irqInfo.on = nop; sc->irqInfo.on = nop;
sc->irqInfo.off = nop; sc->irqInfo.off = nop;
sc->irqInfo.isOn = decISON; sc->irqInfo.isOn = decISON;
#ifdef BSP_SHARED_HANDLER_SUPPORT #ifdef BSP_SHARED_HANDLER_SUPPORT
rc = BSP_install_rtems_shared_irq_handler( &sc->irqInfo ); rc = BSP_install_rtems_shared_irq_handler( &sc->irqInfo );
#else #else
@@ -2036,8 +2036,8 @@ rtems_dc_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
if(!rc) { if(!rc) {
rtems_panic("Can't install dec2114x irq handler.\n"); rtems_panic("Can't install dec2114x irq handler.\n");
} }
#if 0 #if 0
rid = 0; rid = 0;
sc->dc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, sc->dc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
@@ -2061,7 +2061,7 @@ rtems_dc_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
} }
#endif #endif
/* Need this info to decide on a chip type. /* Need this info to decide on a chip type.
sc->dc_info = dc_devtype(dev); sc->dc_info = dc_devtype(dev);
*/ */
@@ -2203,8 +2203,8 @@ rtems_dc_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
pci_write_config_dword(t->dc_bus,t->dc_dev,t->dc_fun,\ pci_write_config_dword(t->dc_bus,t->dc_dev,t->dc_fun,\
DC_PCI_CFDD, command); DC_PCI_CFDD, command);
} }
/* /*
* Try to learn something about the supported media. * Try to learn something about the supported media.
* We know that ASIX and ADMtek and Davicom devices * We know that ASIX and ADMtek and Davicom devices
@@ -2268,7 +2268,7 @@ rtems_dc_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
sc->dc_ldata = malloc(sizeof(struct dc_list_data), M_DEVBUF, M_NOWAIT); sc->dc_ldata = malloc(sizeof(struct dc_list_data), M_DEVBUF, M_NOWAIT);
if (sc->dc_ldata == NULL) { if (sc->dc_ldata == NULL) {
printk("dc%d: no memory for list buffers!\n", sc->dc_unit); printk("dc%d: no memory for list buffers!\n", sc->dc_unit);
if (sc->dc_pnic_rx_buf != NULL) if (sc->dc_pnic_rx_buf != NULL)
@@ -2283,7 +2283,7 @@ rtems_dc_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
} }
bzero(sc->dc_ldata, sizeof(struct dc_list_data)); bzero(sc->dc_ldata, sizeof(struct dc_list_data));
ifp = &sc->arpcom.ac_if; ifp = &sc->arpcom.ac_if;
ifp->if_softc = sc; ifp->if_softc = sc;
ifp->if_unit = unitNumber; /*sc->dc_unit;*/ ifp->if_unit = unitNumber; /*sc->dc_unit;*/
@@ -2347,7 +2347,7 @@ rtems_dc_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
goto fail; goto fail;
} }
#endif #endif
/* /*
* Call MI attach routine. * Call MI attach routine.
*/ */
@@ -2382,16 +2382,16 @@ rtems_dc_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
command = pci_read_config(dev, DC_PCI_CFDD, 4); command = pci_read_config(dev, DC_PCI_CFDD, 4);
command &= ~(DC_CFDD_SNOOZE_MODE|DC_CFDD_SLEEP_MODE); command &= ~(DC_CFDD_SNOOZE_MODE|DC_CFDD_SLEEP_MODE);
switch ((command >> 8) & 0xff) { switch ((command >> 8) & 0xff) {
case 3: case 3:
sc->dc_srm_media = IFM_10_T; sc->dc_srm_media = IFM_10_T;
break; break;
case 4: case 4:
sc->dc_srm_media = IFM_10_T | IFM_FDX; sc->dc_srm_media = IFM_10_T | IFM_FDX;
break; break;
case 5: case 5:
sc->dc_srm_media = IFM_100_TX; sc->dc_srm_media = IFM_100_TX;
break; break;
case 6: case 6:
sc->dc_srm_media = IFM_100_TX | IFM_FDX; sc->dc_srm_media = IFM_100_TX | IFM_FDX;
break; break;
} }
@@ -2663,7 +2663,7 @@ static void dc_pnic_rx_bug_war(sc, idx)
* frame reception. * frame reception.
*/ */
dc_newbuf(sc, i, m); dc_newbuf(sc, i, m);
bcopy(ptr, mtod(m, char *), total_len); bcopy(ptr, mtod(m, char *), total_len);
cur_rx->dc_status = rxstat | DC_RXSTAT_FIRSTFRAG; cur_rx->dc_status = rxstat | DC_RXSTAT_FIRSTFRAG;
return; return;
@@ -2759,7 +2759,7 @@ static void dc_rxeof(sc)
* comes up in the ring. However, don't report long * comes up in the ring. However, don't report long
* frames as errors since they could be vlans * frames as errors since they could be vlans
*/ */
if ((rxstat & DC_RXSTAT_RXERR)){ if ((rxstat & DC_RXSTAT_RXERR)){
if (!(rxstat & DC_RXSTAT_GIANT) || if (!(rxstat & DC_RXSTAT_GIANT) ||
(rxstat & (DC_RXSTAT_CRCERR | DC_RXSTAT_DRIBBLE | (rxstat & (DC_RXSTAT_CRCERR | DC_RXSTAT_DRIBBLE |
DC_RXSTAT_MIIERE | DC_RXSTAT_COLLSEEN | DC_RXSTAT_MIIERE | DC_RXSTAT_COLLSEEN |
@@ -2778,7 +2778,7 @@ static void dc_rxeof(sc)
} }
} }
/* No errors; receive the packet. */ /* No errors; receive the packet. */
total_len -= ETHER_CRC_LEN; total_len -= ETHER_CRC_LEN;
#ifdef __i386__ #ifdef __i386__
@@ -3168,10 +3168,10 @@ dc_daemon(void * arg)
RTEMS_WAIT | RTEMS_EVENT_ANY, \ RTEMS_WAIT | RTEMS_EVENT_ANY, \
RTEMS_NO_TIMEOUT, RTEMS_NO_TIMEOUT,
&events); &events);
ifp = &sc->arpcom.ac_if; ifp = &sc->arpcom.ac_if;
while((status = CSR_READ_4(sc, DC_ISR)) & DC_INTRS) { while((status = CSR_READ_4(sc, DC_ISR)) & DC_INTRS) {
CSR_WRITE_4(sc, DC_ISR, status); CSR_WRITE_4(sc, DC_ISR, status);
@@ -3434,10 +3434,10 @@ static void dc_init(xsc)
break; break;
case 16: case 16:
DC_SETBIT(sc, DC_BUSCTL, DC_CACHEALIGN_16LONG); DC_SETBIT(sc, DC_BUSCTL, DC_CACHEALIGN_16LONG);
break; break;
case 8: case 8:
DC_SETBIT(sc, DC_BUSCTL, DC_CACHEALIGN_8LONG); DC_SETBIT(sc, DC_BUSCTL, DC_CACHEALIGN_8LONG);
break; break;
case 0: case 0:
default: default:
DC_SETBIT(sc, DC_BUSCTL, DC_CACHEALIGN_NONE); DC_SETBIT(sc, DC_BUSCTL, DC_CACHEALIGN_NONE);
@@ -3523,7 +3523,7 @@ static void dc_init(xsc)
*/ */
if (sc->dc_flags & DC_TULIP_LEDS) { if (sc->dc_flags & DC_TULIP_LEDS) {
CSR_WRITE_4(sc, DC_WATCHDOG, CSR_WRITE_4(sc, DC_WATCHDOG,
DC_WDOG_CTLWREN|DC_WDOG_LINK|DC_WDOG_ACTIVITY); DC_WDOG_CTLWREN|DC_WDOG_LINK|DC_WDOG_ACTIVITY);
CSR_WRITE_4(sc, DC_WATCHDOG, 0); CSR_WRITE_4(sc, DC_WATCHDOG, 0);
} }
@@ -3563,7 +3563,7 @@ static void dc_init(xsc)
struct ifreq ifr; struct ifreq ifr;
ifr.ifr_media = sc->dc_srm_media; ifr.ifr_media = sc->dc_srm_media;
ifmedia_ioctl(ifp, &ifr, &mii->mii_media, SIOCSIFMEDIA); ifmedia_ioctl(ifp, &ifr, &mii->mii_media, SIOCSIFMEDIA);
sc->dc_srm_media = 0; sc->dc_srm_media = 0;
} }
#endif #endif

View File

@@ -535,7 +535,7 @@ struct dc_mii_frame {
/* /*
* Special ASIX-specific bits in the ASIX NETCFG register (CSR6). * Special ASIX-specific bits in the ASIX NETCFG register (CSR6).
*/ */
#define DC_AX_NETCFG_RX_BROAD 0x00000100 #define DC_AX_NETCFG_RX_BROAD 0x00000100
/* /*
* RX Filter Index Register values * RX Filter Index Register values
@@ -627,7 +627,7 @@ struct dc_mii_frame {
DC_SETBIT(sc, DC_PN_GPIO, ((r) << 4)); \ DC_SETBIT(sc, DC_PN_GPIO, ((r) << 4)); \
DC_CLRBIT(sc, DC_PN_GPIO, (r)); \ DC_CLRBIT(sc, DC_PN_GPIO, (r)); \
} }
/* shortcut MII access register */ /* shortcut MII access register */
#define DC_PN_MII_DATA 0x0000FFFF #define DC_PN_MII_DATA 0x0000FFFF
#define DC_PN_MII_RESERVER 0x00020000 #define DC_PN_MII_RESERVER 0x00020000
@@ -706,7 +706,7 @@ struct dc_softc {
u_int32_t dc_flags; u_int32_t dc_flags;
u_int32_t dc_txthresh; u_int32_t dc_txthresh;
u_int8_t *dc_srom; u_int8_t *dc_srom;
struct dc_mediainfo *dc_mi; struct dc_mediainfo *dc_mi;
/* /*
struct callout_handle dc_stat_ch; struct callout_handle dc_stat_ch;
*/ */
@@ -820,7 +820,7 @@ struct dc_softc {
#define DC_REVISION_82C168 0x10 #define DC_REVISION_82C168 0x10
#define DC_REVISION_82C169 0x20 #define DC_REVISION_82C169 0x20
/* /*
* Lite-On PNIC II device ID. Note: this is actually a Macronix 98715A * Lite-On PNIC II device ID. Note: this is actually a Macronix 98715A
* with wake on lan/magic packet support. * with wake on lan/magic packet support.
*/ */

View File

@@ -243,7 +243,7 @@ open_eth_initialize_hardware (struct open_eth_softc *sc)
if (!sc->en100MHz) mii_cr = 0; if (!sc->en100MHz) mii_cr = 0;
write_mii(0, mii_cr | 0x8000); write_mii(0, mii_cr | 0x8000);
while (read_mii(0) & 0x8000) {} while (read_mii(0) & 0x8000) {}
if (!sc->en100MHz) write_mii(0, 0); if (!sc->en100MHz) write_mii(0, 0);
mii_cr = read_mii(0); mii_cr = read_mii(0);
printf("open_eth: driver attached, PHY config : 0x%04" PRIx32 "\n", read_mii(0)); printf("open_eth: driver attached, PHY config : 0x%04" PRIx32 "\n", read_mii(0));

View File

@@ -47,13 +47,13 @@
2 for added data IO output: get_reg, put_reg 2 for added data IO output: get_reg, put_reg
4 for packet allocation/free output 4 for packet allocation/free output
8 for only startup status, so we can tell we're installed OK 8 for only startup status, so we can tell we're installed OK
16 dump phy read/write 16 dump phy read/write
32 precise register dump 32 precise register dump
64 dump packets 64 dump packets
*/ */
/*#define DEBUG (-1)*/ /*#define DEBUG (-1)*/
/*#define DEBUG (-1 & ~(16))*/ /*#define DEBUG (-1 & ~(16))*/
#define DEBUG (0) #define DEBUG (0)
#include "smc91111config.h" #include "smc91111config.h"
#include <libchip/smc91111.h> #include <libchip/smc91111.h>
@@ -569,7 +569,7 @@ static void sendpacket(struct ifnet *ifp, struct mbuf *m)
CYG_ASSERT(sdata, "!No sg data pointer here"); CYG_ASSERT(sdata, "!No sg data pointer here");
/* start on an odd offset? /* start on an odd offset?
* If last byte also (1byte mbuf with different pointer should not occur) * If last byte also (1byte mbuf with different pointer should not occur)
* let following code handle it * let following code handle it
*/ */
@@ -579,7 +579,7 @@ static void sendpacket(struct ifnet *ifp, struct mbuf *m)
odd = ~odd; odd = ~odd;
len--; len--;
} }
/* speed up copying a bit, never copy last word */ /* speed up copying a bit, never copy last word */
while(len >= 17){ while(len >= 17){
put_data(cpd, *(sdata)); put_data(cpd, *(sdata));
@@ -593,13 +593,13 @@ static void sendpacket(struct ifnet *ifp, struct mbuf *m)
sdata += 8; sdata += 8;
len -= 16; len -= 16;
} }
/* copy word wise, skip last word */ /* copy word wise, skip last word */
while (len >= 3) { while (len >= 3) {
put_data(cpd, *sdata++); put_data(cpd, *sdata++);
len -= sizeof(*sdata); len -= sizeof(*sdata);
} }
/* one or two bytes left to put into fifo */ /* one or two bytes left to put into fifo */
if ( len > 1 ){ if ( len > 1 ){
/* the last 2bytes */ /* the last 2bytes */
@@ -1637,7 +1637,7 @@ void lan91cxx_print_bank(int bank){
regno=i+bank<<3; regno=i+bank<<3;
regval[i] = get_reg(cpd, regno); regval[i] = get_reg(cpd, regno);
} }
printk("---- BANK %d ----\n\r",bank); printk("---- BANK %d ----\n\r",bank);
for(i=0; i<8; i++){ for(i=0; i<8; i++){
printk("0x%x: 0x%x\n\r",i,regval[i]); printk("0x%x: 0x%x\n\r",i,regval[i]);
} }

View File

@@ -356,13 +356,13 @@ typedef struct lan91cxx_priv_data {
rtems_id txDaemonTid; rtems_id txDaemonTid;
scmv91111_configuration_t config; scmv91111_configuration_t config;
/* backend */ /* backend */
int rpc_cur_mode; int rpc_cur_mode;
int autoneg_active; int autoneg_active;
int phyaddr; int phyaddr;
unsigned int lastPhy18; unsigned int lastPhy18;
int txbusy; /* A packet has been sent*/ int txbusy; /* A packet has been sent*/
unsigned long txkey; /* Used to ack when packet sent*/ unsigned long txkey; /* Used to ack when packet sent*/
unsigned short* base; /* Base I/O address of controller*/ unsigned short* base; /* Base I/O address of controller*/
@@ -395,42 +395,42 @@ typedef struct _debug_regs_pair {
} debug_regs_pair; } debug_regs_pair;
static debug_regs_pair debug_regs[] = { static debug_regs_pair debug_regs[] = {
{LAN91CXX_TCR , "LAN91CXX_TCR" ,0}, {LAN91CXX_TCR , "LAN91CXX_TCR" ,0},
{LAN91CXX_EPH_STATUS , "LAN91CXX_EPH_STATUS",0}, {LAN91CXX_EPH_STATUS , "LAN91CXX_EPH_STATUS",0},
{LAN91CXX_RCR , "LAN91CXX_RCR" ,0}, {LAN91CXX_RCR , "LAN91CXX_RCR" ,0},
{LAN91CXX_COUNTER , "LAN91CXX_COUNTER" ,0}, {LAN91CXX_COUNTER , "LAN91CXX_COUNTER" ,0},
{LAN91CXX_MIR , "LAN91CXX_MIR" ,0}, {LAN91CXX_MIR , "LAN91CXX_MIR" ,0},
{LAN91CXX_MCR , "LAN91CXX_MCR" ,0}, {LAN91CXX_MCR , "LAN91CXX_MCR" ,0},
{LAN91CXX_RPCR , "LAN91CXX_RPCR" ,0}, {LAN91CXX_RPCR , "LAN91CXX_RPCR" ,0},
{LAN91CXX_RESERVED_0 , "LAN91CXX_RESERVED_0",0}, {LAN91CXX_RESERVED_0 , "LAN91CXX_RESERVED_0",0},
{LAN91CXX_BS , "LAN91CXX_BS" ,0}, {LAN91CXX_BS , "LAN91CXX_BS" ,0},
{LAN91CXX_CONFIG , "LAN91CXX_CONFIG" ,0}, {LAN91CXX_CONFIG , "LAN91CXX_CONFIG" ,0},
{LAN91CXX_BASE_REG , "LAN91CXX_BASE_REG" ,0}, {LAN91CXX_BASE_REG , "LAN91CXX_BASE_REG" ,0},
{LAN91CXX_IA01 , "LAN91CXX_IA01" ,0}, {LAN91CXX_IA01 , "LAN91CXX_IA01" ,0},
{LAN91CXX_IA23 , "LAN91CXX_IA23" ,0}, {LAN91CXX_IA23 , "LAN91CXX_IA23" ,0},
{LAN91CXX_IA45 , "LAN91CXX_IA45" ,0}, {LAN91CXX_IA45 , "LAN91CXX_IA45" ,0},
{LAN91CXX_GENERAL , "LAN91CXX_GENERAL" ,0}, {LAN91CXX_GENERAL , "LAN91CXX_GENERAL" ,0},
{LAN91CXX_CONTROL , "LAN91CXX_CONTROL" ,0}, {LAN91CXX_CONTROL , "LAN91CXX_CONTROL" ,0},
{LAN91CXX_BS2 , "LAN91CXX_BS2" ,0}, {LAN91CXX_BS2 , "LAN91CXX_BS2" ,0},
{LAN91CXX_MMU_COMMAND, "LAN91CXX_MMU_COMMAND",0}, {LAN91CXX_MMU_COMMAND, "LAN91CXX_MMU_COMMAND",0},
{LAN91CXX_PNR , "LAN91CXX_PNR" ,0}, {LAN91CXX_PNR , "LAN91CXX_PNR" ,0},
{LAN91CXX_FIFO_PORTS , "LAN91CXX_FIFO_PORTS" ,0}, {LAN91CXX_FIFO_PORTS , "LAN91CXX_FIFO_PORTS" ,0},
{LAN91CXX_POINTER , "LAN91CXX_POINTER" ,0}, {LAN91CXX_POINTER , "LAN91CXX_POINTER" ,0},
{LAN91CXX_DATA_HIGH , "LAN91CXX_DATA_HIGH" ,0}, {LAN91CXX_DATA_HIGH , "LAN91CXX_DATA_HIGH" ,0},
{LAN91CXX_DATA , "LAN91CXX_DATA" ,0}, {LAN91CXX_DATA , "LAN91CXX_DATA" ,0},
{LAN91CXX_INTERRUPT , "LAN91CXX_INTERRUPT" ,0}, {LAN91CXX_INTERRUPT , "LAN91CXX_INTERRUPT" ,0},
{LAN91CXX_BS3 , "LAN91CXX_BS3" ,0}, {LAN91CXX_BS3 , "LAN91CXX_BS3" ,0},
{LAN91CXX_MT01 , "LAN91CXX_MT01" ,0}, {LAN91CXX_MT01 , "LAN91CXX_MT01" ,0},
{LAN91CXX_MT23 , "LAN91CXX_MT23" ,0}, {LAN91CXX_MT23 , "LAN91CXX_MT23" ,0},
{LAN91CXX_MT45 , "LAN91CXX_MT45" ,0}, {LAN91CXX_MT45 , "LAN91CXX_MT45" ,0},
{LAN91CXX_MT67 , "LAN91CXX_MT67" ,0}, {LAN91CXX_MT67 , "LAN91CXX_MT67" ,0},
/*{LAN91CXX_MGMT , "LAN91CXX_MGMT" ,0}, */ /*{LAN91CXX_MGMT , "LAN91CXX_MGMT" ,0}, */
{LAN91CXX_REVISION , "LAN91CXX_REVISION" ,0}, {LAN91CXX_REVISION , "LAN91CXX_REVISION" ,0},
{LAN91CXX_ERCV , "LAN91CXX_ERCV" ,0}, {LAN91CXX_ERCV , "LAN91CXX_ERCV" ,0},
{LAN91CXX_BS4 , "LAN91CXX_BS4" ,0}, {LAN91CXX_BS4 , "LAN91CXX_BS4" ,0},
{-1,0} {-1,0}
}; };
@@ -448,7 +448,7 @@ get_reg(struct lan91cxx_priv_data *cpd, int regno)
HAL_WRITE_UINT16(cpd->base+(LAN91CXX_BS), CYG_CPU_TO_LE16(regno>>3)); HAL_WRITE_UINT16(cpd->base+(LAN91CXX_BS), CYG_CPU_TO_LE16(regno>>3));
HAL_READ_UINT16(cpd->base+((regno&0x7)), val); HAL_READ_UINT16(cpd->base+((regno&0x7)), val);
val = CYG_LE16_TO_CPU(val); val = CYG_LE16_TO_CPU(val);
/*rtems_interrupt_enable(Irql);*/ /*rtems_interrupt_enable(Irql);*/
#ifdef DEBUG & 32 #ifdef DEBUG & 32
@@ -462,7 +462,7 @@ get_reg(struct lan91cxx_priv_data *cpd, int regno)
#else #else
db2_printf("%sread reg %d:%x -> 0x%04x\n", dbg_prefix, regno>>3,(regno&0x7)*2, val); db2_printf("%sread reg %d:%x -> 0x%04x\n", dbg_prefix, regno>>3,(regno&0x7)*2, val);
#endif #endif
return val; return val;
} }
#endif /* SMSC_PLATFORM_DEFINED_GET_REG*/ #endif /* SMSC_PLATFORM_DEFINED_GET_REG*/
@@ -485,12 +485,12 @@ put_reg(struct lan91cxx_priv_data *cpd, int regno, unsigned short val)
#else #else
db2_printf("%swrite reg %d:%x <- 0x%04x\n", dbg_prefix, regno>>3,(regno&0x7)*2, val); db2_printf("%swrite reg %d:%x <- 0x%04x\n", dbg_prefix, regno>>3,(regno&0x7)*2, val);
#endif #endif
/*rtems_interrupt_disable(Irql);*/ /*rtems_interrupt_disable(Irql);*/
HAL_WRITE_UINT16(cpd->base+(LAN91CXX_BS), CYG_CPU_TO_LE16(regno>>3)); HAL_WRITE_UINT16(cpd->base+(LAN91CXX_BS), CYG_CPU_TO_LE16(regno>>3));
HAL_WRITE_UINT16(cpd->base+((regno&0x7)), CYG_CPU_TO_LE16(val)); HAL_WRITE_UINT16(cpd->base+((regno&0x7)), CYG_CPU_TO_LE16(val));
/*rtems_interrupt_enable(Irql);*/ /*rtems_interrupt_enable(Irql);*/
} }
@@ -503,7 +503,7 @@ static __inline__ void
put_data(struct lan91cxx_priv_data *cpd, unsigned short val) put_data(struct lan91cxx_priv_data *cpd, unsigned short val)
{ {
db2_printf("%s[wdata] <- 0x%04x\n", dbg_prefix, val); db2_printf("%s[wdata] <- 0x%04x\n", dbg_prefix, val);
HAL_WRITE_UINT16(cpd->base+((LAN91CXX_DATA & 0x7)), val); HAL_WRITE_UINT16(cpd->base+((LAN91CXX_DATA & 0x7)), val);
} }
@@ -513,7 +513,7 @@ static __inline__ void
put_data8(struct lan91cxx_priv_data *cpd, unsigned char val) put_data8(struct lan91cxx_priv_data *cpd, unsigned char val)
{ {
db2_printf("%s[bdata] <- 0x%02x\n", dbg_prefix, val); db2_printf("%s[bdata] <- 0x%02x\n", dbg_prefix, val);
HAL_WRITE_UINT8(((unsigned char *)(cpd->base+((LAN91CXX_DATA & 0x7))))+1, val); HAL_WRITE_UINT8(((unsigned char *)(cpd->base+((LAN91CXX_DATA & 0x7))))+1, val);
} }
@@ -526,7 +526,7 @@ static __inline__ rxd_t
get_data(struct lan91cxx_priv_data *cpd) get_data(struct lan91cxx_priv_data *cpd)
{ {
rxd_t val; rxd_t val;
#ifdef LAN91CXX_32BIT_RX #ifdef LAN91CXX_32BIT_RX
HAL_READ_UINT32(cpd->base+((LAN91CXX_DATA_HIGH & 0x7)), val); HAL_READ_UINT32(cpd->base+((LAN91CXX_DATA_HIGH & 0x7)), val);
#else #else
@@ -545,7 +545,7 @@ static __inline__ unsigned short
get_banksel(struct lan91cxx_priv_data *cpd) get_banksel(struct lan91cxx_priv_data *cpd)
{ {
unsigned short val; unsigned short val;
HAL_READ_UINT16(cpd->base+(LAN91CXX_BS), val); HAL_READ_UINT16(cpd->base+(LAN91CXX_BS), val);
val = CYG_LE16_TO_CPU(val); val = CYG_LE16_TO_CPU(val);
db2_printf("read bank sel val 0x%04x\n", val); db2_printf("read bank sel val 0x%04x\n", val);

View File

@@ -4,20 +4,20 @@
/* Driver for the Maxim 1375 i2c RTC (TOD only; very simple...) */ /* Driver for the Maxim 1375 i2c RTC (TOD only; very simple...) */
/* /*
* Authorship * Authorship
* ---------- * ----------
* This software was created by * This software was created by
* *
* Till Straumann <strauman@slac.stanford.edu>, 2005-2007, * Till Straumann <strauman@slac.stanford.edu>, 2005-2007,
* Stanford Linear Accelerator Center, Stanford University. * Stanford Linear Accelerator Center, Stanford University.
* *
* Acknowledgement of sponsorship * Acknowledgement of sponsorship
* ------------------------------ * ------------------------------
* The software was produced by * The software was produced by
* the Stanford Linear Accelerator Center, Stanford University, * the Stanford Linear Accelerator Center, Stanford University,
* under Contract DE-AC03-76SFO0515 with the Department of Energy. * under Contract DE-AC03-76SFO0515 with the Department of Energy.
* *
* Government disclaimer of liability * Government disclaimer of liability
* ---------------------------------- * ----------------------------------
* Neither the United States nor the United States Department of Energy, * Neither the United States nor the United States Department of Energy,
@@ -26,18 +26,18 @@
* completeness, or usefulness of any data, apparatus, product, or process * completeness, or usefulness of any data, apparatus, product, or process
* disclosed, or represents that its use would not infringe privately owned * disclosed, or represents that its use would not infringe privately owned
* rights. * rights.
* *
* Stanford disclaimer of liability * Stanford disclaimer of liability
* -------------------------------- * --------------------------------
* Stanford University makes no representations or warranties, express or * Stanford University makes no representations or warranties, express or
* implied, nor assumes any liability for the use of this software. * implied, nor assumes any liability for the use of this software.
* *
* Stanford disclaimer of copyright * Stanford disclaimer of copyright
* -------------------------------- * --------------------------------
* Stanford University, owner of the copyright, hereby disclaims its * Stanford University, owner of the copyright, hereby disclaims its
* copyright and all other rights in this software. Hence, anyone may * copyright and all other rights in this software. Hence, anyone may
* freely use it for any purpose without restriction. * freely use it for any purpose without restriction.
* *
* Maintenance of notices * Maintenance of notices
* ---------------------- * ----------------------
* In the interest of clarity regarding the origin and status of this * In the interest of clarity regarding the origin and status of this
@@ -46,9 +46,9 @@
* or distributed by the recipient and are to be affixed to any copy of * or distributed by the recipient and are to be affixed to any copy of
* software made or distributed by the recipient that contains a copy or * software made or distributed by the recipient that contains a copy or
* derivative of this software. * derivative of this software.
* *
* ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
*/ */
#include <rtems.h> #include <rtems.h>
#include <libchip/rtc.h> #include <libchip/rtc.h>

View File

@@ -2,20 +2,20 @@
/* Driver for the Maxim 1375 i2c RTC (TOD only; very simple...) */ /* Driver for the Maxim 1375 i2c RTC (TOD only; very simple...) */
/* /*
* Authorship * Authorship
* ---------- * ----------
* This software was created by * This software was created by
* *
* Till Straumann <strauman@slac.stanford.edu>, 2005-2007, * Till Straumann <strauman@slac.stanford.edu>, 2005-2007,
* Stanford Linear Accelerator Center, Stanford University. * Stanford Linear Accelerator Center, Stanford University.
* *
* Acknowledgement of sponsorship * Acknowledgement of sponsorship
* ------------------------------ * ------------------------------
* The software was produced by * The software was produced by
* the Stanford Linear Accelerator Center, Stanford University, * the Stanford Linear Accelerator Center, Stanford University,
* under Contract DE-AC03-76SFO0515 with the Department of Energy. * under Contract DE-AC03-76SFO0515 with the Department of Energy.
* *
* Government disclaimer of liability * Government disclaimer of liability
* ---------------------------------- * ----------------------------------
* Neither the United States nor the United States Department of Energy, * Neither the United States nor the United States Department of Energy,
@@ -24,18 +24,18 @@
* completeness, or usefulness of any data, apparatus, product, or process * completeness, or usefulness of any data, apparatus, product, or process
* disclosed, or represents that its use would not infringe privately owned * disclosed, or represents that its use would not infringe privately owned
* rights. * rights.
* *
* Stanford disclaimer of liability * Stanford disclaimer of liability
* -------------------------------- * --------------------------------
* Stanford University makes no representations or warranties, express or * Stanford University makes no representations or warranties, express or
* implied, nor assumes any liability for the use of this software. * implied, nor assumes any liability for the use of this software.
* *
* Stanford disclaimer of copyright * Stanford disclaimer of copyright
* -------------------------------- * --------------------------------
* Stanford University, owner of the copyright, hereby disclaims its * Stanford University, owner of the copyright, hereby disclaims its
* copyright and all other rights in this software. Hence, anyone may * copyright and all other rights in this software. Hence, anyone may
* freely use it for any purpose without restriction. * freely use it for any purpose without restriction.
* *
* Maintenance of notices * Maintenance of notices
* ---------------------- * ----------------------
* In the interest of clarity regarding the origin and status of this * In the interest of clarity regarding the origin and status of this
@@ -44,9 +44,9 @@
* or distributed by the recipient and are to be affixed to any copy of * or distributed by the recipient and are to be affixed to any copy of
* software made or distributed by the recipient that contains a copy or * software made or distributed by the recipient that contains a copy or
* derivative of this software. * derivative of this software.
* *
* ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
*/ */
/* This driver uses the file-system interface to the i2c bus */ /* This driver uses the file-system interface to the i2c bus */
@@ -78,7 +78,7 @@
printk(fmt,args); \ printk(fmt,args); \
} \ } \
} while (0) } while (0)
STATIC uint8_t ds1375_bcd2bin(uint8_t x) STATIC uint8_t ds1375_bcd2bin(uint8_t x)
{ {
@@ -190,7 +190,7 @@ STATIC int wr_bytes(
* the chip interprets the first byte after START as * the chip interprets the first byte after START as
* the register pointer. * the register pointer.
*/ */
d[0] = off; d[0] = off;
memcpy( d + 1, buf, len ); memcpy( d + 1, buf, len );
@@ -290,7 +290,7 @@ STATIC int ds1375_set_time(
buf[DS1375_DAY_OFF] = tm.tm_wday + 1; buf[DS1375_DAY_OFF] = tm.tm_wday + 1;
buf[DS1375_DAT_OFF] = ds1375_bin2bcd( time->day ); buf[DS1375_DAT_OFF] = ds1375_bin2bcd( time->day );
buf[DS1375_MON_OFF] = ds1375_bin2bcd( time->month ); buf[DS1375_MON_OFF] = ds1375_bin2bcd( time->month );
if ( time->year >= 2000 ) { if ( time->year >= 2000 ) {
buf[DS1375_YR_OFF] = ds1375_bin2bcd( time->year - 2000 ); buf[DS1375_YR_OFF] = ds1375_bin2bcd( time->year - 2000 );
buf[DS1375_MON_OFF] |= DS1375_MON_CTRY; buf[DS1375_MON_OFF] |= DS1375_MON_CTRY;
@@ -323,7 +323,7 @@ STATIC int ds1375_set_time(
goto cleanup; goto cleanup;
rval = 0; rval = 0;
cleanup: cleanup:
if ( fd >= 0 ) { if ( fd >= 0 ) {
if ( ! ( DS1375_CR_ECLK & cr ) ) { if ( ! ( DS1375_CR_ECLK & cr ) ) {
@@ -352,8 +352,8 @@ ds1375_get_time_tst()
{ {
rtems_time_of_day rtod; rtems_time_of_day rtod;
time_t secs; time_t secs;
ds1375_get_time( 0, &rtod ); ds1375_get_time( 0, &rtod );
secs = _TOD_To_seconds( &rtod ); secs = _TOD_To_seconds( &rtod );
printf( "%s\n", ctime( &secs ) ); printf( "%s\n", ctime( &secs ) );
return secs; return secs;
@@ -374,7 +374,7 @@ rtems_time_of_day rt;
if ( ! prt ) if ( ! prt )
prt = &rt; prt = &rt;
secs = mktime( &tm ); secs = mktime( &tm );
/* convert to UTC */ /* convert to UTC */
@@ -417,7 +417,7 @@ rtc_ds1375_set_register( uint32_t port, uint8_t reg, uint32_t value )
{ {
int fd; int fd;
uint8_t v = value; uint8_t v = value;
if ( ( fd = open( (const char*)port, O_RDWR ) ) >= 0 ) { if ( ( fd = open( (const char*)port, O_RDWR ) ) >= 0 ) {
wr_bytes( fd, reg, &v, 1 ); wr_bytes( fd, reg, &v, 1 );
close( fd ); close( fd );

View File

@@ -1,5 +1,5 @@
/* /*
* This file interfaces with the real-time clock found in * This file interfaces with the real-time clock found in
* a Motorola MC146818A (common on PC hardware) * a Motorola MC146818A (common on PC hardware)
* *
* Year 2K Notes: * Year 2K Notes:
@@ -99,7 +99,7 @@ int mc146818a_get_time(
while (((*getReg)( mc146818a, MC146818A_STATUSA ) & MC146818ASA_TUP) != 0) { while (((*getReg)( mc146818a, MC146818A_STATUSA ) & MC146818ASA_TUP) != 0) {
rtems_interrupt_flash( level ); rtems_interrupt_flash( level );
} }
/* /*
* Read the time (we have at least 244 usec to do this) * Read the time (we have at least 244 usec to do this)
*/ */
@@ -150,7 +150,7 @@ int mc146818a_set_time(
* Stop the RTC * Stop the RTC
*/ */
(*setReg)( mc146818a, MC146818A_STATUSB, MC146818ASB_HALT|MC146818ASB_24HR ); (*setReg)( mc146818a, MC146818A_STATUSB, MC146818ASB_HALT|MC146818ASB_24HR );
if ( time->year >= 2088 ) if ( time->year >= 2088 )
rtems_fatal_error_occurred( RTEMS_INVALID_NUMBER ); rtems_fatal_error_occurred( RTEMS_INVALID_NUMBER );
@@ -160,7 +160,7 @@ int mc146818a_set_time(
(*setReg)( mc146818a, MC146818A_HRS, To_BCD(time->hour) ); (*setReg)( mc146818a, MC146818A_HRS, To_BCD(time->hour) );
(*setReg)( mc146818a, MC146818A_MIN, To_BCD(time->minute) ); (*setReg)( mc146818a, MC146818A_MIN, To_BCD(time->minute) );
(*setReg)( mc146818a, MC146818A_SEC, To_BCD(time->second) ); (*setReg)( mc146818a, MC146818A_SEC, To_BCD(time->second) );
/* /*
* Restart the RTC * Restart the RTC
*/ */

View File

@@ -43,7 +43,7 @@
#define MC146818A_STATUSD 0x0d /* status register D */ #define MC146818A_STATUSD 0x0d /* status register D */
#define MC146818ASD_PWR 0x80 /* clock lost power */ #define MC146818ASD_PWR 0x80 /* clock lost power */
/* /*
* Driver function table * Driver function table
*/ */

View File

@@ -19,7 +19,7 @@
* *
* This driver uses the termios pseudo driver. * This driver uses the termios pseudo driver.
*/ */
/* /*
* $Id$ * $Id$
*/ */

View File

@@ -49,7 +49,7 @@ void Shm_install_timer(void)
status = rtems_timer_create( rtems_build_name( 'S', 'H', 'P', 'L' ), &id ); status = rtems_timer_create( rtems_build_name( 'S', 'H', 'P', 'L' ), &id );
assert( !status ); assert( !status );
status = rtems_timer_fire_after( id, 1, Shm_Poll_TSR, NULL ); status = rtems_timer_fire_after( id, 1, Shm_Poll_TSR, NULL );
assert( !status ); assert( !status );
} }