Sign in

username:

password:



Not a member?

Search Comp.Arch.Embedded



Search tips

embedded by Keywords

68HC11 | 68HC12 | 8051 | 8052 | ARM | ARM7 | Asic | AT91 | AT91RM9200 | Atmel | AVR | AVRStudio | Bootloader | CFP | CompactFlash | Cygnal | Cypress | Dataflash | DSP | eCos | EEPROM | Embedded Linux | Emulator | Endian | Ethernet | Firewire | FPGA | Freescale | GCC | GNUARM | GSM | H8 | HDLC | I2C | Infineon | Interrupts | Java | JTAG | LCD | LED | LPC2000 | MCU | Microchip | MMC | MPLAB | MSP430 | PC104 | PCB | PCI | PCMCIA | PowerPC | Rabbit | RS232 | RS485 | RTOS | SBC | SDRAM | Sensor | SPI | STK500 | UART | UML | USART | USB | Verilog | VHDL | VxWorks | Xilinx

Discussion Groups

Discussion Groups | Comp.Arch.Embedded | PowerPC MPC5200B, changing mode to run in little endian

There are 2 messages in this thread.

You are currently looking at messages 0 to 2.

PowerPC MPC5200B, changing mode to run in little endian - Taran - 01:05 22-08-07



Hi,

We are using Lite5200B eval board, out software is compiled using the
Windriver diab 5.3.1.0 with the 5200B patch. We are using the
WindRiver ICE for downloading the executable to the board and stepping
through.

We have our software with the MPC5200B running in default big endian
mode. Because the PCI bus is little endian mode we are evaluating the
impact on software if we switch the processor from big-to-little
endian mode. We have a lot of graphics data on PCI.

I have gone through the e300 core and the MPC5200B user manual. All
that I could find is that the MSR[LE] bit has to be set followed by
HID2[LET] bit to run the processor in the little endian mode. The diab
compiler option -Xendian-little was added so that the source is
compiled for little endian mode.

The setting of MSR[LE] and HID2[LET] is done in the crt0 at the reset
vector (section of crt0):

#This is the reset vector
START:
_start:
       xor r2,r2,r2
       oris r2,r2,0x800  #get into r2 0x0800_0000
       mtspr HID2,r2	  #set LET in HID2
       isync
       sync		    # wait for completion
       mfmsr r3          # move value from MSR
       ori r3,r3, 0x01	 # set the LE  bit to run in little endian mode
       mtmsr r3	 # move the value back to the MSR
       isync
       sync                 #initialize stack
       addis		r11,r0,_ld_stack_end@ha	   # Initialize stack pointer r1
to

# THIS IS WHERE THE emulator cannot step through

	addi		r1,r11,_ld_stack_end@l	     # value in linker command file.
	addis		r13,r0,_SDA_BASE_@ha	# Initialize r13 to sdata base
	addi		r13,r13,_SDA_BASE_@l	 # (provided by linker).
	addis		r2,r0,_SDA2_BASE_@ha	# Initialize r2 to sdata2 base
	addi		r2,r2,_SDA2_BASE_@l	  # (provided by linker).
	addi		r0,r0,0			               # Clear r0.
	stwu		r0,-64(r1)	 	             # Terminate stack.

Is there something extra that needs to be done to change the endian-
ness of the processor to little endian?

Any help or pointers are appreciated.
Thanks in advance.

Regards,
Taran Tripathi


Re: PowerPC MPC5200B, changing mode to run in little endian - Paul Genua - 14:14 22-08-07

Another option should be to set the PCI up in the MMU with the 'E'
option. This would effectively create an MMU page for PCI that
operates in little endian - the MMU would essentially do the big/
little endian conversion for you.

 ... Paul


On Aug 22, 1:05 am, Taran <taran.tripa...@gmail.com> wrote:
> Hi,
>
> We are using Lite5200B eval board, out software is compiled using the
> Windriver diab 5.3.1.0 with the 5200B patch. We are using the
> WindRiver ICE for downloading the executable to the board and stepping
> through.
>
> We have our software with the MPC5200B running in default big endian
> mode. Because the PCI bus is little endian mode we are evaluating the
> impact on software if we switch the processor from big-to-little
> endian mode. We have a lot of graphics data on PCI.
>
> I have gone through the e300 core and the MPC5200B user manual. All
> that I could find is that the MSR[LE] bit has to be set followed by
> HID2[LET] bit to run the processor in the little endian mode. The diab
> compiler option -Xendian-little was added so that the source is
> compiled for little endian mode.
>
> The setting of MSR[LE] and HID2[LET] is done in the crt0 at the reset
> vector (section of crt0):
>
> #This is the reset vector
> START:
> _start:
>        xor r2,r2,r2
>        oris r2,r2,0x800  #get into r2 0x0800_0000
>        mtspr HID2,r2      #set LET in HID2
>        isync
>        sync                 # wait for completion
>        mfmsr r3          # move value from MSR
>        ori r3,r3, 0x01   # set the LE  bit to run in little endian mode
>        mtmsr r3  # move the value back to the MSR
>        isync
>        sync                 #initialize stack
>        addis            r11,r0,_ld_stack_end@ha    # Initialize stack pointer r1
> to
>
> # THIS IS WHERE THE emulator cannot step through
>
>         addi            r1,r11,_ld_stack_end@l       # value in linker command file.
>         addis           r13,r0,_SDA_BASE_@ha    # Initialize r13 to sdata base
>         addi            r13,r13,_SDA_BASE_@l     # (provided by linker).
>         addis           r2,r0,_SDA2_BASE_@ha    # Initialize r2 to sdata2 base
>         addi            r2,r2,_SDA2_BASE_@l       # (provided by linker).
>         addi            r0,r0,0                                # Clear r0.
>         stwu            r0,-64(r1)                           # Terminate stack.
>
> Is there something extra that needs to be done to change the endian-
> ness of the processor to little endian?
>
> Any help or pointers are appreciated.
> Thanks in advance.
>
> Regards,
> Taran Tripathi