* Writing to CPLD mapped to EBC Port of AMCC440EP
@ 2008-07-28 23:40 Henry Bausley
2008-07-30 0:02 ` Josh Boyer
0 siblings, 1 reply; 4+ messages in thread
From: Henry Bausley @ 2008-07-28 23:40 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 6506 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 25411 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Writing to CPLD mapped to EBC Port of AMCC440EP
2008-07-28 23:40 Writing to CPLD mapped to EBC Port of AMCC440EP Henry Bausley
@ 2008-07-30 0:02 ` Josh Boyer
2008-07-30 18:33 ` Henry Bausley
2008-07-30 22:29 ` test - please ignore Victor Gallardo
0 siblings, 2 replies; 4+ messages in thread
From: Josh Boyer @ 2008-07-30 0:02 UTC (permalink / raw)
To: Henry Bausley; +Cc: linuxppc-embedded
On Mon, 28 Jul 2008 16:40:35 -0700
"Henry Bausley" <hbausley@deltatau.com> wrote:
>
> 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?
The documentation I have for the Bamboo board says the EPLD is at
address 0x80002000 and is only 8 bytes in size. Similarly, the
Yosemite board CPLD is at 0x80002000 and is only 16 bytes in size. Why
you are ioremapping 16MiB at 0x8F000000 I have no idea.
Also, the individual registers of the EPLD/CPLD on both boards are only
8 bits, so an unsigned char seems appropriate. If you have a custom
board that does something totally different from how the eval boards
are set up, then I'm not sure many people will be able to help you
without documentation for that board.
josh
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Writing to CPLD mapped to EBC Port of AMCC440EP
2008-07-30 0:02 ` Josh Boyer
@ 2008-07-30 18:33 ` Henry Bausley
2008-07-30 22:29 ` test - please ignore Victor Gallardo
1 sibling, 0 replies; 4+ messages in thread
From: Henry Bausley @ 2008-07-30 18:33 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-embedded
Our board is based upon the Yosemite. But we have modified the CPLD and
made our own custom hardware, thats why the parameters for ioremap are
different. The system is based on the 2.6.14-rtl that has worked absolutely
perfect for a couple of years which we got from FSM Labs.
I am porting to the 2.6.24 kernel Denx with xenomai and had the problem. It
turns out the default value if the EBC0_CFG register was 0x84400000 in the
system and we needed to change it to 0xBC400000 to increase the Ready
Timeout. We were getting a machine check error.
Thank's a lot for your input!!!
----- Original Message -----
From: "Josh Boyer" <jwboyer@linux.vnet.ibm.com>
To: "Henry Bausley" <hbausley@deltatau.com>
Cc: <linuxppc-embedded@ozlabs.org>
Sent: Tuesday, July 29, 2008 5:02 PM
Subject: Re: Writing to CPLD mapped to EBC Port of AMCC440EP
> On Mon, 28 Jul 2008 16:40:35 -0700
> "Henry Bausley" <hbausley@deltatau.com> wrote:
>
>>
>> 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?
>
> The documentation I have for the Bamboo board says the EPLD is at
> address 0x80002000 and is only 8 bytes in size. Similarly, the
> Yosemite board CPLD is at 0x80002000 and is only 16 bytes in size. Why
> you are ioremapping 16MiB at 0x8F000000 I have no idea.
>
> Also, the individual registers of the EPLD/CPLD on both boards are only
> 8 bits, so an unsigned char seems appropriate. If you have a custom
> board that does something totally different from how the eval boards
> are set up, then I'm not sure many people will be able to help you
> without documentation for that board.
>
> josh
^ permalink raw reply [flat|nested] 4+ messages in thread
* test - please ignore
2008-07-30 0:02 ` Josh Boyer
2008-07-30 18:33 ` Henry Bausley
@ 2008-07-30 22:29 ` Victor Gallardo
1 sibling, 0 replies; 4+ messages in thread
From: Victor Gallardo @ 2008-07-30 22:29 UTC (permalink / raw)
To: linuxppc-embedded
test - please ignore
--------------------------------------------------------
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, =
is for the sole use of the intended recipient(s) and contains =
information that is confidential and proprietary to Applied Micro =
Circuits Corporation or its subsidiaries. It is to be used solely for =
the purpose of furthering the parties' business relationship. All =
unauthorized review, use, disclosure or distribution is prohibited. If =
you are not the intended recipient, please contact the sender by reply =
e-mail and destroy all copies of the original message.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-07-30 22:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-28 23:40 Writing to CPLD mapped to EBC Port of AMCC440EP Henry Bausley
2008-07-30 0:02 ` Josh Boyer
2008-07-30 18:33 ` Henry Bausley
2008-07-30 22:29 ` test - please ignore Victor Gallardo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).