Hi all! This is my first post here and I'm newbie in HW, so excuse me if posting in a wrong section.
Short story: Need to provide memory and IRQ resources to the Linux kernel in order to bring up the CAN controller. Have no idea how to get them.
Below is the structure I need to fill in. This structure I have taken for example, this is for the Run-Time Clock, but I need for CAN controller. Both are on the same board, and there are constants for RT Clock (and all other devices), but not for my CAN chip. When looking at the subject chip driver's code (sp_probe() function), I see it needs the same type resources.
struct resource tegra_rtc_resources[] = {
[0] = {
.start = ???,
.end = ???,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = ???,
.end = ???,
.flags = IORESOURCE_IRQ,
},
};
In details: I need to bring up the SJA 1000 CAN controller on the Colibri Evaluation Carrier Board v2.1(with Colibri T20 module inserted into it, which has ARM cpu (NVidia Tegra)). This device relates to "platform" devices and it's initialization should include 2 parts:
1) All "platform" devices are added with their resources from the "board driver" (board-colibri_t20.c)
via the system function platform_add_devices()
. The problem is that it initializes all the devices from Colibri T20 (UART, RTC, I2C, NAND etc...) and NOT the CAN chip which is on Eval Board.
2) there are drivers in Linux kernel source sja1000.c
and sja1000_platform.c
which should be what I need, in addition to "can
" and "can-dev
" drivers. But they can't be started (not even probed), because the kernel doesn't "know" about subject platform device
So, to bring up the drivers, I need to create a "platform_device" structure with the array of "resource" structures inside it with exact numbers of IRQs and memory addresses. I also need to provide Oscillator Clock Frequency, Output Controller Registry and Clock Divider Registry.
There is the controller's datasheet, which could be helpful, but I don't know how exactly to use apply it.
Please help me work out how to use it; which good articles to read for this.