Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jul 2007 17:01:12 -0700 (PDT)
From:      Neelkanth Natu <neelnatu@yahoo.com>
To:        Bruce M Simpson <bms@incunabulum.net>, Oleksandr Tymoshenko <gonzo@univ.kiev.ua>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: FreeBSD/MIPS platforms question
Message-ID:  <345835.11930.qm@web34404.mail.mud.yahoo.com>
In-Reply-To: <469D1652.60608@incunabulum.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--- Bruce M Simpson <bms@incunabulum.net> wrote:

> Oleksandr Tymoshenko wrote:
> >     Hi! I'm adding ADM5120 support to p4 repo right now and stumbled
> > upon the routine of setting memory size/timer frequency parameters,
> > implementations of platform_reset and other functions of platform_ 
> > family.
> > For instance sentry5 uses CFM, malta and PMC boards utilize yamon and
> > ADM5120 code gets these parameters as argc, argv of entry point.
> > I think of moving all platform_XXX and mips_init routine to
> > platform-related machdep file in platform dir, just like in -arm tree 
> > e.g.
> > mips32/sentry5/setnty5_machdep.c
> > mips32/adm5120/adm5120_machdep.c
> > etc..
> >
> > What's your opinion?
> >
> 
> Seems reasonable. Be aware of register arguments in locore being used 
> differently by the various firmware. I think I dealt with this OK, let 
> me know if I missed something.

I changed how this works in my tree. Instead of doing firmware specific stuff
in locore.s, I call a function save_bootargs(a0,a1,a2,a3) the very first thing
after the setting up the stack in locore.S.

The save_bootargs() function is implemented in machdep.c and simply copies its
arguments to a global array of type register_t. This way the code in mips_init()
can interpret the register arguments passed by the firmware in whatever way it
sees fit. It completely frees locore.S of knowing what firware booted it.

The only tricky thing about this was making sure that 'register_t bootargs[4]'
ended up in the data section. Otherwise it would be overwritten when we zero bss.

If this is something we want to commit I can generate a patch.

best
Neel

> 
> I sent a mail to the gxemul maintainer and he was happy to incorporate 
> my patches for the YAMON sysreqs which real YAMON implementations 
> implement for this stuff.
> 
> CFE is a far more complete firmware than PMON and is generally more 
> helpful to kernel hackers than PMON is.
> Sadly I haven't had any more free time to work on Sentry5 since 
> April/May. I have chip docs, but still haven't quite got the PCI bus 
> enumeration right.
> 
> Cheers...
> BMS
> _______________________________________________
> freebsd-mips@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-mips
> To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org"
> 



       
____________________________________________________________________________________Ready for the edge of your seat? 
Check out tonight's top picks on Yahoo! TV. 
http://tv.yahoo.com/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?345835.11930.qm>