Line 54... |
Line 54... |
|
|
/* simulator interface */
|
/* simulator interface */
|
static void eth_reset_controller( struct eth_device *eth);
|
static void eth_reset_controller( struct eth_device *eth);
|
static void eth_vapi_read( unsigned long id, unsigned long data);
|
static void eth_vapi_read( unsigned long id, unsigned long data);
|
/* register interface */
|
/* register interface */
|
static void eth_write32( oraddr_t addr, uint32_t value );
|
static void eth_write32( oraddr_t addr, uint32_t value, void *dat );
|
static uint32_t eth_read32( oraddr_t addr );
|
static uint32_t eth_read32( oraddr_t addr, void *dat );
|
/* clock */
|
/* clock */
|
static void eth_controller_tx_clock( struct eth_device * );
|
static void eth_controller_tx_clock( struct eth_device * );
|
static void eth_controller_rx_clock( struct eth_device * );
|
static void eth_controller_rx_clock( struct eth_device * );
|
/* utility functions */
|
/* utility functions */
|
static int eth_find_controller( oraddr_t addr, struct eth_device **eth, oraddr_t *reladdr );
|
static int eth_find_controller( oraddr_t addr, struct eth_device **eth, oraddr_t *reladdr );
|
Line 515... |
Line 515... |
exit (1);
|
exit (1);
|
}
|
}
|
eth->eth_number = i;
|
eth->eth_number = i;
|
eth_reset_controller( eth );
|
eth_reset_controller( eth );
|
if ( eth->baseaddr && first_time )
|
if ( eth->baseaddr && first_time )
|
register_memoryarea( eth->baseaddr, ETH_ADDR_SPACE, 4, 0, eth_read32, eth_write32 );
|
register_memoryarea( eth->baseaddr, ETH_ADDR_SPACE, 4, 0, eth_read32, eth_write32, NULL );
|
}
|
}
|
|
|
if ( first_time )
|
if ( first_time )
|
first_time = 0;
|
first_time = 0;
|
}
|
}
|
Line 707... |
Line 707... |
|
|
|
|
/*
|
/*
|
Read a register
|
Read a register
|
*/
|
*/
|
uint32_t eth_read32( oraddr_t addr )
|
uint32_t eth_read32( oraddr_t addr, void *dat )
|
{
|
{
|
struct eth_device *eth;
|
struct eth_device *eth;
|
if ( !eth_find_controller( addr, ð, &addr ) ) {
|
if ( !eth_find_controller( addr, ð, &addr ) ) {
|
PRINTF( "eth_read32( 0x%"PRIxADDR" ): Not in registered range(s)\n", addr );
|
PRINTF( "eth_read32( 0x%"PRIxADDR" ): Not in registered range(s)\n", addr );
|
return 0;
|
return 0;
|
Line 757... |
Line 757... |
|
|
|
|
/*
|
/*
|
Write a register
|
Write a register
|
*/
|
*/
|
void eth_write32( oraddr_t addr, uint32_t value )
|
void eth_write32( oraddr_t addr, uint32_t value, void *dat )
|
{
|
{
|
struct eth_device *eth;
|
struct eth_device *eth;
|
if ( !eth_find_controller( addr, ð, &addr ) ) {
|
if ( !eth_find_controller( addr, ð, &addr ) ) {
|
PRINTF( "eth_write32( 0x%"PRIxADDR" ): Not in registered range(s)\n", addr );
|
PRINTF( "eth_write32( 0x%"PRIxADDR" ): Not in registered range(s)\n", addr );
|
return;
|
return;
|