source: rtems/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c @ 47b29ac

4.104.114.84.95
Last change on this file since 47b29ac was 47b29ac, checked in by Joel Sherrill <joel.sherrill@…>, on 09/12/07 at 15:39:42

2007-09-12 Daniel Hellstrom <daniel@…>

  • leon_smc91111/leon_smc91111.c: LEON2 SMC91111 initialization: PIO Interrupt initialization fix and speed rate defaulted to 100Mbit/s for boards with 50MHz system clock or greater now all defaults to 100Mbit/s
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  $Id$
3 */
4
5#include <rtems.h>
6
7#include <bsp.h>
8#include <rtems/bspIo.h>
9
10#include <stdlib.h>
11#include <stdio.h>
12#include <stdarg.h>
13#include <rtems/error.h>
14#include <rtems/rtems_bsdnet.h>
15
16#include <sys/param.h>
17#include <sys/mbuf.h>
18
19#include <sys/socket.h>
20#include <sys/sockio.h>
21#include <net/if.h>
22#include <netinet/in.h>
23#include <netinet/if_ether.h>
24
25#include <libchip/smc91111exp.h>
26
27
28#define SMC91111_BASE_ADDR (void*)0x20000300
29#define SMC91111_BASE_IRQ  LEON_TRAP_TYPE(4)
30#define SMC91111_BASE_PIO  4
31
32scmv91111_configuration_t leon_scmv91111_configuration = {
33  SMC91111_BASE_ADDR, /* base address */
34  SMC91111_BASE_IRQ,  /* vector number */
35  SMC91111_BASE_PIO,  /* PIO */
36  100,                /* 100b */
37  1,                  /* fulldx */
38  1                   /* autoneg */
39};
40
41int _rtems_smc91111_driver_attach(
42  struct rtems_bsdnet_ifconfig *config,
43  scmv91111_configuration_t    *scm_config
44);
45
46/*
47 * Attach an SMC91111 driver to the system
48 */
49int rtems_smc91111_driver_attach_leon2(struct rtems_bsdnet_ifconfig *config)
50{
51
52  /* activate io area */
53  printk("Activating Leon2 io port\n");
54  /*configure pio */
55  *((volatile unsigned int *)0x80000000) |= 0x10f80000;
56  *((volatile unsigned int *)0x800000A8) |=
57    (0xe0 | leon_scmv91111_configuration.pio)
58      << (8 * ((leon_scmv91111_configuration.vector & 0x0f) - 4));
59 
60  return _rtems_smc91111_driver_attach(config,&leon_scmv91111_configuration);
61
62};
63
Note: See TracBrowser for help on using the repository browser.