2021-03-20 22:39:00 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
*/
|
2013-01-08 22:40:58 +08:00
|
|
|
#include <rtthread.h>
|
|
|
|
#include "board.h"
|
|
|
|
|
2017-11-30 23:56:52 +08:00
|
|
|
int platform_init(void)
|
2013-01-08 22:40:58 +08:00
|
|
|
{
|
2015-09-30 16:26:40 +08:00
|
|
|
#ifdef RT_USING_LWIP
|
|
|
|
#ifdef RT_USING_TAPNETIF
|
|
|
|
tap_netif_hw_init();
|
|
|
|
#else
|
|
|
|
pcap_netif_hw_init();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2013-01-08 22:40:58 +08:00
|
|
|
#ifdef RT_USING_DFS
|
|
|
|
/* initialize sd card */
|
|
|
|
rt_hw_sdcard_init();
|
|
|
|
|
2022-05-16 07:17:24 +08:00
|
|
|
#ifdef RT_USING_MTD_NAND
|
2013-01-08 22:40:58 +08:00
|
|
|
rt_hw_mtd_nand_init();
|
2022-05-16 07:17:24 +08:00
|
|
|
#endif /* RT_USING_MTD_NAND */
|
2013-01-08 22:40:58 +08:00
|
|
|
|
2022-05-16 07:17:24 +08:00
|
|
|
#ifdef RT_USING_MTD_NOR
|
2013-01-08 22:40:58 +08:00
|
|
|
sst25vfxx_mtd_init("nor", 0, RT_UINT32_MAX);
|
2022-05-16 07:17:24 +08:00
|
|
|
#endif /* RT_USING_MTD_NOR */
|
2013-01-08 22:40:58 +08:00
|
|
|
|
|
|
|
#endif /* RT_USING_DFS */
|
2017-11-30 23:56:52 +08:00
|
|
|
|
2018-03-11 14:35:50 +08:00
|
|
|
return 0;
|
|
|
|
}
|
2021-03-31 21:38:19 +08:00
|
|
|
INIT_COMPONENT_EXPORT(platform_init);
|
2018-03-11 14:35:50 +08:00
|
|
|
|
|
|
|
int platform_post_init(void)
|
|
|
|
{
|
2018-03-03 16:34:01 +08:00
|
|
|
#ifdef PKG_USING_GUIENGINE
|
2017-12-13 20:38:56 +08:00
|
|
|
{
|
|
|
|
extern void rt_hw_sdl_start(void);
|
|
|
|
extern int rtgui_system_server_init(void);
|
|
|
|
|
|
|
|
rtgui_system_server_init();
|
|
|
|
rt_hw_sdl_start();
|
|
|
|
}
|
|
|
|
#endif
|
2017-11-30 23:56:52 +08:00
|
|
|
return 0;
|
2013-01-08 22:40:58 +08:00
|
|
|
}
|
2021-03-31 21:38:19 +08:00
|
|
|
INIT_COMPONENT_EXPORT(platform_post_init);
|