* [MPC7448] machdep_calls
@ 2008-08-18 8:45 Sébastien Chrétien
2008-08-18 9:27 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 11+ messages in thread
From: Sébastien Chrétien @ 2008-08-18 8:45 UTC (permalink / raw)
To: Linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 213 bytes --]
Hello,
I am developping a Linux for my PPC Board. I must write a define_machine
structure (marchdep_calls). Where can I find some Information about
functions of this structure ?
Thanx
Sébastien Chrétien
[-- Attachment #2: Type: text/html, Size: 237 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [MPC7448] machdep_calls
2008-08-18 8:45 [MPC7448] machdep_calls Sébastien Chrétien
@ 2008-08-18 9:27 ` Benjamin Herrenschmidt
2008-08-18 11:22 ` Sébastien Chrétien
0 siblings, 1 reply; 11+ messages in thread
From: Benjamin Herrenschmidt @ 2008-08-18 9:27 UTC (permalink / raw)
To: Sébastien Chrétien; +Cc: Linuxppc-dev
On Mon, 2008-08-18 at 10:45 +0200, Sébastien Chrétien wrote:
> Hello,
>
> I am developping a Linux for my PPC Board. I must write a
> define_machine structure (marchdep_calls). Where can I find some
> Information about functions of this structure ?
It isn't well documented unfortunately. Best is to look at what others
do... and then find your way through.
I agree somebody should write dome doco one day ... in the meantime,
feel free to ask questions here.
Cheers,
Ben.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [MPC7448] machdep_calls
2008-08-18 9:27 ` Benjamin Herrenschmidt
@ 2008-08-18 11:22 ` Sébastien Chrétien
2008-08-18 11:35 ` Sébastien Chrétien
0 siblings, 1 reply; 11+ messages in thread
From: Sébastien Chrétien @ 2008-08-18 11:22 UTC (permalink / raw)
To: benh; +Cc: Linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 636 bytes --]
Ok I am going to copy some examples.
2008/8/18, Benjamin Herrenschmidt <benh@kernel.crashing.org>:
>
> On Mon, 2008-08-18 at 10:45 +0200, Sébastien Chrétien wrote:
> > Hello,
> >
> > I am developping a Linux for my PPC Board. I must write a
> > define_machine structure (marchdep_calls). Where can I find some
> > Information about functions of this structure ?
>
>
> It isn't well documented unfortunately. Best is to look at what others
> do... and then find your way through.
>
> I agree somebody should write dome doco one day ... in the meantime,
> feel free to ask questions here.
>
> Cheers,
> Ben.
>
>
>
[-- Attachment #2: Type: text/html, Size: 924 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [MPC7448] machdep_calls
2008-08-18 11:22 ` Sébastien Chrétien
@ 2008-08-18 11:35 ` Sébastien Chrétien
2008-08-18 12:20 ` Michael Ellerman
2008-08-18 21:11 ` Benjamin Herrenschmidt
0 siblings, 2 replies; 11+ messages in thread
From: Sébastien Chrétien @ 2008-08-18 11:35 UTC (permalink / raw)
To: benh; +Cc: Linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 836 bytes --]
Can somebody explain me the aim of the function "setup_arch" in the
machine_call structure ?
2008/8/18, Sébastien Chrétien <sebastien.chretien.enseirb@gmail.com>:
>
> Ok I am going to copy some examples.
>
> 2008/8/18, Benjamin Herrenschmidt <benh@kernel.crashing.org>:
>>
>> On Mon, 2008-08-18 at 10:45 +0200, Sébastien Chrétien wrote:
>> > Hello,
>> >
>> > I am developping a Linux for my PPC Board. I must write a
>> > define_machine structure (marchdep_calls). Where can I find some
>> > Information about functions of this structure ?
>>
>>
>> It isn't well documented unfortunately. Best is to look at what others
>> do... and then find your way through.
>>
>> I agree somebody should write dome doco one day ... in the meantime,
>> feel free to ask questions here.
>>
>> Cheers,
>> Ben.
>>
>>
>>
>
[-- Attachment #2: Type: text/html, Size: 1504 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [MPC7448] machdep_calls
2008-08-18 11:35 ` Sébastien Chrétien
@ 2008-08-18 12:20 ` Michael Ellerman
2008-08-18 14:17 ` Sébastien Chrétien
2008-08-18 21:11 ` Benjamin Herrenschmidt
1 sibling, 1 reply; 11+ messages in thread
From: Michael Ellerman @ 2008-08-18 12:20 UTC (permalink / raw)
To: Sébastien Chrétien; +Cc: Linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 684 bytes --]
On Mon, 2008-08-18 at 13:35 +0200, Sébastien Chrétien wrote:
> Can somebody explain me the aim of the function "setup_arch" in the
> machine_call structure ?
Is this MPC7448 anything like an mpc7448hpc2 ?
If so maybe you should start by looking at the code for it in:
arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
Even if it's not related, that will give you some idea of what the
callbacks are for.
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [MPC7448] machdep_calls
2008-08-18 12:20 ` Michael Ellerman
@ 2008-08-18 14:17 ` Sébastien Chrétien
2008-08-18 21:39 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 11+ messages in thread
From: Sébastien Chrétien @ 2008-08-18 14:17 UTC (permalink / raw)
To: michael; +Cc: Linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1079 bytes --]
The mpc7448hpc2 uses a tsi108-bridge. My board uses an IP on a FPGA.. I read
the code of mpc7448_hpc2.c.
It uses a ioremap in order to iniatilize the tsi108 registers. But I have
already initialized MMU with my registers in HEAD_32.S. Do I need to use
ioremap in setup_arch() ?
2008/8/18, Michael Ellerman <michael@ellerman.id.au>:
>
> On Mon, 2008-08-18 at 13:35 +0200, Sébastien Chrétien wrote:
> > Can somebody explain me the aim of the function "setup_arch" in the
> > machine_call structure ?
>
>
> Is this MPC7448 anything like an mpc7448hpc2 ?
>
> If so maybe you should start by looking at the code for it in:
>
> arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
>
> Even if it's not related, that will give you some idea of what the
> callbacks are for.
>
> cheers
>
> --
> Michael Ellerman
> OzLabs, IBM Australia Development Lab
>
> wwweb: http://michael.ellerman.id.au
> phone: +61 2 6212 1183 (tie line 70 21183)
>
> We do not inherit the earth from our ancestors,
> we borrow it from our children. - S.M.A.R.T Person
>
>
[-- Attachment #2: Type: text/html, Size: 1448 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [MPC7448] machdep_calls
2008-08-18 11:35 ` Sébastien Chrétien
2008-08-18 12:20 ` Michael Ellerman
@ 2008-08-18 21:11 ` Benjamin Herrenschmidt
1 sibling, 0 replies; 11+ messages in thread
From: Benjamin Herrenschmidt @ 2008-08-18 21:11 UTC (permalink / raw)
To: Sébastien Chrétien; +Cc: Linuxppc-dev
On Mon, 2008-08-18 at 13:35 +0200, Sébastien Chrétien wrote:
> Can somebody explain me the aim of the function "setup_arch" in the
> machine_call structure ?
This is where most of your arch code gets a chance to initialize before
most of the core is.
The generic core linux code calls the architecture setup_arch() very
early during boot, before most other initializations. The powerpc
architecture code performs various early initialisations there, on
32-bit that includes unflattening the device-tree, looking for legacy
serial ports, etc... and initializing bootmem.
It then calls ppc_md.setup_arch to give the platform a chance to perform
other platform specific early initializations before the rest of the
kernel starts initializing.
This is very early, ie, for memory allocation you can only use bootmem
for example. Interrupts haven't been initialized or switched on yet,
etc...
This is typically the place where your arch code will setup it's SMP ops
if any, will discover the fixed PCI host bridges, and initialize low
level HW components that need early initialization.
Ben.
> 2008/8/18, Sébastien Chrétien <sebastien.chretien.enseirb@gmail.com>:
> Ok I am going to copy some examples.
>
> 2008/8/18, Benjamin Herrenschmidt <benh@kernel.crashing.org>:
> On Mon, 2008-08-18 at 10:45 +0200, Sébastien Chrétien
> wrote:
> > Hello,
> >
> > I am developping a Linux for my PPC Board. I must
> write a
> > define_machine structure (marchdep_calls). Where can
> I find some
> > Information about functions of this structure ?
>
>
> It isn't well documented unfortunately. Best is to
> look at what others
> do... and then find your way through.
>
> I agree somebody should write dome doco one day ... in
> the meantime,
> feel free to ask questions here.
>
> Cheers,
> Ben.
>
>
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [MPC7448] machdep_calls
2008-08-18 14:17 ` Sébastien Chrétien
@ 2008-08-18 21:39 ` Benjamin Herrenschmidt
2008-08-19 7:00 ` Sébastien Chrétien
0 siblings, 1 reply; 11+ messages in thread
From: Benjamin Herrenschmidt @ 2008-08-18 21:39 UTC (permalink / raw)
To: Sébastien Chrétien; +Cc: Linuxppc-dev
On Mon, 2008-08-18 at 16:17 +0200, Sébastien Chrétien wrote:
> The mpc7448hpc2 uses a tsi108-bridge. My board uses an IP on a FPGA..
> I read the code of mpc7448_hpc2.c.
> It uses a ioremap in order to iniatilize the tsi108 registers. But I
> have already initialized MMU with my registers in HEAD_32.S. Do I need
> to use ioremap in setup_arch() ?
Why did you hack head_32.S ? You shouldn't do that... This is common
code, not platform code.
Ben.
>
>
>
> 2008/8/18, Michael Ellerman <michael@ellerman.id.au>:
> On Mon, 2008-08-18 at 13:35 +0200, Sébastien Chrétien wrote:
> > Can somebody explain me the aim of the
> function "setup_arch" in the
> > machine_call structure ?
>
>
> Is this MPC7448 anything like an mpc7448hpc2 ?
>
> If so maybe you should start by looking at the code for it in:
>
> arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
>
> Even if it's not related, that will give you some idea of what
> the
> callbacks are for.
>
> cheers
>
> --
> Michael Ellerman
> OzLabs, IBM Australia Development Lab
>
> wwweb: http://michael.ellerman.id.au
> phone: +61 2 6212 1183 (tie line 70 21183)
>
> We do not inherit the earth from our ancestors,
> we borrow it from our children. - S.M.A.R.T Person
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [MPC7448] machdep_calls
2008-08-18 21:39 ` Benjamin Herrenschmidt
@ 2008-08-19 7:00 ` Sébastien Chrétien
2008-08-19 7:27 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 11+ messages in thread
From: Sébastien Chrétien @ 2008-08-19 7:00 UTC (permalink / raw)
To: benh; +Cc: Linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1991 bytes --]
I have no screen that's why I have to use UART. I followed the CPM model in
head_32.S :
#ifdef CONFIG_PPC_EARLY_DEBUG_CPM
setup_cpm_bat:
lis r8, 0xf000
ori r8, r8, 0x002a
mtspr SPRN_DBAT1L, r8
lis r11, 0xf000
ori r11, r11, (BL_1M << 2) | 2
mtspr SPRN_DBAT1U, r11
blr
#endif
With this code I can use udbg.
According to you, what is the best way ?
2008/8/18, Benjamin Herrenschmidt <benh@kernel.crashing.org>:
>
> On Mon, 2008-08-18 at 16:17 +0200, Sébastien Chrétien wrote:
> > The mpc7448hpc2 uses a tsi108-bridge. My board uses an IP on a FPGA..
> > I read the code of mpc7448_hpc2.c.
> > It uses a ioremap in order to iniatilize the tsi108 registers. But I
> > have already initialized MMU with my registers in HEAD_32.S. Do I need
> > to use ioremap in setup_arch() ?
>
>
> Why did you hack head_32.S ? You shouldn't do that... This is common
> code, not platform code.
>
> Ben.
>
> >
> >
> >
> > 2008/8/18, Michael Ellerman <michael@ellerman.id.au>:
> > On Mon, 2008-08-18 at 13:35 +0200, Sébastien Chrétien wrote:
> > > Can somebody explain me the aim of the
> > function "setup_arch" in the
> > > machine_call structure ?
> >
> >
> > Is this MPC7448 anything like an mpc7448hpc2 ?
> >
> > If so maybe you should start by looking at the code for it in:
> >
> > arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
> >
> > Even if it's not related, that will give you some idea of what
> > the
> > callbacks are for.
> >
> > cheers
> >
> > --
> > Michael Ellerman
> > OzLabs, IBM Australia Development Lab
> >
> > wwweb: http://michael.ellerman.id.au
> > phone: +61 2 6212 1183 (tie line 70 21183)
> >
> > We do not inherit the earth from our ancestors,
> > we borrow it from our children. - S.M.A.R.T Person
> >
> >
>
>
[-- Attachment #2: Type: text/html, Size: 3548 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [MPC7448] machdep_calls
2008-08-19 7:00 ` Sébastien Chrétien
@ 2008-08-19 7:27 ` Benjamin Herrenschmidt
2008-08-19 9:23 ` Sébastien Chrétien
0 siblings, 1 reply; 11+ messages in thread
From: Benjamin Herrenschmidt @ 2008-08-19 7:27 UTC (permalink / raw)
To: Sébastien Chrétien; +Cc: Linuxppc-dev
On Tue, 2008-08-19 at 09:00 +0200, Sébastien Chrétien wrote:
> I have no screen that's why I have to use UART. I followed the CPM
> model in head_32.S :
> #ifdef CONFIG_PPC_EARLY_DEBUG_CPM
> setup_cpm_bat:
> lis r8, 0xf000
> ori r8, r8, 0x002a
> mtspr SPRN_DBAT1L, r8
>
> lis r11, 0xf000
> ori r11, r11, (BL_1M << 2) | 2
> mtspr SPRN_DBAT1U, r11
>
> blr
> #endif
The "EARLY DEBUG" stuff is a pile of hacks to help with bringup,
it's definitely not a long term solution to your problems.
You may also want to look at Grant Likely's work on doing proper
early ioremap using BATs.
> With this code I can use udbg.
>
> According to you, what is the best way ?
The above is fine for early debug console. But that's definitely
not the only kind of thing you may want to put in your setup_arch()...
Look at what others do.
Ben.
> 2008/8/18, Benjamin Herrenschmidt <benh@kernel.crashing.org>:
> On Mon, 2008-08-18 at 16:17 +0200, Sébastien Chrétien wrote:
> > The mpc7448hpc2 uses a tsi108-bridge. My board uses an IP on
> a FPGA..
> > I read the code of mpc7448_hpc2.c.
> > It uses a ioremap in order to iniatilize the tsi108
> registers. But I
> > have already initialized MMU with my registers in HEAD_32.S.
> Do I need
> > to use ioremap in setup_arch() ?
>
>
> Why did you hack head_32.S ? You shouldn't do that... This is
> common
> code, not platform code.
>
> Ben.
>
> >
> >
> >
> > 2008/8/18, Michael Ellerman <michael@ellerman.id.au>:
> > On Mon, 2008-08-18 at 13:35 +0200, Sébastien
> Chrétien wrote:
> > > Can somebody explain me the aim of the
> > function "setup_arch" in the
> > > machine_call structure ?
> >
> >
> > Is this MPC7448 anything like an mpc7448hpc2 ?
> >
> > If so maybe you should start by looking at the code
> for it in:
> >
> > arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
> >
> > Even if it's not related, that will give you some
> idea of what
> > the
> > callbacks are for.
> >
> > cheers
> >
> > --
> > Michael Ellerman
> > OzLabs, IBM Australia Development Lab
> >
> > wwweb: http://michael.ellerman.id.au
> > phone: +61 2 6212 1183 (tie line 70 21183)
> >
> > We do not inherit the earth from our ancestors,
> > we borrow it from our children. - S.M.A.R.T Person
> >
> >
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [MPC7448] machdep_calls
2008-08-19 7:27 ` Benjamin Herrenschmidt
@ 2008-08-19 9:23 ` Sébastien Chrétien
0 siblings, 0 replies; 11+ messages in thread
From: Sébastien Chrétien @ 2008-08-19 9:23 UTC (permalink / raw)
To: benh; +Cc: Linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 3243 bytes --]
So I will write .setup_arch of machine_call structure.
When is ppc_md.setup_arch() called ?
2008/8/19, Benjamin Herrenschmidt <benh@kernel.crashing.org>:
>
> On Tue, 2008-08-19 at 09:00 +0200, Sébastien Chrétien wrote:
> > I have no screen that's why I have to use UART. I followed the CPM
> > model in head_32.S :
> > #ifdef CONFIG_PPC_EARLY_DEBUG_CPM
> > setup_cpm_bat:
> > lis r8, 0xf000
> > ori r8, r8, 0x002a
> > mtspr SPRN_DBAT1L, r8
> >
> > lis r11, 0xf000
> > ori r11, r11, (BL_1M << 2) | 2
> > mtspr SPRN_DBAT1U, r11
> >
> > blr
> > #endif
>
>
> The "EARLY DEBUG" stuff is a pile of hacks to help with bringup,
> it's definitely not a long term solution to your problems.
>
> You may also want to look at Grant Likely's work on doing proper
> early ioremap using BATs.
>
>
> > With this code I can use udbg.
> >
> > According to you, what is the best way ?
>
>
> The above is fine for early debug console. But that's definitely
> not the only kind of thing you may want to put in your setup_arch()...
> Look at what others do.
>
> Ben.
>
>
> > 2008/8/18, Benjamin Herrenschmidt <benh@kernel.crashing.org>:
> > On Mon, 2008-08-18 at 16:17 +0200, Sébastien Chrétien wrote:
> > > The mpc7448hpc2 uses a tsi108-bridge. My board uses an IP on
> > a FPGA..
> > > I read the code of mpc7448_hpc2.c.
> > > It uses a ioremap in order to iniatilize the tsi108
> > registers. But I
> > > have already initialized MMU with my registers in HEAD_32.S.
> > Do I need
> > > to use ioremap in setup_arch() ?
> >
> >
> > Why did you hack head_32.S ? You shouldn't do that... This is
> > common
> > code, not platform code.
> >
> > Ben.
> >
> > >
> > >
> > >
> > > 2008/8/18, Michael Ellerman <michael@ellerman.id.au>:
> > > On Mon, 2008-08-18 at 13:35 +0200, Sébastien
> > Chrétien wrote:
> > > > Can somebody explain me the aim of the
> > > function "setup_arch" in the
> > > > machine_call structure ?
> > >
> > >
> > > Is this MPC7448 anything like an mpc7448hpc2 ?
> > >
> > > If so maybe you should start by looking at the code
> > for it in:
> > >
> > > arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
> > >
> > > Even if it's not related, that will give you some
> > idea of what
> > > the
> > > callbacks are for.
> > >
> > > cheers
> > >
> > > --
> > > Michael Ellerman
> > > OzLabs, IBM Australia Development Lab
> > >
> > > wwweb: http://michael.ellerman.id.au
> > > phone: +61 2 6212 1183 (tie line 70 21183)
> > >
> > > We do not inherit the earth from our ancestors,
> > > we borrow it from our children. - S.M.A.R.T Person
> > >
> > >
> >
> >
>
>
[-- Attachment #2: Type: text/html, Size: 7166 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-08-19 9:23 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-18 8:45 [MPC7448] machdep_calls Sébastien Chrétien
2008-08-18 9:27 ` Benjamin Herrenschmidt
2008-08-18 11:22 ` Sébastien Chrétien
2008-08-18 11:35 ` Sébastien Chrétien
2008-08-18 12:20 ` Michael Ellerman
2008-08-18 14:17 ` Sébastien Chrétien
2008-08-18 21:39 ` Benjamin Herrenschmidt
2008-08-19 7:00 ` Sébastien Chrétien
2008-08-19 7:27 ` Benjamin Herrenschmidt
2008-08-19 9:23 ` Sébastien Chrétien
2008-08-18 21:11 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).