Skip to contentSkip to conversation

powerpc/85xx: re-enable timebase sync disabled by KEXEC patch

PATCH In review Li Yang 4 participants 13 messages Dec 3, 2010 – Jan 17, 2011

Subsystems (4)
lore
Share & tools
lore

Li Yang

author
#0 lore raw

PATCH 1/7 powerpc/85xx: re-enable timebase sync disabled by KEXEC patch

The timebase sync is not only necessary when using KEXEC. It should also be used by normal boot up and cpu hotplug. Remove the ifdef added by the KEXEC patch. Fix a problem that cpu hotplugging freezes the whole system.

---
 arch/powerpc/platforms/85xx/smp.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
arch/powerpc/platforms/85xx/smp.c +1 -3
index 5c91a99..1e8aec8 100644
@@ -2,7 +2,7 @@
  * Author: Andy Fleming <[email protected]>
  * 	   Kumar Gala <[email protected]>
  *
- * Copyright 2006-2008 Freescale Semiconductor Inc.
+ * Copyright 2006-2010 Freescale Semiconductor Inc.
  *
  * 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
@@ -115,10 +115,8 @@ smp_85xx_setup_cpu(int cpu_nr)
 
 struct smp_ops_t smp_85xx_ops = {
 	.kick_cpu = smp_85xx_kick_cpu,
-#ifdef CONFIG_KEXEC
 	.give_timebase	= smp_generic_give_timebase,
 	.take_timebase	= smp_generic_take_timebase,
-#endif
 };
 
 #ifdef CONFIG_KEXEC
Signature · 1 line
1.6.6-rc1.GIT
author
#1 lore raw

PATCH 2/7 powerpc/85xx: add HOTPLUG_CPU support

Add support to disable and re-enable individual cores at runtime on MPC85xx/QorIQ SMP machines.

This makes suspend/resume possible for SMP systems, as the power management code on SMP always disable non-boot cpus on suspend.

MPC85xx machines use ePAPR spin-table in boot page for CPU kick-off. This patch brings the bootpage and spin-table from bootloader into kernel because the bootpage in bootloader might have been lost at runtime. Also add support to boot from physical address larger than 32-bit.

---
 arch/powerpc/Kconfig                   |    2 +-
 arch/powerpc/kernel/Makefile           |    2 +-
 arch/powerpc/kernel/head_fsl_booke.S   |   32 +++++
 arch/powerpc/kernel/smp.c              |    4 +-
 arch/powerpc/platforms/85xx/Makefile   |    4 +-
 arch/powerpc/platforms/85xx/bootpage.S |  206 +++++++++++++++++++++++++++++
 arch/powerpc/platforms/85xx/smp.c      |  222 ++++++++++++++++++++++++++------
 7 files changed, 428 insertions(+), 44 deletions(-)
 create mode 100644 arch/powerpc/platforms/85xx/bootpage.S
arch/powerpc/Kconfig +1 -1
index e625e9e..b1982dd 100644
@@ -320,7 +320,7 @@ config SWIOTLB
 
 config HOTPLUG_CPU
 	bool "Support for enabling/disabling CPUs"
-	depends on SMP && HOTPLUG && EXPERIMENTAL && (PPC_PSERIES || PPC_PMAC)
+	depends on SMP && HOTPLUG && EXPERIMENTAL && (PPC_PSERIES || PPC_PMAC || E500)
 	---help---
 	  Say Y here to be able to disable and re-enable individual
 	  CPUs at runtime on SMP machines.
arch/powerpc/kernel/Makefile +1 -1
index 36c30f3..bb20496 100644
@@ -56,7 +56,7 @@ obj-$(CONFIG_IBMEBUS)           += ibmebus.o
 obj-$(CONFIG_GENERIC_TBSYNC)	+= smp-tbsync.o
 obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
 ifeq ($(CONFIG_PPC32),y)
-obj-$(CONFIG_E500)		+= idle_e500.o
+obj-$(CONFIG_E500)		+= idle_e500.o l2cr_85xx.o
 endif
 obj-$(CONFIG_6xx)		+= idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
 obj-$(CONFIG_TAU)		+= tau_6xx.o
arch/powerpc/kernel/head_fsl_booke.S +32 -0
index 529b817..61d9c46 100644
@@ -23,6 +23,7 @@
  *	PowerPC 44x support, Matt Porter <[email protected]>
  *    Copyright 2004 Freescale Semiconductor, Inc
  *	PowerPC e500 modifications, Kumar Gala <[email protected]>
+ *    Copyright 2008, 2010 Freescale Semiconductor, Inc.
  *
  * 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
@@ -254,6 +255,37 @@ _ENTRY(__early_start)
 	lwz	r11, 0(r12);		/* Get Linux PTE */
 #endif
 
+_GLOBAL(flush_disable_L1)
+/*
+ * Flush L1 d-cache, invalidate and disable d-cache,
+ * invalidate and disable i-cache
+ */
+	mflr	r10
+	bl	flush_dcache_L1	/* Flush L1 d-cache */
+	mtlr	r10
+
+	mfspr	r4, SPRN_L1CSR0	/* Invalidate and disable d-cache */
+	li	r5, 2
+	rlwimi	r4, r5, 0, 3
+
+	msync
+	isync
+	mtspr	SPRN_L1CSR0, r4
+	isync
+
+1:	mfspr	r4, SPRN_L1CSR0	/* Wait for the invalidate to finish */
+	andi.	r4, r4, 2
+	bne	1b
+
+	mfspr	r4, SPRN_L1CSR1	/* Invalidate and disable i-cache */
+	li	r5, 2
+	rlwimi	r4, r5, 0, 3
+
+	mtspr	SPRN_L1CSR1, r4
+	isync
+
+	blr
+
 /*
  * Interrupt vector entry code
  *
arch/powerpc/kernel/smp.c +3 -1
index 68034bb..321cf2e 100644
@@ -317,6 +317,8 @@ int generic_cpu_disable(void)
 	set_cpu_online(cpu, false);
 #ifdef CONFIG_PPC64
 	vdso_data->processorCount--;
+#endif
+#if defined(CONFIG_PPC64) || defined(CONFIG_E500)
 	fixup_irqs(cpu_online_mask);
 #endif
 	return 0;
@@ -336,7 +338,7 @@ int generic_cpu_enable(unsigned int cpu)
 	while (!cpu_online(cpu))
 		cpu_relax();
 
-#ifdef CONFIG_PPC64
+#if defined(CONFIG_PPC64) || defined(CONFIG_E500)
 	fixup_irqs(cpu_online_mask);
 	/* counter the irq disable in fixup_irqs */
 	local_irq_enable();
arch/powerpc/platforms/85xx/Makefile +3 -1
index dd70db7..6bbcf22 100644
@@ -1,7 +1,9 @@
 #
 # Makefile for the PowerPC 85xx linux kernel.
 #
-obj-$(CONFIG_SMP) += smp.o
+obj-$(CONFIG_SMP)         += smp.o
+obj-$(CONFIG_HOTPLUG_CPU) += bootpage.o
+obj-$(CONFIG_SUSPEND)     += suspend-asm.o
 
 obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
arch/powerpc/platforms/85xx/bootpage.S new file +206 -0

206 lines not on this page · raw message

arch/powerpc/platforms/85xx/smp.c +182 -40

273 lines not on this page · raw message

Signature · 1 line
1.6.6-rc1.GIT
author
#6 lore raw

PATCH 7/7 P2020ds: add event button handler

In reply to Li Yang

This can be used as a wakeup source for power management.

---
 arch/powerpc/boot/dts/p2020ds.dts        |    9 ++++++++-
 arch/powerpc/platforms/85xx/mpc85xx_ds.c |   26 +++++++++++++++++++++++++-
 2 files changed, 33 insertions(+), 2 deletions(-)
arch/powerpc/boot/dts/p2020ds.dts +8 -1
index 1101914..f4c6520 100644
@@ -1,7 +1,7 @@
 /*
  * P2020 DS Device Tree Source
  *
- * Copyright 2009 Freescale Semiconductor Inc.
+ * Copyright 2009-2010 Freescale Semiconductor Inc.
  *
  * 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
@@ -155,6 +155,13 @@
 			compatible = "fsl,elbc-fcm-nand";
 			reg = <0x6 0x0 0x40000>;
 		};
+
+		ngpixis@3,0 {
+			compatible = "fsl,p2020ds-fpga";
+			reg = <0x3 0 0x30>;
+			interrupt-parent = <&mpic>;
+			interrupts = <0 0>;
+		};
 	};
 
 	soc@ffe00000 {
arch/powerpc/platforms/85xx/mpc85xx_ds.c +25 -1
index 8190bc2..a8807fe 100644
@@ -4,7 +4,7 @@
  * Author Xianghua Xiao ([email protected])
  * Roy Zang <[email protected]>
  * 	- Add PCI/PCI Exprees support
- * Copyright 2007 Freescale Semiconductor Inc.
+ * Copyright 2007-2010 Freescale Semiconductor Inc.
  *
  * 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
@@ -200,6 +200,30 @@ static void __init mpc85xx_ds_setup_arch(void)
 	printk("MPC85xx DS board from Freescale Semiconductor\n");
 }
 
+static irqreturn_t event_isr(int irq, void *dev_id)
+{
+
+	printk(KERN_INFO "MPC85xxDS: Event button been pushed.\n");
+	return IRQ_HANDLED;
+}
+
+static int __init p2020ds_ngpixis_init(void)
+{
+	int event_irq, ret;
+	struct device_node *np;
+
+	np = of_find_compatible_node(NULL, NULL, "fsl,p2020ds-fpga");
+	if (np) {
+		event_irq = irq_of_parse_and_map(np, 0);
+		ret = request_irq(event_irq, event_isr, 0, "event", NULL);
+		if (ret)
+			printk(KERN_ERR "Can't request board event int\n");
+		of_node_put(np);
+	}
+	return 0;
+}
+machine_device_initcall(p2020_ds, p2020ds_ngpixis_init);
+
 /*
  * Called very early, device-tree isn't unflattened
  */
Signature · 1 line
1.6.6-rc1.GIT
author
#2 lore raw

PATCH 3/7 powerpc/85xx: add the deep sleep support

In reply to Li Yang

Some Freescale chips like MPC8536 and P1022 has deep sleep PM mode in addtion to the sleep PM mode.

In sleep power management mode, the clock of e500 core is turned off, the clocks of most IP blocks are shut off, only the modules clocks which allows to wake up the processor are still running.

While in deep sleep PM mode, additionally, the power supply is removed for e500 core and most devices. Only the blocks needed to detect wakeup and sequence the chip out of deep sleep are ON.

Also add APIs for setting wakeup source and lossless Ethernet in low power modes.

The deep sleep mode is equal to the Suspend-to-RAM state of Linux Power Management.

echo mem > /sys/power/state

to enter deep sleep mode.

---
 arch/powerpc/kernel/l2cr_85xx.S           |   53 +++
 arch/powerpc/platforms/85xx/suspend-asm.S |  625 +++++++++++++++++++++++++++++
 arch/powerpc/sysdev/fsl_pmc.c             |  153 ++++++-
 arch/powerpc/sysdev/fsl_soc.h             |   11 +
 4 files changed, 823 insertions(+), 19 deletions(-)
 create mode 100644 arch/powerpc/kernel/l2cr_85xx.S
 create mode 100644 arch/powerpc/platforms/85xx/suspend-asm.S
arch/powerpc/kernel/l2cr_85xx.S new file +53 -0
new file mode 100644
index 0000000..5283d31
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All rights reserved.
+ *	Scott Wood <[email protected]>
+ *	Dave Liu <[email protected]>
+ * implement the L2 cache operations of e500 based L2 controller
+ *
+ * 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.
+ */
+
+#include <asm/reg.h>
+#include <asm/cputable.h>
+#include <asm/ppc_asm.h>
+#include <asm/asm-offsets.h>
+
+	.section .text
+
+	/* r3 = virtual address of L2 controller, WIMG = 01xx */
+_GLOBAL(flush_disable_L2)
+	/* It's a write-through cache, so only invalidation is needed. */
+	mbar
+	isync
+	lwz	r4, 0(r3)
+	li	r5, 1
+	rlwimi	r4, r5, 30, 0xc0000000
+	stw	r4, 0(r3)
+
+	/* Wait for the invalidate to finish */
+1:	lwz	r4, 0(r3)
+	andis.	r4, r4, 0x4000
+	bne	1b
+	mbar
+
+	blr
+
+	/* r3 = virtual address of L2 controller, WIMG = 01xx */
+_GLOBAL(invalidate_enable_L2)
+	mbar
+	isync
+	lwz	r4, 0(r3)
+	li	r5, 3
+	rlwimi	r4, r5, 30, 0xc0000000
+	stw	r4, 0(r3)
+
+	/* Wait for the invalidate to finish */
+1:	lwz	r4, 0(r3)
+	andis.	r4, r4, 0x4000
+	bne	1b
+	mbar
+
+	blr
arch/powerpc/platforms/85xx/suspend-asm.S new file +625 -0

625 lines not on this page · raw message

arch/powerpc/sysdev/fsl_pmc.c +134 -19

193 lines not on this page · raw message

arch/powerpc/sysdev/fsl_soc.h +11 -0
index 5360948..5250539 100644
@@ -3,6 +3,8 @@
 #ifdef __KERNEL__
 
 #include <asm/mmu.h>
+#include <linux/platform_device.h>
+#include <linux/suspend.h>
 
 struct spi_device;
 
@@ -21,6 +23,15 @@ struct device_node;
 
 extern void fsl_rstcr_restart(char *cmd);
 
+#ifdef CONFIG_FSL_PMC
+int pmc_enable_wake(struct platform_device *pdev, suspend_state_t state,
+		bool enable);
+void pmc_enable_lossless(int enable);
+#else
+#define pmc_enable_wake(pdev, state, enable)	(-EINVAL)
+#define pmc_enable_lossless(enable) do {} while (0);
+#endif
+
 #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
 struct platform_diu_data_ops {
 	unsigned int (*get_pixel_format) (unsigned int bits_per_pixel,
Signature · 1 line
1.6.6-rc1.GIT
author
#4 lore raw

PATCH 5/7 powerpc: add the mpic timer support

In reply to Li Yang

There are global timers in the MPIC interrupt controller. The patch adds support to the timers.

The timer can generate interrupt which can be used as a wakeup event.

---
 arch/powerpc/include/asm/mpic.h  |    1 +
 arch/powerpc/sysdev/Makefile     |    2 +-
 arch/powerpc/sysdev/mpic.c       |   88 +++++++++++++-
 arch/powerpc/sysdev/mpic_timer.c |  258 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 346 insertions(+), 3 deletions(-)
 create mode 100644 arch/powerpc/sysdev/mpic_timer.c
arch/powerpc/include/asm/mpic.h +1 -0
index e000cce..4272111 100644
@@ -263,6 +263,7 @@ struct mpic
 #ifdef CONFIG_SMP
 	struct irq_chip		hc_ipi;
 #endif
+	struct irq_chip         hc_tm;
 	const char		*name;
 	/* Flags */
 	unsigned int		flags;
arch/powerpc/sysdev/Makefile +1 -1
index 0bef9da..d95a417 100644
@@ -3,7 +3,7 @@ subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
 ccflags-$(CONFIG_PPC64)		:= -mno-minimal-toc
 
 mpic-msi-obj-$(CONFIG_PCI_MSI)	+= mpic_msi.o mpic_u3msi.o mpic_pasemi_msi.o
-obj-$(CONFIG_MPIC)		+= mpic.o $(mpic-msi-obj-y)
+obj-$(CONFIG_MPIC)		+= mpic.o mpic_timer.o $(mpic-msi-obj-y)
 fsl-msi-obj-$(CONFIG_PCI_MSI)	+= fsl_msi.o
 obj-$(CONFIG_PPC_MSI_BITMAP)	+= msi_bitmap.o
 
arch/powerpc/sysdev/mpic.c +86 -2

167 lines not on this page · raw message

arch/powerpc/sysdev/mpic_timer.c new file +258 -0

258 lines not on this page · raw message

Signature · 1 line
1.6.6-rc1.GIT
author
#5 lore raw

PATCH 6/7 fsl_pmc: update device bindings

---
 Documentation/powerpc/dts-bindings/fsl/pmc.txt |   63 +++++++++++++----------
 1 files changed, 36 insertions(+), 27 deletions(-)
Documentation/powerpc/dts-bindings/fsl/pmc.txt +36 -27
index 07256b7..d84b4f8 100644
@@ -9,22 +9,27 @@ Properties:
 
   "fsl,mpc8548-pmc" should be listed for any chip whose PMC is
   compatible.  "fsl,mpc8536-pmc" should also be listed for any chip
-  whose PMC is compatible, and implies deep-sleep capability.
+  whose PMC is compatible, and implies deep-sleep capability and
+  wake on user defined packet(wakeup on ARP).
+
+  "fsl,p1022-pmc" should be listed for any chip whose PMC is
+  compatible, and implies lossless Ethernet capability during sleep.
 
   "fsl,mpc8641d-pmc" should be listed for any chip whose PMC is
   compatible; all statements below that apply to "fsl,mpc8548-pmc" also
   apply to "fsl,mpc8641d-pmc".
 
   Compatibility does not include bit assignments in SCCR/PMCDR/DEVDISR; these
-  bit assignments are indicated via the sleep specifier in each device's
-  sleep property.
+  bit assignments are indicated via the clock nodes.  Device which has a
+  controllable clock source should have a "clk-handle" property pointing
+  to the clock node.
 
 - reg: For devices compatible with "fsl,mpc8349-pmc", the first resource
   is the PMC block, and the second resource is the Clock Configuration
   block.
 
-  For devices compatible with "fsl,mpc8548-pmc", the first resource
-  is a 32-byte block beginning with DEVDISR.
+  For devices compatible with "fsl,mpc8548-pmc", the second resource
+  is a 32-byte block beginning with DEVDISR if supported.
 
 - interrupts: For "fsl,mpc8349-pmc"-compatible devices, the first
   resource is the PMC block interrupt.
@@ -33,31 +38,35 @@ Properties:
   this is a phandle to an "fsl,gtm" node on which timer 4 can be used as
   a wakeup source from deep sleep.
 
-Sleep specifiers:
+Clock nodes:
+The clock nodes are to describe the masks in PM controller registers for each
+soc clock.
+- fsl,pmcdr-mask: For "fsl,mpc8548-pmc"-compatible devices, the mask will be
+  ORed into PMCDR before suspend if the device using this clock is the wake-up
+  source and need to be running during low power mode; clear the mask if
+  otherwise.
 
-  fsl,mpc8349-pmc: Sleep specifiers consist of one cell.  For each bit
-  that is set in the cell, the corresponding bit in SCCR will be saved
-  and cleared on suspend, and restored on resume.  This sleep controller
-  supports disabling and resuming devices at any time.
+- fsl,sccr-mask: For "fsl,mpc8349-pmc"-compatible devices, the corresponding
+  bit specified by the mask in SCCR will be saved and cleared on suspend, and
+  restored on resume.
 
-  fsl,mpc8536-pmc: Sleep specifiers consist of three cells, the third of
-  which will be ORed into PMCDR upon suspend, and cleared from PMCDR
-  upon resume.  The first two cells are as described for fsl,mpc8578-pmc.
-  This sleep controller only supports disabling devices during system
-  sleep, or permanently.
-
-  fsl,mpc8548-pmc: Sleep specifiers consist of one or two cells, the
-  first of which will be ORed into DEVDISR (and the second into
-  DEVDISR2, if present -- this cell should be zero or absent if the
-  hardware does not have DEVDISR2) upon a request for permanent device
-  disabling.  This sleep controller does not support configuring devices
-  to disable during system sleep (unless supported by another compatible
-  match), or dynamically.
+- fsl,devdisr-mask: Contain one or two cells, depending on the availability of
+  DEVDISR2 register.  For compatible devices, the mask will be ORed into DEVDISR
+  or DEVDISR2 when the clock should be permenently disabled.
 
 Example:
 
-	power@b00 {
-		compatible = "fsl,mpc8313-pmc", "fsl,mpc8349-pmc";
-		reg = <0xb00 0x100 0xa00 0x100>;
-		interrupts = <80 8>;
+	power@e0070 {
+		compatible = "fsl,mpc8536-pmc", "fsl,mpc8548-pmc";
+		reg = <0xe0070 0x20>;
+
+		etsec1_clk: soc-clk@24 {
+			fsl,pmcdr-mask = <0x00000080>;
+		};
+		etsec2_clk: soc-clk@25 {
+			fsl,pmcdr-mask = <0x00000040>;
+		};
+		etsec3_clk: soc-clk@26 {
+			fsl,pmcdr-mask = <0x00000020>;
+		};
 	};
Signature · 1 line
1.6.6-rc1.GIT
author
#3 lore raw

PATCH 4/7 powerpc/85xx: add support to JOG feature using cpufreq interface

In reply to Li Yang

Some 85xx silicons like MPC8536 and P1022 has the JOG PM feature.

The patch adds the support to change CPU frequency using the standard cpufreq interface.

---
 arch/powerpc/platforms/85xx/Makefile  |    1 +
 arch/powerpc/platforms/85xx/cpufreq.c |  236 +++++++++++++++++++++++++++++++++
 arch/powerpc/platforms/Kconfig        |    8 +
 3 files changed, 245 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/platforms/85xx/cpufreq.c
arch/powerpc/platforms/85xx/Makefile +1 -0
index 6bbcf22..11cedde 100644
@@ -4,6 +4,7 @@
 obj-$(CONFIG_SMP)         += smp.o
 obj-$(CONFIG_HOTPLUG_CPU) += bootpage.o
 obj-$(CONFIG_SUSPEND)     += suspend-asm.o
+obj-$(CONFIG_MPC85xx_CPUFREQ) += cpufreq.o
 
 obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
arch/powerpc/platforms/85xx/cpufreq.c new file +236 -0

236 lines not on this page · raw message

arch/powerpc/platforms/Kconfig +8 -0
index 956154f..df529f9 100644
@@ -178,6 +178,14 @@ config CPU_FREQ_PMAC64
 	  This adds support for frequency switching on Apple iMac G5,
 	  and some of the more recent desktop G5 machines as well.
 
+config MPC85xx_CPUFREQ
+	bool "Support for Freescale MPC85xx CPU freq"
+	depends on PPC_85xx && PPC32
+	select CPU_FREQ_TABLE
+	help
+	  This adds support for frequency switching on Freescale MPC85xx,
+	  this currently includes P1022 processor.
+
 config PPC_PASEMI_CPUFREQ
 	bool "Support for PA Semi PWRficient"
 	depends on PPC_PASEMI
Signature · 1 line
1.6.6-rc1.GIT
#11 lore raw
In reply to Li Yang
Quoted 1 line · Li Yang

The timebase sync is not only necessary when using KEXEC. It should =

also

Quoted 2 lines

be used by normal boot up and cpu hotplug. Remove the ifdef added by the KEXEC patch. Fix a problem that cpu hotplugging freezes the whole =

system.

Quoted 6 lines

=20

---
arch/powerpc/platforms/85xx/smp.c | 4 +---

1 files changed, 1 insertions(+), 3 deletions(-)

But we have problems with KEXEC w/o this? What is the issue with = hotplugging and the generic timebase code? When do we freeze?

=

Quoted 2 lines

=20

= renamed from arch/powerpc/platforms/85xx/smp.c +0 -0

b/arch/powerpc/platforms/85xx/smp.c

arch/powerpc/platforms/85xx/smp.c line 7

Quoted 11 lines

index 5c91a99..1e8aec8 100644

arch/powerpc/platforms/85xx/smp.c +1 -1
@@ -2,7 +2,7 @@
 * Author: Andy Fleming <[email protected]>
 * 	   Kumar Gala <[email protected]>
 *
- * Copyright 2006-2008 Freescale Semiconductor Inc.
+ * Copyright 2006-2010 Freescale Semiconductor Inc.
 *
 * This program is free software; you can redistribute  it and/or =

modify it

arch/powerpc/platforms/85xx/smp.c line 8

Quoted 1 line
arch/powerpc/platforms/85xx/smp.c +0 -0
 * under  the terms of  the GNU General  Public License as published =

by the

Quoted 19 lines
arch/powerpc/platforms/85xx/smp.c +0 -0
@@ -115,10 +115,8 @@ smp_85xx_setup_cpu(int cpu_nr)

=20

struct smp_ops_t smp_85xx_ops =3D {
	.kick_cpu =3D smp_85xx_kick_cpu,

-#ifdef CONFIG_KEXEC
.give_timebase =3D smp_generic_give_timebase,
.take_timebase =3D smp_generic_take_timebase,
-#endif
};
=20
#ifdef CONFIG_KEXEC
--=20
1.6.6-rc1.GIT
=20
=20
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

author
#12 lore raw

On Sat, Dec 4, 2010 at 12:40 AM, Kumar Gala <[email protected]> wro= te:

Quoted 4 lines · Li Yang
Quoted 2 lines

The timebase sync is not only necessary when using KEXEC. =C2=A0It shoul=

d also

Quoted 1 line
Quoted 1 line

be used by normal boot up and cpu hotplug. =C2=A0Remove the ifdef added =

by

Quoted 1 line
Quoted 1 line

the KEXEC patch. =C2=A0Fix a problem that cpu hotplugging freezes the wh=

ole system.

Quoted 8 lines
Quoted 6 lines

---
arch/powerpc/platforms/85xx/smp.c | =C2=A0 =C2=A04 +---

1 files changed, 1 insertions(+), 3 deletions(-)

But we have problems with KEXEC w/o this? =C2=A0What is the issue with ho=

tplugging and the generic timebase code? =C2=A0When do we freeze?

Actually the KEXEC patch disables timebase sync when KEXEC is not defined. If the timebase sync is disabled, the timebase on non-boot cpu will become non-consistent. And thus ruins the scheduler when hot-plugged.

Quoted 3 lines

arch/powerpc/platforms/=

Quoted 3 lines
arch/powerpc/platforms/= renamed from arch/powerpc/platforms/85xx/smp.c +0 -0

85xx/smp.c

Quoted 11 lines
Quoted 11 lines

index 5c91a99..1e8aec8 100644

arch/powerpc/platforms/85xx/smp.c +0 -0
@@ -2,7 +2,7 @@

=C2=A0* Author: Andy Fleming <[email protected]>
=C2=A0* =C2=A0 =C2=A0 =C2=A0 Kumar Gala <[email protected]> =C2=A0*
- * Copyright 2006-2008 Freescale Semiconductor Inc.
+ * Copyright 2006-2010 Freescale Semiconductor Inc.
=C2=A0*
=C2=A0* This program is free software; you can redistribute =C2=A0it and=

/or modify it

Quoted 1 line
Quoted 1 line

=C2=A0* under =C2=A0the terms of =C2=A0the GNU General =C2=A0Public Lice=

nse as published by the

Quoted 15 lines
Quoted 15 lines
arch/powerpc/platforms/85xx/smp.c +0 -3
@@ -115,10 +115,8 @@ smp_85xx_setup_cpu(int cpu_nr)
 
 struct smp_ops_t smp_85xx_ops =3D {
 =C2=A0 =C2=A0 =C2=A0 .kick_cpu =3D smp_85xx_kick_cpu,
-#ifdef CONFIG_KEXEC
 =C2=A0 =C2=A0 =C2=A0 .give_timebase =C2=A0=3D smp_generic_give_timebase,
 =C2=A0 =C2=A0 =C2=A0 .take_timebase =C2=A0=3D smp_generic_take_timebase,
-#endif
 };
 
 #ifdef CONFIG_KEXEC
--

1.6.6-rc1.GIT

Quoted 10 lines
Quoted 4 lines

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

--=20
- Leo

#7 lore raw

Re: [PATCH 7/7] P2020ds: add event button handler

In reply to Li Yang
Quoted 1 line · Li Yang

This can be used as a wakeup source for power management.

This patch doesn't actually add wake-up support.

This patch should probably be split up, since you're adding generic functionality for the IRQ that applies to all 85xx boards, but you only update the device tree for one board.

arch/powerpc/platforms/85xx/mpc85xx_ds.c static void __init mpc85xx_ds_setup_arch(void) · line 208

Quoted 6 lines
arch/powerpc/platforms/85xx/mpc85xx_ds.c +6 -0
+static irqreturn_t event_isr(int irq, void *dev_id)
+{
+
+ =A0 =A0 =A0 printk(KERN_INFO "MPC85xxDS: Event button been pushed.\n");
+ =A0 =A0 =A0 return IRQ_HANDLED;
+}

Would it make sense to have this be a weak function, so that it would be easier to implement board-specific support?

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+static int __init p2020ds_ngpixis_init(void)

You're adding a function called "p2020ds_ngpixis_init" to the file "mpc85xx_ds.c". mpc85xx_ds.c supports more than just the P2020DS.

Review

Quoted 5 lines
(quoted diff) +5 -0
+{
+ =A0 =A0 =A0 int event_irq, ret;
+ =A0 =A0 =A0 struct device_node *np;
+
+ =A0 =A0 =A0 np =3D of_find_compatible_node(NULL, NULL, "fsl,p2020ds-fpg=

a");

Quoted 3 lines

+ =A0 =A0 =A0 if (np) {
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 event_irq =3D irq_of_parse_and_map(np, 0);
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D request_irq(event_irq, event_isr, 0=

, "event", NULL);

You should probably choose a less generic name than "event".

Quoted 2 lines

+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ret)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk(KERN_ERR "Can't requ=

est board event int\n");

Use pr_err()

--=20
Timur Tabi
Linux kernel developer at Freescale

author
#8 lore raw

Re: [PATCH 7/7] P2020ds: add event button handler

Quoted 4 lines · Timur Tabi
Quoted 1 line · Li Yang

This can be used as a wakeup source for power management.

This patch doesn't actually add wake-up support.

Any enabled IRQ is a valid wake-up source for standby. The patch enables a board specific interrupt for the purpose of wakeup.

Quoted 4 lines

This patch should probably be split up, since you're adding generic functionality for the IRQ that applies to all 85xx boards, but you only update the device tree for one board.

The IRQ is a board specific one from GPIO which not applicable on all 85xx boards.

Quoted 5 lines

arch/powerpc/platforms/85xx/mpc85xx_ds.c static void __init mpc85xx_ds_setup_arch(void)

Quoted 5 lines
arch/powerpc/platforms/85xx/mpc85xx_ds.c +4 -0
+static irqreturn_t event_isr(int irq, void *dev_id)
+{
+
+ =C2=A0 =C2=A0 =C2=A0 printk(KERN_INFO "MPC85xxDS: Event button been pu=

shed.\n");

Quoted 5 lines
Quoted 2 lines

+ =C2=A0 =C2=A0 =C2=A0 return IRQ_HANDLED;
+}

Would it make sense to have this be a weak function, so that it would be easier to implement board-specific support?

It's already a board-specific one.

Quoted 6 lines

Review

Quoted 3 lines
(quoted diff) +2 -0
+
+static int __init p2020ds_ngpixis_init(void)

You're adding a function called "p2020ds_ngpixis_init" to the file "mpc85xx_ds.c". =C2=A0mpc85xx_ds.c supports more than just the P2020DS.

I'm not sure if other DS boards covered by this file has the same functiona= lity.

Quoted 6 lines

Review

Quoted 6 lines
(quoted diff) +5 -0
+{
+ =C2=A0 =C2=A0 =C2=A0 int event_irq, ret;
+ =C2=A0 =C2=A0 =C2=A0 struct device_node *np;
+
+ =C2=A0 =C2=A0 =C2=A0 np =3D of_find_compatible_node(NULL, NULL, "fsl,p=

2020ds-fpga");

Quoted 2 lines
Quoted 2 lines

+ =C2=A0 =C2=A0 =C2=A0 if (np) {
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 event_irq =3D irq_of_=

parse_and_map(np, 0);

Quoted 1 line
Quoted 1 line

+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ret =3D request_irq(e=

vent_irq, event_isr, 0, "event", NULL);

Quoted 2 lines

You should probably choose a less generic name than "event".

Well, it's the name suggested by the board manual. We may change it to "event_button" if not too long.

- Leo

#9 lore raw

Re: [PATCH 7/7] P2020ds: add event button handler

Quoted 2 lines · Li Yang

Any enabled IRQ is a valid wake-up source for standby. =A0The patch enables a board specific interrupt for the purpose of wakeup.

Oh, right. I should have realized that.

Quoted 6 lines
Quoted 3 lines

This patch should probably be split up, since you're adding generic functionality for the IRQ that applies to all 85xx boards, but you only update the device tree for one board.

The IRQ is a board specific one from GPIO which not applicable on all 85xx boards.

Doesn't the device tree take care of that? If the node exists, the IRQ number is specified. Otherwise, the feature is not enabled.

Quoted 4 lines
Quoted 4 lines

arch/powerpc/platforms/85xx/mpc85xx_ds.c static void __init mpc85xx_ds_setup_arch(void)

Quoted 4 lines
arch/powerpc/platforms/85xx/mpc85xx_ds.c +4 -0
+static irqreturn_t event_isr(int irq, void *dev_id)
+{
+
+ =A0 =A0 =A0 printk(KERN_INFO "MPC85xxDS: Event button been pushed.\n"=

);

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

+ =A0 =A0 =A0 return IRQ_HANDLED;
+}

Would it make sense to have this be a weak function, so that it would be easier to implement board-specific support?

It's already a board-specific one.

Hmmm.... I guess technically it is, but I wonder if it should be.

Quoted 7 lines
Quoted 5 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+static int __init p2020ds_ngpixis_init(void)

You're adding a function called "p2020ds_ngpixis_init" to the file "mpc85xx_ds.c". =A0mpc85xx_ds.c supports more than just the P2020DS.

I'm not sure if other DS boards covered by this file has the same functio=

nality.

Well, either it does or it doesn't, but you can't add a p2020-specific function to mpc85xx_ds.c. You should just rename the function, because I see no reason why it can't work on other DS boards.

The problem is the compatible string. Each pixis implementation is different, but they share several common traits. I wonder if we need to have a generic compatible string for the FPGA node.

Quoted 4 lines
Quoted 1 line

You should probably choose a less generic name than "event".

Well, it's the name suggested by the board manual. =A0We may change it to "event_button" if not too long.

I was thinking something like "fsl-fpga-event".

--=20
Timur Tabi
Linux kernel developer at Freescale

#10 lore raw

Re: [PATCH 5/7] powerpc: add the mpic timer support

In reply to Li Yang

Hi,

I am interested by this implementation.

Quoted 2 lines

+static ssize_t mpic_tm_timeout_store(struct device *dev,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct device_attribute *attr,

Quoted 1 line

+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 const char *buf, size_t count)

Quoted 1 line

+{

<snip>

Review

Quoted 6 lines
(quoted diff) +6 -0
+
+ =C2=A0 =C2=A0 =C2=A0 spin_lock_irq(&priv->lock);
+
+ =C2=A0 =C2=A0 =C2=A0 /* stop timer 0 */
+ =C2=A0 =C2=A0 =C2=A0 temp =3D in_be32(&priv->regs->gtbcr);
+ =C2=A0 =C2=A0 =C2=A0 temp |=3D MPIC_TIMER_STOP; /* counting inhibited *=

/

Quoted 5 lines

+ =C2=A0 =C2=A0 =C2=A0 out_be32(&priv->regs->gtbcr, temp);
+
+ =C2=A0 =C2=A0 =C2=A0 if (interval !=3D 0) {
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* start timer */
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 out_be32(&priv->regs->=

gtbcr, interval | MPIC_TIMER_STOP);

Quoted 1 line

+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 out_be32(&priv->regs->=

gtbcr, interval);

arch/powerpc/sysdev/mpic.c static inline void _mpic_ipi_write(struct mpic *mpic, unsigned int ipi, u32 valu · line 219

Quoted 5 lines

+ =C2=A0 =C2=A0 =C2=A0 }

arch/powerpc/sysdev/mpic.c +4 -0
+
+ =C2=A0 =C2=A0 =C2=A0 spin_unlock_irq(&priv->lock);
+ =C2=A0 =C2=A0 =C2=A0 return count;
+}

What is the delay when doing that stop/start thing ?
Is this delay variable and/or big or not ?
I would imagine a timer which would see its interval regularly corrected, and I would like to know if this is really really fast (say, less than some ticks) or not.

Thanks in advance for any answer !
Regards,
JM