Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - QNX Reboot Error for MPC8323: (3 Items)
   
QNX Reboot Error for MPC8323  
Hi,

I need a software mechanism to reboot my system (MPC8323) and I tried the shutdown utility, but it show some exception 
while rebooting and doesn't restart the system properly.
So, I decided to understand the following code taken from the directory given below
	bsp-nto640-freescale-mpc8323e-rdb-trunk/src/hardware/startup/boards/mpc8323e-rdb

filename:- callout_reboot_8323rdb.s

.include "callout.ah"		
patcher:
	# R3: syspage paddr
	# R4: syspage vaddr
	# R5: rtn dst offset
	# R6: r/w offset
	# R7: patch data
	# R8: rtn src

	stwu    %r1, -32(%r1)
	mflr    %r0
	stw     %r31, 28(%r1)
	stw     %r0, 36(%r1)
	add     %r31,%r3,%r5
	loadi	%r4, 0xF8000000
	loadi   %r3, 32
	bl      callout_io_map
	sth     %r3, 6(%r31)
	srwi    %r3,%r3, 16
	sth     %r3, 2(%r31)
	lwz     %r0, 36(%r1)
	mtlr    %r0
	lwz     %r31, 28(%r1)
	addi    %r1, %r1, 32
	blr

CALLOUT_START	reboot_mpc8323rdb, 0, patcher
	lis		%r4, 0x1234
	ori		%r4, %r4, 0x5678	
	#disable interrupts
	loadi	%r9,PPC_MSR_EE
	mfmsr	%r8
	andc	%r9,%r8,%r9
	mtmsr	%r9
	isync
	lbz		%r0, 7(%r4)
	rlwinm	%r6, %r0, 0, 24, 30
	stb		%r6, 7(%r4)
1:
	b		1b
CALLOUT_END		reboot_mpc8323rdb

But while going through the code we didn't understand what is happening in it. Please answer the following queries about
 the code.

a)	Here, Patcher is providing an address to Callout, what is that address?	
b)	What is significance of address 28(%r1), 36(%r1), 6(%r31), 2(%r31), 7(%r4) in the code and    what is the link of 
these address with System Page Entries?
c)     If possible plz explain the complete flow.


Thanks,

Regards,
Apurva
Re: QNX Reboot Error for MPC8323  
What is the exception that is shown when you use the shutdown utility to
halt the system?
Re: QNX Reboot Error for MPC8323  
Hi,

This is what I get while shutting down.

Shutdown[0,0] S/C/F=10/3/33 C/D=0021c2a8/00289cac state(c0)= now lock
QNX Version 6.4.1 Release 2009/05/20-17:30:49EDT
[0]PID-TID=1-9? P/T FL=00019001/04020000 "proc/boot/procnto-600"
[0]ASPACE PID=28682 PF=00000000 "proc/boot/shutdown"
ppcbe context[03fedf10]:
0000: 00000000 03fedfc0 0028e320 0000b000 34000000 04020000 00000000 00000000
0020: 00009032 00001032 00287120 00009032 42042042 002902a4 00000000 00000000
0040: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00289ca8
0060: 00008000 00000000 03fb7fc0 00287120 00000001 00000000 03ff7d78 03ff7a98
0080: 0000b860 0024c234 00041030 0000b888 42000042 00000000 03ff7a98 03fe18fc
00a0: 03fedff0
instruction[0000b888]:
98 c4 00 07 48 00 00 00 38 63 05 d8 80 04 00 30 7c 16 03 a6 7c ac 42 a6 7c a5
stack[03fedfc0]:
0000: 03fedfe0 00000000 480420e4 00289ca8 03fedff0 00000000 00000008 48041f82
0020: 03fedff0 002665ac 03ff7d78 03ff7a98 00000000 00282090 00000000 00000000
0040: 00000000 00000000 00000000 00000000 00000000 00000000 03ffa000 03ffa000
0060: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000ø3

After this above stuff u-boot starts again.