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.

OMAP-L137/da830 ,How to use spi0 for spidev

Other Parts Discussed in Thread: DA8XX

I want to use the spi0 for spidev, but when i modify /arch/arm//mach-da8xx. I can find /dev/spi0.0  ,it can not use  

what i do is this ,but it is wrong ? who can help me and tell me why? thank you

static struct davinci_spi_platform_data da8xx_spi_pdata0 = {
.version = DAVINCI_SPI_VERSION_2,
.num_chipselect = 1,
.clk_name = "SPI0CLK",
//.chip_sel = da8xx_spi0_chip_sel,
};

static struct resource da8xx_spi_resources0[] = {
[0] = {
.start = DA8XX_SPI0_BASE,
.end = DA8XX_SPI0_BASE + 0xfff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_DA8XX_SPINT0,
.end = IRQ_DA8XX_SPINT0,
.flags = IORESOURCE_IRQ,
},
[2] = {
.start = DA8XX_DMACH_SPI0_RX,
.end = DA8XX_DMACH_SPI0_RX,
.flags = IORESOURCE_DMA | IORESOURCE_DMA_RX_CHAN,
},
[3] = {
.start = DA8XX_DMACH_SPI0_TX,
.end = DA8XX_DMACH_SPI0_TX,
.flags = IORESOURCE_DMA | IORESOURCE_DMA_TX_CHAN,
},
[4] = {
.start = EVENTQ_1,
.end = EVENTQ_1,
.flags = IORESOURCE_DMA | IORESOURCE_DMA_EVENT_Q,
},
};

static struct platform_device da8xx_spi_pdev0 = {
.name = "dm_spi",
.id = 0,
.resource = da8xx_spi_resources0,
.num_resources = ARRAY_SIZE(da8xx_spi_resources0),
.dev = {
.platform_data = &da8xx_spi_pdata0,
},
};

static struct spi_board_info da8xx_spi_board_info0[] = {
[0] = {
.modalias = "spidev",
//.platform_data = &w25x64_spi_flash,
//.controller_data = &w25x64_spi_cfg,
.mode = SPI_MODE_0,
.max_speed_hz = 30000000, /* max sample rate at 3V */
.bus_num = 0,
.chip_select = 0,
},

};
/*
* This function registers the SPI master platform device and the SPI slave
* devices with the SPI bus.
*/
static int __init da8xx_spi_register(struct platform_device *pdev,
struct spi_board_info *bi,
unsigned int bi_size)
{
int ret = platform_device_register(pdev);

if (ret)
return ret;

return spi_register_board_info(bi, bi_size);

}

static int __init da8xx_spi_board_init(void)
{

int ret = da8xx_spi_register(&da8xx_spi_pdev0, da8xx_spi_board_info0,
ARRAY_SIZE(da8xx_spi_board_info0));

if (ret)
return ret;
}

static void __exit da8xx_spi_board_exit(void)
{
/* nothing to be done */
}

module_init(da8xx_spi_board_init);
module_exit(da8xx_spi_board_exit);

  • Hi,

    In DA830/OMAPL137 EVM board uses the SPI0 for SPI flash for booting purpose, so you can use SPI1 for SPIDEV testing.

    1) You have to do pinmuxing for SPI1
    2) Register the SPI1 device as a platform device.
    3) Configure the SPI1 as SPIDEV.
    4) Compile the SPIDEV test "C" app for testing. (Linux-source/Documentation/spi/spidev_test.c)

    You have to modify the board file for this.

    arch/arm/mach-davinci/board-da830-evm.c

    static struct spi_board_info da830evm_spi1_info[] = {
    {
    .modalias = "spidev",
    .max_speed_hz = 2500000,
    .bus_num = 1,
    .chip_select = 2,
    .mode = SPI_MODE_1,
    },
    };

    For SPI1
    ret = da8xx_register_spi(1, da830evm_spi1_info,
    ARRAY_SIZE(da830evm_spi1_info));

    For SPI0
    ret = da8xx_register_spi(0, da830evm_spi0_info,
    ARRAY_SIZE(da830evm_spi0_info));


    e2e.ti.com/.../327091

  • I am sorry to trouble you, my problem is that:

    Also in the menuconfig he added support for SPI and Device Drivers ---> SPI support ---> User mode SPI device driver support

    but when i test it using linux+v2.6.32/Documentation/spi/spi_test.c
    "Unable to handle kernel NULL pointer dereference at virtual address 00000010 .... "

    Can you tell me why it become wrong?
  • Hi,
    Have you modified the "spi_test.c" for spidev1.0 node ?
    Did you get "spidev.10." node or some thing like that ?
    Which SPI bus are you using ?
    As I told you, SPI0 bus use the SPI memory and try to use "SPI1" bus.
  •  Thank you for your reply.

    but spi1 is for uart2 for console (hypertrm) , so I can not use spi1. I modified the "spi_test.c" for spidev0.0 node , and get "spidev0.0." node in /dev. My kernel is 2.6.18, it's spi.c is below:

    I want to use spi0 , what can I do?

    Thank you very much!!!

    /*
     * TI DA8xx EVM SPI platform
     *
     * Copyright (C) 2008 Monta Vista Software Inc. <source@mvista.com>
     *
     * Based on: arch/arm/mach-davinci/davinci_spi_platform.c
     * Copyright (C) 2007 Texas Instruments.
     * Copyright (C) 2007 Monta Vista Software Inc.
     *
     * ----------------------------------------------------------------------------
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation; either version 2 of the License, or
     * (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program; if not, write to the Free Software
     * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     * ----------------------------------------------------------------------------
     *
     * This file came directly from spi_platform_init.c.  This file has been
     * generalized to all DaVinci variants.  This file should replace
     * spi_platform_init.c
     *
     */
    #include <linux/config.h>
    #include <linux/device.h>
    #include <linux/module.h>
    #include <linux/kernel.h>
    #include <linux/types.h>
    #include <linux/init.h>
    #include <linux/io.h>
    #include <linux/resource.h>
    #include <linux/spi/spi.h>
    #include <linux/spi/davinci_spi.h>
    #if !defined(CONFIG_MTD_SPI_FLASH) && !defined(CONFIG_MTD_SPI_FLASH_MODULE)
    #include <asm/arch/gpio.h>
    #include <linux/spi/ads7846.h>
    #endif
    #include <linux/spi/flash.h>
    #include <linux/device.h>
    #include <linux/mtd/mtd.h>
    #include <linux/mtd/partitions.h>
    #include <linux/platform_device.h>
    #include <linux/spi/davinci_spi_master.h>
    #include <linux/spi/at25xxA_eeprom.h>
    #include <linux/spi/mtd_spi_flash.h>
    
    #include <asm/arch/hardware.h>
    #include <asm/arch/cpu.h>
    
    static struct davinci_spi_platform_data da8xx_spi_pdata0 = {
    	.version = DAVINCI_SPI_VERSION_2,
    	.num_chipselect = 1,
    	.clk_name = "SPI0CLK",
    };
    
    static struct resource da8xx_spi_resources0[] = {
    	[0] = {
    		.start = DA8XX_SPI0_BASE,
    		.end = DA8XX_SPI0_BASE + 0xfff,
    		.flags = IORESOURCE_MEM,
    	},
    	[1] = {
    		.start = IRQ_DA8XX_SPINT0,
    		.end = IRQ_DA8XX_SPINT0,
    		.flags = IORESOURCE_IRQ,
    	},
    	[2] = {
    		.start = DA8XX_DMACH_SPI0_RX,
    		.end = DA8XX_DMACH_SPI0_RX,
    		.flags = IORESOURCE_DMA | IORESOURCE_DMA_RX_CHAN,
    	},
    	[3] = {
    		.start = DA8XX_DMACH_SPI0_TX,
    		.end = DA8XX_DMACH_SPI0_TX,
    		.flags = IORESOURCE_DMA | IORESOURCE_DMA_TX_CHAN,
    	},
    	[4] = {
    		.start = EVENTQ_1,
    		.end = EVENTQ_1,
    		.flags = IORESOURCE_DMA | IORESOURCE_DMA_EVENT_Q,
    	},
    };
    
    static struct platform_device da8xx_spi_pdev0 = {
    	.name = "dm_spi",
    	.id = 0,
    	.resource = da8xx_spi_resources0,
    	.num_resources = ARRAY_SIZE(da8xx_spi_resources0),
    	.dev = {
    		.platform_data = &da8xx_spi_pdata0,
    	},
    };
    
    
    static u8 da8xx_spi1_chip_sel[] = {
    	DAVINCI_SPI_INTERN_CS, DAVINCI_SPI_INTERN_CS, 58,
    };
    
    static struct davinci_spi_platform_data da8xx_spi_pdata1 = {
    	.version = DAVINCI_SPI_VERSION_2,
    	.num_chipselect = 3,
    	.clk_name = "SPI1CLK",
    	.chip_sel = da8xx_spi1_chip_sel,
    };
    
    static struct resource da8xx_spi_resources1[] = {
    	[0] = {
    		.start = DA8XX_SPI1_BASE,
    		.end = DA8XX_SPI1_BASE + 0xfff,
    		.flags = IORESOURCE_MEM,
    	},
    	[1] = {
    		.start = IRQ_DA8XX_SPINT1,
    		.end = IRQ_DA8XX_SPINT1,
    		.flags = IORESOURCE_IRQ,
    	},
    	[2] = {
    		.start = DA8XX_DMACH_SPI1_RX,
    		.end = DA8XX_DMACH_SPI1_RX,
    		.flags = IORESOURCE_DMA | IORESOURCE_DMA_RX_CHAN,
    	},
    	[3] = {
    		.start = DA8XX_DMACH_SPI1_TX,
    		.end = DA8XX_DMACH_SPI1_TX,
    		.flags = IORESOURCE_DMA | IORESOURCE_DMA_TX_CHAN,
    	},
    	[4] = {
    		.start = EVENTQ_1,
    		.end = EVENTQ_1,
    		.flags = IORESOURCE_DMA | IORESOURCE_DMA_EVENT_Q,
    	},
    };
    
    static struct platform_device da8xx_spi_pdev1 = {
    	.name = "dm_spi",
    	.id = 1,
    	.resource = da8xx_spi_resources1,
    	.num_resources = ARRAY_SIZE(da8xx_spi_resources1),
    	.dev = {
    		.platform_data = &da8xx_spi_pdata1,
    	},
    };
    
    #if defined(CONFIG_MTD_SPI_FLASH) || defined(CONFIG_MTD_SPI_FLASH_MODULE)
    static struct mtd_partition flash_partitions[] = {
    	[0] = {
    		.name = "U-Boot",
    		.offset = 0,
    		.size = SZ_256K,
    		.mask_flags = MTD_WRITEABLE,
    	},
    	[1] = {
    		.name = "U-Boot Environment",
    		.offset = MTDPART_OFS_APPEND,
    		.size = SZ_16K,
    		.mask_flags = MTD_WRITEABLE,
    	},
    	[2] = {
    		.name = "Linux",
    		.offset = MTDPART_OFS_NXTBLK,
    		.size = MTDPART_SIZ_FULL,
    		.mask_flags = 0,
    	},
    };
    
    struct davinci_spi_config_t w25x64_spi_cfg = {
    	.wdelay		= 0,
    	.odd_parity	= 0,
    	.parity_enable	= 0,
    	.wait_enable	= 0,
    	.lsb_first	= 0,
    	.timer_disable	= 0,
    	.clk_high	= 0,
    	.phase_in	= 1,
    	.clk_internal	= 1,
    	.loop_back	= 0,
    	.cs_hold	= 1,
    	.intr_level	= 0,
    	.pin_op_modes	= SPI_OPMODE_SPISCS_4PIN,
    #ifndef CONFIG_SPI_INTERRUPT
    	.poll_mode	= 1,
    #endif
    };
    
    struct mtd_spi_flash_info w25x64_spi_flash = {
    	.name = "Windbond spi nand flash",
    	.chip_sel = SCS0_SELECT,
    	.parts = flash_partitions,
    	.nr_parts = ARRAY_SIZE(flash_partitions),
    };
    
    #else
    
    /* =============================================================================
     * Touchscreen
     *
     * The TSC2046 is a next-generation version to the ADS7846 4-wire touch screen
     * controller. The TSC2046 is 100% pin-compatible with the existing ADS7846,
     * drops into the same socket.
     *
     * Hence, ads7846 driver is used for touchscreen.
     * =============================================================================
     */
     #define TS_GPIO_BANK     5
    #define TS_GPIO                (5 * 16 + 3)
    
    extern int twl4030_vaux1_ldo_use(void);
    extern int twl4030_vaux1_ldo_unuse(void);
    
    extern int twl4030_vaux3_ldo_use(void);
    extern int twl4030_vaux3_ldo_unuse(void);
    
    static void ads7846_dev_init(void)
    {
    	if (gpio_request(TS_GPIO,NULL) < 0)
    		printk(KERN_ERR "can't get ads746 pen down GPIO\n");
    
    	//omap_set_gpio_direction(TS_GPIO, 1);
    	gpio_direction_input(TS_GPIO);
    
    	//omap_set_gpio_debounce(TS_GPIO, 1);
    	//omap_set_gpio_debounce_time(TS_GPIO, 0xa);
    }
    
    static int ads7846_get_pendown_state(void)
    {
    	//return !omap_get_gpio_datain(TS_GPIO);
    	return  !gpio_get_value(TS_GPIO);
    }
    
    /**
     * ads7846_vaux_control: Enable or disable the voltage for touchscreen.
     * @vaux_cntrl: Either of VAUX_ENABLE or VAUX_DISABLE
     */
    static int ads7846_vaux_control(int vaux_cntrl)
    {
    	int ret = 0;
    
    #if defined (CONFIG_TWL4030_POWER)
    	if (vaux_cntrl == VAUX_ENABLE)
    		ret = twl4030_vaux3_ldo_use();
    	else if (vaux_cntrl == VAUX_DISABLE)
    		ret = twl4030_vaux3_ldo_unuse();
    #endif
    
    	return ret;
    }
    
    struct ads7846_platform_data tsc2046_config = {
    	.x_max			= 0x0fff,
    	.y_max			= 0x0fff,
    	.x_plate_ohms		= 180,
    	.pressure_max		= 255,
    	.debounce_max		= 10,
    	.debounce_tol		= 3,
    	.debounce_rep		= 1,
    	.get_pendown_state	= ads7846_get_pendown_state,
    	.keep_vref_on		= 1,
    	.vaux_control		= ads7846_vaux_control,
    	.settle_delay_usecs	= 150,
    };
    
    struct davinci_spi_config_t tsc2046_spi_cfg = {
    	.wdelay		= 0,
    	.odd_parity	= 0,
    	.parity_enable	= 0,
    	.wait_enable	= 0,
    	.lsb_first	= 0,
    	.timer_disable	= 0,
    	.clk_high	= 0,
    	.phase_in	= 1,
    	.clk_internal	= 1,
    	.loop_back	= 0,
    	.cs_hold	= 1,
    	.intr_level	= 0,
    	.pin_op_modes	= SPI_OPMODE_SPISCS_4PIN,
    #ifndef CONFIG_SPI_INTERRUPT
    	.poll_mode	= 1,
    #endif
    };
    
    #define OMAP_GPIO_IRQ(nr)	(GPIO_IRQ_BASE + (nr))
    #endif
    
    static struct spi_board_info da8xx_spi_board_info0[] = {
    #if defined(CONFIG_MTD_SPI_FLASH) || defined(CONFIG_MTD_SPI_FLASH_MODULE)
    	[0] = {
    		.modalias = MTD_SPI_FLASH_NAME,
    		.platform_data = &w25x64_spi_flash,
    		.controller_data = &w25x64_spi_cfg,
    		.mode = SPI_MODE_0,
    		.max_speed_hz = 30000000,	/* max sample rate at 3V */
    		.bus_num = 0,
    		.chip_select = 0,
    	},
    #else
    	[0] = {
    		/* TSC2046 operates at a max freqency of 2MHz, so
    		 * operate slightly below at 1.5MHz
    		 */
    		.modalias	= "ads7846",
    		.platform_data	= &tsc2046_config,
    		.controller_data= &tsc2046_spi_cfg,
    		.mode = SPI_MODE_0,
    		.max_speed_hz	= 1500000,
    		.bus_num	= 0,
    		.chip_select	= 0,
    		.irq		= OMAP_GPIO_IRQ(TS_GPIO),
    	},
    #endif
    };
    
    static int ak4588_place_holder;
    
    struct davinci_spi_config_t ak4588_spi_cfg = {
    	.wdelay		= 0,
    	.odd_parity	= 0,
    	.parity_enable	= 0,
    	.wait_enable	= 0,
    	.lsb_first	= 0,
    	.timer_disable	= 0,
    	.clk_high	= 0,
    	.phase_in	= 1,
    	.clk_internal	= 1,
    	.loop_back	= 0,
    	.cs_hold	= 1,
    	.intr_level	= 0,
    	.pin_op_modes	= SPI_OPMODE_SPISCS_4PIN,
    #ifndef CONFIG_SPI_INTERRUPT
    	.poll_mode	= 1,
    #endif
    };
    
    static struct spi_board_info da8xx_spi_board_info1[] = {
    	[0] = {
    		.modalias = "AK4588 audio codec",
    		.platform_data = &ak4588_place_holder,
    		.controller_data = &ak4588_spi_cfg,
    		.mode = SPI_MODE_0,
    		.max_speed_hz = 2000000,	/* max sample rate at 3V */
    		.bus_num = 1,
    		.chip_select = 2,
    	},
    };
    
    /*
     * This function registers the SPI master platform device and the SPI slave
     * devices with the SPI bus.
     */
    static int __init da8xx_spi_register(struct platform_device *pdev,
    				     struct spi_board_info *bi,
    				     unsigned int bi_size)
    {
    	int ret = platform_device_register(pdev);
    
    	if (ret)
    		return ret;
    
    	return spi_register_board_info(bi, bi_size);
    
    }
    
    static int __init da8xx_spi_board_init(void)
    {
          ads7846_dev_init();
    	  
    	int ret = da8xx_spi_register(&da8xx_spi_pdev0, da8xx_spi_board_info0,
    				     ARRAY_SIZE(da8xx_spi_board_info0));
    
    	if (ret)
    		return ret;
    
    	return da8xx_spi_register(&da8xx_spi_pdev1, da8xx_spi_board_info1,
    				  ARRAY_SIZE(da8xx_spi_board_info1));
    }
    
    static void __exit da8xx_spi_board_exit(void)
    {
    	/* nothing to be done */
    }
    
    module_init(da8xx_spi_board_init);
    module_exit(da8xx_spi_board_exit);
    

  • If I use spi1, I can not use Uart2, my console is Uart2 ,so , spi0 is the only choice. so how can I modify spi0. if spi0 can not use. Thank you very much.
  • Why do you want to test SPIDEV ?

    Any intention ?

    If you want to test, then boot your board through NFS (need to avoid SPI0 boot) then test SPI0 for SPIDEV test.

    You may need to comment out the SPI0 init for SPI memory flash and enable it for SPIDEV.
  • Happy for your reply. Thank you.
    Now I boot my board through nandflash, not spi flash . I want to use spidev to inter-communicate with a SoC chip.
    but if I cant use spi0, UART1 can be used, but UART1 is not useful in the kernel. so spi0 and UART1 is the select. but all they two can not work .


    now ,I am very vey nervous.

    if spi0 donot work,How to modify UART1 and make it work? Thank you very much.
  • Hi,
    Are you using custom board ?
    Yes, you can make it work SPI0 if you boot the board from NAND flash.
    Could you attach your board file here. (please don't paste as text)
  • Thank you for your reply. all my board file is in the mach-da8xx.rar.
    Can you guide me to modify the spi0 and UART1?
    thank you very much!!
  • in the board-evm.c between "////////////////"is my change
  • Your board file and SPI0 configurations seems good.
    Could you attach the complete boot up log.

    [quote]
    but when i test it using linux+v2.6.32/Documentation/spi/spi_test.c
    "Unable to handle kernel NULL pointer dereference at virtual address 00000010 .... "
    [\quote]
    Share the log when you get "unable to handle" error.

    When you test this code (spi_test.c) you have to short the SPI0_MOSI and SPI0_MISO pins for loop back.
    Able to see any toggling (signal transition) on SPI0 bus say SPI0 CLK, SOMI and SIMO pins through CRO ?
  • Also please make sure that you have disabled "EQEP" support because it is muxed with SPI0.

    devices.c

    static struct platform_device *da8xx_devices[DA8XX_PDEV_COUNT] __initdata = {
    
    [DA8XX_PDEV_SERIAL] = &da8xx_serial_device,
    
    [DA8XX_PDEV_I2C_0] = &da8xx_i2c_device0,
    
    [DA8XX_PDEV_I2C_1] = &da8xx_i2c_device1,
    
    [DA8XX_PDEV_WATCHDOG] = &da8xx_watchdog_device,
    
    [DA8XX_PDEV_USB_20] = &da8xx_usb20_device,
    
    [DA8XX_PDEV_USB_11] = &da8xx_usb11_device,
    
    [DA8XX_PDEV_EMAC] = &da8xx_emac_device,
    
    [DA8XX_PDEV_MMC] = &da8xx_mmc_device,
    
    [DA8XX_PDEV_RTC] = &da8xx_rtc_device,
    /* Titus : EQEP support has been disabled for SPI0 support */
    
    /* [DA8XX_PDEV_EQEP_0] = &da8xx_eqep_device0, */
    
    /* [DA8XX_PDEV_EQEP_1] = &da8xx_eqep_device1, */
    
    [DA8XX_PDEV_LCDC] = &da8xx_lcdc_device,
    
    };

    http://processors.wiki.ti.com/index.php/Omapl137_linux_eqep_driver#Driver_Configuration

  • ICETEK-OMAPL137-KB21原理图.pdf

    bootup log.txt
    
    U-Boot 1.3.3 (Jul 25 2009 - 13:05:00)
    
    I2C:   ready
    DRAM:  64 MB
    NAND:  NAND Manufacturer id: 20
    NAND Device id: 76
    NAND device: Manufacturer ID: 0x20, Chip ID: 0x76 (ST Micro NAND 64MiB 3,3V 8-bi
    t)
    Bad block table found at page 131040, version 0x00
    Bad block table found at page 131008, version 0x00
    nand_read_bbt: Bad block at 0x00004000
    nand_read_bbt: Bad block at 0x00008000
    nand_read_bbt: Bad block at 0x0000c000
    nand_read_bbt: Bad block at 0x00010000
    nand_read_bbt: Bad block at 0x00014000
    nand_read_bbt: Bad block at 0x00018000
    nand_read_bbt: Bad block at 0x0001c000
    nand_read_bbt: Bad block at 0x00020000
    nand_read_bbt: Bad block at 0x00024000
    nand_read_bbt: Bad block at 0x00028000
    nand_read_bbt: Bad block at 0x0002c000
    nand_read_bbt: Bad block at 0x00030000
    nand_read_bbt: Bad block at 0x00034000
    nand_read_bbt: Bad block at 0x00038000
    nand_read_bbt: Bad block at 0x0003c000
    64 MiB
    In:    serial
    Out:   serial
    Err:   serial
    ARM Clock : 300000000 Hz
    
    EEPROM @ 0x50 read FAILED!!!
    Ethernet switch start failed!
    No ETH PHY detected!!!
    Error: Ethernet init failed!
    Hit any key to stop autoboot:  0
    
    NAND read: device 0 offset 0x600000, size 0x300000
    
    Reading data from 0x8ffe00 -- 100% complete.
     3145728 bytes read: OK
    
    Loading from NAND 64MiB 3,3V 8-bit, offset 0x200000
       Image Name:   Linux-2.6.18_pro500-da830_omapl1
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    1815804 Bytes =  1.7 MB
       Load Address: c0008000
       Entry Point:  c0008000
    ## Booting kernel from Legacy Image at c0700000 ...
       Image Name:   Linux-2.6.18_pro500-da830_omapl1
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    1815804 Bytes =  1.7 MB
       Load Address: c0008000
       Entry Point:  c0008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK
    
    Starting kernel ...
    
    Uncompressing Linux.............................................................
    ............................................................ done, booting the k
    ernel.
    Linux version 2.6.18_pro500-da830_omapl137_evm-arm_v5t_le (realtimedsp@realtimed
    sp-laptop) (gcc 版本 4.2.0 (MontaVista 4.2.0-16.0.32.0801914 2008-08-30)) #1 P
    REEMPT Wed Jan 28 21:23:52 CST 2015
    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
    Machine: DaVinci DA8XX EVM
    Memory policy: ECC disabled, Data cache writethrough
    DA830 variant 0x9
    CPU0: D VIVT write-back cache
    CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
    CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
    Built 1 zonelists.  Total pages: 8192
    Kernel command line: mem=32M console=ttyS2,115200n8 root=/dev/ram0 rw initrd=0xc
    1180000,4M ip=off
    PID hash table entries: 256 (order: 8, 1024 bytes)
    Clock event device timer0_0 configured with caps set: 07
    Console: colour dummy device 80x30
    Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
    Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
    Memory: 32MB = 32MB total
    Memory: 24396KB available (3112K code, 634K data, 176K init)
    Security Framework v1.0.0 initialized
    Capability LSM initialized
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
    Freeing initrd memory: 4096K
    NET: Registered protocol family 16
    DaVinci: 128 gpio irqs
    Generic PHY: Registered new driver
    usbcore: registered new driver usbfs
    usbcore: registered new driver hub
    NET: Registered protocol family 2
    IP route cache hash table entries: 256 (order: -2, 1024 bytes)
    TCP established hash table entries: 1024 (order: 0, 4096 bytes)
    TCP bind hash table entries: 512 (order: -1, 2048 bytes)
    TCP: Hash tables configured (established 1024 bind 512)
    TCP reno registered
    NetWinder Floating Point Emulator V0.97 (double precision)
    VFS: Disk quotas dquot_6.5.1
    Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    squashfs: version 3.1 (2006/08/19) Phillip Lougher
    JFFS version 1.0, (C) 1999, 2000  Axis Communications AB
    JFFS2 version 2.2. (NAND) (SUMMARY)  (C) 2001-2006 Red Hat, Inc.
    yaffs Jan 28 2015 21:19:59 Installing.
    SGI XFS with no debug enabled
    Initializing Cryptographic API
    io scheduler noop registered
    io scheduler anticipatory registered (default)
    LTT : ltt-facilities init
    LTT : ltt-facility-core init in kernel
    DAVINCI-WDT: DaVinci Watchdog Timer: heartbeat 60 sec
    Serial: 8250/16550 driver $Revision: 1.90 $ 3 ports, IRQ sharing disabled
    serial8250.0: ttyS0 at MMIO map 0x1c42000 mem 0xfec42000 (irq = 25) is a 16550A
    serial8250.0: ttyS1 at MMIO map 0x1c20400 mem 0xfed0c000 (irq = 53) is a 16550A
    serial8250.0: ttyS2 at MMIO map 0x1d0d000 mem 0xfed0d000 (irq = 61) is a 16550A
    RAMDISK driver initialized: 1 RAM disks of 32768K size 1024 blocksize
    Davinci EMAC MII Bus: probed
    MAC address is 02:00:10:00:00:00
    TI DaVinci EMAC Linux version updated 4.0
    i2c /dev entries driver
    dm_spi.0: davinci SPI Controller driver at 0xc285c000 (irq = 20) use_dma=1
    Pin NSPI1_ENA already used for UART2_RXD.
    dm_spi.1: davinci SPI Controller driver at 0xc285e000 (irq = 56) use_dma=1
    ohci ohci.0: DA8xx OHCI
    ohci ohci.0: new USB bus registered, assigned bus number 1
    Waiting for USB PHY clock good...
    ohci ohci.0: irq 59, io mem 0x01e25000
    usb usb1: configuration #1 chosen from 1 choice
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    usbcore: registered new driver libusual
    musb_hdrc: version 6.0, cppi4.1-dma, host, debug=0
    Waiting for USB PHY clock good...
    musb_hdrc: USB Host mode controller at c2860000 using DMA, IRQ 58
    musb_hdrc musb_hdrc: MUSB HDRC host driver
    musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 2
    usb usb2: configuration #1 chosen from 1 choice
    hub 2-0:1.0: USB hub found
    hub 2-0:1.0: 1 port detected
    mice: PS/2 mouse device common for all mice
    rtc-da8xx rtc-da8xx.0: rtc intf: proc
    rtc-da8xx rtc-da8xx.0: rtc intf: dev (254:0)
    rtc-da8xx rtc-da8xx.0: rtc core: registered rtc-da8xx as rtc0
    rtc-da8xx rtc-da8xx.0: TI DA8xx Real Time Clock driver.
    davinci-mmc davinci-mmc.0: Supporting 8-bit mode
    davinci-mmc davinci-mmc.0: Supporting 4-bit mode
    davinci-mmc davinci-mmc.0: Using DMA mode
    Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50
    2006 UTC).
    ASoC version 0.13.1
    AIC3X Audio Codec 0.2
    ALSA device list:
      No soundcards found.
    IPv4 over IPv4 tunneling driver
    TCP bic registered
    NET: Registered protocol family 1
    NET: Registered protocol family 17
    rtc-da8xx rtc-da8xx.0: setting the system clock to 2000-01-01 00:00:00 (94668480
    0)
    Time: timer0_1 clocksource has been installed.
    Clock event device timer0_0 configured with caps set: 08
    Switched to high resolution mode on CPU 0
    RAMDISK: Compressed image found at block 0
    VFS: Mounted root (ext2 filesystem).
    Freeing init memory: 176K
    INIT: version 2.86 booting
    Starting the hotplug events dispatcher: udevd.
    Synthesizing the initial hotplug events...done.
    Waiting for /dev to be fully populated...done.
    Activating swap...done.
    Remounting root filesystem...done.
    Mounting local filesystems: mount none on /var/run type tmpfs (rw)
    none on /tmp type tmpfs (rw)
    Setting up networking ....
    Starting hotplug subsystem:
       pci
       pci      [success]
       usb
       usb      [success]
       isapnp
       isapnp   [success]
       ide
       ide      [success]
       input
       input    [success]
       scsi
       scsi     [success]
    done.
    Starting portmap daemon....
    INIT: Entering runlevel: 3
    Starting internet superserver: inetd.
    
    MontaVista(R) Linux(R) Professional Edition 5.0.0 (0801921)
    
    (none) login: root
    
    
    Welcome to MontaVista(R) Linux(R) Professional Edition 5.0.0 (0801921).
    
    login[542]: root login on 'console'
    # cd ..
    # ls
    bin          g_serial.ko  linuxrc      proc         spidev_test  usr
    dev          init         lost+found   root         sys          var
    etc          lib          mnt          sbin         tmp
    # cd dev
    # ls
    MAKEDEV         loop            rtc0            usbdev1.1_ep00
    bus             mem             shm             usbdev1.1_ep81
    console         net             snd             usbdev2.1_ep00
    core            null            sndstat         usbdev2.1_ep81
    fd              port            spidev0.0       vc
    full            ppp             stderr          vcc
    i2c             ptmx            stdin           watchdog
    initctl         pts             stdout          zero
    input           random          tts
    kmem            rd              tty
    kmsg            rtc             urandom
    # cd ..
    # ls
    bin          g_serial.ko  linuxrc      proc         spidev_test  usr
    dev          init         lost+found   root         sys          var
    etc          lib          mnt          sbin         tmp
    # ./spidee
    -sh: ./spidee: not found
    # ./spidev_test
    Unable to handle kernel NULL pointer dereference at virtual address 00000010
    spi mode: 0
    bitpgd = c0004000
    s per word: 8
    m[00000010] *pgd=00000000ax speed: 500000
     Hz (500 KHz)
    Internal error: Oops: 17 [#1]
    Modules linked in:
    CPU: 0
    PC is at davinci_spi_bufs_prep+0xc/0x47c
    LR is at davinci_spi_bufs_dma+0xec/0x49c
    pc : [<c021ef70>]    lr : [<c0220258>]    Not tainted
    sp : c1187ea0  ip : c1187eb0  fp : c1187eac
    r10: c1186000  r9 : c16cb200  r8 : c1192260
    r7 : c16cb4a0  r6 : c16a4760  r5 : c03493a0  r4 : 00000000
    r3 : 00000008  r2 : 00000000  r1 : c16cb4a0  r0 : c16cb200
    Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  Segment kernel
    Control: 5317F
    Table: C05F0000  DAC: 00000017
    Process dm_spi.0 (pid: 180, stack limit = 0xc1186258)
    Stack: (0xc1187ea0 to 0xc1188000)
    7ea0: c1187efc c1187eb0 c0220258 c021ef74 00000000 c1187f56 c16cb200 00000001
    7ec0: 00000001 ffffffff c1187f24 01c41000 c1187efc c1192260 00000000 c0521ecc
    7ee0: c021f5b0 c16cb4a0 c16cb200 c1186000 c1187f34 c1187f00 c021eb28 c022017c
    7f00: c16cb4d4 00000000 c1187f54 20000013 c16a4720 c1186000 c16cb4a4 00000000
    7f20: c021e9a4 c16cb4a0 c1187f6c c1187f38 c0063068 c021e9b4 c16a4738 c16a4728
    7f40: 00000002 00000000 c16a4728 c1186000 c16a4720 c16a4730 00000002 c1187f84
    7f60: c1187fcc c1187f70 c0063870 c0062f98 00000001 00000000 00000000 00010000
    7f80: 00000000 00000000 c15066c0 c004b468 00100100 00200200 ffffffff ffffffff
    7fa0: 00000000 c16a4720 c1186000 c0063768 c0443dd8 00000000 00000000 00000000
    7fc0: c1187ff4 c1187fd0 c0066858 c0063778 ffffffff ffffffff 00000000 00000000
    7fe0: 00000000 00000000 00000000 c1187ff8 c00531e0 c0066780 bc7f1dc5 6f3d9573
    Backtrace:
    [<c021ef64>] (davinci_spi_bufs_prep+0x0/0x47c) from [<c0220258>] (davinci_spi_bu
    fs_dma+0xec/0x49c)
    [<c022016c>] (davinci_spi_bufs_dma+0x0/0x49c) from [<c021eb28>] (bitbang_work+0x
    184/0x2d8)
    [<c021e9a4>] (bitbang_work+0x0/0x2d8) from [<c0063068>] (run_workqueue+0xe0/0x17
    0)
    [<c0062f88>] (run_workqueue+0x0/0x170) from [<c0063870>] (worker_thread+0x108/0x
    144)
    [<c0063768>] (worker_thread+0x0/0x144) from [<c0066858>] (kthread+0xe8/0x128)
    [<c0066770>] (kthread+0x0/0x128) from [<c00531e0>] (do_exit+0x0/0xa24)
     r7 = 00000000  r6 = 00000000  r5 = 00000000  r4 = 00000000
    Code: e89da800 e1a0c00d e92dd800 e24cb004 (e5923010)
     

    sorry to trouble you again.

    I had done it fellow you,but something maybe is also wrong. 

    the question is also no answer.

    the boot up log and the Schematic Diagramis in below:

    thank you again.