This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

resources for the CAN controller

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.

  • We feel honored you are asking us to answer questions for products not manufactured by TI, but unfortunately we are not experts on these competitor CAN controller or ARM CPUs.  If you are interested in TI solutions to these types of problems you should consider the OMAP and Sitara (AM335x) processor familes with options for onboard CAN controllers within the uP and s/w libraries provided by TI.

    -- Scott

  • Thanks for answer. I understand this is unrelated to TI.

    But I'm looking  for an answer just in general "How to get resources for an onboard device". I've heard here is a lot of hardware people, so I hope on some help.