Subject: Re: Newbie looking to figure out how to do a port!
To: Peter Seebach <seebs@plethora.net>
From: Jachym Holecek <freza@dspfpga.com>
List: tech-ports
Date: 02/17/2006 17:13:58
Hello,

> The first thing that I'm having trouble with (no, really, it's not gonna be
> this bad ALL the way through) is in locore.S.
> 
> RIGHT up at the top of the file.
> 
>         /* Get the board_config_data from openbios */
>         //lis   %r3,BOARD_CFG_FP@h
>         //ori   %r3,%r3,BOARD_CFG_FP@l
>         //mr    %r31,%r3                /* Save value in r31 */
> 
> The problem here is that, while I am pretty sure there is no
> board_config_data, and no openbios... I do not know whether I should just
> leave this commented out, or should also replace it with something else,
> because I don't know what this is doing.  It looks like it's grabbing a
> single value from an address BOARD_CFG_FP into r31, but I don't see anything
> USING this.

For your redboot-based board, you can probably kill this code
and further, if you find out RB actually passes some interesting
information down to the OS, you would write support for that from
scratch (well -- that's what I'd do).

I guess you already figured how it works, but for the record:

walnut_start.S:
	lis   %r3,BOARD_CFG_FP@h
	ori   %r3,%r3,BOARD_CFG_FP@l
	mr    %r31,%r3 			/* Save value in r31 */
	...
	mr      %r6,%r31 		/* r6 = r31 */
	bl      _C_LABEL(initppc)
	bl 	_C_LABEL(main)


machdep.c:
	void
	initppc(u_int startkernel, 	/* r3 */
		u_int endkernel, 	/* r4 */
		char *args, 		/* r5 */
		void *info_block) 	/* r6 -- Here we go */

> Anyway, if there's any obvious points to look at for "machine reboots long
> before console attach", I wouldn't mind pointers.  I am pretty sure this
> kernel shouldn't work, because all I've done so far is comment out the
> things that clearly depend on openbios, and clean up some macro names and
> such for the consinit code, which OUGHT to be the same on all 405GPr systems,
> since the UART is on-chip.

What Ben Harris and Nathan Williams said ;-)

	-- Jachym