2010-11-16 06:07:37 CAN1 EzKit BF548
Adrian Trüb (SWITZERLAND)
Message: 95876
Hi.
How can I access CAN1 on EzKit BF548?
I found how to configure uClinux kernel and how to use CAN0 on:
docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:can_module&s[]=controller&s[]=area&s[]=network
It works without any problems, but I didn't find any informations about CAN1.
QuoteReplyEditDelete
2010-11-16 06:12:46 Re: CAN1 EzKit BF548
Mike Frysinger (UNITED STATES)
Message: 95877
edit the boards file and add an entry for CAN1 to the platform resources
QuoteReplyEditDelete
2010-11-19 09:22:42 Re: CAN1 EzKit BF548
Adrian Trüb (SWITZERLAND)
Message: 96010
Which board file? ../BF548-EZKIT/device_table.txt?
I tried to create CAN1 with: mknod -m 0666 /dev/can1 c 91 0
instead of adding the entry to device_table, but it doesn't work
QuoteReplyEditDelete
2010-11-19 17:22:34 Re: CAN1 EzKit BF548
Mike Frysinger (UNITED STATES)
Message: 96018
socketcan doesnt use device nodes
the boards file is in the kernel: arch/blackfin/mach-bf548/boards/ezkit.c
QuoteReplyEditDelete
2010-12-13 10:59:46 Re: CAN1 EzKit BF548
Adrian Trüb (SWITZERLAND)
Message: 96670
CAN1 works fine.
I edited the arch/blackfin/mach-bf548/boards/ezkit.c like this:
#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
unsigned short bfin_can0_peripherals[] = {
P_CAN0_RX, P_CAN0_TX, 0
};
static struct resource bfin_can0_resources[] = {
{
.start = 0xFFC02A00,
.end = 0xFFC02FFF,
.flags = IORESOURCE_MEM,
},
{
.start = IRQ_CAN0_RX,
.end = IRQ_CAN0_RX,
.flags = IORESOURCE_IRQ,
},
{
.start = IRQ_CAN0_TX,
.end = IRQ_CAN0_TX,
.flags = IORESOURCE_IRQ,
},
{
.start = IRQ_CAN0_ERROR,
.end = IRQ_CAN0_ERROR,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device bfin_can0_device = {
.name = "bfin_can",
.id = 0,
.num_resources = ARRAY_SIZE(bfin_can0_resources),
.resource = bfin_can0_resources,
.dev = {
.platform_data = &bfin_can0_peripherals, /* Passed to driver */
},
};
unsigned short bfin_can1_peripherals[] = {
P_CAN1_RX, P_CAN1_TX, 0
};
static struct resource bfin_can1_resources[] = {
{
.start = 0xFFC03200,
.end = 0xFFC037FF,
.flags = IORESOURCE_MEM,
},
{
.start = IRQ_CAN1_RX,
.end = IRQ_CAN1_RX,
.flags = IORESOURCE_IRQ,
},
{
.start = IRQ_CAN1_TX,
.end = IRQ_CAN1_TX,
.flags = IORESOURCE_IRQ,
},
{
.start = IRQ_CAN1_ERROR,
.end = IRQ_CAN1_ERROR,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device bfin_can1_device = {
.name = "bfin_can",
.id = 1,
.num_resources = ARRAY_SIZE(bfin_can1_resources),
.resource = bfin_can1_resources,
.dev = {
.platform_data = &bfin_can1_peripherals, /* Passed to driver */
},
};
#endif
And at #if defined(CONFIG_CAN_BFIN) ...:
#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
&bfin_can0_device,
&bfin_can1_device,
#endif