Instruction OCM
Dear all,
I cannot run Linux when I have an instruction OCM in my design but, without instruction OCM everything is fine. I tried to do some debugging. It seems that the Linux memory management unit has a problem with that. After entering the MMU initialization phase, it suddenly jumps to address 0x00000700 it get stuck there. Is there anybody who have tried a design with instruction OCM? Do I need to do special configuration for the Linux kernel?
Regards,
Mojtaba
The traps are down there in low memory. trap 700 is probably the one that deals with MMU exceptions. My guess is your OCM region is overlapping with the DDR memory containing that code.
Steve
Quoted 2 lines
-----Original Message-----
From: [email protected]
[mailto:linuxppc-embedded-
Quoted 10 lines
[email protected]] On Behalf Of mojtaba
Sent: Monday, May 19, 2008 8:17 AM
To: [email protected]
Subject: Instruction OCM
=Dear all,
=I cannot run Linux when I have an instruction OCM in my design but,
without instruction OCM
Quoted 1 line
everything is fine. I tried to do some debugging. It seems that the
Linux memory management unit has
Quoted 1 line
a problem with that. After entering the MMU initialization phase, it
suddenly jumps to address
Quoted 1 line
0x00000700it get stuck there. Is there anybody who have tried a
design with instruction OCM? Do I
Quoted 7 lines
need to do special configuration for the Linux kernel? =
Regards,
=Mojtaba
This email and any attachments are intended for the sole use of the named r= ecipient(s) and contain(s) confidential information that may be proprietary= , privileged or copyrighted under applicable law. If you are not the intend= ed recipient, do not read, copy, or forward this email message or any attac= hments. Delete this email message and any attachments immediately.
How is your IOCM actually built into your system, i.e. what is its base address? It cannot overlap with any other memory address in the system.
-- Mike
________________________________
From: mojtaba [mailto:[email protected]]
Sent: Monday, May 19, 2008 11:17 AM
To: [email protected]
Subject: Instruction OCM
Dear all,
I cannot run Linux when I have an instruction OCM in my design but, without instruction OCM everything is fine. I tried to do some debugging. It seems that the Linux memory management unit has a problem with that. After entering the MMU initialization phase, it suddenly jumps to address 0x00000700 it get stuck there. Is there anybody who have tried a design with instruction OCM? Do I need to do special configuration for the Linux kernel?
Regards,
Mojtaba
Quoted 7 lines · mojtaba
Dear all,
I cannot run Linux when I have an instruction OCM in my design but, without instruction OCM everything is fine. I tried to do some debugging. It seems that the Linux memory management unit has a problem with that. After entering the MMU initialization phase, it suddenly jumps to address
0x00000700it get stuck there. Is there anybody who have tried a design with instruction OCM? Do I need to do special configuration for the Linux kernel?Regards,
Quoted 8 lines
Mojtaba
------------------------------------------------------------------------
_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Address 0x700 means invalid opcode exception.
If instruction OCM is same as data OCM (I think it's so) then any MMU mapping is not applicable to this region at all as OCM controller decodes virtual addresses bypassing any MMU mappings. In your situation MMU maps virtual address of OCM to physical address containing some random data and CPU tries to execute it. So you get invalid opcode exception.
Actually there is no overlapping between IOCM and DDR. The IOCM region addre4sses are:
PARAMETER C_BASEADDR = 0xc0a00000
PARAMETER C_HIGHADDR = 0xc0a1ffff
And the DDR addresses are:
PARAMETER C_MEM0_BASEADDR = 0x00000000
PARAMETER C_MEM0_HIGHADDR = 0x0fffffff
Furthermore, if such a conflict existed, the synthesizer would have identified it.
-----Original Message-----
From: Stephen Neuendorffer [mailto:[email protected]]
Sent: Monday, May 19, 2008 6:59 PM
To: mojtaba; [email protected]
Subject: RE: Instruction OCM
The traps are down there in low memory. trap 700 is probably the one that deals with MMU exceptions. My guess is your OCM region is overlapping with the DDR memory containing that code.
Steve
Quoted 2 lines
-----Original Message-----
From: [email protected]
[mailto:linuxppc-embedded-
Quoted 8 lines
[email protected]] On Behalf Of mojtaba
Sent: Monday, May 19, 2008 8:17 AM
To: [email protected]
Subject: Instruction OCMDear all,
I cannot run Linux when I have an instruction OCM in my design but,
without instruction OCM
Quoted 1 line
everything is fine. I tried to do some debugging. It seems that the
Linux memory management unit has
Quoted 1 line
a problem with that. After entering the MMU initialization phase, it
suddenly jumps to address
Quoted 1 line
0x00000700it get stuck there. Is there anybody who have tried a
design with instruction OCM? Do I
Quoted 5 lines
need to do special configuration for the Linux kernel?
Regards,
Mojtaba
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
Thank you for your email. But what is the solution to that? I have seen this in a thesis:
"when using the OCM buses to connect memory, we can only use virtual memory as long as the virtual address is the same as the physical address, which is conceptually
the same as using a system without MMU. Therefore porting Linux to a system based on an OCM memory system is not possible"
http://ce.et.tudelft.nl/publicationfiles/1367_700_thesis.pdf
Is that right? What do you suggest?
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Sergey Temerkhanov
Sent: Monday, May 19, 2008 8:53 PM
To: [email protected]
Subject: Re: Instruction OCM
Quoted 13 lines · mojtaba
Dear all,
I cannot run Linux when I have an instruction OCM in my design but, without instruction OCM everything is fine. I tried to do some debugging. It seems that the Linux memory management unit has a problem with that. After entering the MMU initialization phase, it suddenly jumps to address
0x00000700it get stuck there. Is there anybody who have tried a design with instruction OCM? Do I need to do special configuration for the Linux kernel?Regards,
Quoted 8 lines
Mojtaba
------------------------------------------------------------------------
_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Address 0x700 means invalid opcode exception.
If instruction OCM is same as data OCM (I think it's so) then any MMU mapping is not applicable to this region at all as OCM controller decodes virtual addresses bypassing any MMU mappings.
In your situation MMU maps virtual address of OCM to physical address containing some random data and CPU tries to execute it. So you get invalid opcode exception.
_______________________________________________
Linuxppc-embedded mailing list [email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
Quoted 9 lines · On Tuesday 20 May 2008 13:19:26 mojtaba wrote:
Thank you for your email. But what is the solution to that? I have seen this in a thesis:
"when using the OCM buses to connect memory, we can only use virtual memory as long as the virtual address is the same as the physical address, which is conceptually
the same as using a system without MMU. Therefore porting Linux to a system based on an OCM memory system is not possible"
Quoted 4 lines
http://ce.et.tudelft.nl/publicationfiles/1367_700_thesis.pdf
Is that right? What do you suggest?
Getting OCM-based devices (and even memory) to work in Linux is possible. All you need is to setup a mapping with virtual addresses equal to physical (some info can be found here:
http://courses.ece.uiuc.edu/ece412/MP_Files/mp2/20060623-XUP-Linux-Tutorial-REVISION-FINAL.pdf)
Furthermore, if you really need to get the code running from OCM, I'd suggest to setup such MMU mapping for OCM region very early - it can be done in initial_mmu function at head_4xx.S. Look at line 936 (#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(SERIAL_DEBUG_IO_BASE))
- that's very good point to start.
Regards, Sergey Temerkhanov
Ah yes, I forgot about that little detail with the OCM.
It would be slick if these mappings were generated based on memory nodes in the device tree for ARCH=3Dpowerpc.
Steve
Quoted 2 lines
-----Original Message-----
From: [email protected]
[mailto:linuxppc-embedded-
Quoted 8 lines
[email protected]] On Behalf Of Temerkhanov
Sent: Tuesday, May 20, 2008 4:11 AM
To: mojtaba; [email protected]
Subject: Re: Instruction OCM
=Quoted 1 line · On Tuesday 20 May 2008 13:19:26 mojtaba wrote:
Thank you for your email. But what is the solution to that? I have
seen
Quoted 3 lines
Quoted 3 lines
this in a thesis:
"when using the OCM buses to connect memory, we can only use virtual
memory
Quoted 1 line
Quoted 1 line
as long as the virtual address is the same as the physical address,
which
Quoted 6 lines
Quoted 6 lines
is conceptually
the same as using a system without MMU. Therefore porting Linux to a system based on an OCM memory system is not possible"http://ce.et.tudelft.nl/publicationfiles/1367_700_thesis.pdf
Quoted 7 lines
Quoted 2 lines
Is that right? What do you suggest?
=
=
Getting OCM-based devices (and even memory) to work in Linux is
possible. All
Quoted 1 line
you need is to setup a mapping with virtual addresses equal to
physical (some
Quoted 2 lines
info can be found here:
http://courses.ece.uiuc.edu/ece412/MP_Files/mp2/20060623-XUP-Linux-Tutor
ial-REVISION-FINAL.pdf)
Quoted 3 lines
=
Furthermore, if you really need to get the code running from OCM, I'd
suggest
Quoted 1 line
to setup such MMU mapping for OCM region very early - it can be done
in
Quoted 10 lines
initial_mmufunction athead_4xx.S. Look at line 936 (#ifdefined(CONFIG_SERIAL_TEXT_DEBUG)&&defined(SERIAL_DEBUG_IO_BASE))
- that's very good point to start.
=Regards, Sergey Temerkhanov
_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
This email and any attachments are intended for the sole use of the named r= ecipient(s) and contain(s) confidential information that may be proprietary= , privileged or copyrighted under applicable law. If you are not the intend= ed recipient, do not read, copy, or forward this email message or any attac= hments. Delete this email message and any attachments immediately.