public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* Re: [ECOS] PowerPC hangs on memory read
@ 2004-06-18 13:46 Anthony Tonizzo
  2004-06-18 14:50 ` Nick Garnett
  0 siblings, 1 reply; 6+ messages in thread
From: Anthony Tonizzo @ 2004-06-18 13:46 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

Andrew:

> You you checked the MMU setup? Maybe you don't have 
> access to this location?

I had a hunch it was MMU, but I was under the mistaken
impression that when enabled, the MMU was mapped to a 1:1
correspondence between logical and physical address 
_for_the_whole_extent_of_the_memory_ (this is not as
wasteful as it sounds since all the addressable space can 
be covered with large memory blocks resulting in acceptably
sized translation tables).

Obviously I was wrong, because once I recompiled Ecos
to disabled the MMU, everything works alright.

I peeked around, and I found one particularly interesting
function in the HAL, cyg_hal_map_memory(). Can
this function be called at any time or is it a setup only
call? In other words, can you augment the MMU translation
table at any time?

Thanks for your help!
Tony


____________________________________________________________
Find what you are looking for with the Lycos Yellow Pages
http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] PowerPC hangs on memory read
  2004-06-18 13:46 [ECOS] PowerPC hangs on memory read Anthony Tonizzo
@ 2004-06-18 14:50 ` Nick Garnett
  0 siblings, 0 replies; 6+ messages in thread
From: Nick Garnett @ 2004-06-18 14:50 UTC (permalink / raw)
  To: atonizzo; +Cc: Andrew Lunn, ecos-discuss

"Anthony Tonizzo" <atonizzo@lycos.com> writes:

> Andrew:
> 
> > You you checked the MMU setup? Maybe you don't have 
> > access to this location?
> 
> I had a hunch it was MMU, but I was under the mistaken
> impression that when enabled, the MMU was mapped to a 1:1
> correspondence between logical and physical address 
> _for_the_whole_extent_of_the_memory_ (this is not as
> wasteful as it sounds since all the addressable space can 
> be covered with large memory blocks resulting in acceptably
> sized translation tables).

The MMU is generally used to control the cache attributes of various
regions of the address space. Usually RAM and ROM are mapped cached,
device registers and PCI space are mapped uncached. It may also be
useful to have an uncached view of RAM too. Depending on the relative
layouts of these blocks, it is not always possible to share MMU
entries between them. Also, by explicitly leaving unused address space
unmapped we can detect invalid accesses more easily.

> 
> Obviously I was wrong, because once I recompiled Ecos
> to disabled the MMU, everything works alright.
> 
> I peeked around, and I found one particularly interesting
> function in the HAL, cyg_hal_map_memory(). Can
> this function be called at any time or is it a setup only
> call? In other words, can you augment the MMU translation
> table at any time?

It is only called at startup. Depending on the MMU facilities
available it either uses the BAT registers, or installs static
mappings in the TLB. These are limited resources, so the HAL writes
needs to work things out fairly carefully.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] PowerPC hangs on memory read
  2004-06-18 15:05 Anthony Tonizzo
@ 2004-06-18 15:30 ` Nick Garnett
  0 siblings, 0 replies; 6+ messages in thread
From: Nick Garnett @ 2004-06-18 15:30 UTC (permalink / raw)
  To: atonizzo; +Cc: Andrew Lunn, ecos-discuss

"Anthony Tonizzo" <atonizzo@lycos.com> writes:

> Nick:
> 
> >It is only called at startup. 
> 
> I spent a good deal of time trying to go to the bottom of
> this. I perused the source code and found that the function
> hal_MMU_init() does all the initialization, and for my
> board defines 3 areas which I was able to identify. By
> placing my PCMCIA memory area in an unused section of one
> of the three, my code ran with MMU enabled. 
> 
> Problem solved, almost.
> 
> Infact, I tried to understand the working of it all, and
> I noticed that hal_MMU_init() relies on a cyg_hal_mem_map[]
> to provide the areas under MMU watch. But I cannot
> figure out where cyg_hal_mem_map[] is defined. I grep'd
> the whole source tree and it appears in two places
> (hal_mem.h and hal_misc.c) and in neither place the
> table contents are defined.
> 
> When/where are the contents of cyg_hal_mem_map[] defined?
> 

It's defined using the macros define by hal_mem.h in the platform HAL,
look for CYGARC_MEMDESC_* .


-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] PowerPC hangs on memory read
@ 2004-06-18 15:05 Anthony Tonizzo
  2004-06-18 15:30 ` Nick Garnett
  0 siblings, 1 reply; 6+ messages in thread
From: Anthony Tonizzo @ 2004-06-18 15:05 UTC (permalink / raw)
  To: Nick Garnett; +Cc: Andrew Lunn, ecos-discuss

Nick:

>It is only called at startup. 

I spent a good deal of time trying to go to the bottom of
this. I perused the source code and found that the function
hal_MMU_init() does all the initialization, and for my
board defines 3 areas which I was able to identify. By
placing my PCMCIA memory area in an unused section of one
of the three, my code ran with MMU enabled. 

Problem solved, almost.

Infact, I tried to understand the working of it all, and
I noticed that hal_MMU_init() relies on a cyg_hal_mem_map[]
to provide the areas under MMU watch. But I cannot
figure out where cyg_hal_mem_map[] is defined. I grep'd
the whole source tree and it appears in two places
(hal_mem.h and hal_misc.c) and in neither place the
table contents are defined.

When/where are the contents of cyg_hal_mem_map[] defined?

Thanks
Tony


____________________________________________________________
Find what you are looking for with the Lycos Yellow Pages
http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] PowerPC hangs on memory read
  2004-06-18  1:58 Anthony Tonizzo
@ 2004-06-18  7:48 ` Andrew Lunn
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2004-06-18  7:48 UTC (permalink / raw)
  To: Anthony Tonizzo; +Cc: ecos-discuss

> The inner loop that performs the reads looks like this:
> 
>    address = PCMCIA_ATTRIBUTE_ADDR + i;
>    HAL_READ_UINT16( address, cis_content );
> 
> and the hangs happens during the HAL_READ_UINT16. I looked
> at the assembler that is generated, and besides being more
> verbose, the GNU code uses an LHZ instruction for the
> read, while the Metrowerks uses an LHA, hardly a reason
> to explain the inexplicable hangup.
> 
> Is there anyone that can suggest possible reasons?

You you checked the MMU setup? Maybe you don't have access to this
location?

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ECOS] PowerPC hangs on memory read
@ 2004-06-18  1:58 Anthony Tonizzo
  2004-06-18  7:48 ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: Anthony Tonizzo @ 2004-06-18  1:58 UTC (permalink / raw)
  To: ecos-discuss


I am trying to read the CIS of a PCMCIA card. My development
system has a PowerPC860 and I am working with a 16 bit
PCMCIA peripheral. 

The code works perfectly when I run it in a standalone
application using the Metrowerks compiler with the Macraigor
Wiggler as hardware debugger. This allows me to verify that
the code is sound. Unfortunately, when run under Ecos, 
using GDB as the debugger, the same code hangs.

The inner loop that performs the reads looks like this:

   address = PCMCIA_ATTRIBUTE_ADDR + i;
   HAL_READ_UINT16( address, cis_content );

and the hangs happens during the HAL_READ_UINT16. I looked
at the assembler that is generated, and besides being more
verbose, the GNU code uses an LHZ instruction for the
read, while the Metrowerks uses an LHA, hardly a reason
to explain the inexplicable hangup.

Is there anyone that can suggest possible reasons?

Thanks
Tony


____________________________________________________________
Find what you are looking for with the Lycos Yellow Pages
http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-06-18 15:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-18 13:46 [ECOS] PowerPC hangs on memory read Anthony Tonizzo
2004-06-18 14:50 ` Nick Garnett
  -- strict thread matches above, loose matches on Subject: below --
2004-06-18 15:05 Anthony Tonizzo
2004-06-18 15:30 ` Nick Garnett
2004-06-18  1:58 Anthony Tonizzo
2004-06-18  7:48 ` Andrew Lunn

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 read-only IMAP folder(s) and NNTP newsgroup(s).