[ECOS] New IMMR address not recognized

Paul Fine pfine@delcomsys.com
Thu Nov 7 08:29:00 GMT 2002

I guess that I am a little confused.

You boot your board using JTAG, including initializing the SDRAM and 
setting the IMMR so that the Internal Memory Mapped Registers have a base 
of 0xF0000000.

Now I am going to start to guess what you did.

You built an eCos kernel using the ts6 target (which is our custom board, 
which you probably don't have, but if you do, let me know).  You then built 
your application against the eCos kernel.  You made some changes to the 
kernel, specifically in ts6.S, which contains the assembly language 
function "hal_hardware_init".  I assume that you then load the application 
into SDRAM using JTAG, and step through the hal_hardware_init code single 
step (also using JTAG) so that you see the internal registers changing in 
the 0xF000xxxx memory space.

You then let the code run, and at some point it crashes with a segmentation 
fault on trying to write to an internal memory mapped register.

The hal_hardware_init function for ts6
         1) checks the NHR bit in the HID0 to see if the IMMR and SDRAM 
(and other stuff) needs to be initialized due to a hard reset.
         2) If NHR is not set, then 0x04700000 is loaded to the IMMR, 
assuming that the hard reset value for the IMMR is 0x0F000000.
         3) The NHR bit of the HID0 is set, and the rest of the 
initialization is done.

If you are initializing the IMMR and SDRAM via JTAG, but not setting the 
NHR bit, that could be a problem, since the init code will try to redo what 
you did via JTAG.  I am surprised that it gets past where the we write to 
the IMMR, since you moved the IMMR.

At 10:10 AM 11/7/2002 -0500, Cusson, Pascal wrote:
>Hi Paul,
>    First I am not using the RedBoot. I am using a JTAG to boot my board.
>The JTAG configures the IMMR as well as the SDRAM. I have been using
>that configuration for about 2 months and without any problem. From what
>I have tried, I cannot access any of the registers. All of them give me
>a signal error - > IGSIGV which display a Segmentation Fault in
>   The strange thing here is that in hal/powerpc/ts6/current/src/ts6.S I
>set a few register and they all get set properly when I read them back
>with my JTAG. Once I get my application running, I get the segmentation
>fault on any attempt to read or write a mapped register.
>   One more thing, I can write at address 0x04700000 which should give a
>segmentation fault since my IMMR is at address 0xf0000000 and not
>0x04700000 anymore. I can confirm this through my JTAG
>    The code was originally written for an IMMR at 0x04700000 but for
>memory reason and because of my previous application, I had to move the
>IMMR at 0xF0000000.
>    It looks like somehow, the addresses 0xf0000000 are blocked. Is there
>such a mechanism in eCos ?
>If you can think of anything, please let me know.
>Best regards,
>-----Original Message-----
>From: Paul Fine [mailto:pfine@delcomsys.com]
>Sent: Thursday, November 07, 2002 9:33 AM
>To: Cusson, Pascal; Patrick Doyle
>Cc: ecos-discuss@sources.redhat.com
>Subject: Re: [ECOS] New IMMR address not recognized
>Is it just one specific register in the 0xF001xxxx memory space that
>the segmentation fault, or is it any memory address in the range?
>You can read the value of the IMMR.  For instance, at the RedBoot
>prompt, I
>can type
>          RedBoot> x -b 0x047101a8 -4 -l 4
>          047101A8: 04700011
>          RedBoot>
>The upper 16 bits (0470) tell me that the internal memory mapped
>are at base 0x04700000.  The lower 16 bits give version information.
>If the value of the IMMR that you read is similar to the one I am
>here, then I am not surprised that writing to an address in the range
>0xF001xxxx crashes the PPC.
>How are you changing the IMMR?  Are you loading code with RedBoot?
>At 03:44 PM 11/6/2002 -0500, Cusson, Pascal wrote:
> >Hi Patrick,
> >    I have a small question for you on the 8260 port you gave me. I am
> > trying to make my IMMR 0xF0000000 instead of 0x04700000. The reason
> > that it is the default on my board and that my entire application uses
> > 0xF0000000.
> >
> >    So far I have modified all files containing 0x04700000 under
> > powerpc/mpc8260 and powerpc/ts6. However, when writing one of the
> > register at address 0xf001xxxx, I get a segmentation fault. Meaning I
> > not writing in at a valid address. However I can write at address
> > 0x04700000 no problem. Is there something else I need to modify in
>eCos ?
> >
> >Thanks for you help
> >
> >Pascal
> >
> >--
> >Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> >and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>Paul Fine
>Senior Member of Technical Staff
>Delphi Communication Systems, Inc.

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

More information about the Ecos-discuss mailing list