tiny6410 spi

Kuzj
I have wireless RF Transceiver Module 433Mhz CC1101 with spi interface. How
use this module with tiny6410? Please help me!

Kuzj
I tried to do the following with kernel linux-2.6.38:
in kernel config enable:
Device Drivers\SPI support\Samsung S3c64XX series type SPI
Device Drivers\SPI support\User mode SPI device driver support

in: 
arch/arm/mach-s3c64xx/Kconfig
add:(otherwise dev-spi.c don`t compiling)
config S3C64XX_DEV_SPI
        bool
        default y
        help
          Setup spi bus.

in:
arch/arm/mach-s3c64xx/mach-mini6410.c
add:
#include <plat/s3c64xx-spi.h>
#include <linux/spi/spi.h>


static void mini6410_set_cs(unsigned line, int cs) {
        unsigned int pin;
        int change = 1;

        switch (line)
        {
        case 0:
                pin = S3C64XX_GPC(7);
                break;
        default:
                printk(KERN_ERR "mini6410_set_cs, unknown line %d\n",
line);
                change = 0;
                break;
        }
        if(change)
        {
                //gpio_request(pin, "temporary");
                gpio_set_value(pin, cs);
                //gpio_free(pin);
        }
};


static int cc1101_ioSetup(struct spi_device *spi)
{
        printk(KERN_INFO "cc1101: setup gpio pins CS and External Int\n");
        s3c_gpio_setpull(S3C64XX_GPL(8), S3C_GPIO_PULL_UP);
        s3c_gpio_cfgpin(S3C64XX_GPL(8), S3C_GPIO_SFN(3));
        s3c_gpio_setpull(S3C64XX_GPC(7), S3C_GPIO_PULL_NONE);
        s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C_GPIO_OUTPUT);
        return 0;
}

static struct s3c64xx_spi_csinfo cc1101_cs_info[] = {
        {
                .fb_delay       = 0x3, // 9ns feedback delay for cs line
                .line           = 0,
                .set_level      = mini6410_set_cs,
        },
};

struct cc1101_platform_data {
        int (*board_specific_setup)(struct spi_device *spi);
};

static struct cc1101_platform_data cc1101_info = {
        .board_specific_setup           = cc1101_ioSetup,
};

static struct spi_board_info mini6410_spi_board_info[] __initdata = {
        {
                .modalias         = "cc1101",
                .platform_data    = &cc1101_info,
                .controller_data  = &cc1101_cs_info,
                .max_speed_hz     = 2*1000*1000,
                .irq              = IRQ_EINT(16),
                .chip_select      = 0,
                .bus_num          = 1,
                .mode             = SPI_MODE_0,
        },
};


in: 
"static struct platform_device *mini6410_devices[] __initdata = {"
add: 
&s3c64xx_device_spi1,

in:
"static void __init mini6410_machine_init(void)"
add:
printk(KERN_INFO "MINI6410: SPI ID %i\n",
spi_register_board_info(mini6410_spi_board_info,
ARRAY_SIZE(mini6410_spi_board_info)));
s3c64xx_spi_set_info(1,0,1);

--------------------------------------------------

After running system I get:

user@fa:~$ dmesg | grep spi
spi-bus: source is mout_epll (0), rate is 24000000
spi-bus: source is mout_epll (0), rate is 24000000

user@fa:~$ dmesg | grep SPI
MINI6410: SPI ID 0

user@fa:~$ find /sys -name '*spi*'
/sys/devices/platform/s3c64xx-spi.1
/sys/devices/platform/s3c64xx-spi.1/spi_master
/sys/devices/platform/s3c64xx-spi.1/spi_master/spi1
/sys/devices/platform/s3c64xx-spi.1/spi1.0
/sys/bus/platform/devices/s3c64xx-spi.1
/sys/bus/platform/drivers/s3c64xx-spi
/sys/bus/platform/drivers/s3c64xx-spi/s3c64xx-spi.1
/sys/bus/spi
/sys/bus/spi/devices/spi1.0
/sys/bus/spi/drivers/spidev
/sys/class/spi_master
/sys/class/spi_master/spi1
/sys/class/spidev
/sys/module/spidev

But in /dev nothing with spi
Somebody, please help.

davef
For the mini2440 I also made this change in my kernel config:

Device Drivers
-> SPI support
SPI Master Controller Drivers
 -> Samsung S3C24XX series SPI
            SPI Protocol Masters
 -> User mode SPI device driver support

Do you need to do something similar for the mini6410?

Kuzj
Thanks for the reply, but i already done this:
I enable in kernel config:
Device Drivers\SPI support\Samsung S3c64XX series type SPI
Device Drivers\SPI support\User mode SPI device driver support.
You talk about it?

davef
Sorry, I have no specific experience on the mini6410.  With help I wrote a
SPI driver for the mini2440, however you appear to have more experience
than I do.

Another idea: I thought udev made the /dev/spi* nodes from information in
/sys/class/

Good luck.

davef
Sorry, I did not notice that you had already done the kernel modification
:(

Google for <udev spi>  I am trying to find which udev file it is suppose to
be in.

davef
Well, I can't find anything in my /lib/udev/rules.d files with spi* in it.

Does dmesg have anything to say?

Kuzj
I found it very similar to what we need. I can check tomorrow.
http://blog.csdn.net/zhanglongtumi/article/details/9049077

davef
Good.

One last one :
https://www.kernel.org/doc/Documentation/spi/spidev
Device creation Driver binding

Good night.