LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] powerpc/40x: Add APM8018X SOC support
From: Tanmay @ 2011-11-24  5:47 UTC (permalink / raw)
  To: Paul Bolle; +Cc: linuxppc-dev, Tanmay Inamdar, linux-kernel
In-Reply-To: <1322043831.1753.49.camel@x61.thuisdomein>

[-- Attachment #1: Type: text/plain, Size: 5301 bytes --]

Hello,

Thanks for the comments. Please see inline.

Regards,
Tanmay

On Wed, Nov 23, 2011 at 3:53 PM, Paul Bolle <pebolle@tiscali.nl> wrote:

> Tanmay,
>
> (Some minor Kconfig related comments follow.)
>
> On Wed, 2011-11-23 at 15:14 +0530, Tanmay Inamdar wrote:
> > The AppliedMicro APM8018X embedded processor targets embedded
> applications that
> > require low power and a small footprint. It features a PowerPC 405
> processor
> > core built in a 65nm low-power CMOS process with a five-stage pipeline
> executing
> > up to one instruction per cycle. The family has 128-kbytes of on-chip
> memory,
> > a 128-bit local bus and on-chip DDR2 SDRAM controller with 16-bit
> interface.
> >
> >[...]
> >
> > Signed-off-by: Tanmay Inamdar <tinamdar@apm.com>
> > ---
> >  arch/powerpc/Kconfig                        |    6 +
> >  arch/powerpc/boot/dcr.h                     |    6 +
> >  arch/powerpc/boot/dts/klondike.dts          |  668 +++++++++++++
> >  arch/powerpc/configs/40x/klondike_defconfig | 1353
> +++++++++++++++++++++++++++
> >  arch/powerpc/include/asm/dcr-regs.h         |   20 +
> >  arch/powerpc/kernel/cputable.c              |   52 +
> >  arch/powerpc/kernel/udbg_16550.c            |   22 +
> >  arch/powerpc/platforms/40x/Kconfig          |   11 +
> >  arch/powerpc/platforms/40x/ppc40x_simple.c  |    4 +-
> >  9 files changed, 2141 insertions(+), 1 deletions(-)
> >  create mode 100644 arch/powerpc/boot/dts/klondike.dts
> >  create mode 100644 arch/powerpc/configs/40x/klondike_defconfig
> >
> > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> > index b177caa..3f2cc36 100644
> > --- a/arch/powerpc/Kconfig
> > +++ b/arch/powerpc/Kconfig
> > @@ -978,3 +978,9 @@ config PPC_LIB_RHEAP
> >       bool
> >
> >  source "arch/powerpc/kvm/Kconfig"
> > +
> > +config UART_16550_WORD_ADDRESSABLE
> > +     bool
> > +     default n
> > +     help
> > +        Enable this if your UART 16550 is word addressable.
>
> This is only relevant for this SOC isn't it? If so, it might be better
> to add it to arch/powerpc/platforms/40x/Kconfig.
>
> The help line can be dropped (there's no prompt, so the help won't be
> user visible).
>
> Some people would suggest to use
>        def_bool n
>
> here. (I don't really care.)
>
Agreed. As Kumar Gala suggested in his comment, I will move this and make a
separate patch for UART changes.

>
> > [...]
>
> > diff --git a/arch/powerpc/kernel/udbg_16550.c
> b/arch/powerpc/kernel/udbg_16550.c
> > index 6837f83..dd3bce9 100644
> > --- a/arch/powerpc/kernel/udbg_16550.c
> > +++ b/arch/powerpc/kernel/udbg_16550.c
> > @@ -18,6 +18,19 @@ extern void real_writeb(u8 data, volatile u8 __iomem
> *addr);
> >  extern u8 real_205_readb(volatile u8 __iomem  *addr);
> >  extern void real_205_writeb(u8 data, volatile u8 __iomem *addr);
> >
> > +#ifdef CONFIG_UART_16550_WORD_ADDRESSABLE
> > +struct NS16550 {
> > +     /* this struct must be packed */
> > +     unsigned char rbr;  /* 0 */ u8 s0[3];
> > +     unsigned char ier;  /* 1 */ u8 s1[3];
> > +     unsigned char fcr;  /* 2 */ u8 s2[3];
> > +     unsigned char lcr;  /* 3 */ u8 s3[3];
> > +     unsigned char mcr;  /* 4 */ u8 s4[3];
> > +     unsigned char lsr;  /* 5 */ u8 s5[3];
> > +     unsigned char msr;  /* 6 */ u8 s6[3];
> > +     unsigned char scr;  /* 7 */ u8 s7[3];
> > +};
> > +#else
> >  struct NS16550 {
> >       /* this struct must be packed */
> >       unsigned char rbr;  /* 0 */
> > @@ -29,6 +42,7 @@ struct NS16550 {
> >       unsigned char msr;  /* 6 */
> >       unsigned char scr;  /* 7 */
> >  };
> > +#endif /* CONFIG_UART_16550_WORD_ADDRESSABLE */
> >
> >  #define thr rbr
> >  #define iir fcr
> > [...]
> > diff --git a/arch/powerpc/platforms/40x/Kconfig
> b/arch/powerpc/platforms/40x/Kconfig
> > index 1530229..3d0d1d9 100644
> > --- a/arch/powerpc/platforms/40x/Kconfig
> > +++ b/arch/powerpc/platforms/40x/Kconfig
> > @@ -186,3 +186,14 @@ config IBM405_ERR51
> >  #    bool
> >  #    depends on !STB03xxx && PPC4xx_DMA
> >  #    default y
> > +#
> > +
> > +config APM8018X
> > +     bool "APM8018X"
> > +     depends on 40x
> > +     default y
>
> Why is this "default y"? All other "selectors" of PPC40x_SIMPLE default
> to n.
>
> Yes. This is a mistake. This should be 'n'.


> > +     select PPC40x_SIMPLE
>
> There was recently some powerpc related discussion on using "select" on
> symbols that are themselves user selectable (see
> https://lkml.org/lkml/2011/11/9/426 ). But other symbols already select
> this symbol so this is not specific to this patch.
>
> > +     select UART_16550_WORD_ADDRESSABLE
> > +     help
> > +       This option enables support for the AppliedMicro Klondike board.
> > +
>
> Since you're selecting it here it's good that you made
> UART_16550_WORD_ADDRESSABLE hidden (as it has no prompt). But perhaps
> you could even drop it and in the code just test for CONFIG_APM8018X. Or
> are you expecting more users of UART_16550_WORD_ADDRESSABLE?
>
At this moment, it is only APM8018X SOC expects this. I am not sure about
more users of  UART_16550_WORD_ADDRESSABLE.  I will try to eliminate it or
make it as a run time selection.

>
> > [...]
>
>
> Paul Bolle
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>

[-- Attachment #2: Type: text/html, Size: 8179 bytes --]

^ permalink raw reply

* [PATCH 0/6] ppc time fixes
From: Anton Blanchard @ 2011-11-24  6:07 UTC (permalink / raw)
  To: benh, paulus, johnstul, miltonm; +Cc: linuxppc-dev

Here is a roll up of various time fixes I have pending.

Anton

^ permalink raw reply

* [PATCH 1/6] powerpc/time: Handle wrapping of decrementer
From: Anton Blanchard @ 2011-11-24  6:07 UTC (permalink / raw)
  To: benh, paulus, johnstul, miltonm; +Cc: linuxppc-dev
In-Reply-To: <20111124060716.362614789@samba.org>

When re-enabling interrupts we have code to handle edge sensitive
decrementers by resetting the decrementer to 1 whenever it is negative.
If interrupts were disabled long enough that the decrementer wrapped to
positive we do nothing. This means interrupts can be delayed for a long
time until it finally goes negative again.

While we hope interrupts are never be disabled long enough for the
decrementer to go positive, we have a very good test team that can
drive any kernel into the ground. The softlockup data we get back
from these fails could be seconds in the future, completely missing
the cause of the lockup.

We already keep track of the timebase of the next event so use that
to work out if we should trigger a decrementer exception.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: stable@kernel.org
---

- I'd like to get this into -stable if possible since the reports are
  coming in on 3.0 and 3.1. It needs some solid review though.

- This has the unfortunate side effect of forcing arch_local_irq_restore
  to create a stack frame, but I will try to optimise that in a subsequent
  patch.

Index: linux-build/arch/powerpc/include/asm/time.h
===================================================================
--- linux-build.orig/arch/powerpc/include/asm/time.h	2011-11-17 10:04:16.543137415 +1100
+++ linux-build/arch/powerpc/include/asm/time.h	2011-11-17 13:19:47.831758211 +1100
@@ -219,5 +219,7 @@ DECLARE_PER_CPU(struct cpu_usage, cpu_us
 extern void secondary_cpu_time_init(void);
 extern void iSeries_time_init_early(void);
 
+extern void decrementer_check_overflow(void);
+
 #endif /* __KERNEL__ */
 #endif /* __POWERPC_TIME_H */
Index: linux-build/arch/powerpc/kernel/irq.c
===================================================================
--- linux-build.orig/arch/powerpc/kernel/irq.c	2011-11-17 10:04:16.551137554 +1100
+++ linux-build/arch/powerpc/kernel/irq.c	2011-11-17 14:23:10.834514143 +1100
@@ -164,16 +164,13 @@ notrace void arch_local_irq_restore(unsi
 	 */
 	local_paca->hard_enabled = en;
 
-#ifndef CONFIG_BOOKE
-	/* On server, re-trigger the decrementer if it went negative since
-	 * some processors only trigger on edge transitions of the sign bit.
-	 *
-	 * BookE has a level sensitive decrementer (latches in TSR) so we
-	 * don't need that
+	/*
+	 * Trigger the decrementer if we have a pending event. Some processors
+	 * only trigger on edge transitions of the sign bit. We might also
+	 * have disabled interrupts long enough that the decrementer wrapped
+	 * to positive.
 	 */
-	if ((int)mfspr(SPRN_DEC) < 0)
-		mtspr(SPRN_DEC, 1);
-#endif /* CONFIG_BOOKE */
+	decrementer_check_overflow();
 
 	/*
 	 * Force the delivery of pending soft-disabled interrupts on PS3.
Index: linux-build/arch/powerpc/kernel/time.c
===================================================================
--- linux-build.orig/arch/powerpc/kernel/time.c	2011-11-17 10:04:16.559137691 +1100
+++ linux-build/arch/powerpc/kernel/time.c	2011-11-17 13:19:49.415785997 +1100
@@ -889,6 +889,15 @@ static void __init clocksource_init(void
 	       clock->name, clock->mult, clock->shift);
 }
 
+void decrementer_check_overflow(void)
+{
+	u64 now = get_tb_or_rtc();
+	struct decrementer_clock *decrementer = &__get_cpu_var(decrementers);
+
+	if (now >= decrementer->next_tb)
+		set_dec(1);
+}
+
 static int decrementer_set_next_event(unsigned long evt,
 				      struct clock_event_device *dev)
 {

^ permalink raw reply

* [PATCH 2/6] powerpc/time: Use clockevents_calc_mult_shift
From: Anton Blanchard @ 2011-11-24  6:07 UTC (permalink / raw)
  To: benh, paulus, johnstul, miltonm; +Cc: linuxppc-dev
In-Reply-To: <20111124060716.362614789@samba.org>

We can use clockevents_calc_mult_shift instead of doing all
the work ourselves.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: linux-build/arch/powerpc/kernel/time.c
===================================================================
--- linux-build.orig/arch/powerpc/kernel/time.c	2011-11-17 10:11:49.035001617 +1100
+++ linux-build/arch/powerpc/kernel/time.c	2011-11-17 10:11:51.175038860 +1100
@@ -112,8 +112,6 @@ static void decrementer_set_mode(enum cl
 static struct clock_event_device decrementer_clockevent = {
        .name           = "decrementer",
        .rating         = 200,
-       .shift          = 0,	/* To be filled in */
-       .mult           = 0,	/* To be filled in */
        .irq            = 0,
        .set_next_event = decrementer_set_next_event,
        .set_mode       = decrementer_set_mode,
@@ -913,31 +911,6 @@ static void decrementer_set_mode(enum cl
 		decrementer_set_next_event(DECREMENTER_MAX, dev);
 }
 
-static inline uint64_t div_sc64(unsigned long ticks, unsigned long nsec,
-				int shift)
-{
-	uint64_t tmp = ((uint64_t)ticks) << shift;
-
-	do_div(tmp, nsec);
-	return tmp;
-}
-
-static void __init setup_clockevent_multiplier(unsigned long hz)
-{
-	u64 mult, shift = 32;
-
-	while (1) {
-		mult = div_sc64(hz, NSEC_PER_SEC, shift);
-		if (mult && (mult >> 32UL) == 0UL)
-			break;
-
-		shift--;
-	}
-
-	decrementer_clockevent.shift = shift;
-	decrementer_clockevent.mult = mult;
-}
-
 static void register_decrementer_clockevent(int cpu)
 {
 	struct clock_event_device *dec = &per_cpu(decrementers, cpu).event;
@@ -955,7 +928,8 @@ static void __init init_decrementer_cloc
 {
 	int cpu = smp_processor_id();
 
-	setup_clockevent_multiplier(ppc_tb_freq);
+	clockevents_calc_mult_shift(&decrementer_clockevent, ppc_tb_freq, 4);
+
 	decrementer_clockevent.max_delta_ns =
 		clockevent_delta2ns(DECREMENTER_MAX, &decrementer_clockevent);
 	decrementer_clockevent.min_delta_ns =

^ permalink raw reply

* [PATCH 3/6] powerpc/time: Use clocksource_register_hz
From: Anton Blanchard @ 2011-11-24  6:07 UTC (permalink / raw)
  To: benh, paulus, johnstul, miltonm; +Cc: linuxppc-dev
In-Reply-To: <20111124060716.362614789@samba.org>

Use clocksource_register_hz which calculates the shift/mult
factors for us. Also remove the shift = 22 assumption in
vsyscall_update - thanks to Paul Mackerras and John Stultz for
catching that.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: linux-build/arch/powerpc/kernel/time.c
===================================================================
--- linux-build.orig/arch/powerpc/kernel/time.c	2011-11-17 10:11:51.175038860 +1100
+++ linux-build/arch/powerpc/kernel/time.c	2011-11-17 10:11:55.547114957 +1100
@@ -86,8 +86,6 @@ static struct clocksource clocksource_rt
 	.rating       = 400,
 	.flags        = CLOCK_SOURCE_IS_CONTINUOUS,
 	.mask         = CLOCKSOURCE_MASK(64),
-	.shift        = 22,
-	.mult         = 0,	/* To be filled in */
 	.read         = rtc_read,
 };
 
@@ -97,8 +95,6 @@ static struct clocksource clocksource_ti
 	.rating       = 400,
 	.flags        = CLOCK_SOURCE_IS_CONTINUOUS,
 	.mask         = CLOCKSOURCE_MASK(64),
-	.shift        = 22,
-	.mult         = 0,	/* To be filled in */
 	.read         = timebase_read,
 };
 
@@ -822,9 +818,8 @@ void update_vsyscall(struct timespec *wa
 	++vdso_data->tb_update_count;
 	smp_mb();
 
-	/* XXX this assumes clock->shift == 22 */
-	/* 4611686018 ~= 2^(20+64-22) / 1e9 */
-	new_tb_to_xs = (u64) mult * 4611686018ULL;
+	/* 19342813113834067 ~= 2^(20+64) / 1e9 */
+	new_tb_to_xs = (u64) mult * (19342813113834067ULL >> clock->shift);
 	new_stamp_xsec = (u64) wall_time->tv_nsec * XSEC_PER_SEC;
 	do_div(new_stamp_xsec, 1000000000);
 	new_stamp_xsec += (u64) wall_time->tv_sec * XSEC_PER_SEC;
@@ -875,9 +870,7 @@ static void __init clocksource_init(void
 	else
 		clock = &clocksource_timebase;
 
-	clock->mult = clocksource_hz2mult(tb_ticks_per_sec, clock->shift);
-
-	if (clocksource_register(clock)) {
+	if (clocksource_register_hz(clock, tb_ticks_per_sec)) {
 		printk(KERN_ERR "clocksource: %s is already registered\n",
 		       clock->name);
 		return;

^ permalink raw reply

* [PATCH 4/6] powerpc/time: Remove unnecessary sanity check of decrementer expiration
From: Anton Blanchard @ 2011-11-24  6:07 UTC (permalink / raw)
  To: benh, paulus, johnstul, miltonm; +Cc: linuxppc-dev
In-Reply-To: <20111124060716.362614789@samba.org>

The clockevents code uses max_delta_ns to avoid calling a
clockevent with too large a value.

Remove the redundant version of this in the timer_interrupt
code.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: linux-build/arch/powerpc/kernel/time.c
===================================================================
--- linux-build.orig/arch/powerpc/kernel/time.c	2011-11-17 10:12:28.891690395 +1100
+++ linux-build/arch/powerpc/kernel/time.c	2011-11-17 10:13:54.241143987 +1100
@@ -572,7 +572,6 @@ void timer_interrupt(struct pt_regs * re
 	struct pt_regs *old_regs;
 	struct decrementer_clock *decrementer =  &__get_cpu_var(decrementers);
 	struct clock_event_device *evt = &decrementer->event;
-	u64 now;
 
 	/* Ensure a positive value is written to the decrementer, or else
 	 * some CPUs will continue to take decrementer exceptions.
@@ -607,16 +606,9 @@ void timer_interrupt(struct pt_regs * re
 		get_lppaca()->int_dword.fields.decr_int = 0;
 #endif
 
-	now = get_tb_or_rtc();
-	if (now >= decrementer->next_tb) {
-		decrementer->next_tb = ~(u64)0;
-		if (evt->event_handler)
-			evt->event_handler(evt);
-	} else {
-		now = decrementer->next_tb - now;
-		if (now <= DECREMENTER_MAX)
-			set_dec((int)now);
-	}
+	decrementer->next_tb = ~(u64)0;
+	if (evt->event_handler)
+		evt->event_handler(evt);
 
 #ifdef CONFIG_PPC_ISERIES
 	if (firmware_has_feature(FW_FEATURE_ISERIES) && hvlpevent_is_pending())

^ permalink raw reply

* [PATCH 5/6] powerpc/time: Fix some style issues
From: Anton Blanchard @ 2011-11-24  6:07 UTC (permalink / raw)
  To: benh, paulus, johnstul, miltonm; +Cc: linuxppc-dev
In-Reply-To: <20111124060716.362614789@samba.org>

Fix some formatting issues and use the DECREMENTER_MAX
define instead of 0x7fffffff.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: linux-build/arch/powerpc/kernel/time.c
===================================================================
--- linux-build.orig/arch/powerpc/kernel/time.c	2011-11-24 16:49:25.853715846 +1100
+++ linux-build/arch/powerpc/kernel/time.c	2011-11-24 16:51:04.651432999 +1100
@@ -106,12 +106,12 @@ static void decrementer_set_mode(enum cl
 				 struct clock_event_device *dev);
 
 static struct clock_event_device decrementer_clockevent = {
-       .name           = "decrementer",
-       .rating         = 200,
-       .irq            = 0,
-       .set_next_event = decrementer_set_next_event,
-       .set_mode       = decrementer_set_mode,
-       .features       = CLOCK_EVT_FEAT_ONESHOT,
+	.name           = "decrementer",
+	.rating         = 200,
+	.irq            = 0,
+	.set_next_event = decrementer_set_next_event,
+	.set_mode       = decrementer_set_mode,
+	.features       = CLOCK_EVT_FEAT_ONESHOT,
 };
 
 struct decrementer_clock {
@@ -435,7 +435,7 @@ EXPORT_SYMBOL(profile_pc);
 /* 
  * This function recalibrates the timebase based on the 49-bit time-of-day
  * value in the Titan chip.  The Titan is much more accurate than the value
- * returned by the service processor for the timebase frequency.  
+ * returned by the service processor for the timebase frequency.
  */
 
 static int __init iSeries_tb_recal(void)
@@ -636,9 +636,9 @@ static void generic_suspend_disable_irqs
 	 * with suspending.
 	 */
 
-	set_dec(0x7fffffff);
+	set_dec(DECREMENTER_MAX);
 	local_irq_disable();
-	set_dec(0x7fffffff);
+	set_dec(DECREMENTER_MAX);
 }
 
 static void generic_suspend_enable_irqs(void)
@@ -982,10 +982,10 @@ void __init time_init(void)
 	boot_tb = get_tb_or_rtc();
 
 	/* If platform provided a timezone (pmac), we correct the time */
-        if (timezone_offset) {
+	if (timezone_offset) {
 		sys_tz.tz_minuteswest = -timezone_offset / 60;
 		sys_tz.tz_dsttime = 0;
-        }
+	}
 
 	vdso_data->tb_update_count = 0;
 	vdso_data->tb_ticks_per_sec = tb_ticks_per_sec;

^ permalink raw reply

* [PATCH 6/6] powerpc/time: Optimise decrementer_check_overflow
From: Anton Blanchard @ 2011-11-24  6:07 UTC (permalink / raw)
  To: benh, paulus, johnstul, miltonm; +Cc: linuxppc-dev
In-Reply-To: <20111124060716.362614789@samba.org>

decrementer_check_overflow is called from arch_local_irq_restore so
we want to make it as light weight as possible. As such, turn
decrementer_check_overflow into an inline function.

To avoid a circular mess of includes, separate out the two components
of struct decrementer_clock and keep the struct clock_event_device
part local to time.c.

The fast path improves from:

arch_local_irq_restore
     0:       mflr    r0
     4:       std     r0,16(r1)
     8:       stdu    r1,-112(r1)
     c:       stb     r3,578(r13)
    10:       cmpdi   cr7,r3,0
    14:       beq-    cr7,24 <.arch_local_irq_restore+0x24>
...
    24:       addi    r1,r1,112
    28:       ld      r0,16(r1)
    2c:       mtlr    r0
    30:       blr

to:

arch_local_irq_restore
    0:       std     r30,-16(r1)
    4:       ld      r30,0(r2)
    8:       stb     r3,578(r13)
    c:       cmpdi   cr7,r3,0
   10:       beq-    cr7,6c <.arch_local_irq_restore+0x6c>
...
   6c:       ld      r30,-16(r1)
   70:       blr

Unfortunately we still setup a local TOC (due to -mminimal-toc). Yet
another sign we should be moving to -mcmodel=medium.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: linux-build/arch/powerpc/kernel/time.c
===================================================================
--- linux-build.orig/arch/powerpc/kernel/time.c	2011-11-17 13:07:26.638774436 +1100
+++ linux-build/arch/powerpc/kernel/time.c	2011-11-17 13:13:22.409001783 +1100
@@ -114,12 +114,8 @@ static struct clock_event_device decreme
 	.features	= CLOCK_EVT_FEAT_ONESHOT,
 };
 
-struct decrementer_clock {
-	struct clock_event_device event;
-	u64 next_tb;
-};
-
-static DEFINE_PER_CPU(struct decrementer_clock, decrementers);
+DEFINE_PER_CPU(u64, decrementers_next_tb);
+static DEFINE_PER_CPU(struct clock_event_device, decrementers);
 
 #ifdef CONFIG_PPC_ISERIES
 static unsigned long __initdata iSeries_recal_titan;
@@ -570,8 +566,8 @@ void arch_irq_work_raise(void)
 void timer_interrupt(struct pt_regs * regs)
 {
 	struct pt_regs *old_regs;
-	struct decrementer_clock *decrementer =  &__get_cpu_var(decrementers);
-	struct clock_event_device *evt = &decrementer->event;
+	u64 *next_tb = &__get_cpu_var(decrementers_next_tb);
+	struct clock_event_device *evt = &__get_cpu_var(decrementers);
 
 	/* Ensure a positive value is written to the decrementer, or else
 	 * some CPUs will continue to take decrementer exceptions.
@@ -606,7 +602,7 @@ void timer_interrupt(struct pt_regs * re
 		get_lppaca()->int_dword.fields.decr_int = 0;
 #endif
 
-	decrementer->next_tb = ~(u64)0;
+	*next_tb = ~(u64)0;
 	if (evt->event_handler)
 		evt->event_handler(evt);
 
@@ -872,19 +868,10 @@ static void __init clocksource_init(void
 	       clock->name, clock->mult, clock->shift);
 }
 
-void decrementer_check_overflow(void)
-{
-	u64 now = get_tb_or_rtc();
-	struct decrementer_clock *decrementer = &__get_cpu_var(decrementers);
-
-	if (now >= decrementer->next_tb)
-		set_dec(1);
-}
-
 static int decrementer_set_next_event(unsigned long evt,
 				      struct clock_event_device *dev)
 {
-	__get_cpu_var(decrementers).next_tb = get_tb_or_rtc() + evt;
+	__get_cpu_var(decrementers_next_tb) = get_tb_or_rtc() + evt;
 	set_dec(evt);
 	return 0;
 }
@@ -898,7 +885,7 @@ static void decrementer_set_mode(enum cl
 
 static void register_decrementer_clockevent(int cpu)
 {
-	struct clock_event_device *dec = &per_cpu(decrementers, cpu).event;
+	struct clock_event_device *dec = &per_cpu(decrementers, cpu);
 
 	*dec = decrementer_clockevent;
 	dec->cpumask = cpumask_of(cpu);
Index: linux-build/arch/powerpc/include/asm/time.h
===================================================================
--- linux-build.orig/arch/powerpc/include/asm/time.h	2011-11-17 13:07:30.438840750 +1100
+++ linux-build/arch/powerpc/include/asm/time.h	2011-11-17 13:13:05.492705459 +1100
@@ -219,7 +219,7 @@ DECLARE_PER_CPU(struct cpu_usage, cpu_us
 extern void secondary_cpu_time_init(void);
 extern void iSeries_time_init_early(void);
 
-extern void decrementer_check_overflow(void);
+DECLARE_PER_CPU(u64, decrementers_next_tb);
 
 #endif /* __KERNEL__ */
 #endif /* __POWERPC_TIME_H */
Index: linux-build/arch/powerpc/kernel/irq.c
===================================================================
--- linux-build.orig/arch/powerpc/kernel/irq.c	2011-11-17 13:07:26.662774855 +1100
+++ linux-build/arch/powerpc/kernel/irq.c	2011-11-17 13:15:02.038747391 +1100
@@ -115,6 +115,15 @@ static inline notrace void set_soft_enab
 	: : "r" (enable), "i" (offsetof(struct paca_struct, soft_enabled)));
 }
 
+static inline notrace void decrementer_check_overflow(void)
+{
+	u64 now = get_tb_or_rtc();
+	u64 *next_tb = &__get_cpu_var(decrementers_next_tb);
+
+	if (now >= *next_tb)
+		set_dec(1);
+}
+
 notrace void arch_local_irq_restore(unsigned long en)
 {
 	/*

^ permalink raw reply

* Re: [PATCH 2/6] powerpc/time: Use clockevents_calc_mult_shift
From: Kumar Gala @ 2011-11-24  6:25 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: paulus, linuxppc-dev, miltonm, johnstul
In-Reply-To: <20111124060847.198884481@samba.org>


On Nov 24, 2011, at 12:07 AM, Anton Blanchard wrote:

> We can use clockevents_calc_mult_shift instead of doing all
> the work ourselves.
>=20
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>=20
> Index: linux-build/arch/powerpc/kernel/time.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- linux-build.orig/arch/powerpc/kernel/time.c	2011-11-17 =
10:11:49.035001617 +1100
> +++ linux-build/arch/powerpc/kernel/time.c	2011-11-17 =
10:11:51.175038860 +1100
> @@ -112,8 +112,6 @@ static void decrementer_set_mode(enum cl
> static struct clock_event_device decrementer_clockevent =3D {
>        .name           =3D "decrementer",
>        .rating         =3D 200,
> -       .shift          =3D 0,	/* To be filled in */
> -       .mult           =3D 0,	/* To be filled in */
>        .irq            =3D 0,
>        .set_next_event =3D decrementer_set_next_event,
>        .set_mode       =3D decrementer_set_mode,
> @@ -913,31 +911,6 @@ static void decrementer_set_mode(enum cl
> 		decrementer_set_next_event(DECREMENTER_MAX, dev);
> }
>=20
> -static inline uint64_t div_sc64(unsigned long ticks, unsigned long =
nsec,
> -				int shift)
> -{
> -	uint64_t tmp =3D ((uint64_t)ticks) << shift;
> -
> -	do_div(tmp, nsec);
> -	return tmp;
> -}
> -
> -static void __init setup_clockevent_multiplier(unsigned long hz)
> -{
> -	u64 mult, shift =3D 32;
> -
> -	while (1) {
> -		mult =3D div_sc64(hz, NSEC_PER_SEC, shift);
> -		if (mult && (mult >> 32UL) =3D=3D 0UL)
> -			break;
> -
> -		shift--;
> -	}
> -
> -	decrementer_clockevent.shift =3D shift;
> -	decrementer_clockevent.mult =3D mult;
> -}
> -
> static void register_decrementer_clockevent(int cpu)
> {
> 	struct clock_event_device *dec =3D &per_cpu(decrementers, =
cpu).event;
> @@ -955,7 +928,8 @@ static void __init init_decrementer_cloc
> {
> 	int cpu =3D smp_processor_id();
>=20
> -	setup_clockevent_multiplier(ppc_tb_freq);
> +	clockevents_calc_mult_shift(&decrementer_clockevent, =
ppc_tb_freq, 4);
> +

Where's this magic 4 come from?

> 	decrementer_clockevent.max_delta_ns =3D
> 		clockevent_delta2ns(DECREMENTER_MAX, =
&decrementer_clockevent);
> 	decrementer_clockevent.min_delta_ns =3D
>=20
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

^ permalink raw reply

* Re: [PATCH V2 1/3] powerpc/83xx: consolidate init_IRQ functions
From: Kumar Gala @ 2011-11-24  6:40 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov; +Cc: Linux PPC Development
In-Reply-To: <1311364544-9413-2-git-send-email-dbaryshkov@gmail.com>


On Jul 22, 2011, at 2:55 PM, Dmitry Eremin-Solenikov wrote:

> On mpc83xx platform nearly all _init_IRQ functions look alike. They =
either
> just setup ipic, or setup ipic and QE PIC. Separate this to special =
functions
> to be either referenced from ppc_md, or called from board file.
>=20
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> arch/powerpc/platforms/83xx/asp834x.c     |   20 +------------
> arch/powerpc/platforms/83xx/km83xx.c      |   33 +--------------------
> arch/powerpc/platforms/83xx/misc.c        |   46 =
+++++++++++++++++++++++++++++
> arch/powerpc/platforms/83xx/mpc830x_rdb.c |   18 +----------
> arch/powerpc/platforms/83xx/mpc831x_rdb.c |   18 +----------
> arch/powerpc/platforms/83xx/mpc832x_mds.c |   30 +------------------
> arch/powerpc/platforms/83xx/mpc832x_rdb.c |   31 +-------------------
> arch/powerpc/platforms/83xx/mpc834x_itx.c |   18 +----------
> arch/powerpc/platforms/83xx/mpc834x_mds.c |   18 +----------
> arch/powerpc/platforms/83xx/mpc836x_mds.c |   30 +------------------
> arch/powerpc/platforms/83xx/mpc836x_rdk.c |   28 +-----------------
> arch/powerpc/platforms/83xx/mpc837x_mds.c |   18 +----------
> arch/powerpc/platforms/83xx/mpc837x_rdb.c |   18 +----------
> arch/powerpc/platforms/83xx/mpc83xx.h     |    9 +++++
> arch/powerpc/platforms/83xx/sbc834x.c     |   20 +------------
> 15 files changed, 68 insertions(+), 287 deletions(-)

applied to next

- k=

^ permalink raw reply

* Re: [PATCH 1/4] powerpc/83xx: consolidate of_platform_bus_probe calls
From: Kumar Gala @ 2011-11-24  6:40 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov; +Cc: linuxppc-dev
In-Reply-To: <1321541330-2330-1-git-send-email-dbaryshkov@gmail.com>


On Nov 17, 2011, at 8:48 AM, Dmitry Eremin-Solenikov wrote:

> 83xx board files have a lot of duplication in
> *_declare_of_platform_devices() functions. Merge that into a single
> function common to most of the boards.
> 
> The only leftover is mpc834x_itx.c board file which explicitly asks for
> fsl,pq2pro-localbus, as corresponding bindings don't provide
> "simple-bus" compatibility in localbus node.
> 
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> arch/powerpc/platforms/83xx/asp834x.c     |   15 +--------------
> arch/powerpc/platforms/83xx/km83xx.c      |   18 +-----------------
> arch/powerpc/platforms/83xx/misc.c        |   17 +++++++++++++++++
> arch/powerpc/platforms/83xx/mpc830x_rdb.c |   13 +------------
> arch/powerpc/platforms/83xx/mpc831x_rdb.c |   14 +-------------
> arch/powerpc/platforms/83xx/mpc832x_mds.c |   18 +-----------------
> arch/powerpc/platforms/83xx/mpc832x_rdb.c |   18 +-----------------
> arch/powerpc/platforms/83xx/mpc834x_itx.c |    3 +--
> arch/powerpc/platforms/83xx/mpc834x_mds.c |   15 +--------------
> arch/powerpc/platforms/83xx/mpc836x_mds.c |   18 +-----------------
> arch/powerpc/platforms/83xx/mpc836x_rdk.c |   11 +----------
> arch/powerpc/platforms/83xx/mpc837x_mds.c |   17 +----------------
> arch/powerpc/platforms/83xx/mpc837x_rdb.c |   18 +-----------------
> arch/powerpc/platforms/83xx/mpc83xx.h     |    1 +
> arch/powerpc/platforms/83xx/sbc834x.c     |   15 +--------------
> 15 files changed, 31 insertions(+), 180 deletions(-)

applied to next

- k

^ permalink raw reply

* Re: [PATCH 2/4] powerpc/83xx: merge PCI bridge additions
From: Kumar Gala @ 2011-11-24  6:40 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov; +Cc: linuxppc-dev
In-Reply-To: <1321541330-2330-2-git-send-email-dbaryshkov@gmail.com>


On Nov 17, 2011, at 8:48 AM, Dmitry Eremin-Solenikov wrote:

> Nearly all mpc83xx-based boards have a common piece of code - one that
> loops over all pci/pcie bridges and registers them. Merge that code into
> a special function common to all boards.
> 
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> arch/powerpc/platforms/83xx/km83xx.c      |    7 +++----
> arch/powerpc/platforms/83xx/misc.c        |   14 ++++++++++++++
> arch/powerpc/platforms/83xx/mpc831x_rdb.c |   11 +----------
> arch/powerpc/platforms/83xx/mpc832x_mds.c |    5 +----
> arch/powerpc/platforms/83xx/mpc832x_rdb.c |    7 ++-----
> arch/powerpc/platforms/83xx/mpc834x_itx.c |    9 +--------
> arch/powerpc/platforms/83xx/mpc834x_mds.c |    9 +--------
> arch/powerpc/platforms/83xx/mpc836x_mds.c |    5 +----
> arch/powerpc/platforms/83xx/mpc836x_rdk.c |    9 +--------
> arch/powerpc/platforms/83xx/mpc837x_mds.c |   11 +----------
> arch/powerpc/platforms/83xx/mpc837x_rdb.c |   11 +----------
> arch/powerpc/platforms/83xx/mpc83xx.h     |    6 ++++++
> arch/powerpc/platforms/83xx/sbc834x.c     |   10 +---------
> 13 files changed, 34 insertions(+), 80 deletions(-)

applied to next

- k

^ permalink raw reply

* Re: [PATCH 4/4] powerpc/83xx: make mpc830x_rdb use mpc83xx_setup_pci
From: Kumar Gala @ 2011-11-24  6:40 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov; +Cc: linuxppc-dev
In-Reply-To: <1321541330-2330-4-git-send-email-dbaryshkov@gmail.com>


On Nov 17, 2011, at 8:48 AM, Dmitry Eremin-Solenikov wrote:

> Traditionally mpc830x_rdb board file searched for mpc8308-pcie devices.
> However both in-kernel dts from the beginning declared those pcie units
> as compatible with mpc8314-pci, which is handled by mpc83xx_setup_pci().
> 
> Drop special handling for mpc8308 and use common function instead.
> 
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> arch/powerpc/platforms/83xx/mpc830x_rdb.c |   12 +-----------
> 1 files changed, 1 insertions(+), 11 deletions(-)

applied to next

- k

^ permalink raw reply

* [PATCH 1/2] powerpc/85xx: Additional consolidate of_platform_bus_probe calls
From: Kumar Gala @ 2011-11-24  7:08 UTC (permalink / raw)
  To: linuxppc-dev

P1010RDB & P1023RDS can use the new mpc85xx_common_publish_devices().
Also move 'fsl,srio' into the list of standard buses.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/platforms/85xx/mpc85xx_common.c |    1 +
 arch/powerpc/platforms/85xx/mpc85xx_mds.c    |    1 -
 arch/powerpc/platforms/85xx/p1010rdb.c       |   15 +++------------
 arch/powerpc/platforms/85xx/p1023_rds.c      |   19 +++----------------
 4 files changed, 7 insertions(+), 29 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/mpc85xx_common.c b/arch/powerpc/platforms/85xx/mpc85xx_common.c
index fe40668..9fef530 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_common.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_common.c
@@ -20,6 +20,7 @@ static struct of_device_id __initdata mpc85xx_common_ids[] = {
 	{ .compatible = "gianfar", },
 	{ .compatible = "fsl,qe", },
 	{ .compatible = "fsl,cpm2", },
+	{ .compatible = "fsl,srio", },
 	{},
 };
 
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 38cb473..495cfd9 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -411,7 +411,6 @@ machine_arch_initcall(mpc8568_mds, board_fixups);
 machine_arch_initcall(mpc8569_mds, board_fixups);
 
 static struct of_device_id mpc85xx_ids[] = {
-	{ .compatible = "fsl,srio", },
 	{ .compatible = "fsl,mpc8548-guts", },
 	{ .compatible = "gpio-leds", },
 	{},
diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c
index d7387fa..2f479f8 100644
--- a/arch/powerpc/platforms/85xx/p1010rdb.c
+++ b/arch/powerpc/platforms/85xx/p1010rdb.c
@@ -28,6 +28,8 @@
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
 
+#include "mpc85xx.h"
+
 void __init p1010_rdb_pic_init(void)
 {
 	struct mpic *mpic;
@@ -81,18 +83,7 @@ static void __init p1010_rdb_setup_arch(void)
 	printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n");
 }
 
-static struct of_device_id __initdata p1010rdb_ids[] = {
-	{ .type = "soc", },
-	{ .compatible = "soc", },
-	{ .compatible = "simple-bus", },
-	{},
-};
-
-static int __init p1010rdb_publish_devices(void)
-{
-	return of_platform_bus_probe(NULL, p1010rdb_ids, NULL);
-}
-machine_device_initcall(p1010_rdb, p1010rdb_publish_devices);
+machine_device_initcall(p1010_rdb, mpc85xx_common_publish_devices);
 machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier);
 
 /*
diff --git a/arch/powerpc/platforms/85xx/p1023_rds.c b/arch/powerpc/platforms/85xx/p1023_rds.c
index 835e0b3..e76c4dc 100644
--- a/arch/powerpc/platforms/85xx/p1023_rds.c
+++ b/arch/powerpc/platforms/85xx/p1023_rds.c
@@ -34,6 +34,8 @@
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
 
+#include "mpc85xx.h"
+
 /* ************************************************************************
  *
  * Setup the architecture
@@ -92,22 +94,7 @@ static void __init mpc85xx_rds_setup_arch(void)
 #endif
 }
 
-static struct of_device_id p1023_ids[] = {
-	{ .type = "soc", },
-	{ .compatible = "soc", },
-	{ .compatible = "simple-bus", },
-	{},
-};
-
-
-static int __init p1023_publish_devices(void)
-{
-	of_platform_bus_probe(NULL, p1023_ids, NULL);
-
-	return 0;
-}
-
-machine_device_initcall(p1023_rds, p1023_publish_devices);
+machine_device_initcall(p1023_rds, mpc85xx_common_publish_devices);
 
 static void __init mpc85xx_rds_pic_init(void)
 {
-- 
1.7.3.4

^ permalink raw reply related

* [PATCH 2/2] powerpc/85xx: Renamed mpc85xx_common.c to common.c
From: Kumar Gala @ 2011-11-24  7:08 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1322118527-14348-1-git-send-email-galak@kernel.crashing.org>

The file name is already scoped by the directory its in.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/platforms/85xx/Makefile               |    2 +-
 .../platforms/85xx/{mpc85xx_common.c => common.c}  |    0
 2 files changed, 1 insertions(+), 1 deletions(-)
 rename arch/powerpc/platforms/85xx/{mpc85xx_common.c => common.c} (100%)

diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index b6beec8..9cb2d43 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -3,7 +3,7 @@
 #
 obj-$(CONFIG_SMP) += smp.o
 
-obj-y += mpc85xx_common.o
+obj-y += common.o
 
 obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
 obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_common.c b/arch/powerpc/platforms/85xx/common.c
similarity index 100%
rename from arch/powerpc/platforms/85xx/mpc85xx_common.c
rename to arch/powerpc/platforms/85xx/common.c
-- 
1.7.3.4

^ permalink raw reply related

* Re: [PATCH] powerpc/85xx: do not force PHYS_64BIT on the P1022DS
From: Kumar Gala @ 2011-11-24  7:12 UTC (permalink / raw)
  To: Timur Tabi; +Cc: linuxppc-dev
In-Reply-To: <1320349099-22594-1-git-send-email-timur@freescale.com>


On Nov 3, 2011, at 2:38 PM, Timur Tabi wrote:

> Kconfig option PHYS_64BIT sets the size of phys_addr_t to 64 bits, =
which
> allows support for a 36-bit physical address space.  With this option, =
the
> kernel can support more than 2GB of RAM, but the larger address size
> impacts performance slightly.
>=20
> By including "select PHYS_64BIT" in the Kconfig for a particular =
board,
> that option is forced enabled, and it becomes impossible to create a =
32-bit
> kernel.  Instead, we should depend on the defconfig to enable this =
option.
> We still build a 36-bit kernel by default, and we also allow users to =
build
> 32-bit kernels if they really want.
>=20
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
> arch/powerpc/platforms/85xx/Kconfig |    1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)

If you want me to apply this please also provided a 32-bit .dts for =
p1022ds.  This should be pretty trivial based on my recent .dts =
cleanups.

- k=

^ permalink raw reply

* Re: [PATCH 1/6] powerpc/85xx: separate cpm2 pic init
From: Kumar Gala @ 2011-11-24  7:15 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov; +Cc: linuxppc-dev
In-Reply-To: <1321552581-29773-1-git-send-email-dbaryshkov@gmail.com>


On Nov 17, 2011, at 11:56 AM, Dmitry Eremin-Solenikov wrote:

> Separate handling of CPM2 PIC initialization to =
mpc85xx_cpm2_pic_init()
> function.
>=20
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> arch/powerpc/platforms/85xx/Makefile         |    2 +
> arch/powerpc/platforms/85xx/ksi8560.c        |   29 +--------------
> arch/powerpc/platforms/85xx/mpc8536_ds.c     |    2 +
> arch/powerpc/platforms/85xx/mpc85xx.h        |    9 +++++
> arch/powerpc/platforms/85xx/mpc85xx_ads.c    |   34 ++----------------
> arch/powerpc/platforms/85xx/mpc85xx_cds.c    |    2 +
> arch/powerpc/platforms/85xx/mpc85xx_common.c |   49 =
++++++++++++++++++++++++++
> arch/powerpc/platforms/85xx/mpc85xx_ds.c     |    2 +
> arch/powerpc/platforms/85xx/mpc85xx_mds.c    |    2 +
> arch/powerpc/platforms/85xx/mpc85xx_rdb.c    |    2 +
> arch/powerpc/platforms/85xx/p1022_ds.c       |    2 +
> arch/powerpc/platforms/85xx/sbc8560.c        |   34 ++----------------
> arch/powerpc/platforms/85xx/socrates.c       |    1 +
> arch/powerpc/platforms/85xx/stx_gp3.c        |   37 =
++------------------
> arch/powerpc/platforms/85xx/tqm85xx.c        |   37 =
++------------------
> arch/powerpc/platforms/85xx/xes_mpc85xx.c    |    2 +
> 16 files changed, 89 insertions(+), 157 deletions(-)
> create mode 100644 arch/powerpc/platforms/85xx/mpc85xx.h
> create mode 100644 arch/powerpc/platforms/85xx/mpc85xx_common.c

applied to next

- k=

^ permalink raw reply

* Re: [PATCH 2/6] powerpc/85xx: consolidate of_platform_bus_probe calls
From: Kumar Gala @ 2011-11-24  7:15 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov; +Cc: linuxppc-dev
In-Reply-To: <1321552581-29773-2-git-send-email-dbaryshkov@gmail.com>


On Nov 17, 2011, at 11:56 AM, Dmitry Eremin-Solenikov wrote:

> 85xx board files have a lot of duplication in *_publish_devices()/
> *_declare_of_platform_devices() functions. Merge that into a single
> function common to most of the boards.
>=20
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> arch/powerpc/platforms/85xx/ksi8560.c        |   17 +---------
> arch/powerpc/platforms/85xx/mpc8536_ds.c     |   14 +-------
> arch/powerpc/platforms/85xx/mpc85xx.h        |    2 +
> arch/powerpc/platforms/85xx/mpc85xx_ads.c    |   18 +----------
> arch/powerpc/platforms/85xx/mpc85xx_cds.c    |   14 +-------
> arch/powerpc/platforms/85xx/mpc85xx_common.c |   16 +++++++++
> arch/powerpc/platforms/85xx/mpc85xx_ds.c     |   18 ++---------
> arch/powerpc/platforms/85xx/mpc85xx_mds.c    |   44 =
+------------------------
> arch/powerpc/platforms/85xx/mpc85xx_rdb.c    |   16 +--------
> arch/powerpc/platforms/85xx/p1022_ds.c       |    5 +--
> arch/powerpc/platforms/85xx/sbc8548.c        |   18 ++---------
> arch/powerpc/platforms/85xx/sbc8560.c        |   18 +----------
> arch/powerpc/platforms/85xx/socrates.c       |   12 +------
> arch/powerpc/platforms/85xx/stx_gp3.c        |   14 +-------
> arch/powerpc/platforms/85xx/tqm85xx.c        |   14 +-------
> arch/powerpc/platforms/85xx/xes_mpc85xx.c    |   18 ++---------
> 16 files changed, 40 insertions(+), 218 deletions(-)

applied to next

- k=

^ permalink raw reply

* Re: [PATCH 8/9] arch/powerpc/sysdev/ehv_pic.c: add missing kfree
From: Kumar Gala @ 2011-11-24  7:16 UTC (permalink / raw)
  To: Julia Lawall
  Cc: kernel-janitors, linux-kernel, Ashish Kalra, Paul Mackerras,
	linuxppc-dev, Timur Tabi
In-Reply-To: <1312802283-9107-8-git-send-email-julia@diku.dk>


On Aug 8, 2011, at 6:18 AM, Julia Lawall wrote:

> From: Julia Lawall <julia@diku.dk>
> 
> At this point, ehv_pic has been allocated but not stored anywhere, so it
> should be freed before leaving the function.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @exists@
> local idexpression x;
> statement S,S1;
> expression E;
> identifier fl;
> expression *ptr != NULL;
> @@
> 
> x = \(kmalloc\|kzalloc\|kcalloc\)(...);
> ...
> if (x == NULL) S
> <... when != x
>     when != if (...) { <+...kfree(x)...+> }
>     when any
>     when != true x == NULL
> x->fl
> ...>
> (
> if (x == NULL) S1
> |
> if (...) { ... when != x
>               when forall
> (
> return \(0\|<+...x...+>\|ptr\);
> |
> * return ...;
> )
> }
> )
> // </smpl>
> 
> Signed-off-by: Julia Lawall <julia@diku.dk>
> 
> ---
> arch/powerpc/sysdev/ehv_pic.c |    1 +
> 1 file changed, 1 insertion(+)

applied to next

- k

^ permalink raw reply

* Re: [PATCH] SPI: fix build with CONFIG_SPI_FSL_ESPI=m
From: Kumar Gala @ 2011-11-24  7:22 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: spi-devel-general, Jiri Slaby, linuxppc-dev, linux-kernel
In-Reply-To: <4E5369A0.4080701@gmail.com>


On Aug 23, 2011, at 3:49 AM, Jiri Slaby wrote:

> On 08/23/2011 09:59 AM, Jiri Slaby wrote:
>> When spi_fsl_espi is chosen to be built as a module, there is a build
>> error because we test only CONFIG_SPI_FSL_ESPI in declaration of
>> struct mpc8xxx_spi in drivers/spi/spi_fsl_lib.h.
>>=20
>> We need to add a test for CONFIG_SPI_FSL_ESPI_MODULE too.
>>=20
>> The error looks like:
>> drivers/spi/spi_fsl_espi.c: In function 'fsl_espi_bufs':
>> drivers/spi/spi_fsl_espi.c:232: error: 'struct mpc8xxx_spi' has no =
member named 'len'
>> ...
>>=20
>> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
>> ---
>> drivers/spi/spi-fsl-lib.h |    2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>=20
>> diff --git a/drivers/spi/spi-fsl-lib.h b/drivers/spi/spi-fsl-lib.h
>> index cbe881b..97968de 100644
>> --- a/drivers/spi/spi-fsl-lib.h
>> +++ b/drivers/spi/spi-fsl-lib.h
>> @@ -28,7 +28,7 @@ struct mpc8xxx_spi {
>> 	/* rx & tx bufs from the spi_transfer */
>> 	const void *tx;
>> 	void *rx;
>> -#ifdef CONFIG_SPI_FSL_ESPI
>> +#if defined(CONFIG_SPI_FSL_ESPI) || =
defined(CONFIG_SPI_FSL_ESPI_MODULE)
>> 	int len;
>> #endif
>=20
> Oh, and there are still link errors:
> ERROR: "mpc8xxx_spi_tx_buf_u32" [drivers/spi/spi_fsl_spi.ko] =
undefined!
> ERROR: "mpc8xxx_spi_rx_buf_u32" [drivers/spi/spi_fsl_spi.ko] =
undefined!
> ERROR: "mpc8xxx_spi_tx_buf_u16" [drivers/spi/spi_fsl_spi.ko] =
undefined!
> ERROR: "mpc8xxx_spi_rx_buf_u16" [drivers/spi/spi_fsl_spi.ko] =
undefined!
> ERROR: "mpc8xxx_spi_tx_buf_u8" [drivers/spi/spi_fsl_spi.ko] undefined!
> ERROR: "mpc8xxx_spi_rx_buf_u8" [drivers/spi/spi_fsl_spi.ko] undefined!
> ERROR: "of_mpc8xxx_spi_probe" [drivers/spi/spi_fsl_spi.ko] undefined!
> ERROR: "mpc8xxx_spi_strmode" [drivers/spi/spi_fsl_spi.ko] undefined!
> ERROR: "mpc8xxx_spi_probe" [drivers/spi/spi_fsl_spi.ko] undefined!
> ERROR: "mpc8xxx_spi_remove" [drivers/spi/spi_fsl_spi.ko] undefined!
> ERROR: "to_of_pinfo" [drivers/spi/spi_fsl_spi.ko] undefined!
> ERROR: "mpc8xxx_spi_tx_buf_u32" [drivers/spi/spi_fsl_espi.ko] =
undefined!
> ERROR: "mpc8xxx_spi_rx_buf_u32" [drivers/spi/spi_fsl_espi.ko] =
undefined!
> ERROR: "of_mpc8xxx_spi_probe" [drivers/spi/spi_fsl_espi.ko] undefined!
> ERROR: "mpc8xxx_spi_probe" [drivers/spi/spi_fsl_espi.ko] undefined!
> ERROR: "mpc8xxx_spi_remove" [drivers/spi/spi_fsl_espi.ko] undefined!
>=20
> The functions are not exported...
>=20
> Should I export all those or deny CONFIG_SPI_FSL_ESPI=3Dm?

I'd just deny CONFIG_SPI_FSL_ESPI=3Dm, unless you have some need for it =
to be a module.

- k=

^ permalink raw reply

* Re: [git pull] Please pull powerpc.git merge branch (updated)
From: Kumar Gala @ 2011-11-24  7:31 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <alpine.LFD.2.00.1111232302440.20012@right.am.freescale.net>


On Nov 23, 2011, at 11:03 PM, Kumar Gala wrote:

> Ben,
>=20
> A few minor fixes for FSL PPC SoCs to send up to Linus.
>=20
> - k
>=20
> The following changes since commit =
caca6a03d365883564885f2c1da3e88dcf65d139:
>=20
>  Linux 3.2-rc3 (2011-11-23 20:20:28 -0800)
>=20
> are available in the git repository at:
>  git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git merge
>=20
> Kumar Gala (1):
>      powerpc/85xx: Fix compile error on p3060_qds.c
>=20
> Paul Bolle (1):
>      powerpc/p3060qds: Fix select of 'MPC8xxx_GPIO'
>=20
> Roy Zang (1):
>      powerpc/p1023: set IRQ[4:6,11] to active-high level sensitive for =
PCIe
>=20
> arch/powerpc/boot/dts/p1023rds.dts      |   17 +++++++++++++----
> arch/powerpc/platforms/85xx/Kconfig     |    2 +-
> arch/powerpc/platforms/85xx/p3060_qds.c |    2 +-
> 3 files changed, 15 insertions(+), 6 deletions(-)

(updated 'merge' with):

Joakim Tjernlund (1):
      powerpc/qe: Fixup QE_General4 errata

 arch/powerpc/sysdev/qe_lib/qe.c         |    2 +-

- k=

^ permalink raw reply

* RE: [PATCH 3/3] mtd/nand : workaround for Freescale FCM to support large-page Nand chip
From: Li Yang-R58472 @ 2011-11-24  7:37 UTC (permalink / raw)
  To: Liu Shuo-B35362, dwmw2@infradead.org, Artem.Bityutskiy@nokia.com,
	Wood Scott-B07421
  Cc: linuxppc-dev@lists.ozlabs.org, akpm@linux-foundation.org,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
In-Reply-To: <1322095306-13156-3-git-send-email-b35362@freescale.com>

PiBTdWJqZWN0OiBbUEFUQ0ggMy8zXSBtdGQvbmFuZCA6IHdvcmthcm91bmQgZm9yIEZyZWVzY2Fs
ZSBGQ00gdG8gc3VwcG9ydA0KPiBsYXJnZS1wYWdlIE5hbmQgY2hpcA0KPiANCj4gRnJvbTogTGl1
IFNodW8gPGIzNTM2MkBmcmVlc2NhbGUuY29tPg0KPiANCj4gRnJlZXNjYWxlIEZDTSBjb250cm9s
bGVyIGhhcyBhIDJLIHNpemUgbGltaXRhdGlvbiBvZiBidWZmZXIgUkFNLiBJbiBvcmRlcg0KPiB0
byBzdXBwb3J0IHRoZSBOYW5kIGZsYXNoIGNoaXAgd2hvc2UgcGFnZSBzaXplIGlzIGxhcmdlciB0
aGFuIDJLIGJ5dGVzLA0KPiB3ZSByZWFkL3dyaXRlIDJrIGRhdGEgcmVwZWF0ZWRseSBieSBpc3N1
aW5nIEZJUl9PUF9SQi9GSVJfT1BfV0IgYW5kIHNhdmUNCj4gdGhlbSB0byBhIGxhcmdlIGJ1ZmZl
ci4NCj4gDQo+IFNpZ25lZC1vZmYtYnk6IExpdSBTaHVvIDxiMzUzNjJAZnJlZXNjYWxlLmNvbT4N
Cj4gU2lnbmVkLW9mZi1ieTogTGkgWWFuZyA8bGVvbGlAZnJlZXNjYWxlLmNvbT4NCj4gLS0tDQo+
ICBkcml2ZXJzL210ZC9uYW5kL2ZzbF9lbGJjX25hbmQuYyB8ICAyMTENCj4gKysrKysrKysrKysr
KysrKysrKysrKysrKysrKysrKysrKystLS0NCj4gIDEgZmlsZXMgY2hhbmdlZCwgMTk0IGluc2Vy
dGlvbnMoKyksIDE3IGRlbGV0aW9ucygtKQ0KPiANCj4gZGlmZiAtLWdpdCBhL2RyaXZlcnMvbXRk
L25hbmQvZnNsX2VsYmNfbmFuZC5jIGIvZHJpdmVycy9tdGQvbmFuZC9mc2xfZWxiY19uYW5kLmMN
Cj4gaW5kZXggZDYzNGM1Zi4uYzk2ZTcxNCAxMDA2NDQNCj4gLS0tIGEvZHJpdmVycy9tdGQvbmFu
ZC9mc2xfZWxiY19uYW5kLmMNCj4gKysrIGIvZHJpdmVycy9tdGQvbmFuZC9mc2xfZWxiY19uYW5k
LmMNCg0KW3NuaXBdDQoNCj4gK3N0YXRpYyB2b2lkIGlvX3RvX2J1ZmZlcihzdHJ1Y3QgbXRkX2lu
Zm8gKm10ZCwgaW50IHN1YnBhZ2UsIGludCBvb2IpDQo+ICt7DQo+ICsJc3RydWN0IG5hbmRfY2hp
cCAqY2hpcCA9IG10ZC0+cHJpdjsNCj4gKwlzdHJ1Y3QgZnNsX2VsYmNfbXRkICpwcml2ID0gY2hp
cC0+cHJpdjsNCj4gKwlzdHJ1Y3QgZnNsX2VsYmNfZmNtX2N0cmwgKmVsYmNfZmNtX2N0cmwgPSBw
cml2LT5jdHJsLT5uYW5kOw0KPiArCXZvaWQgKnNyYywgKmRzdDsNCj4gKwlpbnQgbGVuID0gKG9v
YiA/IDY0IDogMjA0OCk7DQo+ICsNCj4gKwlpZiAob29iKQ0KPiArCQlkc3QgPSBlbGJjX2ZjbV9j
dHJsLT5idWZmZXIgKyBtdGQtPndyaXRlc2l6ZSArIHN1YnBhZ2UgKiA2NDsNCj4gKwllbHNlDQo+
ICsJCWRzdCA9IGVsYmNfZmNtX2N0cmwtPmJ1ZmZlciArIHN1YnBhZ2UgKiAyMDQ4Ow0KPiArDQo+
ICsJc3JjID0gZWxiY19mY21fY3RybC0+YWRkciArIChvb2IgPyAyMDQ4IDogMCk7DQo+ICsJbWVt
Y3B5X2Zyb21pbyhkc3QsIHNyYywgbGVuKTsNCg0KTWlnaHQgYmUgc2FmZXIgdG8gdXNlIF9tZW1j
cHlfZnJvbWlvKCkNCg0KPiArfQ0KPiArDQo+ICtzdGF0aWMgdm9pZCBidWZmZXJfdG9faW8oc3Ry
dWN0IG10ZF9pbmZvICptdGQsIGludCBzdWJwYWdlLCBpbnQgb29iKQ0KPiArew0KPiArCXN0cnVj
dCBuYW5kX2NoaXAgKmNoaXAgPSBtdGQtPnByaXY7DQo+ICsJc3RydWN0IGZzbF9lbGJjX210ZCAq
cHJpdiA9IGNoaXAtPnByaXY7DQo+ICsJc3RydWN0IGZzbF9lbGJjX2ZjbV9jdHJsICplbGJjX2Zj
bV9jdHJsID0gcHJpdi0+Y3RybC0+bmFuZDsNCj4gKwl2b2lkICpzcmMsICpkc3Q7DQo+ICsJaW50
IGxlbiA9IChvb2IgPyA2NCA6IDIwNDgpOw0KPiArDQo+ICsJaWYgKG9vYikNCj4gKwkJc3JjID0g
ZWxiY19mY21fY3RybC0+YnVmZmVyICsgbXRkLT53cml0ZXNpemUgKyBzdWJwYWdlICogNjQ7DQo+
ICsJZWxzZQ0KPiArCQlzcmMgPSBlbGJjX2ZjbV9jdHJsLT5idWZmZXIgKyBzdWJwYWdlICogMjA0
ODsNCj4gKw0KPiArCWRzdCA9IGVsYmNfZmNtX2N0cmwtPmFkZHIgKyAob29iID8gMjA0OCA6IDAp
Ow0KPiArCW1lbWNweV90b2lvKGRzdCwgc3JjLCBsZW4pOw0KPiArDQo+ICsJLyogU2VlIHRoZSBp
bl84KCkgaW4gZnNsX2VsYmNfd3JpdGVfYnVmKCkgKi8NCj4gKwlpbl84KGVsYmNfZmNtX2N0cmwt
PmFkZHIpOw0KDQpTaG91bGQgYmUgc2FmZXIgdG8gcmVhZCBiYWNrIHRoZSBsYXN0IGNoYXIuDQoN
Ci0gTGVvDQo=

^ permalink raw reply

* Re: [PATCH 3/3] mtd/nand : workaround for Freescale FCM to support large-page Nand chip
From: Artem Bityutskiy @ 2011-11-24  7:41 UTC (permalink / raw)
  To: b35362
  Cc: Artem.Bityutskiy, linuxppc-dev, linux-kernel, linux-mtd,
	scottwood, akpm, dwmw2
In-Reply-To: <1322095306-13156-3-git-send-email-b35362@freescale.com>

[-- Attachment #1: Type: text/plain, Size: 570 bytes --]

On Thu, 2011-11-24 at 08:41 +0800, b35362@freescale.com wrote:
> +               /*
> +                * Freescale FCM controller has a 2K size limitation of buffer
> +                * RAM, so elbc_fcm_ctrl->buffer have to be used if writesize
> +                * of chip is greater than 2048.
> +                * We malloc a large enough buffer (maximum page size is 16K).
> +                */
> +               elbc_fcm_ctrl->buffer = kmalloc(1024 * 16 + 1024, GFP_KERNEL); 

Are there NANDs with 16KiB page size?

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH] powerpc: fixup QE_General4 errata
From: Kumar Gala @ 2011-11-24  7:45 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: linuxppc-dev, Timur Tabi
In-Reply-To: <1314102605-9718-1-git-send-email-Joakim.Tjernlund@transmode.se>



On Aug 23, 2011, at 7:30 AM, Joakim Tjernlund wrote:

> QE_General4 should only round up the divisor iff divisor is > 3.
> Rounding up lower divisors makes the error too big, causing USB
> on MPC832x to fail.
> 
> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> ---
> arch/powerpc/sysdev/qe_lib/qe.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

applied to merge

- k

^ permalink raw reply

* Re: Fix for fsl_upm
From: Kumar Gala @ 2011-11-24  7:46 UTC (permalink / raw)
  To: Rusev; +Cc: Shaohui.Xie, linux-kernel, Shengzhou.Liu, paulus, linuxppc-dev
In-Reply-To: <4EA9683D.8030100@dev.rtsoft.ru>


On Oct 27, 2011, at 9:18 AM, Rusev wrote:

> patch is vs. 2.6.39, yet it applied to 3.1
>=20
>=20
>=20
> Fix of UPM driver for Freescale PowerPC processors
>=20
> If Freescale LBC driver fails to initialise itself from device tree,
> then internal structure is freed only but not NULL-fied.
> As result functions fsl_lbc_find() after checking the structure is not =
NULL are
> trying to access device registers.
>=20
> Signed-off-by: Alexandre Rusev <arusev@dev.rtsoft.ru>=20

applied to next

- k=

^ 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