<html><head><meta http-equiv="content-type" content="text/html; charset=GB2312"><style>body { line-height: 1.5; }body { font-size: 10.5pt; font-family: ΢ÈíÑźÚ; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span>hi </div><div><br></div><div>1£ºi want to change the bsp according to the zynq zedboard¡£it only has console driver and i2c driver¡£ so i want to add some drviers i used in bare-metal software before £¨such as gpio£©¡£i do not know how to start¡£</div><div><br></div><div>please give me some advice¡£</div><div><br></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">i find the function in bootcard.c "</span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">rtems_initialize_device_drivers" i think i need add code here, but the bsp i used installed as lib. so , can i change the source code?</span></div>
<div><br></div><div>i do not understand the <span style="font-size: 10.5pt; line-height: 1.5; background-color: window;">RTEMS_DRVMGR_STARTUP level 1,2,3,4 ,is there a example to add my device driver to the rtems architecture£¿</span></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: window;"><br></span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">void rtems_initialize_device_drivers(void)<br>{<br> /*<br> * Initialize all the device drivers and initialize the MPCI layer.<br> *<br> * NOTE: The MPCI may be build upon a device driver.<br> */<br><br> #ifdef RTEMS_DRVMGR_STARTUP<br> /* BSPs has already registered their "root bus" driver in the<br> * bsp_predriver hook or so.<br> *<br> * Init Drivers to Level 1, constraints:<br> * - Interrupts and system clock timer does not work.<br> * - malloc() work, however other memory services may not<br> * have been initialized yet.<br> * - initializes most basic stuff<br> *<br> * Typical setup in Level 1:<br> * - Find most devices in system, do PCI scan and configuration.<br> * - Reset hardware if needed.<br> * - Install IRQ driver<br> * - Install Timer driver<br> * - Install console driver and debug printk()<br> * - Install extra memory.<br> */<br> _DRV_Manager_init_level(1);<br> bsp_driver_level_hook(1);<br> #endif<br><br> /* Initialize I/O drivers. <br> *<br> * Driver Manager note:<br> * All drivers may not be registered yet. Drivers will dynamically<br> * be initialized when registered in level 2,3 and 4.<br> */<br> _IO_Initialize_all_drivers();<br><br> #ifdef RTEMS_DRVMGR_STARTUP<br> /* Init Drivers to Level 2, constraints:<br> * - Interrupts can be registered and enabled.<br> * - System Clock is running<br> * - Console may be used.<br> *<br> * This is typically where drivers are initialized<br> * for the first time.<br> */<br> _DRV_Manager_init_level(2);<br> bsp_driver_level_hook(2);<br><br> /* Init Drivers to Level 3 <br> * <br> * This is typically where normal drivers are initialized<br> * for the second time, they may depend on other drivers<br> * API inited in level 2<br> */<br> _DRV_Manager_init_level(3);<br> bsp_driver_level_hook(3);<br><br> /* Init Drivers to Level 4,<br> * Init drivers that depend on services initialized in Level 3<br> */<br> _DRV_Manager_init_level(4);<br> bsp_driver_level_hook(4);<br> #endif<br><br> #if defined(RTEMS_MULTIPROCESSING)<br> if ( _System_state_Is_multiprocessing ) {<br> _MPCI_Initialization();<br> _MPCI_Internal_packets_Send_process_packet(<br><span style="white-space: pre;"> </span>MPCI_PACKETS_SYSTEM_VERIFY<br> );<br> }<br> #endif<br><br> /*<br> * Run the APIs and BSPs postdriver hooks.<br> *<br> * The API extensions are supposed to create user initialization tasks.<br> */<br> _API_extensions_Run_postdriver();<br>}</span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br></span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br></span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br></span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br></span></div><div>2£ºanother question is how can i enable the interrupt£¿ in the init task is ok£¿</div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);"><br></span></div><div><br></div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div>bin.wang@qkmtech.com</div></div></span></div>
</body></html>