LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] i2c-mpc: work around missing-9th-clock-pulse bug
From: Grant Likely @ 2007-07-11  6:03 UTC (permalink / raw)
  To: Domen Puncer; +Cc: Jean Delvare, i2c, linuxppc-embedded
In-Reply-To: <20070711054923.GA4375@moe.telargo.com>

On 7/10/07, Domen Puncer <domen.puncer@telargo.com> wrote:
> On 10/07/07 14:40 +0200, Jean Delvare wrote:
> > Hi Grant, hi Domen,
> >
> > On Tue, 10 Jul 2007 00:22:05 -0600, Grant Likely wrote:
> > > On 7/10/07, Domen Puncer <domen.puncer@telargo.com> wrote:
> > > > Work around a problem reported on:
> > > > http://ozlabs.org/pipermail/linuxppc-embedded/2005-July/019038.html
> > > > Without this patch I2C on mpc5200 becomes unusable after a while.
> > > > Tested on mpc5200 boards by Matthias and me.
> > > >
> > > >
> > > > Signed-off-by: Domen Puncer <domen.puncer@telargo.com>
> > >
> > > Looks good to me,
> > >
> > > Acked-by: Grant Likely <grant.likely@secretlab.ca>
> >
> > OK, I will take this patch, but I'd like you to add a comment before
> > mpc_i2c_fixup() explaining what exactly the problem is and how it is
> > worked around. Otherwise it's a bit obscure what is going on.
>
> OK.
>
> >
> > I guess you want this patch in 2.6.23-rc1?
>
> Yes.
>
> So... v3:
> <----------- cut ------------->
>
> Work around a problem reported on:
> http://ozlabs.org/pipermail/linuxppc-embedded/2005-July/019038.html
> Without this patch I2C on mpc5200 becomes unusable after a while.
> Tested on mpc5200 boards by Matthias Fechner and me.
>
>
> Signed-off-by: Domen Puncer <domen.puncer@telargo.com>
>
> ---
>  drivers/i2c/busses/i2c-mpc.c |   21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
>
> Index: work-powerpc.git/drivers/i2c/busses/i2c-mpc.c
> ===================================================================
> --- work-powerpc.git.orig/drivers/i2c/busses/i2c-mpc.c
> +++ work-powerpc.git/drivers/i2c/busses/i2c-mpc.c
> @@ -74,6 +74,24 @@ static irqreturn_t mpc_i2c_isr(int irq,
>         return IRQ_HANDLED;
>  }
>
> +/* Sometimes 9th clock pulse isn't generated, so slave doesn't release
> + * the bus.  Documented and suggested workaround on
> + * http://ozlabs.org/pipermail/linuxppc-embedded/2005-July/019038.html
> + */

I don't think it's a great idea to use a link;  You should copy the
important parts into the .c file.  Archives may not be forever, and
links cannot be read when offline.  If the text is too long for the
middle of the C file; then put the documentation at the top right
after the header block.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH] i2c-mpc: work around missing-9th-clock-pulse bug
From: Domen Puncer @ 2007-07-11  5:49 UTC (permalink / raw)
  To: Jean Delvare; +Cc: i2c, linuxppc-embedded
In-Reply-To: <20070710144030.3786cbf3@hyperion.delvare>

On 10/07/07 14:40 +0200, Jean Delvare wrote:
> Hi Grant, hi Domen,
> 
> On Tue, 10 Jul 2007 00:22:05 -0600, Grant Likely wrote:
> > On 7/10/07, Domen Puncer <domen.puncer@telargo.com> wrote:
> > > Work around a problem reported on:
> > > http://ozlabs.org/pipermail/linuxppc-embedded/2005-July/019038.html
> > > Without this patch I2C on mpc5200 becomes unusable after a while.
> > > Tested on mpc5200 boards by Matthias and me.
> > >
> > >
> > > Signed-off-by: Domen Puncer <domen.puncer@telargo.com>
> > 
> > Looks good to me,
> > 
> > Acked-by: Grant Likely <grant.likely@secretlab.ca>
> 
> OK, I will take this patch, but I'd like you to add a comment before
> mpc_i2c_fixup() explaining what exactly the problem is and how it is
> worked around. Otherwise it's a bit obscure what is going on.

OK.

> 
> I guess you want this patch in 2.6.23-rc1?

Yes.

So... v3:
<----------- cut ------------->

Work around a problem reported on:
http://ozlabs.org/pipermail/linuxppc-embedded/2005-July/019038.html
Without this patch I2C on mpc5200 becomes unusable after a while.
Tested on mpc5200 boards by Matthias Fechner and me.


Signed-off-by: Domen Puncer <domen.puncer@telargo.com>

---
 drivers/i2c/busses/i2c-mpc.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

Index: work-powerpc.git/drivers/i2c/busses/i2c-mpc.c
===================================================================
--- work-powerpc.git.orig/drivers/i2c/busses/i2c-mpc.c
+++ work-powerpc.git/drivers/i2c/busses/i2c-mpc.c
@@ -74,6 +74,24 @@ static irqreturn_t mpc_i2c_isr(int irq, 
 	return IRQ_HANDLED;
 }
 
+/* Sometimes 9th clock pulse isn't generated, so slave doesn't release
+ * the bus.  Documented and suggested workaround on
+ * http://ozlabs.org/pipermail/linuxppc-embedded/2005-July/019038.html
+ */
+static void mpc_i2c_fixup(struct mpc_i2c *i2c)
+{
+	writeccr(i2c, 0);
+	udelay(30);
+	writeccr(i2c, CCR_MEN);
+	udelay(30);
+	writeccr(i2c, CCR_MSTA | CCR_MTX);
+	udelay(30);
+	writeccr(i2c, CCR_MSTA | CCR_MTX | CCR_MEN);
+	udelay(30);
+	writeccr(i2c, CCR_MEN);
+	udelay(30);
+}
+
 static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
 {
 	unsigned long orig_jiffies = jiffies;
@@ -153,6 +171,7 @@ static void mpc_i2c_start(struct mpc_i2c
 static void mpc_i2c_stop(struct mpc_i2c *i2c)
 {
 	writeccr(i2c, CCR_MEN);
+	writeccr(i2c, 0);
 }
 
 static int mpc_write(struct mpc_i2c *i2c, int target,
@@ -245,6 +264,8 @@ static int mpc_xfer(struct i2c_adapter *
 		}
 		if (time_after(jiffies, orig_jiffies + HZ)) {
 			pr_debug("I2C: timeout\n");
+			if (readb(i2c->base + MPC_I2C_SR) == (CSR_MCF | CSR_MBB | CSR_RXAK))
+				mpc_i2c_fixup(i2c);
 			return -EIO;
 		}
 		schedule();

^ permalink raw reply

* Please pull powerpc.git merge branch
From: Paul Mackerras @ 2007-07-11  4:46 UTC (permalink / raw)
  To: torvalds; +Cc: linuxppc-dev

Linus,

Please do

git pull \
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git merge

to get a powerpc update for 2.6.23.

Note the changes to Documentation/cachetlb.txt, mm/vmalloc.c and
include/linux/vmalloc.h - that is Ben H's change of unmap_vm_area to
unmap_kernel_range, which was OK'd by Andrew Morton.

Thanks,
Paul.

 Documentation/cachetlb.txt                        |    2 
 Documentation/feature-removal-schedule.txt        |   12 
 Documentation/powerpc/booting-without-of.txt      |   40 +
 arch/powerpc/Kconfig                              |  267 -------
 arch/powerpc/Makefile                             |    2 
 arch/powerpc/boot/44x.c                           |   45 +
 arch/powerpc/boot/44x.h                           |    3 
 arch/powerpc/boot/Makefile                        |   81 +-
 arch/powerpc/boot/cuboot-83xx.c                   |   13 
 arch/powerpc/boot/cuboot-85xx.c                   |   13 
 arch/powerpc/boot/cuboot-ebony.c                  |   16 
 arch/powerpc/boot/cuboot.c                        |   35 +
 arch/powerpc/boot/cuboot.h                        |   14 
 arch/powerpc/boot/dcr.h                           |   37 +
 arch/powerpc/boot/dts/ebony.dts                   |   12 
 arch/powerpc/boot/dts/holly.dts                   |   52 +
 arch/powerpc/boot/dts/mpc7448hpc2.dts             |   33 -
 arch/powerpc/boot/dts/mpc8272ads.dts              |   42 -
 arch/powerpc/boot/dts/mpc832x_mds.dts             |   16 
 arch/powerpc/boot/dts/mpc832x_rdb.dts             |   16 
 arch/powerpc/boot/dts/mpc8349emitx.dts            |   10 
 arch/powerpc/boot/dts/mpc834x_mds.dts             |   10 
 arch/powerpc/boot/dts/mpc836x_mds.dts             |   16 
 arch/powerpc/boot/dts/mpc8540ads.dts              |  147 ++--
 arch/powerpc/boot/dts/mpc8541cds.dts              |   90 +-
 arch/powerpc/boot/dts/mpc8544ds.dts               |   18 
 arch/powerpc/boot/dts/mpc8548cds.dts              |  108 +--
 arch/powerpc/boot/dts/mpc8555cds.dts              |   90 +-
 arch/powerpc/boot/dts/mpc8560ads.dts              |  148 ++--
 arch/powerpc/boot/dts/mpc8568mds.dts              |   66 +-
 arch/powerpc/boot/dts/mpc8641_hpcn.dts            |  147 +++-
 arch/powerpc/boot/dts/mpc866ads.dts               |   31 -
 arch/powerpc/boot/dts/mpc885ads.dts               |   54 +
 arch/powerpc/boot/dts/prpmc2800.dts               |    2 
 arch/powerpc/boot/dts/ps3.dts                     |   68 ++
 arch/powerpc/boot/ebony.c                         |   19 
 arch/powerpc/boot/main.c                          |    2 
 arch/powerpc/boot/of.c                            |  212 -----
 arch/powerpc/boot/of.h                            |   21 +
 arch/powerpc/boot/ofconsole.c                     |   45 +
 arch/powerpc/boot/oflib.c                         |  202 +++++
 arch/powerpc/boot/ops.h                           |    4 
 arch/powerpc/boot/ps3-head.S                      |   80 ++
 arch/powerpc/boot/ps3-hvcall.S                    |  184 +++++
 arch/powerpc/boot/ps3.c                           |  161 ++++
 arch/powerpc/boot/serial.c                        |    2 
 arch/powerpc/boot/stdio.c                         |   10 
 arch/powerpc/boot/types.h                         |    4 
 arch/powerpc/boot/wrapper                         |   55 +
 arch/powerpc/boot/zImage.ps3.lds.S                |   50 +
 arch/powerpc/configs/holly_defconfig              |    6 
 arch/powerpc/configs/ps3_defconfig                |   52 +
 arch/powerpc/kernel/Makefile                      |    7 
 arch/powerpc/kernel/cputable.c                    |   35 +
 arch/powerpc/kernel/head_32.S                     |  122 ---
 arch/powerpc/kernel/head_64.S                     |    4 
 arch/powerpc/kernel/io.c                          |   12 
 arch/powerpc/kernel/irq.c                         |   60 +-
 arch/powerpc/kernel/isa-bridge.c                  |  271 +++++++
 arch/powerpc/kernel/misc_32.S                     |   10 
 arch/powerpc/kernel/misc_64.S                     |   26 -
 arch/powerpc/kernel/of_platform.c                 |    8 
 arch/powerpc/kernel/pci-common.c                  |  454 ++++++++++++
 arch/powerpc/kernel/pci_32.c                      |  510 -------------
 arch/powerpc/kernel/pci_64.c                      |  750 +++----------------
 arch/powerpc/kernel/ppc_ksyms.c                   |    5 
 arch/powerpc/kernel/process.c                     |   14 
 arch/powerpc/kernel/prom.c                        |   29 -
 arch/powerpc/kernel/prom_init.c                   |    4 
 arch/powerpc/kernel/ptrace-common.h               |  161 ----
 arch/powerpc/kernel/ptrace.c                      |  325 ++++++--
 arch/powerpc/kernel/ptrace32.c                    |  239 +++---
 arch/powerpc/kernel/rtas_pci.c                    |    7 
 arch/powerpc/kernel/setup-common.c                |   21 +
 arch/powerpc/kernel/setup_32.c                    |   12 
 arch/powerpc/kernel/setup_64.c                    |   12 
 arch/powerpc/kernel/signal.c                      |  180 +++++
 arch/powerpc/kernel/signal.h                      |   55 +
 arch/powerpc/kernel/signal_32.c                   |  191 +----
 arch/powerpc/kernel/signal_64.c                   |  182 -----
 arch/powerpc/kernel/sysfs.c                       |    5 
 arch/powerpc/kernel/time.c                        |   65 +-
 arch/powerpc/kernel/vdso.c                        |    2 
 arch/powerpc/kernel/vmlinux.lds.S                 |    6 
 arch/powerpc/mm/44x_mmu.c                         |    1 
 arch/powerpc/mm/4xx_mmu.c                         |    1 
 arch/powerpc/mm/Makefile                          |    3 
 arch/powerpc/mm/fault.c                           |    2 
 arch/powerpc/mm/fsl_booke_mmu.c                   |    1 
 arch/powerpc/mm/hash_native_64.c                  |   27 -
 arch/powerpc/mm/hash_utils_64.c                   |    2 
 arch/powerpc/mm/imalloc.c                         |  313 --------
 arch/powerpc/mm/init_32.c                         |    1 
 arch/powerpc/mm/init_64.c                         |    1 
 arch/powerpc/mm/mem.c                             |    3 
 arch/powerpc/mm/mmu_context_32.c                  |    1 
 arch/powerpc/mm/mmu_decl.h                        |   17 
 arch/powerpc/mm/pgtable_32.c                      |  123 ---
 arch/powerpc/mm/pgtable_64.c                      |  206 +----
 arch/powerpc/mm/ppc_mmu_32.c                      |    7 
 arch/powerpc/mm/stab.c                            |    4 
 arch/powerpc/mm/tlb_32.c                          |    1 
 arch/powerpc/mm/tlb_64.c                          |   57 +
 arch/powerpc/oprofile/op_model_power4.c           |   14 
 arch/powerpc/platforms/52xx/efika.c               |   13 
 arch/powerpc/platforms/52xx/lite5200.c            |    2 
 arch/powerpc/platforms/52xx/mpc52xx_pci.c         |   18 
 arch/powerpc/platforms/52xx/mpc52xx_pm.c          |    8 
 arch/powerpc/platforms/82xx/Kconfig               |    2 
 arch/powerpc/platforms/82xx/mpc82xx_ads.c         |   17 
 arch/powerpc/platforms/83xx/Kconfig               |    2 
 arch/powerpc/platforms/83xx/Makefile              |    2 
 arch/powerpc/platforms/83xx/mpc8313_rdb.c         |    8 
 arch/powerpc/platforms/83xx/mpc832x_mds.c         |    7 
 arch/powerpc/platforms/83xx/mpc832x_rdb.c         |    7 
 arch/powerpc/platforms/83xx/mpc834x_itx.c         |    9 
 arch/powerpc/platforms/83xx/mpc834x_mds.c         |   56 -
 arch/powerpc/platforms/83xx/mpc836x_mds.c         |    7 
 arch/powerpc/platforms/83xx/mpc83xx.h             |   34 +
 arch/powerpc/platforms/83xx/pci.c                 |   18 
 arch/powerpc/platforms/83xx/usb.c                 |  181 +++++
 arch/powerpc/platforms/85xx/misc.c                |   32 +
 arch/powerpc/platforms/85xx/mpc8544_ds.c          |   15 
 arch/powerpc/platforms/85xx/mpc85xx.h             |    2 
 arch/powerpc/platforms/85xx/mpc85xx_ads.c         |   32 -
 arch/powerpc/platforms/85xx/mpc85xx_cds.c         |  116 +--
 arch/powerpc/platforms/85xx/mpc85xx_mds.c         |   28 -
 arch/powerpc/platforms/85xx/pci.c                 |   11 
 arch/powerpc/platforms/86xx/Kconfig               |    2 
 arch/powerpc/platforms/86xx/mpc86xx.h             |   11 
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c        |   27 -
 arch/powerpc/platforms/86xx/pci.c                 |   67 +-
 arch/powerpc/platforms/8xx/m8xx_setup.c           |    5 
 arch/powerpc/platforms/8xx/mpc885ads_setup.c      |   71 ++
 arch/powerpc/platforms/Kconfig                    |   29 +
 arch/powerpc/platforms/Kconfig.cputype            |  221 ++++++
 arch/powerpc/platforms/apus/Kconfig               |  130 ---
 arch/powerpc/platforms/cell/io-workarounds.c      |    2 
 arch/powerpc/platforms/cell/spu_base.c            |   59 +-
 arch/powerpc/platforms/cell/spufs/backing_ops.c   |    6 
 arch/powerpc/platforms/cell/spufs/context.c       |   15 
 arch/powerpc/platforms/cell/spufs/fault.c         |   29 +
 arch/powerpc/platforms/cell/spufs/file.c          |  149 ++++
 arch/powerpc/platforms/cell/spufs/inode.c         |   10 
 arch/powerpc/platforms/cell/spufs/run.c           |   45 +
 arch/powerpc/platforms/cell/spufs/sched.c         |  476 ++++++++++--
 arch/powerpc/platforms/cell/spufs/spu_restore.c   |    2 
 arch/powerpc/platforms/cell/spufs/spu_save.c      |    2 
 arch/powerpc/platforms/cell/spufs/spufs.h         |   84 ++
 arch/powerpc/platforms/cell/spufs/switch.c        |   18 
 arch/powerpc/platforms/chrp/Kconfig               |    1 
 arch/powerpc/platforms/chrp/Makefile              |    3 
 arch/powerpc/platforms/chrp/pci.c                 |    7 
 arch/powerpc/platforms/embedded6xx/Kconfig        |    2 
 arch/powerpc/platforms/embedded6xx/holly.c        |    2 
 arch/powerpc/platforms/embedded6xx/linkstation.c  |   10 
 arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c |    9 
 arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.h |    5 
 arch/powerpc/platforms/iseries/call_hpt.h         |    9 
 arch/powerpc/platforms/iseries/htab.c             |    8 
 arch/powerpc/platforms/iseries/pci.c              |    7 
 arch/powerpc/platforms/iseries/setup.c            |    6 
 arch/powerpc/platforms/maple/pci.c                |   41 -
 arch/powerpc/platforms/pasemi/Kconfig             |    9 
 arch/powerpc/platforms/pasemi/Makefile            |    1 
 arch/powerpc/platforms/pasemi/electra_ide.c       |   96 ++
 arch/powerpc/platforms/pasemi/pci.c               |   24 -
 arch/powerpc/platforms/pasemi/setup.c             |    2 
 arch/powerpc/platforms/powermac/Kconfig           |    1 
 arch/powerpc/platforms/powermac/low_i2c.c         |   23 -
 arch/powerpc/platforms/powermac/pci.c             |   46 -
 arch/powerpc/platforms/ps3/Kconfig                |   26 -
 arch/powerpc/platforms/ps3/Makefile               |    1 
 arch/powerpc/platforms/ps3/device-init.c          |  785 ++++++++++++++++++++
 arch/powerpc/platforms/ps3/htab.c                 |   31 -
 arch/powerpc/platforms/ps3/interrupt.c            |  272 ++++---
 arch/powerpc/platforms/ps3/mm.c                   |  632 +++++++++++++---
 arch/powerpc/platforms/ps3/os-area.c              |    4 
 arch/powerpc/platforms/ps3/platform.h             |   43 +
 arch/powerpc/platforms/ps3/repository.c           |  586 ++++++++-------
 arch/powerpc/platforms/ps3/setup.c                |  105 ++-
 arch/powerpc/platforms/ps3/smp.c                  |   18 
 arch/powerpc/platforms/ps3/spu.c                  |   13 
 arch/powerpc/platforms/ps3/system-bus.c           |  562 ++++++++++++--
 arch/powerpc/platforms/ps3/time.c                 |    2 
 arch/powerpc/platforms/pseries/Makefile           |    2 
 arch/powerpc/platforms/pseries/eeh.c              |   19 
 arch/powerpc/platforms/pseries/eeh_cache.c        |    5 
 arch/powerpc/platforms/pseries/eeh_driver.c       |    6 
 arch/powerpc/platforms/pseries/eeh_sysfs.c        |   87 ++
 arch/powerpc/platforms/pseries/lpar.c             |   17 
 arch/powerpc/platforms/pseries/pci_dlpar.c        |    9 
 arch/powerpc/platforms/pseries/plpar_wrappers.h   |   15 
 arch/powerpc/platforms/pseries/pseries.h          |    2 
 arch/powerpc/platforms/pseries/reconfig.c         |    2 
 arch/powerpc/platforms/pseries/setup.c            |    2 
 arch/powerpc/platforms/pseries/xics.c             |   53 +
 arch/powerpc/sysdev/Makefile                      |    6 
 arch/powerpc/sysdev/fsl_pcie.c                    |  171 ----
 arch/powerpc/sysdev/fsl_soc.c                     |   13 
 arch/powerpc/sysdev/indirect_pci.c                |   44 +
 arch/powerpc/sysdev/mpc8xx_pic.h                  |   11 
 arch/powerpc/sysdev/mv64x60_dev.c                 |   28 +
 arch/powerpc/sysdev/mv64x60_pci.c                 |    7 
 arch/powerpc/sysdev/qe_lib/ucc.c                  |    2 
 arch/powerpc/sysdev/qe_lib/ucc_fast.c             |    8 
 arch/powerpc/sysdev/rtc_cmos_setup.c              |   49 +
 arch/powerpc/sysdev/timer.c                       |   14 
 arch/powerpc/sysdev/tsi108_dev.c                  |   33 +
 arch/powerpc/sysdev/tsi108_pci.c                  |   10 
 arch/powerpc/xmon/xmon.c                          |    2 
 arch/ppc/kernel/misc.S                            |    8 
 arch/ppc/kernel/ppc_ksyms.c                       |    1 
 arch/ppc/kernel/setup.c                           |    2 
 arch/ppc/mm/tlb.c                                 |    1 
 arch/ppc/platforms/prep_setup.c                   |    3 
 arch/ppc/syslib/Makefile                          |    1 
 arch/ppc/syslib/indirect_pci.c                    |  134 +++
 arch/ppc/syslib/virtex_devices.c                  |   38 +
 drivers/block/viodasd.c                           |    4 
 drivers/char/briq_panel.c                         |   10 
 drivers/char/hvc_console.c                        |    2 
 drivers/char/viotape.c                            |   12 
 drivers/pci/hotplug/rpadlpar_core.c               |    6 
 drivers/pcmcia/Kconfig                            |   17 
 drivers/pcmcia/m8xx_pcmcia.c                      |  351 ++++-----
 drivers/ps3/Makefile                              |    5 
 drivers/ps3/ps3av.c                               |  372 +++++-----
 drivers/ps3/ps3av_cmd.c                           |   51 -
 drivers/ps3/ps3stor_lib.c                         |  302 ++++++++
 drivers/ps3/sys-manager-core.c                    |   68 ++
 drivers/ps3/sys-manager.c                         |  290 +++++--
 drivers/ps3/vuart.c                               |  817 +++++++++++++--------
 drivers/ps3/vuart.h                               |   71 +-
 drivers/rtc/Kconfig                               |    2 
 drivers/serial/cpm_uart/cpm_uart_core.c           |    2 
 drivers/serial/of_serial.c                        |   33 +
 drivers/video/Kconfig                             |    4 
 drivers/video/ps3fb.c                             |  290 +++----
 include/asm-powerpc/cache.h                       |    4 
 include/asm-powerpc/cputable.h                    |  111 +--
 include/asm-powerpc/floppy.h                      |    6 
 include/asm-powerpc/hvcall.h                      |    1 
 include/asm-powerpc/io.h                          |   26 -
 include/asm-powerpc/irq.h                         |    9 
 include/asm-powerpc/lppaca.h                      |    2 
 include/asm-powerpc/lv1call.h                     |    3 
 include/asm-powerpc/machdep.h                     |    2 
 include/asm-powerpc/mmu-8xx.h                     |  147 ++++
 include/asm-powerpc/mmu-fsl-booke.h               |   88 ++
 include/asm-powerpc/mmu-hash32.h                  |   91 ++
 include/asm-powerpc/mmu-hash64.h                  |    9 
 include/asm-powerpc/mmu.h                         |   13 
 include/asm-powerpc/mmu_context.h                 |  202 +++++
 include/asm-powerpc/mpc86xx.h                     |    6 
 include/asm-powerpc/mpc8xx.h                      |    4 
 include/asm-powerpc/pci-bridge.h                  |  148 +++-
 include/asm-powerpc/pci.h                         |   11 
 include/asm-powerpc/pgtable-ppc32.h               |   50 -
 include/asm-powerpc/pgtable-ppc64.h               |   50 -
 include/asm-powerpc/pgtable.h                     |   28 +
 include/asm-powerpc/ppc-pci.h                     |    9 
 include/asm-powerpc/processor.h                   |    8 
 include/asm-powerpc/prom.h                        |   18 
 include/asm-powerpc/ps3.h                         |  182 +++--
 include/asm-powerpc/ps3av.h                       |   48 +
 include/asm-powerpc/ps3fb.h                       |   12 
 include/asm-powerpc/ps3stor.h                     |   71 ++
 include/asm-powerpc/ptrace.h                      |   22 -
 include/asm-powerpc/reg.h                         |    2 
 include/asm-powerpc/spu.h                         |   24 +
 include/asm-powerpc/syscalls.h                    |    7 
 include/asm-powerpc/system.h                      |    4 
 include/asm-powerpc/termbits.h                    |    4 
 include/asm-powerpc/thread_info.h                 |   12 
 include/asm-powerpc/time.h                        |    4 
 include/asm-powerpc/tlbflush.h                    |    5 
 include/linux/fsl_devices.h                       |    5 
 include/linux/vmalloc.h                           |    3 
 mm/vmalloc.c                                      |   13 
 280 files changed, 10940 insertions(+), 6951 deletions(-)
 create mode 100644 arch/powerpc/boot/cuboot.c
 create mode 100644 arch/powerpc/boot/cuboot.h
 create mode 100644 arch/powerpc/boot/dts/ps3.dts
 create mode 100644 arch/powerpc/boot/of.h
 create mode 100644 arch/powerpc/boot/ofconsole.c
 create mode 100644 arch/powerpc/boot/oflib.c
 create mode 100644 arch/powerpc/boot/ps3-head.S
 create mode 100644 arch/powerpc/boot/ps3-hvcall.S
 create mode 100644 arch/powerpc/boot/ps3.c
 create mode 100644 arch/powerpc/boot/zImage.ps3.lds.S
 create mode 100644 arch/powerpc/kernel/isa-bridge.c
 create mode 100644 arch/powerpc/kernel/pci-common.c
 delete mode 100644 arch/powerpc/kernel/ptrace-common.h
 create mode 100644 arch/powerpc/kernel/signal.c
 create mode 100644 arch/powerpc/kernel/signal.h
 delete mode 100644 arch/powerpc/mm/imalloc.c
 create mode 100644 arch/powerpc/platforms/83xx/usb.c
 create mode 100644 arch/powerpc/platforms/Kconfig.cputype
 delete mode 100644 arch/powerpc/platforms/apus/Kconfig
 create mode 100644 arch/powerpc/platforms/pasemi/electra_ide.c
 create mode 100644 arch/powerpc/platforms/ps3/device-init.c
 create mode 100644 arch/powerpc/platforms/pseries/eeh_sysfs.c
 delete mode 100644 arch/powerpc/sysdev/fsl_pcie.c
 create mode 100644 arch/powerpc/sysdev/rtc_cmos_setup.c
 create mode 100644 arch/ppc/syslib/indirect_pci.c
 create mode 100644 drivers/ps3/ps3stor_lib.c
 create mode 100644 drivers/ps3/sys-manager-core.c
 create mode 100644 include/asm-powerpc/mmu-8xx.h
 create mode 100644 include/asm-powerpc/mmu-fsl-booke.h
 create mode 100644 include/asm-powerpc/mmu-hash32.h
 create mode 100644 include/asm-powerpc/ps3stor.h

Adrian Bunk (1):
      [POWERPC] Make drivers/char/hvc_console.c:khvcd() static

Anton Blanchard (1):
      [POWERPC] Reserve threadinfo flags for perfmon2

Arnd Bergmann (7):
      [POWERPC] Split out CPU specific options into a new Kconfig file
      [POWERPC] move 82xx/83xx/86xx Kconfig options to platform selection
      [POWERPC] rename add_bridge to avoid namespace clashes
      [POWERPC] mpc82xx_ads build fix
      [POWERPC] kill isa_{io,mem}_base definitions for !PCI
      [POWERPC] fix building without PCI
      [POWERPC] disallow building powermac and tsi108 without PCI

Benjamin Herrenschmidt (18):
      [POWERPC] unmap_vm_area becomes unmap_kernel_range for the public
      [POWERPC] Rewrite IO allocation & mapping on powerpc64
      [POWERPC] spufs: Add support for SPU single stepping
      [POWERPC] spufs: Add a "capabilities" file to spu contexts
      [POWERPC] Disable broken PPC_PTRACE_GETFPREGS on 32 bits
      [POWERPC] ptrace cleanups
      [POWERPC] ptrace updates & new, better requests
      [POWERPC] Uninline common ptrace bits
      [POWERPC] Remove some useless ifdef's in ptrace
      [POWERPC] Allow ptrace write to pt_regs trap and orig_r3
      [POWERPC] ptrace shouldn't touch FP exec mode
      [POWERPC] powerpc: ptrace can set DABR on both 32 and 64 bits
      [POWERPC] Always apply DABR changes on context switches
      [POWERPC] Make syscall restart code more common
      [POWERPC] Remove obsolete freezer bits
      [POWERPC] Merge creation of signal frame
      [POWERPC] Remove #ifdef around set_dabr in signal code
      [POWERPC] Less ifdef's in signal.c/signal.h

Brian King (1):
      [POWERPC] Add H_ILLAN_ATTRIBUTES hcall number

Christoph Hellwig (16):
      [POWERPC] Consolidate sys_sigaltstack
      [POWERPC] Consolidate restore_sigmask
      [POWERPC] Consolidate do_signal
      [POWERPC] spusched: Switch from workqueues to kthread + timer tick
      [POWERPC] spusched: Dynamic timeslicing for SCHED_OTHER
      [POWERPC] spusched: Update scheduling paramters on every spu_run
      [POWERPC] spusched: fix cpu/node binding
      [POWERPC] spusched: Catch nosched contexts in spu_deactivate
      [POWERPC] spusched: No preemption for nosched contexts
      [POWERPC] spufs: Add tid file
      [POWERPC] spufs: Implement /proc/spu_loadavg
      [POWERPC] spufs: Add stat file to spufs
      [POWERPC] spusched: Disable tick when not needed
      [POWERPC] spusched: Fix runqueue corruption
      [POWERPC] spufs: Add spu stats in sysfs
      [POWERPC] Remove unused do_signal export

David Gibson (18):
      [POWERPC] Split low-level OF-related bootloader code into separate files
      [POWERPC] Split out asm-ppc/mmu.h portions for the "classic" hash-based MMU
      [POWERPC] Abolish iopa(), mm_ptov(), io_block_mapping() from arch/powerpc
      [POWERPC] Remove the dregs of APUS support from arch/powerpc
      [POWERPC] Remove a couple of unused definitions from pgtable_32.c
      [POWERPC] Start factoring pgtable-ppc32.h and pgtable-ppc64.h
      [POWERPC] Kill typedef-ed structs for hash PTEs and BATs
      [POWERPC] Merge CPU features pertaining to icache coherency
      [POWERPC] Factor zImage's 44x reset code out of ebony.c
      [POWERPC] Derive ebc ranges property from EBC registers
      [POWERPC] Consolidate cuboot initialization code
      [POWERPC] Don't store a command line in the Holly device tree
      [POWERPC] Fix problems with device tree representation of TSI-1xx bridges
      [POWERPC] Make more OF-related bootwrapper functions available to non-OF platforms
      [POWERPC] Abolish unused ucBoardRev variables
      [POWERPC] In booting-without-of.txt, clarify that properties must precede subnodes
      [POWERPC] Split out asm-ppc/mmu.h portions for Freescale Book-E
      [POWERPC] Split out asm-ppc/mmu.h portions for PowerPC 8xx

David Woodhouse (3):
      [POWERPC] PS3: System-bus uevent
      [POWERPC] PS3: System-bus modinfo attribute
      [POWERPC] Enable arbitary speed tty ioctls and split input/output speed

Domen Puncer (1):
      [POWERPC] 52xx: sparse fixes

Geert Uytterhoeven (7):
      [POWERPC] PS3: Fix sparse warnings
      [POWERPC] PS3: Simplify definition of DBG
      [POWERPC] PS3: Frame buffer system-bus rework
      [POWERPC] PS3: Fix more sparse warnings
      [POWERPC] PS3: Preallocate bootmem memory for the PS3 FLASH ROM storage driver
      [POWERPC] PS3: Storage Driver Core
      [POWERPC] PS3: Storage device registration routines

Geoff Levand (24):
      [POWERPC] cell: Add spu shutdown method
      [POWERPC] PS3: Rename IPI symbols
      [POWERPC] PS3: Use __maybe_unused
      [POWERPC] PS3: Map SPU regions as non-guarded
      [POWERPC] PS3: Move chip mask defs up
      [POWERPC] PS3: Kexec support
      [POWERPC] PS3: System-bus rework
      [POWERPC] PS3: Repository probe cleanups
      [POWERPC] PS3: Vuart rework
      [POWERPC] PS3: System manager re-work
      [POWERPC] PS3: Rework AV settings driver
      [POWERPC] PS3: Device registration routines.
      [POWERPC] PS3: Rename processor id symbols
      [POWERPC] PS3: Use clear_bit
      [POWERPC] Output params value in early_init_devtree
      [POWERPC] Correct __secondary_hold comment
      [POWERPC] Add signed types to bootwrapper
      [POWERPC] Add u64 printf to bootwrapper
      [POWERPC] Fix constantness of bootwrapper arg
      [POWERPC] Make kernel_entry_t have global scope in bootwrapper
      [POWERPC] PS3: Device tree source
      [POWERPC] PS3: Select MEMORY_HOTPLUG
      [POWERPC] PS3: Update ps3_defconfig
      [POWERPC] PS3: Bootwrapper support.

Grant Likely (2):
      [POWERPC] 83xx: Add USB support to mpc8349-mitx board port
      [POWERPC] xilinxfb: Parameterize xilinxfb platform device registration

Guennadi Liakhovetski (1):
      [POWERPC] Don't link timer.o for powerpc systems using generic rtc

Ishizaki Kou (2):
      [POWERPC] of_serial: Ignore unknown serial port
      [POWERPC] of_serial: add port type checking

Jake Moilanen (1):
      [POWERPC] Donate idle CPU cycles on dedicated partitions

Jeremy Kerr (5):
      [POWERPC] spusched: Fix timeslice calculations
      [POWERPC] spusched: Print out scheduling tunables with DEBUG
      [POWERPC] spufs: Remove spufs_dir_inode_operations
      [POWERPC] spufs: Trivial whitespace fixes
      [POWERPC] spufs: Fix libassist accounting

Johannes Berg (3):
      [POWERPC] Use mktime in timer sysdev
      [POWERPC] powermac i2c: Use mutex
      [POWERPC] arch/powerpc/kernel/sysfs.c: Move NUMA exports

Jon Loeliger (1):
      [POWERPC] Replace use of GET_64BIT(prop, i) with of_read_number().

Jon Tollefson (1):
      [POWERPC] Move common code out of if/else

Josh Boyer (2):
      [POWERPC] Consolidate PowerPC 750 cputable features
      [POWERPC] Schedule removal of arch/ppc

Kazunori Asayama (2):
      [POWERPC] spufs: Fix lost events in poll/epoll on mfc
      [POWERPC] spufs: Save dma_tagstatus_R in CSA

Kumar Gala (24):
      [POWERPC] Remove set_cfg_type for PCI indirect users that don't need it
      [POWERPC] 52xx: Remove support for PCI bus_offset
      [POWERPC] Pass the pci_controller into pci_exclude_device
      [POWERPC] Remove hack to determine the 2nd PHBs bus number
      [POWERPC] Remove bus_offset in places its not really used
      [POWERPC] Added self_busno to indicate which bus number the PHB is
      [POWERPC] Removed remnants of bus_offset
      [POWERPC] Added indirect_type to handle variants of PCI ops
      [POWERPC] 86xx: Workaround PCI_PRIMARY_BUS usage
      [POWERPC] Merge asm-ppc/pci-bridge.h into asm-power/pci-bridge.h
      [POWERPC] Remove local_number from pci_controller
      [POWERPC] Removed dead code related to PCI on ppc32
      [POWERPC] Use global_number in ppc32 pci_controller
      [POWERPC] Merge ppc32 and ppc64 pcibios_alloc_controller() prototypes
      [POWERPC] Move pci_bus_to_hose users to pci_bus_to_host
      [POWERPC] Move common PCI code out of pci_32/pci_64
      [POWERPC] Use ppc64 style list management for pci_controller on ppc32
      [POWERPC] Add copyright header to pci-common.c based on pci_{32,64}.c
      [POWERPC] Reworked interrupt numbers for OpenPIC based Freescale chips
      [POWERPC] Kill pcibios_enable_resources()
      [POWERPC] Fix up interrupt senses for MPC85xx boards
      [POWERPC] Merge asm-ppc/mmu_context.h into asm-power/mmu_context.h
      [POWERPC] Move inline asm eieio to using eieio inline function
      [POWERPC] CPM_UART: Use inline function form of eieio

Laurent Pinchart (1):
      [PPC] Add linux/pagemap.h to arch/ppc/mm/tlb.c

Li Yang (3):
      [POWERPC] qe_lib: export symbols for QE driver to compile as module
      [POWERPC] 83xx: USB platform code rework
      [POWERPC] Fix typo in Ebony default DTS

Linas Vepstas (5):
      [POWERPC] pseries: asm/pci-bridge.h CONFIG_ minor cleanup
      [POWERPC] Add EEH sysfs blinkenlights
      [POWERPC] Show EEH per-device false positives
      [POWERPC] Remove dead EEH code
      [POWERPC] Tweak EEH copyright info

Manish Ahuja (1):
      [POWERPC] Remove extra return statement

Mark A. Greer (5):
      [POWERPC] Remove 'make zImage.dts' feature
      [POWERPC] When appropriate, wrap device tree with zImage
      [POWERPC] Update holly to use new dts wrapping feature
      [POWERPC] Call add_preferred_console when MPSC is console
      [POWERPC] Remove 'console=' from cmdline on prpmc2800

Masakazu Mokuno (1):
      [POWERPC] PS3: Compare firmware version

Masashi Kimoto (1):
      [POWERPC] PS3: Add support for HDMI RGB Full Range mode

Mathieu Desnoyers (1):
      [POWERPC] Remove unnecessary #undef printk from prom.c

Michael Ellerman (8):
      [POWERPC] Split virq setup logic out into irq_setup_virq()
      [POWERPC] Add irq_create_direct_mapping()
      [POWERPC] Add for_each_compatible_node()
      [POWERPC] Turn off debugging in arch/powerpc/kernel/pci_64.c
      [POWERPC] Check for the root node in of_detach_node()
      [POWERPC] Generalise device_node flag interface
      [POWERPC] Add a warning to help trackdown device_node refcounting bugs
      [POWERPC] Make the debugfs "powerpc" dir globally accessible

Michael Neuling (2):
      [POWERPC] Fix stolen time for SMT without LPAR
      [POWERPC] Do firmware feature fixups after features are initialised

Mike Wolf (1):
      [POWERPC] Oprofile support for Power 5++

Milton Miller (1):
      [POWERPC] kexec: Send slaves to new kernel earlier

Mohan Kumar M (1):
      [POWERPC] Fix interrupt distribution in ppc970

Nathan Lynch (1):
      [POWERPC] Remove spinlock from struct cpu_purr_data

Olaf Hering (1):
      [POWERPC] Make two xmon variables static

Olof Johansson (4):
      [POWERPC] pasemi: Electra IDE/pata_platform glue
      [POWERPC] Uninline and export virq_to_hw()
      [POWERPC] pasemi: Rename platform
      [POWERPC] pasemi: Don't auto-select CONFIG_EMBEDDED

Robert P. J. Day (2):
      [POWERPC] VIOTAPE: Use designated initializers for fops member structures.
      [POWERPC] Remove dead code for preventing pread() and pwrite() calls

Roland Dreier (1):
      [POWERPC] Add cputable entry for PowerPC 440SPe Rev. B

Roy Zang (4):
      [POWERPC] Document the global utilities node define and example
      [POWERPC] Fix the node index confusion for SOC
      [POWERPC] 85xx: Fix 8548CDS reset bug
      [POWERPC] Remove redundant pci_read_irq_line() function for 85xx platform

Sachin P. Sant (1):
      [POWERPC] Fix Kexec/Kdump for power6

Sebastian Siewior (2):
      [POWERPC] spufs: fix building spufs/spu_save_dump.h
      [POWERPC] spufs: Add bit definition

Segher Boessenkool (1):
      [POWERPC] Fix VDSO compile warning

Sonny Rao (1):
      [POWERPC] Check for NULL ppc_md.init_IRQ() before calling

Stephen Rothwell (1):
      [POWERPC] Fix viodasd geometry calculations

Timur Tabi (1):
      [POWERPC] Fix MAC address entries for 83xx, 85xx, and 86xx device trees

Tony Breeds (4):
      [POWERPC] Move iSeries_tb_recal into its own late_initcall.
      [POWERPC] Create a dummy zImage if no valid platform has been selected
      [POWERPC] Modify sched_clock() to make CONFIG_PRINTK_TIME more sane
      [POWERPC] Add __read_mostly support for powerpc

Vitaly Bordug (2):
      [POWERPC] 8xx: mpc885ads pcmcia support
      [POWERPC] dts: kill hardcoded phandles

Wade Farnsworth (4):
      [POWERPC] 86xx: Add uli1575 pci-bridge sector to MPC8641HPCN dts file.
      [POWERPC] Fix drivers/rtc/Kconfig for powerpc
      [POWERPC] Add a check for keyboard/mouse device nodes in check_legacy_ioport()
      [POWERPC] Create add_rtc() function to enable the RTC CMOS driver

York Sun (1):
      [POWERPC] Let subordinate transparent bridges be transparent.

Zhang Wei (4):
      [POWERPC] Remove PCI-e errata for MPC8641 silicon ver 1.0
      [POWERPC] 86xx: Avoid system halt if link training isn't at least L0.
      [POWERPC] MPC8641HPCN: Set IDE in ULI1575 to not native mode.
      [POWERPC] 86xx: Created quirk_fsl_pcie_transparent() to initialize bridge resources.

will schmidt (2):
      [POWERPC] During VM oom condition, kill all threads in process group
      [POWERPC] Oprofile enhanced instruction sampling support

^ permalink raw reply

* Re: [patch 5/6] Update the 83xx/85xx/86xx boards device tree
From: Zang Roy-r61911 @ 2007-07-11  2:53 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev list, Paul Mackerras
In-Reply-To: <FFEC5443-109B-45B7-80CA-0252F9365B55@kernel.crashing.org>

On Wed, 2007-07-11 at 04:28, Segher Boessenkool wrote:
> > Indentify pci, pcie host by compatible property
> > "fsl,mpc83xx-pci","83xx"
> > "fsl,mpc85xx-pci","85xx"
> > "fsl,mpc86xx-pci","86xx"
> > and
> > "fsl, mpc85xx-pciex","85xx"
> > "fsl, mpc86xx-pciex","86xx"
> 
> This can't ever work -- 
It works!
> if you see "compatible" = "85xx",
> what is it?
That's why I remove the original compatible "85xx".

>   PCI or PCIe?  Or something else perhaps, maybe
> a CPU or an I2C controller or who-knows-what?
I just think the compatible field
"fsl,mpc83xx-pci","83xx"
has some redundant information.
Kumar don't want to break anything using the old  
information.  
We can remove it in the future:-).
Roy

^ permalink raw reply

* Re: [PATCH 1/1] libata: pata_pdc2027x PLL input clock fix
From: Albert Lee @ 2007-07-11  2:45 UTC (permalink / raw)
  To: Mikael Pettersson
  Cc: dwm, jeff, linux-ide, bahadir.balban, linuxppc-dev, alan
In-Reply-To: <200707102314.l6ANEWq2029195@harpo.it.uu.se>

Mikael Pettersson wrote:
> 
> 
> 2.6.22 + this prints the following on my G3:
> 
> pata_pdc2027x 0000:00:0e.0: version 0.9
> usec_elapsed for mdelay(37) [35431]
> start time: [1184112028]s [775333]us 
> end   time: [1184112028]s [810764]us 
> pata_pdc2027x 0000:00:0e.0: PLL input clock 1691741 kHz
> pata_pdc2027x: Invalid PLL input clock 1691741kHz, give up!
> 

My x86 box got this:
Jul 11 10:02:17 p4ht-s kernel: [  260.746980] ACPI: PCI Interrupt 0000:02:05.0[A] -> Link [LNK1] -> GSI 10 (level, low) -> IRQ 10
Jul 11 10:02:17 p4ht-s kernel: [  260.882905] usec_elapsed for mdelay(37) [36734]
Jul 11 10:02:17 p4ht-s kernel: [  260.882911] start time: [1184119336]s [999802]us 
Jul 11 10:02:17 p4ht-s kernel: [  260.882914] end   time: [1184119337]s [36536]us 
Jul 11 10:02:17 p4ht-s kernel: [  260.882917] pata_pdc2027x 0000:02:05.0: PLL input clock 16829 kHz

So, it seems both mdelay(37) and do_gettimeofday() are working properly on PowerMac G3.
Maybe the calculated wrong PLL input is due to wrong reading of the counter register?
Could you please try the attached debug patch for more clue, thanks.

--
albert

diff -Nrup 00_libata-dev/drivers/ata/pata_pdc2027x.c 01_debug/drivers/ata/pata_pdc2027x.c
--- 00_libata-dev/drivers/ata/pata_pdc2027x.c	2007-07-07 09:58:55.000000000 +0800
+++ 01_debug/drivers/ata/pata_pdc2027x.c	2007-07-11 10:41:41.000000000 +0800
@@ -574,8 +574,8 @@ retry:
 
 	counter = (bccrh << 15) | bccrl;
 
-	PDPRINTK("bccrh [%X] bccrl [%X]\n", bccrh,  bccrl);
-	PDPRINTK("bccrhv[%X] bccrlv[%X]\n", bccrhv, bccrlv);
+	printk(KERN_ERR "bccrh [%X] bccrl [%X]\n", bccrh,  bccrl);
+	printk(KERN_ERR "bccrhv[%X] bccrlv[%X]\n", bccrhv, bccrlv);
 
 	/*
 	 * The 30-bit decreasing counter are read by 2 pieces.
@@ -584,7 +584,7 @@ retry:
 	 */
 	if (retry && !(bccrh == bccrhv && bccrl >= bccrlv)) {
 		retry--;
-		PDPRINTK("rereading counter\n");
+		printk(KERN_ERR "rereading counter\n");
 		goto retry;
 	}
 
@@ -722,8 +722,21 @@ static long pdc_detect_pll_input_clock(s
 	pll_clock = (start_count - end_count) / 100 *
 		(100000000 / usec_elapsed);
 
-	PDPRINTK("start[%ld] end[%ld] \n", start_count, end_count);
-	PDPRINTK("PLL input clock[%ld]Hz\n", pll_clock);
+	printk(KERN_ERR "start[%ld] end[%ld] \n", start_count, end_count);
+	printk(KERN_ERR "usec_elapsed for mdelay(100) [%ld]\n", usec_elapsed);
+	printk(KERN_ERR "start time: [%ld]s [%ld]us \n", start_time.tv_sec, start_time.tv_usec);
+	printk(KERN_ERR "end   time: [%ld]s [%ld]us \n", end_time.tv_sec, end_time.tv_usec);
+	printk(KERN_ERR "PLL input clock[%ld]Hz\n", pll_clock);
+
+	/* mdelay(37) for comparison */
+	do_gettimeofday(&start_time);
+	mdelay(37);
+	do_gettimeofday(&end_time);
+	usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 1000000 +
+		(end_time.tv_usec - start_time.tv_usec);
+	printk(KERN_ERR "usec_elapsed for mdelay(37) [%ld]\n", usec_elapsed);
+	printk(KERN_ERR "start time: [%ld]s [%ld]us \n", start_time.tv_sec, start_time.tv_usec);
+	printk(KERN_ERR "end   time: [%ld]s [%ld]us \n", end_time.tv_sec, end_time.tv_usec);
 
 	return pll_clock;
 }

^ permalink raw reply

* Re: [patch 3/6] Add 8548 CDS PCI express controller node and PCI-X device node
From: Zang Roy-r61911 @ 2007-07-11  2:44 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev list, Paul Mackerras
In-Reply-To: <963D5B48-F1E5-4930-9F29-98D7F0E33C0A@kernel.crashing.org>

On Wed, 2007-07-11 at 04:25, Segher Boessenkool wrote:
> >               pci1: pci@8000 {
> >                       interrupt-map-mask = <1f800 0 0 7>;
> 
> Set the mask to <1800 0 0 7>, and you need only 16
> entries to encode the swizzle.  Except...
> 
> > +                             /* bus 1 , idsel 0x2 Tsi310 bridge
> secondary */
> 
> ...interrupts on bus 1 should be swizzled on bus 1, not
> at the PHB.  Really.  It is a horrible workaround for a
> non-existing problem to do it here, and I promise you
> it _will_ come back to hurt you later.  Not a threat,
> just a promise :-)

I just want to make it as a temporary workaround now.
Extra patches will be provided to fix it.


> > -                     compatible = "85xx";
> > +                     compatible = "fsl,mpc85xx-pci","85xx";
> 
> No more "xx" please...
> 
> > +             pci@a000 {
> > +                     interrupt-map-mask = <f800 0 0 7>;
> > +                     interrupt-map = <
> > +
> > +                             /* IDSEL 0x0 (PEX) */
> > +                             00000 0 0 1 &mpic 0 1
> > +                             00000 0 0 2 &mpic 1 0
> > +                             00000 0 0 3 &mpic 2 0
> > +                             00000 0 0 4 &mpic 3 0>;
> 
> Why sense 0 for all but the first entry in this map?
Now, only the first entry is used.
> 
> > +                     compatible = "fsl,mpc86xx-pciex","86xx";
> 
> And "xx" again.  Aren't the 85- and 86- PCIe controllers
> compatible, btw?

^ permalink raw reply

* Re: [PATCH v2] Consolidate mm_context_t definition in mmu.h
From: Josh Boyer @ 2007-07-11  2:22 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, arnd, david
In-Reply-To: <18068.4589.614583.210312@cargo.ozlabs.ibm.com>

On Wed, Jul 11, 2007 at 09:10:37AM +1000, Paul Mackerras wrote:
> Josh Boyer writes:
> 
> > All of the platforms except PPC64 share a common mm_context_t definition.
> > Defining it in mmu.h avoids duplicating it in the platform specific mmu
> > header files.  We further consolidate it by having the PPC32 definition
> > share the mm_context_id_t type for the id member.
> 
> Unfortunately the string of ifdefs in your consolidated version makes
> my eyes water.  I'm not sure it isn't better the way it is.

Eh, you're the maintainer.  No worries.

Though realistically, I only added a single ifdef set in the structure.  The
rest are all Ben's ;)

josh

^ permalink raw reply

* Missed serial patch breaks arch/powerpc 44x port
From: Josh Boyer @ 2007-07-11  2:17 UTC (permalink / raw)
  To: paulus, akpm; +Cc: linuxppc-dev, david

Hi All,

When support for the PPC44x arch/powerpc port was posted back in May, David
included two serial patches along with it.  The short story is that the
powerpc patches were merged in via Paul, but the two serial patches were never
merged.  This makes the 44x arch/powerpc port dead on arival in 2.6.22.

The two patches I speak of are:

http://patchwork.ozlabs.org/linuxppc/patch?person=11&id=10935

and

http://patchwork.ozlabs.org/linuxppc/patch?person=11&id=10934

Unfortunately, the fact that the second patch is missing breaks the Ebony
board, manifesting itself in a machine check during boot.  The lack of using
resource_size_t for the mapbase member of the uart_port structure means that
the physical address passed in is too large for the data type and the wrong
address gets ioremapped.

Could we get those patches, particularly the second one, merged during the
merge window?  We might also want to push them to -stable.

The alternative would be to re-introduce the fixup_big_phys_addr function in
the 44x ioremap path.  I'd rather avoid adding that back in temporarily if
these serial patches are eventually going to go in anyway.

josh

^ permalink raw reply

* Re: [patch 3/6] Add 8548 CDS PCI express controller node and PCI-X device node
From: Kumar Gala @ 2007-07-11  2:02 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: Paul Mackerras, linuxppc-dev list
In-Reply-To: <963D5B48-F1E5-4930-9F29-98D7F0E33C0A@kernel.crashing.org>


On Jul 10, 2007, at 3:25 PM, Segher Boessenkool wrote:

>>  		pci1: pci@8000 {
>>  			interrupt-map-mask = <1f800 0 0 7>;
>
> Set the mask to <1800 0 0 7>, and you need only 16
> entries to encode the swizzle.  Except...
>
>> +				/* bus 1 , idsel 0x2 Tsi310 bridge secondary */
>
> ...interrupts on bus 1 should be swizzled on bus 1, not
> at the PHB.  Really.  It is a horrible workaround for a
> non-existing problem to do it here, and I promise you
> it _will_ come back to hurt you later.  Not a threat,
> just a promise :-)
>
>> -			compatible = "85xx";
>> +			compatible = "fsl,mpc85xx-pci","85xx";
>
> No more "xx" please...
>
>> +		pci@a000 {
>> +			interrupt-map-mask = <f800 0 0 7>;
>> +			interrupt-map = <
>> +
>> +				/* IDSEL 0x0 (PEX) */
>> +				00000 0 0 1 &mpic 0 1
>> +				00000 0 0 2 &mpic 1 0
>> +				00000 0 0 3 &mpic 2 0
>> +				00000 0 0 4 &mpic 3 0>;
>
> Why sense 0 for all but the first entry in this map?
>
>> +			compatible = "fsl,mpc86xx-pciex","86xx";
>
> And "xx" again.  Aren't the 85- and 86- PCIe controllers
> compatible, btw?

They are, but we need to distinguish between 83xx, 85xx, and 86xx  
pci, pciex, pci-x controllers.

- k

^ permalink raw reply

* Re: [PATCH] pata_mpc52xx: suspend/resume support
From: Jeff Garzik @ 2007-07-11  1:14 UTC (permalink / raw)
  To: Domen Puncer; +Cc: linux-ide, linuxppc-embedded
In-Reply-To: <20070703082738.GM23294@moe.telargo.com>

Domen Puncer wrote:
> Implement suspend and resume routines for mpc52xx ata driver.
> Tested on Lite5200b with deep-sleep and low-power (not yet in-tree)
> modes.
> 
> 
> Signed-off-by: Domen Puncer <domen.puncer@telargo.com>
> 
> ---
> If anyone cares, I attached ATA_DEBUG messages at the end of patch.
> Should it take almost 5 seconds?
> 
> 
>  drivers/ata/pata_mpc52xx.c |   18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)

applied

^ permalink raw reply

* Re: [PATCH] Allow exec on 32-bit from readable, non-exec pages, with a warning.
From: Paul Mackerras @ 2007-07-11  1:02 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev, Arnd Bergmann
In-Reply-To: <89E626D4-D48D-4062-A996-E2DFFE8248E3@kernel.crashing.org>

Segher Boessenkool writes:

> >> Yeah.  Giving the warning is a good thing though.
> >
> > No, it isn't; it's just noise, if we're not ever going to do anything
> > to prevent the behaviour - and we can't.
> 
> The same userland code will not run correctly on PPC64 or BookE
> systems.  Is that not a reason to warn?

It *will* run on ppc64 systems, because there we get the
READ_IMPLIES_EXEC personality flag set via the elf_read_implies_exec
thing in include/asm-powerpc/elf.h.  The READ_IMPLIES_EXEC flag is
only set if we don't have the non-executable stack note in the ELF
header, i.e. only for old binaries or libraries.

As for Book E, that could be fixed using elf_read_implies_exec too, if
anyone cared.  In fact maybe the correct solution is to have

#define elf_read_implies_exec(ex, exec_stk) \
	(exec_stk != EXSTACK_DISABLE_X) : 0)

for all 32-bit powerpc.

Paul.

^ permalink raw reply

* Re: [PATCH v2] Allow exec on 32-bit from readable, non-exec pages, with a warning.
From: Segher Boessenkool @ 2007-07-11  0:16 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <18066.63111.703924.714899@cargo.ozlabs.ibm.com>

>> In older versions of glibc (through 2.3), the dynamic linker  
>> executes a
>> small amount of code from the data segment, which is not marked as
>> executable.  A recent change (commit  
>> 9ba4ace39fdfe22268daca9f28c5df384ae462cf)
>> stops this from working; there should be a deprecation period before
>> older glibc versions stop working.
>
> Actually I see no good reason to enforce no-exec at all if we can't do
> it consistently.  And if we're not going to enforce it then there is
> no point whinging about it.

I have a new patch with just this behaviour, Scott is
testing it on old glibc (I think it succeeded, need
confirmation though), I'll have it tested on new glibc
tomorrow.  So patch tomorrow, and let's try to forget
about all this after that, eh?  :-)

> When I applied Segher's original patch I thought that we had the
> read-implies-exec stuff enabled for the affected CPUs, but it turns
> out we don't.  (We only have that stuff turned on for 32-bit processes
> on 64-bit cpus - see elf_read_implies_exec in include/asm-powerpc/ 
> elf.h.)

I never thought "real code" would rely on executing stuff
it didn't map as executable before.  Silly me.  In my
defense, no one else noticed in time either ;-)


Segher

^ permalink raw reply

* Re: [PATCH 2.6.21-rt2] PowerPC: decrementer clockevent driver
From: Segher Boessenkool @ 2007-07-11  0:10 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Thomas Gleixner, mingo, linux-kernel
In-Reply-To: <18068.5829.53635.797336@cargo.ozlabs.ibm.com>

>>> This scales with the number of processors since there is one
>>> decrementer per core (is it per thread on SMT chips?
>>> I don't know).
>>
>> One per core.
>
> No, each thread has its own decrementer, but the timebase is shared.

Argh, of course you're right, I'm reading the wrong ISA
version again.  Sorry.


Segher

^ permalink raw reply

* Re: [PATCH] Allow exec on 32-bit from readable, non-exec pages, with a warning.
From: Segher Boessenkool @ 2007-07-11  0:03 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Arnd Bergmann
In-Reply-To: <18068.5706.700933.551828@cargo.ozlabs.ibm.com>

>> Yeah.  Giving the warning is a good thing though.
>
> No, it isn't; it's just noise, if we're not ever going to do anything
> to prevent the behaviour - and we can't.

The same userland code will not run correctly on PPC64 or BookE
systems.  Is that not a reason to warn?


Segher

^ permalink raw reply

* Re: [PATCH 2.6.21-rt2] PowerPC: decrementer clockevent driver
From: Paul Mackerras @ 2007-07-10 23:31 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev, Thomas Gleixner, mingo, linux-kernel
In-Reply-To: <78777AB0-8FA2-4FB0-9D02-6504ED28957D@kernel.crashing.org>

Segher Boessenkool writes:

> > This scales with the number of processors since there is one
> > decrementer per core (is it per thread on SMT chips?
> > I don't know).
> 
> One per core.

No, each thread has its own decrementer, but the timebase is shared.

Paul.

^ permalink raw reply

* Re: [PATCH] Allow exec on 32-bit from readable, non-exec pages, with a warning.
From: Paul Mackerras @ 2007-07-10 23:29 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev, Arnd Bergmann
In-Reply-To: <8CA741AA-D200-474F-943D-ECE4B3ACD38B@kernel.crashing.org>

Segher Boessenkool writes:

> Yeah.  Giving the warning is a good thing though.

No, it isn't; it's just noise, if we're not ever going to do anything
to prevent the behaviour - and we can't.

Paul.

^ permalink raw reply

* Re: [PATCH] Infinite loop/always true check possible with unsigned counter.
From: Paul Mackerras @ 2007-07-10 23:19 UTC (permalink / raw)
  To: Manish Ahuja; +Cc: ppc-dev
In-Reply-To: <4693D27D.7070504@austin.ibm.com>

Manish Ahuja writes:

> I presume the patch is good then. Do I need to change anything ?

I guess not.  It will cause a warning on the first for loop if anyone
tries to compile with -Wextra or -Wsign-compare, but it would be only
one of lots of warnings in that case (and in fact comparing signed
with unsigned is a perfectly legitimate, well-defined thing to do; you
just have to be aware that the comparison is done as unsigned).

Paul.

^ permalink raw reply

* Re: [PATCH 7/15] bootwrapper: Add kexec callable zImage wrapper
From: Segher Boessenkool @ 2007-07-10 23:16 UTC (permalink / raw)
  To: Milton Miller; +Cc: linuxppc-dev, Paul Mackerras, David Gibson
In-Reply-To: <boot-6-07.miltonm@bga.com>

> The memory node off the root with a name starting with "memory" must
> contain enough free memory (not in the reserved ranges) in the first
> reg range to uncompress the the kernel with padding.

There can be many nodes called "/memory".  You probably
want to use the node pointed to by /chosen/memory instead?


Segher

^ permalink raw reply

* Re: [PATCH 1/1] libata: pata_pdc2027x PLL input clock fix
From: Mikael Pettersson @ 2007-07-10 23:14 UTC (permalink / raw)
  To: albertl, mikpe; +Cc: dwm, jeff, linux-ide, bahadir.balban, linuxppc-dev, alan

On Tue, 10 Jul 2007 11:52:59 +0800, Albert Lee wrote:
> >>Recently the PLL input clock of pata_pdc2027x is sometimes detected
> >>higer than expected (e.g. 20.027 MHz compared to 16.714 MHz).
> >>It seems sometimes the mdelay() function is not as precise as it
> >>used to be. Per Alan's advice, HT or power management might affect
> >>the precision of mdelay().
> >>
> >>This patch calls gettimeofday() to mesure the time elapsed and
> >>calculate the PLL input clock accordingly.
> > 
> > 
> > Unfortunately this breaks pata_pdc2027x on my PowerMac G3:
> > 
> <snip>
> > 
> > In fairness, this is a slightly non-standard PowerMac G3, in that it
> > has a G4 upgrade processor. The firmware doesn't recognise the CPU
> > and gives some CPU core frequency-related properties too low values.
> > However, the bus frequency property _is_ correct, which is what
> > most or all timing stuff should be based on.
> > 
> > Looks like a platform bug.
> > 
> 
> According to the document, do_gettimeofday() has microsecond
> resolution. Since the driver calls mdelay(100) (100000 microseconds), 
> it won't affect the PLL input clock calculation much if somehow
> do_gettimeofday() drifts several (say 100) microseconds.
> 
> Could you please apply the attached debug patch and collect more info
> on the PowerMac G3. Hopefully we can have more clue. Thanks.
> --
> albert
> 
> (BTW, maybe opening a bug in bugzilla.kernel.org would help the
> debugging.)
> 
> --- 00_libata-dev/drivers/ata/pata_pdc2027x.c	2007-07-07 09:58:55.000000000 +0800
> +++ 01_debug/drivers/ata/pata_pdc2027x.c	2007-07-10 11:18:38.000000000 +0800
> @@ -722,6 +722,15 @@ static long pdc_detect_pll_input_clock(s
>  	pll_clock = (start_count - end_count) / 100 *
>  		(100000000 / usec_elapsed);
>  
> +	do_gettimeofday(&start_time);
> +	mdelay(37);
> +	do_gettimeofday(&end_time);
> +	usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 1000000 +
> +		(end_time.tv_usec - start_time.tv_usec);
> +	printk(KERN_ERR "usec_elapsed for mdelay(37) [%ld]\n", usec_elapsed);
> +	printk(KERN_ERR "start time: [%ld]s [%ld]us \n", start_time.tv_sec, start_time.tv_usec);
> +	printk(KERN_ERR "end   time: [%ld]s [%ld]us \n", end_time.tv_sec, end_time.tv_usec);
> +
>  	PDPRINTK("start[%ld] end[%ld] \n", start_count, end_count);
>  	PDPRINTK("PLL input clock[%ld]Hz\n", pll_clock);

2.6.22 + this prints the following on my G3:

pata_pdc2027x 0000:00:0e.0: version 0.9
usec_elapsed for mdelay(37) [35431]
start time: [1184112028]s [775333]us 
end   time: [1184112028]s [810764]us 
pata_pdc2027x 0000:00:0e.0: PLL input clock 1691741 kHz
pata_pdc2027x: Invalid PLL input clock 1691741kHz, give up!

/Mikael

^ permalink raw reply

* Re: [PATCH 11/15] bootwrapper: allow vmlinuz to be an external payload
From: Segher Boessenkool @ 2007-07-10 23:11 UTC (permalink / raw)
  To: Milton Miller; +Cc: linuxppc-dev, Paul Mackerras, David Gibson
In-Reply-To: <boot-6-11.miltonm@bga.com>

> Allow the boot wrapper to obtain the vmlinux elf from an external
> platform supplied location instead of embedding it at link time.
>
> When used with the cpio library, the kernel can be stored as a file
> an file in the initramfs, allowing the same (compressed) copy of
> the vmlinux elf to be used for both the kernel to execute and any
> user space tools such as kexec (for reboot), crash dump, or oprofile.

Awesome!


Segher

^ permalink raw reply

* Re: [PATCH v2] Consolidate mm_context_t definition in mmu.h
From: Paul Mackerras @ 2007-07-10 23:10 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev, arnd, david
In-Reply-To: <1184089950.32199.24.camel@weaponx.rchland.ibm.com>

Josh Boyer writes:

> All of the platforms except PPC64 share a common mm_context_t definition.
> Defining it in mmu.h avoids duplicating it in the platform specific mmu
> header files.  We further consolidate it by having the PPC32 definition
> share the mm_context_id_t type for the id member.

Unfortunately the string of ifdefs in your consolidated version makes
my eyes water.  I'm not sure it isn't better the way it is.

Paul.

^ permalink raw reply

* Re: [PATCH 6/15] bootwrapper: switch 64 bit cpus to 32 bit mode
From: Segher Boessenkool @ 2007-07-10 22:57 UTC (permalink / raw)
  To: Milton Miller; +Cc: linuxppc-dev, Paul Mackerras, David Gibson
In-Reply-To: <boot-6-06.miltonm@bga.com>

> +	/* Check if the processor is running in 32 bit mode, using
> +	 * only 32 bit instructions which should be safe on 32 and
> +	 * 64 bit processors.
> +	 *
> +	 * Subtract the bottom 32 bits of MSR from the full value
> +	 * recording the result.  Since MSR[SF] is in the high word,
> +	 * the result will be not-equal iff in 32 bit mode (either
> +	 * the processor is a 32 bit processor or MSR[SF] = 0).
> +	 */

The other way around -- the processor is 64-bit and MSR[SF]=1.

Great trick btw! :-)

> +	mfmsr	r0		/* grab whole msr		*/
> +	rlwinm	r8,r0,0,0,31	/* extract bottom word		*/
> +	subf.	r8,r8,r0	/* subtract, same?		*/
> +	beq	0f		/* yes: we are 32 bit mode	*/

The code is fine though.


Segher

^ permalink raw reply

* [PATCH/EXAMPLE 15/15] bootwrapper: example sreset marshalling
From: Milton Miller @ 2007-07-10 22:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, David Gibson
In-Reply-To: <boot-6-00.miltonm@bga.com>


An example using the marshalling code that can be entered by sreset.
By linking the marshalling code is at 0 and differentiating a cpu
id from a device tree, it also works for kexec.

Signed-off-by: Milton Miller <miltonm@bga.com>
--- 
For reference only, not intended to be merged.

Index: work.git/arch/powerpc/boot/crt0_sample.S
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ work.git/arch/powerpc/boot/crt0_sample.S	2007-07-10 16:47:25.000000000 -0500
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2006-2007 Milton Miller, IBM Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+	/*
+	 * This can be either a kexec started image or a sreset initiated
+	 * one.  kexec-tools purgatory is suppposed to copy from entry
+	 * point, but instead copies from image start, so put marshal_low
+	 * at address 0.
+	 */
+
+	.globl _zimage_start
+_zimage_start:
+#include "marshal_low.S"
+
+	.org 0x100
+	bl	get_cpu_id
+1:	mflr	0
+	lis	r4,1b@ha
+	addi	r4,r4,1b@l
+	subf	r0,r4,r0
+
+	lis	r4,elected_master@ha
+	addi	r4,r4,elected_master@l
+	add	r4,r4,r0
+2:	lwarx	r6,r0,r4
+	cmpwi	r6,0
+	bge	3f
+	stwcx.	r3,r0,r4
+	bne-	2b
+	lwz	r6,0(r4)
+
+3:	lis	r4,cpus_found@ha
+	addi	r4,r4,cpus_found@l
+	add	r4,r4,r0
+4:	lwarx	r12,r0,r4
+	addi	r12,r12,1
+	stwcx.	r12,r0,r4
+	bne-	4b
+
+	cmpw	r6,r3
+	bne	slave
+
+	mr	r4,r0
+	li	r5,0
+	b	master
+
+
+	.globl	_zimage_start_plat
+_zimage_start_plat:
+	b	_zimage_start_lib
+
+	.weak	get_cpu_id
+get_cpu_id:
+
+get_pir:
+	mfspr	r3,1023	/* SPRN_PIR */
+	blr
+
+	.balign 8
+	.globl elected_master
+elected_master:
+	.long -1
+	.globl cpus_expected
+cpus_expected:
+	.long 8
+	.globl cpus_found
+cpus_found:
+	.long 0
Index: work.git/arch/powerpc/boot/sample.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ work.git/arch/powerpc/boot/sample.c	2007-07-10 16:48:45.000000000 -0500
@@ -0,0 +1,62 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Copyright IBM Corporation 2007
+ *
+ * Authors: Milton Miller <miltonm@bga.com>
+ */
+
+#include "ops.h"
+#include "reg.h"
+#include "flatdevtree.h"
+
+extern struct boot_param_header _dtb_start[], _dtb_end[];
+struct boot_param_header *sample_dt_blob;
+
+extern unsigned int get_cpu_id(void);
+extern unsigned int cpus_found, cpus_expected;
+
+void platform_init(unsigned long boot_cpu_id)
+{
+	if (boot_cpu_id > 1024) {
+		sample_dt_blob = (void *)boot_cpu_id;
+		boot_cpu_id = get_cpu_id();
+	}
+
+	if (!sample_dt_blob)
+		if (_dtb_start != _dtb_end)
+			sample_dt_blob = _dtb_start;
+
+	if (!sample_dt_blob)
+		sample_dt_blob = 31 * 1024 * 1024 + (void *)0;
+
+	if (sample_dt_blob->magic != OF_DT_HEADER)
+		fatal("No device tree at %p\n", sample_dt_blob);
+
+	if (sample_dt_blob->version < 2)
+		conv_flattree_inplace(sample_dt_blob);
+
+	sample_dt_blob->boot_cpuid_phys = boot_cpu_id;
+
+	if (cpus_found && cpus_found < cpus_expected) {
+		HMT_LOW;
+		while (cpus_found < cpus_expected) {
+			barrier();
+		}
+		HMT_MEDIUM;
+	}
+
+	kexec_platform_init(sample_dt_blob);
+}
Index: work.git/arch/powerpc/boot/Makefile
===================================================================
--- work.git.orig/arch/powerpc/boot/Makefile	2007-07-10 16:41:01.000000000 -0500
+++ work.git/arch/powerpc/boot/Makefile	2007-07-10 16:47:45.000000000 -0500
@@ -48,7 +48,7 @@ src-wlib := string.S crt0.S stdio.c main
 		44x.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c
 src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c crt0_kexec.S \
 		cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
-		ps3-head.S ps3-hvcall.S ps3.c
+		ps3-head.S ps3-hvcall.S ps3.c crt0_sample.S sample.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -128,7 +128,7 @@ quiet_cmd_wrap	= WRAP    $@
 		$(if $6,$6,vmlinux)
 
 kexec-$(CONFIG_PPC32)			+= zImage.kexec
-kexec-$(CONFIG_PPC64)			+= zImage.kexec64
+kexec-$(CONFIG_PPC64)			+= zImage.kexec64 zImage.sample
 
 image-$(CONFIG_PPC_PSERIES)		+= zImage.pseries
 image-$(CONFIG_PPC_MAPLE)		+= zImage.pseries
Index: work.git/arch/powerpc/boot/wrapper
===================================================================
--- work.git.orig/arch/powerpc/boot/wrapper	2007-07-10 16:41:01.000000000 -0500
+++ work.git/arch/powerpc/boot/wrapper	2007-07-10 16:47:25.000000000 -0500
@@ -139,6 +139,9 @@ kexec)
 kexec64)
     platformo="-e _zimage_start_64 $object/crt0_kexec.o"
     ;;
+sample)
+    platformo="$object/crt0_sample.o $object/sample.o"
+    ;;
 miboot|uboot)
     # miboot and U-boot want just the bare bits, not an ELF binary
     ext=bin

^ permalink raw reply

* [PATCH 14/15] boot: add a hook to start cpus
From: Milton Miller @ 2007-07-10 22:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, David Gibson
In-Reply-To: <boot-6-00.miltonm@bga.com>

The kexec code is doing strange contortions with dtops.finalize and
platform_ops.vmlinux_alloc to manage the slave cpus.   Add a hook
with the needed information.

Signed-off-by: Milton Miller <miltonm@bga.com>
---
Index: work.git/arch/powerpc/boot/kexec.c
===================================================================
--- work.git.orig/arch/powerpc/boot/kexec.c	2007-07-10 04:39:43.000000000 -0500
+++ work.git/arch/powerpc/boot/kexec.c	2007-07-10 04:40:01.000000000 -0500
@@ -180,32 +180,11 @@ static void init_flat_tree(struct boot_p
 		fatal("Unable to initialize device_tree library!\n\r");
 }
 
-static void *saved_vmlinux_addr;
-
-static void *kexec_vmlinux_alloc(unsigned long size)
-{
-	void *addr;
-
-	addr = ranges_vmlinux_alloc(size);
-
-	saved_vmlinux_addr = addr;
-	return addr;
-}
-
 static void kexec_fixups(void)
 {
 	wait_slaves_moved();
 }
 
-static unsigned long (*finalize_chain)(void);
-
-static unsigned long kexec_finalize(void)
-{
-	send_slaves_to_kernel(saved_vmlinux_addr);
-
-	return finalize_chain();
-}
-
 void kexec_platform_init(struct boot_param_header *dt_blob)
 {
 	slaves_are_low();
@@ -226,8 +205,7 @@ void kexec_platform_init(struct boot_par
 	init_flat_tree(dt_blob);
 
 	platform_ops.find_vmlinuz = find_vmlinux_in_initramfs;
-	platform_ops.vmlinux_alloc = kexec_vmlinux_alloc;
+	platform_ops.vmlinux_alloc = ranges_vmlinux_alloc;
 	platform_ops.fixups = kexec_fixups;
-	finalize_chain = dt_ops.finalize;
-	dt_ops.finalize = kexec_finalize;
+	platform_ops.start_smp = send_slaves_to_kernel;
 }
Index: work.git/arch/powerpc/boot/main.c
===================================================================
--- work.git.orig/arch/powerpc/boot/main.c	2007-07-10 04:39:43.000000000 -0500
+++ work.git/arch/powerpc/boot/main.c	2007-07-10 04:39:43.000000000 -0500
@@ -212,6 +212,9 @@ void start(void)
 	else
 		printf(" using OF tree (promptr=%p)\n\r", loader_info.promptr);
 
+	if (platform_ops.start_smp)
+		platform_ops.start_smp(vmlinux.addr);
+
 	if (console_ops.close)
 		console_ops.close();
 
Index: work.git/arch/powerpc/boot/ops.h
===================================================================
--- work.git.orig/arch/powerpc/boot/ops.h	2007-07-10 04:39:43.000000000 -0500
+++ work.git/arch/powerpc/boot/ops.h	2007-07-10 04:39:43.000000000 -0500
@@ -35,6 +35,7 @@ struct platform_ops {
 	void *	(*realloc)(void *ptr, unsigned long size);
 	void	(*exit)(void);
 	void *	(*vmlinux_alloc)(unsigned long size);
+	void	(*start_smp)(void *vmlinux);
  	void	(*find_vmlinuz)(struct gunzip_state *, void **srcp,
  			unsigned long *lenp);
 };

^ permalink raw reply

* [PATCH 13/15] bootwrapper: attach an empty vmlinux
From: Milton Miller @ 2007-07-10 22:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, David Gibson
In-Reply-To: <boot-6-00.miltonm@bga.com>

Allow the boot wrapper code to be linked without an attached vmlinux.

Rather than invent a new syntax to invoke the wrapper, attach the
stripped version of empty.o, which produces the same result.

This new intermediary is called zBoot.

Signed-off-by: Milton Miller <miltonm@bga.com>
--- 
Initial attempts to remove the dependency on vmlinux in the arch Makefile
have lead to multiple make commands competing in the boot directory and
destroying each other.

Index: work.git/arch/powerpc/boot/Makefile
===================================================================
--- work.git.orig/arch/powerpc/boot/Makefile	2007-07-10 16:38:01.000000000 -0500
+++ work.git/arch/powerpc/boot/Makefile	2007-07-10 16:41:01.000000000 -0500
@@ -124,7 +124,8 @@ endif
 # args (to if_changed): 1 = (this rule), 2 = platform, 3 = dts 4=dtb 5=initrd
 quiet_cmd_wrap	= WRAP    $@
       cmd_wrap	=$(CONFIG_SHELL) $(wrapper) -c -o $@ -p $2 $(CROSSWRAP) \
-		$(if $3, -s $3)$(if $4, -d $4)$(if $5, -i $5) vmlinux
+		$(if $3, -s $3)$(if $4, -d $4)$(if $5, -i $5) \
+		$(if $6,$6,vmlinux)
 
 kexec-$(CONFIG_PPC32)			+= zImage.kexec
 kexec-$(CONFIG_PPC64)			+= zImage.kexec64
@@ -142,6 +143,7 @@ image-$(CONFIG_PPC_PRPMC2800)		+= zImage
 image-$(CONFIG_PPC_ISERIES)		+= zImage.iseries
 image-$(CONFIG_DEFAULT_UIMAGE)		+= uImage
 image-$(CONFIG_KEXEC)			+= $(kexec-y)
+image-$(CONFIG_KEXEC)			+= $(patsubst zImage%,zBoot%,$(kexec-y))
 
 ifneq ($(CONFIG_DEVICE_TREE),"")
 image-$(CONFIG_PPC_83xx)		+= cuImage.83xx
@@ -190,6 +192,9 @@ $(obj)/vmlinux.strip: vmlinux
 $(obj)/zImage.iseries: vmlinux
 	$(STRIP) -s -R .comment $< -o $@
 
+$(obj)/zBoot.%: $(wrapperbits)
+	$(call if_changed,wrap,$*,,,,$(obj)/empty.o)
+
 $(obj)/zImage.ps3: vmlinux  $(wrapper) $(wrapperbits) $(srctree)/$(src)/dts/ps3.dts
 	$(STRIP) -s -R .comment $< -o vmlinux.strip
 	$(call cmd,wrap,ps3,$(srctree)/$(src)/dts/ps3.dts,,)
@@ -227,7 +232,7 @@ clean-files += $(image-) $(initrd-) zIma
 	treeImage.* $(kexec-)
 
 # clean up files cached by wrapper
-clean-kernel := vmlinux.strip vmlinux.bin
+clean-kernel := vmlinux.strip vmlinux.bin empty.o.bin
 clean-kernel += $(addsuffix .gz,$(clean-kernel))
 # If not absolute clean-files are relative to $(obj).
 clean-files += $(addprefix $(objtree)/, $(clean-kernel))
Index: work.git/arch/powerpc/boot/wrapper
===================================================================
--- work.git.orig/arch/powerpc/boot/wrapper	2007-07-10 16:37:30.000000000 -0500
+++ work.git/arch/powerpc/boot/wrapper	2007-07-10 16:41:01.000000000 -0500
@@ -161,6 +161,13 @@ ps3)
     ;;
 esac
 
+if [ "$kernel" = $object/empty.o ] ; then
+    ext=bin
+    objflags="-O binary"
+    gzip=
+fi
+
+
 vmz="$tmpdir/`basename \"$kernel\"`.$ext"
 if [ -z "$cacheit" -o ! -f "$vmz$gzip" -o "$vmz$gzip" -ot "$kernel" ]; then
     ${CROSS}objcopy $objflags "$kernel" "$vmz.$$"

^ 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