Hello Andreas,
I am using the Linux version 2.6.25 with the new dspi driver.
I am sure the hardware is OK, because we are also using VxWorks in the same board and the DSPI devices works perfectly. Moreover I can see the signals through the oscilloscope (chip select, clock).
I added my configuration board in the arch/asm-m68k/coldfire/m547x_8x-devices.c file:
static struct coldfire_dspi_chip hua_chip_info = {
.bits_per_word = 8,
.mode = SPI_MODE_3,
};
static struct spi_board_info spi_board_info[] = {
{
.modalias = "ds3234",
.bus_num = 1,
.chip_select = 0,
.controller_data = &hua_chip_info,
.max_speed_hz = 100000,
},
{
.modalias = "fram",
.bus_num = 1,
.chip_select = 2,
.controller_data = &hua_chip_info,
.platform_data = &fram_data,
}
};
I initialized the dspi registers in the function m547x_8x_spi_init of the same file: GPIO_PAR_DSPI, DSPI_DSR, DSPI_DCMR, DSPI_DRSER.
Then I have a file for the RTC device (ds3234.c, I adapted this driver from the kernel 2.6.28) and a file for the FRAM (based on an EEPROM, although with lots of changes).
Currently I can see the both devices on /sys, so I guess they are correctly attached. Problems:
- RTC: it is possible I have a speed and configuration problem. I enabled the debug messages and when I read the date and time the status and configuration registers always read 0xff. However if I turn down the speed (through the br and pbr fileds of the coldfire_dspi_chip structure), the status and configuration register seem OK, but the driver hangs the kernel after the function dspi_setup_chip.
- FRAM: I have a "fram" file that I use as the file to read and write the memory. When I try to read the file, the kernel crashes.
Maybe I am forgetting doing something regarding the configuration that I did not know I had to do. Please, correct me if you detect something wrong or weird.
Thanks for your help!
Raúl