All of lore.kernel.org
 help / color / mirror / Atom feed
* Moving from arch/ppc to arch/powerpc with an MPC8248 (part 1)
@ 2007-02-14 12:08 Laurent Pinchart
  2007-02-14 13:10 ` Vitaly Bordug
  2007-02-14 20:42 ` Guennadi Liakhovetski
  0 siblings, 2 replies; 8+ messages in thread
From: Laurent Pinchart @ 2007-02-14 12:08 UTC (permalink / raw)
  To: linuxppc-embedded

Hi everybody,

I'm trying to take the big jump and move my (mostly) stable board support from 
arch/ppc to arch/powerpc. I'm still at a very early stage, but here are 
already a few questions.

arch/ppc defines some 8260 generic handlers in syslib/mpc8260_setup.c for 
operations such as halt, reset, show_cpuinfo, ... The MPC82xx ADS in 
arch/powerpc/platforms/82xx redefines those handles as board-specific 
functions. Should they be made generic to all 82xx boards, or should I copy 
them to my board-specific file ? If the code should be shared by all 82xx 
boards, I'll probably end up copying most of the 
arch/ppc/syslib/mpc8260_setup.c code to 
arch/powerpc/platforms/82xx/mpc82xx.c.

Best regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Moving from arch/ppc to arch/powerpc with an MPC8248 (part 1)
  2007-02-14 12:08 Moving from arch/ppc to arch/powerpc with an MPC8248 (part 1) Laurent Pinchart
@ 2007-02-14 13:10 ` Vitaly Bordug
  2007-02-14 13:43   ` Laurent Pinchart
  2007-02-14 20:42 ` Guennadi Liakhovetski
  1 sibling, 1 reply; 8+ messages in thread
From: Vitaly Bordug @ 2007-02-14 13:10 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-embedded

On Wed, 14 Feb 2007 13:08:17 +0100
Laurent Pinchart <laurent.pinchart@technotrade.biz> wrote:

> Hi everybody,
> 
> I'm trying to take the big jump and move my (mostly) stable board support from 
> arch/ppc to arch/powerpc. I'm still at a very early stage, but here are 
> already a few questions.
> 
> arch/ppc defines some 8260 generic handlers in syslib/mpc8260_setup.c for 
> operations such as halt, reset, show_cpuinfo, ... The MPC82xx ADS in 
> arch/powerpc/platforms/82xx redefines those handles as board-specific 
> functions. Should they be made generic to all 82xx boards, or should I copy 
> them to my board-specific file ? If the code should be shared by all 82xx 
> boards, I'll probably end up copying most of the 
> arch/ppc/syslib/mpc8260_setup.c code to 
> arch/powerpc/platforms/82xx/mpc82xx.c.
> 
I'd just copy stuff to the BSP -- let's consider the common/uncommon stuff later when we'll have to add something else.

It's hard to envision what level of code should be common and what should be board-specific as of now.
Otherwise, we'll have to painfully revisit issue later.

-- 
Sincerely, 
Vitaly

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Moving from arch/ppc to arch/powerpc with an MPC8248 (part 1)
  2007-02-14 13:10 ` Vitaly Bordug
@ 2007-02-14 13:43   ` Laurent Pinchart
  2007-02-14 13:53     ` Vitaly Bordug
  0 siblings, 1 reply; 8+ messages in thread
From: Laurent Pinchart @ 2007-02-14 13:43 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: linuxppc-embedded

Hi,

> > I'm trying to take the big jump and move my (mostly) stable board support
> > from arch/ppc to arch/powerpc. I'm still at a very early stage, but here
> > are already a few questions.
> >
> > arch/ppc defines some 8260 generic handlers in syslib/mpc8260_setup.c for
> > operations such as halt, reset, show_cpuinfo, ... The MPC82xx ADS in
> > arch/powerpc/platforms/82xx redefines those handles as board-specific
> > functions. Should they be made generic to all 82xx boards, or should I
> > copy them to my board-specific file ? If the code should be shared by all
> > 82xx boards, I'll probably end up copying most of the
> > arch/ppc/syslib/mpc8260_setup.c code to
> > arch/powerpc/platforms/82xx/mpc82xx.c.
>
> I'd just copy stuff to the BSP -- let's consider the common/uncommon stuff
> later when we'll have to add something else.
>
> It's hard to envision what level of code should be common and what should
> be board-specific as of now. Otherwise, we'll have to painfully revisit
> issue later.

It seems there are still lots of inconsistencies regarding MPC82xx support in 
arch/powerpc. For instance, get_immrbase() is used to get the IMMR address 
from the OF device tree, but cpm2_map() uses the CPM_MAP_ADDR address which 
is platform-dependant, and hardcoded to 0xf0000000 in 
platforms/82xx/pq2ads.h.

Is someone working on fixing MPC82xx support for arch/powerpc ? I don't have 
much time now to hack all the platform-specific code and cleanup 
inconsistencies, so if someone is working on it I'll wait for patches. If 
not, I'll have to work on that later, as time permits. As I'm new to the 
arch/powerpc code, I'd appreciate if someone with a good understanding of 
what should be done could give me a few pointers (such as 'fix the CPM2 
mapping code this way', just general guidelines). Otherwise I'll have to ask 
questions at every line of code.

Best regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Moving from arch/ppc to arch/powerpc with an MPC8248 (part 1)
  2007-02-14 13:43   ` Laurent Pinchart
@ 2007-02-14 13:53     ` Vitaly Bordug
  2007-02-14 13:59       ` Laurent Pinchart
  0 siblings, 1 reply; 8+ messages in thread
From: Vitaly Bordug @ 2007-02-14 13:53 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-embedded

On Wed, 14 Feb 2007 14:43:18 +0100
Laurent Pinchart <laurent.pinchart@technotrade.biz> wrote:

> Hi,
> 
> > > I'm trying to take the big jump and move my (mostly) stable board support
> > > from arch/ppc to arch/powerpc. I'm still at a very early stage, but here
> > > are already a few questions.
> > >
> > > arch/ppc defines some 8260 generic handlers in syslib/mpc8260_setup.c for
> > > operations such as halt, reset, show_cpuinfo, ... The MPC82xx ADS in
> > > arch/powerpc/platforms/82xx redefines those handles as board-specific
> > > functions. Should they be made generic to all 82xx boards, or should I
> > > copy them to my board-specific file ? If the code should be shared by all
> > > 82xx boards, I'll probably end up copying most of the
> > > arch/ppc/syslib/mpc8260_setup.c code to
> > > arch/powerpc/platforms/82xx/mpc82xx.c.
> >
> > I'd just copy stuff to the BSP -- let's consider the common/uncommon stuff
> > later when we'll have to add something else.
> >
> > It's hard to envision what level of code should be common and what should
> > be board-specific as of now. Otherwise, we'll have to painfully revisit
> > issue later.
> 
> It seems there are still lots of inconsistencies regarding MPC82xx support in 
> arch/powerpc. For instance, get_immrbase() is used to get the IMMR address 
> from the OF device tree, but cpm2_map() uses the CPM_MAP_ADDR address which 
> is platform-dependant, and hardcoded to 0xf0000000 in 
> platforms/82xx/pq2ads.h.
> 
Are you using up-to-date powerpc.git? I get rid of hardcoded CPM_MAP_ADDR
completely (or it should be such, heh). please make sure you have my recent commits in.

> Is someone working on fixing MPC82xx support for arch/powerpc ? I don't have 
> much time now to hack all the platform-specific code and cleanup 
> inconsistencies, so if someone is working on it I'll wait for patches. If 
> not, I'll have to work on that later, as time permits. As I'm new to the 
> arch/powerpc code, I'd appreciate if someone with a good understanding of 
> what should be done could give me a few pointers (such as 'fix the CPM2 
> mapping code this way', just general guidelines). Otherwise I'll have to ask 
> questions at every line of code.
> 

Well 827x works perfectly for me, and there are no direct immr dereferences anymore in arch/powerpc...
There still might be gotchas because that merge was sort of one-man-show, but let me know and we'll figure out something.


-- 
Sincerely, 
Vitaly

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Moving from arch/ppc to arch/powerpc with an MPC8248 (part 1)
  2007-02-14 13:53     ` Vitaly Bordug
@ 2007-02-14 13:59       ` Laurent Pinchart
  0 siblings, 0 replies; 8+ messages in thread
From: Laurent Pinchart @ 2007-02-14 13:59 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: linuxppc-embedded

 Hi,

> > > > I'm trying to take the big jump and move my (mostly) stable board
> > > > support from arch/ppc to arch/powerpc. I'm still at a very early
> > > > stage, but here are already a few questions.
> > > >
> > > > arch/ppc defines some 8260 generic handlers in syslib/mpc8260_setup.c
> > > > for operations such as halt, reset, show_cpuinfo, ... The MPC82xx ADS
> > > > in arch/powerpc/platforms/82xx redefines those handles as
> > > > board-specific functions. Should they be made generic to all 82xx
> > > > boards, or should I copy them to my board-specific file ? If the code
> > > > should be shared by all 82xx boards, I'll probably end up copying
> > > > most of the
> > > > arch/ppc/syslib/mpc8260_setup.c code to
> > > > arch/powerpc/platforms/82xx/mpc82xx.c.
> > >
> > > I'd just copy stuff to the BSP -- let's consider the common/uncommon
> > > stuff later when we'll have to add something else.
> > >
> > > It's hard to envision what level of code should be common and what
> > > should be board-specific as of now. Otherwise, we'll have to painfully
> > > revisit issue later.
> >
> > It seems there are still lots of inconsistencies regarding MPC82xx
> > support in arch/powerpc. For instance, get_immrbase() is used to get the
> > IMMR address from the OF device tree, but cpm2_map() uses the
> > CPM_MAP_ADDR address which is platform-dependant, and hardcoded to
> > 0xf0000000 in
> > platforms/82xx/pq2ads.h.
>
> Are you using up-to-date powerpc.git? I get rid of hardcoded CPM_MAP_ADDR
> completely (or it should be such, heh). please make sure you have my recent
> commits in.

I'm using up-to-date linux-2.6.git, which is probably way old compared to 
powerpc.git :-) What's the powerpc.git URL ? Do you plan to push your changes 
upstream for 2.6.21 ?

> > Is someone working on fixing MPC82xx support for arch/powerpc ? I don't
> > have much time now to hack all the platform-specific code and cleanup
> > inconsistencies, so if someone is working on it I'll wait for patches. If
> > not, I'll have to work on that later, as time permits. As I'm new to the
> > arch/powerpc code, I'd appreciate if someone with a good understanding of
> > what should be done could give me a few pointers (such as 'fix the CPM2
> > mapping code this way', just general guidelines). Otherwise I'll have to
> > ask questions at every line of code.
>
> Well 827x works perfectly for me, and there are no direct immr dereferences
> anymore in arch/powerpc... There still might be gotchas because that merge
> was sort of one-man-show, but let me know and we'll figure out something.

I'll have a look at that, thanks.

Laurent Pinchart

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Moving from arch/ppc to arch/powerpc with an MPC8248 (part 1)
  2007-02-14 12:08 Moving from arch/ppc to arch/powerpc with an MPC8248 (part 1) Laurent Pinchart
  2007-02-14 13:10 ` Vitaly Bordug
@ 2007-02-14 20:42 ` Guennadi Liakhovetski
  1 sibling, 0 replies; 8+ messages in thread
From: Guennadi Liakhovetski @ 2007-02-14 20:42 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-embedded

On Wed, 14 Feb 2007, Laurent Pinchart wrote:

> arch/ppc defines some 8260 generic handlers in syslib/mpc8260_setup.c for 
> operations such as halt, reset, show_cpuinfo, ... The MPC82xx ADS in 
> arch/powerpc/platforms/82xx redefines those handles as board-specific 
> functions. Should they be made generic to all 82xx boards, or should I copy 
> them to my board-specific file ? If the code should be shared by all 82xx 
> boards, I'll probably end up copying most of the 
> arch/ppc/syslib/mpc8260_setup.c code to 
> arch/powerpc/platforms/82xx/mpc82xx.c.

Emn, sorry, don't know about 8248 and 8260 specifically, but just looking 
at notation 8248 should be closer to 8245 than to 8260, is it not?

If there are enough similarities, you might also look at 
arch/powerpc/platforms/embedded6xx/linkstation.c for an example of such a 
ppc -> powerpc migration. Not that I considered it an ideal example to 
follow. Rather, if it helps you - good. If you find anything that can be 
improved there - would be happy to know.

Thanks
Guennadi
---
Guennadi Liakhovetski

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Moving from arch/ppc to arch/powerpc with an MPC8248 (part 1)
  2007-02-15 12:43 Heiko Schocher
@ 2007-02-15 16:33 ` Vitaly Bordug
  0 siblings, 0 replies; 8+ messages in thread
From: Vitaly Bordug @ 2007-02-15 16:33 UTC (permalink / raw)
  To: hs; +Cc: linuxppc-embedded

On Thu, 15 Feb 2007 13:43:43 +0100
Heiko Schocher wrote:

> Hello Laurent, Vitaly
> 
> >> Are you using up-to-date powerpc.git? I get rid of hardcoded
> CPM_MAP_ADDR
> >> completely (or it should be such, heh). please make sure you have
> >> my recent
> 
> I found two more in arch/powerpc/sysdev/cpm2_common.c (in actual
> powerpc.git Tree):
> 
> diff --git a/arch/powerpc/sysdev/cpm2_common.c
> b/arch/powerpc/sysdev/cpm2_common.c index ec26599..2159895 100644
> --- a/arch/powerpc/sysdev/cpm2_common.c
> +++ b/arch/powerpc/sysdev/cpm2_common.c
> @@ -60,7 +60,7 @@ intctl_cpm2_t *cpm2_intctl;
>  void
>  cpm2_reset(void)
>  {
> -	cpm2_immr = (cpm2_map_t *)ioremap(CPM_MAP_ADDR,
> CPM_MAP_SIZE);
> +	cpm2_immr = (cpm2_map_t *) ioremap(get_immrbase(),
> CPM_MAP_SIZE); cpm2_intctl = cpm2_map(im_intctl);
>  
>  	/* Reclaim the DP memory for our use.
> @@ -234,7 +234,7 @@ static void cpm2_dpinit(void)
>  {
>  	spin_lock_init(&cpm_dpmem_lock);
>  
> -	im_dprambase = ioremap(CPM_MAP_ADDR, CPM_DATAONLY_BASE +
> CPM_DATAONLY_SIZE);
> +	im_dprambase = (u8 *) ioremap(get_immrbase(),
> CPM_DATAONLY_BASE + CPM_DATAONLY_SIZE); 
>  	/* initialize the info header */
>  	rh_init(&cpm_dpmem_info, 1,
> 
> 

Those exist in my local tree - missed the resubmit I guess. Will fix.

> >> commits in.
> >
> > I'm using up-to-date linux-2.6.git, which is probably way old
> > compared to posuch werpc.git :-) What's the powerpc.git URL ? Do
> > you plan to push your changes upstream for 2.6.21 ?
> 
> I think you find the powerpc.git at
> http://www.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git/
> 
> Am I right?
> 
yep. :)
> I also "playing" at the moment to port a running mpc8272 base port
> under arch/ppc to arch/powerpc, but I cant say, when I am finishing
> it ...
> 
it is completed and works for me - I even checked in the defconfig.

> When I compile the Tree I got a compilererror in
> drivers/serial/cpm_uart/cpm_uart_cpm2.c, because I have a SMC as a
> console. I fixed it with the following patch:
> 
> diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
> b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
> index 787a8f1..5a36ad2 100644
> --- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
> +++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
> @@ -285,7 +285,7 @@ void cpm_uart_freebuf(struct uart_cpm_port *pinfo)
>  int __init cpm_uart_init_portdesc(void)
>  {
>  #if defined(CONFIG_SERIAL_CPM_SMC1) ||
> defined(CONFIG_SERIAL_CPM_SMC2)
> -	u32 addr;
> +	u16* addr;
>  #endif
>  	pr_debug("CPM uart[-]:init portdesc\n");
>
Well, those init_portdesc should not be toggled in normal case - all should come through platform devices (done by device tree traversal for now since we need to keep the compatibility with ppc stuff)
  

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Moving from arch/ppc to arch/powerpc with an MPC8248 (part 1)
@ 2007-02-15 12:43 Heiko Schocher
  2007-02-15 16:33 ` Vitaly Bordug
  0 siblings, 1 reply; 8+ messages in thread
From: Heiko Schocher @ 2007-02-15 12:43 UTC (permalink / raw)
  To: linuxppc-embedded

Hello Laurent, Vitaly

>> Are you using up-to-date powerpc.git? I get rid of hardcoded
CPM_MAP_ADDR
>> completely (or it should be such, heh). please make sure you have my recent

I found two more in arch/powerpc/sysdev/cpm2_common.c (in actual powerpc.git Tree):

diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c
index ec26599..2159895 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2_common.c
@@ -60,7 +60,7 @@ intctl_cpm2_t *cpm2_intctl;
 void
 cpm2_reset(void)
 {
-	cpm2_immr = (cpm2_map_t *)ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE);
+	cpm2_immr = (cpm2_map_t *) ioremap(get_immrbase(), CPM_MAP_SIZE);
 	cpm2_intctl = cpm2_map(im_intctl);
 
 	/* Reclaim the DP memory for our use.
@@ -234,7 +234,7 @@ static void cpm2_dpinit(void)
 {
 	spin_lock_init(&cpm_dpmem_lock);
 
-	im_dprambase = ioremap(CPM_MAP_ADDR, CPM_DATAONLY_BASE + CPM_DATAONLY_SIZE);
+	im_dprambase = (u8 *) ioremap(get_immrbase(), CPM_DATAONLY_BASE + CPM_DATAONLY_SIZE);
 
 	/* initialize the info header */
 	rh_init(&cpm_dpmem_info, 1,


>> commits in.
>
> I'm using up-to-date linux-2.6.git, which is probably way old compared to 
> powerpc.git :-) What's the powerpc.git URL ? Do you plan to push your changes 
> upstream for 2.6.21 ?

I think you find the powerpc.git at
http://www.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git/

Am I right?

I also "playing" at the moment to port a running mpc8272 base port under
arch/ppc to arch/powerpc, but I cant say, when I am finishing it ...

When I compile the Tree I got a compilererror in
drivers/serial/cpm_uart/cpm_uart_cpm2.c, because I have a SMC as a
console. I fixed it with the following patch:

diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index 787a8f1..5a36ad2 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -285,7 +285,7 @@ void cpm_uart_freebuf(struct uart_cpm_port *pinfo)
 int __init cpm_uart_init_portdesc(void)
 {
 #if defined(CONFIG_SERIAL_CPM_SMC1) || defined(CONFIG_SERIAL_CPM_SMC2)
-	u32 addr;
+	u16* addr;
 #endif
 	pr_debug("CPM uart[-]:init portdesc\n");
 

Best regards
Heiko
-- 
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office:  Kirchenstr. 5,       D-82194 Groebenzell,            Germany

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-02-15 16:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-14 12:08 Moving from arch/ppc to arch/powerpc with an MPC8248 (part 1) Laurent Pinchart
2007-02-14 13:10 ` Vitaly Bordug
2007-02-14 13:43   ` Laurent Pinchart
2007-02-14 13:53     ` Vitaly Bordug
2007-02-14 13:59       ` Laurent Pinchart
2007-02-14 20:42 ` Guennadi Liakhovetski
2007-02-15 12:43 Heiko Schocher
2007-02-15 16:33 ` Vitaly Bordug

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.