* 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] 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
* [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
* [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
* 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
* 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 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 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 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
* [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
* [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 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 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 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 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 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
* 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
* Re: [PATCH 2/3] powerpc/85xx: add pixis indirect mode device tree node
From: Kumar Gala @ 2011-11-24 5:16 UTC (permalink / raw)
To: Timur Tabi; +Cc: scottwood, linuxppc-dev
In-Reply-To: <1321638601-6861-2-git-send-email-timur@freescale.com>
On Nov 18, 2011, at 11:50 AM, Timur Tabi wrote:
> The Freescale P1022 has a unique pin muxing "feature" where the DIU =
video
> controller's video signals are muxed with 24 of the local bus address =
signals.
> When the DIU is enabled, the bulk of the local bus is disabled, =
preventing
> access to memory-mapped devices like NOR flash and the pixis FPGA.
>=20
> In this situation, the pixis supports "indirect mode", which allows =
access
> to the pixis itself by reading/writing addresses on specific local bus
> chip selects. CS0 is used to select which pixis register to access, =
and
> CS1 is used to read/write the value.
>=20
> To support this, we introduce another board-control child node of the
> localbus node that contains a 'reg' property for CS0 and CS1. This =
will
> produce the correct physical addresses for CS0 and CS1.
>=20
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
> arch/powerpc/boot/dts/p1022ds.dts | 14 ++++++++++++++
> 1 files changed, 14 insertions(+), 0 deletions(-)
applied to next
- k=
^ permalink raw reply
* Re: [PATCH 1/3] powerpc/85xx: p1022ds: disable the NOR flash node if video is enabled
From: Kumar Gala @ 2011-11-24 5:12 UTC (permalink / raw)
To: Timur Tabi; +Cc: scottwood, linuxppc-dev
In-Reply-To: <1321638601-6861-1-git-send-email-timur@freescale.com>
On Nov 18, 2011, at 11:49 AM, Timur Tabi wrote:
> The Freescale P1022 has a unique pin muxing "feature" where the DIU =
video
> controller's video signals are muxed with 24 of the local bus address =
signals.
> When the DIU is enabled, the bulk of the local bus is disabled, =
preventing
> access to memory-mapped devices like NOR flash and the pixis FPGA.
>=20
> Therefore, if the DIU is going to be enabled, then memory-mapped =
devices on
> the localbus, like NOR flash, need to be disabled.
>=20
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
> arch/powerpc/platforms/85xx/p1022_ds.c | 70 =
++++++++++++++++++++++++++++++++
> 1 files changed, 70 insertions(+), 0 deletions(-)
>=20
> diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c =
b/arch/powerpc/platforms/85xx/p1022_ds.c
> index fda1571..e0280e2 100644
> --- a/arch/powerpc/platforms/85xx/p1022_ds.c
> +++ b/arch/powerpc/platforms/85xx/p1022_ds.c
> @@ -270,6 +270,54 @@ void __init p1022_ds_pic_init(void)
> void __init mpc85xx_smp_init(void);
> #endif
>=20
> +#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
> +
> +/*
> + * Disables a node in the device tree.
> + *
> + * This function is called before kmalloc() is available, and it's =
only called
> + * once, so we instead of allocating the new property object via the =
bootmem
> + * allocator, we just create a static local variable.
> + */
> +static void __init disable_one_node(struct device_node *np)
> +{
> + struct property *old;
> + static struct property new =3D {
> + .name =3D "status",
> + .value =3D "disabled",
> + .length =3D sizeof("disabled"),
> + };
> +
> + old =3D of_find_property(np, new.name, NULL);
> + if (old)
> + prom_update_property(np, &new, old);
> + else
> + prom_add_property(np, &new);
> +}
> +
> +/* TRUE if there is a "video=3Dfslfb" command-line parameter. */
> +static bool fslfb;
> +
> +/*
> + * Search for a "video=3Dfslfb" command-line parameter, and set =
'fslfb' to
> + * true if we find it.
> + *
> + * We need to use early_param() instead of __setup() because the =
normal
> + * __setup() gets called to late. However, early_param() gets called =
very
> + * early, before the device tree is unflattened, so all we can do now =
is set a
> + * global variable. Later on, p1022_ds_setup_arch() will use that =
variable
> + * to determine if we need to update the device tree.
> + */
> +static int __init early_video_setup(char *options)
> +{
> + fslfb =3D (strncmp(options, "fslfb:", 6) =3D=3D 0);
> +
> + return 0;
> +}
> +early_param("video", early_video_setup);
> +
> +#endif
> +
> /*
> * Setup the architecture
> */
> @@ -307,6 +355,28 @@ static void __init p1022_ds_setup_arch(void)
> diu_ops.set_monitor_port =3D p1022ds_set_monitor_port;
> diu_ops.set_pixel_clock =3D p1022ds_set_pixel_clock;
> diu_ops.valid_monitor_port =3D p1022ds_valid_monitor_port;
> +
> + /*
> + * Delete the NOR flash node if there is video=3Dfslfb... =
command-line
> + * parameter. When the DIU is active, NOR flash is unavailable, =
so we
> + * have to delete the node before the MTD driver loads.
> + */
Fix comment, you aren't deleting the node, your marked it disabled.
> + if (fslfb) {
> + struct device_node *np =3D
> + of_find_compatible_node(NULL, NULL, =
"fsl,p1022-elbc");
> +
> + if (np) {
> + np =3D of_find_compatible_node(np, NULL, =
"cfi-flash");
> + if (np) {
> + pr_info("p1022ds: disabling %s node",
> + np->full_name);
> + disable_one_node(np);
> + of_node_put(np);
> + }
> + }
> +
> + }
> +
> #endif
>=20
> #ifdef CONFIG_SMP
> --=20
> 1.7.3.4
>=20
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [PATCH] powerpc/85xx: Add lbc suspend support for PM
From: Kumar Gala @ 2011-11-24 5:04 UTC (permalink / raw)
To: Jia Hongtao; +Cc: B11780, linuxppc-dev
In-Reply-To: <1321856951-10789-1-git-send-email-B38951@freescale.com>
On Nov 21, 2011, at 12:29 AM, Jia Hongtao wrote:
> Power supply for LBC registers is off when system go to deep-sleep =
state.
> We save the values of registers before suspend and restore to =
registers
> after resume.
>=20
> We removed the last two reservation arrays from struct fsl_lbc_regs =
for
> allocating less memory and minimizing the memcpy size.
>=20
> Signed-off-by: Jiang Yutang <b14898@freescale.com>
> Signed-off-by: Jia Hongtao <B38951@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
> arch/powerpc/include/asm/fsl_lbc.h | 7 +++++--
> arch/powerpc/sysdev/fsl_lbc.c | 36 =
++++++++++++++++++++++++++++++++++++
> 2 files changed, 41 insertions(+), 2 deletions(-)
applied to next
- k=
^ permalink raw reply
* Re: [PATCH] Do not hide resource for pci/pcie when configured as Agent/EP
From: Kumar Gala @ 2011-11-24 5:04 UTC (permalink / raw)
To: Jia Hongtao; +Cc: B11780, linuxppc-dev
In-Reply-To: <1319789280-12091-1-git-send-email-B38951@freescale.com>
On Oct 28, 2011, at 3:08 AM, Jia Hongtao wrote:
> From: Jason Jin <Jason.jin@freescale.com>
>
> Current pci/pcie init code will hide the pci/pcie host resource.
> But did not judge it is host/RC or agent/EP. If configured as
> agent/EP, we should avoid hiding its resource in the host side.
>
> In PCI system, the Programing Interface can be used to judge the
> host/agent status:
> Programing Interface = 0: host
> Programing Interface = 1: Agent
>
> In PCIE system, both the Programing Interface and Header type can
> be used to judge the RC/EP status.
> Header Type = 0: EP
> Header Type = 1: RC
>
> Signed-off-by: Jason Jin <Jason.jin@freescale.com>
> Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
> Signed-off-by: Jia Hongtao <B38951@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
> arch/powerpc/kernel/pci-common.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
applied to next
- k
^ permalink raw reply
* [git pull] Please pull powerpc.git merge branch
From: Kumar Gala @ 2011-11-24 5:03 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
Ben,
A few minor fixes for FSL PPC SoCs to send up to Linus.
- k
The following changes since commit caca6a03d365883564885f2c1da3e88dcf65d139:
Linux 3.2-rc3 (2011-11-23 20:20:28 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git merge
Kumar Gala (1):
powerpc/85xx: Fix compile error on p3060_qds.c
Paul Bolle (1):
powerpc/p3060qds: Fix select of 'MPC8xxx_GPIO'
Roy Zang (1):
powerpc/p1023: set IRQ[4:6,11] to active-high level sensitive for PCIe
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(-)
^ permalink raw reply
* Re: [4/4] powerpc/booke: Re-organize debug code
From: Kumar Gala @ 2011-11-24 4:54 UTC (permalink / raw)
To: Ben Herrenschmidt; +Cc: linuxppc-dev@ozlabs.org list
In-Reply-To: <567C3D8A-BBB9-4487-8069-0EA57701D7B6@pobox.com>
>>>> * set_dabr/do_dabr are no longer used when CNFIG_PPC_ADV_DEBUG_REGS =
is set
>>>> refactor code a bit such that we only build the dabr code for
>>>> !CONFIG_PPC_ADV_DEBUG_REGS and removed some =
CONFIG_PPC_ADV_DEBUG_REGS
>>>> code in set_dabr that would never get built.
>>>>=20
>>>> * Move do_send_trap into traps.c as its only used there
>>>>=20
>>>> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
>>>>=20
>>>> ---
>>>> arch/powerpc/include/asm/system.h | 5 +--
>>>> arch/powerpc/kernel/process.c | 97 =
+++++++++++++-----------------------
>>>> arch/powerpc/kernel/traps.c | 17 +++++++
>>>> 3 files changed, 53 insertions(+), 66 deletions(-)
>>>>=20
>>>> diff --git a/arch/powerpc/include/asm/system.h =
b/arch/powerpc/include/asm/system.h
>>>> index e30a13d..1dc5d9c 100644
>>>> --- a/arch/powerpc/include/asm/system.h
>>>> +++ b/arch/powerpc/include/asm/system.h
>>>> @@ -111,11 +111,8 @@ static inline int debugger_dabr_match(struct =
pt_regs *regs) { return 0; }
>>>> static inline int debugger_fault_handler(struct pt_regs *regs) { =
return 0; }
>>>> #endif
>>>>=20
>>>> +#ifndef CONFIG_PPC_ADV_DEBUG_REGS
>>>> extern int set_dabr(unsigned long dabr);
>>>> -#ifdef CONFIG_PPC_ADV_DEBUG_REGS
>>>> -extern void do_send_trap(struct pt_regs *regs, unsigned long =
address,
>>>> - unsigned long error_code, int signal_code, int =
brkpt);
>>>> -#else
>>>=20
>>>=20
>>> This part of the patch breaks xmon.c
>>> Naively I simply wrapped the xmon call:
>>>=20
>>> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
>>> index f08836a..b5911b2 100644
>>> --- a/arch/powerpc/xmon/xmon.c
>>> +++ b/arch/powerpc/xmon/xmon.c
>>> @@ -738,8 +738,10 @@ static void insert_bpts(void)
>>>=20
>>> static void insert_cpu_bpts(void)
>>> {
>>> +#ifndef CONFIG_PPC_ADV_DEBUG_REGS
>>> if (dabr.enabled)
>>> set_dabr(dabr.address | (dabr.enabled & 7));
>>> +#endif
>>> if (iabr && cpu_has_feature(CPU_FTR_IABR))
>>> mtspr(SPRN_IABR, iabr->address
>>> | (iabr->enabled & (BP_IABR|BP_IABR_TE)));
>>> @@ -767,7 +769,9 @@ static void remove_bpts(void)
>>>=20
>>> static void remove_cpu_bpts(void)
>>> {
>>> +#ifndef CONFIG_PPC_ADV_DEBUG_REGS
>>> set_dabr(0);
>>> +#endif
>>> if (cpu_has_feature(CPU_FTR_IABR))
>>> mtspr(SPRN_IABR, 0);
>>> }
>>=20
>> Shouldn't all of these functions be #ifndef'd out as we don't support =
cpu_bpts on book-e parts in xmon code today?
>=20
> Well I guess this is one for benh, because I would have expected xmon =
to test and call ppc_md.dabr.
> Actually, should everyone be doing that?
> -jx
Ben,
Any comment on direction here ?
- k
>>>> extern void do_dabr(struct pt_regs *regs, unsigned long address,
>>>> unsigned long error_code);
>>>> #endif
>>>> diff --git a/arch/powerpc/kernel/process.c =
b/arch/powerpc/kernel/process.c
>>>> index 269a309..989e574 100644
>>>> --- a/arch/powerpc/kernel/process.c
>>>> +++ b/arch/powerpc/kernel/process.c
>>>> @@ -251,50 +251,6 @@ void discard_lazy_cpu_state(void)
>>>> #endif /* CONFIG_SMP */
>>>>=20
>>>> #ifdef CONFIG_PPC_ADV_DEBUG_REGS
>>>> -void do_send_trap(struct pt_regs *regs, unsigned long address,
>>>> - unsigned long error_code, int signal_code, int =
breakpt)
>>>> -{
>>>> - siginfo_t info;
>>>> -
>>>> - if (notify_die(DIE_DABR_MATCH, "dabr_match", regs, error_code,
>>>> - 11, SIGSEGV) =3D=3D NOTIFY_STOP)
>>>> - return;
>>>> -
>>>> - /* Deliver the signal to userspace */
>>>> - info.si_signo =3D SIGTRAP;
>>>> - info.si_errno =3D breakpt; /* breakpoint or watchpoint id =
*/
>>>> - info.si_code =3D signal_code;
>>>> - info.si_addr =3D (void __user *)address;
>>>> - force_sig_info(SIGTRAP, &info, current);
>>>> -}
>>>> -#else /* !CONFIG_PPC_ADV_DEBUG_REGS */
>>>> -void do_dabr(struct pt_regs *regs, unsigned long address,
>>>> - unsigned long error_code)
>>>> -{
>>>> - siginfo_t info;
>>>> -
>>>> - if (notify_die(DIE_DABR_MATCH, "dabr_match", regs, error_code,
>>>> - 11, SIGSEGV) =3D=3D NOTIFY_STOP)
>>>> - return;
>>>> -
>>>> - if (debugger_dabr_match(regs))
>>>> - return;
>>>> -
>>>> - /* Clear the DABR */
>>>> - set_dabr(0);
>>>> -
>>>> - /* Deliver the signal to userspace */
>>>> - info.si_signo =3D SIGTRAP;
>>>> - info.si_errno =3D 0;
>>>> - info.si_code =3D TRAP_HWBKPT;
>>>> - info.si_addr =3D (void __user *)address;
>>>> - force_sig_info(SIGTRAP, &info, current);
>>>> -}
>>>> -#endif /* CONFIG_PPC_ADV_DEBUG_REGS */
>>>> -
>>>> -static DEFINE_PER_CPU(unsigned long, current_dabr);
>>>> -
>>>> -#ifdef CONFIG_PPC_ADV_DEBUG_REGS
>>>> /*
>>>> * Set the debug registers back to their default "safe" values.
>>>> */
>>>> @@ -357,16 +313,7 @@ static void switch_booke_debug_regs(struct =
thread_struct *new_thread)
>>>> prime_debug_regs(new_thread);
>>>> }
>>>> #else /* !CONFIG_PPC_ADV_DEBUG_REGS */
>>>> -#ifndef CONFIG_HAVE_HW_BREAKPOINT
>>>> -static void set_debug_reg_defaults(struct thread_struct *thread)
>>>> -{
>>>> - if (thread->dabr) {
>>>> - thread->dabr =3D 0;
>>>> - set_dabr(0);
>>>> - }
>>>> -}
>>>> -#endif /* !CONFIG_HAVE_HW_BREAKPOINT */
>>>> -#endif /* CONFIG_PPC_ADV_DEBUG_REGS */
>>>> +static DEFINE_PER_CPU(unsigned long, current_dabr);
>>>>=20
>>>> int set_dabr(unsigned long dabr)
>>>> {
>>>> @@ -376,19 +323,45 @@ int set_dabr(unsigned long dabr)
>>>> return ppc_md.set_dabr(dabr);
>>>>=20
>>>> /* XXX should we have a CPU_FTR_HAS_DABR ? */
>>>> -#ifdef CONFIG_PPC_ADV_DEBUG_REGS
>>>> - mtspr(SPRN_DAC1, dabr);
>>>> -#ifdef CONFIG_PPC_47x
>>>> - isync();
>>>> -#endif
>>>> -#elif defined(CONFIG_PPC_BOOK3S)
>>>> mtspr(SPRN_DABR, dabr);
>>>> -#endif
>>>> -
>>>>=20
>>>> return 0;
>>>> }
>>>>=20
>>>> +void do_dabr(struct pt_regs *regs, unsigned long address,
>>>> + unsigned long error_code)
>>>> +{
>>>> + siginfo_t info;
>>>> +
>>>> + if (notify_die(DIE_DABR_MATCH, "dabr_match", regs, error_code,
>>>> + 11, SIGSEGV) =3D=3D NOTIFY_STOP)
>>>> + return;
>>>> +
>>>> + if (debugger_dabr_match(regs))
>>>> + return;
>>>> +
>>>> + /* Clear the DABR */
>>>> + set_dabr(0);
>>>> +
>>>> + /* Deliver the signal to userspace */
>>>> + info.si_signo =3D SIGTRAP;
>>>> + info.si_errno =3D 0;
>>>> + info.si_code =3D TRAP_HWBKPT;
>>>> + info.si_addr =3D (void __user *)address;
>>>> + force_sig_info(SIGTRAP, &info, current);
>>>> +}
>>>> +
>>>> +#ifndef CONFIG_HAVE_HW_BREAKPOINT
>>>> +static void set_debug_reg_defaults(struct thread_struct *thread)
>>>> +{
>>>> + if (thread->dabr) {
>>>> + thread->dabr =3D 0;
>>>> + set_dabr(0);
>>>> + }
>>>> +}
>>>> +#endif /* !CONFIG_HAVE_HW_BREAKPOINT */
>>>> +#endif /* CONFIG_PPC_ADV_DEBUG_REGS */
>>>> +
>>>> #ifdef CONFIG_PPC64
>>>> DEFINE_PER_CPU(struct cpu_usage, cpu_usage_array);
>>>> #endif
>>>> diff --git a/arch/powerpc/kernel/traps.c =
b/arch/powerpc/kernel/traps.c
>>>> index db733d3..edc1108 100644
>>>> --- a/arch/powerpc/kernel/traps.c
>>>> +++ b/arch/powerpc/kernel/traps.c
>>>> @@ -1184,6 +1184,23 @@ void SoftwareEmulation(struct pt_regs *regs)
>>>> #endif /* CONFIG_8xx */
>>>>=20
>>>> #ifdef CONFIG_PPC_ADV_DEBUG_REGS
>>>> +static void do_send_trap(struct pt_regs *regs, unsigned long =
address,
>>>> + unsigned long error_code, int signal_code, int =
breakpt)
>>>> +{
>>>> + siginfo_t info;
>>>> +
>>>> + if (notify_die(DIE_DABR_MATCH, "dabr_match", regs, error_code,
>>>> + 11, SIGSEGV) =3D=3D NOTIFY_STOP)
>>>> + return;
>>>> +
>>>> + /* Deliver the signal to userspace */
>>>> + info.si_signo =3D SIGTRAP;
>>>> + info.si_errno =3D breakpt; /* breakpoint or watchpoint id =
*/
>>>> + info.si_code =3D signal_code;
>>>> + info.si_addr =3D (void __user *)address;
>>>> + force_sig_info(SIGTRAP, &info, current);
>>>> +}
>>>> +
>>>> static void handle_debug(struct pt_regs *regs, unsigned long =
debug_status)
>>>> {
>>>> int changed =3D 0;
>>=20
^ permalink raw reply
* Re: [PATCH 1/2] Unify pci/pcie initialization code
From: Kumar Gala @ 2011-11-24 4:50 UTC (permalink / raw)
To: Jia Hongtao-B38951
Cc: Gala Kumar-B11780, linuxppc-dev@lists.ozlabs.org, Li Yang-R58472
In-Reply-To: <412C8208B4A0464FA894C5F0C278CD5DFD4DB8@039-SN1MPN1-005.039d.mgd.msft.net>
On Nov 22, 2011, at 12:20 AM, Jia Hongtao-B38951 wrote:
> Hi Kumar,
> We want more comments on this series of patches ([1/2] & [2/2]) to =
speed up the pushing-to-kernel progress.
> Thanks.
I think the code is fine, but you need to update it for all the boards =
include the 86xx ones.
- k
>=20
> -----Original Message-----
> From: Jia Hongtao-B38951=20
> Sent: Monday, October 31, 2011 1:55 PM
> To: linuxppc-dev@lists.ozlabs.org
> Cc: Li Yang-R58472; Gala Kumar-B11780; Jia Hongtao-B38951
> Subject: [PATCH 1/2] Unify pci/pcie initialization code
>=20
> In previous version pci/pcie initialization is in platform code which =
Initialize PCI bridge base on EP/RC or host/agent settings.
> We unified pci/pcie initialization as common APIs named fsl_pci_setup =
which can be called by platform code.
>=20
> Signed-off-by: Jia Hongtao <B38951@freescale.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
> arch/powerpc/platforms/85xx/mpc85xx_ds.c | 30 ++-----------------
> arch/powerpc/sysdev/fsl_pci.c | 48 =
++++++++++++++++++++++++++++++
> arch/powerpc/sysdev/fsl_pci.h | 5 +++
> 3 files changed, 56 insertions(+), 27 deletions(-)
>=20
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c =
b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
> index 10e7db0..7188c0b 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
> @@ -157,33 +157,12 @@ extern void __init mpc85xx_smp_init(void); =
#endif static void __init mpc85xx_ds_setup_arch(void) { -#ifdef =
CONFIG_PCI
> - struct device_node *np;
> - struct pci_controller *hose;
> -#endif
> - dma_addr_t max =3D 0xffffffff;
> -
> if (ppc_md.progress)
> ppc_md.progress("mpc85xx_ds_setup_arch()", 0);
>=20
> -#ifdef CONFIG_PCI
> - for_each_node_by_type(np, "pci") {
> - if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
> - of_device_is_compatible(np, "fsl,mpc8548-pcie") ||
> - of_device_is_compatible(np, "fsl,p2020-pcie")) {
> - struct resource rsrc;
> - of_address_to_resource(np, 0, &rsrc);
> - if ((rsrc.start & 0xfffff) =3D=3D =
primary_phb_addr)
> - fsl_add_bridge(np, 1);
> - else
> - fsl_add_bridge(np, 0);
> -
> - hose =3D pci_find_hose_for_OF_device(np);
> - max =3D min(max, hose->dma_window_base_cur +
> - hose->dma_window_size);
> - }
> - }
> + fsl_pci_setup(primary_phb_addr);
>=20
> +#ifdef CONFIG_PCI
> ppc_md.pci_exclude_device =3D mpc85xx_exclude_device; #endif
>=20
> @@ -192,11 +171,8 @@ static void __init mpc85xx_ds_setup_arch(void) =
#endif
>=20
> #ifdef CONFIG_SWIOTLB
> - if (memblock_end_of_DRAM() > max) {
> + if (memblock_end_of_DRAM() > 0xffffffff)
> ppc_swiotlb_enable =3D 1;
> - set_pci_dma_ops(&swiotlb_dma_ops);
> - ppc_md.pci_dma_dev_setup =3D pci_dma_dev_setup_swiotlb;
> - }
> #endif
>=20
> printk("MPC85xx DS board from Freescale Semiconductor\n"); diff =
--git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c =
index 80b8b7a..4d4536f 100644
> --- a/arch/powerpc/sysdev/fsl_pci.c
> +++ b/arch/powerpc/sysdev/fsl_pci.c
> @@ -402,6 +402,54 @@ int __init fsl_add_bridge(struct device_node =
*dev, int is_primary) } #endif /* CONFIG_FSL_SOC_BOOKE || =
CONFIG_PPC_86xx */
>=20
> +static struct of_device_id pci_ids[] =3D {
> + { .compatible =3D "fsl,mpc8540-pci", },
> + { .compatible =3D "fsl,mpc8548-pcie", },
> + {},
> +};
> +
> +/**
> + * fsl_pci_setup - Initialization for PCI
> + * @primary_phb_addr: primary bus address
> + *
> + * Add bridge if pci controller is a host */ void fsl_pci_setup(int=20=
> +primary_phb_addr) {
> + struct device_node *np;
> + struct pci_controller *hose;
> + dma_addr_t min_dma_addr =3D 0xffffffff;
> +
> + for_each_node_by_type(np, "pci") {
> + if (of_match_node(pci_ids, np)) {
> + struct resource rsrc;
> + of_address_to_resource(np, 0, &rsrc);
> + if ((rsrc.start & 0xfffff) =3D=3D =
primary_phb_addr)
> + fsl_add_bridge(np, 1);
> + else
> + fsl_add_bridge(np, 0);
> +
> + hose =3D pci_find_hose_for_OF_device(np);
> + min_dma_addr =3D min(min_dma_addr,
> + hose->dma_window_base_cur
> + + hose->dma_window_size);
> +
> + }
> + }
> +
> +#ifdef CONFIG_SWIOTLB
> + /*
> + * if we couldn't map all of DRAM via the dma windows we need =
SWIOTLB
> + * to handle buffers located outside of dma capable memory =
region
> + */
> + if (memblock_end_of_DRAM() > min_dma_addr) {
> + ppc_swiotlb_enable =3D 1;
> + set_pci_dma_ops(&swiotlb_dma_ops);
> + ppc_md.pci_dma_dev_setup =3D pci_dma_dev_setup_swiotlb;
> + }
> +#endif
> +}
> +
> DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, =
quirk_fsl_pcie_header);
>=20
> #if defined(CONFIG_PPC_83xx) || defined(CONFIG_PPC_MPC512x) diff --git =
a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h index =
a39ed5c..775ea21 100644
> --- a/arch/powerpc/sysdev/fsl_pci.h
> +++ b/arch/powerpc/sysdev/fsl_pci.h
> @@ -89,6 +89,11 @@ struct ccsr_pci {
> };
>=20
> extern int fsl_add_bridge(struct device_node *dev, int is_primary);
> +#ifndef CONFIG_PCI
> +#define fsl_pci_setup(p)
> +#else
> +extern void fsl_pci_setup(int primary_phb_addr); #endif
> extern void fsl_pcibios_fixup_bus(struct pci_bus *bus); extern int =
mpc83xx_add_bridge(struct device_node *dev);
> u64 fsl_pci_immrbar_base(struct pci_controller *hose);
> --
> 1.7.5.1
>=20
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply
* [PATCH 2/3] mtd/nand : set correct length to FBCR for a non-full-page write
From: b35362 @ 2011-11-24 0:41 UTC (permalink / raw)
To: dwmw2, Artem.Bityutskiy, scottwood
Cc: linuxppc-dev, akpm, linux-mtd, linux-kernel
In-Reply-To: <1322095306-13156-1-git-send-email-b35362@freescale.com>
From: Liu Shuo <b35362@freescale.com>
When we do a non-full-page write, the length be set to FBCR should
not be 'elbc_fcm_ctrl->index', it should be 'elbc_fcm_ctrl->index -
elbc_fcm_ctrl->column'.
Signed-off-by: Liu Shuo <b35362@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
drivers/mtd/nand/fsl_elbc_nand.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index 6fce7da..d634c5f 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -474,7 +474,8 @@ static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command,
*/
if (elbc_fcm_ctrl->oob || elbc_fcm_ctrl->column != 0 ||
elbc_fcm_ctrl->index != mtd->writesize + mtd->oobsize)
- out_be32(&lbc->fbcr, elbc_fcm_ctrl->index);
+ out_be32(&lbc->fbcr,
+ elbc_fcm_ctrl->index - elbc_fcm_ctrl->column);
else
out_be32(&lbc->fbcr, 0);
--
1.7.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox