我找到原因了,借版描述下问题,给后来的人借鉴下,谢谢楼主
am3359有DCAN控制器,但是这不代表beaglebone源码里把can加进去了,事实上是am335x-EVM支持,在/arch/arm/mach-omap2里的board-am335x.c里把can初始化添加进去,我不清楚哪个是代表beaglebone板,所以都添加了
/* Beaglebone < Rev A3 */
static struct evm_dev_cfg beaglebone_old_dev_cfg[] = {
{am335x_rtc_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{clkout2_enable, DEV_ON_BASEBOARD, PROFILE_NONE},
{rmii1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{usb0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{i2c2_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{sgx_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{d_can_init, DEV_ON_BASEBOARD, PROFILE_NONE}, /*add*/
{NULL, 0, 0},
};
/* Beaglebone Rev A3 and after */
static struct evm_dev_cfg beaglebone_dev_cfg[] = {
{am335x_rtc_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{clkout2_enable, DEV_ON_BASEBOARD, PROFILE_NONE},
{tps65217_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{mii1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{usb0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{i2c2_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{sgx_init, DEV_ON_BASEBOARD, PROFILE_NONE},
{d_can_init, DEV_ON_BASEBOARD, PROFILE_NONE}, /*add*/
{NULL, 0, 0},
};
然后将d_can_init函数修改为如下:
static void d_can_init(int evm_id, int profile)
{
switch (evm_id) {
case IND_AUT_MTR_EVM:
setup_pin_mux(d_can_ia_pin_mux);
/* Instance Zero */
am33xx_d_can_init(0);
break;
/*add*/
case BEAGLE_BONE_A3:
case BEAGLE_BONE_OLD:
case GEN_PURP_EVM:
case GEN_PURP_DDR3_EVM:
setup_pin_mux(d_can_gp_pin_mux);
/* Instance One */
am33xx_d_can_init(1);
break;
default:
break;
}
}
PS:这么久没有找到原因是因为上不了google,google果然还是强大的多