<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body>
<div id="contentDescription" style="line-height:1.5;text-align:justify;text-justify:inter-ideograph">
<div>Thanks very much </div><div>yes,as you said,i init my baremetal drivers by initializing them at Init task. Now it works. </div><div><br></div><div>Yes l use 4.11.2 now,during this time, i read the rtems source code about the interrupt and init sequence,i have known something which confused me. What i think is proved right by reading What you said.</div><div><br></div><div>Thanks again </div><div><br></div><div class="NETEASEMAILMASTERLOCALSIGNATURE"><div id="imail_signature">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<a href="https://maas.mail.163.com/dashi-web-extend/html/proSignature.html?iconUrl=https%3A%2F%2Fmail-online.nosdn.127.net%2Fqiyelogo%2FdefaultAvatar.png&name=%E7%8E%8B%E5%BD%AC&uid=example%40163.com&ftlId=3&items=%5B%22%E9%82%AE%E7%AE%B1%EF%BC%9Abin.wang%40qkmtech.com%22%5D" width="400" style="display:block; max-width: 400px; _width: 400px; background:#fff;padding:15px 0 10px 0;text-decoration: none; outline:none;-webkit-tap-highlight-color:transparent;">
<table cellpadding="0" style="width:100%; max-width: 100%; table-layout: fixed; border-collapse: collapse; border-spacing: 0; line-height: 1.3; color: #9b9ea1;font-size: 14px;">
<tbody style="font-family: 'PingFang SC', 'Hiragino Sans GB','WenQuanYi Micro Hei', 'Microsoft Yahei', '微软雅黑', verdana !important; word-wrap:break-word; word-break:break-all;">
<tr>
<td width="45" style="padding:0 7px 0 0; box-sizing: border-box; width: 45px;">
<img width="38" height="38" style="width: 38px; height: 38px; border-radius:50%;" src="https://mail-online.nosdn.127.net/qiyelogo/defaultAvatar.png">
</td>
<td style="padding: 0 0 0 7px;">
<div style="max-width: 380px; _width: 380px;">
<div style="box-sizing: border-box; padding-right: 35px; font-size: 16px; margin-bottom: 5px; color:#31353b;font-weight:bold;width: 100%; white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">王彬</div>
<div style="font-size:0;line-height: 0;">
</div>
<div style="word-wrap:break-word;word-break:break-all">
邮箱:bin.wang@qkmtech.com
</div>
</div>
</td>
</tr>
</tbody>
</table>
</a>
<p style="margin:0;border-top:1px solid #e5e5e5;padding-top: 6px; font-size: 12px; color:#b6b8bb;line-height: 1.5;">签名由 <a href="https://mail.163.com/dashi/dlpro.html?from=mail88" style="color:#6aa8f6;text-decoration: none">网易邮箱大师</a> 定制</p></div></div>
<div class="J-reply" style="background-color:#f2f2f2;color:black;padding-top:6px;padding-bottom:6px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;margin-top:45px;margin-bottom:20px;"><div style="font-size:14px;line-height:1.5;word-break:break-all;margin-left:10px;margin-right:10px">On <span class="mail-date">01/10/2018 23:36</span>, <a class="mail-to" style="text-decoration:none;color:#2a97ff;" href="mailto:gedare@rtems.org">Gedare Bloom</a> wrote: </div></div><blockquote id="ntes-iosmail-quote" style="margin:0">Hello,
<br>
<br>On Tue, Jan 2, 2018 at 8:35 AM, bin.wang@qkmtech.com
<br><bin.wang@qkmtech.com> wrote:
<br>> hi
<br>>
<br>> 1:i want to change the bsp according to the zynq zedboard。it only has
<br>> console driver and i2c driver。 so i want to add some drviers i used in
<br>> bare-metal software before (such as gpio)。i do not know how to start。
<br>>
<br>You can add the drivers to the BSP. Probably you can just make your
<br>baremetal drivers work correctly by initializing them at the right
<br>time.
<br>
<br>> please give me some advice。
<br>>
<br>> i find the function in bootcard.c "rtems_initialize_device_drivers"
<br>> i think i need add code here, but the bsp i used installed as lib. so ,
<br>> can i change the source code?
<br>>
<br>> i do not understand the RTEMS_DRVMGR_STARTUP level 1,2,3,4 ,is there a
<br>> example to add my device driver to the rtems architecture?
<br>>
<br>This DRVMGR stuff interacts with the cpukit/libdrvmgr, which is from
<br>Gaisler folks and mostly supports Sparc targets.
<br>
<br>What version of rtems do you use? I guess it is 4.11.x?
<br>
<br>You could initialize baremetal drivers at any point even in your
<br>application itself.
<br>
<br>> 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>> 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>> }
<br>>
<br>>
<br>>
<br>>
<br>> 2:another question is how can i enable the interrupt? in the init task is
<br>> ok?
<br>>
<br>Interrupts will be already enabled when Init() is called. They get
<br>turned on during the RTEMS initialization sequence.
<br>
<br>>
<br>> ________________________________
<br>> bin.wang@qkmtech.com
<br>>
<br>> _______________________________________________
<br>> users mailing list
<br>> users@rtems.org
<br>> http://lists.rtems.org/mailman/listinfo/users
<br></blockquote>
</div>
</body></html>