LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 0/8] [POWERPC] 8xx cleanups
From: Jochen Friedrich @ 2008-01-23 15:58 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: Scott Wood, linuxppc-dev list, Kernel, Linux

Hi,

this is a series against paulus for-2.6.25 tree to clean up various 8xx related stuff.
The series can be pulled from git://git.bocc.de/dbox2.git cleanup.
Patch 6 has been modified to remove the #ifdefs as suggested by Arndt Bergmann.
Patch 8 is a new one.

[POWERPC] Remove unused m8xx_cpm_hostalloc/free/dump()
[POWERPC] Rename m8xx_pic_init to mpc8xx_pics_init
[POWERPC] Remove unneeded and misspelled prototype m8xx_calibrate_decr
[POWERPC] Remove declaration of m8xx_pic_init.
[POWERPC] Remove sysdev/commproc.h
[POWERPC] Get rid of conditional includes of board specific setup
[POWERPC] Rename commproc to cpm1 and cpm2_common.c to cpm2.c
[POWERPC] Move definition of buffer descriptor to cpm.h

Thanks,
Jochen

^ permalink raw reply

* [PATCHv2 1/8] [POWERPC] Remove unused m8xx_cpm_hostalloc/free/dump()
From: Jochen Friedrich @ 2008-01-23 15:59 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: Scott Wood, linuxppc-dev list, Kernel, Linux

m8xx_cpm_hostalloc is still defined in commproc.c, but no users are left
in the kernel tree. m8xx_cpm_hostfree and m8xx_cpm_hostdump are only
defined in the headers. Remove this dead code.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
  arch/powerpc/sysdev/commproc.c |   37 -------------------------------------
  arch/ppc/8xx_io/commproc.c     |   38 --------------------------------------
  include/asm-powerpc/commproc.h |    4 ----
  include/asm-ppc/commproc.h     |    4 ----
  4 files changed, 0 insertions(+), 83 deletions(-)

diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index 621bc6c..818d4b0 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -48,8 +48,6 @@
  #ifndef CONFIG_PPC_CPM_NEW_BINDING
  static void m8xx_cpm_dpinit(void);
  #endif
-static uint host_buffer; /* One page of host buffer */
-static uint host_end;    /* end + 1 */
  cpm8xx_t __iomem *cpmp;  /* Pointer to comm processor space */
  immap_t __iomem *mpc8xx_immr;
  static cpic8xx_t __iomem *cpic_reg;
@@ -268,41 +266,6 @@ out:
  }
  EXPORT_SYMBOL(cpm_command);

-/* We used to do this earlier, but have to postpone as long as possible
- * to ensure the kernel VM is now running.
- */
-static void
-alloc_host_memory(void)
-{
-	dma_addr_t	physaddr;
-
-	/* Set the host page for allocation.
-	*/
-	host_buffer = (uint)dma_alloc_coherent(NULL, PAGE_SIZE, &physaddr,
-			GFP_KERNEL);
-	host_end = host_buffer + PAGE_SIZE;
-}
-
-/* We also own one page of host buffer space for the allocation of
- * UART "fifos" and the like.
- */
-uint
-m8xx_cpm_hostalloc(uint size)
-{
-	uint	retloc;
-
-	if (host_buffer == 0)
-		alloc_host_memory();
-
-	if ((host_buffer + size) >= host_end)
-		return(0);
-
-	retloc = host_buffer;
-	host_buffer += size;
-
-	return(retloc);
-}
-
  /* Set a baud rate generator.  This needs lots of work.  There are
   * four BRGs, any of which can be wired to any channel.
   * The internal baud rate clock is the system clock divided by 16.
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index 9da880b..3f93af8 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -55,8 +55,6 @@
  })

  static void m8xx_cpm_dpinit(void);
-static	uint	host_buffer;	/* One page of host buffer */
-static	uint	host_end;	/* end + 1 */
  cpm8xx_t	*cpmp;		/* Pointer to comm processor space */

  /* CPM interrupt vector functions.
@@ -68,7 +66,6 @@ struct	cpm_action {
  static	struct	cpm_action cpm_vecs[CPMVEC_NR];
  static	irqreturn_t cpm_interrupt(int irq, void * dev);
  static	irqreturn_t cpm_error_interrupt(int irq, void *dev);
-static	void	alloc_host_memory(void);
  /* Define a table of names to identify CPM interrupt handlers in
   * /proc/interrupts.
   */
@@ -158,21 +155,6 @@ m8xx_cpm_reset(void)
  	cpmp = (cpm8xx_t *)commproc;
  }

-/* We used to do this earlier, but have to postpone as long as possible
- * to ensure the kernel VM is now running.
- */
-static void
-alloc_host_memory(void)
-{
-	dma_addr_t	physaddr;
-
-	/* Set the host page for allocation.
-	*/
-	host_buffer = (uint)dma_alloc_coherent(NULL, PAGE_SIZE, &physaddr,
-			GFP_KERNEL);
-	host_end = host_buffer + PAGE_SIZE;
-}
-
  /* This is called during init_IRQ.  We used to do it above, but this
   * was too early since init_IRQ was not yet called.
   */
@@ -319,26 +301,6 @@ cpm_free_handler(int cpm_vec)
  	cpm_vecs[cpm_vec].dev_id = NULL;
  }

-/* We also own one page of host buffer space for the allocation of
- * UART "fifos" and the like.
- */
-uint
-m8xx_cpm_hostalloc(uint size)
-{
-	uint	retloc;
-
-	if (host_buffer == 0)
-		alloc_host_memory();
-
-	if ((host_buffer + size) >= host_end)
-		return(0);
-
-	retloc = host_buffer;
-	host_buffer += size;
-
-	return(retloc);
-}
-
  /* Set a baud rate generator.  This needs lots of work.  There are
   * four BRGs, any of which can be wired to any channel.
   * The internal baud rate clock is the system clock divided by 16.
diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h
index 9e3b864..9757521 100644
--- a/include/asm-powerpc/commproc.h
+++ b/include/asm-powerpc/commproc.h
@@ -87,10 +87,6 @@ extern uint cpm_dpram_phys(u8* addr);

  extern void cpm_setbrg(uint brg, uint rate);

-extern uint m8xx_cpm_hostalloc(uint size);
-extern int  m8xx_cpm_hostfree(uint start);
-extern void m8xx_cpm_hostdump(void);
-
  extern void cpm_load_patch(cpm8xx_t *cp);

  /* Buffer descriptors used by many of the CPM protocols.
diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h
index 462abb1..5418d6d 100644
--- a/include/asm-ppc/commproc.h
+++ b/include/asm-ppc/commproc.h
@@ -75,10 +75,6 @@ extern void *cpm_dpram_addr(unsigned long offset);
  extern uint cpm_dpram_phys(u8* addr);
  extern void cpm_setbrg(uint brg, uint rate);

-extern uint m8xx_cpm_hostalloc(uint size);
-extern int  m8xx_cpm_hostfree(uint start);
-extern void m8xx_cpm_hostdump(void);
-
  extern void cpm_load_patch(volatile immap_t *immr);

  /* Buffer descriptors used by many of the CPM protocols.
-- 
1.5.3.8

^ permalink raw reply related

* [PATCHv2 3/8] [POWERPC] Remove unneeded and misspelled prototype m8xx_calibrate_decr
From: Jochen Friedrich @ 2008-01-23 15:59 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: Scott Wood, linuxppc-dev list, Kernel, Linux

m8xx_calibrate_decr seems to be a misspelled prototype for
mpc8xx_calibrate_decr. As it's not needed anyways, just remove it.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
  arch/powerpc/platforms/8xx/m8xx_setup.c |    1 -
  1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c
index 1337457..85abd61 100644
--- a/arch/powerpc/platforms/8xx/m8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
@@ -31,7 +31,6 @@
  struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
  #endif

-void m8xx_calibrate_decr(void);
  extern int cpm_pic_init(void);
  extern int cpm_get_irq(void);

-- 
1.5.3.8

^ permalink raw reply related

* [PATCHv2 4/8] [POWERPC] Remove declaration of m8xx_pic_init.
From: Jochen Friedrich @ 2008-01-23 16:00 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: Scott Wood, linuxppc-dev list, Kernel, Linux

m8xx_pic_init is declared in ppc8xx_pic.h but defined nowhere in the ppc
tree. Remove it.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
  arch/ppc/syslib/ppc8xx_pic.h |    1 -
  1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/ppc/syslib/ppc8xx_pic.h b/arch/ppc/syslib/ppc8xx_pic.h
index d7d9f65..53bcd97 100644
--- a/arch/ppc/syslib/ppc8xx_pic.h
+++ b/arch/ppc/syslib/ppc8xx_pic.h
@@ -6,7 +6,6 @@

  extern struct hw_interrupt_type ppc8xx_pic;

-void m8xx_pic_init(void);
  void m8xx_do_IRQ(struct pt_regs *regs,
                   int            cpu);
  int m8xx_get_irq(struct pt_regs *regs);
-- 
1.5.3.8

^ permalink raw reply related

* [PATCHv2 2/8] [POWERPC] Rename m8xx_pic_init to mpc8xx_pics_init
From: Jochen Friedrich @ 2008-01-23 15:59 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: Scott Wood, linuxppc-dev list, Kernel, Linux

m8xx_pic_init calls both mpc8xx_pic_init and cpm_pic_init. Renaming the
function to use the same name space as the rest of the mpc8xx
specific funtions and to be more meaningful.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
  arch/powerpc/platforms/8xx/ep88xc.c          |    2 +-
  arch/powerpc/platforms/8xx/m8xx_setup.c      |    4 ++--
  arch/powerpc/platforms/8xx/mpc86xads_setup.c |    2 +-
  arch/powerpc/platforms/8xx/mpc885ads_setup.c |    2 +-
  arch/powerpc/sysdev/commproc.h               |    2 +-
  5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c
index c518b6c..c883c31 100644
--- a/arch/powerpc/platforms/8xx/ep88xc.c
+++ b/arch/powerpc/platforms/8xx/ep88xc.c
@@ -166,7 +166,7 @@ define_machine(ep88xc) {
  	.name = "Embedded Planet EP88xC",
  	.probe = ep88xc_probe,
  	.setup_arch = ep88xc_setup_arch,
-	.init_IRQ = m8xx_pic_init,
+	.init_IRQ = mpc8xx_pics_init,
  	.get_irq	= mpc8xx_get_irq,
  	.restart = mpc8xx_restart,
  	.calibrate_decr = mpc8xx_calibrate_decr,
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c
index ba645c2..1337457 100644
--- a/arch/powerpc/platforms/8xx/m8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
@@ -237,13 +237,13 @@ static void cpm_cascade(unsigned int irq, struct irq_desc *desc)
  	desc->chip->eoi(irq);
  }

-/* Initialize the internal interrupt controller.  The number of
+/* Initialize the internal interrupt controllers.  The number of
   * interrupts supported can vary with the processor type, and the
   * 82xx family can have up to 64.
   * External interrupts can be either edge or level triggered, and
   * need to be initialized by the appropriate driver.
   */
-void __init m8xx_pic_init(void)
+void __init mpc8xx_pics_init(void)
  {
  	int irq;

diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index d2927a4..dea1df1 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -139,7 +139,7 @@ define_machine(mpc86x_ads) {
  	.name			= "MPC86x ADS",
  	.probe			= mpc86xads_probe,
  	.setup_arch		= mpc86xads_setup_arch,
-	.init_IRQ		= m8xx_pic_init,
+	.init_IRQ		= mpc8xx_pics_init,
  	.get_irq		= mpc8xx_get_irq,
  	.restart		= mpc8xx_restart,
  	.calibrate_decr		= mpc8xx_calibrate_decr,
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 2cf1b6a..8f2aa04 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -275,7 +275,7 @@ define_machine(mpc885_ads) {
  	.name			= "Freescale MPC885 ADS",
  	.probe			= mpc885ads_probe,
  	.setup_arch		= mpc885ads_setup_arch,
-	.init_IRQ		= m8xx_pic_init,
+	.init_IRQ		= mpc8xx_pics_init,
  	.get_irq		= mpc8xx_get_irq,
  	.restart		= mpc8xx_restart,
  	.calibrate_decr		= mpc8xx_calibrate_decr,
diff --git a/arch/powerpc/sysdev/commproc.h b/arch/powerpc/sysdev/commproc.h
index 9155ba4..f481adf 100644
--- a/arch/powerpc/sysdev/commproc.h
+++ b/arch/powerpc/sysdev/commproc.h
@@ -6,7 +6,7 @@ extern void mpc8xx_restart(char *cmd);
  extern void mpc8xx_calibrate_decr(void);
  extern int mpc8xx_set_rtc_time(struct rtc_time *tm);
  extern void mpc8xx_get_rtc_time(struct rtc_time *tm);
-extern void m8xx_pic_init(void);
+extern void mpc8xx_pics_init(void);
  extern unsigned int mpc8xx_get_irq(void);

  #endif
-- 
1.5.3.8

^ permalink raw reply related

* [PATCHv2 5/8] [POWERPC] Remove sysdev/commproc.h
From: Jochen Friedrich @ 2008-01-23 16:00 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: Scott Wood, linuxppc-dev list, Kernel, Linux

Move cpm1 specific prototypes to asm/commproc.h and mpc8xx specific
prototypes to asm/mpc8xx.h. Adjust includes accordingly. Remove now
unneeded sysdev/commproc.h.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
  arch/powerpc/platforms/8xx/ep88xc.c          |    3 +--
  arch/powerpc/platforms/8xx/m8xx_setup.c      |    1 -
  arch/powerpc/platforms/8xx/mpc86xads_setup.c |    2 --
  arch/powerpc/platforms/8xx/mpc885ads_setup.c |    2 --
  arch/powerpc/sysdev/commproc.c               |    1 -
  arch/powerpc/sysdev/commproc.h               |   12 ------------
  arch/powerpc/sysdev/mpc8xx_pic.c             |    1 -
  drivers/net/fs_enet/mac-scc.c                |    1 -
  include/asm-powerpc/commproc.h               |    2 ++
  include/asm-powerpc/mpc8xx.h                 |    7 +++++++
  10 files changed, 10 insertions(+), 22 deletions(-)
  delete mode 100644 arch/powerpc/sysdev/commproc.h

diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c
index c883c31..9365f07 100644
--- a/arch/powerpc/platforms/8xx/ep88xc.c
+++ b/arch/powerpc/platforms/8xx/ep88xc.c
@@ -16,8 +16,7 @@
  #include <asm/io.h>
  #include <asm/udbg.h>
  #include <asm/commproc.h>
-
-#include <sysdev/commproc.h>
+#include <asm/mpc8xx.h>

  struct cpm_pin {
  	int port, pin, flags;
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c
index 85abd61..c6a4663 100644
--- a/arch/powerpc/platforms/8xx/m8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
@@ -25,7 +25,6 @@
  #include <mm/mmu_decl.h>

  #include <sysdev/mpc8xx_pic.h>
-#include <sysdev/commproc.h>

  #ifdef CONFIG_PCMCIA_M8XX
  struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index dea1df1..7389590 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -27,8 +27,6 @@
  #include <asm/fs_pd.h>
  #include <asm/udbg.h>

-#include <sysdev/commproc.h>
-
  #include "mpc86xads.h"

  struct cpm_pin {
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 8f2aa04..ae69e93 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -40,8 +40,6 @@
  #include <asm/fs_pd.h>
  #include <asm/udbg.h>

-#include <sysdev/commproc.h>
-
  static u32 __iomem *bcsr, *bcsr5;

  #ifdef CONFIG_PCMCIA_M8XX
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index 818d4b0..ef82587 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -30,7 +30,6 @@
  #include <linux/interrupt.h>
  #include <linux/irq.h>
  #include <linux/module.h>
-#include <asm/mpc8xx.h>
  #include <asm/page.h>
  #include <asm/pgtable.h>
  #include <asm/8xx_immap.h>
diff --git a/arch/powerpc/sysdev/commproc.h b/arch/powerpc/sysdev/commproc.h
deleted file mode 100644
index f481adf..0000000
--- a/arch/powerpc/sysdev/commproc.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _POWERPC_SYSDEV_COMMPROC_H
-#define _POWERPC_SYSDEV_COMMPROC_H
-
-extern void cpm_reset(void);
-extern void mpc8xx_restart(char *cmd);
-extern void mpc8xx_calibrate_decr(void);
-extern int mpc8xx_set_rtc_time(struct rtc_time *tm);
-extern void mpc8xx_get_rtc_time(struct rtc_time *tm);
-extern void mpc8xx_pics_init(void);
-extern unsigned int mpc8xx_get_irq(void);
-
-#endif
diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c
index 7aa4ff5..0e74a4b 100644
--- a/arch/powerpc/sysdev/mpc8xx_pic.c
+++ b/arch/powerpc/sysdev/mpc8xx_pic.c
@@ -10,7 +10,6 @@
  #include <asm/irq.h>
  #include <asm/io.h>
  #include <asm/8xx_immap.h>
-#include <asm/mpc8xx.h>

  #include "mpc8xx_pic.h"

diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c
index fe3d8a6..1502dbf 100644
--- a/drivers/net/fs_enet/mac-scc.c
+++ b/drivers/net/fs_enet/mac-scc.c
@@ -39,7 +39,6 @@
  #ifdef CONFIG_8xx
  #include <asm/8xx_immap.h>
  #include <asm/pgtable.h>
-#include <asm/mpc8xx.h>
  #include <asm/commproc.h>
  #endif

diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h
index 9757521..ec87b8f 100644
--- a/include/asm-powerpc/commproc.h
+++ b/include/asm-powerpc/commproc.h
@@ -89,6 +89,8 @@ extern void cpm_setbrg(uint brg, uint rate);

  extern void cpm_load_patch(cpm8xx_t *cp);

+extern void cpm_reset(void);
+
  /* Buffer descriptors used by many of the CPM protocols.
  */
  typedef struct cpm_buf_desc {
diff --git a/include/asm-powerpc/mpc8xx.h b/include/asm-powerpc/mpc8xx.h
index 2be014b..2af9fcb 100644
--- a/include/asm-powerpc/mpc8xx.h
+++ b/include/asm-powerpc/mpc8xx.h
@@ -11,6 +11,13 @@

  #ifdef CONFIG_8xx

+extern void mpc8xx_restart(char *cmd);
+extern void mpc8xx_calibrate_decr(void);
+extern int mpc8xx_set_rtc_time(struct rtc_time *tm);
+extern void mpc8xx_get_rtc_time(struct rtc_time *tm);
+extern void mpc8xx_pics_init(void);
+extern unsigned int mpc8xx_get_irq(void);
+
  #ifdef CONFIG_FADS
  #include <platforms/fads.h>
  #endif
-- 
1.5.3.8

^ permalink raw reply related

* [PATCHv2 6/8] [POWERPC] Get rid of conditional includes of board specific setup
From: Jochen Friedrich @ 2008-01-23 16:01 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: Scott Wood, linuxppc-dev list, Kernel, Linux

Directly include mpc885ads.h from mpc885ads_setup.c. Now we can get rid
of the arch dependent includes in mpc8xx.h.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
  arch/powerpc/platforms/8xx/mpc885ads_setup.c |    2 +
  include/asm-powerpc/mpc8xx.h                 |   34 +++++++-------------------
  2 files changed, 11 insertions(+), 25 deletions(-)

diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index ae69e93..426b897 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -40,6 +40,8 @@
  #include <asm/fs_pd.h>
  #include <asm/udbg.h>

+#include "mpc885ads.h"
+
  static u32 __iomem *bcsr, *bcsr5;

  #ifdef CONFIG_PCMCIA_M8XX
diff --git a/include/asm-powerpc/mpc8xx.h b/include/asm-powerpc/mpc8xx.h
index 2af9fcb..70fd8a7 100644
--- a/include/asm-powerpc/mpc8xx.h
+++ b/include/asm-powerpc/mpc8xx.h
@@ -1,16 +1,16 @@
-/* This is the single file included by all MPC8xx build options.
- * Since there are many different boards and no standard configuration,
- * we have a unique include file for each.  Rather than change every
- * file that has to include MPC8xx configuration, they all include
- * this one and the configuration switching is done here.
+/*
+ * Prototypes, etc. for the Freescale MPC8xx embedded cpu chips
+ * May need to be cleaned as the port goes on ...
+ *
+ * Copyright (C) 2008 Jochen Friedrich <jochen@scram.de>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
   */
-#ifdef __KERNEL__
  #ifndef __CONFIG_8xx_DEFS
  #define __CONFIG_8xx_DEFS

-
-#ifdef CONFIG_8xx
-
  extern void mpc8xx_restart(char *cmd);
  extern void mpc8xx_calibrate_decr(void);
  extern int mpc8xx_set_rtc_time(struct rtc_time *tm);
@@ -18,22 +18,6 @@ extern void mpc8xx_get_rtc_time(struct rtc_time *tm);
  extern void mpc8xx_pics_init(void);
  extern unsigned int mpc8xx_get_irq(void);

-#ifdef CONFIG_FADS
-#include <platforms/fads.h>
-#endif
-
-#if defined(CONFIG_MPC86XADS)
-#include <platforms/8xx/mpc86xads.h>
-#endif
-
-#if defined(CONFIG_MPC885ADS)
-#include <platforms/8xx/mpc885ads.h>
-#endif
-
-#ifdef CONFIG_PCMCIA_M8XX
  extern struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
-#endif

-#endif /* CONFIG_8xx */
  #endif /* __CONFIG_8xx_DEFS */
-#endif /* __KERNEL__ */
-- 
1.5.3.8

^ permalink raw reply related

* [PATCHv2 7/8] [POWERPC] Rename commproc to cpm1 and cpm2_common.c to cpm2.c
From: Jochen Friedrich @ 2008-01-23 16:01 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: Scott Wood, linuxppc-dev list, Kernel, Linux

Rename commproc.[ch] to cpm1.[ch] to be more consistent with cpm2. Also
rename cpm2_common.c to cpm2.c as suggested by Scott Wood. Adjust the
includes accordingly.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
  arch/powerpc/platforms/8xx/ep88xc.c           |    2 +-
  arch/powerpc/platforms/8xx/mpc86xads_setup.c  |    2 +-
  arch/powerpc/platforms/8xx/mpc885ads_setup.c  |    2 +-
  arch/powerpc/sysdev/Makefile                  |    4 ++--
  arch/powerpc/sysdev/{commproc.c => cpm1.c}    |    4 ++--
  arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} |    3 +--
  arch/powerpc/sysdev/micropatch.c              |    2 +-
  arch/ppc/8260_io/enet.c                       |    2 +-
  arch/ppc/8xx_io/commproc.c                    |    2 +-
  arch/ppc/8xx_io/enet.c                        |    6 +++---
  arch/ppc/8xx_io/fec.c                         |    2 +-
  arch/ppc/8xx_io/micropatch.c                  |    2 +-
  arch/ppc/boot/simple/iic.c                    |    2 +-
  arch/ppc/boot/simple/m8xx_tty.c               |    2 +-
  arch/ppc/kernel/ppc_ksyms.c                   |    2 +-
  arch/ppc/platforms/mpc866ads_setup.c          |    2 +-
  arch/ppc/platforms/mpc885ads_setup.c          |    2 +-
  arch/ppc/syslib/mpc8xx_devices.c              |    2 +-
  arch/ppc/xmon/start_8xx.c                     |    2 +-
  drivers/net/fec.c                             |    2 +-
  drivers/net/fec.h                             |    2 +-
  drivers/net/fec_8xx/fec_8xx-netta.c           |    2 +-
  drivers/net/fec_8xx/fec_main.c                |    2 +-
  drivers/net/fec_8xx/fec_mii.c                 |    2 +-
  drivers/net/fs_enet/fs_enet.h                 |    2 +-
  drivers/net/fs_enet/mac-fec.c                 |    2 +-
  drivers/net/fs_enet/mac-scc.c                 |    2 +-
  drivers/serial/68360serial.c                  |    2 +-
  drivers/serial/cpm_uart/cpm_uart_cpm1.h       |    2 +-
  include/asm-powerpc/{commproc.h => cpm1.h}    |    8 ++++----
  include/asm-ppc/{commproc.h => cpm1.h}        |    8 ++++----
  31 files changed, 41 insertions(+), 42 deletions(-)
  rename arch/powerpc/sysdev/{commproc.c => cpm1.c} (99%)
  rename arch/powerpc/sysdev/{cpm2_common.c => cpm2.c} (99%)
  rename include/asm-powerpc/{commproc.h => cpm1.h} (99%)
  rename include/asm-ppc/{commproc.h => cpm1.h} (99%)

diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c
index 9365f07..d300576 100644
--- a/arch/powerpc/platforms/8xx/ep88xc.c
+++ b/arch/powerpc/platforms/8xx/ep88xc.c
@@ -15,7 +15,7 @@
  #include <asm/machdep.h>
  #include <asm/io.h>
  #include <asm/udbg.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
  #include <asm/mpc8xx.h>

  struct cpm_pin {
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index 7389590..a68509d 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -23,7 +23,7 @@
  #include <asm/time.h>
  #include <asm/mpc8xx.h>
  #include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
  #include <asm/fs_pd.h>
  #include <asm/udbg.h>

diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 426b897..f39447b 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -36,7 +36,7 @@
  #include <asm/time.h>
  #include <asm/mpc8xx.h>
  #include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
  #include <asm/fs_pd.h>
  #include <asm/udbg.h>

diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index 9a20ef4..61f2604 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -35,8 +35,8 @@ endif
  # Temporary hack until we have migrated to asm-powerpc
  ifeq ($(ARCH),powerpc)
  obj-$(CONFIG_CPM)		+= cpm_common.o
-obj-$(CONFIG_CPM2)		+= cpm2_common.o cpm2_pic.o
+obj-$(CONFIG_CPM2)		+= cpm2.o cpm2_pic.o
  obj-$(CONFIG_PPC_DCR)		+= dcr.o
-obj-$(CONFIG_8xx)		+= mpc8xx_pic.o commproc.o
+obj-$(CONFIG_8xx)		+= mpc8xx_pic.o cpm1.o
  obj-$(CONFIG_UCODE_PATCH)	+= micropatch.o
  endif
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/cpm1.c
similarity index 99%
rename from arch/powerpc/sysdev/commproc.c
rename to arch/powerpc/sysdev/cpm1.c
index ef82587..df8bd2b 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/cpm1.c
@@ -33,7 +33,7 @@
  #include <asm/page.h>
  #include <asm/pgtable.h>
  #include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
  #include <asm/io.h>
  #include <asm/tlbflush.h>
  #include <asm/rheap.h>
@@ -290,7 +290,7 @@ cpm_setbrg(uint brg, uint rate)
  		out_be32(bp, (((BRG_UART_CLK / rate) - 1) << 1) | CPM_BRG_EN);
  	else
  		out_be32(bp, (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) |
-		             CPM_BRG_EN | CPM_BRG_DIV16);
+			      CPM_BRG_EN | CPM_BRG_DIV16);
  }

  #ifndef CONFIG_PPC_CPM_NEW_BINDING
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2.c
similarity index 99%
rename from arch/powerpc/sysdev/cpm2_common.c
rename to arch/powerpc/sysdev/cpm2.c
index f7188e2..7be7112 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2.c
@@ -153,8 +153,7 @@ cpm2_fastbrg(uint brg, uint rate, int div16)

  	if (brg < 4) {
  		bp = cpm2_map_size(im_brgc1, 16);
-	}
-	else {
+	} else {
  		bp = cpm2_map_size(im_brgc5, 16);
  		brg -= 4;
  	}
diff --git a/arch/powerpc/sysdev/micropatch.c b/arch/powerpc/sysdev/micropatch.c
index 712b10a..d8d6028 100644
--- a/arch/powerpc/sysdev/micropatch.c
+++ b/arch/powerpc/sysdev/micropatch.c
@@ -16,7 +16,7 @@
  #include <asm/page.h>
  #include <asm/pgtable.h>
  #include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>

  /*
   * I2C/SPI relocation patch arrays.
diff --git a/arch/ppc/8260_io/enet.c b/arch/ppc/8260_io/enet.c
index 615b658..3ea4db2 100644
--- a/arch/ppc/8260_io/enet.c
+++ b/arch/ppc/8260_io/enet.c
@@ -10,7 +10,7 @@
   * This version of the driver is somewhat selectable for the different
   * processor/board combinations.  It works for the boards I know about
   * now, and should be easily modified to include others.  Some of the
- * configuration information is contained in <asm/commproc.h> and the
+ * configuration information is contained in <asm/cpm1.h> and the
   * remainder is here.
   *
   * Buffer descriptors are kept in the CPM dual port RAM, and the frame
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index 3f93af8..9d656de 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -34,7 +34,7 @@
  #include <asm/page.h>
  #include <asm/pgtable.h>
  #include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
  #include <asm/io.h>
  #include <asm/tlbflush.h>
  #include <asm/rheap.h>
diff --git a/arch/ppc/8xx_io/enet.c b/arch/ppc/8xx_io/enet.c
index eace3bc..c6d047a 100644
--- a/arch/ppc/8xx_io/enet.c
+++ b/arch/ppc/8xx_io/enet.c
@@ -8,7 +8,7 @@
   * This version of the driver is somewhat selectable for the different
   * processor/board combinations.  It works for the boards I know about
   * now, and should be easily modified to include others.  Some of the
- * configuration information is contained in <asm/commproc.h> and the
+ * configuration information is contained in <asm/cpm1.h> and the
   * remainder is here.
   *
   * Buffer descriptors are kept in the CPM dual port RAM, and the frame
@@ -43,7 +43,7 @@
  #include <asm/pgtable.h>
  #include <asm/mpc8xx.h>
  #include <asm/uaccess.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
  #include <asm/cacheflush.h>

  /*
@@ -80,7 +80,7 @@
   * programming documents for details unique to your board.
   *
   * For the TQM8xx(L) modules, there is no control register interface.
- * All functions are directly controlled using I/O pins.  See <asm/commproc.h>.
+ * All functions are directly controlled using I/O pins.  See <asm/cpm1.h>.
   */

  /* The transmitter timeout
diff --git a/arch/ppc/8xx_io/fec.c b/arch/ppc/8xx_io/fec.c
index 0288279..11b0aa6 100644
--- a/arch/ppc/8xx_io/fec.c
+++ b/arch/ppc/8xx_io/fec.c
@@ -53,7 +53,7 @@
  #include <asm/mpc8xx.h>
  #include <asm/irq.h>
  #include <asm/uaccess.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>

  #ifdef	CONFIG_USE_MDIO
  /* Forward declarations of some structures to support different PHYs
diff --git a/arch/ppc/8xx_io/micropatch.c b/arch/ppc/8xx_io/micropatch.c
index cfad46b..9a5d95d 100644
--- a/arch/ppc/8xx_io/micropatch.c
+++ b/arch/ppc/8xx_io/micropatch.c
@@ -16,7 +16,7 @@
  #include <asm/page.h>
  #include <asm/pgtable.h>
  #include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>

  /*
   * I2C/SPI relocation patch arrays.
diff --git a/arch/ppc/boot/simple/iic.c b/arch/ppc/boot/simple/iic.c
index e4efd83..5e91489 100644
--- a/arch/ppc/boot/simple/iic.c
+++ b/arch/ppc/boot/simple/iic.c
@@ -5,7 +5,7 @@
  #include <linux/types.h>
  #include <asm/uaccess.h>
  #include <asm/mpc8xx.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>


  /* IIC functions.
diff --git a/arch/ppc/boot/simple/m8xx_tty.c b/arch/ppc/boot/simple/m8xx_tty.c
index ea615d8..f28924e 100644
--- a/arch/ppc/boot/simple/m8xx_tty.c
+++ b/arch/ppc/boot/simple/m8xx_tty.c
@@ -11,7 +11,7 @@
  #include <linux/types.h>
  #include <asm/uaccess.h>
  #include <asm/mpc8xx.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>

  #ifdef CONFIG_MBX
  #define MBX_CSR1	((volatile u_char *)0xfa100000)
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 22494ec..0d53dc3 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -45,7 +45,7 @@
  #include <asm/dcr.h>

  #ifdef  CONFIG_8xx
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
  #endif

  extern void transfer_to_handler(void);
diff --git a/arch/ppc/platforms/mpc866ads_setup.c b/arch/ppc/platforms/mpc866ads_setup.c
index bf72204..62370f4 100644
--- a/arch/ppc/platforms/mpc866ads_setup.c
+++ b/arch/ppc/platforms/mpc866ads_setup.c
@@ -32,7 +32,7 @@
  #include <asm/time.h>
  #include <asm/ppcboot.h>
  #include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
  #include <asm/ppc_sys.h>
  #include <asm/mpc8xx.h>

diff --git a/arch/ppc/platforms/mpc885ads_setup.c b/arch/ppc/platforms/mpc885ads_setup.c
index 87deaef..ba06cc0 100644
--- a/arch/ppc/platforms/mpc885ads_setup.c
+++ b/arch/ppc/platforms/mpc885ads_setup.c
@@ -31,7 +31,7 @@
  #include <asm/time.h>
  #include <asm/ppcboot.h>
  #include <asm/8xx_immap.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
  #include <asm/ppc_sys.h>

  extern unsigned char __res[];
diff --git a/arch/ppc/syslib/mpc8xx_devices.c b/arch/ppc/syslib/mpc8xx_devices.c
index c05ac87..80804ee 100644
--- a/arch/ppc/syslib/mpc8xx_devices.c
+++ b/arch/ppc/syslib/mpc8xx_devices.c
@@ -16,7 +16,7 @@
  #include <linux/device.h>
  #include <linux/serial_8250.h>
  #include <linux/mii.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
  #include <asm/mpc8xx.h>
  #include <asm/irq.h>
  #include <asm/ppc_sys.h>
diff --git a/arch/ppc/xmon/start_8xx.c b/arch/ppc/xmon/start_8xx.c
index a48bd59..3097406 100644
--- a/arch/ppc/xmon/start_8xx.c
+++ b/arch/ppc/xmon/start_8xx.c
@@ -14,7 +14,7 @@
  #include <linux/kernel.h>
  #include <asm/8xx_immap.h>
  #include <asm/mpc8xx.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>

  extern void xmon_printf(const char *fmt, ...);
  extern int xmon_8xx_write(char *str, int nb);
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 0fbf1bb..0800cce 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -58,7 +58,7 @@
  #else
  #include <asm/8xx_immap.h>
  #include <asm/mpc8xx.h>
-#include "commproc.h"
+#include "cpm1.h"
  #endif

  #if defined(CONFIG_FEC2)
diff --git a/drivers/net/fec.h b/drivers/net/fec.h
index 1d42160..bcff463 100644
--- a/drivers/net/fec.h
+++ b/drivers/net/fec.h
@@ -111,7 +111,7 @@ typedef struct bufdesc {


  /*
- *	The following definitions courtesy of commproc.h, which where
+ *	The following definitions courtesy of cpm1.h, which where
   *	Copyright (c) 1997 Dan Malek (dmalek@jlc.net).
   */
  #define BD_SC_EMPTY     ((ushort)0x8000)        /* Recieve is empty */
diff --git a/drivers/net/fec_8xx/fec_8xx-netta.c b/drivers/net/fec_8xx/fec_8xx-netta.c
index e492eb8..79deee2 100644
--- a/drivers/net/fec_8xx/fec_8xx-netta.c
+++ b/drivers/net/fec_8xx/fec_8xx-netta.c
@@ -26,7 +26,7 @@
  #include <asm/mpc8xx.h>
  #include <asm/irq.h>
  #include <asm/uaccess.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>

  #include "fec_8xx.h"

diff --git a/drivers/net/fec_8xx/fec_main.c b/drivers/net/fec_8xx/fec_main.c
index 8d2904f..795e22e 100644
--- a/drivers/net/fec_8xx/fec_main.c
+++ b/drivers/net/fec_8xx/fec_main.c
@@ -35,7 +35,7 @@
  #include <asm/mpc8xx.h>
  #include <asm/irq.h>
  #include <asm/uaccess.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>

  #include "fec_8xx.h"

diff --git a/drivers/net/fec_8xx/fec_mii.c b/drivers/net/fec_8xx/fec_mii.c
index e8e10a0..3b6ca29 100644
--- a/drivers/net/fec_8xx/fec_mii.c
+++ b/drivers/net/fec_8xx/fec_mii.c
@@ -34,7 +34,7 @@
  #include <asm/mpc8xx.h>
  #include <asm/irq.h>
  #include <asm/uaccess.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>

  /*************************************************/

diff --git a/drivers/net/fs_enet/fs_enet.h b/drivers/net/fs_enet/fs_enet.h
index c675e29..e05389c 100644
--- a/drivers/net/fs_enet/fs_enet.h
+++ b/drivers/net/fs_enet/fs_enet.h
@@ -12,7 +12,7 @@
  #include <asm/fs_pd.h>

  #ifdef CONFIG_CPM1
-#include <asm/commproc.h>
+#include <asm/cpm1.h>

  struct fec_info {
  	fec_t __iomem *fecp;
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
index c1fee48..8a311d1 100644
--- a/drivers/net/fs_enet/mac-fec.c
+++ b/drivers/net/fs_enet/mac-fec.c
@@ -40,7 +40,7 @@
  #include <asm/8xx_immap.h>
  #include <asm/pgtable.h>
  #include <asm/mpc8xx.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
  #endif

  #ifdef CONFIG_PPC_CPM_NEW_BINDING
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c
index 1502dbf..d3cda70 100644
--- a/drivers/net/fs_enet/mac-scc.c
+++ b/drivers/net/fs_enet/mac-scc.c
@@ -39,7 +39,7 @@
  #ifdef CONFIG_8xx
  #include <asm/8xx_immap.h>
  #include <asm/pgtable.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>
  #endif

  #ifdef CONFIG_PPC_CPM_NEW_BINDING
diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c
index 2aa6bfe..2969ebc 100644
--- a/drivers/serial/68360serial.c
+++ b/drivers/serial/68360serial.c
@@ -39,7 +39,7 @@
  #include <linux/delay.h>
  #include <asm/irq.h>
  #include <asm/m68360.h>
-#include <asm/commproc.h>
+#include <asm/cpm1.h>


  #ifdef CONFIG_KGDB
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.h b/drivers/serial/cpm_uart/cpm_uart_cpm1.h
index 9b5465f..ddf46d3 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.h
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.h
@@ -10,7 +10,7 @@
  #ifndef CPM_UART_CPM1_H
  #define CPM_UART_CPM1_H

-#include <asm/commproc.h>
+#include <asm/cpm1.h>

  /* defines for IRQs */
  #ifndef CONFIG_PPC_CPM_NEW_BINDING
diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/cpm1.h
similarity index 99%
rename from include/asm-powerpc/commproc.h
rename to include/asm-powerpc/cpm1.h
index ec87b8f..901a00b 100644
--- a/include/asm-powerpc/commproc.h
+++ b/include/asm-powerpc/cpm1.h
@@ -14,8 +14,8 @@
   * IDMA1 space.  The remaining DP RAM is available for buffer descriptors
   * or other use.
   */
-#ifndef __CPM_8XX__
-#define __CPM_8XX__
+#ifndef __CPM1__
+#define __CPM1__

  #include <asm/8xx_immap.h>
  #include <asm/ptrace.h>
@@ -82,7 +82,7 @@ extern int cpm_dpfree(unsigned long offset);
  extern unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align);
  extern void cpm_dpdump(void);
  extern void *cpm_dpram_addr(unsigned long offset);
-extern uint cpm_dpram_phys(u8* addr);
+extern uint cpm_dpram_phys(u8 *addr);
  #endif

  extern void cpm_setbrg(uint brg, uint rate);
@@ -747,4 +747,4 @@ enum cpm_clk {

  int cpm1_clk_setup(enum cpm_clk_target target, int clock, int mode);

-#endif /* __CPM_8XX__ */
+#endif /* __CPM1__ */
diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/cpm1.h
similarity index 99%
rename from include/asm-ppc/commproc.h
rename to include/asm-ppc/cpm1.h
index 5418d6d..03035ac 100644
--- a/include/asm-ppc/commproc.h
+++ b/include/asm-ppc/cpm1.h
@@ -14,8 +14,8 @@
   * IDMA1 space.  The remaining DP RAM is available for buffer descriptors
   * or other use.
   */
-#ifndef __CPM_8XX__
-#define __CPM_8XX__
+#ifndef __CPM1__
+#define __CPM1__

  #include <asm/8xx_immap.h>
  #include <asm/ptrace.h>
@@ -72,7 +72,7 @@ extern int cpm_dpfree(unsigned long offset);
  extern unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align);
  extern void cpm_dpdump(void);
  extern void *cpm_dpram_addr(unsigned long offset);
-extern uint cpm_dpram_phys(u8* addr);
+extern uint cpm_dpram_phys(u8 *addr);
  extern void cpm_setbrg(uint brg, uint rate);

  extern void cpm_load_patch(volatile immap_t *immr);
@@ -685,4 +685,4 @@ typedef struct risc_timer_pram {
  extern void cpm_install_handler(int vec, void (*handler)(void *), void *dev_id);
  extern void cpm_free_handler(int vec);

-#endif /* __CPM_8XX__ */
+#endif /* __CPM1__ */
-- 
1.5.3.8

^ permalink raw reply related

* [PATCHv2 8/8] [POWERPC] Move definition of buffer descriptor to cpm.h
From: Jochen Friedrich @ 2008-01-23 16:02 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: Scott Wood, linuxppc-dev list, Kernel, Linux

Buffer descriptors are used by both CPM1 and CPM2. Move the definitions
from the cpm dependent include file to common cpm.h

Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
  include/asm-powerpc/cpm.h  |   73 ++++++++++++++++++++++++++++++++++++++++++++
  include/asm-powerpc/cpm1.h |   65 ---------------------------------------
  include/asm-powerpc/cpm2.h |   64 --------------------------------------
  3 files changed, 73 insertions(+), 129 deletions(-)

diff --git a/include/asm-powerpc/cpm.h b/include/asm-powerpc/cpm.h
index fae83b1..77e39da 100644
--- a/include/asm-powerpc/cpm.h
+++ b/include/asm-powerpc/cpm.h
@@ -4,6 +4,79 @@
  #include <linux/compiler.h>
  #include <linux/types.h>

+/* Buffer descriptors used by many of the CPM protocols. */
+typedef struct cpm_buf_desc {
+	ushort	cbd_sc;		/* Status and Control */
+	ushort	cbd_datlen;	/* Data length in buffer */
+	uint	cbd_bufaddr;	/* Buffer address in host memory */
+} cbd_t;
+
+/* Buffer descriptor control/status used by serial
+ */
+
+#define BD_SC_EMPTY	(0x8000)	/* Receive is empty */
+#define BD_SC_READY	(0x8000)	/* Transmit is ready */
+#define BD_SC_WRAP	(0x2000)	/* Last buffer descriptor */
+#define BD_SC_INTRPT	(0x1000)	/* Interrupt on change */
+#define BD_SC_LAST	(0x0800)	/* Last buffer in frame */
+#define BD_SC_TC	(0x0400)	/* Transmit CRC */
+#define BD_SC_CM	(0x0200)	/* Continous mode */
+#define BD_SC_ID	(0x0100)	/* Rec'd too many idles */
+#define BD_SC_P		(0x0100)	/* xmt preamble */
+#define BD_SC_BR	(0x0020)	/* Break received */
+#define BD_SC_FR	(0x0010)	/* Framing error */
+#define BD_SC_PR	(0x0008)	/* Parity error */
+#define BD_SC_NAK	(0x0004)	/* NAK - did not respond */
+#define BD_SC_OV	(0x0002)	/* Overrun */
+#define BD_SC_UN	(0x0002)	/* Underrun */
+#define BD_SC_CD	(0x0001)	/* */
+#define BD_SC_CL	(0x0001)	/* Collision */
+
+/* Buffer descriptor control/status used by Ethernet receive.
+ * Common to SCC and FCC.
+ */
+#define BD_ENET_RX_EMPTY	(0x8000)
+#define BD_ENET_RX_WRAP		(0x2000)
+#define BD_ENET_RX_INTR		(0x1000)
+#define BD_ENET_RX_LAST		(0x0800)
+#define BD_ENET_RX_FIRST	(0x0400)
+#define BD_ENET_RX_MISS		(0x0100)
+#define BD_ENET_RX_BC		(0x0080)	/* FCC Only */
+#define BD_ENET_RX_MC		(0x0040)	/* FCC Only */
+#define BD_ENET_RX_LG		(0x0020)
+#define BD_ENET_RX_NO		(0x0010)
+#define BD_ENET_RX_SH		(0x0008)
+#define BD_ENET_RX_CR		(0x0004)
+#define BD_ENET_RX_OV		(0x0002)
+#define BD_ENET_RX_CL		(0x0001)
+#define BD_ENET_RX_STATS	(0x01ff)	/* All status bits */
+
+/* Buffer descriptor control/status used by Ethernet transmit.
+ * Common to SCC and FCC.
+ */
+#define BD_ENET_TX_READY	(0x8000)
+#define BD_ENET_TX_PAD		(0x4000)
+#define BD_ENET_TX_WRAP		(0x2000)
+#define BD_ENET_TX_INTR		(0x1000)
+#define BD_ENET_TX_LAST		(0x0800)
+#define BD_ENET_TX_TC		(0x0400)
+#define BD_ENET_TX_DEF		(0x0200)
+#define BD_ENET_TX_HB		(0x0100)
+#define BD_ENET_TX_LC		(0x0080)
+#define BD_ENET_TX_RL		(0x0040)
+#define BD_ENET_TX_RCMASK	(0x003c)
+#define BD_ENET_TX_UN		(0x0002)
+#define BD_ENET_TX_CSL		(0x0001)
+#define BD_ENET_TX_STATS	(0x03ff)	/* All status bits */
+
+/* Buffer descriptor control/status used by Transparent mode SCC.
+ */
+#define BD_SCC_TX_LAST		(0x0800)
+
+/* Buffer descriptor control/status used by I2C.
+ */
+#define BD_I2C_START		(0x0400)
+
  int cpm_muram_init(void);
  unsigned long cpm_muram_alloc(unsigned long size, unsigned long align);
  int cpm_muram_free(unsigned long offset);
diff --git a/include/asm-powerpc/cpm1.h b/include/asm-powerpc/cpm1.h
index 901a00b..b2ebd6a 100644
--- a/include/asm-powerpc/cpm1.h
+++ b/include/asm-powerpc/cpm1.h
@@ -91,32 +91,6 @@ extern void cpm_load_patch(cpm8xx_t *cp);

  extern void cpm_reset(void);

-/* Buffer descriptors used by many of the CPM protocols.
-*/
-typedef struct cpm_buf_desc {
-	ushort	cbd_sc;		/* Status and Control */
-	ushort	cbd_datlen;	/* Data length in buffer */
-	uint	cbd_bufaddr;	/* Buffer address in host memory */
-} cbd_t;
-
-#define BD_SC_EMPTY	((ushort)0x8000)	/* Receive is empty */
-#define BD_SC_READY	((ushort)0x8000)	/* Transmit is ready */
-#define BD_SC_WRAP	((ushort)0x2000)	/* Last buffer descriptor */
-#define BD_SC_INTRPT	((ushort)0x1000)	/* Interrupt on change */
-#define BD_SC_LAST	((ushort)0x0800)	/* Last buffer in frame */
-#define BD_SC_TC	((ushort)0x0400)	/* Transmit CRC */
-#define BD_SC_CM	((ushort)0x0200)	/* Continous mode */
-#define BD_SC_ID	((ushort)0x0100)	/* Rec'd too many idles */
-#define BD_SC_P		((ushort)0x0100)	/* xmt preamble */
-#define BD_SC_BR	((ushort)0x0020)	/* Break received */
-#define BD_SC_FR	((ushort)0x0010)	/* Framing error */
-#define BD_SC_PR	((ushort)0x0008)	/* Parity error */
-#define BD_SC_NAK	((ushort)0x0004)	/* NAK - did not respond */
-#define BD_SC_OV	((ushort)0x0002)	/* Overrun */
-#define BD_SC_UN	((ushort)0x0002)	/* Underrun */
-#define BD_SC_CD	((ushort)0x0001)	/* ?? */
-#define BD_SC_CL	((ushort)0x0001)	/* Collision */
-
  /* Parameter RAM offsets.
  */
  #define PROFF_SCC1	((uint)0x0000)
@@ -446,41 +420,6 @@ typedef struct scc_enet {
  #define SCC_PSMR_NIB22	((ushort)0x000a)	/* Start frame search */
  #define SCC_PSMR_FDE	((ushort)0x0001)	/* Full duplex enable */

-/* Buffer descriptor control/status used by Ethernet receive.
-*/
-#define BD_ENET_RX_EMPTY	((ushort)0x8000)
-#define BD_ENET_RX_WRAP		((ushort)0x2000)
-#define BD_ENET_RX_INTR		((ushort)0x1000)
-#define BD_ENET_RX_LAST		((ushort)0x0800)
-#define BD_ENET_RX_FIRST	((ushort)0x0400)
-#define BD_ENET_RX_MISS		((ushort)0x0100)
-#define BD_ENET_RX_LG		((ushort)0x0020)
-#define BD_ENET_RX_NO		((ushort)0x0010)
-#define BD_ENET_RX_SH		((ushort)0x0008)
-#define BD_ENET_RX_CR		((ushort)0x0004)
-#define BD_ENET_RX_OV		((ushort)0x0002)
-#define BD_ENET_RX_CL		((ushort)0x0001)
-#define BD_ENET_RX_BC		((ushort)0x0080)	/* DA is Broadcast */
-#define BD_ENET_RX_MC		((ushort)0x0040)	/* DA is Multicast */
-#define BD_ENET_RX_STATS	((ushort)0x013f)	/* All status bits */
-
-/* Buffer descriptor control/status used by Ethernet transmit.
-*/
-#define BD_ENET_TX_READY	((ushort)0x8000)
-#define BD_ENET_TX_PAD		((ushort)0x4000)
-#define BD_ENET_TX_WRAP		((ushort)0x2000)
-#define BD_ENET_TX_INTR		((ushort)0x1000)
-#define BD_ENET_TX_LAST		((ushort)0x0800)
-#define BD_ENET_TX_TC		((ushort)0x0400)
-#define BD_ENET_TX_DEF		((ushort)0x0200)
-#define BD_ENET_TX_HB		((ushort)0x0100)
-#define BD_ENET_TX_LC		((ushort)0x0080)
-#define BD_ENET_TX_RL		((ushort)0x0040)
-#define BD_ENET_TX_RCMASK	((ushort)0x003c)
-#define BD_ENET_TX_UN		((ushort)0x0002)
-#define BD_ENET_TX_CSL		((ushort)0x0001)
-#define BD_ENET_TX_STATS	((ushort)0x03ff)	/* All status bits */
-
  /* SCC as UART
  */
  typedef struct scc_uart {
@@ -549,8 +488,6 @@ typedef struct scc_trans {
  	uint	st_cmask;	/* Constant mask for CRC */
  } scc_trans_t;

-#define BD_SCC_TX_LAST		((ushort)0x0800)
-
  /* IIC parameter RAM.
  */
  typedef struct iic {
@@ -574,8 +511,6 @@ typedef struct iic {
  	char	res2[2];	/* Reserved */
  } iic_t;

-#define BD_IIC_START		((ushort)0x0400)
-
  /* SPI parameter RAM.
  */
  typedef struct spi {
diff --git a/include/asm-powerpc/cpm2.h b/include/asm-powerpc/cpm2.h
index f1112c1..b93a53e 100644
--- a/include/asm-powerpc/cpm2.h
+++ b/include/asm-powerpc/cpm2.h
@@ -132,29 +132,6 @@ extern void cpm_setbrg(uint brg, uint rate);
  extern void cpm2_fastbrg(uint brg, uint rate, int div16);
  extern void cpm2_reset(void);

-
-/* Buffer descriptors used by many of the CPM protocols.
-*/
-typedef struct cpm_buf_desc {
-	ushort	cbd_sc;		/* Status and Control */
-	ushort	cbd_datlen;	/* Data length in buffer */
-	uint	cbd_bufaddr;	/* Buffer address in host memory */
-} cbd_t;
-
-#define BD_SC_EMPTY	((ushort)0x8000)	/* Receive is empty */
-#define BD_SC_READY	((ushort)0x8000)	/* Transmit is ready */
-#define BD_SC_WRAP	((ushort)0x2000)	/* Last buffer descriptor */
-#define BD_SC_INTRPT	((ushort)0x1000)	/* Interrupt on change */
-#define BD_SC_LAST	((ushort)0x0800)	/* Last buffer in frame */
-#define BD_SC_CM	((ushort)0x0200)	/* Continous mode */
-#define BD_SC_ID	((ushort)0x0100)	/* Rec'd too many idles */
-#define BD_SC_P		((ushort)0x0100)	/* xmt preamble */
-#define BD_SC_BR	((ushort)0x0020)	/* Break received */
-#define BD_SC_FR	((ushort)0x0010)	/* Framing error */
-#define BD_SC_PR	((ushort)0x0008)	/* Parity error */
-#define BD_SC_OV	((ushort)0x0002)	/* Overrun */
-#define BD_SC_CD	((ushort)0x0001)	/* ?? */
-
  /* Function code bits, usually generic to devices.
  */
  #define CPMFCR_GBL	((u_char)0x20)	/* Set memory snooping */
@@ -456,43 +433,6 @@ typedef struct scc_enet {
  #define SCC_PSMR_NIB22	((ushort)0x000a)	/* Start frame search */
  #define SCC_PSMR_FDE	((ushort)0x0001)	/* Full duplex enable */

-/* Buffer descriptor control/status used by Ethernet receive.
- * Common to SCC and FCC.
- */
-#define BD_ENET_RX_EMPTY	((ushort)0x8000)
-#define BD_ENET_RX_WRAP		((ushort)0x2000)
-#define BD_ENET_RX_INTR		((ushort)0x1000)
-#define BD_ENET_RX_LAST		((ushort)0x0800)
-#define BD_ENET_RX_FIRST	((ushort)0x0400)
-#define BD_ENET_RX_MISS		((ushort)0x0100)
-#define BD_ENET_RX_BC		((ushort)0x0080)	/* FCC Only */
-#define BD_ENET_RX_MC		((ushort)0x0040)	/* FCC Only */
-#define BD_ENET_RX_LG		((ushort)0x0020)
-#define BD_ENET_RX_NO		((ushort)0x0010)
-#define BD_ENET_RX_SH		((ushort)0x0008)
-#define BD_ENET_RX_CR		((ushort)0x0004)
-#define BD_ENET_RX_OV		((ushort)0x0002)
-#define BD_ENET_RX_CL		((ushort)0x0001)
-#define BD_ENET_RX_STATS	((ushort)0x01ff)	/* All status bits */
-
-/* Buffer descriptor control/status used by Ethernet transmit.
- * Common to SCC and FCC.
- */
-#define BD_ENET_TX_READY	((ushort)0x8000)
-#define BD_ENET_TX_PAD		((ushort)0x4000)
-#define BD_ENET_TX_WRAP		((ushort)0x2000)
-#define BD_ENET_TX_INTR		((ushort)0x1000)
-#define BD_ENET_TX_LAST		((ushort)0x0800)
-#define BD_ENET_TX_TC		((ushort)0x0400)
-#define BD_ENET_TX_DEF		((ushort)0x0200)
-#define BD_ENET_TX_HB		((ushort)0x0100)
-#define BD_ENET_TX_LC		((ushort)0x0080)
-#define BD_ENET_TX_RL		((ushort)0x0040)
-#define BD_ENET_TX_RCMASK	((ushort)0x003c)
-#define BD_ENET_TX_UN		((ushort)0x0002)
-#define BD_ENET_TX_CSL		((ushort)0x0001)
-#define BD_ENET_TX_STATS	((ushort)0x03ff)	/* All status bits */
-
  /* SCC as UART
  */
  typedef struct scc_uart {
@@ -562,8 +502,6 @@ typedef struct scc_trans {
  	uint	st_cmask;	/* Constant mask for CRC */
  } scc_trans_t;

-#define BD_SCC_TX_LAST		((ushort)0x0800)
-
  /* How about some FCCs.....
  */
  #define FCC_GFMR_DIAG_NORM	((uint)0x00000000)
@@ -769,8 +707,6 @@ typedef struct spi {

  #define SPI_EB		((u_char)0x10)		/* big endian byte order */

-#define BD_IIC_START		((ushort)0x0400)
-
  /* IDMA parameter RAM
  */
  typedef struct idma {
-- 
1.5.3.8

^ permalink raw reply related

* Re: [PATCHv2 5/8] [POWERPC] Remove sysdev/commproc.h
From: Kumar Gala @ 2008-01-23 16:06 UTC (permalink / raw)
  To: Jochen Friedrich; +Cc: Scott Wood, Kernel, Linux, linuxppc-dev list
In-Reply-To: <479764B8.4010909@scram.de>


On Jan 23, 2008, at 10:00 AM, Jochen Friedrich wrote:

> Move cpm1 specific prototypes to asm/commproc.h and mpc8xx specific
> prototypes to asm/mpc8xx.h. Adjust includes accordingly. Remove now
> unneeded sysdev/commproc.h.
>
> Signed-off-by: Jochen Friedrich <jochen@scram.de>
> ---
> arch/powerpc/platforms/8xx/ep88xc.c          |    3 +--
> arch/powerpc/platforms/8xx/m8xx_setup.c      |    1 -
> arch/powerpc/platforms/8xx/mpc86xads_setup.c |    2 --
> arch/powerpc/platforms/8xx/mpc885ads_setup.c |    2 --
> arch/powerpc/sysdev/commproc.c               |    1 -
> arch/powerpc/sysdev/commproc.h               |   12 ------------
> arch/powerpc/sysdev/mpc8xx_pic.c             |    1 -
> drivers/net/fs_enet/mac-scc.c                |    1 -
> include/asm-powerpc/commproc.h               |    2 ++
> include/asm-powerpc/mpc8xx.h                 |    7 +++++++

Do we really need the prototypes you moved into asm/mpc8xx.h here?   
can they just live in platforms/8xx/8xx.h or something like that?

- k

^ permalink raw reply

* Re: [PATCHv2 4/8] [POWERPC] Remove declaration of m8xx_pic_init.
From: Kumar Gala @ 2008-01-23 16:07 UTC (permalink / raw)
  To: Jochen Friedrich; +Cc: Scott Wood, Kernel, Linux, linuxppc-dev list
In-Reply-To: <47976499.9050505@scram.de>


On Jan 23, 2008, at 10:00 AM, Jochen Friedrich wrote:

> m8xx_pic_init is declared in ppc8xx_pic.h but defined nowhere in the  
> ppc
> tree. Remove it.
>
> Signed-off-by: Jochen Friedrich <jochen@scram.de>

if we respin the patches, merge this with 2/8 - Rename m8xx_pic_init  
to mpc8xx_pics_init.

(otherwise i'll merge when I commit).

- k

^ permalink raw reply

* Re: [PATCHv2 0/8] [POWERPC] 8xx cleanups
From: Kumar Gala @ 2008-01-23 16:11 UTC (permalink / raw)
  To: Jochen Friedrich; +Cc: Scott Wood, Kernel, Linux, linuxppc-dev list
In-Reply-To: <4797641F.4000902@scram.de>


On Jan 23, 2008, at 9:58 AM, Jochen Friedrich wrote:

> Hi,
>
> this is a series against paulus for-2.6.25 tree to clean up various  
> 8xx related stuff.
> The series can be pulled from git://git.bocc.de/dbox2.git cleanup.
> Patch 6 has been modified to remove the #ifdefs as suggested by  
> Arndt Bergmann.
> Patch 8 is a new one.
>
> [POWERPC] Remove unused m8xx_cpm_hostalloc/free/dump()
> [POWERPC] Rename m8xx_pic_init to mpc8xx_pics_init
> [POWERPC] Remove unneeded and misspelled prototype m8xx_calibrate_decr
> [POWERPC] Remove declaration of m8xx_pic_init.
> [POWERPC] Remove sysdev/commproc.h
> [POWERPC] Get rid of conditional includes of board specific setup
> [POWERPC] Rename commproc to cpm1 and cpm2_common.c to cpm2.c
> [POWERPC] Move definition of buffer descriptor to cpm.h

These roughly look good, had a few comments.  Don't see any reason why  
they can't go in.

What impact do the have on boards in arch/ppc being able to build?

- k

^ permalink raw reply

* Re: [PATCH] [POWERPC] Update TQM5200, CM5200 and Motion-PRO _defconfig and .dts files
From: Grant Likely @ 2008-01-23 16:27 UTC (permalink / raw)
  To: Wolfgang Denk
  Cc: Olof Johansson, linuxppc-dev, tech-denx, Detlev Zundel,
	Marian Balakowicz
In-Reply-To: <20080123125413.EB56924344@gemini.denx.de>

On 1/23/08, Wolfgang Denk <wd@denx.de> wrote:
> In message <479725A4.2020401@semihalf.com> you wrote:
> > Olof Johansson wrote:
> > ...
> > >
> > > I disagree, I have one defconfig for all our boards to date. It means I
> > > only have one kernel to build to test on all boards, instead of having
> > > to build a number of different kernels. Keeping it fairly generic also
> > > means a customer can start out using the generic kernel in case they
> > > want to, and later on add their own drivers and prune out what is not
> > > needed.
> >
> > Well, I just prefer separate defconfigs but I can live with the common
> > one as well, feel free to merge it as you see it fit.
>
> Well, it may make sense to use common defconfig files for  boards  of
> the same breed (different configurations of one board family from one
> vendor  for  example).  But  please  note  that  TQM5200,  CM5200 and
> Motion-PRO are boards from 3 different  vendors,  used  by  different
> projects  with  differing  needs.  IMO  it  makes  very much sense to
> provide 3 separate default configurations  that  match  the  specific
> requirements of each of these boards.
>
> In this case I vote for separate defconfig files, please.

I think I'm going to go with a single defconfig for all 5200 boards
for the time being.  We can revisit later if it turns out not to be
working.  Here are my reasons:

- mpc5200 is intended to be multiplatform.  Using a common defconfig
increases the likelyhood that a kernel with support for all 5200
platforms will actually get tested.
- Reduces the time cost required to build all powerpc defconfigs (only
1 needed instead of 5 and growing)
- defconfigs are intended to be the known working configuration; not
necessarily an optimized for deployment configuration.  The
system/kernel engineer is still responsible to tailor the
configuration for a shippable distribution.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: CONFIG_PCI interaction with pata_platform driver on MPC834x board
From: Kumar Gala @ 2008-01-23 16:38 UTC (permalink / raw)
  To: Johns Daniel; +Cc: linuxppc-embedded
In-Reply-To: <ba5d9360801230706n47ad71bapd1820488f823736f@mail.gmail.com>


On Jan 23, 2008, at 9:06 AM, Johns Daniel wrote:

> I am asking this question once more since my previous try -- right
> before the Christmas break -- did not elicit any responses!   ;~)
>
> Without PCI support configured in the kernel, the CompactFlash card is
> discovered and configured by the kernel. With PCI support configured
> in the kernel, it fails to discover the CF card through the
> pata_platform driver.
>
> (Note that both PCI and CF work fine on this same board with the
> generic IDE driver!)
>
> There are only two differences that I notice between the two kernel
> setups that might be significant:
> 1.) The libata virq changes from 19 to 20.
> 2.) The isa_io_base changes from 0x0 to 0xfcfff000.
> Are either of these two changes significant?
>
> I am using the "arch/powerpc" kernel, version 2.6.20.21. The CF is
> wired directly to the local bus in True IDE mode.
>
> I have some debug info included in my previous message at:
>
> http://www.nabble.com/CONFIG_PCI-interaction-with-pata_platform-driver-on-MPC834x-board-tc14457502.html

I suggest putting some prints in the driver to see if the addresses  
that are ioremap() are the same.

then I'd track down if/where actual register read/writes are occurring  
and see if the same address is being used.

- k

^ permalink raw reply

* Re: framebuffer swap endianess
From: Kumar Gala @ 2008-01-23 16:39 UTC (permalink / raw)
  To: Roman Fietze; +Cc: linuxppc-embedded
In-Reply-To: <200801230839.33212.roman.fietze@telemotive.de>


On Jan 23, 2008, at 1:39 AM, Roman Fietze wrote:

> Hello ANgelo,
>
> On Tuesday 22 January 2008 16:46:47 Angelo wrote:
>
>> I have just create a framebuffer for an embedded system:
>> - powerpc (little endian)  with  a GPU (big endian).
>
> Are you sure? Isn't it the other way around?

we are sure.  Linux only supports PPC in big endian mode.

  - k

^ permalink raw reply

* Re: [patch v4 0/4] Cypress c67x00 (EZ-Host/EZ-OTG) support
From: Grant Likely @ 2008-01-23 17:12 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: David Brownell, linuxppc-dev, linux-usb
In-Reply-To: <87sl0qzxos.fsf@macbook.be.48ers.dk>

On 1/21/08, Peter Korsgaard <jacmet@sunsite.dk> wrote:
> >>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:
>
>  Grant> Personally, I'd prefer to see the v3 series picked up now (as I
>  Grant> believe all outstanding comments from the list have been addressed)
>  Grant> and have new patches build on top of that, but that's just my
>  Grant> preference.
>
> Here's the v3->v4 without gadget diff:

Okay, I've had a chance to read through this.  I haven't tested it,
but I don't see anything I strongly disagree with.  I've just got a
few editorial comments below and a question.

The question is about the device structure which used to be provided
by the platform device instances and now there just uses the c67x00's
device struct.  I was under the impression that each USB HCD needs to
have it's own struct device.  I take it that's not true?

Otherwise:

Acked-by: Grant Likely <grant.likely@secretlab.ca>

Cheers,
g.
>
> diff --git a/drivers/usb/c67x00/c67x00-drv.c b/drivers/usb/c67x00/c67x00-drv.c
> index 0f0720a..c2ea3b6 100644
> --- a/drivers/usb/c67x00/c67x00-drv.c
> +++ b/drivers/usb/c67x00/c67x00-drv.c
> @@ -203,19 +175,19 @@ static int __devinit c67x00_drv_probe(struct platform_device *pdev)
>         }
>
>         for (i = 0; i < C67X00_SIES; i++)
> -               c67x00_probe_sie(&c67x00->sie[i]);
> +               c67x00_probe_sie(&c67x00->sie[i], c67x00, i);
>
>         platform_set_drvdata(pdev, c67x00);
>
>         return 0;
>
> - reset_failed:
> +reset_failed:
>         free_irq(res2->start, c67x00);
> - request_irq_failed:
> +request_irq_failed:
>         iounmap(c67x00->hpi.base);
> - map_failed:
> +map_failed:
>         release_mem_region(res->start, res->end - res->start + 1);
> - request_mem_failed:
> +request_mem_failed:

A single space should be preserved in front of the labels.  Doing so
means that git-diff picks up the function name instead of the label
when generating output.

> diff --git a/drivers/usb/c67x00/c67x00-hcd.c b/drivers/usb/c67x00/c67x00-hcd.c
> index 3d0b77e..4afb291 100644
> --- a/drivers/usb/c67x00/c67x00-hcd.c
> +++ b/drivers/usb/c67x00/c67x00-hcd.c
> @@ -368,23 +383,26 @@ int c67x00_hcd_probe(struct c67x00_sie *sie)
>                 goto err2;
>         }
>
> +       spin_lock_irqsave(&sie->lock, flags);
> +       sie->private_data = c67x00;
> +       sie->irq = c67x00_hcd_irq;
> +       spin_unlock_irqrestore(&sie->lock, flags);
> +
>         return retval;
> - err2:
> +err2:
>         c67x00_sched_stop_scheduler(c67x00);
> - err1:
> +err1:
>         usb_put_hcd(hcd);
> - err0:
> +err0:

Ditto on the labels

> diff --git a/drivers/usb/c67x00/c67x00-hcd.h b/drivers/usb/c67x00/c67x00-hcd.h
> index 5b35f01..daee4cd 100644
> --- a/drivers/usb/c67x00/c67x00-hcd.h
> +++ b/drivers/usb/c67x00/c67x00-hcd.h
> @@ -132,6 +147,6 @@ void c67x00_sched_kick(struct c67x00_hcd *c67x00);
>  int c67x00_sched_start_scheduler(struct c67x00_hcd *c67x00);
>  void c67x00_sched_stop_scheduler(struct c67x00_hcd *c67x00);
>
> -#define c67x00_hcd_dev(x)      (c67x00_hcd_to_hcd(x)->self.controller)
> +#define c67x00_dev(x)  (c67x00_hcd_to_hcd(x)->self.controller)

Can the name c67x00_hcd_dev() be used instead?  This macro is used
with 'struct c67x00_hcd', not 'struct c67x00' and I find the code less
confusing if the macro name reflects that.

>
>  #endif                         /* _USB_C67X00_HCD_H */
> diff --git a/drivers/usb/c67x00/c67x00-sched.c b/drivers/usb/c67x00/c67x00-sched.c
> index 35d7318..3140d89 100644
> --- a/drivers/usb/c67x00/c67x00-sched.c
> +++ b/drivers/usb/c67x00/c67x00-sched.c
> -       /* Something went wrong; unwind the allocations */
> - err_epdata:
> +err_epdata:
>         kfree(urbp);
> - err_urbp:
> +err_urbp:
>         usb_hcd_unlink_urb_from_ep(hcd, urb);
> - err_not_linked:
> +err_not_linked:

ditto

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: [PATCHv2 0/8] [POWERPC] 8xx cleanups
From: Sam Ravnborg @ 2008-01-23 17:12 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Scott Wood, linuxppc-dev list, Kernel, Linux
In-Reply-To: <CA8FFE19-B84A-426B-9B1C-EF0F7C87AE47@kernel.crashing.org>

> 
> What impact do the have on boards in arch/ppc being able to build?

Byt the way what are the plans for powerpc?
We have:
arch/ppc
arch/ppc64
arch/powerpc

It was my understanding that arch/powerpc was supposed
to be the future unified powerpc architecture but it
does not even provide a defconfig.

And I do not see too much happening to do so - but that maybe
because I looked at a wrong place.

	Sam

^ permalink raw reply

* Re: [PATCH] Fix boot problem in situations where the boot CPU is running on a memoryless node
From: Pekka J Enberg @ 2008-01-23 17:29 UTC (permalink / raw)
  To: Mel Gorman
  Cc: lee.schermerhorn, Olaf Hering, Linux MM, linux-kernel,
	linuxppc-dev, Aneesh Kumar K.V, hanth Aravamudan, akpm,
	KAMEZAWA Hiroyuki, Christoph Lameter
In-Reply-To: <20080123155655.GB20156@csn.ul.ie>

Hi,

On Wed, 23 Jan 2008, Mel Gorman wrote:
> Applied in combination with the N_NORMAL_MEMORY revert and it fails to
> boot. Console is as follows;

Thanks for testing!
 
On Wed, 23 Jan 2008, Mel Gorman wrote:
> [c0000000005c3b40] c0000000000dadb4 .cache_grow+0x7c/0x338
> [c0000000005c3c00] c0000000000db518 .fallback_alloc+0x1c0/0x224
> [c0000000005c3cb0] c0000000000db920 .kmem_cache_alloc+0xe0/0x14c
> [c0000000005c3d50] c0000000000dcbd0 .kmem_cache_create+0x230/0x4cc
> [c0000000005c3e30] c0000000004c049c .kmem_cache_init+0x1ec/0x51c
> [c0000000005c3ee0] c00000000049f8d8 .start_kernel+0x304/0x3fc
> [c0000000005c3f90] c000000000008594 .start_here_common+0x54/0xc0
> 
> 0xc0000000000dadb4 is in cache_grow (mm/slab.c:2782).
> 2777            local_flags = flags & (GFP_CONSTRAINT_MASK|GFP_RECLAIM_MASK);
> 2778    
> 2779            /* Take the l3 list lock to change the colour_next on this node */
> 2780            check_irq_off();
> 2781            l3 = cachep->nodelists[nodeid];
> 2782            spin_lock(&l3->list_lock);
> 2783    
> 2784            /* Get colour for the slab, and cal the next value. */
> 2785            offset = l3->colour_next;
> 2786            l3->colour_next++;

Ok, so it's too early to fallback_alloc() because in kmem_cache_init() we 
do:

        for (i = 0; i < NUM_INIT_LISTS; i++) {
                kmem_list3_init(&initkmem_list3[i]);
                if (i < MAX_NUMNODES)
                        cache_cache.nodelists[i] = NULL;
        }

Fine. But, why are we hitting fallback_alloc() in the first place? It's 
definitely not because of missing ->nodelists as we do:

        cache_cache.nodelists[node] = &initkmem_list3[CACHE_CACHE];

before attempting to set up kmalloc caches. Now, if I understood 
correctly, we're booting off a memoryless node so kmem_getpages() will 
return NULL thus forcing us to fallback_alloc() which is unavailable at 
this point.

As far as I can tell, there are two ways to fix this:

  (1) don't boot off a memoryless node (why are we doing this in the first 
      place?)
  (2) initialize cache_cache.nodelists with initmem_list3 equivalents
      for *each node hat has normal memory*

I am still wondering why this worked before, though.

			Pekka

^ permalink raw reply

* Re: [PATCHv2 0/8] [POWERPC] 8xx cleanups
From: Jon Loeliger @ 2008-01-23 17:31 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Scott Wood, linuxppc-dev list, Kernel, Linux
In-Reply-To: <20080123171252.GA22967@uranus.ravnborg.org>

Sam Ravnborg wrote:
>> What impact do the have on boards in arch/ppc being able to build?
> 
> Byt the way what are the plans for powerpc?
> We have:
> arch/ppc
> arch/ppc64
> arch/powerpc
> 
> It was my understanding that arch/powerpc was supposed
> to be the future unified powerpc architecture but it
> does not even provide a defconfig.
> 
> And I do not see too much happening to do so - but that maybe
> because I looked at a wrong place.

You must have looked in the wrong place. :-)

arch/ppc is scheduled for removal from mainline in June.

arch/powerpc is under significant development, with lots
of defconfigs in arch/powerpc/configs.

arch/ppc64 is long dead.

jdl

^ permalink raw reply

* Re: [PATCH] Fix boot problem in situations where the boot CPU is running on a memoryless node
From: Pekka J Enberg @ 2008-01-23 17:42 UTC (permalink / raw)
  To: Mel Gorman
  Cc: lee.schermerhorn, Olaf Hering, Linux MM, linux-kernel,
	linuxppc-dev, Aneesh Kumar K.V, hanth Aravamudan, akpm,
	KAMEZAWA Hiroyuki, Christoph Lameter
In-Reply-To: <Pine.LNX.4.64.0801231906520.1028@sbz-30.cs.Helsinki.FI>

On Wed, 23 Jan 2008, Pekka J Enberg wrote:
> As far as I can tell, there are two ways to fix this:

[snip]
 
>   (2) initialize cache_cache.nodelists with initmem_list3 equivalents
>       for *each node hat has normal memory*

An untested patch follows:

---
 mm/slab.c |   39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

Index: linux-2.6/mm/slab.c
===================================================================
--- linux-2.6.orig/mm/slab.c
+++ linux-2.6/mm/slab.c
@@ -304,11 +304,11 @@ struct kmem_list3 {
 /*
  * Need this for bootstrapping a per node allocator.
  */
-#define NUM_INIT_LISTS (2 * MAX_NUMNODES + 1)
+#define NUM_INIT_LISTS (3 * MAX_NUMNODES)
 struct kmem_list3 __initdata initkmem_list3[NUM_INIT_LISTS];
 #define	CACHE_CACHE 0
-#define	SIZE_AC 1
-#define	SIZE_L3 (1 + MAX_NUMNODES)
+#define	SIZE_AC MAX_NUMNODES
+#define	SIZE_L3 (2 * MAX_NUMNODES)
 
 static int drain_freelist(struct kmem_cache *cache,
 			struct kmem_list3 *l3, int tofree);
@@ -1410,6 +1410,22 @@ static void init_list(struct kmem_cache 
 }
 
 /*
+ * For setting up all the kmem_list3s for cache whose buffer_size is same as
+ * size of kmem_list3.
+ */
+static void __init set_up_list3s(struct kmem_cache *cachep, int index)
+{
+	int node;
+
+	for_each_node_state(node, N_NORMAL_MEMORY) {
+		cachep->nodelists[node] = &initkmem_list3[index + node];
+		cachep->nodelists[node]->next_reap = jiffies +
+		    REAPTIMEOUT_LIST3 +
+		    ((unsigned long)cachep) % REAPTIMEOUT_LIST3;
+	}
+}
+
+/*
  * Initialisation.  Called after the page allocator have been initialised and
  * before smp_init().
  */
@@ -1432,6 +1448,7 @@ void __init kmem_cache_init(void)
 		if (i < MAX_NUMNODES)
 			cache_cache.nodelists[i] = NULL;
 	}
+	set_up_list3s(&cache_cache, CACHE_CACHE);
 
 	/*
 	 * Fragmentation resistance on low memory - only use bigger
@@ -1964,22 +1981,6 @@ static void slab_destroy(struct kmem_cac
 	}
 }
 
-/*
- * For setting up all the kmem_list3s for cache whose buffer_size is same as
- * size of kmem_list3.
- */
-static void __init set_up_list3s(struct kmem_cache *cachep, int index)
-{
-	int node;
-
-	for_each_node_state(node, N_NORMAL_MEMORY) {
-		cachep->nodelists[node] = &initkmem_list3[index + node];
-		cachep->nodelists[node]->next_reap = jiffies +
-		    REAPTIMEOUT_LIST3 +
-		    ((unsigned long)cachep) % REAPTIMEOUT_LIST3;
-	}
-}
-
 static void __kmem_cache_destroy(struct kmem_cache *cachep)
 {
 	int i;

^ permalink raw reply

* Re: [patch v4 0/4] Cypress c67x00 (EZ-Host/EZ-OTG) support
From: David Brownell @ 2008-01-23 17:53 UTC (permalink / raw)
  To: Grant Likely; +Cc: linux-usb, linuxppc-dev
In-Reply-To: <fa686aa40801230912m2314209fp2545898949ed3b24@mail.gmail.com>

On Wednesday 23 January 2008, Grant Likely wrote:
> The question is about the device structure which used to be provided
> by the platform device instances and now there just uses the c67x00's
> device struct.  I was under the impression that each USB HCD needs to
> have it's own struct device.  I take it that's not true?

Each root hub necessarily is a unique device, representing a set
of downstream links.  Unless Peter didn't test something relevant,
it would seem we have observational proof that two root hubs can
share the same device node for an upstream link.

I can't think of a reason to demand multiple upstream links, though
sharing them between root hubs like that isn't a common structure.  

- Dave

^ permalink raw reply

* Re: [PATCHv2 0/8] [POWERPC] 8xx cleanups
From: Sam Ravnborg @ 2008-01-23 18:00 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: Scott Wood, linuxppc-dev list, Kernel, Linux
In-Reply-To: <47977A02.40506@freescale.com>

On Wed, Jan 23, 2008 at 11:31:46AM -0600, Jon Loeliger wrote:
> Sam Ravnborg wrote:
> >>What impact do the have on boards in arch/ppc being able to build?
> >
> >Byt the way what are the plans for powerpc?
> >We have:
> >arch/ppc
> >arch/ppc64
> >arch/powerpc
> >
> >It was my understanding that arch/powerpc was supposed
> >to be the future unified powerpc architecture but it
> >does not even provide a defconfig.
> >
> >And I do not see too much happening to do so - but that maybe
> >because I looked at a wrong place.
> 
> You must have looked in the wrong place. :-)
> 
> arch/ppc is scheduled for removal from mainline in June.
Good to hear.

> arch/powerpc is under significant development, with lots
> of defconfigs in arch/powerpc/configs.
Double checked - it was my build script that used ARCH=ppc
Now I just need to build another toolchain as the ppc750 could not build
the defconfig. crosstool is my friend here.

	Sam

^ permalink raw reply

* Re: [PATCHv2 5/8] [POWERPC] Remove sysdev/commproc.h
From: Jochen Friedrich @ 2008-01-23 18:03 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Scott Wood, Kernel, Linux, linuxppc-dev list
In-Reply-To: <83FEE161-D10D-4E21-BDB3-D0B6D49668CE@kernel.crashing.org>

Hi Kumar,

> Do we really need the prototypes you moved into asm/mpc8xx.h here?  can 
> they just live in platforms/8xx/8xx.h or something like that?

At least drivers/pcmcia/m8xx_pcmcia.c uses the symbol m8xx_pcmcia_ops
which is conditionally defined in platforms/8xx/m8xx_setup.c. However,
this driver currently seems to be broken (doesn't compile neither as
built-in nor as module).

Other drivers that include asm/mpc8xx.c are:

drivers/net/fec.c (the include seems to be obsolete, as according to Kconfig
                    the driver is only built on MPC52xx platforms)
drivers/net/fec_8xx (unused, depends on non-existant CONFIG_8XX)
drivers/net/fs_enet (i need to check if the include is needed, at all)

I'll have a closer look at this.

Thanks,
Jochen

^ permalink raw reply

* Re: [PATCH] Fix boot problem in situations where the boot CPU is running on a memoryless node
From: Christoph Lameter @ 2008-01-23 18:35 UTC (permalink / raw)
  To: Pekka J Enberg
  Cc: lee.schermerhorn, Olaf Hering, Linux MM, Mel Gorman, linux-kernel,
	linuxppc-dev, Aneesh Kumar K.V, hanth Aravamudan, akpm,
	KAMEZAWA Hiroyuki
In-Reply-To: <Pine.LNX.4.64.0801231611160.20050@sbz-30.cs.Helsinki.FI>

On Wed, 23 Jan 2008, Pekka J Enberg wrote:

> I still think Christoph's kmem_getpages() patch is correct (to fix 
> cache_grow() oops) but I overlooked the fact that none the callers of 
> ____cache_alloc_node() deal with bootstrapping (with the exception of 
> __cache_alloc_node() that even has a comment about it).

My patch is useless. kmem_getpages called with nodeid == -1 falls back 
correctly to the available node. The problem is that the node structures 
for the page does not exist.
 
> But what I am really wondering about is, why wasn't the 
> N_NORMAL_MEMORY revert enough? I assume this used to work before so what 
> more do we need to revert for 2.6.24?

I think that is because SLUB relaxed the requirements on having regular 
memory on the boot node. Now the expectation is that SLAB can do the same.

^ permalink raw reply

* Re: [PATCH] Fix boot problem in situations where the boot CPU is running on a memoryless node
From: Christoph Lameter @ 2008-01-23 18:36 UTC (permalink / raw)
  To: Pekka J Enberg
  Cc: lee.schermerhorn, Olaf Hering, Linux MM, Mel Gorman, linux-kernel,
	linuxppc-dev, Aneesh Kumar K.V, hanth Aravamudan, akpm,
	KAMEZAWA Hiroyuki
In-Reply-To: <Pine.LNX.4.64.0801231648140.23343@sbz-30.cs.Helsinki.FI>

On Wed, 23 Jan 2008, Pekka J Enberg wrote:

> Furthermore, don't let kmem_getpages() call alloc_pages_node() if nodeid passed
> to it is -1 as the latter will always translate that to numa_node_id() which
> might not have ->nodelist that caused the invocation of fallback_alloc() in the
> first place (for example, during bootstrap).

kmem_getpages is called without GFP_THISNODE. This 
alloc_pages_node(numa_node_id(), ...) will fall back to the next node with 
memory.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox