From: Jun Sun <jsun@mvista.com>
To: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Cc: "Gleb O. Raiko" <raiko@niisi.msk.ru>,
linux-mips@fnet.fr, linux-mips@oss.sgi.com
Subject: Re: [patch] linux 2.4.5: Export mips_machtype
Date: Thu, 23 Aug 2001 10:05:06 -0700 [thread overview]
Message-ID: <3B8537C2.E18E5125@mvista.com> (raw)
In-Reply-To: Pine.GSO.3.96.1010823174707.21718F-100000@delta.ds2.pg.gda.pl
"Maciej W. Rozycki" wrote:
>
> On Thu, 23 Aug 2001, Gleb O. Raiko wrote:
>
> > In order to read a PCI ID, you need to know how to do it. In pc world,
> > you may rely on configuation access types, at least, ports are known. On
> > other arches, you need to know where such "ports" are. Even if hardware
> > supports, say, configuration type 1 accesses, developers are free to put
> > port addresses anywhere.
>
> Yep, I see. MIPS is quite special here, because, unlike for Alphas,
> PowerPCs, SPARCs, etc. there is a couple of independend vendors making
> systems, so there is no single way of obtaining a system ID. So you need
> to know how to access chipset from elsewhere.
>
> > > How do you set up mips_machtype on your system in the first place? At
> > > kernel_entry the code does not know what machine it's running on anyway,
> > > so it has to set mips_machtype based on a detection algorithm.
> >
> > First, mips_machtype is accessed far later than kernel_entry is
>
> That's quite obvious -- nothing can be done in Linux earlier. ;-) But
> you need to initialize mips_machtype somehow.
>
> > executed. Personally, I am lucky :-), I may read firmware environment
> > variables.
>
> Well, other system might as well (e.g. DECstations can), but that doesn't
> solve the problem -- to access firmware variables you need to know which
> kind of firmware you are on.
>
I talked about machine detection a while back. My idea is following:
0. all machines that are *configured* into the image will supply <my>_detect()
and <my>_setup() functions.
1. at MIPS start up, we loop through all <my>_detect(), which returns three
values, a) run-time detection negative, b) run-time detection positive, and c)
no run-time detection code, but I return positive because I am configured in.
2. the startup code resolves conflicts (which sometimes may panic); and decide
on one machine.
3. then the startup code calls the right <my>_setup() code which will set up
the mach_type and other stuff.
BTW, a side benenfit of doing this is that we can remove all the machine
specific code in common files such as bootinfo.h, setup.c, etc, which are
getting harder and harder to maintain as we are adding more and more embedded
boards to the tree.
If we push it to an extreme by using mechnism like do_initcalls(), we can
achieve zero common source file modification when adding a new a machine.
This will greatly facilitate embedded development as it allows more parallel
development and allow people to maintain their own board code much easier
before the code is submitted to the tree.
Jun
next prev parent reply other threads:[~2001-08-23 17:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-13 13:26 [patch] linux 2.4.5: Export mips_machtype Maciej W. Rozycki
2001-08-13 15:53 ` Ralf Baechle
2001-08-13 16:36 ` Maciej W. Rozycki
2001-08-13 18:27 ` Gleb O. Raiko
2001-08-14 17:43 ` Maciej W. Rozycki
2001-08-15 17:44 ` Keith M Wesolowski
2001-08-15 18:04 ` Ilya Volynets
2001-08-16 8:04 ` Soft-Float emulation with gcc - pr3900 Zoon
2001-08-23 11:38 ` [patch] linux 2.4.5: Export mips_machtype Gleb O. Raiko
2001-08-23 15:59 ` Maciej W. Rozycki
2001-08-23 17:05 ` Jun Sun [this message]
2001-08-23 17:31 ` Maciej W. Rozycki
2001-08-24 9:37 ` Gleb O. Raiko
2001-08-24 15:57 ` Maciej W. Rozycki
2001-08-24 17:23 ` Jun Sun
2001-08-24 9:42 ` Gleb O. Raiko
2001-08-24 16:10 ` Maciej W. Rozycki
2001-08-13 19:39 ` Harald Koerfgen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3B8537C2.E18E5125@mvista.com \
--to=jsun@mvista.com \
--cc=linux-mips@fnet.fr \
--cc=linux-mips@oss.sgi.com \
--cc=macro@ds2.pg.gda.pl \
--cc=raiko@niisi.msk.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox