2009-02-09 17:00:03 PPI BF527 won't compile
Adam Dershowitz (UNITED STATES)
Message: 69149
I am trying to use the Blackfin BF5xx Driver with uClinux-dist-2008R1.5-RC3. If I try to compile it for the BF527 I get an error:
Undefined Reference to "bfin_clear_PPI_STATUS"
I foudn that all of the related things are defined in: include/asm-blackfin/machbf527/cdefBF52x_base.h
And that it is defined in machbf-537/cdefbf534.h this way:
#define bfin_clear_PPI_STATUS() bfin_write_PPI_STATUS(0xFFFF)
So I copied that definition into the cdefbfBF52x_base.h and now it does compile. But I want to make sure that is the correct definition for the 527. The bug tracker #2562 shows that there was a problem with this, but that it was fixed.
So, my questions are 1) Why isn't this defined for the 527? Just an accidental oversight or something else to be aware of?
2) Who should I report this to, so that it can be fixed in the future?
3) Is bfin_write_PPI_STATUS(0xFFFF) the correct way to clear the PPI status on a BF527?
Thanks,
--Adam
QuoteReplyEditDelete
2009-02-09 17:28:51 Re: PPI BF527 won't compile
Mike Frysinger (UNITED STATES)
Message: 69151
the PPI driver in the release really only works for BF533 and BF537. it has been rewritten in svn trunk and should work on all platforms now (including the BF52x).
QuoteReplyEditDelete
2009-02-09 20:52:47 Re: PPI BF527 won't compile
Adam Dershowitz (UNITED STATES)
Message: 69160
OK.
I just downloaded char/bfin_ppi.c and char/bfin_ppi.h. When I try to build I get build errors.
In function 'disable_ppi_dma'
bfin_ppi.c:150 error: 'ANOMALY_0500278' undeclared.
Are there other files that I need to get this new version to work? Do I need a full svn snapshot of the whole linux-2.6.x kernel? Or are there just a few other changes that perhaps you can point me to?
Thank you for the help.
--Adam
QuoteReplyEditDelete
2009-02-09 20:59:30 Re: PPI BF527 won't compile
Robin Getz (UNITED STATES)
Message: 69162
Adam:
You need the whole things - trunk toolchain, trunk U-Boot, trunk linux kernel, trunk uClinux Dist - the whole shooting match.
If you wonder why - check out the faq.
http://docs.blackfin.uclinux.org/doku.php?id=faq
-Robin
QuoteReplyEditDelete
2009-02-09 20:59:34 Re: PPI BF527 won't compile
Mike Frysinger (UNITED STATES)
Message: 69163
you can try to backport the changes yourself or just grab the latest code from svn/git
QuoteReplyEditDelete
2009-02-10 03:56:03 Re: PPI BF527 won't compile
Michael Hennerich (GERMANY)
Message: 69176
Mike,
ANOMALY_05000278 is not defined for BF51x, BF54x and BF52x can you please add these.
Adam,
As a temp. solution - Simply add following line into the driver
#define ANOMALY_05000278 0 /* in case you compile for BF52x */
-Michael
QuoteReplyEditDelete
2009-02-10 04:10:46 Re: PPI BF527 won't compile
Mike Frysinger (UNITED STATES)
Message: 69177
should be all set now in trunk
QuoteReplyEditDelete
2009-02-10 13:07:47 Re: PPI BF527 won't compile
Adam Dershowitz (UNITED STATES)
Message: 69212
Robin,
that FAQ doesn't really address my question. Because we are not yet talking about a release. I have the latest release, and now we are just talking about a patch to that. I assume that stuff in SVN repository has not yet gone through the full set of testing (or it would be a release)
So, depending on what has been changed I could imagine that the release code could be more stable, and just using the new ppi could work with it fine. Or, it could be that it needs features in the newer version of the rest of the code, so that a full update, from the release to trunk, is necesssary, or at least more stable.
I will try just the fixed version of the ppi code initially, and see what happens.
--Adam
QuoteReplyEditDelete
2009-02-10 20:19:03 Re: PPI BF527 won't compile
Robin Getz (UNITED STATES)
Message: 69225
Adam:
The FAQ does address the point I was making -- The question "Why do I need to use the same version of toolchain/kernel/uClibc/U-boot/uClinux-dist?"
I'm not as hopeful as Mike - and don't normally suggest people backport things from trunk to the last release. If you want to use a feature from trunk - use trunk - and that means upgrade everything - as the FAQ states.
-Robin
QuoteReplyEditDelete
2009-02-11 13:18:12 Re: PPI BF527 won't compile
Adam Dershowitz (UNITED STATES)
Message: 69273
I tried just changing those two files, and now it does compile. But when I run it, I don't see anything new in /dev/
And, during my boot I see:
ppi: can't get major 252
Is this a known problem? Any suggestions? Perhaps the answer is that this relates to me not doing a full update, as Robin had suggested, and I need the trunk versions?
Thanks,
--Adam
QuoteReplyEditDelete
2009-02-11 13:23:21 Re: PPI BF527 won't compile
Mike Frysinger (UNITED STATES)
Message: 69274
major numbers are unique. only one driver can have it at a time. look at /proc/devices.
QuoteReplyEditDelete
2009-02-11 15:00:43 Re: PPI BF527 won't compile
Adam Dershowitz (UNITED STATES)
Message: 69279
Thanks.
opt was using 252, so I disabled that and rebuilt. Now I get a kernel panic on boot from ppi_init_module.
I am trying to download and build the SVN version to see if that helps.
QuoteReplyEditDelete
2009-02-11 15:32:02 Re: PPI BF527 won't compile
Michael Hennerich (GERMANY)
Message: 69282
Can you post the kernel panic messages?
QuoteReplyEditDelete
2009-02-11 16:15:45 Re: PPI BF527 won't compile
Adam Dershowitz (UNITED STATES)
Message: 69284
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler cfq registered
NULL pointer access (probably)
Kernel OOPS in progress
Defered Exception context
CURRENT PROCESS:
COMM=swapper PID=1
invalid mm
return address: [0x0008b4fa]; contents of:
0x0008b4d0: 05e3 e800 0008 0c81 e630 0011 3021 e632
0x0008b4e0: 0013 e537 0014 1402 2209 3209 e530 0011
0x0008b4f0: 5ac8 0a58 14dc e531 0013 [9949] 4308 0c00
0x0008b500: 19bd e535 0011 612a 0810 181c 0a6b 1c04
SEQUENCER STATUS: Not tainted
SEQSTAT: 00000027 IPEND: 8030 SYSCFG: 0006
HWERRCAUSE: 0x0
EXCAUSE : 0x27
physical IVG15 asserted : <0xffa00dac> { _evt_system_call + 0x0 }
logical irq 6 mapped : <0xffa00250> { _timer_interrupt + 0x0 }
logical irq 59 mapped : <0x000c361c> { _blackfin_interrupt + 0x0 }
RETE: <0x00000000> /* Maybe null pointer? */
RETN: <0x03eebef0> /* unknown address */
RETX: <0x0008b4fa> { _vsnprintf + 0x2a }
RETS: <0x0009c0c6> { _device_create + 0x66 }
PC : <0x0008b4fa> { _vsnprintf + 0x2a }
DCPLB_FAULT_ADDR: <0x00000000> /* Maybe null pointer? */
ICPLB_FAULT_ADDR: <0x0008b4fa> { _vsnprintf + 0x2a }
PROCESSOR STATE:
R0 : 00d3a2a4 R1 : 00000014 R2 : 00000000 R3 : 00d3a400
R4 : 00000014 R5 : 00000000 R6 : 0fc00000 R7 : 00d38ca0
P0 : 00d3a2a4 P1 : 00000000 P2 : 00d3a400 P3 : 00d3a2b8
P4 : 009e9cfc P5 : 00d3a200 FP : 03eebf6c SP : 03eebe14
LB0: 0008bd5c LT0: 0008bd5c LC0: 00000000
LB1: 0008b7c8 LT1: 0008b7be LC1: 00000000
B0 : 00000000 L0 : 00000000 M0 : 00000000 I0 : 0018b390
B1 : 00000000 L1 : 00000000 M1 : 00000000 I1 : 00000000
B2 : 00000000 L2 : 00000000 M2 : 00000000 I2 : fffedbb0
B3 : 00000000 L3 : 00000000 M3 : 00000000 I3 : 00000000
A0.w: 00000044 A0.x: 00000000 A1.w: 00000044 A1.x: 00000000
USP : 00000000 ASTAT: 00003024
Hardware Trace:
0 Target : <0x0000494c> { _trap_c + 0x0 }
Source : <0xffa006ec> { _exception_to_level5 + 0xb4 }
1 Target : <0xffa00638> { _exception_to_level5 + 0x0 }
Source : <0xffa00590> { _ex_trap_c + 0x5c }
2 Target : <0xffa00534> { _ex_trap_c + 0x0 }
Source : <0xffa0078c> { _trap + 0x28 }
3 Target : <0xffa00764> { _trap + 0x0 }
Source : <0x0008b4f6> { _vsnprintf + 0x26 }
4 Target : <0x0008b4ea> { _vsnprintf + 0x1a }
Source : <0x0008b4e6> { _vsnprintf + 0x16 }
5 Target : <0x0008b4d0> { _vsnprintf + 0x0 }
Source : <0x0009c0c2> { _device_create + 0x62 }
6 Target : <0x0009c08c> { _device_create + 0x2c }
Source : <0x000343bc> { _kmem_cache_zalloc + 0x54 }
7 Target : <0x000343b4> { _kmem_cache_zalloc + 0x4c }
Source : <0x0008bd62> { _memset + 0x2e }
8 Target : <0x0008bd34> { _memset + 0x0 }
Source : <0x000343b0> { _kmem_cache_zalloc + 0x48 }
9 Target : <0x00034378> { _kmem_cache_zalloc + 0x10 }
Source : <0x000343c2> { _kmem_cache_zalloc + 0x5a }
10 Target : <0x000343c2> { _kmem_cache_zalloc + 0x5a }
Source : <0x0012572e> { _cond_resched + 0x1a }
11 Target : <0x00125714> { _cond_resched + 0x0 }
Source : <0x000343be> { _kmem_cache_zalloc + 0x56 }
12 Target : <0x000343be> { _kmem_cache_zalloc + 0x56 }
Source : <0x00034374> { _kmem_cache_zalloc + 0xc }
13 Target : <0x00034368> { _kmem_cache_zalloc + 0x0 }
Source : <0x0009c088> { _device_create + 0x28 }
14 Target : <0x0009c060> { _device_create + 0x0 }
Source : <0x001a66ac> { _ppi_init_module + 0x8c }
15 Target : <0x001a6690> { _ppi_init_module + 0x70 }
Source : <0x00065d56> { _sysfs_add_file + 0x4a }
Stack from 03eebdf4:
4ea93000 ffa006f0 00184568 00184568 00184564 03ef0478 00044c22 009e8654
0008b4fa 00008030 00000027 00000000 03eebef0 0008b4fa 0008b4fa 0009c0c6
00d3a2a4 00003024 0008b7c8 0008bd5c 0008b7be 0008bd5c 00000000 00000000
00000044 00000000 00000044 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 fffedbb0 00000000 0018b390 00000000 03eebf6c 00d3a200 009e9cfc
Call Trace:
[<00008124>] _l1_data_B_sram_alloc+0x14/0x34
[<0009e7cc>] _class_register+0x104/0x110
[<0006682e>] _sysfs_make_dirent+0x1e/0x38
[<0009c0c6>] _device_create+0x66/0x90
[<001a66b0>] _ppi_init_module+0x90/0x188
[<00009600>] _in_sched_functions+0x18/0x38
[<001a6398>] _tty_init+0x128/0x158
[<00194654>] _kernel_init+0x88/0x234
[<001945cc>] _kernel_init+0x0/0x234
[<00001666>] _kernel_thread_helper+0x6/0xc
Modules linked in:
Kernel panic - not syncing: Kernel exception
QuoteReplyEditDelete
2009-02-11 16:53:52 Re: PPI BF527 won't compile
Michael Hennerich (GERMANY)
Message: 69287
I haven't tried the driver on BF52x yet.
Tomorrow - I see if I can recreate the issue on my side.
-Michael
QuoteReplyEditDelete
2009-02-12 06:39:11 Re: PPI BF527 won't compile
Michael Hennerich (GERMANY)
Message: 69340
Module insertion as well as driver build into the kernel works ok for me on BF527
root:/dev> modprobe bfin_ppi ppi_major=62
root:/dev> modprobe -r bfin_ppi
root:/dev> version
kernel: Linux release 2.6.28.4-ADI-2009R1-pre-svn6093, build #10090 Thu Feb 12 12:33:02 CET 2009
toolchain: bfin-uclinux-gcc release gcc version 4.1.2 (ADI svn)
user-dist: release svn-7707, build #3431 Thu Feb 12 12:32:18 CET 2009
root:/dev>
root:/dev> cat /proc/cpuinfo
processor : 0
vendor_id : Analog Devices
cpu family : 0x27e0
model name : ADSP-BF527 525(MHz CCLK) 131(MHz SCLK) (mpu off)
stepping : 0
cpu MHz : 525.000/131.250000
bogomips : 1044.48
Calibration : 522240000 loops
cache size : 16 KB(L1 icache) 32 KB(L1 dcache-wt) 0 KB(L2 cache)
dbank-A/B : cache/cache
icache setup : 4 Sub-banks/4 Ways, 32 Lines/Way
dcache setup : 2 Super-banks/4 Sub-banks/2 Ways, 64 Lines/Way
board name : ADI BF527-EZKIT
board memory : 65536 kB (0x00000000 -> 0x04000000)
kernel memory : 64504 kB (0x00001000 -> 0x03eff000)
root:/dev>
QuoteReplyEditDelete
2009-02-12 13:15:10 Re: PPI BF527 won't compile
Adam Dershowitz (UNITED STATES)
Message: 69354
Thanks.
I upgraded to the SVN snapshot of linux and now it does seem to be working.
I think that just upgrading those couple of files was not enough, with the 20081.5RC3, for it to work. There is something else that was missing or different.
QuoteReplyEditDelete
2009-02-20 20:00:27 Re: PPI BF527 won't compile
Adam Dershowitz (UNITED STATES)
Message: 69708
I have been trying to track down a problem related to this ppi driver. I was working from ppitest.c that is included.
What I realized is that ppitest tries to set both
CMD_PPI_PORT_DIRECTION and CMD_PPI_PACKING. Neither of these appear to be valid to the driver. So, when ppitest is run, I get
device ioctl error: Invalid argument.
I tried commenting out those two things commands from the setup. Now my code works, sometimes. But it seems to depend on the version of u-boot that is being used. I assume that is because of some other parameter being set, or not set by u-boot, and then not being conifigured properly in the setup.
Any ideas?
QuoteReplyEditDelete
2009-02-20 20:04:53 Re: PPI BF527 won't compile
Mike Frysinger (UNITED STATES)
Message: 69709
if you're using the bf527-ezkit, then u-boot will configure the ppi for the lcd to display the splash screen
QuoteReplyEditDelete
2009-06-05 06:17:09 Re: PPI BF527 won't compile
Stefan Wanja (GERMANY)
Message: 75249
Hello,
I am trying to get the adv7183b extension board with the bf527 ezkit working. I just checked out the svn trunk and tried to build, but I still get an error about a missing definition of bfin_clear_PPI_STATUS. Shouldn't this be added into 'arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h' ?
QuoteReplyEditDelete