[PATCH] perf, powerpc: Convert the FSL driver to use local64_t

2010-08-02 Thread Paul Mackerras
From: Peter Zijlstra a.p.zijls...@chello.nl

For some reason the FSL driver got left out when we converted perf
to use local64_t instead of atomic64_t.

Signed-off-by: Peter Zijlstra a.p.zijls...@chello.nl
---
This is against the perf/core branch in the tip tree at
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
Posting here for comment.

 arch/powerpc/kernel/perf_event_fsl_emb.c |   28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

Index: linux-2.6/arch/powerpc/kernel/perf_event_fsl_emb.c
===
--- linux-2.6.orig/arch/powerpc/kernel/perf_event_fsl_emb.c
+++ linux-2.6/arch/powerpc/kernel/perf_event_fsl_emb.c
@@ -162,15 +162,15 @@ static void fsl_emb_pmu_read(struct perf
 * Therefore we treat them like NMIs.
 */
do {
-   prev = atomic64_read(event-hw.prev_count);
+   prev = local64_read(event-hw.prev_count);
barrier();
val = read_pmc(event-hw.idx);
-   } while (atomic64_cmpxchg(event-hw.prev_count, prev, val) != prev);
+   } while (local64_cmpxchg(event-hw.prev_count, prev, val) != prev);
 
/* The counters are only 32 bits wide */
delta = (val - prev)  0xul;
-   atomic64_add(delta, event-count);
-   atomic64_sub(delta, event-hw.period_left);
+   local64_add(delta, event-count);
+   local64_sub(delta, event-hw.period_left);
 }
 
 /*
@@ -296,11 +296,11 @@ static int fsl_emb_pmu_enable(struct per
 
val = 0;
if (event-hw.sample_period) {
-   s64 left = atomic64_read(event-hw.period_left);
+   s64 left = local64_read(event-hw.period_left);
if (left  0x8000L)
val = 0x8000L - left;
}
-   atomic64_set(event-hw.prev_count, val);
+   local64_set(event-hw.prev_count, val);
write_pmc(i, val);
perf_event_update_userpage(event);
 
@@ -371,8 +371,8 @@ static void fsl_emb_pmu_unthrottle(struc
if (left  0x8000L)
val = 0x8000L - left;
write_pmc(event-hw.idx, val);
-   atomic64_set(event-hw.prev_count, val);
-   atomic64_set(event-hw.period_left, left);
+   local64_set(event-hw.prev_count, val);
+   local64_set(event-hw.period_left, left);
perf_event_update_userpage(event);
perf_enable();
local_irq_restore(flags);
@@ -500,7 +500,7 @@ const struct pmu *hw_perf_event_init(str
return ERR_PTR(-ENOTSUPP);
 
event-hw.last_period = event-hw.sample_period;
-   atomic64_set(event-hw.period_left, event-hw.last_period);
+   local64_set(event-hw.period_left, event-hw.last_period);
 
/*
 * See if we need to reserve the PMU.
@@ -541,16 +541,16 @@ static void record_and_restart(struct pe
int record = 0;
 
/* we don't have to worry about interrupts here */
-   prev = atomic64_read(event-hw.prev_count);
+   prev = local64_read(event-hw.prev_count);
delta = (val - prev)  0xul;
-   atomic64_add(delta, event-count);
+   local64_add(delta, event-count);
 
/*
 * See if the total period for this event has expired,
 * and update for the next period.
 */
val = 0;
-   left = atomic64_read(event-hw.period_left) - delta;
+   left = local64_read(event-hw.period_left) - delta;
if (period) {
if (left = 0) {
left += period;
@@ -584,8 +584,8 @@ static void record_and_restart(struct pe
}
 
write_pmc(event-hw.idx, val);
-   atomic64_set(event-hw.prev_count, val);
-   atomic64_set(event-hw.period_left, left);
+   local64_set(event-hw.prev_count, val);
+   local64_set(event-hw.period_left, left);
perf_event_update_userpage(event);
 }
 


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: [PATCH 3/3 v2] mmc: Add ESDHC weird voltage bits workaround

2010-08-02 Thread Zang Roy-R61911
 

 -Original Message-
 From: Anton Vorontsov [mailto:cbouatmai...@gmail.com] 
 Sent: Friday, July 30, 2010 15:06 PM
 To: Zang Roy-R61911
 Cc: linux-...@vger.kernel.org; linuxppc-...@ozlabs.org; 
 a...@linux-foundation.org
 Subject: Re: [PATCH 3/3 v2] mmc: Add ESDHC weird voltage bits 
 workaround
 
 On Fri, Jul 30, 2010 at 11:52:57AM +0800, Roy Zang wrote:
  P4080 ESDHC controller does not support 1.8V and 3.0V 
 voltage. but the
  host controller capabilities register wrongly set the bits.
  This patch adds the workaround to correct the weird voltage 
 setting bits.
  
  Signed-off-by: Roy Zang tie-fei.z...@freescale.com
  ---
 [...]
  diff --git a/drivers/mmc/host/sdhci-of-core.c 
 b/drivers/mmc/host/sdhci-of-core.c
  index 0c30242..1f3913d 100644
  --- a/drivers/mmc/host/sdhci-of-core.c
  +++ b/drivers/mmc/host/sdhci-of-core.c
  @@ -164,6 +164,10 @@ static int __devinit 
 sdhci_of_probe(struct of_device *ofdev,
  if (sdhci_of_wp_inverted(np))
  host-quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
   
  +   if (of_device_is_compatible(np, fsl,p4080-esdhc))
  +   host-quirks |= (SDHCI_QUIRK_QORIQ_NO_VDD_180
  +   |SDHCI_QUIRK_QORIQ_NO_VDD_300);
  +
 
 It should be two properties, something like sdhci,no-vdd-180
 and sdhci,no-vdd-300. But it might be even better: we have
 voltage-ranges for mmc-spi case, see
 Documentation/powerpc/dts-bindings/mmc-spi-slot.txt.
 
 If voltage-ranges specified, then we use it, not capabilities
 register.
 
 For p4080 it will be 'voltage-ranges = 3200 3400;'. So, with
 voltage-ranges we can do fine grained VDD control without
 introducing anything new.
why not
   voltage-ranges = 3300 3300;
?
Roy

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: ramdisk size is larger than 4MB

2010-08-02 Thread Shawn Jin
 It should be fine to just change it locally.  It would be a problem to
 change it upstream for all boards, since some supported boards have
 only 16MB (or even 8MB) of RAM.

 I'll definitely try to change it locally first. Would a configurable
 base address for the bootwrapper an acceptable solution?

I found the link_address in the wrapper shell script sets the _start
address. But after changing it to 0x80, the kernel failed to boot,
shown below. There must be something also needs proper adjustment.
What would that be?

= bootm 400
## Booting image at 0400 ...
   Image Name:   Linux-2.6.33.5
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:1757356 Bytes =  1.7 MB
   Load Address: 0080
   Entry Point:  00800554
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
Memory - 0x0 0x800 (128MB)
ENET0: local-mac-address - 00:09:9b:01:58:64
CPU clock-frequency - 0x7270e00 (120MHz)
CPU timebase-frequency - 0x7270e0 (8MHz)
CPU bus-frequency - 0x3938700 (60MHz)

zImage starting: loaded at 0x0080 (sp: 0x07d1cbd0)
Allocating 0x3a15a4 bytes for kernel ...
gunzipping (0x - 0x0080c000:0x00bd702c)...done 0x3886ec bytes

Linux/PowerPC load: root=/dev/ram
Finalizing device tree... flat tree at 0xbe4300

Thanks a lot,
-Shawn.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 3/3 v2] mmc: Add ESDHC weird voltage bits workaround

2010-08-02 Thread Anton Vorontsov
On Mon, Aug 02, 2010 at 02:19:58PM +0800, Zang Roy-R61911 wrote:
[...]
  For p4080 it will be 'voltage-ranges = 3200 3400;'. So, with
  voltage-ranges we can do fine grained VDD control without
  introducing anything new.
 why not
voltage-ranges = 3300 3300;

Right you are, both will be 3300.

Thanks,

-- 
Anton Vorontsov
email: cbouatmai...@gmail.com
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 02/11] powerpc/nvram: More flexible nvram_create_partition()

2010-08-02 Thread Benjamin Herrenschmidt
On Mon, 2010-08-02 at 10:55 +1000, Benjamin Herrenschmidt wrote:
 Replace nvram_create_os_partition() with a variant that takes
 the partition name, signature and size as arguments.
 
 Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org
 ---
  arch/powerpc/kernel/nvram_64.c |   46 +++
  arch/powerpc/platforms/pseries/nvram.c |6 ++--
  2 files changed, 31 insertions(+), 21 deletions(-)
 
 diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
 index a8154f1..974b3ec 100644
 --- a/arch/powerpc/kernel/nvram_64.c
 +++ b/arch/powerpc/kernel/nvram_64.c
 @@ -307,13 +307,15 @@ static int __init nvram_remove_os_partition(void)
   return 0;
  }
  
 -/* nvram_create_os_partition
 - *
 - * Create a OS linux partition to buffer error logs.
 - * Will create a partition starting at the first free
 - * space found if space has enough room.
 +/**
 + * nvram_create_partition - Create a partition in nvram
 + * @name: name of the partition to create
 + * @sig: signature of the partition to create
 + * @req_size: size to allocate preferrably
 + * @min_size: minimum acceptable size (0 means req_size)
   */
 -static int __init nvram_create_os_partition(void)
 +static int __init nvram_create_partition(const char *name, int sig,
 +  int req_size, int min_size)
  {

Order of args is req , min but...

 + rc =nvram_create_partition(ppc64,linux, NVRAM_SIG_OS,
 +NVRAM_MIN_REQ, NVRAM_MAX_REQ);
   if (rc) {

I call it the other way around :-)

I should have tested this more before sending for RFC :-) Anyways, I
found more crap, like the way the list head is allocated etc...

I'll do another pass this week after I've dealt with the merge window.

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2 0/6] refactor spi_mpc8xxx.c and add eSPI controller support

2010-08-02 Thread Mingkai Hu
In-Reply-To: 

This patchset refactor the file spi_mpc8xxx.c to abstract some common
code as a lib used by the SPI/eSPI controller driver, move the SPI 
controller driver code to spi_fsl_spi.c, and add the eSPI controller
support with spi_fsl_espi.c.

Tested on P4080DS and MPC8536DS board based on latest Linux tree.

[PATCH v2 1/6] spi/mpc8xxx: refactor the common code for SPI/eSPI controller
[PATCH v2 2/6] eSPI: add eSPI controller support
[PATCH v2 3/6] mtd: m25p80: add support to parse the SPI flash's partitions
[PATCH v2 4/6] mtd: m25p80: add a read function to read page by page
[PATCH v2 5/6] powerpc/of: add eSPI controller dts bindings
[PATCH v2 6/6] DTS: add SPI flash(s25fl128p01) support on p4080ds and mpc8536ds 
board

Thanks,
Mingkai

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2 6/6] DTS: add SPI flash(s25fl128p01) support on p4080ds and mpc8536ds board

2010-08-02 Thread Mingkai Hu
Signed-off-by: Mingkai Hu mingkai...@freescale.com
---

v2:
 - Remove the whitespace inconsitencies

 arch/powerpc/boot/dts/mpc8536ds.dts |   52 +++
 arch/powerpc/boot/dts/p4080ds.dts   |   11 +++-
 2 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8536ds.dts 
b/arch/powerpc/boot/dts/mpc8536ds.dts
index 815cebb..a75c10e 100644
--- a/arch/powerpc/boot/dts/mpc8536ds.dts
+++ b/arch/powerpc/boot/dts/mpc8536ds.dts
@@ -108,6 +108,58 @@
};
};
 
+   s...@7000 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = fsl,mpc8536-espi;
+   reg = 0x7000 0x1000;
+   interrupts = 59 0x2;
+   interrupt-parent = mpic;
+   fsl,espi-num-chipselects = 4;
+
+   fl...@0 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = spansion,s25sl12801;
+   reg = 0;
+   spi-max-frequency = 4000;
+   partit...@u-boot {
+   label = u-boot;
+   reg = 0x 0x0010;
+   read-only;
+   };
+   partit...@kernel {
+   label = kernel;
+   reg = 0x0010 0x0050;
+   read-only;
+   };
+   partit...@dtb {
+   label = dtb;
+   reg = 0x0060 0x0010;
+   read-only;
+   };
+   partit...@fs {
+   label = file system;
+   reg = 0x0070 0x0090;
+   };
+   };
+   fl...@1 {
+   compatible = spansion,s25sl12801;
+   reg = 1;
+   spi-max-frequency = 4000;
+   };
+   fl...@2 {
+   compatible = spansion,s25sl12801;
+   reg = 2;
+   spi-max-frequency = 4000;
+   };
+   fl...@3 {
+   compatible = spansion,s25sl12801;
+   reg = 3;
+   spi-max-frequency = 4000;
+   };
+   };
+
d...@21300 {
#address-cells = 1;
#size-cells = 1;
diff --git a/arch/powerpc/boot/dts/p4080ds.dts 
b/arch/powerpc/boot/dts/p4080ds.dts
index 6b29eab..48437ad 100644
--- a/arch/powerpc/boot/dts/p4080ds.dts
+++ b/arch/powerpc/boot/dts/p4080ds.dts
@@ -236,22 +236,19 @@
};
 
s...@11 {
-   cell-index = 0;
#address-cells = 1;
#size-cells = 0;
-   compatible = fsl,espi;
+   compatible = fsl,mpc8536-espi;
reg = 0x11 0x1000;
interrupts = 53 0x2;
interrupt-parent = mpic;
-   espi,num-ss-bits = 4;
-   mode = cpu;
+   fsl,espi-num-chipselects = 4;
 
-   fsl_m25...@0 {
+   fl...@0 {
#address-cells = 1;
#size-cells = 1;
-   compatible = fsl,espi-flash;
+   compatible = spansion,s25sl12801;
reg = 0;
-   linux,modalias = fsl_m25p80;
spi-max-frequency = 4000; /* input clock 
*/
partit...@u-boot {
label = u-boot;
-- 
1.6.4


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2 5/6] powerpc/of: add eSPI controller dts bindings

2010-08-02 Thread Mingkai Hu
Also modifiy the document of cell-index in SPI controller.

Signed-off-by: Mingkai Hu mingkai...@freescale.com
---

v2:
 - Add cell-index clarification
 - Add mpc8536 chip name to the compatible value

 Documentation/powerpc/dts-bindings/fsl/spi.txt |   24 +++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/Documentation/powerpc/dts-bindings/fsl/spi.txt 
b/Documentation/powerpc/dts-bindings/fsl/spi.txt
index 80510c0..01543ca 100644
--- a/Documentation/powerpc/dts-bindings/fsl/spi.txt
+++ b/Documentation/powerpc/dts-bindings/fsl/spi.txt
@@ -1,7 +1,9 @@
 * SPI (Serial Peripheral Interface)
 
 Required properties:
-- cell-index : SPI controller index.
+- cell-index : QE SPI subblock index.
+  0: QE subblock SPI1
+  1: QE subblock SPI2
 - compatible : should be fsl,spi.
 - mode : the SPI operation mode, it can be cpu or cpu-qe.
 - reg : Offset and length of the register set for the device
@@ -29,3 +31,23 @@ Example:
gpios = gpio 18 1 // device reg=0
 gpio 19 1;   // device reg=1
};
+
+
+* eSPI (Enhanced Serial Peripheral Interface)
+
+Required properties:
+- compatible : should be fsl,mpc8536-espi.
+- reg : Offset and length of the register set for the device.
+- interrupts : should contain eSPI interrupt, the device has one interrupt.
+- fsl,espi-num-chipselects : the number of the chipselect signals.
+
+Example:
+   s...@11 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = fsl,espi;
+   reg = 0x11 0x1000;
+   interrupts = 53 0x2;
+   interrupt-parent = mpic;
+   fsl,espi-num-chipselects = 4;
+   };
-- 
1.6.4


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2 2/6] eSPI: add eSPI controller support

2010-08-02 Thread Mingkai Hu
Add eSPI controller support based on the library code spi_fsl_lib.c.

The eSPI controller is newer controller 85xx/Pxxx devices supported.
There're some differences comparing to the SPI controller:

1. Has different register map and different bit definition
   So leave the code operated the register to the driver code, not
   the common code.

2. Support 4 dedicated chip selects
   The software can't controll the chip selects directly, The SPCOM[CS]
   field is used to select which chip selects is used, and the
   SPCOM[TRANLEN] field is set to tell the controller how long the CS
   signal need to be asserted. So the driver doesn't need the chipselect
   related function when transfering data, just set corresponding register
   fields to controll the chipseclect.

3. Different Transmit/Receive FIFO access register behavior
   For SPI controller, the Tx/Rx FIFO access register can hold only
   one character regardless of the character length, but for eSPI
   controller, the register can hold 4 or 2 characters according to
   the character lengths. Access the Tx/Rx FIFO access register of the
   eSPI controller will shift out/in 4/2 characters one time. For SPI
   subsystem, the command and data are put into different transfers, so
   we need to combine all the transfers to one transfer in order to pass
   the transfer to eSPI controller.

Signed-off-by: Mingkai Hu mingkai...@freescale.com
---

v2:
 - Rename fsl_espi.c to spi_fsl_espi.c, also the config name
 - Move register map definiton from spi_fsl_lib.c to spi_fsl_espi.c
 - Break some funcions line in the arguments instead of the declaration
 - Inconsistent whitespacing in the macro definition
 - Init bits_per_word to 0 to eliminate the else clause
 - Add brace for the else clause to match if clause
 - Add chip name mpc8536 to the compatible value
 - Drop the last entry's comma in the match table
 - move module_init() immediately after the init fsl_espi_init() function

 drivers/spi/Kconfig|9 +
 drivers/spi/Makefile   |1 +
 drivers/spi/spi_fsl_espi.c |  633 
 drivers/spi/spi_fsl_lib.h  |2 +
 4 files changed, 645 insertions(+), 0 deletions(-)
 create mode 100644 drivers/spi/spi_fsl_espi.c

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index cd7f13b..a379363 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -140,6 +140,15 @@ config SPI_FSL_SPI
  MPC83xx platform uses the controller in cpu mode or CPM/QE mode.
  MPC8569 uses the controller in QE mode, MPC8610 in cpu mode.
 
+config SPI_FSL_ESPI
+   tristate Freescale eSPI controller
+   depends on FSL_SOC
+   select SPI_FSL_LIB
+   help
+ This enables using the Freescale eSPI controllers in master mode.
+ From MPC8536, 85xx platform uses the controller, and all P10xx,
+ P20xx, P40xx uses this controller.
+
 config SPI_GPIO
tristate GPIO-based bitbanging SPI Master
depends on GENERIC_GPIO
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index cf8d9be..dd86ba7 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -24,6 +24,7 @@ obj-$(CONFIG_SPI_DW_MMIO) += dw_spi_mmio.o
 obj-$(CONFIG_SPI_EP93XX)   += ep93xx_spi.o
 obj-$(CONFIG_SPI_FSL_LIB)  += spi_fsl_lib.o
 obj-$(CONFIG_SPI_FSL_SPI)  += spi_fsl_spi.o
+obj-$(CONFIG_SPI_FSL_ESPI) += spi_fsl_espi.o
 obj-$(CONFIG_SPI_GPIO) += spi_gpio.o
 obj-$(CONFIG_SPI_IMX)  += spi_imx.o
 obj-$(CONFIG_SPI_LM70_LLP) += spi_lm70llp.o
diff --git a/drivers/spi/spi_fsl_espi.c b/drivers/spi/spi_fsl_espi.c
new file mode 100644
index 000..61987cf
--- /dev/null
+++ b/drivers/spi/spi_fsl_espi.c
@@ -0,0 +1,633 @@
+/*
+ * Freescale eSPI controller driver.
+ *
+ * Copyright 2010 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+#include linux/module.h
+#include linux/delay.h
+#include linux/irq.h
+#include linux/spi/spi.h
+#include linux/platform_device.h
+#include linux/fsl_devices.h
+#include linux/mm.h
+#include linux/of.h
+#include linux/of_platform.h
+#include linux/of_spi.h
+#include sysdev/fsl_soc.h
+#include linux/interrupt.h
+
+#include spi_fsl_lib.h
+
+/* eSPI Controller registers */
+struct fsl_espi_reg {
+   __be32 mode;/* 0x000 - eSPI mode register */
+   __be32 event;   /* 0x004 - eSPI event register */
+   __be32 mask;/* 0x008 - eSPI mask register */
+   __be32 command; /* 0x00c - eSPI command register */
+   __be32 transmit;/* 0x010 - eSPI transmit FIFO access register*/
+   __be32 receive; /* 0x014 - eSPI receive FIFO access register*/
+   u8 res[8];

[PATCH v2 3/6] mtd: m25p80: add support to parse the SPI flash's partitions

2010-08-02 Thread Mingkai Hu
Signed-off-by: Mingkai Hu mingkai...@freescale.com
---

v2:
 - Move the flash partition function from of_spi.c to MTD driver

 drivers/mtd/devices/m25p80.c |   29 +
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 81e49a9..5f00075 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -752,6 +752,31 @@ static const struct spi_device_id *__devinit 
jedec_probe(struct spi_device *spi)
return NULL;
 }
 
+/*
+ * parse_flash_partition - Parse the flash partition on the SPI bus
+ * @spi: Pointer to spi_device device
+ */
+void parse_flash_partition(struct spi_device *spi)
+{
+   struct mtd_partition *parts;
+   struct flash_platform_data *pdata;
+   int nr_parts = 0;
+   struct device_node *np = spi-dev.of_node;
+
+   nr_parts = of_mtd_parse_partitions(spi-dev, np, parts);
+   if (!nr_parts)
+   return;
+
+   pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
+   if (!pdata)
+   return;
+
+   pdata-parts = parts;
+   pdata-nr_parts = nr_parts;
+   spi-dev.platform_data = pdata;
+
+   return;
+}
 
 /*
  * board specific setup should have ensured the SPI clock used here
@@ -771,6 +796,10 @@ static int __devinit m25p_probe(struct spi_device *spi)
 * a chip ID, try the JEDEC id commands; they'll work for most
 * newer chips, even if we don't recognize the particular chip.
 */
+
+   /* Parse the flash partition */
+   parse_flash_partition(spi);
+
data = spi-dev.platform_data;
if (data  data-type) {
const struct spi_device_id *plat_id;
-- 
1.6.4


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2 4/6] mtd: m25p80: add a read function to read page by page

2010-08-02 Thread Mingkai Hu
For Freescale's eSPI controller, the max transaction length one time
is limitted by the SPCOM[TRANSLEN] field which is 0x. When used
mkfs.ext2 command to create ext2 filesystem on the flash, the read
length will exceed the max value of the SPCOM[TRANSLEN] field, so
change the read function to read page by page.

For other SPI flash driver, also needed to supply the read function
if used the eSPI controller.

Signed-off-by: Mingkai Hu mingkai...@freescale.com
---

v2:
 - Add SPI_MASTER_TRANS_LIMIT flag to indicate the master's trans length
   limitation, so the MTD driver can select the correct transfer behaviour
   at driver probe time

 drivers/mtd/devices/m25p80.c |   78 ++
 drivers/spi/spi_fsl_espi.c   |1 +
 include/linux/spi/spi.h  |1 +
 3 files changed, 80 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 5f00075..30e4568 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -376,6 +376,81 @@ static int m25p80_read(struct mtd_info *mtd, loff_t from, 
size_t len,
 }
 
 /*
+ * Read an address range from the flash chip page by page.
+ * Some controller has transaction length limitation such as the
+ * Freescale's eSPI controller can only trasmit 0x bytes one
+ * time, so we have to read page by page if the len is more than
+ * the limitation.
+ */
+static int m25p80_page_read(struct mtd_info *mtd, loff_t from, size_t len,
+   size_t *retlen, u_char *buf)
+{
+   struct m25p *flash = mtd_to_m25p(mtd);
+   struct spi_transfer t[2];
+   struct spi_message m;
+   u32 i, page_size = 0;
+
+   DEBUG(MTD_DEBUG_LEVEL2, %s: %s %s 0x%08x, len %zd\n,
+   dev_name(flash-spi-dev), __func__, from,
+   (u32)from, len);
+
+   /* sanity checks */
+   if (!len)
+   return 0;
+
+   if (from + len  flash-mtd.size)
+   return -EINVAL;
+
+   spi_message_init(m);
+   memset(t, 0, (sizeof t));
+
+   /* NOTE:
+* OPCODE_FAST_READ (if available) is faster.
+* Should add 1 byte DUMMY_BYTE.
+*/
+   t[0].tx_buf = flash-command;
+   t[0].len = m25p_cmdsz(flash) + FAST_READ_DUMMY_BYTE;
+   spi_message_add_tail(t[0], m);
+
+   t[1].rx_buf = buf;
+   spi_message_add_tail(t[1], m);
+
+   /* Byte count starts at zero. */
+   if (retlen)
+   *retlen = 0;
+
+   mutex_lock(flash-lock);
+
+   /* Wait till previous write/erase is done. */
+   if (wait_till_ready(flash)) {
+   /* REVISIT status return?? */
+   mutex_unlock(flash-lock);
+   return 1;
+   }
+
+   /* Set up the write data buffer. */
+   flash-command[0] = OPCODE_READ;
+
+   for (i = page_size; i  len; i += page_size) {
+   page_size = len - i;
+   if (page_size  flash-page_size)
+   page_size = flash-page_size;
+   m25p_addr2cmd(flash, from + i, flash-command);
+   t[1].len = page_size;
+   t[1].rx_buf = buf + i;
+
+   spi_sync(flash-spi, m);
+
+   *retlen += m.actual_length - m25p_cmdsz(flash)
+   - FAST_READ_DUMMY_BYTE;
+   }
+
+   mutex_unlock(flash-lock);
+
+   return 0;
+}
+
+/*
  * Write an address range to the flash chip.  Data must be written in
  * FLASH_PAGESIZE chunks.  The address range may be any size provided
  * it is within the physical boundaries.
@@ -877,6 +952,9 @@ static int __devinit m25p_probe(struct spi_device *spi)
flash-mtd.erase = m25p80_erase;
flash-mtd.read = m25p80_read;
 
+   if (spi-master-flags  SPI_MASTER_TRANS_LIMIT)
+   flash-mtd.read = m25p80_page_read;
+
/* sst flash chips use AAI word program */
if (info-jedec_id  16 == 0xbf)
flash-mtd.write = sst_write;
diff --git a/drivers/spi/spi_fsl_espi.c b/drivers/spi/spi_fsl_espi.c
index 61987cf..e15b7dc 100644
--- a/drivers/spi/spi_fsl_espi.c
+++ b/drivers/spi/spi_fsl_espi.c
@@ -470,6 +470,7 @@ static struct spi_master * __devinit fsl_espi_probe(struct 
device *dev,
goto err_probe;
 
master-setup = fsl_espi_setup;
+   master-flags = SPI_MASTER_TRANS_LIMIT;
 
mpc8xxx_spi = spi_master_get_devdata(master);
mpc8xxx_spi-spi_do_one_msg = fsl_espi_do_one_msg;
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index af56071..0729cbd 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -261,6 +261,7 @@ struct spi_master {
 #define SPI_MASTER_HALF_DUPLEX BIT(0)  /* can't do full duplex */
 #define SPI_MASTER_NO_RX   BIT(1)  /* can't do buffer read */
 #define SPI_MASTER_NO_TX   BIT(2)  /* can't do buffer write */
+#define SPI_MASTER_TRANS_LIMIT BIT(3)  /* have trans length limit */
 
/* Setup mode and clock, etc (spi 

Re: [PATCH RFC] usb gadget: introduce usb_gadget_probe_driver

2010-08-02 Thread Michał Nazarewicz

On Fri, 30 Jul 2010 16:49:14 +0200, Uwe Kleine-König 
u.kleine-koe...@pengutronix.de wrote:

by using usb_gadget_probe_driver with driver-bind = NULL.  When all
drivers are fixed to use the new function the bind member of struct
usb_gadget_driver can go away.


On second thought, would it be hard to just fix all the gadgets?  It's not like 
there
are thousands of them so it shouldn't take that long.  Moreover, since you'd 
remove
the bind field and change the prototype of the usb_gadget_register() all 
instances
would be found at compile time.

With that and the other functions which use bind callbacks 
(usb_add_configuration(),
usb_composite_register()) the patch would be much better in my opinion and also
much better then my approach with __ref.

--
Best regards,_ _
| Humble Liege of Serenely Enlightened Majesty of  o' \,=./ `o
| Computer Science,  Michał mina86 Nazarewicz   (o o)
+[mina86*mina86.com]---[mina86*jabber.org]ooO--(_)--Ooo--
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: 2.6.35-stable/ppc64/p7: Badness at lib/dma-debug.c:902, Call Trace Instruction Dump during boot

2010-08-02 Thread FUJITA Tomonori
CC'ed to dma-debug maintainer.

On Mon, 02 Aug 2010 16:21:09 +0530
Subrata Modak subr...@linux.vnet.ibm.com wrote:

 Hi,
 
 On boot, Badness at lib/dma-debug.c:902, Call Trace  Instruction Dump
 are recorded at /var/log/messages:
 
 
 udev: starting version 151
 ses 0:8:0:0: Attached Enclosure device
 IBM eHEA ethernet device driver (Release EHEA_0105)
 mlx4_core: Mellanox ConnectX core driver v0.01 (May 1, 2007)
 mlx4_core: Initializing 0002:01:00.0
 mlx4_core 0002:01:00.0: enabling device (0140 - 0142)
 ehea: eth0: Jumbo frames are enabled
 ehea: eth0 - logical port id #1
 ehea: eth1: Jumbo frames are enabled
 ehea: eth1 - logical port id #2
 mlx4_core 0002:01:00.0: Requested 17 vectors, but only 8 MSI-X vectors
 available, trying again
 mlx4_core 0002:01:00.0: DMA-API: device driver tries to sync DMA memory it has
 not allocated [device address=0x60f22000] [size=4096 bytes]
 [ cut here ]
 Badness at lib/dma-debug.c:902
 NIP: c03fdfa0 LR: c03fdf9c CTR: 0001
 REGS: c00f35bfad00 TRAP: 0700   Not tainted  (2.6.35)
 MSR: 80029032 EE,ME,CE,IR,DR  CR: 48002482  XER: 2010
 TASK = c00f35c08000[502] 'modprobe' THREAD: c00f35bf8000 CPU: 8
 GPR00: c03fdf9c c00f35bfaf80 c1464c48 0096
 GPR04: 0001 c00c19b0  0002
 GPR08:  c00f35c08000 43b3 0001
 GPR12: 7669636520616464 c3fa5800  10016628
 GPR16: c00f32a02000 c00f32402000 c00f33604648 c00f35bfb1c0
 GPR20: c00f38002120 60f22000 0200 c1f4b000
 GPR24: 0001 0001 c1f47900 c00f35bfb0b0
 GPR28:  c00f38002120 c13eaea8 c00f35bfaf80
 NIP [c03fdfa0] .check_sync+0x108/0x52c
 LR [c03fdf9c] .check_sync+0x104/0x52c
 Call Trace:
 [c00f35bfaf80] [c03fdf9c] .check_sync+0x104/0x52c (unreliable)
 [c00f35bfb040] [c03fe8d4] .debug_dma_sync_single_for_cpu+0x58/0x70

I guess that this driver does a partial sync with
dma_sync_single_for_* API. dma-debug can't handle it properly. It's
likely that this is a false warning.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Issues to access Compact Flash Card on MPC8360E

2010-08-02 Thread Atul Deshmukh
Hi,

I would like to have your expert opinion on one of our design issue to
access the Compact Flash on MPC8360E.

I'm building an embedded system that will access Compact Flash card on
MPC8360E through local bus and not through PCMCIA.

The issue is how to access the CF card i.e. whether in memory mapped/io
mapped/True IDE mode?

Following are some concerned points...

1: If we use PC-Card ATA memory mapped mode then we have to stick with
PCMCIA specs and we also need PCMCIA bus on our board and have to use 'CF to
PCMCIA adapter'. But I don't have that much space on the board.So how can I
use CF card in PC-Card ATA memory mapped mode without using adapter and what
kernel drivers we can use for that?

2: The second approach is to use True IDE but in this case also we need IDE
socket.
Can we use CF card using its own 50 pin connector only without using any
adapter.What drivers we can use for True-IDE mode?



I read the CF specs and digged into kernel code for drivers and came up with
some findings which could be right or wrong..
Pls put on your thoughts on it and correct me if i'm wrong.

1: To access CF card in PC-Card ATA memory mapped/IO mapped mode we have
to use PCMCIA subsystem of kernel where we can use low level socket driver
that do resource windows allocation and other low level operations. We also
have to use linux provided Card Services (linux-kernel-source/drivers/
pcmcia/cs.c) and Driver Services (linux-kernel-source/drivers/pcmcia/ds.c)
but we have to write our own client driver and application driver to access
those serives.Am I going right way

2: To access CF card in True IDE mode we have to use
linux-kernel-source/drivers/ata/pata_platform.c and
linux-kernel-source/drivers/ata/libata-sff.c.I'm going right??

Your suggestions would be really helpful



-- 
Regards,
Atul
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] usb gadget: don't save bind callback in struct usb_gadget_driver

2010-08-02 Thread Uwe Kleine-König
The bind function is only needed at probe time, so there is no value in
saving it .

To accomplish this the function to register a gadget driver now takes
the bind function as a second argument.  To make things clearer rename
the function to resemble platform_driver_probe vs.
platform_driver_register.

This fixes many section mismatches like

WARNING: drivers/usb/gadget/g_printer.o(.data+0xc): Section mismatch in
reference from the variable printer_driver to the function
.init.text:printer_bind()
The variable printer_driver references
the function __init printer_bind()

All callers are fixed.

Signed-off-by: Uwe Kleine-König u.kleine-koe...@pengutronix.de
Cc: Michał Nazarewicz m.nazarew...@samsung.com
Cc: David Brownell davi...@pacbell.net
Cc: Julia Lawall ju...@diku.dk
Cc: Greg Kroah-Hartman gre...@suse.de
---
Hello,

now that Michał seems to be happy with my approach I made the effort to come up
with a complete patch that fixes the section mismatches.

Note this patch conflicts with usb-gadget-section-mismatch-warning-fixed.patch
in Greg's usb tree.  Greg, up to you to decide if it's already to late to drop
the old patch in favour of mine.

Julia, you found an inconsitency in my first patch.  I didn't, so can
you please point out in more words what you meant?

Best regards
Uwe

 drivers/usb/gadget/amd5536udc.c |9 +
 drivers/usb/gadget/at91_udc.c   |   11 ++-
 drivers/usb/gadget/atmel_usba_udc.c |7 ---
 drivers/usb/gadget/ci13xxx_udc.c|   16 
 drivers/usb/gadget/composite.c  |3 +--
 drivers/usb/gadget/dummy_hcd.c  |   10 +-
 drivers/usb/gadget/file_storage.c   |3 +--
 drivers/usb/gadget/fsl_qe_udc.c |   12 ++--
 drivers/usb/gadget/fsl_udc_core.c   |   10 +-
 drivers/usb/gadget/gmidi.c  |3 +--
 drivers/usb/gadget/goku_udc.c   |9 +
 drivers/usb/gadget/imx_udc.c|9 +
 drivers/usb/gadget/inode.c  |6 ++
 drivers/usb/gadget/langwell_udc.c   |9 +
 drivers/usb/gadget/lh7a40x_udc.c|9 +
 drivers/usb/gadget/m66592-udc.c |9 +
 drivers/usb/gadget/net2280.c|   10 +-
 drivers/usb/gadget/omap_udc.c   |   10 +-
 drivers/usb/gadget/printer.c|5 ++---
 drivers/usb/gadget/pxa25x_udc.c |9 +
 drivers/usb/gadget/pxa27x_udc.c |   12 +++-
 drivers/usb/gadget/r8a66597-udc.c   |9 +
 drivers/usb/gadget/s3c-hsotg.c  |9 +
 drivers/usb/gadget/s3c2410_udc.c|   17 -
 drivers/usb/musb/musb_gadget.c  |8 
 include/linux/usb/gadget.h  |   14 +++---
 26 files changed, 122 insertions(+), 116 deletions(-)

diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index 731150d..c266c1e 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -1954,13 +1954,14 @@ static int setup_ep0(struct udc *dev)
 }
 
 /* Called by gadget driver to register itself */
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+   int (*bind)(struct usb_gadget *))
 {
struct udc  *dev = udc;
int retval;
u32 tmp;
 
-   if (!driver || !driver-bind || !driver-setup
+   if (!driver || bind || !driver-setup
|| driver-speed != USB_SPEED_HIGH)
return -EINVAL;
if (!dev)
@@ -1972,7 +1973,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver 
*driver)
dev-driver = driver;
dev-gadget.dev.driver = driver-driver;
 
-   retval = driver-bind(dev-gadget);
+   retval = bind(dev-gadget);
 
/* Some gadget drivers use both ep0 directions.
 * NOTE: to gadget driver, ep0 is just one endpoint...
@@ -2000,7 +2001,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver 
*driver)
 
return 0;
 }
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 /* shutdown requests and disconnect from gadget */
 static void
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index eaa79c8..a3d04ba 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1570,14 +1570,15 @@ static irqreturn_t at91_vbus_irq(int irq, void *_udc)
return IRQ_HANDLED;
 }
 
-int usb_gadget_register_driver (struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+   int (*bind)(struct usb_gadget *))
 {
struct at91_udc *udc = controller;
int retval;
 
if (!driver
|| driver-speed  USB_SPEED_FULL
-   || !driver-bind
+   || !bind
|| !driver-setup) {
DBG(bad 

Re: [PATCH] usb gadget: don't save bind callback in struct usb_gadget_driver

2010-08-02 Thread Julia Lawall
 diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
 index 731150d..c266c1e 100644
 --- a/drivers/usb/gadget/amd5536udc.c
 +++ b/drivers/usb/gadget/amd5536udc.c
 @@ -1954,13 +1954,14 @@ static int setup_ep0(struct udc *dev)
  }
  
  /* Called by gadget driver to register itself */
 -int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 +int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
 + int (*bind)(struct usb_gadget *))
  {
   struct udc  *dev = udc;
   int retval;
   u32 tmp;
  
 - if (!driver || !driver-bind || !driver-setup
 + if (!driver || bind || !driver-setup

I have the impression that this should be !bind rather than bind.  
That would be like what is done in the patch for 
drivers/usb/gadget/fsl_udc_core.c below


 diff --git a/drivers/usb/gadget/fsl_udc_core.c 
 b/drivers/usb/gadget/fsl_udc_core.c
 index 08a9a62..c16b402 100644
 --- a/drivers/usb/gadget/fsl_udc_core.c
 +++ b/drivers/usb/gadget/fsl_udc_core.c
 @@ -1765,7 +1765,8 @@ static irqreturn_t fsl_udc_irq(int irq, void *_udc)
   * Hook to gadget drivers
   * Called by initialization code of gadget drivers
  **/
 -int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 +int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
 + int (*bind)(struct usb_gadget *))
  {
   int retval = -ENODEV;
   unsigned long flags = 0;
 @@ -1775,8 +1776,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver 
 *driver)
  
   if (!driver || (driver-speed != USB_SPEED_FULL
driver-speed != USB_SPEED_HIGH)
 - || !driver-bind || !driver-disconnect
 - || !driver-setup)
 + || !bind || !driver-disconnect || !driver-setup)
   return -EINVAL;

Here !driver-bind is converted to !bind.

julia
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] usb gadget: don't save bind callback in struct usb_gadget_driver

2010-08-02 Thread Uwe Kleine-König
On Mon, Aug 02, 2010 at 02:51:36PM +0200, Julia Lawall wrote:
  diff --git a/drivers/usb/gadget/amd5536udc.c 
  b/drivers/usb/gadget/amd5536udc.c
  index 731150d..c266c1e 100644
  --- a/drivers/usb/gadget/amd5536udc.c
  +++ b/drivers/usb/gadget/amd5536udc.c
  @@ -1954,13 +1954,14 @@ static int setup_ep0(struct udc *dev)
   }
   
   /* Called by gadget driver to register itself */
  -int usb_gadget_register_driver(struct usb_gadget_driver *driver)
  +int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
  +   int (*bind)(struct usb_gadget *))
   {
  struct udc  *dev = udc;
  int retval;
  u32 tmp;
   
  -   if (!driver || !driver-bind || !driver-setup
  +   if (!driver || bind || !driver-setup
 
 I have the impression that this should be !bind rather than bind.  
ah, now I see what you meant.  Obviously you're right.  I fixed it up
locally here for now.  Greg, just tell me when/if you need a fixed
patch.

 That would be like what is done in the patch for 
 drivers/usb/gadget/fsl_udc_core.c below

Thanks
Uwe

-- 
Pengutronix e.K.   | Uwe Kleine-König|
Industrial Linux Solutions | http://www.pengutronix.de/  |
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] perf, powerpc: Convert the FSL driver to use local64_t

2010-08-02 Thread Kumar Gala

On Aug 2, 2010, at 1:18 AM, Paul Mackerras wrote:

 From: Peter Zijlstra a.p.zijls...@chello.nl
 
 For some reason the FSL driver got left out when we converted perf
 to use local64_t instead of atomic64_t.
 
 Signed-off-by: Peter Zijlstra a.p.zijls...@chello.nl
 ---
 This is against the perf/core branch in the tip tree at
 git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
 Posting here for comment.
 
 arch/powerpc/kernel/perf_event_fsl_emb.c |   28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

Acked-by: Kumar Gala ga...@kernel.crashing.org

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: Issues to access Compact Flash Card on MPC8360E

2010-08-02 Thread Anton Vorontsov
On Mon, Aug 02, 2010 at 07:44:22PM +0530, Atul Deshmukh wrote:
 Thanks a lot Anton,
 From the dts entry given below,
 
 local...@e0005000 {
  #address-cells = 2;
#size-cells = 1;
compatible = fsl,mpc8349e-localbus,
 fsl,pq2pro-localbus;
reg = 0xe0005000 0xd8;
ranges = 0x3 0x0 0xf000 0x210;
p...@3,0 {
compatible = fsl,mpc8349emitx-pata,
 ata-generic;
reg = 0x3 0x0 0x10 0x3 0x20c 0x4;
reg-shift = 1;
pio-mode = 6;
interrupts = 23 0x8;
   interrupt-parent = ipic;
};
};
 
 
 we can conclude that it uses ata-generic SATA/PATA controlelr driver which

How did you come to this conclusion? From the node above it's IMHO
pretty clear that IDE (PATA) is on the localbus.

The driver is drivers/ata/pata_of_platform.c.

 controls PCI-based IDE-controller where we can plug in our CF card...Am I
 right???

Nope, no PCI involved. CF is almost* directly connected to
the localbus.

 But in our design we don't use any controller we directly connects CF card
 to local bus where UPM controls it..

Yes, that's exactly how CF is done on MPC8349EmITX boards.

 Can you please explain how the interface is implemented in MPC8349..

Via localbus + UPM.

* 'almost' is because there are some buffers and inverters, see
  schematics:
  
http://www.freescale.com/files/32bit/hardware_tools/schematics/MPC8349EMITXESCH.pdf

-- 
Anton Vorontsov
email: cbouatmai...@gmail.com
irc://irc.freenode.net/bd2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: make 3.82 fails on powerpc defconfig update [was: Linux 2.6.35]

2010-08-02 Thread Sam Ravnborg
On Mon, Aug 02, 2010 at 11:51:11AM +0300, Thomas Backlund wrote:
 Hi,
 (please cc me as I'm not subscribed)

 updating from make 3.81 to 3.82 gets me this:

 [tho...@tmb linux-2.6.35]$ cp arch/powerpc/configs/ppc64_defconfig .config
 [tho...@tmb linux-2.6.35]$ LC_ALL=C make oldconfig ARCH=powerpc
 /mnt/work/2.6.35/linux-2.6.35/arch/powerpc/Makefile:183: *** mixed  
 implicit and normal rules.  Stop.

 The lines are:

 182:
 183: $(BOOT_TARGETS): vmlinux
 184: $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst  
 %,$(boot)/%,$@)
 185:

 BOOT_TARGETS are defined on line 166 as:
 BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.%  
 cuImage.% simpleImage.%


 Now it's not a regression in the kernel as the same happends with the  
 2.6.34 tree too.

 (btw, the host I'm syncing the defconfig with is a x86_64 machine)


 Now, I dont know if this is intended breakage by the make update, or  
 if the Makefile needs to be updated

 Any ideas how to fix ?

This is in the category intended breakage.
We had a similar issue in the top-level Makefile which Paul (IIRC)
helped me to fix long time ago.

To fix popwerpc I suggest something along these lines.
[Note: I did not test it - please do so.

Sam

[PATCH] powerpc: fix build with make 3.82

Thomas Backlund reported that the powerpc build broke with make 3.82.
It failed with the following message:

arch/powerpc/Makefile:183: *** mixed implicit and normal rules.  Stop.

The fix is to avoid mixing non-wildcard and wildcard targets.

Reported-by: Thomas Backlund t...@mandriva.org
Cc: Michal Marek mma...@suse.cz
Signed-off-by: Sam Ravnborg s...@ravnborg.org
---
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 77cfe7a..ad88b21 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -163,9 +163,11 @@ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
 # Default to zImage, override when needed
 all: zImage
 
-BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% 
cuImage.% simpleImage.%
+# With make 3.82 we cannot mix normal and wildcard targets
+BOOT_TARGETS1 := zImage zImage.initrd uImaged
+BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
 
-PHONY += $(BOOT_TARGETS)
+PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
 
 boot := arch/$(ARCH)/boot
 
@@ -180,7 +182,9 @@ relocs_check: arch/powerpc/relocs_check.pl vmlinux
 zImage: relocs_check
 endif
 
-$(BOOT_TARGETS): vmlinux
+$(BOOT_TARGETS1): vmlinux
+   $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+$(BOOT_TARGETS2): vmlinux
$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 
 bootwrapper_install %.dtb:
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH v2 1/2] powerpc/85xx: kexec for SMP 85xx BookE systems

2010-08-02 Thread Kumar Gala

On Jul 21, 2010, at 4:14 PM, Matthew McClintock wrote:

 Adds support for kexec on 85xx machines for the BookE platform.
 Including support for SMP machines
 
 Based off work from Maxim Uvarov muva...@mvista.com
 Signed-off-by: Matthew McClintock m...@freescale.com
 ---
 arch/powerpc/Kconfig  |   10 +++---
 arch/powerpc/platforms/85xx/smp.c |   63 +
 2 files changed, 68 insertions(+), 5 deletions(-)

applied to next

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: make 3.82 fails on powerpc defconfig update [was: Linux 2.6.35]

2010-08-02 Thread Sam Ravnborg
 
 Thanks, this seems to fix the first issue, but then I get the same erro on 
 the following line 190:
 
 190: bootwrapper_install %.dtb:
 191:$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 

Obviously - dunno how I missed that.
Updated patch below.

I will do a proper submission after you
confirm that powerpc build is working with make 3.82.

Sam

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 77cfe7a..ace7a3e 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -163,9 +163,11 @@ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
 # Default to zImage, override when needed
 all: zImage
 
-BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% 
cuImage.% simpleImage.%
+# With make 3.82 we cannot mix normal and wildcard targets
+BOOT_TARGETS1 := zImage zImage.initrd uImaged
+BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
 
-PHONY += $(BOOT_TARGETS)
+PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
 
 boot := arch/$(ARCH)/boot
 
@@ -180,10 +182,16 @@ relocs_check: arch/powerpc/relocs_check.pl vmlinux
 zImage: relocs_check
 endif
 
-$(BOOT_TARGETS): vmlinux
+$(BOOT_TARGETS1): vmlinux
+   $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+$(BOOT_TARGETS2): vmlinux
+   $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+
+
+bootwrapper_install
$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 
-bootwrapper_install %.dtb:
+%.dtb:
$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 
 define archhelp
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: make 3.82 fails on powerpc defconfig update [was: Linux 2.6.35]

2010-08-02 Thread Thomas Backlund
02.08.2010 21:28, Sam Ravnborg skrev:
 On Mon, Aug 02, 2010 at 11:51:11AM +0300, Thomas Backlund wrote:
 Hi,
 (please cc me as I'm not subscribed)

 updating from make 3.81 to 3.82 gets me this:

 [tho...@tmb linux-2.6.35]$ cp arch/powerpc/configs/ppc64_defconfig .config
 [tho...@tmb linux-2.6.35]$ LC_ALL=C make oldconfig ARCH=powerpc
 /mnt/work/2.6.35/linux-2.6.35/arch/powerpc/Makefile:183: *** mixed  
 implicit and normal rules.  Stop.

 The lines are:

 182:
 183: $(BOOT_TARGETS): vmlinux
 184: $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst  
 %,$(boot)/%,$@)
 185:

 BOOT_TARGETS are defined on line 166 as:
 BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.%  
 cuImage.% simpleImage.%


 Now it's not a regression in the kernel as the same happends with the  
 2.6.34 tree too.

 (btw, the host I'm syncing the defconfig with is a x86_64 machine)


 Now, I dont know if this is intended breakage by the make update, or  
 if the Makefile needs to be updated

 Any ideas how to fix ?
 
 This is in the category intended breakage.
 We had a similar issue in the top-level Makefile which Paul (IIRC)
 helped me to fix long time ago.
 
 To fix popwerpc I suggest something along these lines.
 [Note: I did not test it - please do so.
 
   Sam
 
 [PATCH] powerpc: fix build with make 3.82
 
 Thomas Backlund reported that the powerpc build broke with make 3.82.
 It failed with the following message:
 
 arch/powerpc/Makefile:183: *** mixed implicit and normal rules.  Stop.
 
 The fix is to avoid mixing non-wildcard and wildcard targets.
 
 Reported-by: Thomas Backlund t...@mandriva.org
 Cc: Michal Marek mma...@suse.cz
 Signed-off-by: Sam Ravnborg s...@ravnborg.org
 ---
 diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
 index 77cfe7a..ad88b21 100644
 --- a/arch/powerpc/Makefile
 +++ b/arch/powerpc/Makefile
 @@ -163,9 +163,11 @@ drivers-$(CONFIG_OPROFILE)   += 
 arch/powerpc/oprofile/
  # Default to zImage, override when needed
  all: zImage
  
 -BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% 
 cuImage.% simpleImage.%
 +# With make 3.82 we cannot mix normal and wildcard targets
 +BOOT_TARGETS1 := zImage zImage.initrd uImaged
 +BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
  
 -PHONY += $(BOOT_TARGETS)
 +PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
  
  boot := arch/$(ARCH)/boot
  
 @@ -180,7 +182,9 @@ relocs_check: arch/powerpc/relocs_check.pl vmlinux
  zImage: relocs_check
  endif
  
 -$(BOOT_TARGETS): vmlinux
 +$(BOOT_TARGETS1): vmlinux
 + $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 +$(BOOT_TARGETS2): vmlinux
   $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
  
  bootwrapper_install %.dtb:


Thanks, this seems to fix the first issue, but then I get the same erro on the 
following line 190:

190: bootwrapper_install %.dtb:
191:$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)


--
Thomas
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: make 3.82 fails on powerpc defconfig update [was: Linux 2.6.35]

2010-08-02 Thread Andreas Schwab
Sam Ravnborg s...@ravnborg.org writes:

 +bootwrapper_install

Missing colon.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: make 3.82 fails on powerpc defconfig update [was: Linux 2.6.35]

2010-08-02 Thread Thomas Backlund
02.08.2010 23:51, Sam Ravnborg skrev:

 Thanks, this seems to fix the first issue, but then I get the same erro on 
 the following line 190:

 190: bootwrapper_install %.dtb:
 191:$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst 
 %,$(boot)/%,$@)

 
 Obviously - dunno how I missed that.
 Updated patch below.
 
 I will do a proper submission after you
 confirm that powerpc build is working with make 3.82.
 

Yeah, that was an obvious fix, thanks!

One small typo fix below...
(a missing ':')

Otherwise it works here, so:

Tested-by: Thomas Backlund t...@mandriva.org

   Sam
 
 diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
 index 77cfe7a..ace7a3e 100644
 --- a/arch/powerpc/Makefile
 +++ b/arch/powerpc/Makefile
 @@ -163,9 +163,11 @@ drivers-$(CONFIG_OPROFILE)   += 
 arch/powerpc/oprofile/
  # Default to zImage, override when needed
  all: zImage
  
 -BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% 
 cuImage.% simpleImage.%
 +# With make 3.82 we cannot mix normal and wildcard targets
 +BOOT_TARGETS1 := zImage zImage.initrd uImaged
 +BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
  
 -PHONY += $(BOOT_TARGETS)
 +PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
  
  boot := arch/$(ARCH)/boot
  
 @@ -180,10 +182,16 @@ relocs_check: arch/powerpc/relocs_check.pl vmlinux
  zImage: relocs_check
  endif
  
 -$(BOOT_TARGETS): vmlinux
 +$(BOOT_TARGETS1): vmlinux
 + $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 +$(BOOT_TARGETS2): vmlinux
 + $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 +
 +
 +bootwrapper_install

bootwrapper_install:

   $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
  
 -bootwrapper_install %.dtb:
 +%.dtb:
   $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
  
  define archhelp
 .
 

--
Thomas
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: Please pull my perf.git urgent branch

2010-08-02 Thread Scott Wood
On Wed, 28 Jul 2010 14:47:31 +1000
Paul Mackerras pau...@samba.org wrote:

 On Tue, Jul 27, 2010 at 11:28:54AM -0500, Scott Wood wrote:
 
  Doesn't the setting of .period need to be maintained (it is in the other
  powerpc perf_event implementation that this is derived from)?
 
 Gah, yes it does.

Well, looks like Linus pulled anyway...  I'll send a patch to
add .period.

-Scott

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] perf, powerpc: fsl_emb: Restore setting perf_sample_data.period

2010-08-02 Thread Scott Wood
Commit 6b95ed345b9faa4ab3598a82991968f2e9f851bb changed from
a struct initializer to perf_sample_data_init(), but the setting
of the .period member was left out.

Signed-off-by: Scott Wood scottw...@freescale.com
---
 arch/powerpc/kernel/perf_event_fsl_emb.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/perf_event_fsl_emb.c 
b/arch/powerpc/kernel/perf_event_fsl_emb.c
index babccee..4339d20 100644
--- a/arch/powerpc/kernel/perf_event_fsl_emb.c
+++ b/arch/powerpc/kernel/perf_event_fsl_emb.c
@@ -569,6 +569,7 @@ static void record_and_restart(struct perf_event *event, 
unsigned long val,
struct perf_sample_data data;
 
perf_sample_data_init(data, 0);
+   data.period = event-hw.last_period;
 
if (perf_event_overflow(event, nmi, data, regs)) {
/*
-- 
1.7.0.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] usb gadget: don't save bind callback in struct usb_gadget_driver

2010-08-02 Thread Greg KH
On Mon, Aug 02, 2010 at 03:12:48PM +0200, Uwe Kleine-König wrote:
 On Mon, Aug 02, 2010 at 02:51:36PM +0200, Julia Lawall wrote:
   diff --git a/drivers/usb/gadget/amd5536udc.c 
   b/drivers/usb/gadget/amd5536udc.c
   index 731150d..c266c1e 100644
   --- a/drivers/usb/gadget/amd5536udc.c
   +++ b/drivers/usb/gadget/amd5536udc.c
   @@ -1954,13 +1954,14 @@ static int setup_ep0(struct udc *dev)
}

/* Called by gadget driver to register itself */
   -int usb_gadget_register_driver(struct usb_gadget_driver *driver)
   +int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
   + int (*bind)(struct usb_gadget *))
{
 struct udc  *dev = udc;
 int retval;
 u32 tmp;

   - if (!driver || !driver-bind || !driver-setup
   + if (!driver || bind || !driver-setup
  
  I have the impression that this should be !bind rather than bind.  
 ah, now I see what you meant.  Obviously you're right.  I fixed it up
 locally here for now.  Greg, just tell me when/if you need a fixed
 patch.

Didn't you already post a fixed patch?

thanks,

greg k-h
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 2/3] USB: add of_platform glue driver for FSL USB DR controller

2010-08-02 Thread Greg KH
On Wed, Jul 28, 2010 at 11:46:47AM -0700, Greg KH wrote:
 On Wed, Jul 28, 2010 at 12:14:14PM -0600, Grant Likely wrote:
  On Wed, Jul 28, 2010 at 5:58 AM, Anatolij Gustschin ag...@denx.de wrote:
   Hi Grant,
  
   On Wed, 28 Jul 2010 02:16:08 -0600
   Grant Likely grant.lik...@secretlab.ca wrote:
  
   On Thu, Jul 22, 2010 at 10:25 AM, Anatolij Gustschin ag...@denx.de 
   wrote:
The driver creates platform devices based on the information
from USB nodes in the flat device tree. This is the replacement
for old arch fsl_soc usb code removed by the previous patch.
It uses usual of-style binding, available EHCI-HCD and UDC
drivers can be bound to the created devices. The new of-style
driver additionaly instantiates USB OTG platform device, as the
appropriate USB OTG driver will be added soon.
   
Signed-off-by: Anatolij Gustschin ag...@denx.de
Cc: Kumar Gala ga...@kernel.crashing.org
Cc: Grant Likely grant.lik...@secretlab.ca
  
   Hi Anatolij,
  
   Looks pretty good, but some comments below.
  
   Thanks for review and comments! Greg already merged this series and
   therefore I'll submit an incremental cleanup patch to address
   outstanding issues. My reply is below.
  
  Greg maintains a patchwork tree IIRC.  I believe he drops patches from
  his linux-next branch if they need to be reworked.  Greg, do I have
  this right?
 
 Yup.  I can easily drop all of these patches.
 
  Also, my preference would be to see some 3rd party testing before
  committing to having this merged.
 
 Ok, I will go drop them all now, and wait for some that pass your
 review.

All 3 now dropped.

thanks,

greg k-h
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Please pull my perf.git master branch

2010-08-02 Thread Paul Mackerras
Ingo,

Please do a pull from my perf.git tree at:

  git://git.kernel.org/pub/scm/linux/kernel/git/paulus/perf.git master

to get two commits.  They only affect the driver for the PMU on the
Freescale embedded PowerPC processors.  One is from Peter Z. and has
been around for some time.  The other fixes a bug introduced by a
patch from Peter Z. that I sent upstream recently.

Thanks,
Paul.

Peter Zijlstra (1):
  perf, powerpc: Convert the FSL driver to use local64_t

Scott Wood (1):
  perf, powerpc: fsl_emb: Restore setting perf_sample_data.period

 arch/powerpc/kernel/perf_event_fsl_emb.c |   29 +++--
 1 files changed, 15 insertions(+), 14 deletions(-)
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 2/3 v2] dts: Add sdhci,auto-cmd12 field for p4080 device tree

2010-08-02 Thread Roy Zang
Signed-off-by: Roy Zang tie-fei.z...@freescale.com
---
 Documentation/powerpc/dts-bindings/fsl/esdhc.txt |2 ++
 arch/powerpc/boot/dts/p4080ds.dts|1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt 
b/Documentation/powerpc/dts-bindings/fsl/esdhc.txt
index 8a00407..64bcb8b 100644
--- a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt
+++ b/Documentation/powerpc/dts-bindings/fsl/esdhc.txt
@@ -14,6 +14,8 @@ Required properties:
 reports inverted write-protect state;
   - sdhci,1-bit-only : (optional) specifies that a controller can
 only handle 1-bit data transfers.
+  - sdhci,auto-cmd12: (optional) specifies that a controller can
+only handle auto CMD12.
 
 Example:
 
diff --git a/arch/powerpc/boot/dts/p4080ds.dts 
b/arch/powerpc/boot/dts/p4080ds.dts
index 6b29eab..efa0091 100644
--- a/arch/powerpc/boot/dts/p4080ds.dts
+++ b/arch/powerpc/boot/dts/p4080ds.dts
@@ -280,6 +280,7 @@
reg = 0x114000 0x1000;
interrupts = 48 2;
interrupt-parent = mpic;
+   sdhci,auto-cmd12;
};
 
i...@118000 {
-- 
1.5.6.5


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 3/3 v2] dts: Add ESDHC weird voltage bits workaround

2010-08-02 Thread Roy Zang
P4080 ESDHC controller does not support 1.8V and 3.0V voltage. but the
host controller capabilities register wrongly set the bits.
This patch adds the workaround to correct the weird voltage setting bits.
Only 3.3V voltage is supported for P4080 ESDHC controller.

Signed-off-by: Roy Zang tie-fei.z...@freescale.com
---
 arch/powerpc/boot/dts/p4080ds.dts |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/p4080ds.dts 
b/arch/powerpc/boot/dts/p4080ds.dts
index efa0091..2f0de24 100644
--- a/arch/powerpc/boot/dts/p4080ds.dts
+++ b/arch/powerpc/boot/dts/p4080ds.dts
@@ -280,6 +280,7 @@
reg = 0x114000 0x1000;
interrupts = 48 2;
interrupt-parent = mpic;
+   voltage-ranges = 3300 3300;
sdhci,auto-cmd12;
};
 
-- 
1.5.6.5


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver

2010-08-02 Thread Roy Zang
From: Jerry Huang chang-ming.hu...@freescale.com

Add auto CMD12 command support for eSDHC driver.
This is needed by P4080 and P1022 for block read/write.
Manual asynchronous CMD12 abort operation causes protocol violations on
these silicons.

Signed-off-by: Jerry Huang chang-ming.hu...@freescale.com
Signed-off-by: Roy Zang tie-fei.z...@freescale.com
---
 drivers/mmc/host/sdhci-of-core.c |4 
 drivers/mmc/host/sdhci.c |   14 --
 drivers/mmc/host/sdhci.h |2 ++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-core.c b/drivers/mmc/host/sdhci-of-core.c
index a2e9820..dd1bdd1 100644
--- a/drivers/mmc/host/sdhci-of-core.c
+++ b/drivers/mmc/host/sdhci-of-core.c
@@ -154,6 +154,10 @@ static int __devinit sdhci_of_probe(struct of_device 
*ofdev,
host-ops = sdhci_of_data-ops;
}
 
+   if (of_get_property(np, sdhci,auto-cmd12, NULL))
+   host-quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
+
+
if (of_get_property(np, sdhci,1-bit-only, NULL))
host-quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
 
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index c6d1bd8..a92566e 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -817,8 +817,12 @@ static void sdhci_set_transfer_mode(struct sdhci_host 
*host,
WARN_ON(!host-data);
 
mode = SDHCI_TRNS_BLK_CNT_EN;
-   if (data-blocks  1)
-   mode |= SDHCI_TRNS_MULTI;
+   if (data-blocks  1) {
+   if (host-quirks  SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
+   mode |= SDHCI_TRNS_MULTI | SDHCI_TRNS_ACMD12;
+   else
+   mode |= SDHCI_TRNS_MULTI;
+   }
if (data-flags  MMC_DATA_READ)
mode |= SDHCI_TRNS_READ;
if (host-flags  SDHCI_REQ_USE_DMA)
@@ -1108,6 +1112,12 @@ static void sdhci_request(struct mmc_host *mmc, struct 
mmc_request *mrq)
 #ifndef SDHCI_USE_LEDS_CLASS
sdhci_activate_led(host);
 #endif
+   if (host-quirks  SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12) {
+   if (mrq-stop) {
+   mrq-data-stop = NULL;
+   mrq-stop = NULL;
+   }
+   }
 
host-mrq = mrq;
 
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index c846813..8fb088c 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -240,6 +240,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN  (125)
 /* Controller cannot support End Attribute in NOP ADMA descriptor */
 #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC  (126)
+/* Controller uses Auto CMD12 command to stop the transfer */
+#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (127)
 
int irq;/* Device IRQ */
void __iomem *  ioaddr; /* Mapped address */
-- 
1.5.6.5


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH v4 1/2] powerpc: cleanup APIs for cpu/thread/core mappings

2010-08-02 Thread Benjamin Herrenschmidt
On Thu, 2010-07-22 at 06:27 +0530, Vaidyanathan Srinivasan wrote:
 These APIs take logical cpu number as input
 Change cpu_first_thread_in_core() to cpu_leftmost_thread_sibling()
 Change cpu_last_thread_in_core() to cpu_rightmost_thread_sibling()

I'm still not happy here.

I don't find leftmost/rightmost to be a progress from the previous
naming. If you really want to change to avoid in_core() at the end, then
call them first_thread_sibling() and last_thread_sibling().

Then you change:

 -static inline int cpu_thread_to_core(int cpu)
 -{
 - return cpu  threads_shift;
 -}

  .../... to:

 -/* Must be called when no change can occur to cpu_present_mask,
 +/* Helper routines for cpu to core mapping */
 +int cpu_core_of_thread(int cpu)
 +{
 + return cpu  threads_shift;
 +}
 +EXPORT_SYMBOL_GPL(cpu_core_of_thread);

Any reason you are making it out of line other than gratuituous
bloat ? :-)

 +int cpu_first_thread_of_core(int core)
 +{
 + return core  threads_shift;
 +}
 +EXPORT_SYMBOL_GPL(cpu_first_thread_of_core);

Same.

Ben.

 +/* Must be called when no change can occur to cpu_present_map,
   * i.e. during cpu online or offline.
   */
  static struct device_node *cpu_to_l2cache(int cpu)
 @@ -527,7 +540,7 @@ int __devinit start_secondary(void *unused)
   notify_cpu_starting(cpu);
   set_cpu_online(cpu, true);
   /* Update sibling maps */
 - base = cpu_first_thread_in_core(cpu);
 + base = cpu_leftmost_thread_sibling(cpu);
   for (i = 0; i  threads_per_core; i++) {
   if (cpu_is_offline(base + i))
   continue;
 @@ -606,7 +619,7 @@ int __cpu_disable(void)
   return err;
  
   /* Update sibling maps */
 - base = cpu_first_thread_in_core(cpu);
 + base = cpu_leftmost_thread_sibling(cpu);
   for (i = 0; i  threads_per_core; i++) {
   cpumask_clear_cpu(cpu, cpu_sibling_mask(base + i));
   cpumask_clear_cpu(base + i, cpu_sibling_mask(cpu));
 diff --git a/arch/powerpc/mm/mmu_context_nohash.c 
 b/arch/powerpc/mm/mmu_context_nohash.c
 index ddfd7ad..22f3bc5 100644
 --- a/arch/powerpc/mm/mmu_context_nohash.c
 +++ b/arch/powerpc/mm/mmu_context_nohash.c
 @@ -111,8 +111,8 @@ static unsigned int steal_context_smp(unsigned int id)
* a core map instead but this will do for now.
*/
   for_each_cpu(cpu, mm_cpumask(mm)) {
 - for (i = cpu_first_thread_in_core(cpu);
 -  i = cpu_last_thread_in_core(cpu); i++)
 + for (i = cpu_leftmost_thread_sibling(cpu);
 +  i = cpu_rightmost_thread_sibling(cpu); i++)
   __set_bit(id, stale_map[i]);
   cpu = i - 1;
   }
 @@ -264,14 +264,14 @@ void switch_mmu_context(struct mm_struct *prev, struct 
 mm_struct *next)
*/
   if (test_bit(id, stale_map[cpu])) {
   pr_hardcont( | stale flush %d [%d..%d],
 - id, cpu_first_thread_in_core(cpu),
 - cpu_last_thread_in_core(cpu));
 + id, cpu_leftmost_thread_sibling(cpu),
 + cpu_rightmost_thread_sibling(cpu));
  
   local_flush_tlb_mm(next);
  
   /* XXX This clear should ultimately be part of 
 local_flush_tlb_mm */
 - for (i = cpu_first_thread_in_core(cpu);
 -  i = cpu_last_thread_in_core(cpu); i++) {
 + for (i = cpu_leftmost_thread_sibling(cpu);
 +  i = cpu_rightmost_thread_sibling(cpu); i++) {
   __clear_bit(id, stale_map[i]);
   }
   }


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 3/3] P4080/mtd: Fix the freescale lbc issue with 36bit mode

2010-08-02 Thread Roy Zang
From: Lan Chunhe-B25806 b25...@freescale.com

When system uses 36bit physical address, res.start is 36bit
physical address. But the function of in_be32 returns 32bit
physical address. Then both of them compared each other is
wrong. So by converting the address of res.start into
the right format fixes this issue.

Signed-off-by: Lan Chunhe-B25806 b25...@freescale.com
Signed-off-by: Roy Zang tie-fei.z...@freescale.com
---
 arch/powerpc/include/asm/fsl_lbc.h |1 +
 arch/powerpc/sysdev/fsl_lbc.c  |   33 -
 drivers/mtd/nand/fsl_elbc_nand.c   |2 +-
 3 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/fsl_lbc.h 
b/arch/powerpc/include/asm/fsl_lbc.h
index 9b95eab..28dcf63 100644
--- a/arch/powerpc/include/asm/fsl_lbc.h
+++ b/arch/powerpc/include/asm/fsl_lbc.h
@@ -249,6 +249,7 @@ struct fsl_upm {
int width;
 };
 
+extern unsigned int convert_lbc_address(phys_addr_t addr_base);
 extern int fsl_lbc_find(phys_addr_t addr_base);
 extern int fsl_upm_find(phys_addr_t addr_base, struct fsl_upm *upm);
 
diff --git a/arch/powerpc/sysdev/fsl_lbc.c b/arch/powerpc/sysdev/fsl_lbc.c
index 9c9e44f..08f98d8 100644
--- a/arch/powerpc/sysdev/fsl_lbc.c
+++ b/arch/powerpc/sysdev/fsl_lbc.c
@@ -31,6 +31,36 @@ struct fsl_lbc_ctrl *fsl_lbc_ctrl_dev;
 EXPORT_SYMBOL(fsl_lbc_ctrl_dev);
 
 /**
+ * convert_lbc_address - convert the base address
+ * @addr_base: base address of the memory bank
+ *
+ * This function converts a base address of lbc into the right format for the 
BR
+ * registers. If the SOC has eLBC then it returns 32bit physical address else
+ * it returns 34bit physical address for local bus(Example: MPC8641).
+ */
+unsigned int convert_lbc_address(phys_addr_t addr_base)
+{
+   void *dev;
+   int compatible;
+
+   dev = of_find_node_by_name(NULL, localbus);
+   if (!dev) {
+   printk(KERN_INFO fsl-lbc: can't find localbus node\n);
+   of_node_put(dev);
+   return 0;
+   }
+
+   compatible = of_device_is_compatible(dev, fsl,elbc);
+   of_node_put(dev);
+   if (compatible)
+   return addr_base  0x8000;
+   else
+   return (addr_base  0x08000ull) \
+   | ((addr_base  0x3ull)  19);
+}
+EXPORT_SYMBOL(convert_lbc_address);
+
+/**
  * fsl_lbc_find - find Localbus bank
  * @addr_base: base address of the memory bank
  *
@@ -50,7 +80,8 @@ int fsl_lbc_find(phys_addr_t addr_base)
__be32 br = in_be32(fsl_lbc_ctrl_dev-regs-bank[i].br);
__be32 or = in_be32(fsl_lbc_ctrl_dev-regs-bank[i].or);
 
-   if (br  BR_V  (br  or  BR_BA) == addr_base)
+   if (br  BR_V  (br  or  BR_BA) \
+   == convert_lbc_address(addr_base))
return i;
}
 
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index 7bbcb3f..0e8dc40 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -838,7 +838,7 @@ static int __devinit fsl_elbc_nand_probe(struct of_device 
*dev,
(in_be32(lbc-bank[bank].br)  BR_MSEL) == BR_MS_FCM 
(in_be32(lbc-bank[bank].br) 
 in_be32(lbc-bank[bank].or)  BR_BA)
-== res.start)
+== convert_lbc_address(res.start))
break;
 
if (bank = MAX_BANKS) {
-- 
1.5.6.5


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: Please pull my perf.git urgent branch

2010-08-02 Thread Ingo Molnar

* Scott Wood scottw...@freescale.com wrote:

 On Wed, 28 Jul 2010 14:47:31 +1000
 Paul Mackerras pau...@samba.org wrote:
 
  On Tue, Jul 27, 2010 at 11:28:54AM -0500, Scott Wood wrote:
  
   Doesn't the setting of .period need to be maintained (it is in the other
   powerpc perf_event implementation that this is derived from)?
  
  Gah, yes it does.
 
 Well, looks like Linus pulled anyway...  I'll send a patch to
 add .period.

Yes, the original commit was already upstream when you reported this bug.

Paul added a -stable tag to the fix so it will get into the .35.1 pipeline 
this week.

Thanks,

Ingo
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 0/2 v3] mpc5200 ac97 gpio reset

2010-08-02 Thread Mark Brown
On Sat, Jul 31, 2010 at 10:42:15PM -0600, Grant Likely wrote:
 On Sun, Jun 27, 2010 at 4:01 PM, Mark Brown

  I'm a little concerned with a collision with multi codec here. It'd
  be handy if you could keep it separate in case it needs merging
  into both trees (or we could merge via ASoC only).

 Hmmm.  Yeah, probably better to take it via your tree then.  I've
 currently got patch 1 in linux-next, but I'll drop it before asking
 benh to pull.  Go ahead and add my acked-by.

Looks like multi-component is slightly too late for .36 and I don't have
the original patch any more since it looked like you were going to be
carrying it...  could you restore the patch to your tree please?
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev