Writing to CPLD mapped to EBC Port of AMCC440EP

Henry Bausley hbausley at deltatau.com
Tue Jul 29 09:40:35 EST 2008


I am attempting to write to a CPLD mapped to the EBC port of a AMCC 440EP.  When I attempt to write using an unsigned variable
ie. unsigned *pbase = (unsigned char *)ioremap64(0x8F000000,0x1000000);
I get a kernel access of bad area, sig: 11 fault.  However, if I change to an unsigned char ie. unsigned char *pbase = (unsigned char *)ioremap64(0x8F000000,
0x1000000); The system doesn't crash.  I need to write using an unsigned.  Does any one have any ideas what I am doing wrong?

I am using 2.6.24 Xenomai Denx. 4.2.  I am porting a working 2.6.14 project that was developed with FSM Labs RT Linux (now owned by WindRiver).




//-----------------------------------------------------------------------
// initialize module -- this what is called when you do insmod ./ubus.ko
//-----------------------------------------------------------------------
static int __init ubus_init_module (void) 
{
  int i;
  unsigned ofs[20] =
{0x400000,0x400100,0x500000,0x500100,0x600000,0x600100,0x700000,0x700100,

0x608000,0x608100,0x708000,0x708100,0x610000,0x610100,0x710000,0x710100,
                        0x618000,0x618100,0x718000,0x718100};
  unsigned *pbase = (unsigned *)ioremap64(0x8F000000,
0x1000000);
  unsigned *p;
  for( i = 0; i < 20;i++)
  {
    p = pbase + ofs[i] + 0x34;
    *p = 0x25500;
    printk(KERN_ALERT "p = %X\r\n",p);
  }
  iounmap(pbase);
  PRINTK("initializing module ubus\n");
  i = register_chrdev (UBUS_MAJOR, UBUS_NAME, &ubus_fops);
  if (i != 0) return - EIO;

  return 0;
}


-bash-3.2# insmod
ubus.ko                                                                                            
Oops: kernel access of bad area, sig: 11
[#1]                                                                        
NIP: d1068054 LR: d1068038 CTR:
00000000                                                                             
REGS: cf489d70 TRAP: 0300   Not tainted
(2.6.24.2)                                                                  
MSR: 00029000 <EE,ME>  CR: 08004022  XER:
00000004                                                                   
DEAR: d61000d0, ESR:
00800000                                                                                        
TASK = cf45c410[309] 'insmod' THREAD:
cf488000                                                                       
GPR00: d1068038 cf489e20 cf45c410 d5100000 d6100000 00000000 00000000
cf4467f8                                       
GPR08: 000007f8 d1060000 8ffff000 00000000 28004028 1004950c 00000000
d509c1e4                                       
GPR16: cffe1ce0 d5093a04 00000000 00000036 00000036 d5093310 c003cb00
d5081000                                       
GPR24: 00000026 00000026 d5093464 cf489e28 d1


0664c4 00025500 00000026 d1066a60                                       
NIP [d1068054] ubus_init_module+0x54/0x190
[ubus]                                                                    
LR [d1068038] ubus_init_module+0x38/0x190
[ubus]                                                                     
Call
Trace:                                                                                                          
[cf489e20] [d1068038] ubus_init_module+0x38/0x190 [ubus]
(unreliable)                                                
[cf489e90] [c003df74] sys_init_module
+0x174/0x15e0                                                                   
[cf489f40] [c0001ac4] ret_from_syscall
+0x0/0x3c                                                                      
Instruction
dump:                                                                                                    
480000cd 3c808f00 3ca00100 38600000 480000cd 80810008 3fa00002
5484103a                                              
7c841a14 3d20d106 63bd5500 3b8964c4 <93a400d0> 7c7e1b78 388400d0
7f83e378                                            
Segmentation fault   


-bash-3.2# insmod
ubus.ko                                                                                            
p = D5500034                                                                                                         
p = D5500134                                                                                                         
p = D5600034                                                                                                         
p = D5600134                                                                                                         
p = D5700034                                                                                                         
p = D5700134                                                                                                         
p = D5800034                                                                                                         
p = D5800134                                                                                                         
p = D5708034                                                                                                         
p = D5708134                                                                                                          
p = D5808034                                                                                                         
p = D5808134                                                                                                         
p = D5710034                                                                                                         
p = D5710134                                                                                                         
p = D5810034                                                                                                         
p = D5810134                                                                                                         
p = D5718034                                                                                                         
p = D5718134                                                                                                         
p = D5818034                                                                                                         
p = D5818134                                                                                                         
initializing module ubus  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20080728/6a4acaef/attachment-0001.htm>


More information about the Linuxppc-embedded mailing list