source: rtems/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c @ 37f09415

Last change on this file since 37f09415 was d2a30c77, checked in by Joel Sherrill <joel.sherrill@…>, on 10/05/05 at 19:25:45

2005-10-05 Jiri Gaisler <jiri@…>

Edvin Catovic <edvin@…>
Konrad Eisele <konrad@…>

PR 827/bsps

  • .cvsignore, ChangeLog?, Makefile.am, README, bsp_specs, configure.ac, times, clock/.cvsignore, clock/Makefile.am, clock/ckinit.c, console/.cvsignore, console/Makefile.am, console/console.c, console/consolereserveresources.c, console/debugputs.c, gnatsupp/.cvsignore, gnatsupp/Makefile.am, gnatsupp/gnatsupp.c, include/.cvsignore, include/Makefile.am, include/bsp.h, include/coverhd.h, include/leon.h, leon_open_eth/.cvsignore, leon_open_eth/Makefile.am, leon_open_eth/leon_open_eth.c, leon_smc91111/.cvsignore, leon_smc91111/Makefile.am, leon_smc91111/leon_smc91111.c, start/.cvsignore, start/Makefile.am, startup/.cvsignore, startup/Makefile.am, startup/linkcmds, startup/setvec.c, startup/spurious.c, timer/.cvsignore, timer/Makefile.am, timer/timer.c, tools/.cvsignore, tools/ChangeLog, tools/Makefile.am, tools/configure.ac, tools/runtest.in, wrapup/.cvsignore, wrapup/Makefile.am: New files.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  $Id$
3 */
4
5#include <rtems.h>
6
7#include <bsp.h>
8#include <stdio.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  10,                 /* 10b */
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  if (LEON_REG.Scaler_Reload >= 49)
53    leon_scmv91111_configuration.ctl_rspeed = 100;
54
55  /* activate io area */
56  DEBUG_puts("Activating Leon2 io port\n");
57  /*configure pio */
58  *((volatile unsigned int *)0x80000000) |= 0x10f80000;
59  *((volatile unsigned int *)0x800000A8) |=
60    (0xe0 | leon_scmv91111_configuration.vector)
61      << (8 * (leon_scmv91111_configuration.pio - 4));
62 
63  return _rtems_smc91111_driver_attach(config,&leon_scmv91111_configuration);
64
65};
66
Note: See TracBrowser for help on using the repository browser.