[linux-yocto] [PATCH 38/39] i2c: comforming to changes introduced by move of_i2c to core

2014-04-11 Thread Charlie Paul
From: Paul Butler 

LSI driver updates to conform to changes introduced by:
commit f78f5da062c3e5991643664d2463adf1f2294e04
Author: Wolfram Sang 
Date:   Thu Jul 11 12:56:15 2013 +0100

i2c: move OF helpers into the core

Signed-off-by: Paul Butler 
---
 drivers/i2c/busses/acp3400-i2c.c |3 ---
 drivers/i2c/busses/i2c-axxia.c   |3 ---
 2 files changed, 6 deletions(-)

diff --git a/drivers/i2c/busses/acp3400-i2c.c b/drivers/i2c/busses/acp3400-i2c.c
index de4eff6..b4febc0 100644
--- a/drivers/i2c/busses/acp3400-i2c.c
+++ b/drivers/i2c/busses/acp3400-i2c.c
@@ -19,7 +19,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -464,8 +463,6 @@ static int acp34xx_i2c_probe(struct platform_device *dev)
 
pr_info("%s: adapter has been added\n", np->full_name);
 
-   of_i2c_register_devices(&i2c->adap);
-
dev_set_drvdata(&dev->dev, i2c);
return 0;
 err:
diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index c2b84a4..86fc695 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #define SCL_WAIT_TIMEOUT_NS 2500
@@ -573,8 +572,6 @@ axxia_i2c_probe(struct platform_device *pdev)
 
platform_set_drvdata(pdev, idev);
 
-   of_i2c_register_devices(&idev->adapter);
-
return 0;
 }
 
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 36/39] arch/powerpc: Clean up of Compatible Names in Axxia Device Trees

2014-04-11 Thread Charlie Paul
From: John Jacques 

The base compatible type for Axxia (PowerPC) is not lsi,acp.

Signed-off-by: John Jacques 
---
 arch/powerpc/platforms/44x/acpx1.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/44x/acpx1.c 
b/arch/powerpc/platforms/44x/acpx1.c
index b903787..934ea0a 100644
--- a/arch/powerpc/platforms/44x/acpx1.c
+++ b/arch/powerpc/platforms/44x/acpx1.c
@@ -253,7 +253,7 @@ static int __init acpx14xx_probe(void)
 {
unsigned long root = of_get_flat_dt_root();
 
-   if (!of_flat_dt_is_compatible(root, "ibm,acpx1-4xx"))
+   if (!of_flat_dt_is_compatible(root, "lsi,acp"))
return 0;
 
return 1;
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 35/39] arch/powerpc: Update the Axxia Device Tree Files

2014-04-11 Thread Charlie Paul
From: John Jacques 

A new system, 3500, was added which required some changes
to the device trees.

Signed-off-by: John Jacques 
---
 arch/powerpc/boot/dts/acp25xx.dts |  391 ++---
 arch/powerpc/boot/dts/acp342x.dts |  349 +
 arch/powerpc/boot/dts/acp344x.dts |  164 +++-
 arch/powerpc/boot/dts/acp35xx.dts |   99 ++
 4 files changed, 540 insertions(+), 463 deletions(-)

diff --git a/arch/powerpc/boot/dts/acp25xx.dts 
b/arch/powerpc/boot/dts/acp25xx.dts
index 9893cf9..ad9dfe8 100644
--- a/arch/powerpc/boot/dts/acp25xx.dts
+++ b/arch/powerpc/boot/dts/acp25xx.dts
@@ -1,10 +1,10 @@
 /*
- * Device Tree Source for IBM Embedded PPC 476 Platform
+ * Device Tree Source for LSI ACP25xx.
  *
- * Copyright 2009 Torez Smith, IBM Corporation.
+ * Copyright 2013, LSI Corporation
  *
  * Based on earlier code:
- * Copyright (c) 2006, 2007 IBM Corp.
+ * Copyright (c) 2009, 2006, 2007 IBM Corp.
  * Josh Boyer , David Gibson 
  *
  * This file is licensed under the terms of the GNU General Public
@@ -17,164 +17,198 @@
 /memreserve/ 0x 0x0040;
 
 / {
-#address-cells = <2>;
-#size-cells = <1>;
-model = "ibm,acpx1-4xx";
-compatible = "ibm,acpx1-4xx","ibm,47x-AMP";
-dcr-parent = <&{/cpus/cpu@0}>;
+   #address-cells = <2>;
+   #size-cells = <1>;
+   model = "ibm,acpx1-4xx";
+   compatible = "ibm,acpx1-4xx","ibm,47x-AMP";
+   dcr-parent = <&{/cpus/cpu@0}>;
 
-aliases {
-serial0 = &UART0;
-serial1 = &UART1;
-rapidio0 = &rio0;
+   aliases {
+   serial0   = &UART0;
+   serial1   = &UART1;
ethernet0 = &FEMAC;
-};
+   rapidio0  = &SRIO0;
+   };
 
-cpus {
-#address-cells = <1>;
-#size-cells = <0>;
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
 
-cpu@0 {
-device_type = "cpu";
-model = "PowerPC,4xx"; // real CPU changed in sim
-reg = <0>;
-clock-frequency = <0x5f5e1000>;
-timebase-frequency = <0x5f5e1000>;
-i-cache-line-size = <32>;
-d-cache-line-size = <32>;
-i-cache-size = <32768>;
-d-cache-size = <32768>;
-dcr-controller;
-dcr-access-method = "native";
-status = "ok";
-reset-type = <3>; // 1=core, 2=chip, 3=system (default)
-};
-};
+   cpu@0 {
+   device_type = "cpu";
+   model = "PowerPC,4xx"; // real CPU changed in sim
+   reg = <0>;
+   clock-frequency = <0>; // filled in by U-Boot
+   timebase-frequency = <0>; // filled in by U-Boot
+   i-cache-line-size = <32>;
+   d-cache-line-size = <32>;
+   i-cache-size = <32768>;
+   d-cache-size = <32768>;
+   dcr-controller;
+   dcr-access-method = "native";
+   status = "ok";
+   reset-type = <3>; // 1=core, 2=chip, 3=system (default)
+   };
+
+   cpu@1 {
+   device_type = "cpu";
+   model = "PowerPC,4xx"; // real CPU changed in sim
+   reg = <1>;
+   clock-frequency = <0>; // filled in by U-Boot
+   timebase-frequency = <0>; // filled in by U-Boot
+   i-cache-line-size = <32>;
+   d-cache-line-size = <32>;
+   i-cache-size = <32768>;
+   d-cache-size = <32768>;
+   dcr-controller;
+   dcr-access-method = "native";
+   status = "disabled";
+   enable-method = "spin-table";
+   cpu-release-addr = <0 0>; // Fixed by the boot loader
+   reset-type = <3>; // 1=core, 2=chip, 3=system (default)
+   };
+   };
 
 memory@0 {
 device_type = "memory";
-reg = <0x 0x 0x8000>; // filled in by 
U-Boot
+reg = <0x 0x 0x>; // filled in by 
U-Boot
 };
 
 memory@8000 {
 device_type = "memory";
-reg = <0x 0x8000 0x8000>; // filled in by 
U-Boot
+reg = <0x 0x 0x>; // filled in by 
U-Boot
 };
 
-MPIC: interrupt-controller {
-compatible = "chrp,open-pic";
- 

[linux-yocto] [PATCH 37/39] LSI drivers/tty: Axxia Serial Driver Update

2014-04-11 Thread Charlie Paul
From: John Jacques 

Updated to work with the 3500 variant.

Signed-off-by: John Jacques 
---
 drivers/tty/serial/lsi_acp_serial.c |  103 ---
 1 file changed, 58 insertions(+), 45 deletions(-)

diff --git a/drivers/tty/serial/lsi_acp_serial.c 
b/drivers/tty/serial/lsi_acp_serial.c
index f9676ca..c03f29b 100644
--- a/drivers/tty/serial/lsi_acp_serial.c
+++ b/drivers/tty/serial/lsi_acp_serial.c
@@ -81,9 +81,8 @@ struct uart_acp_port {
unsigned int interrupt_mask;
unsigned int old_status;
void *timer_base;
-   unsigned long divisor;
-   unsigned char ibrd;
-   unsigned char fbrd;
+   unsigned short ibrd;
+   unsigned short fbrd;
 };
 
 /*
@@ -119,25 +118,10 @@ struct uart_acp_port {
 static int
 get_clock_stuff(struct uart_acp_port *port, int baud_rate)
 {
-   unsigned long divisor;
unsigned long ibrd;
unsigned long fbrd;
 
-   /*
- Since the IBDR (integer part of the baud rate
- divisor) is a 16 bit quatity, find the minimum load
- value that will let the IBDR/FBDR result in the
- desired baud rate.
-   */
-
-   if (100 < per_clock) {
-   divisor = per_clock / 2500;
-   ibrd = 2500 / (16 * baud_rate);
-   } else {
-   /* Emulation is much slower... */
-   divisor = per_clock / 325;
-   ibrd = 325 / (16 * baud_rate);
-   }
+   ibrd = per_clock / (16 * baud_rate);
 
/*
 * The following formula is from the ARM document (ARM DDI 0183E).
@@ -164,36 +148,15 @@ get_clock_stuff(struct uart_acp_port *port, int baud_rate)
 * 2 * (16 * baud_rate)
 */
 
-   port->port.uartclk = (per_clock / divisor);
+   port->port.uartclk = per_clock;
 
fbrd = port->port.uartclk % (16 * baud_rate);
fbrd *= 128;
fbrd += (16 * baud_rate);
fbrd /= (2 * (16 * baud_rate));
 
-   port->divisor = (divisor - 1);
-   port->ibrd = (unsigned char) ibrd;
-   port->fbrd = (unsigned char) fbrd;
-
-   if (port->divisor != in_le32(port->timer_base + TIMER_LOAD)) {
-   while (0 ==
-  (in_le32((const volatile unsigned *)
-   (port->port.membase + UART01x_FR)) &
-   UART011_FR_TXFE))
-   ;
-
-   while (0 !=
-  (in_le32((const volatile unsigned *)
-   (port->port.membase + UART01x_FR)) &
-   UART01x_FR_BUSY))
-   ;
-
-   out_le32((port->timer_base + TIMER_CONTROL), 0);
-   out_le32((port->timer_base + TIMER_LOAD), port->divisor);
-   out_le32((port->timer_base + TIMER_CONTROL),
-(TIMER_CONTROL_ENABLE |
- TIMER_CONTROL_MODE));
-   }
+   port->ibrd = (unsigned short) ibrd;
+   port->fbrd = (unsigned short) fbrd;
 
return 0;
 }
@@ -461,7 +424,7 @@ unsigned int acp_serial_get_mctrl(struct uart_port *port)
 #define TIOCMBIT(uartbit, tiocmbit) do { \
if (status & (uartbit))  \
result |= (tiocmbit);\
-} while (0);
+} while (0)
TIOCMBIT(UART01x_FR_DCD, TIOCM_CAR);
TIOCMBIT(UART01x_FR_DSR, TIOCM_DSR);
TIOCMBIT(UART01x_FR_CTS, TIOCM_CTS);
@@ -482,7 +445,7 @@ void acp_serial_set_mctrl(struct uart_port *port, unsigned 
int mctrl)
cr |= uartbit;   \
else \
cr &= ~uartbit;  \
-} while (0);
+} while (0)
 
TIOCMBIT(TIOCM_RTS, UART011_CR_RTS);
TIOCMBIT(TIOCM_DTR, UART011_CR_DTR);
@@ -766,8 +729,13 @@ acp_serial_set_termios(struct uart_port *port, struct 
ktermios *termios,
out_le32((u32 *)(uap->port.membase + UART011_CR), 0);
 
/* Set baud rate */
+#if 1
out_le32((u32 *)(uap->port.membase + UART011_FBRD), uap->fbrd);
out_le32((u32 *)(uap->port.membase + UART011_IBRD), uap->ibrd);
+#else
+   out_le32((u32 *)(uap->port.membase + UART011_FBRD), 0x13);
+   out_le32((u32 *)(uap->port.membase + UART011_IBRD), 0x598);
+#endif
 
/*
 * --v--v--v--v-
@@ -1134,6 +1102,51 @@ acp_serial_add_ports(struct uart_driver *driver)
ret = -ENOMEM;
}
 
+   np = of_find_compatible_node(NULL, NULL, "lsi,acp3500");
+
+   if (NULL == np) {
+   unsigned long divisor;
+
+   /*
+ In the 3500 case, the peripheral clock is connected
+ directly to the UART.  If this isn't 3500, set up
+ the second timer (which is in between the peripheral
+ clock and the UART) and adjust per_clock
+ accordingly.
+   */
+
+   if (100 < per_clock) {
+   divisor = 

[linux-yocto] [PATCH 32/39] arch/arm/mach-axxia: Name Cleanup

2014-04-11 Thread Charlie Paul
From: John Jacques 

Change emulation to emu to match the other targets (sim for
simulation, etc.).

Signed-off-by: John Jacques 
---
 arch/arm/boot/dts/axm5504-emu.dts |2 +-
 arch/arm/boot/dts/axm5507-emu.dts |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/axm5504-emu.dts 
b/arch/arm/boot/dts/axm5504-emu.dts
index 9ddce7d..0d7ca8f 100644
--- a/arch/arm/boot/dts/axm5504-emu.dts
+++ b/arch/arm/boot/dts/axm5504-emu.dts
@@ -18,7 +18,7 @@
 
 / {
model = "Emulation Platform AXM55xx";
-   compatible = "lsi,axm5516-emulation", "lsi,axm5516";
+   compatible = "lsi,axm5516-emu", "lsi,axm5516";
 
memory {
device_type = "memory";
diff --git a/arch/arm/boot/dts/axm5507-emu.dts 
b/arch/arm/boot/dts/axm5507-emu.dts
index 201f3af..8de0b23 100644
--- a/arch/arm/boot/dts/axm5507-emu.dts
+++ b/arch/arm/boot/dts/axm5507-emu.dts
@@ -18,7 +18,7 @@
 
 / {
model = "Emulation Platform AXM55xx";
-   compatible = "lsi,axm5516-emulation", "lsi,axm5516";
+   compatible = "lsi,axm5516-emu", "lsi,axm5516";
 
memory {
device_type = "memory";
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 31/39] LSI AXXIA: Basic perf support for axxia plaform block provided by LSI.

2014-04-11 Thread Charlie Paul
From: Jonas Svennebring 

The basic support includes:
* Generic AXXIA SMON (Statistic Monitor) functionality.

 * Support for Memory Controllers:
- DDRC, DDR Controllers.
- ELM, Encryption Memory Controllers .

 *Preparation for support of:
- PCX, integrated Ethernet switch.
- VP, virtual pipeline packet processing engines.

 Documentation, VP/PCX support as well as patch alignment with coming
 ARM L3$ and interconnect is in the workings.

Signed-off-by: Jonas Svennebring 
---
 arch/arm/mach-axxia/perf_event_memc.c |  130 ++
 arch/arm/mach-axxia/perf_event_memc.h |   62 +++
 arch/arm/mach-axxia/perf_event_pcx.c  |   46 +
 arch/arm/mach-axxia/perf_event_platform.c |  270 +
 arch/arm/mach-axxia/perf_event_platform.h |   10 ++
 arch/arm/mach-axxia/perf_event_vp.c   |   51 ++
 arch/arm/mach-axxia/smon.c|  200 +
 arch/arm/mach-axxia/smon.h|   71 
 8 files changed, 840 insertions(+)
 create mode 100644 arch/arm/mach-axxia/perf_event_memc.c
 create mode 100644 arch/arm/mach-axxia/perf_event_memc.h
 create mode 100644 arch/arm/mach-axxia/perf_event_pcx.c
 create mode 100644 arch/arm/mach-axxia/perf_event_platform.c
 create mode 100644 arch/arm/mach-axxia/perf_event_platform.h
 create mode 100644 arch/arm/mach-axxia/perf_event_vp.c
 create mode 100644 arch/arm/mach-axxia/smon.c
 create mode 100644 arch/arm/mach-axxia/smon.h

diff --git a/arch/arm/mach-axxia/perf_event_memc.c 
b/arch/arm/mach-axxia/perf_event_memc.c
new file mode 100644
index 000..a20fc8a
--- /dev/null
+++ b/arch/arm/mach-axxia/perf_event_memc.c
@@ -0,0 +1,130 @@
+/*
+ * arch/arm/mach-axxia/perf_event_memc.c
+ * included from arch/arm/mach-axxia/perf_event_platform.c
+ *
+ * Support for the LSI Axxia boards based on ARM cores.
+ *
+ * Copyright (C) 2014 LSI
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "perf_event_memc.h"
+
+static void memc_startup_init(void)
+{
+   smon_init_ncp(&ddrc0_smon, DDRC0, DDRC_PERF, DDRC_SMON);
+   smon_init_ncp(&ddrc1_smon, DDRC1, DDRC_PERF, DDRC_SMON);
+   smon_init_mem(&elm0_smon, ELM0, ELM_SMON);
+   smon_init_mem(&elm1_smon, ELM1, ELM_SMON);
+}
+
+static uint32_t memc_pmu_event_init(uint32_t event, struct perf_event *pevent)
+{
+   return 0;
+}
+
+static void memc_pmu_event_destroy(uint32_t event, struct perf_event *pevent)
+{
+   smon_stop_if_unassigned(&ddrc0_smon);
+   smon_stop_if_unassigned(&ddrc1_smon);
+   smon_stop_if_unassigned(&elm0_smon);
+   smon_stop_if_unassigned(&elm1_smon);
+}
+
+static uint32_t memc_pmu_event_add(uint32_t ev, struct perf_event *pevent)
+{
+   uint32_t ret;
+
+   if (ev >= DDRC0_OFFSET && ev <= DDRC0_SMON_MAX) {
+
+   ret = smon_allocate(&ddrc0_smon, ev - DDRC0_OFFSET);
+   if (ret != 0)
+   return ret;
+
+   ret = smon_start(&ddrc0_smon, ev - DDRC0_OFFSET);
+   if (ret != 0)
+   return ret;
+   } else if (ev >= DDRC1_OFFSET && ev <= DDRC1_SMON_MAX) {
+
+   ret = smon_allocate(&ddrc1_smon, ev - DDRC1_OFFSET);
+   if (ret != 0)
+   return ret;
+
+   ret = smon_start(&ddrc1_smon, ev - DDRC1_OFFSET);
+   if (ret != 0)
+   return ret;
+   } else if (ev >= ELM0_OFFSET && ev <= ELM0_SMON_MAX) {
+
+   ret = smon_allocate(&elm0_smon, ev - ELM0_OFFSET);
+   if (ret != 0)
+   return ret;
+
+   ret = smon_start(&elm0_smon, ev - ELM0_OFFSET);
+   if (ret != 0)
+   return ret;
+   } else if (ev >= ELM1_OFFSET && ev <= ELM1_SMON_MAX) {
+
+   ret = smon_allocate(&elm1_smon, ev - ELM1_OFFSET);
+   if (ret != 0)
+   return ret;
+
+   ret = smon_start(&elm1_smon, ev - ELM1_OFFSET);
+   if (ret != 0)
+   return ret;
+   }
+
+   return 0;
+}
+
+/*
+ * Remove event and return counter update.
+ */
+static uint32_t memc_pmu_event_del(uint32_t ev, struct perf_event *pevent,
+   int flags)
+{
+   uint32_t count = 0;
+
+   if (ev >= DDRC0_OFFSET && 

[linux-yocto] [PATCH 33/39] arch/arm/mach-axxia: Work-Around for Event Problems in v1.0 Silicon

2014-04-11 Thread Charlie Paul
From: John Jacques 

SEV/WFE are unusable in v1.0 silicon.  The boot loader now sets bit 7
in the ACLTR register of each core, making wfe a nop.  At present,
bit 7 of the ACTLR does not work in simulation and emulaton.  Until
that is corrected, this work-around is necessary.

Signed-off-by: John Jacques 
---
 arch/arm/include/asm/spinlock.h |5 
 arch/arm/mach-axxia/Makefile|5 ++--
 arch/arm/mach-axxia/ev.c|   53 +++
 3 files changed, 61 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-axxia/ev.c

diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h
index b07c09e..be4ae62 100644
--- a/arch/arm/include/asm/spinlock.h
+++ b/arch/arm/include/asm/spinlock.h
@@ -88,7 +88,12 @@ static inline void arch_spin_lock(arch_spinlock_t *lock)
: "cc");
 
while (lockval.tickets.next != lockval.tickets.owner) {
+#ifdef CONFIG_ARCH_AXXIA
+   extern void __axxia_arch_wfe(void);
+   __axxia_arch_wfe();
+#else
wfe();
+#endif
lockval.tickets.owner = ACCESS_ONCE(lock->tickets.owner);
}
 
diff --git a/arch/arm/mach-axxia/Makefile b/arch/arm/mach-axxia/Makefile
index 62197f1..8125e97 100644
--- a/arch/arm/mach-axxia/Makefile
+++ b/arch/arm/mach-axxia/Makefile
@@ -3,8 +3,9 @@
 #
 obj-y  += axxia.o
 obj-y  += clock.o
-obj-y   += io.o
-obj-y   += ssp-gpio.o
+obj-y  += ev.o
+obj-y  += io.o
+obj-y  += ssp-gpio.o
 obj-y  += ncr.o
 obj-y  += timers.o
 obj-y  += pci.o
diff --git a/arch/arm/mach-axxia/ev.c b/arch/arm/mach-axxia/ev.c
new file mode 100644
index 000..f4630d1
--- /dev/null
+++ b/arch/arm/mach-axxia/ev.c
@@ -0,0 +1,53 @@
+/*
+ * arch/arm/mach-axxia/ev.c
+ *
+ * Support for the LSI Axxia boards based on ARM cores.
+ *
+ * Copyright (C) 2012 LSI
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static int initialized;
+static int wfe_available;
+
+inline void
+__axxia_arch_wfe(void)
+{
+   if (0 == initialized) {
+   if (of_find_compatible_node(NULL, NULL,
+   "lsi,axm5516-sim") != NULL ||
+   of_find_compatible_node(NULL, NULL,
+   "lsi,axm5516-emu") != NULL)
+   wfe_available = 0;
+   else
+   wfe_available = 1;
+
+   initialized = 1;
+   }
+
+   if (0 != wfe_available)
+   wfe();
+
+   return;
+}
+EXPORT_SYMBOL(__axxia_arch_wfe);
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 34/39] LSI powerpc/sysdev: Removing the power of 2 size restriction

2014-04-11 Thread Charlie Paul
From: SangeethaRao 

Removed the power of 2 size restriction for PCIe inbound
mapping in LSI PCIe driver

Signed-off-by: SangeethaRao 
---
 arch/powerpc/sysdev/lsi_pci.c |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/sysdev/lsi_pci.c b/arch/powerpc/sysdev/lsi_pci.c
index ca1506d..e9beadc 100644
--- a/arch/powerpc/sysdev/lsi_pci.c
+++ b/arch/powerpc/sysdev/lsi_pci.c
@@ -152,9 +152,8 @@ static int __init acp_parse_dma_ranges(struct 
pci_controller *hose,
return -ENXIO;
}
 
-   /* Check we are a power of 2 size and that base is a multiple of size*/
-   if ((size & (size - 1)) != 0  ||
-   (res->start & (size - 1)) != 0) {
+   /* Check that base is a multiple of size*/
+   if ((res->start & (size - 1)) != 0) {
pr_err("%s: dma-ranges unaligned\n",
   hose->dn->full_name);
return -ENXIO;
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 39/39] gpio: repairs merge comflict

2014-04-11 Thread Charlie Paul
From: Paul Butler 

A merge conflict resolution in aafea43a1528d028c66849e8266c04675aa6690d
reverted a change added in f8e6479d13bce233ff4f9ef58a522a4225ff651d

Signed-off-by: Paul Butler 
---
 drivers/gpio/gpio-pl061.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index 0254470..c13f8d1 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -358,7 +358,7 @@ static int pl061_probe(struct device *dev,
irq_set_chained_handler(irq, pl061_irq_handler);
irq_set_handler_data(irq, chip);
 
-   chip->domain = irq_domain_add_simple(adev->dev.of_node, PL061_GPIO_NR,
+   chip->domain = irq_domain_add_simple(dev->of_node, PL061_GPIO_NR,
 irq_base, &pl061_domain_ops, chip);
if (!chip->domain)
return -ENODEV;
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 30/39] arm/mm: Backport of 3159f372354e8e1f5dee714663d70

2014-04-11 Thread Charlie Paul
From: Jonas Svennebring 

 ARM: 7840/1: LPAE: don't reject mapping /dev/mem above 4GB

 commit 3159f372354e8e1f5dee714663d70 upstream

 With LPAE enabled, physical address space is larger than 4GB. Allow 
mapping any
 part of it via /dev/mem by using PHYS_MASK to determine valid range.

 PHYS_MASK covers 40 bits with LPAE enabled and 32 bits otherwise.

 Reported-by: Vassili Karpov 
 Signed-off-by: Sergey Dyasly 
 Acked-by: Catalin Marinas 
 Signed-off-by: Russell King 
 Signed-off-by: Jonas Svennebring 
---
 arch/arm/mm/mmap.c |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
index f0ef2f7..18d6aeb 100644
--- a/arch/arm/mm/mmap.c
+++ b/arch/arm/mm/mmap.c
@@ -11,7 +11,7 @@
 #include 
 #include 
 
-#define COLOUR_ALIGN(addr,pgoff)   \
+#define COLOUR_ALIGN(addr, pgoff)  \
addr)+SHMLBA-1)&~(SHMLBA-1)) +  \
 (((pgoff)> PAGE_SHIFT) > 0x0010);
+   return (pfn + (size >> PAGE_SHIFT)) <= (1 + (PHYS_MASK >> PAGE_SHIFT));
 }
 
 #ifdef CONFIG_STRICT_DEVMEM
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 29/39] axxia: Updated Device Trees Signed-off-by: John Jacques

2014-04-11 Thread Charlie Paul
From: John Jacques 

---
 arch/arm/boot/dts/Makefile  |5 +
 arch/arm/boot/dts/axm-sim.dts   |  403 ---
 arch/arm/boot/dts/axm-ve-tc1.dts|  363 
 arch/arm/boot/dts/axm-ve-tc2.dts|  174 -
 arch/arm/boot/dts/axm5504-emu.dts   |   44 
 arch/arm/boot/dts/axm5504-emulation.dts |   44 
 arch/arm/boot/dts/axm5507-cpus.dtsi |   73 ++
 arch/arm/boot/dts/axm5507-emu.dts   |   44 
 arch/arm/boot/dts/axm5516-sim.dts   |  127 ++
 arch/powerpc/boot/dts/acp25xx.dts   |2 +-
 arch/powerpc/boot/dts/acp342x.dts   |2 +-
 arch/powerpc/boot/dts/acp344x.dts   |2 +-
 arch/powerpc/boot/dts/acp35xx.dts   |2 +-
 13 files changed, 297 insertions(+), 988 deletions(-)
 delete mode 100644 arch/arm/boot/dts/axm-sim.dts
 delete mode 100644 arch/arm/boot/dts/axm-ve-tc1.dts
 delete mode 100644 arch/arm/boot/dts/axm-ve-tc2.dts
 create mode 100644 arch/arm/boot/dts/axm5504-emu.dts
 delete mode 100644 arch/arm/boot/dts/axm5504-emulation.dts
 create mode 100644 arch/arm/boot/dts/axm5507-cpus.dtsi
 create mode 100644 arch/arm/boot/dts/axm5507-emu.dts
 create mode 100644 arch/arm/boot/dts/axm5516-sim.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index dbd0158..5d73aba 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -220,6 +220,11 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
wm8505-ref.dtb \
wm8650-mid.dtb \
wm8850-w70v2.dtb
+dtb-$(CONFIG_ARCH_AXXIA) += axm5504-sim.dtb \
+   axm5516-sim.dtb \
+   axm5504-emu.dtb \
+   axm5507-emu.dtb \
+   axm5516-amarillo.dtb
 dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \
zynq-zc706.dtb
 
diff --git a/arch/arm/boot/dts/axm-sim.dts b/arch/arm/boot/dts/axm-sim.dts
deleted file mode 100644
index bb46808..000
--- a/arch/arm/boot/dts/axm-sim.dts
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * arch/arm/boot/dts/axm-sim.dts
- *
- * Copyright (C) 2012 LSI
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-/dts-v1/;
-
-/ {
-   model = "AXM5516";
-   compatible = "arm", "lsi,axm5516";
-   interrupt-parent = <&gic>;
-   #address-cells = <2>;
-   #size-cells = <2>;
-
-   chosen { };
-
-   aliases {
-   serial0 = &axxia_serial0;
-   serial1 = &axxia_serial1;
-   serial2 = &axxia_serial2;
-   serial3 = &axxia_serial3;
-   timer   = &axxia_timers;
-   };
-
-   cpus {
-   #address-cells = <1>;
-   #size-cells = <0>;
-
-   cpu@0 {
-   device_type = "cpu";
-   compatible = "arm,cortex-a15";
-   reg = <0>;
-   };
-
-   cpu@1 {
-   device_type = "cpu";
-   compatible = "arm,cortex-a15";
-   reg = <1>;
-   };
-
-   cpu@2 {
-   device_type = "cpu";
-   compatible = "arm,cortex-a15";
-   reg = <2>;
-   };
-
-   cpu@3 {
-   device_type = "cpu";
-   compatible = "arm,cortex-a15";
-   reg = <3>;
-   };
-
-   cpu@4 {
-   device_type = "cpu";
-   compatible = "arm,cortex-a15";
-   reg = <4>;
-   };
-
-   cpu@5 {
-   device_type = "cpu";
-   compatible = "arm,cortex-a15";
-   reg = <5>;
-   };
-
-   cpu@6 {
-   device_type = "cpu";
-   compatible = "arm,cortex-a15";
-   reg = <6>;
-   };
-
-   cpu@7 {
-   device_type = "cpu";
-   compatible = "arm,cortex-a15";
-   reg = <7>;
-   };
-
-   cpu@8 {
-   device_type = "cpu";
-   compatible = "arm,cortex-a15";
-   reg = <8>;
-   };
-
-   cpu@9 {
-   device_

[linux-yocto] [PATCH 19/39] arm/axxia: improved robustness for DDR retention

2014-04-11 Thread Charlie Paul
From: Gary McGee 

- add new ncp_ddr_shutdown() function using private i/o functions.
  This eliminates unwanted code that may be introduced by use of
  the standard i/o macros/functions.
- do explicit memory copy to preload ncp_ddr_shutdown() into L2 cache
- initialize ELM sysmem capture to provide post-mortem debug capability
- fix VP engine quiesce to account for engines with different CMSI
  adaptation layers  (CAAL vs. CNAL).

Signed-off-by: Gary McGee 
---
 arch/arm/mach-axxia/Makefile|2 +-
 arch/arm/mach-axxia/ddr_retention.c |   94 --
 arch/arm/mach-axxia/ddr_shutdown.c  |  332 +++
 3 files changed, 365 insertions(+), 63 deletions(-)
 create mode 100644 arch/arm/mach-axxia/ddr_shutdown.c

diff --git a/arch/arm/mach-axxia/Makefile b/arch/arm/mach-axxia/Makefile
index 7dbad2a..8e7dec4 100644
--- a/arch/arm/mach-axxia/Makefile
+++ b/arch/arm/mach-axxia/Makefile
@@ -7,7 +7,7 @@ obj-y   += io.o
 obj-y  += ncr.o
 obj-y  += timers.o
 obj-y  += pci.o
-obj-y  += ddr_retention.o
+obj-y  += ddr_retention.o ddr_shutdown.o
 obj-$(CONFIG_I2C)  += i2c.o
 obj-$(CONFIG_SMP)  += platsmp.o headsmp.o
 obj-$(CONFIG_ARCH_AXXIA_GIC)   += axxia-gic.o
diff --git a/arch/arm/mach-axxia/ddr_retention.c 
b/arch/arm/mach-axxia/ddr_retention.c
index bcedf33..7dab78f 100644
--- a/arch/arm/mach-axxia/ddr_retention.c
+++ b/arch/arm/mach-axxia/ddr_retention.c
@@ -36,7 +36,6 @@
 static void __iomem *nca;
 static void __iomem *apb;
 static void __iomem *dickens;
-static void __iomem *femac;
 static int ddr_retention_enabled;
 
 enum {
@@ -229,53 +228,24 @@ static inline void cpu_disable_l2_prefetch(void)
 }
 
 static inline void
-ncp_ddr_shutdown(unsigned long ctl_244)
+reset_elm_trace(void)
 {
-   unsigned long value;
-
-   cpu_disable_l2_prefetch();
-
-   /*
-* put SDRAM in self-refresh mode
-*/
-   ncr_write(NCP_REGION_ID(34, 0), 0x3d0, 4, &ctl_244);
-   ncr_write(NCP_REGION_ID(15, 0), 0x3d0, 4, &ctl_244);
-
-   /* check interrupt status for completion */
-   /* CDR1 - word offset 0x104 (byte offset 0x410) */
-   do {
-   ncr_read(NCP_REGION_ID(34, 0), 0x410, 4, &value);
-   } while ((value & 0x0200) == 0);
+   /* reset and disable ELM trace */
+   ncr_register_write(htonl(0x000fff04), (unsigned *) (apb + 0x68000));
+   ncr_register_write(htonl(0x000fff04), (unsigned *) (apb + 0x78000));
 
-   do {
-   ncr_read(NCP_REGION_ID(15, 0), 0x410, 4, &value);
-   } while ((value & 0x0200) == 0);
-
-   /*
-Indicate DDR Retention Reset
-*/
-
-   /* set bit 0 of persist_scratch */
-   writel_relaxed(0x0001, apb + 0x300dc);
+   /* reset ELM statistics */
+   ncr_register_write(htonl(0x1), (unsigned *) (apb + 0x60230));
+   ncr_register_write(htonl(0x1), (unsigned *) (apb + 0x70230));
 
-   /*
-* Issue Chip Reset
-*/
+   /* enable ELM trace */
+   ncr_register_write(htonl(0x000fff01), (unsigned *) (apb + 0x68000));
+   ncr_register_write(htonl(0x000fff01), (unsigned *) (apb + 0x78000));
+}
 
-   /* Intrnl Boot, 0x Target */
-   writel_relaxed(0x0040, apb + 0x31004);
-   /* Set ResetReadDone */
-   writel_relaxed(0x8000, apb + 0x3180c);
-   /* Chip Reset */
-   writel_relaxed(0x00080802, apb + 0x31008);
 
-   wfi();
-   while (1)
-   ;
-   __asm__ __volatile__("nop\n\t");
+extern void ncp_ddr_shutdown(void *, void *,  unsigned long);
 
-   return;
-}
 
 void
 initiate_retention_reset(void)
@@ -283,6 +253,8 @@ initiate_retention_reset(void)
unsigned long ctl_244 = 0;
unsigned long value;
unsigned cpu_id;
+   volatile long tmp;
+   volatile long *ptmp;
 
if (0 == ddr_retention_enabled) {
pr_info("DDR Retention Reset is Not Enabled\n");
@@ -292,19 +264,17 @@ initiate_retention_reset(void)
if (NULL == nca || NULL == apb || NULL == dickens)
BUG();
 
-   /* kill the femac */
-   writel(0x8000, (femac+0x2000));
-   value = readl(femac + 0x2000);
-
preempt_disable();
cpu_id = smp_processor_id();
-   udelay(1000);
+
/* send stop message to other CPUs */
local_irq_disable();
+   local_fiq_disable();
asm volatile ("dsb" : : : "memory");
asm volatile ("dmb" : : : "memory");
system_state = SYSTEM_RESTART;
smp_send_stop();
+   udelay(1000);
 
flush_cache_all();
flush_l3();
@@ -314,11 +284,6 @@ initiate_retention_reset(void)
quiesce_vp_engine(AXXIA_ENGINE_CNAL);
 
 
-   /* disable sysmem interrupts */
-   value = 0;
-   ncr_wr

[linux-yocto] [PATCH 27/39] i2c-axxia: Use managed functions devm_*

2014-04-11 Thread Charlie Paul
From: Anders Berg 

Use the devm_ functions for resource allocation to simplify error handling.

Signed-off-by: Anders Berg 
---
 drivers/i2c/busses/i2c-axxia.c |   98 +++-
 1 file changed, 36 insertions(+), 62 deletions(-)

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index 8cc972d..c2b84a4 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -116,12 +116,8 @@ struct axxia_i2c_dev {
struct i2c_adapter adapter;
/* clock reference for i2c input clock */
struct clk *i2c_clk;
-   /* ioremapped registers cookie */
-   void __iomem *base;
/* pointer to register struct */
struct i2c_regs __iomem *regs;
-   /* irq number */
-   int irq;
/* xfer completion object */
struct completion msg_complete;
/* pointer to current message */
@@ -488,11 +484,11 @@ axxia_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg 
msgs[], int num)
 static u32
 axxia_i2c_func(struct i2c_adapter *adap)
 {
-   return I2C_FUNC_I2C |
+   u32 caps = (I2C_FUNC_I2C |
I2C_FUNC_10BIT_ADDR |
I2C_FUNC_SMBUS_EMUL |
-   I2C_FUNC_SMBUS_BLOCK_DATA;
-
+   I2C_FUNC_SMBUS_BLOCK_DATA);
+   return caps;
 }
 
 static const struct i2c_algorithm axxia_i2c_algo = {
@@ -505,49 +501,42 @@ axxia_i2c_probe(struct platform_device *pdev)
 {
struct device_node *np = pdev->dev.of_node;
struct axxia_i2c_dev *idev = NULL;
-   struct clk *i2c_clk = NULL;
-   void __iomem *base = NULL;
-   u32 bus = pdev->id;
-   int irq = 0;
+   struct resource *res;
+   void __iomem *base;
+   int irq;
int ret = 0;
 
-   base = of_iomap(np, 0);
-   if (!base) {
-   dev_err(&pdev->dev, "failed to iomap registers\n");
-   ret = -ENOMEM;
-   goto err_cleanup;
-   }
+   idev = devm_kzalloc(&pdev->dev, sizeof(*idev), GFP_KERNEL);
+   if (!idev)
+   return -ENOMEM;
 
-   irq = irq_of_parse_and_map(np, 0);
-   if (irq == 0) {
-   dev_err(&pdev->dev, "no irq property\n");
-   ret = -EINVAL;
-   goto err_cleanup;
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   if (!res) {
+   dev_err(&pdev->dev, "can't get device io-resource\n");
+   return -ENOENT;
}
 
-   i2c_clk = clk_get(&pdev->dev, "i2c");
-   if (IS_ERR(i2c_clk)) {
-   dev_err(&pdev->dev, "missing bus clock");
-   ret = PTR_ERR(i2c_clk);
-   goto err_cleanup;
+   irq = platform_get_irq(pdev, 0);
+   if (irq < 0) {
+   dev_err(&pdev->dev, "can't get irq number\n");
+   return -ENOENT;
}
 
-   idev = kzalloc(sizeof(struct axxia_i2c_dev), GFP_KERNEL);
-   if (!idev) {
-   ret = -ENOMEM;
-   goto err_cleanup;
+   base = devm_ioremap_resource(&pdev->dev, res);
+   if (IS_ERR(base))
+   return PTR_ERR(base);
+
+   idev->i2c_clk = devm_clk_get(&pdev->dev, "i2c");
+   if (IS_ERR(idev->i2c_clk)) {
+   dev_err(&pdev->dev, "missing I2C bus clock");
+   return PTR_ERR(idev->i2c_clk);
}
 
-   idev->base = base;
-   idev->regs = (struct __iomem i2c_regs*) base;
-   idev->i2c_clk  = i2c_clk;
+   idev->regs = (struct i2c_regs __iomem *) base;
idev->dev  = &pdev->dev;
init_completion(&idev->msg_complete);
 
-   of_property_read_u32(np, "bus", &bus);
-
of_property_read_u32(np, "clock-frequency", &idev->bus_clk_rate);
-
if (idev->bus_clk_rate == 0)
idev->bus_clk_rate = 10; /* default clock rate */
 
@@ -556,48 +545,37 @@ axxia_i2c_probe(struct platform_device *pdev)
ret = axxia_i2c_init(idev);
if (ret) {
dev_err(&pdev->dev, "Failed to initialize i2c controller");
-   goto err_cleanup;
+   return ret;
}
 
-   ret = request_irq(irq, axxia_i2c_isr, 0, pdev->name, idev);
+   ret = devm_request_irq(&pdev->dev, irq, axxia_i2c_isr, 0,
+   pdev->name, idev);
if (ret) {
-   dev_err(&pdev->dev, "Failed to request irq %i\n", idev->irq);
-   goto err_cleanup;
+   dev_err(&pdev->dev, "can't claim irq %d\n", irq);
+   return ret;
}
-   idev->irq = irq;
 
clk_enable(idev->i2c_clk);
 
i2c_set_adapdata(&idev->adapter, idev);
+   strlcpy(idev->adapter.name, pdev->name, sizeof(idev->adapter.name));
idev->adapter.owner = THIS_MODULE;
idev->adapter.class = I2C_CLASS_HWMON;
-   snprintf(idev->adapter.name, sizeof(idev->adapter.name),
-"Axxia I2C%u", bus);
idev->adapter.algo = &axxia_i2c_algo;
idev->adapter.dev.parent = 

[linux-yocto] [PATCH 20/39] kernel/irq/manage.c: Fix irq_set_affinity to allow use with buslocks

2014-04-11 Thread Charlie Paul
From: David Mercado 

Fix irq_set_affinity() to allow usage of buslocks with "slow bus"
IRQ controllers, such as the LSI Axxia GIC.  Otherwise, a device
having its IRQ affinity changed will hang.

Signed-off-by: David Mercado 
---
 kernel/irq/manage.c |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 9bd5c8a..81afc6d 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -195,16 +195,16 @@ int __irq_set_affinity_locked(struct irq_data *data, 
const struct cpumask *mask)
  */
 int irq_set_affinity(unsigned int irq, const struct cpumask *mask)
 {
-   struct irq_desc *desc = irq_to_desc(irq);
unsigned long flags;
+   struct irq_desc *desc = irq_get_desc_buslock(irq, &flags,
+IRQ_GET_DESC_CHECK_GLOBAL);
int ret;
 
if (!desc)
return -EINVAL;
 
-   raw_spin_lock_irqsave(&desc->lock, flags);
ret =  __irq_set_affinity_locked(irq_desc_get_irq_data(desc), mask);
-   raw_spin_unlock_irqrestore(&desc->lock, flags);
+   irq_put_desc_busunlock(desc, flags);
return ret;
 }
 
@@ -1101,8 +1101,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, 
struct irqaction *new)
goto out_mask;
}
 
-   desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED | \
- IRQS_ONESHOT | IRQS_WAITING);
+   desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED |
+   IRQS_ONESHOT | IRQS_WAITING);
irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS);
 
if (new->flags & IRQF_PERCPU) {
@@ -1134,7 +1134,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, 
struct irqaction *new)
 
if (nmsk != omsk)
/* hope the handler works with current  trigger mode */
-   pr_warning("irq %d uses trigger mode %u; requested 
%u\n",
+   pr_warn("irq %d uses trigger mode %u; requested %u\n",
   irq, nmsk, omsk);
}
 
@@ -1313,7 +1313,7 @@ void remove_irq(unsigned int irq, struct irqaction *act)
struct irq_desc *desc = irq_to_desc(irq);
 
if (desc && !WARN_ON(irq_settings_is_per_cpu_devid(desc)))
-   __free_irq(irq, act->dev_id);
+   __free_irq(irq, act->dev_id);
 }
 EXPORT_SYMBOL_GPL(remove_irq);
 
@@ -1595,7 +1595,7 @@ void remove_percpu_irq(unsigned int irq, struct irqaction 
*act)
struct irq_desc *desc = irq_to_desc(irq);
 
if (desc && irq_settings_is_per_cpu_devid(desc))
-   __free_percpu_irq(irq, act->percpu_dev_id);
+   __free_percpu_irq(irq, act->percpu_dev_id);
 }
 
 /**
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 08/39] i2c-axxia: Adjust tLOW, tHIGH to match fast-mode requirements

2014-04-11 Thread Charlie Paul
From: Anders Berg 

Adjusted the controller setup to meet the timing requirements for I2C fast-mode
on the SCL signal (tLOW and tHIGH). For fast-mode, a 33/66 duty cycle of the
SCL is used to match the minimum timing requirements of 1.3/0.6 for tLOW/tHIGH.

Signed-off-by: Anders Berg 
---
 drivers/i2c/busses/i2c-axxia.c |   22 +++---
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index f536dc4..8cc972d 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -165,6 +165,7 @@ axxia_i2c_init(struct axxia_i2c_dev *idev)
u32 divisor = clk_get_rate(idev->i2c_clk) / idev->bus_clk_rate;
u32 clk_mhz = clk_get_rate(idev->i2c_clk) / 100;
u32 t_setup;
+   u32 t_high, t_low;
u32 tmo_clk;
u32 prescale;
unsigned long timeout;
@@ -185,15 +186,22 @@ axxia_i2c_init(struct axxia_i2c_dev *idev)
/* Enable Master Mode */
writel(0x1, &idev->regs->global_control);
 
+   if (idev->bus_clk_rate <= 10) {
+   /* Standard mode SCL 50/50, tSU:DAT = 250 ns */
+   t_high  = divisor*1/2;
+   t_low   = divisor*1/2;
+   t_setup = ns_to_clk(250, clk_mhz);
+   } else {
+   /* Fast mode SCL 33/66, tSU:DAT = 100 ns */
+   t_high  = divisor*1/3;
+   t_low   = divisor*2/3;
+   t_setup = ns_to_clk(100, clk_mhz);
+   }
+
/* SCL High Time */
-   writel(divisor/2, &idev->regs->scl_high_period);
+   writel(t_high, &idev->regs->scl_high_period);
/* SCL Low Time */
-   writel(divisor/2, &idev->regs->scl_low_period);
-
-   t_setup = (idev->bus_clk_rate <= 10) ?
-   ns_to_clk(250, clk_mhz) : /* Standard mode tSU:DAT = 250 ns */
-   ns_to_clk(100, clk_mhz); /* Fast mode tSU:DAT = 100 ns */
-
+   writel(t_low, &idev->regs->scl_low_period);
/* SDA Setup Time */
writel(t_setup, &idev->regs->sda_setup_time);
/* SDA Hold Time, 300ns */
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 11/39] LSI AXM55xx: Configuration updates

2014-04-11 Thread Charlie Paul
From: Michael Bringmann 

Update the powerpc FDT settings for the latest AXXIA RIO code.

Signed-off-by: Michael Bringmann 
---
 arch/powerpc/boot/dts/acp25xx.dts |   49 +
 arch/powerpc/boot/dts/acp342x.dts |   37 ++
 arch/powerpc/boot/dts/acp344x.dts |   63 +
 arch/powerpc/boot/dts/acp35xx.dts |   25 +--
 4 files changed, 82 insertions(+), 92 deletions(-)

diff --git a/arch/powerpc/boot/dts/acp25xx.dts 
b/arch/powerpc/boot/dts/acp25xx.dts
index 4db67df..02f6a28 100644
--- a/arch/powerpc/boot/dts/acp25xx.dts
+++ b/arch/powerpc/boot/dts/acp25xx.dts
@@ -90,7 +90,7 @@
 clock-frequency = <0>; // Filled in by zImage
 UART0: serial@00404000 {
 device_type = "serial";
-compatible = "acp-uart0";
+compatible = "lsi,acp-uart0";
 enabled = <1>;
 reg = <0x00404000 0x1000>;
 clock-reg = <0x00408040 0x20>;
@@ -101,7 +101,7 @@
 };
 UART1: serial@00405000 {
 device_type = "serial";
-compatible = "acp-uart1";
+compatible = "lsi,acp-uart1";
 enabled = <0>;
 reg = <0x00405000 0x1000>;
 clock-reg = <0x00408060 0x20>;
@@ -112,21 +112,21 @@
 };
 USB0: usb@004a4000 {
 device_type = "usb";
-compatible = "acp-usb";
+compatible = "lsi,acp-usb";
 enabled = <0>;
 reg = <0x004a4000 0x0002>;
 interrupt-parent = <&MPIC>;
 interrupts = <31>;
 };
 I2C: i2c@00403000 {
-compatible = "acp-i2c";
+compatible = "lsi,acp-i2c";
 enabled = <0>;
 reg = <0x00403000 0x1000>;
 interrupt-parent = <&MPIC>;
 interrupts = <21>;
 };
 SSP: ssp@00402000 {
-compatible = "acp-ssp";
+compatible = "arm,acp-ssp";
 enabled = <0>;
 reg = <0x00402000 0x1000>;
 interrupt-parent = <&MPIC>;
@@ -134,14 +134,14 @@
 };
 NAND: nand@0044 {
 device_type = "nand";
-compatible = "acp-nand";
+compatible = "lsi,acp-nand";
 enabled = <1>;
 reg = <0x0044 0x2
0x0040c000 0x1000>;
 };
 FEMAC: femac@0048 {
 device_type = "network";
-compatible = "acp-femac";
+compatible = "lsi,acp-femac";
 enabled = <1>;
 reg = <0x0048 0x1000
0x00481000 0x1000
@@ -283,27 +283,20 @@
 >;
 };
 
-rio0: rapidio@f002 {
-compatible = "acp,rapidio-delta";
+rio0: rapidio@0x21 {
+index = <0>;
+status = "okay";
+#address-cells = <2>;
+#size-cells = <2>;
+compatible = "axxia,rapidio-delta";
 device_type = "rapidio";
-enabled = <0>;
-#size = <0>;/* 0 = (256, small system)
- * 1 = (65536, large system) */
-/*
-#host-device-id = <1>;
-*/
-/* >=0 for enum; < 0 for disc */
-/*
-num-dme = <1 0 1>;
-*/
-/* (#outb-mseg>, <#outb-sseg>, <#inb> */
-/*
-num-odme-mseg-desc = <2 128 128>;
-num-odme-sseg-desc = <1 256>;
-num-idme-desc = <1 512>;
-*/
-reg = <0xf002 0x2 0x1000>; /* SRIO Conf region */
-interrupt-parent = <&MPIC>;
-interrupts = <30 0x2 /* NCP_INTR_MPIC_SRC_AXIS_SRIO */>;
+reg = <0x0020 0x0056 0x0 0x1000>; /* SRIO Conf 0 region */
+ranges = <0x0 0x0 0x0021 0x 

[linux-yocto] [PATCH 24/39] arm/axxia: GPIO driver for SPI chip selects

2014-04-11 Thread Charlie Paul
From: Anders Berg 

Add gpiochip driver for the 5 chip select signals provided by the SSP block.
This makes it possible to use the device tree for all SPI configuration,
instead of having it in the platform specific code.

Signed-off-by: Anders Berg 
---
 arch/arm/mach-axxia/Makefile   |1 +
 arch/arm/mach-axxia/axxia.c|   62 ---
 arch/arm/mach-axxia/clock.c|2 +-
 arch/arm/mach-axxia/ssp-gpio.c |  132 
 4 files changed, 134 insertions(+), 63 deletions(-)
 create mode 100644 arch/arm/mach-axxia/ssp-gpio.c

diff --git a/arch/arm/mach-axxia/Makefile b/arch/arm/mach-axxia/Makefile
index 8e7dec4..62197f1 100644
--- a/arch/arm/mach-axxia/Makefile
+++ b/arch/arm/mach-axxia/Makefile
@@ -4,6 +4,7 @@
 obj-y  += axxia.o
 obj-y  += clock.o
 obj-y   += io.o
+obj-y   += ssp-gpio.o
 obj-y  += ncr.o
 obj-y  += timers.o
 obj-y  += pci.o
diff --git a/arch/arm/mach-axxia/axxia.c b/arch/arm/mach-axxia/axxia.c
index dcb6305..d73e11b 100644
--- a/arch/arm/mach-axxia/axxia.c
+++ b/arch/arm/mach-axxia/axxia.c
@@ -34,7 +34,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #ifdef CONFIG_ARM_ARCH_TIMER
@@ -62,8 +61,6 @@ static const char *axxia_dt_match[] __initconst = {
NULL
 };
 
-static void __iomem *ssp_base;
-
 static struct map_desc axxia_static_mappings[] __initdata = {
 #ifdef CONFIG_DEBUG_LL
{
@@ -151,17 +148,9 @@ struct pl061_platform_data gpio1_plat_data = {
.values = 0 /* startup values */
 };
 
-static struct pl022_ssp_controller ssp_plat_data = {
-   .bus_id = 0,
-   .num_chipselect = 5,
-   .enable_dma = 0
-};
-
 static struct of_dev_auxdata axxia_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA("arm,primecell", 0x20101EULL,
   "mmci",  &mmc_plat_data),
-   OF_DEV_AUXDATA("arm,primecell", 0x2010088000ULL,
-  "ssp",   &ssp_plat_data),
OF_DEV_AUXDATA("arm,primecell", 0x2010092000ULL,
   "gpio0", &gpio0_plat_data),
OF_DEV_AUXDATA("arm,primecell", 0x2010093000ULL,
@@ -220,49 +209,6 @@ static struct platform_device pmu_device = {
.dev.platform_data  = &axxia_pmu_platdata,
 };
 
-static inline void
-spidev_chip_select(u32 control, unsigned n)
-{
-   if (control == SSP_CHIP_SELECT)
-   writel(~(1.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct gpio_dev {
+   void __iomem*regs;
+   struct gpio_chip gpio_chip;
+};
+
+static int
+ssp_gpio_get(struct gpio_chip *chip, unsigned offset)
+{
+   struct gpio_dev *priv = dev_get_drvdata(chip->dev);
+   u32 tmp = readl(priv->regs + 0x30);
+   return !!(tmp & (1regs + 0x30);
+   if (value)
+   tmp |= (1dev, sizeof(*priv), GFP_KERNEL);
+   if (!priv)
+   return -ENOMEM;
+
+   platform_set_drvdata(pdev, priv);
+
+   io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   if (!io)
+   return -EINVAL;
+
+   priv->regs = devm_ioremap_nocache(&pdev->dev,
+  io->start, resource_size(io));
+   if (!priv->regs)
+   return -ENXIO;
+
+   chip = &priv->gpio_chip;
+   chip->dev = &pdev->dev;
+#ifdef CONFIG_OF_GPIO
+   chip->of_node = pdev->dev.of_node;
+#endif
+   chip->get = ssp_gpio_get;
+   chip->direction_output = ssp_gpio_direction_out;
+   chip->set = ssp_gpio_set;
+   chip->label = "ssp-gpio";
+   chip->owner = THIS_MODULE;
+   chip->base = -1;
+   chip->ngpio = 5;
+
+   /* Deassert all */
+   writel(0x1f, priv->regs + 0x30);
+
+   ret = gpiochip_add(chip);
+   if (ret < 0)
+   dev_err(&pdev->dev, "could not register gpiochip, %d\n", ret);
+
+   return ret;
+}
+
+static int
+ssp_gpio_remove(struct platform_device *pdev)
+{
+   struct gpio_dev *priv = dev_get_drvdata(&pdev->dev);
+   return gpiochip_remove(&priv->gpio_chip);
+}
+
+static const struct of_device_id ssp_gpio_id_table[] = {
+   { .compatible = "lsi,ssp-gpio" },
+   {}
+};
+MODULE_DEVICE_TABLE(platform, ssp_gpio_id_table);
+
+static struct platform_driver ssp_gpio_driver = {
+   .driver = {
+   .name   = "ssp-gpio",
+   .owner  = THIS_MODULE,
+   .of_match_table = ssp_gpio_id_table
+   },
+   .probe  = ssp_gpio_probe,
+   .remove = 

[linux-yocto] [PATCH 21/39] LSI AXM55xx: Axxia GIC driver improvements (3rd gen)

2014-04-11 Thread Charlie Paul
From: David Mercado 

Introduce the use of "slow" bus locking to allow use of Linux RPC
mechanism, remove unnecessary memory barriers, etc.

Signed-off-by: David Mercado 
---
 arch/arm/mach-axxia/axxia-gic.c | 1138 ---
 1 file changed, 577 insertions(+), 561 deletions(-)

diff --git a/arch/arm/mach-axxia/axxia-gic.c b/arch/arm/mach-axxia/axxia-gic.c
index 5aefa42..32c7525 100644
--- a/arch/arm/mach-axxia/axxia-gic.c
+++ b/arch/arm/mach-axxia/axxia-gic.c
@@ -3,7 +3,7 @@
  *
  *  Cloned from linux/arch/arm/common/gic.c
  *
- *  Copyright (C) 2002 ARM Limited, All Rights Reserved.
+ *  Copyright (C) 2013 LSI Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -33,28 +33,16 @@
  * registers are banked per-cpu for these sources.
  */
 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
 #include 
-#include 
 #include 
-#include 
+#include 
 #include 
-#include 
-#include 
-#include 
+#include 
 
-#include 
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
@@ -87,13 +75,7 @@ enum axxia_ext_ipi_num {
MAX_AXM_IPI_NUM
 };
 
-/*
- * Some big arbritary number that won't ever conflict with
- * the IPI numbers defined in arch/arm/kernel/smp.c
- */
-#define AXXIA_RPC 0xff
-
-/* RPC Message types. */
+/* MUX Message types. */
 enum axxia_mux_msg_type {
MUX_MSG_CALL_FUNC = 0,
MUX_MSG_CALL_FUNC_SINGLE,
@@ -113,11 +95,6 @@ static void muxed_ipi_message_pass(const struct cpumask 
*mask,
struct axxia_mux_msg *info;
int cpu;
 
-   /*
-* Order previous accesses before accesses in the IPI handler.
-*/
-   dmb();
-
for_each_cpu(cpu, mask) {
info = &per_cpu(ipi_mux_msg, cpu_logical_map(cpu));
info->msg |= 1 << ipi_num;
@@ -129,8 +106,6 @@ static void axxia_ipi_demux(struct pt_regs *regs)
struct axxia_mux_msg *info = &__get_cpu_var(ipi_mux_msg);
u32 all;
 
-   mb();
-
do {
all = xchg(&info->msg, 0);
if (all & (1 << MUX_MSG_CALL_FUNC))
@@ -153,19 +128,54 @@ struct gic_chip_data {
union gic_base dist_base;
union gic_base cpu_base;
 #ifdef CONFIG_CPU_PM
-   u32 saved_spi_enable[DIV_ROUND_UP(MAX_GIC_INTERRUPTS, 32)];
-   u32 saved_spi_conf[DIV_ROUND_UP(MAX_GIC_INTERRUPTS, 16)];
-   u32 saved_spi_target[DIV_ROUND_UP(MAX_GIC_INTERRUPTS, 4)];
-   u32 __percpu *saved_ppi_enable;
-   u32 __percpu *saved_ppi_conf;
+   u32 saved_spi_enable[DIV_ROUND_UP(MAX_GIC_INTERRUPTS, 32)]
+   [MAX_NUM_CLUSTERS];
+   u32 saved_spi_conf[DIV_ROUND_UP(MAX_GIC_INTERRUPTS, 16)]
+ [MAX_NUM_CLUSTERS];
+   u32 saved_spi_target[DIV_ROUND_UP(MAX_GIC_INTERRUPTS, 4)]
+   [MAX_NUM_CLUSTERS];
+   u32 __percpu *saved_ppi_enable[MAX_NUM_CLUSTERS];
+   u32 __percpu *saved_ppi_conf[MAX_NUM_CLUSTERS];
 #endif
struct irq_domain *domain;
unsigned int gic_irqs;
 };
 
+enum gic_rpc_func_mask {
+   IRQ_MASK = 0x01,
+   IRQ_UNMASK = 0x02,
+   SET_TYPE = 0x04,
+   SET_AFFINITY = 0x08,
+   CLR_AFFINITY = 0x10,
+   GIC_NOTIFIER = 0x20,
+   MAX_GIC_FUNC_MASK
+};
+
+
+#ifdef CONFIG_CPU_PM
+struct gic_notifier_data {
+   struct notifier_block *self;
+   unsigned long cmd;
+   void *v;
+};
+#endif
+
+struct gic_rpc_data {
+   struct irq_data *d;
+   u32 func_mask;
+   u32 cpu, oldcpu;
+   u32 type;
+   const struct cpumask *mask_val;
+#ifdef CONFIG_CPU_PM
+   struct gic_notifier_data gn_data;
+#endif
+};
+
 static DEFINE_RAW_SPINLOCK(irq_controller_lock);
+static DEFINE_MUTEX(irq_bus_lock);
 
-static struct gic_chip_data gic_data[MAX_NUM_CLUSTERS] __read_mostly;
+static struct gic_chip_data gic_data __read_mostly;
+static struct gic_rpc_data gic_rpc_data = {NULL, 0, 0, 0, 0, NULL};
 
 #define gic_data_dist_base(d)  ((d)->dist_base.common_base)
 #define gic_data_cpu_base(d)   ((d)->cpu_base.common_base)
@@ -188,88 +198,88 @@ static inline unsigned int gic_irq(struct irq_data *d)
return d->hwirq;
 }
 
-typedef void axxia_call_func_t(void *info);
-
-struct axxia_gic_rpc {
-   int cpu;
-   axxia_call_func_t *func;
-   void *info;
-};
-
-static DEFINE_PER_CPU_SHARED_ALIGNED(struct axxia_gic_rpc, axxia_gic_rpc);
-
-void axxia_gic_handle_gic_rpc(void)
-{
-   u32 this_cpu = cpu_logical_map(smp_processor_id());
-   int cpu;
-
-   for_each_possible_cpu(cpu)
-   {
-   struct axxia_gic_rpc *slot = &per_cpu(axxia_gic_rpc, cpu);
-   if (slot->func && slot->cpu == this_cpu) {
-   slot->func(slot->info);
-   slot->func = NULL;
-   dmb();
-   }
-   }
-}
-
-static void axxia_gic_handle_gic_rpc_ipi(void)
-{
-   irq

[linux-yocto] [PATCH 23/39] arm/axxia: Configure changes to 'GPIO driver for SPI chip selects'

2014-04-11 Thread Charlie Paul
From: Anders Berg 

This patch was split off as configuration changes to
support the GPIO driver changes.

Signed-off-by: Anders Berg 
---
 arch/arm/boot/dts/axm5504-sim.dts  |4 
 arch/arm/boot/dts/axm5516-amarillo.dts |4 
 arch/arm/boot/dts/axm55xx.dtsi |6 ++
 3 files changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/axm5504-sim.dts 
b/arch/arm/boot/dts/axm5504-sim.dts
index 2dd964b..7580ae5 100644
--- a/arch/arm/boot/dts/axm5504-sim.dts
+++ b/arch/arm/boot/dts/axm5504-sim.dts
@@ -106,6 +106,10 @@
status = "okay";
 };
 
+&spics {
+   status = "okay";
+};
+
 &spi0 {
status = "okay";
 };
diff --git a/arch/arm/boot/dts/axm5516-amarillo.dts 
b/arch/arm/boot/dts/axm5516-amarillo.dts
index 85c4ede..a802b52 100644
--- a/arch/arm/boot/dts/axm5516-amarillo.dts
+++ b/arch/arm/boot/dts/axm5516-amarillo.dts
@@ -78,6 +78,10 @@
status = "okay";
 };
 
+&spics {
+   status = "okay";
+};
+
 &spi0 {
status = "okay";
 
diff --git a/arch/arm/boot/dts/axm55xx.dtsi b/arch/arm/boot/dts/axm55xx.dtsi
index fc81a75..f774531 100644
--- a/arch/arm/boot/dts/axm55xx.dtsi
+++ b/arch/arm/boot/dts/axm55xx.dtsi
@@ -370,6 +370,12 @@
#size-cells = <0>;
reg = <0x20 0x10088000 0x00 0x1000>;
interrupts = <0 42 4>;
+   num-cs = <5>;
+   cs-gpios = <&spics 0 1>,
+  <&spics 1 1>,
+  <&spics 2 1>,
+  <&spics 3 1>,
+  <&spics 4 1>;
status = "disabled";
};
};
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 15/39] Revert "LSI AXM55XX: Disable use of wfe/sev in arch spinlock"

2014-04-11 Thread Charlie Paul
From: Anders Berg 

This reverts commit ae0c53fc61475c63150beb6cddf8ef343b3903e1.

Signed-off-by: Anders Berg 
---
 arch/arm/include/asm/spinlock.h |6 --
 1 file changed, 6 deletions(-)

diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h
index 1416189..b07c09e 100644
--- a/arch/arm/include/asm/spinlock.h
+++ b/arch/arm/include/asm/spinlock.h
@@ -37,10 +37,6 @@
\
"nop.w" \
 )
-#elif defined(CONFIG_ARCH_AXXIA)
-/* Disable use of wfe/sev in Axxia. */
-#define SEV
-#define WFE(cond)
 #else
 #define SEVALT_SMP("sev", "nop")
 #define WFE(cond)  ALT_SMP("wfe" cond, "nop")
@@ -92,9 +88,7 @@ static inline void arch_spin_lock(arch_spinlock_t *lock)
: "cc");
 
while (lockval.tickets.next != lockval.tickets.owner) {
-#if !defined(CONFIG_ARCH_AXXIA)
wfe();
-#endif
lockval.tickets.owner = ACCESS_ONCE(lock->tickets.owner);
}
 
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 16/39] dma: lsi-dma32: DMA driver configuration update

2014-04-11 Thread Charlie Paul
From: Anders Berg 

Updating DMA with extra memory

Signed-off-by: Anders Berg 
---
 arch/arm/boot/dts/axm55xx.dts |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/axm55xx.dts b/arch/arm/boot/dts/axm55xx.dts
index 230a305..fa5b4b5 100644
--- a/arch/arm/boot/dts/axm55xx.dts
+++ b/arch/arm/boot/dts/axm55xx.dts
@@ -229,7 +229,8 @@
 
gpdma@202014 {
compatible = "lsi,dma32";
-   reg = <0x20 0x2014 0x00 0x1000>;
+   reg = <0x20 0x2014 0x00 0x1000>,
+ <0x20 0x10094000 0x00 0x1000>;
interrupts = <0 60 4>, /* busy */
 <0 61 4>; /* error */
 
@@ -244,7 +245,8 @@
 
gpdma@2020141000 {
compatible = "lsi,dma32";
-   reg = <0x20 0x20141000 0x00 0x1000>;
+   reg = <0x20 0x20141000 0x00 0x1000>,
+ <0x20 0x10094000 0x00 0x1000>;
interrupts = <0 64 4>, /* busy */
 <0 65 4>; /* error */
 
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 17/39] dma: lsi-dma32: Cleanup DMA driver

2014-04-11 Thread Charlie Paul
From: Anders Berg 

Use the devm_* helpers to avoid messy error recovery and make use of the
virt-dma interface to avoid duplicated code.

Signed-off-by: Anders Berg 
---
 drivers/dma/Kconfig |1 +
 drivers/dma/lsi-dma32.c |  527 ---
 drivers/dma/lsi-dma32.h |   41 ++--
 3 files changed, 200 insertions(+), 369 deletions(-)

diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 2ad1215..03eb991 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -91,6 +91,7 @@ config AT_HDMAC
 config LSI_DMA
tristate "LSI General Purpose DMA support"
select DMA_ENGINE
+   select DMA_VIRTUAL_CHANNELS
select ASYNC_TX_ENABLE_CHANNEL_SWITCH
help
  Enable support for the LSI General Purpose DMA controller found
diff --git a/drivers/dma/lsi-dma32.c b/drivers/dma/lsi-dma32.c
index b16df68..0c679bf 100644
--- a/drivers/dma/lsi-dma32.c
+++ b/drivers/dma/lsi-dma32.c
@@ -23,10 +23,10 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -36,11 +36,9 @@
 #include 
 #include 
 #include 
+#include "virt-dma.h"
 #include "lsi-dma32.h"
 
-#define rd32(_addr) readl((_addr))
-#define wr32(_value, _addr) writel((_value), (_addr))
-
 #ifdef DEBUG
 #define engine_dbg(engine, fmt, ...) \
do { \
@@ -54,7 +52,7 @@
struct gpdma_channel *_c = dmac; \
(void)_c; \
pr_debug("dma0ch%d: [%s] " fmt, \
-   dmac->channel, __func__, ##__VA_ARGS__); \
+   dmac->id, __func__, ##__VA_ARGS__); \
} while (0)
 #else
 #define engine_dbg(engine, fmt, ...) do {} while (0)
@@ -62,29 +60,26 @@
 #endif
 
 
-static dma_cookie_t gpdma_tx_submit(struct dma_async_tx_descriptor *txd);
-
-
 static void reset_channel(struct gpdma_channel *dmac)
 {
const int WAIT = 1024;
int i;
 
/* Pause channel */
-   wr32(DMA_STATUS_CH_PAUS_WR_EN | DMA_STATUS_CH_PAUSE,
+   writel(DMA_STATUS_CH_PAUS_WR_EN | DMA_STATUS_CH_PAUSE,
 dmac->base+DMA_STATUS);
wmb();
 
/* Disable channel */
-   wr32(0, dmac->base+DMA_CHANNEL_CONFIG);
-   for (i = 0; rd32(dmac->base+DMA_CHANNEL_CONFIG) && i < WAIT; i++)
+   writel(0, dmac->base+DMA_CHANNEL_CONFIG);
+   for (i = 0; readl(dmac->base+DMA_CHANNEL_CONFIG) && i < WAIT; i++)
cpu_relax();
if (i == WAIT)
ch_dbg(dmac, "Failed to DISABLE channel\n");
 
/* Clear FIFO */
-   wr32(DMA_CONFIG_CLEAR_FIFO, dmac->base+DMA_CHANNEL_CONFIG);
-   for (i = 0; rd32(dmac->base+DMA_CHANNEL_CONFIG) && i < WAIT; i++)
+   writel(DMA_CONFIG_CLEAR_FIFO, dmac->base+DMA_CHANNEL_CONFIG);
+   for (i = 0; readl(dmac->base+DMA_CHANNEL_CONFIG) && i < WAIT; i++)
cpu_relax();
if (i == WAIT)
ch_dbg(dmac, "Failed to clear FIFO\n");
@@ -100,7 +95,7 @@ static void soft_reset(struct gpdma_engine *engine)
reset_channel(&engine->channel[i]);
 
/* Reset GPDMA by writing Magic Number to reset reg */
-   wr32(GPDMA_MAGIC, engine->gbase + SOFT_RESET);
+   writel(GPDMA_MAGIC, engine->gbase + SOFT_RESET);
wmb();
 
cfg = (engine->pool.phys & 0xfff0) | GEN_CONFIG_EXT_MEM;
@@ -110,7 +105,7 @@ static void soft_reset(struct gpdma_engine *engine)
cfg |= GEN_CONFIG_INT_EDGE(i);
engine_dbg(engine, "Using edge-triggered interrupts\n");
}
-   wr32(cfg, engine->gbase + GEN_CONFIG);
+   writel(cfg, engine->gbase + GEN_CONFIG);
engine_dbg(engine, "engine->desc.phys & 0xfff0 == %llx\n",
   (engine->pool.phys & 0xfff0));
 
@@ -164,28 +159,30 @@ static struct gpdma_desc *get_descriptor(struct 
gpdma_engine *engine)
unsigned long flags;
struct gpdma_desc *desc = NULL;
 
-   raw_spin_lock_irqsave(&engine->lock, flags);
+   spin_lock_irqsave(&engine->lock, flags);
if (engine->pool.next < GPDMA_MAX_DESCRIPTORS)
desc = engine->pool.free[engine->pool.next++];
-   raw_spin_unlock_irqrestore(&engine->lock, flags);
+   spin_unlock_irqrestore(&engine->lock, flags);
+   desc->engine = engine;
 
return desc;
 }
 
-static void
-free_descriptor(struct gpdma_engine *engine, struct gpdma_desc *desc)
+static void free_descriptor(struct virt_dma_desc *vd)
 {
+   struct gpdma_desc *desc = to_gpdma_desc(vd);
+   struct gpdma_engine *engine = desc->engine;
unsigned long flags;
 
-   raw_spin_lock_irqsave(&engine->lock, flags);
+   spin_lock_irqsave(&engine->lock, flags);
BUG_ON(engine->pool.next == 0);
engine->pool.free[--engine->pool.next] = desc;
-   raw_spin_unlock_irqrestore(&engine->lock, flags);
+   spin_unlock_irqrestore(&engine->lock, flags);
 }
 
 static int segment_match(struct gpdma_engine *engine, struct gpdm

[linux-yocto] [PATCH 13/39] arm/axxia: Workaround for cross-cluster sev issue

2014-04-11 Thread Charlie Paul
From: Anders Berg 

In revision 1.0 of the AXM55xx device, the events signals across cluster can
get lost if multiple CPUs signals an event roughly at the same point in time.
This may lead to spin-lock deadlock as other clusters may be sitting in a wfe
instruction waiting for a lock to become free.

The workaround is to disable the wfe instruction (effectively turning it into a
NOP) by setting ACTLR[7]=1.

Signed-off-by: Anders Berg 
---
 arch/arm/mach-axxia/platsmp.c |   54 ++---
 1 file changed, 45 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-axxia/platsmp.c b/arch/arm/mach-axxia/platsmp.c
index 1922122..8e863b0 100644
--- a/arch/arm/mach-axxia/platsmp.c
+++ b/arch/arm/mach-axxia/platsmp.c
@@ -26,8 +26,38 @@
 
 extern void axxia_secondary_startup(void);
 
-#define APB2_SER3_PHY_ADDR0x00201003ULL
-#define APB2_SER3_ADDR_SIZE   0x1
+#define SYSCON_PHYS_ADDR 0x00201003ULL
+
+static int __cpuinitdata wfe_fixup;
+
+/*
+ * Check if we need to enable cross-cluster SEV workaround for a bug in
+ * revision 1.0 silicon (which could cause event signals (from SEV instruction)
+ * to get lost between clusters). As a workaround, we set the bit 7 in CP15
+ * ACTLR (enable WFE as a no-operation) for each core.
+ */
+static void __init check_fixup_sev(void __iomem *syscon)
+{
+   u32 pfuse = readl(syscon + 0x34);
+   u32 chip_type = pfuse & 0x1f;
+   u32 chip_ver  = (pfuse >> 5) & 0x3f;
+
+   /* Set flag for secondary cores */
+   wfe_fixup = (chip_type == 0 || chip_type == 9) && (chip_ver == 0);
+   pr_info("axxia: Cross-cluster SEV fixup: %s\n", wfe_fixup ? "yes" : 
"no");
+}
+
+static void __init do_fixup_sev(void)
+{
+   u32 tmp;
+
+   if (wfe_fixup) {
+   asm volatile("mrc\tp15, 0, %0, c1, c0, 1" : "=r"(tmp));
+   tmp |= (1<<7);
+   asm volatile("mcr\tp15, 0, %0, c1, c0, 1" :: "r"(tmp));
+   isb();
+   }
+}
 
 /*
  * Write pen_release in a way that is guaranteed to be visible to all
@@ -46,6 +76,9 @@ static DEFINE_RAW_SPINLOCK(boot_lock);
 
 void __cpuinit axxia_secondary_init(unsigned int cpu)
 {
+   /* Fixup for cross-cluster SEV */
+   do_fixup_sev();
+
/*
 * If this isn't the first physical core in a secondary cluster
 * then run the standard GIC secondary init routine. Otherwise,
@@ -144,14 +177,17 @@ static __init struct device_node *get_cpu_node(int cpu)
 
 static void __init axxia_smp_prepare_cpus(unsigned int max_cpus)
 {
-   void __iomem *apb2_ser3_base;
+   void __iomem *syscon;
int cpu_count = 0;
int cpu;
 
-   apb2_ser3_base = ioremap(APB2_SER3_PHY_ADDR, APB2_SER3_ADDR_SIZE);
-   if (WARN_ON(!apb2_ser3_base))
+   syscon = ioremap(SYSCON_PHYS_ADDR, SZ_64K);
+   if (WARN_ON(!syscon))
return;
 
+   check_fixup_sev(syscon);
+   do_fixup_sev();
+
/*
 * Initialise the present map, which describes the set of CPUs actually
 * populated at the present time.
@@ -178,10 +214,10 @@ static void __init axxia_smp_prepare_cpus(unsigned int 
max_cpus)
if (!is_hyp_mode_available()) {
u32 phys_cpu = cpu_logical_map(cpu);
if (phys_cpu != 0) {
-   u32 tmp = readl(apb2_ser3_base + 0x1010);
-   writel(0xab, apb2_ser3_base+0x1000);
+   u32 tmp = readl(syscon + 0x1010);
+   writel(0xab, syscon + 0x1000);
tmp &= ~(1 << phys_cpu);
-   writel(tmp, apb2_ser3_base+0x1010);
+   writel(tmp, syscon + 0x1010);
}
}
 
@@ -203,7 +239,7 @@ static void __init axxia_smp_prepare_cpus(unsigned int 
max_cpus)
}
}
 
-   iounmap(apb2_ser3_base);
+   iounmap(syscon);
 }
 
 struct smp_operations axxia_smp_ops __initdata = {
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 28/39] i2c-axxia: Configure changes to 'Use managed functions devm_*'

2014-04-11 Thread Charlie Paul
 Drop the 'bus' property from the device tree. Instead the alias nodes are used
to determine adapter numbering.

Signed-off-by: Anders Berg 
---
 arch/arm/boot/dts/axm55xx.dtsi |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/axm55xx.dtsi b/arch/arm/boot/dts/axm55xx.dtsi
index f774531..92347d8 100644
--- a/arch/arm/boot/dts/axm55xx.dtsi
+++ b/arch/arm/boot/dts/axm55xx.dtsi
@@ -21,6 +21,10 @@
serial3   = &serial3;
ethernet0 = &femac;
timer = &timer0;
+   i2c0  = &i2c0;
+   i2c1  = &i2c1;
+   i2c2  = &i2c2;
+   i2c3  = &i2c3;
};
 
clocks {
@@ -234,7 +238,6 @@
#size-cells = <0>;
reg = <0x20 0x10084000 0x00 0x1000>;
interrupts = <0 19 4>;
-   bus = <0>;
status = "disabled";
};
 
@@ -245,7 +248,6 @@
#size-cells = <0>;
reg = <0x20 0x10085000 0x00 0x1000>;
interrupts = <0 20 4>;
-   bus = <1>;
status = "disabled";
};
 
@@ -256,7 +258,6 @@
#size-cells = <0>;
reg = <0x20 0x10086000 0x00 0x1000>;
interrupts = <0 21 4>;
-   bus = <2>;
status = "disabled";
};
 
@@ -267,7 +268,6 @@
#size-cells = <0>;
reg = <0x20 0x10087000 0x00 0x1000>;
interrupts = <0 22 4>;
-   bus = <3>;
status = "disabled";
};
 
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 10/39] arch/arm/mach-axxia: Updates to the VMFS File System

2014-04-11 Thread Charlie Paul
From: John Jacques 

Updated to work when CONFIG_UIDGID_STRICT_TYPE_CHECKS is
not defined.

This fixed a build failure.

Signed-off-by: John Jacques 
---
 fs/vmfs/inode.c |   18 --
 fs/vmfs/ioctl.c |8 
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/fs/vmfs/inode.c b/fs/vmfs/inode.c
index 713da0d..099bd76 100644
--- a/fs/vmfs/inode.c
+++ b/fs/vmfs/inode.c
@@ -486,11 +486,25 @@ int vmfs_notify_change(struct dentry *dentry, struct 
iattr *attr)
goto out;
 
error = -EPERM;
-   if ((attr->ia_valid & ATTR_UID) && ((attr->ia_uid).val != 
(server->mnt->uid).val))
+#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
+   if ((attr->ia_valid & ATTR_UID) &&
+   (attr->ia_uid.val != (server->mnt->uid).val))
goto out;
+#else
+   if ((attr->ia_valid & ATTR_UID) &&
+   (attr->ia_uid != server->mnt->uid))
+   goto out;
+#endif
 
-   if ((attr->ia_valid & ATTR_GID) && ((attr->ia_gid).val != 
(server->mnt->gid).val))
+#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
+   if ((attr->ia_valid & ATTR_GID) &&
+   ((attr->ia_gid).val != (server->mnt->gid).val))
goto out;
+#else
+   if ((attr->ia_valid & ATTR_GID) &&
+   (attr->ia_gid != server->mnt->gid))
+   goto out;
+#endif
 
if ((attr->ia_valid & ATTR_MODE) && (attr->ia_mode & ~mask))
goto out;
diff --git a/fs/vmfs/ioctl.c b/fs/vmfs/ioctl.c
index 988e69c..798df63 100644
--- a/fs/vmfs/ioctl.c
+++ b/fs/vmfs/ioctl.c
@@ -34,11 +34,19 @@ long vmfs_unlocked_ioctl(struct file *filp, unsigned int 
cmd,
uid16_t uid16;
uid_t uid32;
case VMFS_IOC_GETMOUNTUID:
+#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
SET_UID(uid16, (server->mnt->mounted_uid).val);
+#else
+   SET_UID(uid16, server->mnt->mounted_uid);
+#endif
result = put_user(uid16, (uid16_t __user *) arg);
break;
case VMFS_IOC_GETMOUNTUID32:
+#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
SET_UID(uid32, (server->mnt->mounted_uid).val);
+#else
+   SET_UID(uid32, server->mnt->mounted_uid);
+#endif
result = put_user(uid32, (uid_t __user *) arg);
break;
default:
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 14/39] Revert "LSI AXM55XX: Add GENERIC_LOCKBREAK"

2014-04-11 Thread Charlie Paul
From: Anders Berg 

This reverts commit 2340ef2f1f09c964a4139ac25653a3775bdb706a.

Signed-off-by: Anders Berg 
---
 arch/arm/Kconfig |7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 28757ec..e75d225 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -154,17 +154,12 @@ config TRACE_IRQFLAGS_SUPPORT
bool
default y
 
-config GENERIC_LOCKBREAK
-   bool
-   default y
-   depends on SMP
-
 config RWSEM_GENERIC_SPINLOCK
bool
default y
 
 config RWSEM_XCHGADD_ALGORITHM
-   def_bool !RWSEM_GENERIC_SPINLOCK && !PREEMPT_RT_FULL
+   bool
 
 config ARCH_HAS_ILOG2_U32
bool
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 12/39] LSI AXM55xx: Disable linkdown reset configuration.

2014-04-11 Thread Charlie Paul
From: Michael Bringmann 

Signed-off-by: Michael Bringmann 
---
 arch/powerpc/boot/dts/acp25xx.dts |2 ++
 arch/powerpc/boot/dts/acp35xx.dts |2 ++
 2 files changed, 4 insertions(+)

diff --git a/arch/powerpc/boot/dts/acp25xx.dts 
b/arch/powerpc/boot/dts/acp25xx.dts
index 02f6a28..b5463c5 100644
--- a/arch/powerpc/boot/dts/acp25xx.dts
+++ b/arch/powerpc/boot/dts/acp25xx.dts
@@ -292,7 +292,9 @@
 device_type = "rapidio";
 reg = <0x0020 0x0056 0x0 0x1000>; /* SRIO Conf 0 region */
 ranges = <0x0 0x0 0x0021 0x 0x0 0x4000>;
+   /*
 linkdown-reset = <0x0200 0x100 0x0020 0x0043 0x0 
0x1>;
+   */
interrupt-parent = <&MPIC>;
 interrupts = <30 2>;
 outb-dmes = <2 0x0003 1 0x0001>;
diff --git a/arch/powerpc/boot/dts/acp35xx.dts 
b/arch/powerpc/boot/dts/acp35xx.dts
index de9c827..6f37e45 100644
--- a/arch/powerpc/boot/dts/acp35xx.dts
+++ b/arch/powerpc/boot/dts/acp35xx.dts
@@ -403,7 +403,9 @@
 device_type = "rapidio";
 reg = <0x0020 0x0056 0x0 0x1000>; /* SRIO Conf 0 region */
 ranges = <0x0 0x0 0x0021 0x 0x0 0x4000>;
+   /*
 linkdown-reset = <0x0200 0x100 0x0020 0x0040A000 0x0 
0x1>;
+   */
interrupt-parent = <&MPIC>;
 interrupts = <56 2>;
 outb-dmes = <2 0x0003 1 0x0001>;
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 26/39] hwmon: Support new revision of LTC2974

2014-04-11 Thread Charlie Paul
From: Anders Berg 

Recognize chip id for newer revision of LTC2974.

Signed-off-by: Anders Berg 
---
 drivers/hwmon/pmbus/ltc2978.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/pmbus/ltc2978.c b/drivers/hwmon/pmbus/ltc2978.c
index 586a89e..7dad0ab 100644
--- a/drivers/hwmon/pmbus/ltc2978.c
+++ b/drivers/hwmon/pmbus/ltc2978.c
@@ -52,7 +52,8 @@ enum chips { ltc2974, ltc2978, ltc3880, ltc3883 };
 /* LTC3883 only */
 #define LTC3883_MFR_IIN_PEAK   0xe1
 
-#define LTC2974_ID 0x0212
+#define LTC2974_ID_REV10x0212
+#define LTC2974_ID_REV20x0213
 #define LTC2978_ID_REV10x0121
 #define LTC2978_ID_REV20x0122
 #define LTC3880_ID 0x4000
@@ -390,7 +391,7 @@ static int ltc2978_probe(struct i2c_client *client,
if (chip_id < 0)
return chip_id;
 
-   if (chip_id == LTC2974_ID) {
+   if (chip_id == LTC2974_ID_REV1 || chip_id == LTC2974_ID_REV2) {
data->id = ltc2974;
} else if (chip_id == LTC2978_ID_REV1 || chip_id == LTC2978_ID_REV2) {
data->id = ltc2978;
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 07/39] arch/arm/mach-axxia: Disable DDR Retention Resets in Sim/Emu

2014-04-11 Thread Charlie Paul
From: John Jacques 

DDR retention reset only works on hardware systems, this patch
disables it in simulation and emulation.

Signed-off-by: John Jacques 
---
 arch/arm/mach-axxia/ddr_retention.c |   56 +--
 1 file changed, 33 insertions(+), 23 deletions(-)

diff --git a/arch/arm/mach-axxia/ddr_retention.c 
b/arch/arm/mach-axxia/ddr_retention.c
index e409774..933ff6d 100644
--- a/arch/arm/mach-axxia/ddr_retention.c
+++ b/arch/arm/mach-axxia/ddr_retention.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -35,8 +36,10 @@
 static void __iomem *nca;
 static void __iomem *apb;
 static void __iomem *dickens;
+static int ddr_retention_enabled;
 
-unsigned long ncp_caal_regions_acp55xx[] = {
+static unsigned long
+ncp_caal_regions_acp55xx[] = {
NCP_REGION_ID(0x0b, 0x05),  /* SPPV2   */
NCP_REGION_ID(0x0c, 0x05),  /* SED */
NCP_REGION_ID(0x0e, 0x05),  /* DPI_HFA */
@@ -120,7 +123,6 @@ flush_l3(void)
}
 
asm volatile ("dsb" : : : "memory");
-   asm volatile ("dmb" : : : "memory");
 
return;
 }
@@ -253,23 +255,22 @@ initiate_retention_reset(void)
 {
unsigned long ctl_244 = 0;
unsigned long value;
-   unsigned long delay;
+
+   if (0 == ddr_retention_enabled) {
+   pr_info("DDR Retention Reset is Not Enabled\n");
+   return;
+   }
 
if (NULL == nca || NULL == apb || NULL == dickens)
BUG();
 
-   system_state = SYSTEM_RESTART;
+   /* send stop message to other CPUs */
+   local_irq_disable();
asm volatile ("dsb" : : : "memory");
asm volatile ("dmb" : : : "memory");
-   usermodehelper_disable();
-   device_shutdown();
-   cpu_hotplug_disable();
-   syscore_shutdown();
+   system_state = SYSTEM_RESTART;
smp_send_stop();
 
-   for (delay = 0; delay < 1; ++delay)
-   udelay(1000);
-
flush_cache_all();
flush_l3();
 
@@ -290,6 +291,7 @@ initiate_retention_reset(void)
ncr_read(NCP_REGION_ID(34, 0), 0x3d0, 4, &ctl_244);
ctl_244 |= 0x000a;
 
+
/*
 * set up for CRBW operation
 */
@@ -309,7 +311,7 @@ initiate_retention_reset(void)
 * into cache
 */
asm volatile ("dsb" : : : "memory");
-   prefetch(ncp_ddr_shutdown);
+   prefetch_range(ncp_ddr_shutdown, 0x1000);
 
ncp_ddr_shutdown();
 
@@ -325,25 +327,33 @@ axxia_ddr_retention_trigger(struct file *file, const char 
__user *buf,
return 0;
 }
 
-static const struct file_operations proc_ops = {
+static const struct file_operations axxia_ddr_retention_proc_ops = {
.write  = axxia_ddr_retention_trigger,
.llseek = noop_llseek,
 };
 
-#define PROC_PATH "driver/axxia_ddr_retention_reset"
-
 void
 axxia_ddr_retention_init(void)
 {
-   if (!of_find_compatible_node(NULL, NULL, "lsi,axm5516"))
-   return;
+   /*
+   * Only available on ASIC systems.
+   */
 
-   if (!proc_create(PROC_PATH, S_IWUSR, NULL, &proc_ops)) {
-   pr_err("Failed to register DDR retention proc interface\n");
-   return;
+   if (of_find_compatible_node(NULL, NULL, "lsi,axm5516")) {
+   /* Create /proc entry. */
+   if (!proc_create("driver/axxia_ddr_retention_reset",
+   S_IWUSR, NULL, &axxia_ddr_retention_proc_ops)) {
+   pr_info("Failed to register DDR retention proc 
entry\n");
+   } else {
+   apb = ioremap(0x201000, 0x4);
+   nca = ioremap(0x00202010ULL, 0x2);
+   dickens = ioremap(0x20, 0x100);
+   ddr_retention_enabled = 1;
+   pr_info("DDR Retention Reset Initialized\n");
+   }
+   } else {
+   pr_info("DDR Retention Reset is Not Available\n");
}
 
-   apb = ioremap(0x201000, 0x4);
-   nca = ioremap(0x00202010ULL, 0x2);
-   dickens = ioremap(0x20, 0x100);
+   return;
 }
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 06/39] arch/arm/mach-axxia: Accept the new lsi, axm5516-emu Machine

2014-04-11 Thread Charlie Paul
From: John Jacques 

Add lsi,axm5516-emu to the list of matching machines.

Signed-off-by: John Jacques 
---
 arch/arm/mach-axxia/axxia.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-axxia/axxia.c b/arch/arm/mach-axxia/axxia.c
index b227ca9..dcb6305 100644
--- a/arch/arm/mach-axxia/axxia.c
+++ b/arch/arm/mach-axxia/axxia.c
@@ -58,6 +58,7 @@
 static const char *axxia_dt_match[] __initconst = {
"lsi,axm5516",
"lsi,axm5516-sim",
+   "lsi,axm5516-emu",
NULL
 };
 
@@ -296,6 +297,7 @@ void __init axxia_dt_init(void)
pm_power_off = NULL; /* TBD */
 
ncr_init();
+   axxia_ddr_retention_init();
 
spi_register_board_info(spi_devs, ARRAY_SIZE(spi_devs));
 
@@ -307,8 +309,6 @@ void __init axxia_dt_init(void)
 
axxia_pcie_init();
 
-   axxia_ddr_retention_init();
-
platform_device_register(&pmu_device);
 }
 
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 02/39] i2c-axxia: Fix broken smbus block read

2014-04-11 Thread Charlie Paul
From: Anders Berg 

Changed the initial transfer size on block reads from 1 to I2C_SMBUS_BLOCK_MAX.
The size is adjusted when the first byte (block length) is received. Having the
initial size set to 1 could cause the controller to stop the transfter after
the block length byte, if the transfter length register wasn't updated in time.

Signed-off-by: Anders Berg 
---
 drivers/i2c/busses/i2c-axxia.c |   20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index e0a4b24..a46d2d3 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -260,15 +260,18 @@ axxia_i2c_empty_rx_fifo(struct axxia_i2c_dev *idev)
while (0 < bytes_to_transfer--) {
int c = readl(&idev->regs->mst_data);
if (idev->msg_xfrd == 0 && i2c_m_recv_len(msg)) {
-   if (c == 0 || c > I2C_SMBUS_BLOCK_MAX) {
+   /*
+* Check length byte for SMBus block read
+*/
+   if (c <= 0) {
idev->msg_err = -EPROTO;
i2c_int_disable(idev, ~0);
-   dev_err(idev->dev,
-   "invalid SMBus block size (%d)\n", c);
complete(&idev->msg_complete);
break;
+   } else if (c > I2C_SMBUS_BLOCK_MAX) {
+   c = I2C_SMBUS_BLOCK_MAX;
}
-   msg->len += c;
+   msg->len = 1 + c;
writel(msg->len, &idev->regs->mst_rx_xfer);
}
msg->buf[idev->msg_xfrd++] = c;
@@ -330,7 +333,7 @@ axxia_i2c_isr(int irq, void *_dev)
if (unlikely(status & MST_STATUS_ERR)) {
idev->msg_err = status & MST_STATUS_ERR;
i2c_int_disable(idev, ~0);
-   dev_err(idev->dev, "error %s, rx=%u/%u tx=%u/%u\n",
+   dev_dbg(idev->dev, "error %s, rx=%u/%u tx=%u/%u\n",
status_str(idev->msg_err),
readl(&idev->regs->mst_rx_bytes_xfrd),
readl(&idev->regs->mst_rx_xfer),
@@ -389,7 +392,10 @@ axxia_i2c_xfer_msg(struct axxia_i2c_dev *idev, struct 
i2c_msg *msg)
/* TX 0 bytes */
writel(0, &idev->regs->mst_tx_xfer);
/* RX # bytes */
-   writel(msg->len, &idev->regs->mst_rx_xfer);
+   if (i2c_m_recv_len(msg))
+   writel(I2C_SMBUS_BLOCK_MAX, &idev->regs->mst_rx_xfer);
+   else
+   writel(msg->len, &idev->regs->mst_rx_xfer);
/* Chip address for write */
writel(CHIP_READ(msg->addr), &idev->regs->mst_addr_1);
} else {
@@ -421,7 +427,7 @@ axxia_i2c_xfer_msg(struct axxia_i2c_dev *idev, struct 
i2c_msg *msg)
 
WARN_ON(readl(&idev->regs->mst_command) & 0x8);
 
-   if (WARN_ON(ret == 0)) {
+   if (ret == 0) {
dev_warn(idev->dev, "xfer timeout (%#x)\n", msg->addr);
axxia_i2c_init(idev);
return -ETIMEDOUT;
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 09/39] LSI AXXIA: fixes for VP engine quiesce and DDR shutdown

2014-04-11 Thread Charlie Paul
From: Gary McGee 

---
 arch/arm/mach-axxia/ddr_retention.c |  187 ---
 arch/arm/mach-axxia/ncr.c   |   18 +++-
 2 files changed, 121 insertions(+), 84 deletions(-)

diff --git a/arch/arm/mach-axxia/ddr_retention.c 
b/arch/arm/mach-axxia/ddr_retention.c
index 933ff6d..bcedf33 100644
--- a/arch/arm/mach-axxia/ddr_retention.c
+++ b/arch/arm/mach-axxia/ddr_retention.c
@@ -36,9 +36,15 @@
 static void __iomem *nca;
 static void __iomem *apb;
 static void __iomem *dickens;
+static void __iomem *femac;
 static int ddr_retention_enabled;
 
-static unsigned long
+enum {
+   AXXIA_ENGINE_CAAL,
+   AXXIA_ENGINE_CNAL
+};
+
+unsigned long
 ncp_caal_regions_acp55xx[] = {
NCP_REGION_ID(0x0b, 0x05),  /* SPPV2   */
NCP_REGION_ID(0x0c, 0x05),  /* SED */
@@ -57,6 +63,11 @@ ncp_caal_regions_acp55xx[] = {
NCP_REGION_ID(0x1c, 0x05),  /* PAB */
NCP_REGION_ID(0x1f, 0x05),  /* EIOAM0  */
NCP_REGION_ID(0x31, 0x05),  /* ISB */
+   NCP_REGION_ID(0xff, 0xff)
+};
+
+unsigned long
+ncp_cnal_regions_acp55xx[] = {
NCP_REGION_ID(0x28, 0x05),  /* EIOASM0 */
NCP_REGION_ID(0x29, 0x05),  /* EIOASM1 */
NCP_REGION_ID(0x2a, 0x05),  /* EIOAS2  */
@@ -67,6 +78,7 @@ ncp_caal_regions_acp55xx[] = {
NCP_REGION_ID(0xff, 0xff)
 };
 
+
 /*
   
--
   flush_l3
@@ -128,17 +140,36 @@ flush_l3(void)
 }
 
 static void
-quiesce_vp_engine(void)
+quiesce_vp_engine(int engineType)
 {
-   unsigned long   *pCnalRegions = ncp_caal_regions_acp55xx;
-   unsigned long *pRegion;
+   unsigned long *pEngineRegions;
+   unsigned long ortOff, owtOff;
+   unsigned long *pRegion;
unsigned ort, owt;
-   unsigned long  buf = 0;
-   unsigned short node, target;
-   int  loop;
+   unsigned long buf = 0;
+   unsigned short node, target;
+   int loop;
 
pr_info("quiescing VP engines...\n");
-   pRegion = pCnalRegions;
+
+   switch (engineType) {
+   case AXXIA_ENGINE_CNAL:
+   pEngineRegions = ncp_cnal_regions_acp55xx;
+   ortOff = 0x1c0;
+   owtOff = 0x1c4;
+   break;
+
+   case AXXIA_ENGINE_CAAL:
+   pEngineRegions = ncp_caal_regions_acp55xx;
+   ortOff = 0xf8;
+   owtOff = 0xfc;
+   break;
+
+   default:
+   return;
+   }
+
+   pRegion = pEngineRegions;
 
while (*pRegion != NCP_REGION_ID(0xff, 0xff)) {
/* set read/write transaction limits to zero */
@@ -147,15 +178,15 @@ quiesce_vp_engine(void)
pRegion++;
}
 
-   pRegion = pCnalRegions;
+   pRegion = pEngineRegions;
loop = 0;
 
while (*pRegion != NCP_REGION_ID(0xff, 0xff)) {
node = (*pRegion & 0x) >> 16;
target = *pRegion & 0x;
/* read the number of outstanding read/write transactions */
-   ncr_read(*pRegion, 0xf8, 4, &ort);
-   ncr_read(*pRegion, 0xfc, 4, &owt);
+   ncr_read(*pRegion, ortOff, 4, &ort);
+   ncr_read(*pRegion, owtOff, 4, &owt);
 
if ((ort == 0) && (owt == 0)) {
/* this engine has been quiesced, move on to the next */
@@ -164,8 +195,9 @@ quiesce_vp_engine(void)
pRegion++;
} else {
if (loop++ > 1) {
-   pr_info("Unable to quiesce region 0x%02x.0x%02x 
ort=0x%x, owt=0x%x\n",
-  node, target, ort, owt);
+   pr_info(
+   "Unable to quiesce region 
0x%02x.0x%02x ort=0x%x, owt=0x%x\n",
+   node, target, ort, owt);
pRegion++;
loop = 0;
continue;
@@ -176,76 +208,71 @@ quiesce_vp_engine(void)
return;
 }
 
+static inline void cpu_disable_l2_prefetch(void)
+{
+   unsigned int v;
+
+/*
+ * MRC p15, 1, , c15, c0, 3; Read L2 Prefetch Control Register
+ * MCR p15, 1, , c15, c0, 3; Write L2 Prefetch Control Register
+ *
+ */
+   asm volatile(
+   "   mrc p15, 1, %0, c15, c0, 3\n"
+   "   and %0, %0, #0x\n"
+   "   mcr p15, 1, %0, c15, c0, 3\n"
+   : "=&r" (v)
+   :
+   : "cc");
+
+   isb();
+}
+
 static inline void
-ncp_ddr_shutdown(void)
+ncp_ddr_shutdown(unsigned long ctl_244)
 {
unsigned long value;
-   int loop = 1;
-   unsigned long cdr2[2] = {0x2200, 0x0f00};
-   int smId;
 
+   cpu_disable_l2_prefetch();
 
/*
-* Most of the PIO command has already been set up.
-* issue confi

[linux-yocto] [PATCH 05/39] arch/arm/mach-axxia: Updated Device Tree for Emulation

2014-04-11 Thread Charlie Paul
From: John Jacques 

Added device tree support for the latest GIC driver.

In some cases, it is necessary to distinguish between simulation,
emulation, and hardware systems.  Simulation already had a different
name (lsi,axm5516-sim).  This patch gives emulation a different name
as well (lsi,axm5516-emu).

Signed-off-by: John Jacques 
---
 arch/arm/boot/dts/axm55xxemu.dts   |   33 ++
 arch/arm/boot/dts/axm55xxemu7.dts  |  226 
 arch/arm/boot/dts/axm55xxsim16.dts |2 +-
 3 files changed, 235 insertions(+), 26 deletions(-)
 create mode 100644 arch/arm/boot/dts/axm55xxemu7.dts

diff --git a/arch/arm/boot/dts/axm55xxemu.dts b/arch/arm/boot/dts/axm55xxemu.dts
index d95af00..7c0802a 100644
--- a/arch/arm/boot/dts/axm55xxemu.dts
+++ b/arch/arm/boot/dts/axm55xxemu.dts
@@ -1,5 +1,5 @@
 /*
- * arch/arm/boot/dts/axm5500-sim.dts
+ * arch/arm/boot/dts/axm55xxemu.dts
  *
  * Copyright (C) 2012 LSI
  *
@@ -24,7 +24,7 @@
 
 / {
model = "AXM5516";
-   compatible = "arm", "lsi,axm5516";
+   compatible = "arm", "lsi,axm5516-emu";
interrupt-parent = <&gic>;
#address-cells = <2>;
#size-cells = <2>;
@@ -46,6 +46,7 @@
compatible = "arm,cortex-a15";
reg = <0>;
 cpu-release-addr = <0>; // Fixed by the boot loader
+   clock-frequency= <0>;   // Placeholder
};
 
cpu@1 {
@@ -53,6 +54,7 @@
compatible = "arm,cortex-a15";
reg = <1>;
 cpu-release-addr = <0>; // Fixed by the boot loader
+   clock-frequency= <0>;   // Placeholder
};
 
cpu@2 {
@@ -60,6 +62,7 @@
compatible = "arm,cortex-a15";
reg = <2>;
 cpu-release-addr = <0>; // Fixed by the boot loader
+   clock-frequency= <0>;   // Placeholder
};
 
cpu@3 {
@@ -67,30 +70,8 @@
compatible = "arm,cortex-a15";
reg = <3>;
 cpu-release-addr = <0>; // Fixed by the boot loader
+   clock-frequency= <0>;   // Placeholder
};
-
-   /*
-   cpu@4 {
-   device_type = "cpu";
-   compatible = "arm,cortex-a15";
-   reg = <4>;
-cpu-release-addr = <0>; // Fixed by the boot loader
-   };
-
-   cpu@5 {
-   device_type = "cpu";
-   compatible = "arm,cortex-a15";
-   reg = <5>;
-cpu-release-addr = <0>; // Fixed by the boot loader
-   };
-
-   cpu@6 {
-   device_type = "cpu";
-   compatible = "arm,cortex-a15";
-   reg = <6>;
-cpu-release-addr = <0>; // Fixed by the boot loader
-   };
-   */
};
 
clocks {
@@ -122,6 +103,8 @@
interrupt-controller;
reg = <0x20 0x01001000 0 0x1000>,  /* gic dist base */
  <0x20 0x01002000 0 0x100>,   /* gic cpu base */
+ <0x20 0x01004000 0 0x2000>,  /* vgic control */
+ <0x20 0x01006000 0 0x2000>,  /* vgic cpu base */
  <0x20 0x1003 0 0x100>,   /* axm IPI mask reg base */
  <0x20 0x1004 0 0x2>; /* axm IPI send reg base */
};
diff --git a/arch/arm/boot/dts/axm55xxemu7.dts 
b/arch/arm/boot/dts/axm55xxemu7.dts
new file mode 100644
index 000..56375c1
--- /dev/null
+++ b/arch/arm/boot/dts/axm55xxemu7.dts
@@ -0,0 +1,226 @@
+/*
+ * arch/arm/boot/dts/axm55xxemu7.dts
+ *
+ * Copyright (C) 2012 LSI
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/dts-v1/;
+
+/memreserve/ 0x 0x0040;
+
+/ {
+   model = "AXM5516";
+   compatible = "arm", "lsi,axm5516-emu";
+   interrupt-parent = <&gic>;
+   #address-cells = <2>;
+   #size-cells = <2>;
+
+   chosen { };
+
+   aliases {
+   serial0   = &axxia_serial0;
+   

[linux-yocto] [PATCH 04/39] LSI powerpc/boot: added for rapidio

2014-04-11 Thread Charlie Paul
---
 arch/arm/boot/dts/axm55xx.dts |   33 +++
 arch/powerpc/boot/dts/lsi_acp342x.dts |  317 +
 arch/powerpc/boot/dts/lsi_acp344x.dts |  355 +
 3 files changed, 705 insertions(+)
 create mode 100644 arch/powerpc/boot/dts/lsi_acp342x.dts
 create mode 100644 arch/powerpc/boot/dts/lsi_acp344x.dts

diff --git a/arch/arm/boot/dts/axm55xx.dts b/arch/arm/boot/dts/axm55xx.dts
index 1aabe31..230a305 100644
--- a/arch/arm/boot/dts/axm55xx.dts
+++ b/arch/arm/boot/dts/axm55xx.dts
@@ -35,6 +35,8 @@
serial0   = &axxia_serial0;
timer = &axxia_timers;
ethernet0 = &axxia_femac0;
+   rapidio0  = &rio0;
+   rapidio1  = &rio1;
};
 
cpus {
@@ -455,6 +457,37 @@
reg = <0x20 0x10098000 0 0x3000>;
interrupts = <0 45 4>;
};
+
+rio0: rapidio@0x31 {
+index = <0>;
+status = "okay";
+#address-cells = <2>;
+#size-cells = <2>;
+compatible = "axxia,rapidio-delta";
+device_type = "rapidio";
+reg = <0x0020 0x20142000 0x0 0x1000>; /* SRIO Conf 0 region */
+ranges = <0x0 0x0 0x0031 0x 0x0 0x4000>;
+linkdown-reset = <0x0200 0x100 0x0020 0x1000 0x0 
0x1>;
+interrupts = <0 89 4>;
+outb-dmes = <2 0x0003 1 0x>;
+   enable_ds = <1>;
+};
+
+rio1: rapidio@0x314000 {
+index = <1>;
+status = "okay";
+#address-cells = <2>;
+#size-cells = <2>;
+compatible = "axxia,rapidio-delta";
+device_type = "rapidio";
+reg = <0x0020 0x20143000 0x0 0x1000>; /* SRIO Conf 1 region */
+ranges = <0x0 0x0 0x0031 0x4000 0x0 0x4000>;
+linkdown-reset = <0x0200 0x200 0x0020 0x1000 0x0 
0x1>;
+interrupts = <0 90 4>;
+outb-dmes = <2 0x0003 1 0x>;
+   enable_ds = <1>;
+};
+
 };
 
 /*
diff --git a/arch/powerpc/boot/dts/lsi_acp342x.dts 
b/arch/powerpc/boot/dts/lsi_acp342x.dts
new file mode 100644
index 000..da6066e
--- /dev/null
+++ b/arch/powerpc/boot/dts/lsi_acp342x.dts
@@ -0,0 +1,317 @@
+/*
+ * Device Tree Source for IBM Embedded PPC 476 Platform
+ *
+ * Copyright 2009 Torez Smith, IBM Corporation.
+ *
+ * Based on earlier code:
+ * Copyright (c) 2006, 2007 IBM Corp.
+ * Josh Boyer , David Gibson 
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without
+ * any warranty of any kind, whether express or implied.
+ */
+
+/dts-v1/;
+
+/memreserve/ 0x 0x0040;
+
+/ {
+   #address-cells = <2>;
+   #size-cells = <1>;
+   model = "ibm,acpx1-4xx";
+   compatible = "ibm,acpx1-4xx","ibm,47x-AMP";
+   dcr-parent = <&{/cpus/cpu@0}>;
+
+   aliases {
+   serial0 = &UART0;
+   serial1 = &UART1;
+   rapidio0 = &rio0;
+   ethernet0 = &FEMAC;
+   };
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   cpu@0 {
+   device_type = "cpu";
+   model = "PowerPC,4xx"; // real CPU changed in sim
+   reg = <0>;
+clock-frequency = <0x5f5e1000>;
+timebase-frequency = <0x5f5e1000>;
+   i-cache-line-size = <32>;
+   d-cache-line-size = <32>;
+   i-cache-size = <32768>;
+   d-cache-size = <32768>;
+   dcr-controller;
+   dcr-access-method = "native";
+   status = "ok";
+   reset-type = <3>; // 1=core, 2=chip, 3=system (default)
+   };
+   cpu@1 {
+   device_type = "cpu";
+   model = "PowerPC,4xx"; // real CPU changed in sim
+   reg = <1>;
+clock-frequency = <0x5f5e1000>;
+timebase-frequency = <0x5f5e1000>;
+   i-cache-line-size = <32>;
+   d-cache-line-size = <32>;
+   i-cache-size = <32768>;
+   d-cache-size = <32768>;
+   dcr-controller;
+   dcr-access-method = "native";
+   status = "disabled";
+   enable-method = "spin-table";
+   cpu-release-addr = <0 0x2040>;
+   reset-type = <3>; // 1=core, 2=chip, 3=system (default)
+   };
+   };
+
+memory@0 {
+device_type = "memory";
+

[linux-yocto] [PATCH 03/39] i2c-axxia: code update kernel.org coding spec

2014-04-11 Thread Charlie Paul
This file was updated with the checkpatch and the appropriate
changes were made to support kernel.org syntax
---
 drivers/i2c/busses/i2c-axxia.c |   26 --
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index a46d2d3..f536dc4 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -207,14 +207,13 @@ axxia_i2c_init(struct axxia_i2c_dev *idev)
/*
   Find the prescaler value that makes tmo_clk fit in 15-bits counter.
 */
-   for (prescale=0; prescale < 15; ++prescale) {
+   for (prescale = 0; prescale < 15; ++prescale) {
if (tmo_clk <= 0x7fff)
break;
tmo_clk >>= 1;
}
-   if (tmo_clk > 0x7fff) {
+   if (tmo_clk > 0x7fff)
tmo_clk = 0x7fff;
-   }
 
/* Prescale divider (log2) */
writel(prescale, &idev->regs->timer_clock_div);
@@ -358,9 +357,8 @@ axxia_i2c_isr(int irq, void *_dev)
}
 
/* RX FIFO needs service? */
-   if (i2c_m_rd(idev->msg) && (status & MST_STATUS_RFL)) {
+   if (i2c_m_rd(idev->msg) && (status & MST_STATUS_RFL))
axxia_i2c_empty_rx_fifo(idev);
-   }
 
/* TX FIFO needs service? */
if (!i2c_m_rd(idev->msg) && (status & MST_STATUS_TFL)) {
@@ -421,7 +419,8 @@ axxia_i2c_xfer_msg(struct axxia_i2c_dev *idev, struct 
i2c_msg *msg)
 
i2c_int_enable(idev, int_mask);
 
-   ret = wait_for_completion_timeout(&idev->msg_complete, 
I2C_XFER_TIMEOUT);
+   ret = wait_for_completion_timeout(&idev->msg_complete,
+   I2C_XFER_TIMEOUT);
 
i2c_int_disable(idev, int_mask);
 
@@ -452,11 +451,11 @@ axxia_i2c_stop(struct axxia_i2c_dev *idev)
/* Issue stop */
writel(0xb, &idev->regs->mst_command);
i2c_int_enable(idev, int_mask);
-   ret = wait_for_completion_timeout(&idev->msg_complete, 
I2C_STOP_TIMEOUT);
+   ret = wait_for_completion_timeout(&idev->msg_complete,
+   I2C_STOP_TIMEOUT);
i2c_int_disable(idev, int_mask);
-   if (ret == 0) {
+   if (ret == 0)
return -ETIMEDOUT;
-   }
 
WARN_ON(readl(&idev->regs->mst_command) & 0x8);
 
@@ -470,9 +469,8 @@ axxia_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg 
msgs[], int num)
int i;
int ret = 0;
 
-   for (i = 0; ret == 0 && i < num; i++) {
+   for (i = 0; ret == 0 && i < num; i++)
ret = axxia_i2c_xfer_msg(idev, &msgs[i]);
-   }
 
axxia_i2c_stop(idev);
 
@@ -482,10 +480,10 @@ axxia_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg 
msgs[], int num)
 static u32
 axxia_i2c_func(struct i2c_adapter *adap)
 {
-   return (I2C_FUNC_I2C |
+   return I2C_FUNC_I2C |
I2C_FUNC_10BIT_ADDR |
I2C_FUNC_SMBUS_EMUL |
-   I2C_FUNC_SMBUS_BLOCK_DATA);
+   I2C_FUNC_SMBUS_BLOCK_DATA;
 
 }
 
@@ -533,7 +531,7 @@ axxia_i2c_probe(struct platform_device *pdev)
}
 
idev->base = base;
-   idev->regs = (struct __iomem i2c_regs *) base;
+   idev->regs = (struct __iomem i2c_regs*) base;
idev->i2c_clk  = i2c_clk;
idev->dev  = &pdev->dev;
init_completion(&idev->msg_complete);
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 00/39] Resubmittal of LSI AXXIA updates to standard/axxia/base 3.10

2014-04-11 Thread Charlie Paul
These patches are the fixed patches from the original 57 patches submitted to 
the
LSI standard/axxia/base. NOTE: The patces for RIO have been removed. All other 
comments
have been implemented.

Anders Berg (13):
  i2c-axxia: Fix broken smbus block read
  i2c-axxia: Adjust tLOW,tHIGH to match fast-mode requirements
  arm/axxia: Workaround for cross-cluster sev issue
  Revert "LSI AXM55XX: Add GENERIC_LOCKBREAK"
  Revert "LSI AXM55XX: Disable use of wfe/sev in arch spinlock"
  dma: lsi-dma32: DMA driver configuration update
  dma: lsi-dma32: Cleanup DMA driver
  mach-axxia: Split device tree into SoC/board parts
  arm/axxia: Configure changes to 'GPIO driver for SPI chip selects'
  arm/axxia: GPIO driver for SPI chip selects
  spi: Revert to mainline spi-pl022
  hwmon: Support new revision of LTC2974
  i2c-axxia: Use managed functions devm_*

Charlie Paul (3):
  i2c-axxia: code update kernel.org coding spec
  LSI powerpc/boot: added for rapidio
  i2c-axxia: Configure changes to 'Use managed functions devm_*'

David Mercado (3):
  LSI FEMAC Ethernet Driver
  kernel/irq/manage.c: Fix irq_set_affinity to allow use with buslocks
  LSI AXM55xx: Axxia GIC driver improvements (3rd gen)

Gary McGee (2):
  LSI AXXIA: fixes for VP engine quiesce and DDR shutdown
  arm/axxia: improved robustness for DDR retention

John Jacques (10):
  arch/arm/mach-axxia: Updated Device Tree for Emulation
  arch/arm/mach-axxia: Accept the new lsi,axm5516-emu Machine
  arch/arm/mach-axxia: Disable DDR Retention Resets in Sim/Emu
  arch/arm/mach-axxia: Updates to the VMFS File System
  axxia: Updated Device Trees Signed-off-by: John Jacques

  arch/arm/mach-axxia: Name Cleanup
  arch/arm/mach-axxia: Work-Around for Event Problems in v1.0 Silicon
  arch/powerpc: Update the Axxia Device Tree Files
  arch/powerpc: Clean up of Compatible Names in Axxia Device Trees
  LSI drivers/tty: Axxia Serial Driver Update

Jonas Svennebring (2):
  arm/mm: Backport of 3159f372354e8e1f5dee714663d70
  LSI AXXIA: Basic perf support for axxia plaform block provided by
LSI.

Michael Bringmann (2):
  LSI AXM55xx: Configuration updates
  LSI AXM55xx: Disable linkdown reset configuration.

Paul Butler (2):
  i2c: comforming to changes introduced by move of_i2c to core
  gpio: repairs merge comflict

SangeethaRao (2):
  arch/powerpc: Checking in correct USB entries to ACP3421 DTS
  LSI powerpc/sysdev: Removing the power of 2 size restriction

 arch/arm/Kconfig  |7 +-
 arch/arm/boot/dts/Makefile|5 +
 arch/arm/boot/dts/axm-sim.dts |  403 -
 arch/arm/boot/dts/axm-ve-tc1.dts  |  363 -
 arch/arm/boot/dts/axm-ve-tc2.dts  |  174 --
 arch/arm/boot/dts/axm5504-cpus.dtsi   |   49 +
 arch/arm/boot/dts/axm5504-emu.dts |   44 +
 arch/arm/boot/dts/axm5504-sim.dts |  127 ++
 arch/arm/boot/dts/axm5507-cpus.dtsi   |   73 +
 arch/arm/boot/dts/axm5507-emu.dts |   44 +
 arch/arm/boot/dts/axm5508-cpus.dtsi   |   81 +
 arch/arm/boot/dts/axm5512-cpus.dtsi   |  114 ++
 arch/arm/boot/dts/axm5516-amarillo.dts|  195 +++
 arch/arm/boot/dts/axm5516-cpus.dtsi   |  145 ++
 arch/arm/boot/dts/axm5516-sim.dts |  127 ++
 arch/arm/boot/dts/axm55xx.dts |  464 --
 arch/arm/boot/dts/axm55xx.dtsi|  390 +
 arch/arm/boot/dts/axm55xxemu.dts  |  219 ---
 arch/arm/boot/dts/axm55xxemu7.dts |  226 +++
 arch/arm/boot/dts/axm55xxsim.dts  |  363 -
 arch/arm/boot/dts/axm55xxsim16.dts|  459 --
 arch/arm/boot/fmboot/Makefile |   12 +-
 arch/arm/include/asm/spinlock.h   |9 +-
 arch/arm/mach-axxia/Makefile  |6 +-
 arch/arm/mach-axxia/axxia-gic.c   | 1138 ++---
 arch/arm/mach-axxia/axxia.c   |   66 +-
 arch/arm/mach-axxia/clock.c   |2 +-
 arch/arm/mach-axxia/ddr_retention.c   |  255 +--
 arch/arm/mach-axxia/ddr_shutdown.c|  332 
 arch/arm/mach-axxia/ev.c  |   53 +
 arch/arm/mach-axxia/ncr.c |   18 +-
 arch/arm/mach-axxia/perf_event_memc.c |  130 ++
 arch/arm/mach-axxia/perf_event_memc.h |   62 +
 arch/arm/mach-axxia/perf_event_pcx.c  |   46 +
 arch/arm/mach-axxia/perf_event_platform.c |  270 
 arch/arm/mach-axxia/perf_event_platform.h |   10 +
 arch/arm/mach-axxia/perf_event_vp.c   |   51 +
 arch/arm/mach-axxia/platsmp.c |   54 +-
 arch/arm/mach-axxia/smon.c|  200 +++
 arch/arm/mach-axxia/smon.h|   71 +
 arch/arm/mach-axxia/ssp-gpio.c|  132 ++
 arch/arm/mm/mmap.c|   10 +-
 arch/powerpc/boot/dts/acp25xx.dts |  398 +++--
 arch/powerpc/boot/dts/acp342x.dts |  353 ++--
 arch/powerpc/boot/dts/acp344x.dts |  151 +-
 arch/powerpc/boot/dts/acp35xx.dts |   72 +-
 arch/powerpc/boot/dts/lsi_acp342x.dts |  317 
 arch/powerpc/boot/dts/lsi_acp344x

[linux-yocto] [PATCH 01/39] arch/powerpc: Checking in correct USB entries to ACP3421 DTS

2014-04-11 Thread Charlie Paul
From: SangeethaRao 

These changes were made to fix the failure in the USB.
This change only affects the ACP34321 DTS

Signed-off-by: SangeethaRao 
---
 arch/powerpc/boot/dts/acp342x.dts |   33 +
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/arch/powerpc/boot/dts/acp342x.dts 
b/arch/powerpc/boot/dts/acp342x.dts
index b851788..f5cf3a6 100644
--- a/arch/powerpc/boot/dts/acp342x.dts
+++ b/arch/powerpc/boot/dts/acp342x.dts
@@ -90,64 +90,65 @@
 clock-frequency = <0>; // Filled in by zImage
 UART0: serial@00404000 {
 device_type = "serial";
-compatible = "acp-uart0";
+compatible = "lsi,acp-uart0";
 enabled = <1>;
 reg = <0x00404000 0x1000>;
 clock-reg = <0x00408040 0x20>;
 clock-frequency = <0xbebc200>;
 current-speed = <9600>;
 interrupt-parent = <&MPIC>;
-interrupts = <22 4>;
+interrupts = <22>;
 };
 UART1: serial@00405000 {
 device_type = "serial";
-compatible = "acp-uart1";
+compatible = "lsi,acp-uart1";
 enabled = <0>;
 reg = <0x00405000 0x1000>;
 clock-reg = <0x00408060 0x20>;
 clock-frequency = <2>;
 current-speed = <9600>;
 interrupt-parent = <&MPIC>;
-interrupts = <23 4>;
+interrupts = <23>;
 };
 USB0: usb@004a4000 {
 device_type = "usb";
-compatible = "acp-usb";
-enabled = <0>;
-reg = <0x004a4000 0x0002>;
+compatible = "lsi,acp-usb";
+enabled = <1>;
+reg = <0x20 0x004A 0x0 002>,
+   <0x20 0x0040C000 0x0 0001000>;
 interrupt-parent = <&MPIC>;
-interrupts = <31 4>;
+interrupts = <31>;
 };
 I2C: i2c@00403000 {
-compatible = "acp-i2c";
+compatible = "lsi,acp-i2c";
 enabled = <0>;
 reg = <0x00403000 0x1000>;
 interrupt-parent = <&MPIC>;
-interrupts = <21 4>;
+interrupts = <21>;
 };
 SSP: ssp@00402000 {
-compatible = "acp-ssp";
+compatible = "arm,acp-ssp";
 enabled = <0>;
 reg = <0x00402000 0x1000>;
 interrupt-parent = <&MPIC>;
-interrupts = <20 4>;
+interrupts = <20>;
 };
 NAND: nand@0044 {
 device_type = "nand";
-compatible = "acp-nand";
+compatible = "lsi,acp-nand";
 enabled = <1>;
 reg = <0x0044 0x2
0x0040c000 0x1000>;
 };
 FEMAC: femac@0048 {
 device_type = "network";
-compatible = "acp-femac";
+compatible = "lsi,acp-femac";
 enabled = <1>;
 reg = <0x0048 0x1000
0x00481000 0x1000
0x00482000 0x1000>;
 interrupt-parent = <&MPIC>;
-interrupts = <33 4>;
+interrupts = <33>;
 mdio-reg = <0x00409000 0x1000>;
 // The following will get filled in by
 // the boot loader.
@@ -284,7 +285,7 @@
 };
 
 rio0: rapidio@f002 {
-compatible = "acp,rapidio-delta";

Re: [linux-yocto] [PATCH 47/57] Basic perf support for axxia plaform block provided by LSI.

2014-04-11 Thread Paul, Charlie
Bruce,

I am going to resubmit this group of patches less any patch that has to do with 
RIO. This was requested by our customer. This should remove any patches that 
don't have the required comments in the headers. The other patches are all 
updated as per your comments.

Charlie

-Original Message-
From: Bruce Ashfield [mailto:bruce.ashfi...@windriver.com] 
Sent: Monday, March 24, 2014 6:09 AM
To: Svennebring, Jonas; Charlie Paul; linux-yocto@yoctoproject.org
Cc: Paul, Charlie
Subject: Re: [PATCH 47/57] Basic perf support for axxia plaform block provided 
by LSI.

On 14-03-24 07:24 AM, Svennebring, Jonas wrote:
> Hi,
>
> The basic support includes:
> * Generic AXXIA SMON (Statistic Monitor) functionality.
>
> * Support for Memory Controllers:
>- DDRC, DDR Controllers.
>- ELM, Encryption Memory Controllers .
>
> *Preparation for support of:
>- PCX, integrated Ethernet switch.
>- VP, virtual pipeline packet processing engines.
>
> Documentation, VP/PCX support as well as patch alignment with coming ARM L3$ 
> and interconnect is in the workings.
>

Looks good. Thanks for the summary.

Charlie: can we capture this in the log ?

Bruce

> Best Regards,
>
> //Jonas
>
> -Original Message-
> From: Bruce Ashfield [mailto:bruce.ashfi...@windriver.com]
> Sent: den 20 mars 2014 09:44
> To: Charlie Paul; linux-yocto@yoctoproject.org
> Cc: charlie.p...@windriver.com; Svennebring, Jonas
> Subject: Re: [PATCH 47/57] Basic perf support for axxia plaform block 
> provided by LSI.
>
> Can we get a short feature listing of what is included in the basic support ?
>
> A summary here is fine, and perhaps a README or other perf documentation 
> update as well.
>
> Bruce
>
> On 14-03-18 12:56 AM, Charlie Paul wrote:
>> From: Jonas Svennebring 
>>
>> Signed-off-by: Jonas Svennebring 
>> ---
>>arch/arm/mach-axxia/perf_event_memc.c |  130 ++
>>arch/arm/mach-axxia/perf_event_memc.h |   62 +++
>>arch/arm/mach-axxia/perf_event_pcx.c  |   46 +
>>arch/arm/mach-axxia/perf_event_platform.c |  270 
>> +
>>arch/arm/mach-axxia/perf_event_platform.h |   10 ++
>>arch/arm/mach-axxia/perf_event_vp.c   |   51 ++
>>arch/arm/mach-axxia/smon.c|  200 +
>>arch/arm/mach-axxia/smon.h|   71 
>>8 files changed, 840 insertions(+)
>>create mode 100644 arch/arm/mach-axxia/perf_event_memc.c
>>create mode 100644 arch/arm/mach-axxia/perf_event_memc.h
>>create mode 100644 arch/arm/mach-axxia/perf_event_pcx.c
>>create mode 100644 arch/arm/mach-axxia/perf_event_platform.c
>>create mode 100644 arch/arm/mach-axxia/perf_event_platform.h
>>create mode 100644 arch/arm/mach-axxia/perf_event_vp.c
>>create mode 100644 arch/arm/mach-axxia/smon.c
>>create mode 100644 arch/arm/mach-axxia/smon.h
>>
>> diff --git a/arch/arm/mach-axxia/perf_event_memc.c
>> b/arch/arm/mach-axxia/perf_event_memc.c
>> new file mode 100644
>> index 000..a20fc8a
>> --- /dev/null
>> +++ b/arch/arm/mach-axxia/perf_event_memc.c
>> @@ -0,0 +1,130 @@
>> +/*
>> + * arch/arm/mach-axxia/perf_event_memc.c
>> + * included from arch/arm/mach-axxia/perf_event_platform.c
>> + *
>> + * Support for the LSI Axxia boards based on ARM cores.
>> + *
>> + * Copyright (C) 2014 LSI
>> + *
>> + * This program is free software; you can redistribute it and/or 
>> +modify
>> + * it under the terms of the GNU General Public License as published 
>> +by
>> + * the Free Software Foundation; either version 2 of the License, or
>> + * (at your option) any later version.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU General Public License
>> + * along with this program; if not, write to the Free Software
>> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
>> +02111-1307  USA  */
>> +
>> +#include "perf_event_memc.h"
>> +
>> +static void memc_startup_init(void)
>> +{
>> +smon_init_ncp(&ddrc0_smon, DDRC0, DDRC_PERF, DDRC_SMON);
>> +smon_init_ncp(&ddrc1_smon, DDRC1, DDRC_PERF, DDRC_SMON);
>> +smon_init_mem(&elm0_smon, ELM0, ELM_SMON);
>> +smon_init_mem(&elm1_smon, ELM1, ELM_SMON); }
>> +
>> +static uint32_t memc_pmu_event_init(uint32_t event, struct 
>> +perf_event
>> +*pevent) {
>> +return 0;
>> +}
>> +
>> +static void memc_pmu_event_destroy(uint32_t event, struct perf_event
>> +*pevent) {
>> +smon_stop_if_unassigned(&ddrc0_smon);
>> +smon_stop_if_unassigned(&ddrc1_smon);
>> +smon_stop_if_unassigned(&elm0_smon);
>> +smon_stop_if_unassigned(&elm1_smon);
>> +}
>> +
>> +static uint32_t memc_pmu_event_add(uint32_t ev, struct perf_event
>> +*pevent) {
>> +uint32_t ret;
>> +
>> +if