GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / cfe / build / broadcom / tiny / tiny_devs.c
blob7a4fd298905103595bb0bf8c43639bb4d4a4893b
1 /* *********************************************************************
2 * Broadcom Common Firmware Environment (CFE)
3 *
4 * Board device initialization File: tiny_devs.c
5 *
6 * This is the "C" part of the board support package. The
7 * routines to create and initialize the console, wire up
8 * device drivers, and do other customization live here.
9 *
10 * Author: Mitch Lichtenberg (mpl@broadcom.com)
12 *********************************************************************
14 * Copyright 2000,2001,2002,2003
15 * Broadcom Corporation. All rights reserved.
17 * This software is furnished under license and may be used and
18 * copied only in accordance with the following terms and
19 * conditions. Subject to these conditions, you may download,
20 * copy, install, use, modify and distribute modified or unmodified
21 * copies of this software in source and/or binary form. No title
22 * or ownership is transferred hereby.
24 * 1) Any source code used, modified or distributed must reproduce
25 * and retain this copyright notice and list of conditions
26 * as they appear in the source file.
28 * 2) No right is granted to use any trade name, trademark, or
29 * logo of Broadcom Corporation. The "Broadcom Corporation"
30 * name may not be used to endorse or promote products derived
31 * from this software without the prior written permission of
32 * Broadcom Corporation.
34 * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR
35 * IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
36 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
37 * PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT
38 * SHALL BROADCOM BE LIABLE FOR ANY DAMAGES WHATSOEVER, AND IN
39 * PARTICULAR, BROADCOM SHALL NOT BE LIABLE FOR DIRECT, INDIRECT,
40 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
41 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
42 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
43 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
44 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
45 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF
46 * THE POSSIBILITY OF SUCH DAMAGE.
47 ********************************************************************* */
52 #include "lib_types.h"
53 #include "lib_queue.h"
54 #include "cfe_iocb.h"
55 #include "cfe_device.h"
56 #include "env_subr.h"
57 #include "cfe.h"
59 #include "sb1250_defs.h"
60 #include "sb1250_regs.h"
61 #include "sb1250_pci.h"
62 #include "sb1250_ldt.h"
64 #include "bsp_config.h"
66 #include "dev_newflash.h"
68 #include "tiny.h"
70 /* *********************************************************************
71 * Devices we're importing
72 ********************************************************************* */
74 extern cfe_driver_t sb1250_uart; /* SB1250 serial ports */
75 extern cfe_driver_t newflashdrv; /* AMD-style flash */
76 #if CFG_NETWORK
77 extern cfe_driver_t sb1250_ether;
78 extern cfe_driver_t sb1250_x1240eeprom; /* Xicor SMBus NVRAM */
79 #endif
81 /* *********************************************************************
82 * Some board-specific parameters
83 ********************************************************************* */
85 #define PROMICE_BASE (0x1FFC0000)
86 #define PROMICE_WORDSIZE 1
89 /* *********************************************************************
90 * board_console_init()
92 * Add the console device and set it to be the primary
93 * console.
95 * Input parameters:
96 * nothing
98 * Return value:
99 * nothing
100 ********************************************************************* */
102 void board_console_init(void)
104 /* Console */
105 cfe_add_device(&sb1250_uart,A_DUART,0,0);
106 cfe_set_console("uart0");
110 /* *********************************************************************
111 * board_device_init()
113 * Initialize and add other devices. Add everything you need
114 * for bootstrap here, like disk drives, flash memory, UARTs,
115 * network controllers, etc.
117 * Input parameters:
118 * nothing
120 * Return value:
121 * nothing
122 ********************************************************************* */
124 //#define BOOTROM_PHYS 0x1FC00000
125 //#define BOOTROM_SIZE 2*1024*1024
126 void board_device_init(void)
128 cfe_add_device(&newflashdrv,
129 BOOTROM_PHYS,
130 (BOOTROM_SIZE) | FLASH_FLG_BUS8 | FLASH_FLG_DEV16,
131 NULL);
133 #if CFG_NETWORK
134 cfe_add_device(&sb1250_x1240eeprom,X1240_SMBUS_CHAN,X1240_SMBUS_DEV,0);
135 cfe_set_envdevice("eeprom0"); /* Connect NVRAM subsystem to EEPROM */
136 cfe_add_device(&sb1250_ether,A_MAC_BASE_0,0,env_getenv("ETH0_HWADDR"));
137 #endif
142 /* *********************************************************************
143 * board_device_reset()
145 * Reset devices. This call is done when the firmware is restarted,
146 * as might happen when an operating system exits, just before the
147 * "reset" command is applied to the installed devices. You can
148 * do whatever board-specific things are here to keep the system
149 * stable, like stopping DMA sources, interrupts, etc.
151 * Input parameters:
152 * nothing
154 * Return value:
155 * nothing
156 ********************************************************************* */
158 void board_device_reset(void)
165 /* *********************************************************************
166 * board_final_init()
168 * Do any final initialization, such as adding commands to the
169 * user interface.
171 * If you don't want a user interface, put the startup code here.
172 * This routine is called just before CFE starts its user interface.
174 * Input parameters:
175 * nothing
177 * Return value:
178 * nothing
179 ********************************************************************* */
181 void board_final_init(void)