完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛扫一扫,分享给好友
|
在Board-am335xevm.c (archARMmach-omap2) 中
/* General Purpose EVM */ static struct evm_dev_cfg gen_purp_evm_dev_cfg[] =[ [am335x_rtc_init, DEV_ON_BASEBOARD, PROFILE_ALL], [clkout2_enable, DEV_ON_BASEBOARD, PROFILE_ALL], [enable_ecap0, DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_1 | PROFILE_2 | PROFILE_7) ], ........ ] 这里的PROFILE_XXX指的是什么,有什么作用呢?对应芯片手册里面的什么功能呢? |
|
相关推荐
4个回答
|
|
|
具体可以看解析的函数,类似于case,和芯片好像没啥关系,软件方面的东西
|
|
|
|
|
|
你好!可以查看下GP EVM 7寸液晶屏旁边有一个SW8,其作为profile selection,可以有8中profile
详细可以参考u-boot源码下boardtiam335xmux.c中的定义 The AM335x GP EVM can have one of 8 different profiles selected. Each profile has a different set of peripherals and requires different pinmux configurations that conflict with other profiles. |
|
|
|
|
|
TI的内核bsp是通过初始化evm_dev_cfg结构体来初始化cpu外设的。比如evm_sk_dev_cfg
/* EVM - Starter Kit */ static struct evm_dev_cfg evm_sk_dev_cfg[] = [ [am335x_rtc_init, DEV_ON_BASEBOARD, PROFILE_ALL], [mmc1_wl12xx_init, DEV_ON_BASEBOARD, PROFILE_ALL], [mmc0_init, DEV_ON_BASEBOARD, PROFILE_ALL], [rgmii1_init, DEV_ON_BASEBOARD, PROFILE_ALL], [rgmii2_init, DEV_ON_BASEBOARD, PROFILE_ALL], [lcdc_init, DEV_ON_BASEBOARD, PROFILE_ALL], [enable_ecap2, DEV_ON_BASEBOARD, PROFILE_ALL], [mfd_tscadc_init, DEV_ON_BASEBOARD, PROFILE_ALL], [gpio_keys_init, DEV_ON_BASEBOARD, PROFILE_ALL], [gpio_led_init, DEV_ON_BASEBOARD, PROFILE_ALL], [lis331dlh_init, DEV_ON_BASEBOARD, PROFILE_ALL], [mcasp1_init, DEV_ON_BASEBOARD, PROFILE_ALL], [uart1_wl12xx_init, DEV_ON_BASEBOARD, PROFILE_ALL], [wl12xx_init, DEV_ON_BASEBOARD, PROFILE_ALL], [gpio_ddr_vtt_enb_init, DEV_ON_BASEBOARD, PROFILE_ALL], [sgx_init, DEV_ON_BASEBOARD, PROFILE_ALL], [NULL, 0, 0], ]; evm_sk_dev_cfg被_configure_device函数读取,_configure_device(EVM_SK , evm_sk_dev_cfg, PROFILE_NONE); 这里 TI默认提供以下几种配置: gen_purp_evm_dev_cfg ind_auto_mtrl_evm_dev_cfg beaglebone_old_dev_cfg beaglebone_dev_cfg beaglebone_black_dev_cfg evm_sk_dev_cfg 分析_configure_device static void _configure_device(int evm_id, struct evm_dev_cfg *dev_cfg, int profile) [ int i; am335x_evm_set_id(evm_id); /* * Only General Purpose & Industrial Auto Motro Control * EVM has profiles. So check if this evm has profile. * If not, ignore the profile comparison */ /* * If the device is on baseboard, directly configure it. Else (device on * Daughter board), check if the daughter card is detected. */ if (profile == PROFILE_NONE) [ for (i = 0; dev_cfg->device_init != NULL; dev_cfg++) [ if (dev_cfg->device_on == DEV_ON_BASEBOARD) dev_cfg->device_init(evm_id, profile); else if (daughter_brd_detected == true) dev_cfg->device_init(evm_id, profile); ] ] else [ for (i = 0; dev_cfg->device_init != NULL; dev_cfg++) [ if (dev_cfg->profile & profile) [ if (dev_cfg->device_on == DEV_ON_BASEBOARD) dev_cfg->device_init(evm_id, profile); else if (daughter_brd_detected == true) dev_cfg->device_init(evm_id, profile); ] ] ] ] 可见,_configure_device分2种情形。 一、当以PROFILE_NONE方式执行_configure_device时,需要符合2个条件之1才会执行dev_cfg->device_init(evm_id, profile); 条件1:dev_cfg->device_on == DEV_ON_BASEBOARD ,即当前板子是母板 条件2:daughter_brd_detected == true,子板被检测到,还要多判断一个条件:dev_cfg->profile & profile 二、当_configure_device(int evm_id, struct evm_dev_cfg *dev_cfg, int profile)的第3个参数profile不是PROFILE_NONE时, 也就是指定了某种配置,这时先判断 dev_cfg->profile & profile,即dev_cfg里那些具有profile属性的成员才会被执行, 根据TI的源码注释信息,似乎是am335_evm这个板子有8种底板,使用profile来区分使用哪种底板的功能。 /* * The AM335x GP EVM, if daughter card(s) are connected, can have 8 * different profiles. These profiles determine what peripherals are * valid and need pinmux to be configured. */ #define PROFILE_NONE 0x0 #define PROFILE_0 (1 << 0) #define PROFILE_1 (1 << 1) #define PROFILE_2 (1 << 2) #define PROFILE_3 (1 << 3) #define PROFILE_4 (1 << 4) #define PROFILE_5 (1 << 5) #define PROFILE_6 (1 << 6) #define PROFILE_7 (1 << 7) #define PROFILE_MASK 0x7 #define PROFILE_ALL 0xFF 比如我写了一个mmc0_init来初始化mmc,这个功能所有子板都具备,那就可以使用 PROFILE_ALL来向 evm_sk_dev_cfg添加成员函数: [mmc0_init, DEV_ON_BASEBOARD, PROFILE_ALL], |
|
|
|
|
60user78 发表于 2018-5-15 01:11 软件方面的东西,作为功能选择的 仔细看看它的分支就可以了,一般情况下可以无视 不过为了保险起见,最好还是仔细一点,一般这个处理函数在上下文中会有所体现的 |
|
|
|
|
只有小组成员才能发言,加入小组>>
549 浏览 0 评论
1613 浏览 0 评论
2047 浏览 0 评论
为啥BQ7693003DBTR芯片在和BQ769X0盒子通讯时收不到信号?
1513 浏览 0 评论
DSP 28027F 开发板 XDS100v2调试探针诊断日志显示了 Error -150 (SC_ERR_FTDI_FAIL)如何解决
1337 浏览 0 评论
AT32F407在USART2 DMA发送数据时,接包接到了要发送的数据,程序还是处于等待传输完成的标识判断中,为什么?
1757浏览 29评论
2781浏览 23评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
1724浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
1634浏览 14评论
两个TMP117传感器一个可以正常读取温度值,一个读取的值一直是0,为什么?
1645浏览 13评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 05:00 , Processed in 0.632704 second(s), Total 81, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
3525