[ELDK] how to test SPI on TX25

Hu Kai hukai at venture.com.sg
Thu Jan 7 11:41:10 CET 2010


Hi,

It does not work at all.

Here is my BSP code for AD7879 and spidev.
static struct spi_board_info tx25_spi_board_info[] __initdata = {
	{
		.modalias = "ad7879",
		.platform_data = &ad7879_ts_info,
		.irq = MXC_INT_CSPI1,
		.max_speed_hz = 5000000,     /* max spi clock (SCK) speed in
HZ */
		.bus_num = 0,
		.chip_select = 0,
//		.controller_data = &spi_ad7879_chip_info,
		.mode = SPI_MODE_0,//SPI_CPHA | SPI_CPOL,
	},
	{
		.modalias = "spidev",
		.max_speed_hz = 5000000,     /* max spi clock (SCK) speed in
HZ */
		.bus_num = 0,
		.chip_select = 1,
	},
};

When I do spidev_test on the /dev/spidev0.1, I got system crash error

root at triton1:/mnt# ./spidev_test
mxc_spi_setup: mode 0, 8 bpw, 5000000 hz
mxc_spi_setup: mode 0, 8 bpw, 5000000 hz
mxc_spi_setup: mode 0, 8 bpw, 500000 hz
spi mode: 0
bits per word: 8
max speed: 5Unable to handle kernel NULL pointer dereference at virtual
address
00000000
00000 Hz (500 KHz)
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 0 [#1] PREEMPT
Modules linked in:
CPU: 0    Not tainted  (2.6.31 #43)
PC is at 0x0
LR is at bitbang_work+0x2d8/0x310
pc : [<00000000>]    lr : [<c01eb33c>]    psr: 60000013
sp : d18adf00  ip : d18adeb0  fp : d18adf3c
r10: d1876700  r9 : 00000000  r8 : d1876200
r7 : 00000000  r6 : d1cbbe7c  r5 : ffffffa4  r4 : 00000001
r3 : 00000001  r2 : 00000000  r1 : 00000000  r0 : d1876200
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 0005317f  Table: 91c84000  DAC: 00000017
Process spi_imx.0 (pid: 96, stack limit = 0xd18ac270)
Stack: (0xd18adf00 to 0xd18ae000)
df00: d18adf3c d1876720 00000001 d187673c 00000001 00000000 00000001
d1866a20
df20: d1876704 d18adf6c c01eb064 d18ac000 d18adfa4 d18adf40 c005f400
c01eb074
df40: 00000001 00000000 c005f388 c0390a68 d1866a44 d1866a3c 00000000
d1873160
df60: c0062fd4 d18adf64 d18adf64 c07b75a4 00000000 c0359e38 c00466dc
d181bd6c
df80: d1866a20 c005f208 00000000 00000000 00000000 00000000 d18adff4
d18adfa8
dfa0: c0062ecc c005f218 c0028f44 00000000 00000000 00000001 dead4ead
ffffffff
dfc0: ffffffff c03daa2c 00000000 c033f858 d18adfd0 d18adfd0 00000000
00000000
dfe0: 00000000 00000000 00000000 d18adff8 c004f844 c0062e58 33cc33cc
33cc33cc
Backtrace:
[<c01eb064>] (bitbang_work+0x0/0x310) from [<c005f400>]
(worker_thread+0x1f8/0x2
f8)
[<c005f208>] (worker_thread+0x0/0x2f8) from [<c0062ecc>] (kthread+0x84/0x8c)
[<c0062e48>] (kthread+0x0/0x8c) from [<c004f844>] (do_exit+0x0/0x658)
 r6:00000000 r5:00000000 r4:00000000
Code: bad PC value.

00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00





Confidential/Privileged information may be contained in this email. If you are not the intended recipient, please do not copy, distribute or use it for any purpose, nor disclose its contents to any other person. Please notify the sender immediately if you receive this in error.


-----Original Message-----

From: Wolfgang Denk [mailto:wd at denx.de] 
Sent: 2010年1月7日 18:33
To: Hu Kai
Cc: eldk at lists.denx.de
Subject: Re: [ELDK] how to test SPI on TX25

Dear "Hu Kai",

In message <DAC9957A95E64D7EA05FB3FB6F6E546D at WSGENERAL50002> you wrote:
> 
>    I have made the SPI master driver /drivers/spi/mxc_spi.c probes
properly
> on Starterkit TX25. (Freescale i.MX25)
>
>    And I enabled the SPIDEV inside the kernel.
>
>    During initialization, I have created a SPI device (call
> platform_device_register) and spi touch panel (call
> spi_register_board_info).
>
>    How to verify the SPI master working properly? 

Well, is your touch panel working? This seems to be the best test on
your system if SPI is working.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Q:  What's a light-year?
A:  One-third less calories than a regular year.


More information about the eldk mailing list