[linux-yocto] [PATCH 01/17] net: lsi_acp_net: Added new string to DT match

2014-07-09 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

Add a the vendor prefixed compatible string to the match table.

Signed-off-by: Anders Berg anders.b...@lsi.com
---
 drivers/net/ethernet/lsi/lsi_acp_net.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/lsi/lsi_acp_net.c 
b/drivers/net/ethernet/lsi/lsi_acp_net.c
index 5589619..de1e895 100644
--- a/drivers/net/ethernet/lsi/lsi_acp_net.c
+++ b/drivers/net/ethernet/lsi/lsi_acp_net.c
@@ -2078,7 +2078,8 @@ static int __devexit appnic_drv_remove(struct 
platform_device *pdev)
 }
 
 static const struct of_device_id appnic_dt_ids[] = {
-   { .compatible = acp-femac, }
+   { .compatible = lsi,acp-femac },
+   { .compatible = acp-femac }
 };
 MODULE_DEVICE_TABLE(of, appnic_dt_ids);
 
-- 
1.7.9.5

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


[linux-yocto] [PATCH 03/17] ARM: axxia: Support MSI on both PCIe controllers

2014-07-09 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

Add support for PCIe MSI on both controllers. On AXM5516, PCIE0 has the ability
to signal MSI interrupts on 16 separate lines to the CPU cores, where as PCIE1
only has a single interrupt line that is used for legacy, status/error and MSI.
This patch adds MSI support on a controller with only one interrupt line.

Signed-off-by: Anders Berg anders.b...@lsi.com
---
 arch/arm/mach-axxia/pci.c |   67 +++--
 1 file changed, 41 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-axxia/pci.c b/arch/arm/mach-axxia/pci.c
index 49565e8..0f94403 100644
--- a/arch/arm/mach-axxia/pci.c
+++ b/arch/arm/mach-axxia/pci.c
@@ -40,6 +40,7 @@
 #include asm-generic/errno-base.h
 #include mach/pci.h
 
+
 #define PCIE_CONFIG  (0x1000)
 #define PCIE_STATUS  (0x1004)
 #define PCIE_CORE_DEBUG  (0x1008)
@@ -143,6 +144,7 @@ struct axxia_pciex_port {
 #define PCIE_MAX_PORTS 2
 static struct axxia_pciex_port *axxia_pciex_ports;
 
+static void pcie_msi_dispatch(u32 group, struct axxia_pciex_port *port);
 
 static void __init
 fixup_axxia_pci_bridge(struct pci_dev *dev)
@@ -474,6 +476,14 @@ pcie_legacy_isr(int irq, void *arg)
(void) readl(port-regs + PCIE_MSG_IN_FIFO);
/* Next handler in chain will service this interrupt */
retval = IRQ_NONE;
+   } else if (intr_status  INT0_MSI) {
+   u32 msi_status = readl(port-regs + PCIE_MSI0_STATUS);
+   if (msi_status == 0) {
+   retval = IRQ_NONE;
+   } else {
+   u32 group = ffs(msi_status) - 1;
+   pcie_msi_dispatch(group, port);
+   }
}
 
/*
@@ -488,7 +498,7 @@ pcie_legacy_isr(int irq, void *arg)
 }
 
 /*
- * pcie_msi_irq_handler
+ * MSI handler
  *
  * This is the handler for PCIE MSI service. It will decode the signalled MSI
  * using the following hierarchy of status bits. This handler is installed as a
@@ -526,38 +536,40 @@ pcie_legacy_isr(int irq, void *arg)
  *   +--+
  */
 static void
-pcie_msi_irq_handler(int irq, struct axxia_pciex_port *port)
+pcie_msi_dispatch(u32 group, struct axxia_pciex_port *port)
 {
-   void __iomem *mbase = port-regs;
-   u32 group = irq - port-irq[1];
u32 status;
 
-   /* Check if interrupt is pending */
-   status = readl(mbase + PCIE_MSI0_STATUS);
-   if (!(status  (1group)))
-   return;
-
/* Check next level interrupt status */
-   status = readl(mbase + PCIE_MSI1_STATUS(group))  0x;
+   status = readl(port-regs + PCIE_MSI1_STATUS(group))  0x;
while (status) {
u32 line = ffs(status) - 1;
-   status = ~(1line);
+   status = ~(1  line);
/* Clear interrupt on sub-level */
-   writel((1line), mbase + PCIE_MSI1_STATUS(group));
+   writel((1  line), port-regs + PCIE_MSI1_STATUS(group));
generic_handle_irq(AXXIA_MSI_FIRST + (group * 16) + line);
}
 
/* Clear interrupt on top-level*/
-   writel(1group, mbase + PCIE_MSI0_STATUS);
-
+   writel(1  group, port-regs + PCIE_MSI0_STATUS);
 }
 
 static void
-pcie_pei0_msi_handler(unsigned int irq, struct irq_desc *desc)
+pcie_msi_irq_handler(unsigned int irq, struct irq_desc *desc)
 {
-   kstat_incr_irqs_this_cpu(irq, desc);
-   /* Handle the PCIe interrupt */
-   pcie_msi_irq_handler(irq, axxia_pciex_ports[0]);
+   struct axxia_pciex_port *port = axxia_pciex_ports[0];
+   u32 group = irq - port-irq[1];
+   u32 status;
+
+   /* Check if interrupt is pending */
+   status = readl(port-regs + PCIE_MSI0_STATUS);
+   if (status  (1  group)) {
+   kstat_incr_irqs_this_cpu(irq, desc);
+   /* Handle the PCIe interrupt */
+   pcie_msi_dispatch(group, port);
+   } else {
+   handle_bad_irq(irq, desc);
+   }
/* Signal end-of-interrupt */
irq_desc_get_chip(desc)-irq_eoi(desc-irq_data);
 }
@@ -604,13 +616,12 @@ static int axxia_pcie_setup(int portno, struct 
pci_sys_data *sys)
goto fail;
}
 
-   /* MSI interrupts for PEI0 */
-   if (sys-domain == 0) {
-   for (i = 1; i = 16; i++) {
-   port-irq[i] = irq_of_parse_and_map(port-node, i);
-   irq_set_chained_handler(port-irq[i],
-   pcie_pei0_msi_handler);
-   }
+   /* MSI interrupts */
+   for (i = 1; i = 16; i++) {
+   port-irq[i] = irq_of_parse_and_map(port-node, i);
+   if (!port-irq[i])
+   break;
+   irq_set_chained_handler(port-irq[i], pcie_msi_irq_handler);
}
 
/* Setup as root complex */
@@ -971,7 +982,11 @@ again:
 
   

[linux-yocto] [PATCH 04/17] i2c: axxia: Minor cleanup (cosmetic)

2014-07-09 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

Remove unused definitions and remove redundant variable.

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 drivers/i2c/busses/i2c-axxia.c |   27 +++
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index db1a2d3..7355975 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -49,8 +49,6 @@ struct i2c_regs {
__le32 mst_tx_xfer;
__le32 mst_addr_1;
__le32 mst_addr_2;
-#define CHIP_READ(_chip)  (((_chip)  1) | 1)
-#define CHIP_WRITE(_chip) (((_chip)  1) | 0)
__le32 mst_data;
__le32 mst_tx_fifo;
__le32 mst_rx_fifo;
@@ -115,9 +113,7 @@ 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 */
+   /* pointer to registers */
struct i2c_regs __iomem *regs;
/* irq number */
int irq;
@@ -365,7 +361,7 @@ axxia_i2c_isr(int irq, void *_dev)
/* Transfer error? */
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(status),
readl(idev-regs-mst_rx_bytes_xfrd),
readl(idev-regs-mst_rx_xfer),
@@ -439,13 +435,13 @@ 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);
+ I2C_XFER_TIMEOUT);
 
i2c_int_disable(idev, int_mask);
 
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;
@@ -471,7 +467,7 @@ axxia_i2c_stop(struct axxia_i2c_dev *idev)
writel(0xb, idev-regs-mst_command);
i2c_int_enable(idev, int_mask);
ret = wait_for_completion_timeout(idev-msg_complete,
-   I2C_STOP_TIMEOUT);
+ I2C_STOP_TIMEOUT);
i2c_int_disable(idev, int_mask);
if (ret == 0)
return -ETIMEDOUT;
@@ -500,11 +496,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 |
-   I2C_FUNC_10BIT_ADDR |
-   I2C_FUNC_SMBUS_EMUL |
-   I2C_FUNC_SMBUS_BLOCK_DATA;
-
+   u32 caps = (I2C_FUNC_I2C |
+   I2C_FUNC_10BIT_ADDR |
+   I2C_FUNC_SMBUS_EMUL |
+   I2C_FUNC_SMBUS_BLOCK_DATA);
+   return caps;
 }
 
 static const struct i2c_algorithm axxia_i2c_algo = {
@@ -554,7 +550,6 @@ axxia_i2c_probe(struct platform_device *pdev)
goto err_cleanup;
}
 
-   idev-base = base;
idev-regs = (struct __iomem i2c_regs*)base;
idev-i2c_clk  = i2c_clk;
idev-dev  = pdev-dev;
@@ -627,7 +622,7 @@ axxia_i2c_remove(struct platform_device *pdev)
i2c_del_adapter(idev-adapter);
free_irq(idev-irq, idev);
clk_put(idev-i2c_clk);
-   iounmap(idev-base);
+   iounmap(idev-regs);
kfree(idev);
return 0;
 }
-- 
1.7.9.5

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


[linux-yocto] [PATCH 10/17] gpio: pl061: Fix .init section mismatch

2014-07-09 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 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 9d35136..3d0e9fc 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -390,7 +390,7 @@ static const struct dev_pm_ops pl061_dev_pm_ops = {
 #endif
 
 #ifdef CONFIG_ARM_AMBA
-static int __init pl061_amba_probe(struct amba_device *dev, struct amba_id *id)
+static int pl061_amba_probe(struct amba_device *dev, const struct amba_id *id)
 {
return pl061_probe(dev-dev, dev-res, dev-irq[0], NULL);
 }
-- 
1.7.9.5

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


[linux-yocto] [PATCH 13/17] powerpc/sysdev/lsi:adding 3500 PCIe inbound mapping support

2014-07-09 Thread Charlie Paul
From: SangeethaRao sangeetha@lsi.com

Signed-off-by: SangeethaRao sangeetha@lsi.com
---
 arch/powerpc/sysdev/lsi_pci.c |   40 +++-
 1 file changed, 35 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/sysdev/lsi_pci.c b/arch/powerpc/sysdev/lsi_pci.c
index f485343..1236fdc 100644
--- a/arch/powerpc/sysdev/lsi_pci.c
+++ b/arch/powerpc/sysdev/lsi_pci.c
@@ -756,15 +756,45 @@ configure_acp_pciex_PIMs(struct pciex_port *port,
  dma_base.
*/
 
-   pci_dram_offset = size;
-   hose-dma_window_base_cur = size;
-
-   out_le32(mbase + PCI_BASE_ADDRESS_0, RES_TO_U32_LOW(size));
-   out_le32(mbase + PCI_BASE_ADDRESS_1, RES_TO_U32_HIGH(size));
+   if (0x10 == port-acpChipType) {
+   /* For 3500, set base address to pci base */
+   pci_dram_offset = res-start;
+   hose-dma_window_base_cur = res-start;
+   } else {
+   pci_dram_offset = size;
+   hose-dma_window_base_cur = size;
+   }
 
if (5 == port-acpChipType) {
printk(KERN_WARNING Setting SIZE for 2500\n);
out_le32(mbase + 0x11f4, 0xf000UL);
+   out_le32(mbase + PCI_BASE_ADDRESS_0,
+   RES_TO_U32_LOW(size));
+   out_le32(mbase + PCI_BASE_ADDRESS_1,
+   RES_TO_U32_HIGH(size));
+   } else if (0x10 == port-acpChipType) {
+   printk(KERN_WARNING Setting SIZE for 3500\n);
+   out_le32(mbase + 0x11f4, size);
+   /* Verify BAR0 size */
+   {
+   u32 bar0_size;
+   out_le32(mbase + PCI_BASE_ADDRESS_0, ~0);
+   out_le32(mbase + PCI_BASE_ADDRESS_1, ~0);
+   bar0_size = in_le32(mbase + PCI_BASE_ADDRESS_0);
+   if ((bar0_size  ~0xf) != size)
+   pr_err(PCIE%d: Config BAR0 failed\n,
+   port-index);
+   bar0_size = in_le32(mbase + PCI_BASE_ADDRESS_1);
+   }
+   /* Set the BASE0 address to start of PCIe base */
+   out_le32(mbase + PCI_BASE_ADDRESS_0, res-start);
+   /* Set the BASE1 address to 0x0 */
+   out_le32(mbase + PCI_BASE_ADDRESS_1, 0x0);
+   } else {
+   out_le32(mbase + PCI_BASE_ADDRESS_0,
+   RES_TO_U32_LOW(size));
+   out_le32(mbase + PCI_BASE_ADDRESS_1,
+   RES_TO_U32_HIGH(size));
}
 
/*
-- 
1.7.9.5

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


[linux-yocto] [PATCH 12/17] misc: lsi-smmon: Add parameter panic_on_fatal

2014-07-09 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

Added module parameter panic_on_fatal which when set will cause the driver
to call panic() when an uncorrectable ECC error is detected.

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 drivers/misc/lsi-smmon.c |   27 ++-
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/misc/lsi-smmon.c b/drivers/misc/lsi-smmon.c
index d263df9..88f291a 100644
--- a/drivers/misc/lsi-smmon.c
+++ b/drivers/misc/lsi-smmon.c
@@ -24,6 +24,10 @@ static int log = 1;
 module_param(log, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(log, Log each error to kernel log.);
 
+static int panic_on_fatal = 1;
+module_param(panic_on_fatal, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(panic_on_fatal, Panic on fatal error.);
+
 /*
   AXM55xx memory controller interrupt status bits:
 
@@ -96,18 +100,19 @@ static const u32 event_mask[NR_EVENTS] = {
 };
 
 static const struct event_logging {
+   int fatal;
const char *level;
const char *name;
 } event_logging[NR_EVENTS] = {
-   [EV_ILLEGAL] = {KERN_ERR, Illegal access},
-   [EV_MULT_ILLEGAL]= {KERN_ERR, Illegal access},
-   [EV_CORR_ECC]= {KERN_NOTICE, Correctable ECC error},
-   [EV_MULT_CORR_ECC]   = {KERN_NOTICE, Correctable ECC error},
-   [EV_UNCORR_ECC]  = {KERN_CRIT, Uncorrectable ECC error},
-   [EV_MULT_UNCORR_ECC] = {KERN_CRIT, Uncorrectable ECC error},
-   [EV_PORT_ERROR]  = {KERN_CRIT, Port error},
-   [EV_WRAP_ERROR]  = {KERN_CRIT, Wrap error},
-   [EV_PARITY_ERROR]= {KERN_CRIT, Parity error},
+   [EV_ILLEGAL] = {0, KERN_ERR, Illegal access},
+   [EV_MULT_ILLEGAL]= {0, KERN_ERR, Illegal access},
+   [EV_CORR_ECC]= {0, KERN_NOTICE, Correctable ECC error},
+   [EV_MULT_CORR_ECC]   = {0, KERN_NOTICE, Correctable ECC error},
+   [EV_UNCORR_ECC]  = {1, KERN_CRIT, Uncorrectable ECC error},
+   [EV_MULT_UNCORR_ECC] = {1, KERN_CRIT, Uncorrectable ECC error},
+   [EV_PORT_ERROR]  = {0, KERN_CRIT, Port error},
+   [EV_WRAP_ERROR]  = {0, KERN_CRIT, Wrap error},
+   [EV_PARITY_ERROR]= {0, KERN_CRIT, Parity error},
 };
 
 struct smmon_attr {
@@ -181,6 +186,10 @@ static irqreturn_t smmon_isr(int interrupt, void *device)
for (i = 0; i  NR_EVENTS; ++i) {
if ((status  event_mask[i]) != 0) {
++sm-counter[i];
+   if (panic_on_fatal  event_logging[i].fatal)
+   panic(%s (%s)\n,
+ event_logging[i].name,
+ dev_name(sm-pdev-dev));
if (log)
printk_ratelimited(%s%s: %s\n,
   event_logging[i].level,
-- 
1.7.9.5

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


[linux-yocto] [PATCH 14/17] arch/powerpc: Updated Device Trees for Axxia (3400/3500)

2014-07-09 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

Also added the 6th Core to the Default 3500 Device Tree

Signed-off-by: John Jacques john.jacq...@lsi.com
---
 arch/powerpc/boot/dts/acp342x.dts |  347 +++--
 arch/powerpc/boot/dts/acp344x.dts |  164 --
 arch/powerpc/boot/dts/acp35xx.dts |   73 
 3 files changed, 323 insertions(+), 261 deletions(-)

diff --git a/arch/powerpc/boot/dts/acp342x.dts 
b/arch/powerpc/boot/dts/acp342x.dts
index 6e02a8c..28a0a13 100644
--- a/arch/powerpc/boot/dts/acp342x.dts
+++ b/arch/powerpc/boot/dts/acp342x.dts
@@ -1,10 +1,10 @@
 /*
- * Device Tree Source for IBM Embedded PPC 476 Platform
+ * Device Tree Source for LSI Axxia ACP342x.
  *
- * 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 jwbo...@linux.vnet.ibm.com, David Gibson d...@au1.ibm.com
  *
  * This file is licensed under the terms of the GNU General Public
@@ -17,165 +17,187 @@
 /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;
+   #address-cells = 2;
+   #size-cells = 1;
+   model = ibm,acpx1-4xx;
+   compatible = lsi,acp3420, lsi,acp, ibm,acpx1-4xx;
+   dcr-parent = {/cpus/cpu@0};
+
+   aliases {
+   serial0   = UART0;
+   serial1   = UART1;
ethernet0 = FEMAC;
-};
+   rapidio0  = SRIO0;
+   };
 
-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)
-};
-};
+   cpus {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   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; // filled in by U-Boot
+   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 = 0 0 0; // filled in by U-Boot
 };
 
 memory@8000 {
 device_type = memory;
-reg = 0x 0x8000 0x8000; // filled in by 
U-Boot
+reg = 0 0 0; // filled in by U-Boot
 };
 
-MPIC: interrupt-controller {
-compatible = chrp,open-pic;
-interrupt-controller;
-dcr-reg = 0xffc0 0x0003;
-#address-cells = 0;
-#size-cells = 0;
-#interrupt-cells = 

[linux-yocto] [PATCH 11/17] misc: lsi-smmon: Bug when probing with IRQ pending

2014-07-09 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

We must not call the ncr_write function to unmask interrupts with
the memory controller interrupt enabled, as this could cause the ISR to
be invoked before ncr_write has released the lock used to serialize
register accesses.

To avoid this, temporarily disable the IRQ line while unmasking the
interrupt sources in the controller.

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 drivers/misc/lsi-smmon.c |   31 +--
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/drivers/misc/lsi-smmon.c b/drivers/misc/lsi-smmon.c
index fe0d9e0..d263df9 100644
--- a/drivers/misc/lsi-smmon.c
+++ b/drivers/misc/lsi-smmon.c
@@ -200,8 +200,8 @@ smmon_probe(struct platform_device *pdev)
 {
struct sm_dev *sm;
struct resource *io;
-   struct resource *irq;
-   u32 mask = SM_INT_MASK;
+   int irq;
+   u32 mask;
int rc = 0;
 
sm = devm_kzalloc(pdev-dev, sizeof *sm, GFP_KERNEL);
@@ -218,26 +218,37 @@ smmon_probe(struct platform_device *pdev)
}
sm-region = io-start;
 
-   irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-   if (!irq) {
-   rc = -EINVAL;
+   /* Disable all memory controller interrupts */
+   mask = 0x;
+   ncr_write(sm-region, 0x414, 4, mask);
+
+   irq = platform_get_irq(pdev, 0);
+   if (irq  0) {
+   rc = irq;
goto out;
}
 
-   rc = devm_request_irq(pdev-dev, irq-start, smmon_isr,
-   IRQF_ONESHOT, dev_name(pdev-dev), pdev);
+   rc = devm_request_irq(pdev-dev, irq, smmon_isr,
+ IRQF_ONESHOT, dev_name(pdev-dev), sm);
if (rc)
goto out;
 
-   /* Enable memory controller interrupts */
-   ncr_write(sm-region, 0x414, 4, mask);
-
rc = sysfs_create_group(pdev-dev.kobj, smmon_attr_group);
if (rc)
goto out;
 
dev_set_drvdata(pdev-dev, sm);
pr_info(%s: Memory controller monitor\n, dev_name(pdev-dev));
+
+   /* Enable memory controller interrupts. We need to disable the
+* interrupt while unmasking it, since otherwise there will be a
+* locking conflict in ncr_write/ncr_read when the ISR tries to read
+* interrupt status.
+*/
+   disable_irq(irq);
+   mask = SM_INT_MASK;
+   ncr_write(sm-region, 0x414, 4, mask);
+   enable_irq(irq);
 out:
return rc;
 }
-- 
1.7.9.5

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


[linux-yocto] [PATCH 15/17] arch/powerpc: Update the Axxia NAND Driver to support 3500

2014-07-09 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

The nand driver changes have to support multiple controllers on multiple 
targets.
This is the simplest way I could see to get there.  There is a change from using
hard coded defines to using the device tree which was required to accomplish 
this.

Signed-off-by: John Jacques john.jacq...@lsi.com
---
 drivers/mtd/nand/lsi_acp_nand.c |  171 +--
 1 file changed, 93 insertions(+), 78 deletions(-)

diff --git a/drivers/mtd/nand/lsi_acp_nand.c b/drivers/mtd/nand/lsi_acp_nand.c
index 1cac342..07c521e 100644
--- a/drivers/mtd/nand/lsi_acp_nand.c
+++ b/drivers/mtd/nand/lsi_acp_nand.c
@@ -342,16 +342,11 @@ _WRITEL(const char *file, int line, unsigned long value, 
unsigned long address)
 */
 
 static void *gpreg_base;
-
-#define LSI_NAND_PECC_BUSY_REGISTER (gpreg_base + 0x00c)
-
-#ifdef CONFIG_ACP_X1V1
-#define LSI_NAND_PECC_BUSY_MASK(1  25)
-#else
-#define LSI_NAND_PECC_BUSY_MASK(1  28)
-#endif
+static void *pecc_busy_register;
+static unsigned long pecc_busy_mask;
 
 #define MAX_READ_BUF   16
+
 /*
   --
   MTD structures
@@ -706,8 +701,8 @@ lsi_nand_command(struct mtd_info *mtd, unsigned int command,
   NAND_NCE | NAND_CLE | NAND_CTRL_CHANGE);
do {
udelay(chip-chip_delay);
-   status = READL((void *)LSI_NAND_PECC_BUSY_REGISTER);
-   } while (0 != (status  LSI_NAND_PECC_BUSY_MASK));
+   status = READL(pecc_busy_register);
+   } while (0 != (status  pecc_busy_mask));
 
/* wait until CHIP_BUSY goes low */
do {
@@ -835,9 +830,9 @@ static int lsi_nand_wait(struct mtd_info *mtd, struct 
nand_chip *chip)
 #ifdef NOT_USED
if (FL_READING == chip-state || FL_WRITING == chip-state) {
for (;;) {
-   status = READL((void *)LSI_NAND_PECC_BUSY_REGISTER);
+   status = READL((void *)pecc_busy_register);
 
-   if (0 == (status  LSI_NAND_PECC_BUSY_MASK))
+   if (0 == (status  pecc_busy_mask))
break;
 
udelay(chip-chip_delay);
@@ -845,9 +840,9 @@ static int lsi_nand_wait(struct mtd_info *mtd, struct 
nand_chip *chip)
}
 #else
for (;;) {
-   status = READL((void *)LSI_NAND_PECC_BUSY_REGISTER);
+   status = READL((void *)pecc_busy_register);
 
-   if (0 == (status  LSI_NAND_PECC_BUSY_MASK))
+   if (0 == (status  pecc_busy_mask))
break;
 
udelay(chip-chip_delay);
@@ -3468,15 +3463,17 @@ lsi_nand_init(void)
void *nand_base;
struct device_node *np = NULL;
struct mtd_part_parser_data ppdata;
-   static const char *part_probe_types[]
-   = { cmdlinepart, ofpart, NULL };
-
-   np = of_find_compatible_node(NULL, NULL, lsi,acp3500);
-
-   if (NULL != np) {
-   printk(KERN_ERR NAND Support is Not Yet Available on 3500\n);
-   return -1;
-   }
+   static const char *part_probe_types[] =
+   { cmdlinepart, ofpart, NULL };
+   const u32 *reg;
+   int reglen;
+   u64 nand_address;
+   unsigned long nand_length;
+   u64 gpreg_address;
+   unsigned long gpreg_length;
+   const u32 *enabled;
+   unsigned long cr;
+   unsigned long cr_save;
 
memset(ppdata, 0, sizeof(ppdata));
 
@@ -3485,74 +3482,92 @@ lsi_nand_init(void)
while (np  !of_device_is_compatible(np, acp-nand))
np = of_find_node_by_type(np, nand);
 
-   if (np) {
-   const u32 *reg;
-   int reglen;
-   u64 nand_address;
-   unsigned long nand_length;
-   u64 gpreg_address;
-   unsigned long gpreg_length;
-   const u32 *enabled;
+   if (NULL == np) {
+   printk(KERN_ERR No NAND Nodes in Device Tree\n);
 
-   enabled = of_get_property(np, enabled, NULL);
+   return -1;
+   }
 
-   if (!enabled || (enabled  (0 == *enabled))) {
-   printk(KERN_INFO ACP NAND Controller Isn't 
Enabled.\n);
-   return -ENODEV;
-   }
+   enabled = of_get_property(np, enabled, NULL);
 
-   reg = of_get_property(np, reg, reglen);
-
-   if (reg  (16 == reglen)) {
-   nand_address = of_translate_address(np, reg);
-   nand_length = reg[1];
-   reg += 2;
-   gpreg_address = of_translate_address(np, reg);
-   gpreg_length = reg[1];
-   printk(KERN_INFO nand_address=0x%08llx 
nand_length=0x%lx\n
-  gpreg_address=0x%08llx 

[linux-yocto] [PATCH 17/17] arch/powerpc: Reset Updates for Axxia

2014-07-09 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

Reset support for 3400/2500/3500 got removed when we were porting to
Yocto quite some time back.  It has never worked since that port.
This restores the original reset code require to support reset on 
3400/2500/3500.

Signed-off-by: John Jacques john.jacq...@lsi.com
---
 arch/powerpc/sysdev/ppc4xx_soc.c |   73 +-
 1 file changed, 72 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/sysdev/ppc4xx_soc.c b/arch/powerpc/sysdev/ppc4xx_soc.c
index 0debcc3..5505f46 100644
--- a/arch/powerpc/sysdev/ppc4xx_soc.c
+++ b/arch/powerpc/sysdev/ppc4xx_soc.c
@@ -24,6 +24,9 @@
 #include asm/dcr.h
 #include asm/dcr-regs.h
 #include asm/reg.h
+#ifdef CONFIG_ACP
+#include asm/mpic.h
+#endif
 
 static u32 dcrbase_l2c;
 
@@ -60,7 +63,7 @@ static irqreturn_t l2c_error_handler(int irq, void *dev)
}
 
/* Clear parity errors */
-   if (sr  (L2C_SR_CPE | L2C_SR_TPE)){
+   if (sr  (L2C_SR_CPE | L2C_SR_TPE)) {
mtdcr(dcrbase_l2c + DCRN_L2C0_ADDR, 0);
mtdcr(dcrbase_l2c + DCRN_L2C0_CMD, L2C_CMD_CCP | L2C_CMD_CTE);
} else {
@@ -190,6 +193,45 @@ static int __init ppc4xx_l2c_probe(void)
 }
 arch_initcall(ppc4xx_l2c_probe);
 
+#ifdef CONFIG_ACP
+
+/*
+ * Issue a core reset.
+ */
+
+void
+acp_jump_to_boot_loader(void *input)
+{
+   mpic_teardown_this_cpu(0);
+   /* This is only valid in the core reset case, so 0x1000. */
+   mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | 0x1000);
+
+   while (1)
+   ;   /* Just in case the jump fails. */
+}
+
+/*
+ * Get all other cores to run acp_jump_to_boot_loader() then go
+ * there as well.
+ */
+
+void
+acp_reset_cores(void)
+{
+   int cpu;
+
+   for_each_possible_cpu(cpu) {
+   if (cpu != smp_processor_id())
+   smp_call_function_single(cpu, acp_jump_to_boot_loader,
+NULL, 0);
+   }
+
+   acp_jump_to_boot_loader(NULL);
+}
+
+
+#endif
+
 /*
  * Apply a system reset. Alternatively a board specific value may be
  * provided via the reset-type property in the cpu node.
@@ -214,7 +256,36 @@ void ppc4xx_reset_system(char *cmd)
reset_type = prop[0]  28;
}
 
+#ifdef CONFIG_ACP
+   if (DBCR0_RST_CORE == reset_type) {
+   acp_reset_cores();
+   } else {
+   /*
+ In this case, reset_type is either chip or system.
+
+ On the AXM3500 (PVR=0x7ff520c1), writing to DBCR0
+ will occasionally stall the system.  As a
+ work-around, write to the system control register.
+   */
+
+   u32 pvr_value;
+
+   asm volatile (mfpvr%0 : =r(pvr_value));
+
+   if (0x7ff520c1 == pvr_value) {
+   u32 value;
+
+   value = mfdcrx(0xd0a);
+   value |= 0xab;
+   mtdcrx(0xd0a, value);
+   mtdcrx(0xe00, 1);
+   } else {
+   mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | reset_type);
+   }
+   }
+#else
mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | reset_type);
+#endif
 
while (1)
;   /* Just in case the reset doesn't work */
-- 
1.7.9.5

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


[linux-yocto] [PATCH 16/17] kernel/smp: Allow smp_call_function_single() to be called with a function that doesn't return.

2014-07-09 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

When we do a reset (core, not chip or system), the core that is doing the reset 
has to
tell all the other cores to reset.  To do this, we call 
smp_call_function_single().
In this case the function specified in smp_call_function_single() doesn't 
return.
The wait parameter (third argument, described as '@wait: If true, wait until
function has completed on other CPUs.') doesn't work as described without the 
patch.

Without the patch, smp_call_function_single() doesn't return when the function
indicated resets the called core.  The comments indicate that it should, but it 
does not.

Signen-off-by: John Jacques john.jacq...@lsi.com
---
 kernel/smp.c |   24 +++-
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/kernel/smp.c b/kernel/smp.c
index d5f3238..040b2b1 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -17,14 +17,14 @@
 static struct {
struct list_headqueue;
raw_spinlock_t  lock;
-} call_function __cacheline_aligned_in_smp =
-   {
+} call_function __cacheline_aligned_in_smp = {
.queue  = LIST_HEAD_INIT(call_function.queue),
.lock   = __RAW_SPIN_LOCK_UNLOCKED(call_function.lock),
};
 
 enum {
CSD_FLAG_LOCK   = 0x01,
+   CSD_FLAG_NOWAIT = 0x02,
 };
 
 struct call_function_data {
@@ -268,6 +268,8 @@ void generic_smp_call_function_single_interrupt(void)
 
while (!list_empty(list)) {
struct call_single_data *data;
+   void (*func)(void *);
+   void *info;
 
data = list_entry(list.next, struct call_single_data, list);
list_del(data-list);
@@ -278,12 +280,21 @@ void generic_smp_call_function_single_interrupt(void)
 * so save them away before making the call:
 */
data_flags = data-flags;
-
-   data-func(data-info);
+   func = data-func;
+   info = data-info;
 
/*
+* Unlock before calling func so that func never has
+* to return.
+*
 * Unlocked CSDs are valid through generic_exec_single():
 */
+   if ((data_flags  CSD_FLAG_LOCK) 
+   (data_flags  CSD_FLAG_NOWAIT))
+   csd_unlock(data);
+
+   func(info);
+
if (data_flags  CSD_FLAG_LOCK)
csd_unlock(data);
}
@@ -337,6 +348,9 @@ int smp_call_function_single(int cpu, smp_call_func_t func, 
void *info,
 
csd_lock(data);
 
+   if (!wait)
+   data-flags |= CSD_FLAG_NOWAIT;
+
data-func = func;
data-info = info;
generic_exec_single(cpu, data, wait);
@@ -672,7 +686,7 @@ EXPORT_SYMBOL(nr_cpu_ids);
 /* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */
 void __init setup_nr_cpu_ids(void)
 {
-   nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1;
+   nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask), NR_CPUS) + 
1;
 }
 
 /* Called by boot processor to activate the rest. */
-- 
1.7.9.5

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


[linux-yocto] [PATCH 01/17] net: lsi_acp_net: Added new string to DT match

2014-07-08 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

Add a the vendor prefixed compatible string to the match table.

Signed-off-by: Anders Berg anders.b...@lsi.com
---
 drivers/net/ethernet/lsi/lsi_acp_net.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/lsi/lsi_acp_net.c 
b/drivers/net/ethernet/lsi/lsi_acp_net.c
index 5589619..de1e895 100644
--- a/drivers/net/ethernet/lsi/lsi_acp_net.c
+++ b/drivers/net/ethernet/lsi/lsi_acp_net.c
@@ -2078,7 +2078,8 @@ static int __devexit appnic_drv_remove(struct 
platform_device *pdev)
 }
 
 static const struct of_device_id appnic_dt_ids[] = {
-   { .compatible = acp-femac, }
+   { .compatible = lsi,acp-femac },
+   { .compatible = acp-femac }
 };
 MODULE_DEVICE_TABLE(of, appnic_dt_ids);
 
-- 
1.7.9.5

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


[linux-yocto] [PATCH 04/17] i2c: axxia: Minor cleanup (cosmetic)

2014-07-08 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

Remove unused definitions and remove redundant variable.

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 drivers/i2c/busses/i2c-axxia.c |   27 +++
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index db1a2d3..7355975 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -49,8 +49,6 @@ struct i2c_regs {
__le32 mst_tx_xfer;
__le32 mst_addr_1;
__le32 mst_addr_2;
-#define CHIP_READ(_chip)  (((_chip)  1) | 1)
-#define CHIP_WRITE(_chip) (((_chip)  1) | 0)
__le32 mst_data;
__le32 mst_tx_fifo;
__le32 mst_rx_fifo;
@@ -115,9 +113,7 @@ 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 */
+   /* pointer to registers */
struct i2c_regs __iomem *regs;
/* irq number */
int irq;
@@ -365,7 +361,7 @@ axxia_i2c_isr(int irq, void *_dev)
/* Transfer error? */
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(status),
readl(idev-regs-mst_rx_bytes_xfrd),
readl(idev-regs-mst_rx_xfer),
@@ -439,13 +435,13 @@ 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);
+ I2C_XFER_TIMEOUT);
 
i2c_int_disable(idev, int_mask);
 
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;
@@ -471,7 +467,7 @@ axxia_i2c_stop(struct axxia_i2c_dev *idev)
writel(0xb, idev-regs-mst_command);
i2c_int_enable(idev, int_mask);
ret = wait_for_completion_timeout(idev-msg_complete,
-   I2C_STOP_TIMEOUT);
+ I2C_STOP_TIMEOUT);
i2c_int_disable(idev, int_mask);
if (ret == 0)
return -ETIMEDOUT;
@@ -500,11 +496,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 |
-   I2C_FUNC_10BIT_ADDR |
-   I2C_FUNC_SMBUS_EMUL |
-   I2C_FUNC_SMBUS_BLOCK_DATA;
-
+   u32 caps = (I2C_FUNC_I2C |
+   I2C_FUNC_10BIT_ADDR |
+   I2C_FUNC_SMBUS_EMUL |
+   I2C_FUNC_SMBUS_BLOCK_DATA);
+   return caps;
 }
 
 static const struct i2c_algorithm axxia_i2c_algo = {
@@ -554,7 +550,6 @@ axxia_i2c_probe(struct platform_device *pdev)
goto err_cleanup;
}
 
-   idev-base = base;
idev-regs = (struct __iomem i2c_regs*)base;
idev-i2c_clk  = i2c_clk;
idev-dev  = pdev-dev;
@@ -627,7 +622,7 @@ axxia_i2c_remove(struct platform_device *pdev)
i2c_del_adapter(idev-adapter);
free_irq(idev-irq, idev);
clk_put(idev-i2c_clk);
-   iounmap(idev-base);
+   iounmap(idev-regs);
kfree(idev);
return 0;
 }
-- 
1.7.9.5

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


[linux-yocto] [PATCH 00/17] LSI AXXIA updates to 3.4 standard/axxia/base

2014-07-08 Thread Charlie Paul
Updates to 2sc and additions to the 3500

Anders Berg (12):
  net: lsi_acp_net: Added new string to DT match
  ARM: dts: axxia: Corrected IRQ for memory contollers
  ARM: axxia: Support MSI on both PCIe controllers
  i2c: axxia: Minor cleanup (cosmetic)
  i2c: axxia: Report spurious IRQ
  i2c: axxia: Fix broken smbus block read
  i2c: axxia: Fall back to polling mode when no IRQ
  ARM: axxia: Fix .init section mismatch
  spi: pl022: Fix .init section mismatch
  gpio: pl061: Fix .init section mismatch
  misc: lsi-smmon: Bug when probing with IRQ pending
  misc: lsi-smmon: Add parameter panic_on_fatal

John Jacques (4):
  arch/powerpc: Updated Device Trees for Axxia (3400/3500)
  arch/powerpc: Update the Axxia NAND Driver to support 3500
  kernel/smp: Allow smp_call_function_single() to be called with a
function that doesn't return.
  arch/powerpc: Reset Updates for Axxia

SangeethaRao (1):
  powerpc/sysdev/lsi:adding 3500 PCIe inbound mapping support

 arch/arm/boot/dts/axm55xx.dts  |4 +-
 arch/arm/mach-axxia/pci.c  |   75 ---
 arch/powerpc/boot/dts/acp342x.dts  |  347 +---
 arch/powerpc/boot/dts/acp344x.dts  |  164 ++-
 arch/powerpc/boot/dts/acp35xx.dts  |   73 +++
 arch/powerpc/sysdev/lsi_pci.c  |   40 +++-
 arch/powerpc/sysdev/ppc4xx_soc.c   |   73 ++-
 drivers/gpio/gpio-pl061.c  |2 +-
 drivers/i2c/busses/i2c-axxia.c |  109 ++
 drivers/misc/lsi-smmon.c   |   58 --
 drivers/mtd/nand/lsi_acp_nand.c|  171 +---
 drivers/net/ethernet/lsi/lsi_acp_net.c |3 +-
 drivers/spi/spi-pl022.c|4 +-
 kernel/smp.c   |   24 ++-
 14 files changed, 699 insertions(+), 448 deletions(-)

-- 
1.7.9.5

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


[linux-yocto] [PATCH 02/17] ARM: dts: axxia: Corrected IRQ for memory contollers

2014-07-08 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

The interrupt numbers for the memory controllers was wrong (conflicting with
assigned range for PCI MSI. This would cause a device using MSI to fail to
request its IRQ.

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

diff --git a/arch/arm/boot/dts/axm55xx.dts b/arch/arm/boot/dts/axm55xx.dts
index 826a6e6..91d3f42 100644
--- a/arch/arm/boot/dts/axm55xx.dts
+++ b/arch/arm/boot/dts/axm55xx.dts
@@ -198,13 +198,13 @@
sm0@0022 {
compatible = lsi,smmon;
reg = 0 0x0022 0 0x1000;
-   interrupts = 0 192 4;
+   interrupts = 0 161 4;
};
 
sm1@0022 {
compatible = lsi,smmon;
reg = 0 0x000f 0 0x1000;
-   interrupts = 0 193 4;
+   interrupts = 0 160 4;
};
 
gpdma@202014 {
-- 
1.7.9.5

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


[linux-yocto] [PATCH 06/17] i2c: axxia: Fix broken smbus block read

2014-07-08 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

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 transfer after the block length byte, if the
transfer length register wasn't updated in time.

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 drivers/i2c/busses/i2c-axxia.c |   16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index e965793..15d5f0d 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -271,15 +271,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;
@@ -402,7 +405,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);
} else {
/* TX # bytes */
writel(msg-len, idev-regs-mst_tx_xfer);
-- 
1.7.9.5

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


[linux-yocto] [PATCH 08/17] ARM: axxia: Fix .init section mismatch

2014-07-08 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 arch/arm/mach-axxia/pci.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-axxia/pci.c b/arch/arm/mach-axxia/pci.c
index 0f94403..ae6eaf8 100644
--- a/arch/arm/mach-axxia/pci.c
+++ b/arch/arm/mach-axxia/pci.c
@@ -576,7 +576,7 @@ pcie_msi_irq_handler(unsigned int irq, struct irq_desc 
*desc)
 
 
 /* PCIe setup function */
-static int axxia_pcie_setup(int portno, struct pci_sys_data *sys)
+static __devinit int axxia_pcie_setup(int portno, struct pci_sys_data *sys)
 {
struct axxia_pciex_port *port = axxia_pciex_ports[sys-domain];
u32 pci_config, pci_status, link_state;
@@ -757,7 +757,7 @@ pcie_alloc_msi_table(struct pci_dev *pdev, struct 
axxia_pciex_port *port)
 /*
  * Scan PCIe bus
  */
-static struct pci_bus __init *
+static __devinit struct pci_bus *
 axxia_pcie_scan_bus(int nr, struct pci_sys_data *sys)
 {
if (WARN_ON(nr = PCIE_MAX_PORTS))
@@ -769,7 +769,7 @@ axxia_pcie_scan_bus(int nr, struct pci_sys_data *sys)
 
 
 
-static int __init
+static __devinit int
 axxia_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
struct pci_sys_data *sys = dev-sysdata;
@@ -788,7 +788,7 @@ static struct irq_chip axxia_msi_chip = {
 
 
 /* Port definition struct */
-static struct hw_pci axxia_pcie_hw[] = {
+static struct hw_pci axxia_pcie_hw[] __initdata = {
[0] = {
.nr_controllers = 1,
.domain = 0,
-- 
1.7.9.5

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


[linux-yocto] [PATCH 10/17] gpio: pl061: Fix .init section mismatch

2014-07-08 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 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 9d35136..3d0e9fc 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -390,7 +390,7 @@ static const struct dev_pm_ops pl061_dev_pm_ops = {
 #endif
 
 #ifdef CONFIG_ARM_AMBA
-static int __init pl061_amba_probe(struct amba_device *dev, struct amba_id *id)
+static int pl061_amba_probe(struct amba_device *dev, const struct amba_id *id)
 {
return pl061_probe(dev-dev, dev-res, dev-irq[0], NULL);
 }
-- 
1.7.9.5

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


[linux-yocto] [PATCH 11/17] misc: lsi-smmon: Bug when probing with IRQ pending

2014-07-08 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

We must not call the ncr_write function to unmask interrupts with
the memory controller interrupt enabled, as this could cause the ISR to
be invoked before ncr_write has released the lock used to serialize
register accesses.

To avoid this, temporarily disable the IRQ line while unmasking the
interrupt sources in the controller.

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 drivers/misc/lsi-smmon.c |   31 +--
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/drivers/misc/lsi-smmon.c b/drivers/misc/lsi-smmon.c
index fe0d9e0..d263df9 100644
--- a/drivers/misc/lsi-smmon.c
+++ b/drivers/misc/lsi-smmon.c
@@ -200,8 +200,8 @@ smmon_probe(struct platform_device *pdev)
 {
struct sm_dev *sm;
struct resource *io;
-   struct resource *irq;
-   u32 mask = SM_INT_MASK;
+   int irq;
+   u32 mask;
int rc = 0;
 
sm = devm_kzalloc(pdev-dev, sizeof *sm, GFP_KERNEL);
@@ -218,26 +218,37 @@ smmon_probe(struct platform_device *pdev)
}
sm-region = io-start;
 
-   irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-   if (!irq) {
-   rc = -EINVAL;
+   /* Disable all memory controller interrupts */
+   mask = 0x;
+   ncr_write(sm-region, 0x414, 4, mask);
+
+   irq = platform_get_irq(pdev, 0);
+   if (irq  0) {
+   rc = irq;
goto out;
}
 
-   rc = devm_request_irq(pdev-dev, irq-start, smmon_isr,
-   IRQF_ONESHOT, dev_name(pdev-dev), pdev);
+   rc = devm_request_irq(pdev-dev, irq, smmon_isr,
+ IRQF_ONESHOT, dev_name(pdev-dev), sm);
if (rc)
goto out;
 
-   /* Enable memory controller interrupts */
-   ncr_write(sm-region, 0x414, 4, mask);
-
rc = sysfs_create_group(pdev-dev.kobj, smmon_attr_group);
if (rc)
goto out;
 
dev_set_drvdata(pdev-dev, sm);
pr_info(%s: Memory controller monitor\n, dev_name(pdev-dev));
+
+   /* Enable memory controller interrupts. We need to disable the
+* interrupt while unmasking it, since otherwise there will be a
+* locking conflict in ncr_write/ncr_read when the ISR tries to read
+* interrupt status.
+*/
+   disable_irq(irq);
+   mask = SM_INT_MASK;
+   ncr_write(sm-region, 0x414, 4, mask);
+   enable_irq(irq);
 out:
return rc;
 }
-- 
1.7.9.5

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


[linux-yocto] [PATCH 09/17] spi: pl022: Fix .init section mismatch

2014-07-08 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 drivers/spi/spi-pl022.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 1204d69..12b925b 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -2287,8 +2287,8 @@ static struct vendor_data vendor_db5500_pl023 = {
.loopback = true,
 };
 
-static int __init
-pl022_amba_probe(struct amba_device *adev, struct amba_id *id)
+static int
+pl022_amba_probe(struct amba_device *adev, const struct amba_id *id)
 {
struct pl022 *pl022 = NULL;
int ret;
-- 
1.7.9.5

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


[linux-yocto] [PATCH 14/17] arch/powerpc: Updated Device Trees for Axxia (3400/3500)

2014-07-08 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

Also added the 6th Core to the Default 3500 Device Tree

Signed-off-by: John Jacques john.jacq...@lsi.com
---
 arch/powerpc/boot/dts/acp342x.dts |  347 +++--
 arch/powerpc/boot/dts/acp344x.dts |  164 --
 arch/powerpc/boot/dts/acp35xx.dts |   73 
 3 files changed, 323 insertions(+), 261 deletions(-)

diff --git a/arch/powerpc/boot/dts/acp342x.dts 
b/arch/powerpc/boot/dts/acp342x.dts
index 6e02a8c..28a0a13 100644
--- a/arch/powerpc/boot/dts/acp342x.dts
+++ b/arch/powerpc/boot/dts/acp342x.dts
@@ -1,10 +1,10 @@
 /*
- * Device Tree Source for IBM Embedded PPC 476 Platform
+ * Device Tree Source for LSI Axxia ACP342x.
  *
- * 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 jwbo...@linux.vnet.ibm.com, David Gibson d...@au1.ibm.com
  *
  * This file is licensed under the terms of the GNU General Public
@@ -17,165 +17,187 @@
 /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;
+   #address-cells = 2;
+   #size-cells = 1;
+   model = ibm,acpx1-4xx;
+   compatible = lsi,acp3420, lsi,acp, ibm,acpx1-4xx;
+   dcr-parent = {/cpus/cpu@0};
+
+   aliases {
+   serial0   = UART0;
+   serial1   = UART1;
ethernet0 = FEMAC;
-};
+   rapidio0  = SRIO0;
+   };
 
-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)
-};
-};
+   cpus {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   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; // filled in by U-Boot
+   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 = 0 0 0; // filled in by U-Boot
 };
 
 memory@8000 {
 device_type = memory;
-reg = 0x 0x8000 0x8000; // filled in by 
U-Boot
+reg = 0 0 0; // filled in by U-Boot
 };
 
-MPIC: interrupt-controller {
-compatible = chrp,open-pic;
-interrupt-controller;
-dcr-reg = 0xffc0 0x0003;
-#address-cells = 0;
-#size-cells = 0;
-#interrupt-cells = 

[linux-yocto] [PATCH 12/17] misc: lsi-smmon: Add parameter panic_on_fatal

2014-07-08 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

Added module parameter panic_on_fatal which when set will cause the driver
to call panic() when an uncorrectable ECC error is detected.

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 drivers/misc/lsi-smmon.c |   27 ++-
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/misc/lsi-smmon.c b/drivers/misc/lsi-smmon.c
index d263df9..88f291a 100644
--- a/drivers/misc/lsi-smmon.c
+++ b/drivers/misc/lsi-smmon.c
@@ -24,6 +24,10 @@ static int log = 1;
 module_param(log, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(log, Log each error to kernel log.);
 
+static int panic_on_fatal = 1;
+module_param(panic_on_fatal, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(panic_on_fatal, Panic on fatal error.);
+
 /*
   AXM55xx memory controller interrupt status bits:
 
@@ -96,18 +100,19 @@ static const u32 event_mask[NR_EVENTS] = {
 };
 
 static const struct event_logging {
+   int fatal;
const char *level;
const char *name;
 } event_logging[NR_EVENTS] = {
-   [EV_ILLEGAL] = {KERN_ERR, Illegal access},
-   [EV_MULT_ILLEGAL]= {KERN_ERR, Illegal access},
-   [EV_CORR_ECC]= {KERN_NOTICE, Correctable ECC error},
-   [EV_MULT_CORR_ECC]   = {KERN_NOTICE, Correctable ECC error},
-   [EV_UNCORR_ECC]  = {KERN_CRIT, Uncorrectable ECC error},
-   [EV_MULT_UNCORR_ECC] = {KERN_CRIT, Uncorrectable ECC error},
-   [EV_PORT_ERROR]  = {KERN_CRIT, Port error},
-   [EV_WRAP_ERROR]  = {KERN_CRIT, Wrap error},
-   [EV_PARITY_ERROR]= {KERN_CRIT, Parity error},
+   [EV_ILLEGAL] = {0, KERN_ERR, Illegal access},
+   [EV_MULT_ILLEGAL]= {0, KERN_ERR, Illegal access},
+   [EV_CORR_ECC]= {0, KERN_NOTICE, Correctable ECC error},
+   [EV_MULT_CORR_ECC]   = {0, KERN_NOTICE, Correctable ECC error},
+   [EV_UNCORR_ECC]  = {1, KERN_CRIT, Uncorrectable ECC error},
+   [EV_MULT_UNCORR_ECC] = {1, KERN_CRIT, Uncorrectable ECC error},
+   [EV_PORT_ERROR]  = {0, KERN_CRIT, Port error},
+   [EV_WRAP_ERROR]  = {0, KERN_CRIT, Wrap error},
+   [EV_PARITY_ERROR]= {0, KERN_CRIT, Parity error},
 };
 
 struct smmon_attr {
@@ -181,6 +186,10 @@ static irqreturn_t smmon_isr(int interrupt, void *device)
for (i = 0; i  NR_EVENTS; ++i) {
if ((status  event_mask[i]) != 0) {
++sm-counter[i];
+   if (panic_on_fatal  event_logging[i].fatal)
+   panic(%s (%s)\n,
+ event_logging[i].name,
+ dev_name(sm-pdev-dev));
if (log)
printk_ratelimited(%s%s: %s\n,
   event_logging[i].level,
-- 
1.7.9.5

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


[linux-yocto] [PATCH 15/17] arch/powerpc: Update the Axxia NAND Driver to support 3500

2014-07-08 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

Signed-off-by: John Jacques john.jacq...@lsi.com
---
 drivers/mtd/nand/lsi_acp_nand.c |  171 +--
 1 file changed, 93 insertions(+), 78 deletions(-)

diff --git a/drivers/mtd/nand/lsi_acp_nand.c b/drivers/mtd/nand/lsi_acp_nand.c
index 1cac342..07c521e 100644
--- a/drivers/mtd/nand/lsi_acp_nand.c
+++ b/drivers/mtd/nand/lsi_acp_nand.c
@@ -342,16 +342,11 @@ _WRITEL(const char *file, int line, unsigned long value, 
unsigned long address)
 */
 
 static void *gpreg_base;
-
-#define LSI_NAND_PECC_BUSY_REGISTER (gpreg_base + 0x00c)
-
-#ifdef CONFIG_ACP_X1V1
-#define LSI_NAND_PECC_BUSY_MASK(1  25)
-#else
-#define LSI_NAND_PECC_BUSY_MASK(1  28)
-#endif
+static void *pecc_busy_register;
+static unsigned long pecc_busy_mask;
 
 #define MAX_READ_BUF   16
+
 /*
   --
   MTD structures
@@ -706,8 +701,8 @@ lsi_nand_command(struct mtd_info *mtd, unsigned int command,
   NAND_NCE | NAND_CLE | NAND_CTRL_CHANGE);
do {
udelay(chip-chip_delay);
-   status = READL((void *)LSI_NAND_PECC_BUSY_REGISTER);
-   } while (0 != (status  LSI_NAND_PECC_BUSY_MASK));
+   status = READL(pecc_busy_register);
+   } while (0 != (status  pecc_busy_mask));
 
/* wait until CHIP_BUSY goes low */
do {
@@ -835,9 +830,9 @@ static int lsi_nand_wait(struct mtd_info *mtd, struct 
nand_chip *chip)
 #ifdef NOT_USED
if (FL_READING == chip-state || FL_WRITING == chip-state) {
for (;;) {
-   status = READL((void *)LSI_NAND_PECC_BUSY_REGISTER);
+   status = READL((void *)pecc_busy_register);
 
-   if (0 == (status  LSI_NAND_PECC_BUSY_MASK))
+   if (0 == (status  pecc_busy_mask))
break;
 
udelay(chip-chip_delay);
@@ -845,9 +840,9 @@ static int lsi_nand_wait(struct mtd_info *mtd, struct 
nand_chip *chip)
}
 #else
for (;;) {
-   status = READL((void *)LSI_NAND_PECC_BUSY_REGISTER);
+   status = READL((void *)pecc_busy_register);
 
-   if (0 == (status  LSI_NAND_PECC_BUSY_MASK))
+   if (0 == (status  pecc_busy_mask))
break;
 
udelay(chip-chip_delay);
@@ -3468,15 +3463,17 @@ lsi_nand_init(void)
void *nand_base;
struct device_node *np = NULL;
struct mtd_part_parser_data ppdata;
-   static const char *part_probe_types[]
-   = { cmdlinepart, ofpart, NULL };
-
-   np = of_find_compatible_node(NULL, NULL, lsi,acp3500);
-
-   if (NULL != np) {
-   printk(KERN_ERR NAND Support is Not Yet Available on 3500\n);
-   return -1;
-   }
+   static const char *part_probe_types[] =
+   { cmdlinepart, ofpart, NULL };
+   const u32 *reg;
+   int reglen;
+   u64 nand_address;
+   unsigned long nand_length;
+   u64 gpreg_address;
+   unsigned long gpreg_length;
+   const u32 *enabled;
+   unsigned long cr;
+   unsigned long cr_save;
 
memset(ppdata, 0, sizeof(ppdata));
 
@@ -3485,74 +3482,92 @@ lsi_nand_init(void)
while (np  !of_device_is_compatible(np, acp-nand))
np = of_find_node_by_type(np, nand);
 
-   if (np) {
-   const u32 *reg;
-   int reglen;
-   u64 nand_address;
-   unsigned long nand_length;
-   u64 gpreg_address;
-   unsigned long gpreg_length;
-   const u32 *enabled;
+   if (NULL == np) {
+   printk(KERN_ERR No NAND Nodes in Device Tree\n);
 
-   enabled = of_get_property(np, enabled, NULL);
+   return -1;
+   }
 
-   if (!enabled || (enabled  (0 == *enabled))) {
-   printk(KERN_INFO ACP NAND Controller Isn't 
Enabled.\n);
-   return -ENODEV;
-   }
+   enabled = of_get_property(np, enabled, NULL);
 
-   reg = of_get_property(np, reg, reglen);
-
-   if (reg  (16 == reglen)) {
-   nand_address = of_translate_address(np, reg);
-   nand_length = reg[1];
-   reg += 2;
-   gpreg_address = of_translate_address(np, reg);
-   gpreg_length = reg[1];
-   printk(KERN_INFO nand_address=0x%08llx 
nand_length=0x%lx\n
-  gpreg_address=0x%08llx gpreg_length=0x%lx\n,
-  nand_address, nand_length,
-  gpreg_address, gpreg_length);
-   nand_base = ioremap(nand_address, nand_length);
-   gpreg_base = 

[linux-yocto] [PATCH 17/17] arch/powerpc: Reset Updates for Axxia

2014-07-08 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

Signed-off-by: John Jacques john.jacq...@lsi.com
---
 arch/powerpc/sysdev/ppc4xx_soc.c |   73 +-
 1 file changed, 72 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/sysdev/ppc4xx_soc.c b/arch/powerpc/sysdev/ppc4xx_soc.c
index 0debcc3..5505f46 100644
--- a/arch/powerpc/sysdev/ppc4xx_soc.c
+++ b/arch/powerpc/sysdev/ppc4xx_soc.c
@@ -24,6 +24,9 @@
 #include asm/dcr.h
 #include asm/dcr-regs.h
 #include asm/reg.h
+#ifdef CONFIG_ACP
+#include asm/mpic.h
+#endif
 
 static u32 dcrbase_l2c;
 
@@ -60,7 +63,7 @@ static irqreturn_t l2c_error_handler(int irq, void *dev)
}
 
/* Clear parity errors */
-   if (sr  (L2C_SR_CPE | L2C_SR_TPE)){
+   if (sr  (L2C_SR_CPE | L2C_SR_TPE)) {
mtdcr(dcrbase_l2c + DCRN_L2C0_ADDR, 0);
mtdcr(dcrbase_l2c + DCRN_L2C0_CMD, L2C_CMD_CCP | L2C_CMD_CTE);
} else {
@@ -190,6 +193,45 @@ static int __init ppc4xx_l2c_probe(void)
 }
 arch_initcall(ppc4xx_l2c_probe);
 
+#ifdef CONFIG_ACP
+
+/*
+ * Issue a core reset.
+ */
+
+void
+acp_jump_to_boot_loader(void *input)
+{
+   mpic_teardown_this_cpu(0);
+   /* This is only valid in the core reset case, so 0x1000. */
+   mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | 0x1000);
+
+   while (1)
+   ;   /* Just in case the jump fails. */
+}
+
+/*
+ * Get all other cores to run acp_jump_to_boot_loader() then go
+ * there as well.
+ */
+
+void
+acp_reset_cores(void)
+{
+   int cpu;
+
+   for_each_possible_cpu(cpu) {
+   if (cpu != smp_processor_id())
+   smp_call_function_single(cpu, acp_jump_to_boot_loader,
+NULL, 0);
+   }
+
+   acp_jump_to_boot_loader(NULL);
+}
+
+
+#endif
+
 /*
  * Apply a system reset. Alternatively a board specific value may be
  * provided via the reset-type property in the cpu node.
@@ -214,7 +256,36 @@ void ppc4xx_reset_system(char *cmd)
reset_type = prop[0]  28;
}
 
+#ifdef CONFIG_ACP
+   if (DBCR0_RST_CORE == reset_type) {
+   acp_reset_cores();
+   } else {
+   /*
+ In this case, reset_type is either chip or system.
+
+ On the AXM3500 (PVR=0x7ff520c1), writing to DBCR0
+ will occasionally stall the system.  As a
+ work-around, write to the system control register.
+   */
+
+   u32 pvr_value;
+
+   asm volatile (mfpvr%0 : =r(pvr_value));
+
+   if (0x7ff520c1 == pvr_value) {
+   u32 value;
+
+   value = mfdcrx(0xd0a);
+   value |= 0xab;
+   mtdcrx(0xd0a, value);
+   mtdcrx(0xe00, 1);
+   } else {
+   mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | reset_type);
+   }
+   }
+#else
mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | reset_type);
+#endif
 
while (1)
;   /* Just in case the reset doesn't work */
-- 
1.7.9.5

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


[linux-yocto] [PATCH 4/9] dma: lsi-dma32: Remove debug printks

2014-06-19 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 drivers/dma/lsi-dma32.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/dma/lsi-dma32.c b/drivers/dma/lsi-dma32.c
index a5f3804..a488eec 100644
--- a/drivers/dma/lsi-dma32.c
+++ b/drivers/dma/lsi-dma32.c
@@ -173,7 +173,6 @@ static struct gpdma_desc *get_descriptor(struct 
gpdma_engine *engine)
list_del(desc-vdesc.node);
new = desc;
new-chain = NULL;
-   pr_info( get_desc %p\n, new);
break;
}
}
@@ -243,7 +242,6 @@ static void free_descriptor(struct virt_dma_desc *vd)
 
spin_lock_irqsave(engine-lock, flags);
while (desc) {
-   pr_info(free_desc %p\n, desc);
list_add_tail(desc-vdesc.node, engine-free_list);
desc = desc-chain;
}
-- 
1.7.9.5

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


[linux-yocto] [PATCH 2/9] sysdev LSI_POWERPC: Adding 3500 PCIe inbound mapping support

2014-06-19 Thread Charlie Paul
From: SangeethaRao sangeetha@lsi.com

Signed-off-by: SangeethaRao sangeetha@lsi.com
---
 arch/powerpc/sysdev/lsi_pci.c |   42 ++---
 1 file changed, 35 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/sysdev/lsi_pci.c b/arch/powerpc/sysdev/lsi_pci.c
index e9beadc..2c99507 100644
--- a/arch/powerpc/sysdev/lsi_pci.c
+++ b/arch/powerpc/sysdev/lsi_pci.c
@@ -753,16 +753,44 @@ configure_acp_pciex_PIMs(struct pciex_port *port,
  window.  We use this elsewhere to set up the
  dma_base.
*/
-
-   pci_dram_offset = size;
-   hose-dma_window_base_cur = size;
-
-   out_le32(mbase + PCI_BASE_ADDRESS_0, RES_TO_U32_LOW(size));
-   out_le32(mbase + PCI_BASE_ADDRESS_1, RES_TO_U32_HIGH(size));
+   if (0x10 == port-acpChipType) {
+   /* For 3500, set base address to pci base */
+   pci_dram_offset = res-start;
+   hose-dma_window_base_cur = res-start;
+   } else {
+   pci_dram_offset = size;
+   hose-dma_window_base_cur = size;
+   }
 
if (5 == port-acpChipType) {
-   pr_warn(Setting SIZE for 2500\n);
+   pr_info(Setting SIZE for 2500\n);
out_le32(mbase + 0x11f4, 0xf000UL);
+   out_le32(mbase + PCI_BASE_ADDRESS_0,
+   RES_TO_U32_LOW(size));
+   out_le32(mbase + PCI_BASE_ADDRESS_1,
+   RES_TO_U32_HIGH(size));
+   } else if (0x10 == port-acpChipType) {
+   pr_info(Setting SIZE for 3500\n);
+   out_le32(mbase + 0x11f4, size);
+   /* Verify BAR0 size */
+   {
+   u32 bar0_size;
+   out_le32(mbase + PCI_BASE_ADDRESS_0, ~0);
+   out_le32(mbase + PCI_BASE_ADDRESS_1, ~0);
+   bar0_size = in_le32(mbase + PCI_BASE_ADDRESS_0);
+   if ((bar0_size  ~0xf) != size)
+   pr_err(PCIE%d: Config BAR0 failed\n, 
port-index);
+   bar0_size = in_le32(mbase + PCI_BASE_ADDRESS_1);
+   }
+   /* Set the BASE0 address to start of PCIe base */
+   out_le32(mbase + PCI_BASE_ADDRESS_0, res-start);
+   /* Set the BASE1 address to 0x0 */
+   out_le32(mbase + PCI_BASE_ADDRESS_1, 0x0);
+   } else {
+   out_le32(mbase + PCI_BASE_ADDRESS_0,
+   RES_TO_U32_LOW(size));
+   out_le32(mbase + PCI_BASE_ADDRESS_1,
+   RES_TO_U32_HIGH(size));
}
 
/*
-- 
1.7.9.5

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


[linux-yocto] [PATCH 1/9] dma: lsi-dma32: Add support for sg operation

2014-06-19 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

The driver is extended with implementation of DMA scatterlist operation
(device_prep_dma_sg). This allows for DMA operations to be performed on
non-contiguous ranges of memory.

Due to hardware limitations, each entry in the scatterlist needs to have
identical (physical) address bits [36:32]. The reason behind this is that the
top address bits are not maintained per-descriptor, but held in a per-channel
register and is initialized when a transfer is started (with the address bits
from the first scatterlist entry).

Signed-off-by: Anders Berg anders.b...@lsi.com
---
 drivers/dma/lsi-dma32.c |  235 +++
 drivers/dma/lsi-dma32.h |7 +-
 2 files changed, 181 insertions(+), 61 deletions(-)

diff --git a/drivers/dma/lsi-dma32.c b/drivers/dma/lsi-dma32.c
index 0977ef4..a5f3804 100644
--- a/drivers/dma/lsi-dma32.c
+++ b/drivers/dma/lsi-dma32.c
@@ -145,11 +145,13 @@ static int alloc_desc_table(struct gpdma_engine *engine)
engine_dbg(engine, order=%d pa=%#llx va=%p\n,
   engine-pool.order, engine-pool.phys, engine-pool.va);
 
-   engine-pool.free = NULL;
-   for (i = 0; i  GPDMA_MAX_DESCRIPTORS-1; i++)
-   engine-pool.va[i].chain = engine-pool.va[i+1];
-   engine-pool.va[GPDMA_MAX_DESCRIPTORS-1].chain = NULL;
-   engine-pool.free = engine-pool.va[0];
+   INIT_LIST_HEAD(engine-free_list);
+   for (i = 0; i  GPDMA_MAX_DESCRIPTORS; i++) {
+   struct gpdma_desc *desc = engine-pool.va[i];
+   async_tx_ack(desc-vdesc.tx);
+   desc-engine = engine;
+   list_add_tail(desc-vdesc.node, engine-free_list);
+   }
 
return 0;
 }
@@ -163,18 +165,59 @@ static void free_desc_table(struct gpdma_engine *engine)
 static struct gpdma_desc *get_descriptor(struct gpdma_engine *engine)
 {
unsigned long flags;
-   struct gpdma_desc *desc;
+   struct gpdma_desc *new = NULL, *desc, *tmp;
 
spin_lock_irqsave(engine-lock, flags);
-   desc = engine-pool.free;
-   if (desc) {
-   engine-pool.free = desc-chain;
-   desc-chain = NULL;
-   desc-engine = engine;
+   list_for_each_entry_safe(desc, tmp, engine-free_list, vdesc.node) {
+   if (async_tx_test_ack(desc-vdesc.tx)) {
+   list_del(desc-vdesc.node);
+   new = desc;
+   new-chain = NULL;
+   pr_info( get_desc %p\n, new);
+   break;
+   }
}
spin_unlock_irqrestore(engine-lock, flags);
 
-   return desc;
+   return new;
+}
+
+/**
+ * init_descriptor - Fill out all descriptor fields
+ */
+static void init_descriptor(struct gpdma_desc *desc,
+   dma_addr_t src, u32 src_acc,
+   dma_addr_t dst, u32 dst_acc,
+   size_t len)
+{
+   u32 src_count = len  src_acc;
+   u32 dst_count = len  dst_acc;
+   u32 rot_len = (2 * (1  src_acc)) - 1;
+
+   BUG_ON(src_count * (1src_acc) != len);
+   BUG_ON(dst_count * (1dst_acc) != len);
+
+   desc-src = src;
+   desc-dst = dst;
+
+   desc-hw.src_x_ctr = cpu_to_le16(src_count - 1);
+   desc-hw.src_y_ctr = 0;
+   desc-hw.src_x_mod = cpu_to_le32(1  src_acc);
+   desc-hw.src_y_mod = 0;
+   desc-hw.src_addr  = cpu_to_le32(src  0x);
+   desc-hw.src_data_mask = ~0;
+   desc-hw.src_access= cpu_to_le16((rot_len  6) |
+   (src_acc  3) |
+   (burst  7));
+   desc-hw.dst_access= cpu_to_le16((dst_acc  3) |
+   (burst  7));
+   desc-hw.ch_config = cpu_to_le32(DMA_CONFIG_ONE_SHOT(1));
+   desc-hw.next_ptr  = 0;
+   desc-hw.dst_x_ctr = cpu_to_le16(dst_count - 1);
+   desc-hw.dst_y_ctr = 0;
+   desc-hw.dst_x_mod = cpu_to_le32(1  dst_acc);
+   desc-hw.dst_y_mod = 0;
+   desc-hw.dst_addr  = cpu_to_le32(dst  0x);
 }
 
 static phys_addr_t desc_to_paddr(const struct gpdma_channel *dmac,
@@ -195,16 +238,15 @@ 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;
-   struct gpdma_desc *tail;
 
BUG_ON(desc == NULL);
 
-   for (tail = desc; tail-chain != NULL; tail = tail-chain)
-   ;
-
spin_lock_irqsave(engine-lock, flags);
-   tail-chain = engine-pool.free;
-   engine-pool.free = desc;
+   while (desc) {
+   pr_info(free_desc %p\n, desc);
+   list_add_tail(desc-vdesc.node, engine-free_list);
+   desc = desc-chain;
+   }
spin_unlock_irqrestore(engine-lock, flags);
 }
 
@@ -388,10 +430,8 @@ 

[linux-yocto] [PATCH 6/9] arch/arm: virtio

2014-06-19 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

Signed-off-by: John Jacques john.jacq...@lsi.com
---
 arch/arm/boot/dts/axm5504-sim.dts |6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/axm5504-sim.dts 
b/arch/arm/boot/dts/axm5504-sim.dts
index 7580ae5..7c99c9f 100644
--- a/arch/arm/boot/dts/axm5504-sim.dts
+++ b/arch/arm/boot/dts/axm5504-sim.dts
@@ -42,6 +42,12 @@
};
};
 
+   virtio_block@013 {
+compatible = virtio,mmio;
+reg = 0x20 0x101f 0 0x1;
+interrupts = 0 255 4;
+   };
+
sim {
compatible = arm,amba-bus, simple-bus;
device_type = soc;
-- 
1.7.9.5

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


[linux-yocto] [PATCH 3/9] board/powerpc: Update the Device Tree for 3500

2014-06-19 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

Update the compatibility field and peripherals to support
the 3500.

Signed-off-by: John Jacques john.jacq...@lsi.com
---
 arch/powerpc/boot/dts/acp35xx.dts |   68 +++--
 1 file changed, 19 insertions(+), 49 deletions(-)

diff --git a/arch/powerpc/boot/dts/acp35xx.dts 
b/arch/powerpc/boot/dts/acp35xx.dts
index b03680b..b46b10d 100644
--- a/arch/powerpc/boot/dts/acp35xx.dts
+++ b/arch/powerpc/boot/dts/acp35xx.dts
@@ -20,7 +20,7 @@
#address-cells = 2;
#size-cells = 1;
model = ibm,acpx1-4xx;
-   compatible = lsi,acp3500, lsi,acp, ibm,acpx1-4xx;
+   compatible = lsi,acp3500, lsi,axxia35xx, lsi,acp, ibm,acpx1-4xx;
dcr-parent = {/cpus/cpu@0};
 
aliases {
@@ -64,7 +64,7 @@
dcr-access-method = native;
status = disabled;
enable-method = spin-table;
-   cpu-release-addr = 0 0; // Fixed by the boot loader
+   cpu-release-addr = 0; // filled in by U-Boot
reset-type = 3; // 1=core, 2=chip, 3=system (default)
};
 
@@ -82,7 +82,7 @@
dcr-access-method = native;
status = disabled;
enable-method = spin-table;
-   cpu-release-addr = 0 0; // Fixed by the boot loader
+   cpu-release-addr = 0; // filled in by U-Boot
reset-type = 3; // 1=core, 2=chip, 3=system (default)
};
 
@@ -101,11 +101,11 @@
dcr-access-method = native;
status = disabled;
enable-method = spin-table;
-   cpu-release-addr = 0 0; // Fixed by the boot loader
+   cpu-release-addr = 0; // filled in by U-Boot
reset-type = 3; // 1=core, 2=chip, 3=system (default)
};
 
-   cpu@4 {
+   cpu@4 {
device_type = cpu;
model = PowerPC,4xx; // real CPU changed in sim
reg = 4;
@@ -119,11 +119,11 @@
dcr-access-method = native;
status = disabled;
enable-method = spin-table;
-   cpu-release-addr = 0 0; // Fixed by the boot loader
+   cpu-release-addr = 0; // filled in by U-Boot
reset-type = 3; // 1=core, 2=chip, 3=system (default)
};
 
-   cpu@5 {
+   cpu@5 {
device_type = cpu;
model = PowerPC,4xx; // real CPU changed in sim
reg = 5;
@@ -137,22 +137,19 @@
dcr-access-method = native;
status = disabled;
enable-method = spin-table;
-   cpu-release-addr = 0 0; // Fixed by the boot loader
+   cpu-release-addr = 0; // filled in by U-Boot
reset-type = 3; // 1=core, 2=chip, 3=system (default)
};
-
-
-
};
 
 memory@0 {
 device_type = memory;
-reg = 0x 0x 0x; // filled in by 
U-Boot
+   reg = 0 0 0; // filled in by U-Boot
 };
 
 memory@8000 {
 device_type = memory;
-reg = 0x 0x0800 0x; // filled in by 
U-Boot
+reg = 0 0 0; // filled in by U-Boot
 };
 
MPIC: interrupt-controller {
@@ -189,7 +186,7 @@
enabled = 0;
reg = 0x00424000 0x1000;
clock-reg = 0x00429040 0x20;
-   clock-frequency = 0;
+   clock-frequency = 2;
current-speed = 9600;
interrupt-parent = MPIC;
interrupts = 29;
@@ -202,7 +199,7 @@
enabled = 0;
reg = 0x00425000 0x1000;
clock-reg = 0x00429060 0x20;
-   clock-frequency = 0;
+   clock-frequency = 2;
current-speed = 9600;
interrupt-parent = MPIC;
interrupts = 30;
@@ -211,42 +208,18 @@
USB0: usb0 {
device_type = usb;
compatible = acp-usb;
-   enabled = 1;
-   reg = 0x20 0x004a 0x0 0x0002,
-  0x20 0x0040c000 0x0 0x1000;
+   enabled = 0;
+

[linux-yocto] [PATCH 7/9] arch/arm: Add Virtio Block Support to Axxia Simulation

2014-06-19 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

Signed-off-by: John Jacques john.jacq...@lsi.com
---
 arch/arm/boot/dts/axm5504-sim.dts |   12 ++--
 arch/arm/boot/dts/axm5516-sim.dts |6 ++
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/axm5504-sim.dts 
b/arch/arm/boot/dts/axm5504-sim.dts
index 7c99c9f..bbb922a 100644
--- a/arch/arm/boot/dts/axm5504-sim.dts
+++ b/arch/arm/boot/dts/axm5504-sim.dts
@@ -42,12 +42,6 @@
};
};
 
-   virtio_block@013 {
-compatible = virtio,mmio;
-reg = 0x20 0x101f 0 0x1;
-interrupts = 0 255 4;
-   };
-
sim {
compatible = arm,amba-bus, simple-bus;
device_type = soc;
@@ -56,6 +50,12 @@
interrupt-parent = gic;
ranges;
 
+   virtio_block@013 {
+compatible = virtio,mmio;
+reg = 0x20 0x101f 0 0x1;
+interrupts = 0 223 4;
+   };
+
mmci@020101E {
compatible = arm,pl180, arm,primecell;
reg = 0x20 0x101E 0x00 0x1000;
diff --git a/arch/arm/boot/dts/axm5516-sim.dts 
b/arch/arm/boot/dts/axm5516-sim.dts
index e8cd01a..3ea5f05 100644
--- a/arch/arm/boot/dts/axm5516-sim.dts
+++ b/arch/arm/boot/dts/axm5516-sim.dts
@@ -50,6 +50,12 @@
interrupt-parent = gic;
ranges;
 
+   virtio_block@013 {
+compatible = virtio,mmio;
+reg = 0x20 0x101f 0 0x1;
+interrupts = 0 223 4;
+   };
+
mmci@020101E {
compatible = arm,pl180, arm,primecell;
reg = 0x20 0x101E 0x00 0x1000;
-- 
1.7.9.5

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


[linux-yocto] [PATCH] LSI AXXIA updates to 3.4 standard/axxia/base

2014-06-11 Thread Charlie Paul
This patch fixes typy which causes a build failure

John Jacques (1):
  axxia: Fixed typo in acp.dts file

 arch/powerpc/boot/dts/acp342x.dts |4 ++--
 arch/powerpc/boot/dts/acp35xx.dts |6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

-- 
1.7.9.5

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


[linux-yocto] [PATCH 0/8] LSI AXXIA updates to 3.10 standard/axxia/base

2014-06-04 Thread Charlie Paul
Updates to the  arm and i2c

Anders Berg (5):
  i2c: axxia: Minor cosmetic cleanup
  i2c: axxia: Fall back to polling mode when no IRQ
  misc: lsi-smmon: Bug when probing with IRQ pending
  misc: lsi-smmon: Add parameter panic_on_fatal
  ARM: dts: axxia: Added memory controllers

John Jacques (3):
  arch/arm/mach-axxia: Enable Secondary Cores when in Hyp Mode
  arch/arm/mach-axxia: Remove Unused Device Tree
  arch/arm/mach-axxia: Device Trees for New 5500 Variants

 arch/arm/boot/dts/Makefile |4 +-
 arch/arm/boot/dts/axm5508-amarillo.dts |  221 +++
 arch/arm/boot/dts/axm5512-amarillo.dts |  221 +++
 arch/arm/boot/dts/axm5516-amarillo.dts |8 ++
 arch/arm/boot/dts/axm55xx.dtsi |   14 ++
 arch/arm/boot/dts/axm55xxemu7.dts  |  226 
 arch/arm/mach-axxia/platsmp.c  |   23 ++--
 drivers/i2c/busses/i2c-axxia.c |   94 +++--
 drivers/misc/lsi-smmon.c   |   58 +---
 9 files changed, 568 insertions(+), 301 deletions(-)
 create mode 100644 arch/arm/boot/dts/axm5508-amarillo.dts
 create mode 100644 arch/arm/boot/dts/axm5512-amarillo.dts
 delete mode 100644 arch/arm/boot/dts/axm55xxemu7.dts

-- 
1.7.9.5

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


[linux-yocto] [PATCH 2/8] i2c: axxia: Fall back to polling mode when no IRQ

2014-06-04 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

If the device tree does not specify an interrupt property, the device falls
back to polling the controller status. This is needed to support simulator
models without interrupt capabilities.

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 drivers/i2c/busses/i2c-axxia.c |   82 +++-
 1 file changed, 48 insertions(+), 34 deletions(-)

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index 4721d3c..93f73ec 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -123,6 +123,8 @@ struct axxia_i2c_dev {
size_t msg_xfrd;
/* error code for completed message */
int msg_err;
+   /* IRQ number (or 0 if not using interrupt) */
+   int irq;
/* current i2c bus clock rate */
u32 bus_clk_rate;
 };
@@ -327,15 +329,11 @@ status_str(u32 status)
return buf;
 }
 
-static irqreturn_t
-axxia_i2c_isr(int irq, void *_dev)
+static void
+axxia_i2c_service_irq(struct axxia_i2c_dev *idev)
 {
-   struct axxia_i2c_dev *idev = _dev;
u32 status = readl(idev-regs-mst_int_status);
 
-   /* Clear interrupt */
-   writel(0x01, idev-regs-interrupt_status);
-
/* RX FIFO needs service? */
if (i2c_m_rd(idev-msg)  (status  MST_STATUS_RFL))
axxia_i2c_empty_rx_fifo(idev);
@@ -370,6 +368,23 @@ axxia_i2c_isr(int irq, void *_dev)
readl(idev-regs-mst_tx_xfer));
complete(idev-msg_complete);
}
+}
+
+static irqreturn_t
+axxia_i2c_isr(int irq, void *_dev)
+{
+   struct axxia_i2c_dev *idev = _dev;
+
+   if ((readl(idev-regs-interrupt_status)  0x1) == 0)
+   return IRQ_NONE;
+
+   if (!idev-msg)
+   return IRQ_NONE;
+
+   axxia_i2c_service_irq(idev);
+
+   /* Clear interrupt */
+   writel(0x01, idev-regs-interrupt_status);
 
return IRQ_HANDLED;
 }
@@ -436,14 +451,21 @@ axxia_i2c_xfer_msg(struct axxia_i2c_dev *idev, struct 
i2c_msg *msg)
/* Start manual mode */
writel(0x8, idev-regs-mst_command);
 
-   i2c_int_enable(idev, int_mask);
-
-   ret = wait_for_completion_timeout(idev-msg_complete,
- I2C_XFER_TIMEOUT);
-
-   i2c_int_disable(idev, int_mask);
+   if (idev-irq  0) {
+   i2c_int_enable(idev, int_mask);
+   ret = wait_for_completion_timeout(idev-msg_complete,
+ I2C_XFER_TIMEOUT);
+   i2c_int_disable(idev, int_mask);
+   WARN_ON(readl(idev-regs-mst_command)  0x8);
+   } else {
+   unsigned long tmo = jiffies + I2C_XFER_TIMEOUT;
 
-   WARN_ON(readl(idev-regs-mst_command)  0x8);
+   do {
+   /* Poll interrupt status */
+   axxia_i2c_service_irq(idev);
+   ret = try_wait_for_completion(idev-msg_complete);
+   } while (!ret  time_before(jiffies, tmo));
+   }
 
if (ret == 0) {
dev_warn(idev-dev, xfer timeout (%#x)\n, msg-addr);
@@ -518,7 +540,6 @@ axxia_i2c_probe(struct platform_device *pdev)
struct axxia_i2c_dev *idev = NULL;
struct resource *res;
void __iomem *base;
-   int irq;
int ret = 0;
 
idev = devm_kzalloc(pdev-dev, sizeof(*idev), GFP_KERNEL);
@@ -526,48 +547,41 @@ axxia_i2c_probe(struct platform_device *pdev)
return -ENOMEM;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   dev_err(pdev-dev, can't get device io-resource\n);
-   return -ENOENT;
-   }
-
-   irq = platform_get_irq(pdev, 0);
-   if (irq  0) {
-   dev_err(pdev-dev, can't get irq number\n);
-   return -ENOENT;
-   }
-
base = devm_ioremap_resource(pdev-dev, res);
if (IS_ERR(base))
return PTR_ERR(base);
 
+   idev-irq = platform_get_irq(pdev, 0);
+   if (idev-irq  0)
+   dev_info(pdev-dev, No IRQ specified, using polling mode\n);
+
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-regs = (struct i2c_regs __iomem *) base;
-   idev-dev  = pdev-dev;
+   idev-regs = (struct i2c_regs __iomem *) base;
+   idev-dev = pdev-dev;
init_completion(idev-msg_complete);
 
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 */
 
-   platform_set_drvdata(pdev, idev);
-
ret = axxia_i2c_init(idev);
if (ret) {
dev_err(pdev-dev, Failed to initialize i2c controller);
return ret;
}
 

[linux-yocto] [PATCH 3/8] misc: lsi-smmon: Bug when probing with IRQ pending

2014-06-04 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

We must not call the ncr_write function to unmask interrupts with
the memory controller interrupt enabled, as this could cause the ISR to
be invoked before ncr_write has released the lock used to serialize
register accesses.

To avoid this, temporarily disable the IRQ line while unmasking the
interrupt sources in the controller.

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 drivers/misc/lsi-smmon.c |   31 +--
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/drivers/misc/lsi-smmon.c b/drivers/misc/lsi-smmon.c
index 21d59b0..774430f 100644
--- a/drivers/misc/lsi-smmon.c
+++ b/drivers/misc/lsi-smmon.c
@@ -201,8 +201,8 @@ smmon_probe(struct platform_device *pdev)
 {
struct sm_dev *sm;
struct resource *io;
-   struct resource *irq;
-   u32 mask = SM_INT_MASK;
+   int irq;
+   u32 mask;
int rc = 0;
 
sm = devm_kzalloc(pdev-dev, sizeof(*sm), GFP_KERNEL);
@@ -219,26 +219,37 @@ smmon_probe(struct platform_device *pdev)
}
sm-region = io-start;
 
-   irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-   if (!irq) {
-   rc = -EINVAL;
+   /* Disable all memory controller interrupts */
+   mask = 0x;
+   ncr_write(sm-region, 0x414, 4, mask);
+
+   irq = platform_get_irq(pdev, 0);
+   if (irq  0) {
+   rc = irq;
goto out;
}
 
-   rc = devm_request_irq(pdev-dev, irq-start, smmon_isr,
- IRQF_ONESHOT, dev_name(pdev-dev), pdev);
+   rc = devm_request_irq(pdev-dev, irq, smmon_isr,
+ IRQF_ONESHOT, dev_name(pdev-dev), sm);
if (rc)
goto out;
 
-   /* Enable memory controller interrupts */
-   ncr_write(sm-region, 0x414, 4, mask);
-
rc = sysfs_create_group(pdev-dev.kobj, smmon_attr_group);
if (rc)
goto out;
 
dev_set_drvdata(pdev-dev, sm);
pr_info(%s: Memory controller monitor\n, dev_name(pdev-dev));
+
+   /* Enable memory controller interrupts. We need to disable the
+* interrupt while unmasking it, since otherwise there will be a
+* locking conflict in ncr_write/ncr_read when the ISR tries to read
+* interrupt status.
+*/
+   disable_irq(irq);
+   mask = SM_INT_MASK;
+   ncr_write(sm-region, 0x414, 4, mask);
+   enable_irq(irq);
 out:
return rc;
 }
-- 
1.7.9.5

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


[linux-yocto] [PATCH 5/8] ARM: dts: axxia: Added memory controllers

2014-06-04 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 arch/arm/boot/dts/axm5516-amarillo.dts |8 
 arch/arm/boot/dts/axm55xx.dtsi |   14 ++
 2 files changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/axm5516-amarillo.dts 
b/arch/arm/boot/dts/axm5516-amarillo.dts
index 8d4ea09..c07de15 100644
--- a/arch/arm/boot/dts/axm5516-amarillo.dts
+++ b/arch/arm/boot/dts/axm5516-amarillo.dts
@@ -32,6 +32,14 @@
mdio-clock-period = 0xf0;
 };
 
+sm0 {
+   status = okay;
+};
+
+sm1 {
+   status = okay;
+};
+
 pcie0 {
status = okay;
 };
diff --git a/arch/arm/boot/dts/axm55xx.dtsi b/arch/arm/boot/dts/axm55xx.dtsi
index 6a43139..90eebe3 100644
--- a/arch/arm/boot/dts/axm55xx.dtsi
+++ b/arch/arm/boot/dts/axm55xx.dtsi
@@ -65,6 +65,20 @@
 1 10 0xf08;
};
 
+   sm0: sm0@0022 {
+   compatible = lsi,smmon;
+   reg = 0 0x0022 0 0x1000;
+   interrupts = 0 161 4;
+   status = disabled;
+   };
+
+   sm1: sm1@0022 {
+   compatible = lsi,smmon;
+   reg = 0 0x000f 0 0x1000;
+   interrupts = 0 160 4;
+   status = disabled;
+   };
+
femac: femac@0x201012 {
compatible = lsi,acp-femac;
device_type = network;
-- 
1.7.9.5

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


[linux-yocto] [PATCH 4/8] misc: lsi-smmon: Add parameter panic_on_fatal

2014-06-04 Thread Charlie Paul
From: Anders Berg anders.b...@avagotech.com

Added module parameter panic_on_fatal which when set will cause the driver
to call panic() when an uncorrectable ECC error is detected.

Signed-off-by: Anders Berg anders.b...@avagotech.com
---
 drivers/misc/lsi-smmon.c |   27 ++-
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/misc/lsi-smmon.c b/drivers/misc/lsi-smmon.c
index 774430f..d2ceb31 100644
--- a/drivers/misc/lsi-smmon.c
+++ b/drivers/misc/lsi-smmon.c
@@ -24,6 +24,10 @@ static int log = 1;
 module_param(log, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(log, Log each error to kernel log.);
 
+static int panic_on_fatal = 1;
+module_param(panic_on_fatal, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(panic_on_fatal, Panic on fatal error.);
+
 /*
   AXM55xx memory controller interrupt status bits:
 
@@ -96,18 +100,19 @@ static const u32 event_mask[NR_EVENTS] = {
 };
 
 static const struct event_logging {
+   int fatal;
const char *level;
const char *name;
 } event_logging[NR_EVENTS] = {
-   [EV_ILLEGAL] = {KERN_ERR, Illegal access},
-   [EV_MULT_ILLEGAL]= {KERN_ERR, Illegal access},
-   [EV_CORR_ECC]= {KERN_NOTICE, Correctable ECC error},
-   [EV_MULT_CORR_ECC]   = {KERN_NOTICE, Correctable ECC error},
-   [EV_UNCORR_ECC]  = {KERN_CRIT, Uncorrectable ECC error},
-   [EV_MULT_UNCORR_ECC] = {KERN_CRIT, Uncorrectable ECC error},
-   [EV_PORT_ERROR]  = {KERN_CRIT, Port error},
-   [EV_WRAP_ERROR]  = {KERN_CRIT, Wrap error},
-   [EV_PARITY_ERROR]= {KERN_CRIT, Parity error},
+   [EV_ILLEGAL] = {0, KERN_ERR, Illegal access},
+   [EV_MULT_ILLEGAL]= {0, KERN_ERR, Illegal access},
+   [EV_CORR_ECC]= {0, KERN_NOTICE, Correctable ECC error},
+   [EV_MULT_CORR_ECC]   = {0, KERN_NOTICE, Correctable ECC error},
+   [EV_UNCORR_ECC]  = {1, KERN_CRIT, Uncorrectable ECC error},
+   [EV_MULT_UNCORR_ECC] = {1, KERN_CRIT, Uncorrectable ECC error},
+   [EV_PORT_ERROR]  = {0, KERN_CRIT, Port error},
+   [EV_WRAP_ERROR]  = {0, KERN_CRIT, Wrap error},
+   [EV_PARITY_ERROR]= {0, KERN_CRIT, Parity error},
 };
 
 struct smmon_attr {
@@ -182,6 +187,10 @@ smmon_isr(int interrupt, void *device)
for (i = 0; i  NR_EVENTS; ++i) {
if ((status  event_mask[i]) != 0) {
++sm-counter[i];
+   if (panic_on_fatal  event_logging[i].fatal)
+   panic(%s (%s)\n,
+ event_logging[i].name,
+ dev_name(sm-pdev-dev));
if (log)
printk_ratelimited(%s%s: %s\n,
   event_logging[i].level,
-- 
1.7.9.5

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


[linux-yocto] [PATCH 6/8] arch/arm/mach-axxia: Enable Secondary Cores when in Hyp Mode

2014-06-04 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

The Axxia boot loader leaves secondary cores in reset; Linux is expected
to enable them.  This change makes that happen.

Signed-off-by: John Jacques john.jacq...@lsi.com
---
 arch/arm/mach-axxia/platsmp.c |   23 ---
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-axxia/platsmp.c b/arch/arm/mach-axxia/platsmp.c
index a067de2..54fdcbf 100644
--- a/arch/arm/mach-axxia/platsmp.c
+++ b/arch/arm/mach-axxia/platsmp.c
@@ -40,7 +40,6 @@ __axxia_arch_wfe(void)
 
return;
 }
-
 EXPORT_SYMBOL(__axxia_arch_wfe);
 
 /*
@@ -217,21 +216,15 @@ static void __init axxia_smp_prepare_cpus(unsigned int 
max_cpus)
continue;
 
/*
-* Release all physical cpus when not in hyp mode since we
-* might want to bring them online later.
-*
-* Also we need to get the execution into kernel code (it's
-* currently executing in u-boot).  u-boot releases the cores
-* from reset in hyp mode.
+* Release all physical cpus since we might want to
+* bring them online later.
 */
-   if (!is_hyp_mode_available()) {
-   if (cpu != 0) {
-   u32 phys_cpu = cpu_logical_map(cpu);
-   u32 tmp = readl(syscon + 0x1010);
-   writel(0xab, syscon + 0x1000);
-   tmp = ~(1  phys_cpu);
-   writel(tmp, syscon + 0x1010);
-   }
+   if (cpu != 0) {
+   u32 phys_cpu = cpu_logical_map(cpu);
+   u32 tmp = readl(syscon + 0x1010);
+   writel(0xab, syscon + 0x1000);
+   tmp = ~(1  phys_cpu);
+   writel(tmp, syscon + 0x1010);
}
 
if (cpu_count  max_cpus) {
-- 
1.7.9.5

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


[linux-yocto] [PATCH 8/8] arch/arm/mach-axxia: Device Trees for New 5500 Variants

2014-06-04 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

Add device trees for two new 5500 variants, 5512 and 5508.

Signed-off-by: John Jacques john.jacq...@lsi.com
---
 arch/arm/boot/dts/Makefile |4 +-
 arch/arm/boot/dts/axm5508-amarillo.dts |  221 
 arch/arm/boot/dts/axm5512-amarillo.dts |  221 
 3 files changed, 445 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/axm5508-amarillo.dts
 create mode 100644 arch/arm/boot/dts/axm5512-amarillo.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 5d73aba..1b5fcd7 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -224,7 +224,9 @@ dtb-$(CONFIG_ARCH_AXXIA) += axm5504-sim.dtb \
axm5516-sim.dtb \
axm5504-emu.dtb \
axm5507-emu.dtb \
-   axm5516-amarillo.dtb
+   axm5516-amarillo.dtb \
+   axm5512-amarillo.dtb \
+   axm5508-amarillo.dtb
 dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \
zynq-zc706.dtb
 
diff --git a/arch/arm/boot/dts/axm5508-amarillo.dts 
b/arch/arm/boot/dts/axm5508-amarillo.dts
new file mode 100644
index 000..09e3e42
--- /dev/null
+++ b/arch/arm/boot/dts/axm5508-amarillo.dts
@@ -0,0 +1,221 @@
+/*
+ * arch/arm/boot/dts/axm5516-amarillo.dts
+ *
+ * Copyright (C) 2013 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.
+ */
+
+/dts-v1/;
+
+/memreserve/ 0x 0x0040;
+
+/include/ axm55xx.dtsi
+/include/ axm5508-cpus.dtsi
+
+/ {
+   model = Amarillo AXM5516;
+   compatible = lsi,axm5516-amarillo, lsi,axm5516;
+
+   memory {
+   device_type = memory;
+   reg = 0 0x 0 0x4000;
+   };
+};
+
+femac {
+   status = okay;
+   mdio-clock-offset = 0x1c;
+   mdio-clock-period = 0xf0;
+};
+
+sm0 {
+   status = okay;
+};
+
+sm1 {
+   status = okay;
+};
+
+pcie0 {
+   status = okay;
+};
+
+pcie1 {
+   status = okay;
+};
+
+rio0 {
+   status = okay;
+};
+
+rio1 {
+   status = okay;
+};
+
+usb0 {
+   status = okay;
+};
+
+mtc {
+   status = okay;
+};
+
+serial0 {
+   status = okay;
+};
+
+serial1 {
+   status = okay;
+};
+
+serial2 {
+   status = okay;
+};
+
+serial3 {
+   status = okay;
+};
+
+gpio0 {
+   status = okay;
+};
+
+gpio1 {
+   status = okay;
+};
+
+spics {
+   status = okay;
+};
+
+spi0 {
+   status = okay;
+
+   flash@0 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = s25fl129p1;
+   reg = 0x0;
+   spi-max-frequency = 2500;
+   pl022,com-mode = 0;
+
+   partition@0 {
+   label = spl;
+   reg = 0x0 0x4;
+   };
+   partition@4 {
+   label = parameters0;
+   reg = 0x4 0x1;
+   };
+   partition@5 {
+   label = parameters1;
+   reg = 0x5 0x1;
+   };
+   partition@6 {
+   label = env0;
+   reg = 0x6 0x1;
+   };
+   partition@7 {
+   label = env1;
+   reg = 0x7 0x1;
+   };
+   partition@10 {
+   label = u-boot0;
+   reg = 0x10 0x20;
+   };
+   partition@30 {
+   label = u-boot1;
+   reg = 0x10 0x20;
+   };
+   };
+};
+
+i2c0 {
+   status = okay;
+
+   sysfpga@40 {
+   reg = 0x40;
+   };
+};
+
+i2c1 {
+   status = okay;
+
+   pxa9555@20 {
+   compatible = pca9555;
+   reg = 0x20;
+   };
+
+   adt7467@2e {
+   compatible = adt7473;
+   reg = 0x2e;
+   };
+
+   temp@18 {
+   compatible = jc42;
+   reg = 0x18;
+   };
+
+   temp@1a {
+   compatible = jc42;
+   reg = 0x1a;
+   };
+
+   spd@50 {
+   compatible = spd;
+   reg = 0x50;
+   };
+
+   spd@52 {
+   compatible = spd;
+   reg = 0x52;
+   };
+
+   eeprom@54 {
+   compatible = 24c1024;
+   reg = 0x54;
+   pagesize = 128;
+   };
+};
+
+i2c2 {
+   status = okay;
+
+   pxa9544@70 {
+   compatible = pca9544;
+   reg = 0x70;
+   };
+
+   pxa9544@71 {
+   compatible = pca9544;
+   reg = 0x71;
+   };
+
+   pxa9544@72 {
+   compatible = pca9544;
+  

[linux-yocto] [PATCH 0/4] LSI AXXIA updates to standard/axxia/base 3.10

2014-05-20 Thread Charlie Paul
These patches are updates to the LSI standard/axxia/base for 3.10. 

John Jacques (2):
  arch/arm/mach-axxia: Added the Redundant Parameters inthe Device Tree
  arch/arm/mach-axxia: Move Simulutaion/Emulation WFE/SEV Work-Around

SangeethaRao (2):
  ARM:mach-axxia: Added code to PCIe driver to allocate IO_RESOURCE for
PEI0/PEI1
  LSI nand:  Enables support for 3500 NAND

 arch/arm/boot/dts/axm5516-amarillo.dts |   16 +++---
 arch/arm/mach-axxia/Makefile   |1 -
 arch/arm/mach-axxia/ev.c   |   53 
 arch/arm/mach-axxia/pci.c  |   33 +---
 arch/arm/mach-axxia/platsmp.c  |   20 
 drivers/mtd/nand/lsi_acp_nand.c|   43 ++
 6 files changed, 90 insertions(+), 76 deletions(-)
 delete mode 100644 arch/arm/mach-axxia/ev.c

-- 
1.7.9.5

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


[linux-yocto] [PATCH 00/30] LSI AXXIA updates to 3.4 standard/axxia/base

2014-05-06 Thread Charlie Paul
This is a resubmittal of the second set of patches

Patch 04/28 was not changed, but noted your explanation. 
Patch 05/28 added more information as why the mbox was increased
Patch 07/28 was split into two patches as requested
Patch 10/28 was split into two patches as requested
Patch 17/28 more information added
Patch 24/28 more information added


Anders Berg (4):
  i2c-axxia: Adjust tLOW,tHIGH to match fast-mode requirements
  i2c-axxia: Avoid timeout when interrupt delayed
  i2c-axxia: Fixed i2c device minor numbers
  i2c: axxia: Add support for 10-bit addressing

David Mercado (4):
  LSI FEMAC Ethernet: Updated for upstream submittal
  kernel/irq/manage.c: Fix irq_set_affinity to allow use with buslocks
  LSI AXM55xx: Axxia GIC driver improvements (3rd gen)
  LSI AXM55xx: Fix PMU handler issue

Gary McGee (1):
  LSI AXM55xx arm/axxia: improved robustness for DDR retention

John Jacques (4):
  axxia: Device tree and Target Name/Machine Type Update
  axxia: Fix a Size Warning in the SRIO Section of the Device Trees
  arch/powerpc: Updated the UART Driver to Support 3500
  arch/powerpc: Don't Try to Use NAND on Axxia 3500

Michael Bringmann (13):
  LSI AXM55xx: Validate SRIO link ready status during driver
initialization.
  LSI AXM55xx: Some code optimizations for AXXIA rapidio mport driver.
  LSI AXM55xx: Fixes for mailbox open bounds checks.
  LSI AXM55xx: Improve concurrency protection in AXXIA rapidio calls.
  LSI AXM55xx: Fix concurrency issue for variable
  LSI AXM55xx rapidio: Change the timers for inbound messages
  LSI AXM55xx rapidio: Speed up bottleneck in inbox.
  LSI AXM55x rapidio: removed __devinit from init routines
  LSI AXM55xx/rapidio: Fix NULL pointer reference in
rio_release_inb_mbox.
  LSI AXM55xx: Various bug fixes for rapidio endpoint controller.
  LSI AXM55xx: Configuration updates and bug fixes for rapidio.
  LSI AXM55xx: Disable linkdown reset configuration.
  LSI AXM55xx: Move datastream APIs and symbols to public header file.

SangeethaRao (2):
  LSI sysdev/pci: Removing the power of 2 size restriction
  LSI AXM55xx i2c: Adding support for AXM3500 I2C driver

ningligong (2):
  LSI AXM55xx rapidio? Fixed offset of RAB_OBDSE_XX registers
  LSI AXM55xx: Fixed inbound data streaming ISR handling

 arch/arm/boot/dts/axm55xx.dts |4 +-
 arch/arm/boot/dts/axm55xxemu.dts  |   25 +-
 arch/arm/boot/dts/axm55xxemu7.dts |  217 +
 arch/arm/boot/dts/axm55xxsim.dts  |   26 +-
 arch/arm/boot/dts/axm55xxsim16.dts|   26 +-
 arch/arm/include/asm/axxia-rio.h  |5 +-
 arch/arm/mach-axxia/Makefile  |2 +-
 arch/arm/mach-axxia/axxia-gic.c   | 1160 +
 arch/arm/mach-axxia/axxia.c   |   40 +-
 arch/arm/mach-axxia/ddr_retention.c   |  258 +++---
 arch/arm/mach-axxia/ddr_shutdown.c|  332 +++
 arch/arm/mach-axxia/rapidio.c |   19 +-
 arch/powerpc/boot/dts/acp25xx.dts |   37 +-
 arch/powerpc/boot/dts/acp342x.dts |   37 +-
 arch/powerpc/boot/dts/acp344x.dts |   37 +-
 arch/powerpc/boot/dts/acp35xx.dts |   29 +-
 arch/powerpc/include/asm/axxia-rio.h  |5 +-
 arch/powerpc/sysdev/lsi_pci.c |   16 +-
 drivers/i2c/busses/i2c-axxia.c|  115 ++-
 drivers/mtd/nand/lsi_acp_nand.c   |9 +-
 drivers/net/ethernet/lsi/Kconfig  |   15 -
 drivers/net/ethernet/lsi/lsi_acp_mdio.c   |  201 +++--
 drivers/net/ethernet/lsi/lsi_acp_net.c|  871 +--
 drivers/net/ethernet/lsi/lsi_acp_net.h|  261 --
 drivers/rapidio/devices/lsi/axxia-rio-ds.c|  647 --
 drivers/rapidio/devices/lsi/axxia-rio-ds.h|  326 +--
 drivers/rapidio/devices/lsi/axxia-rio-irq.c   |  289 +++---
 drivers/rapidio/devices/lsi/axxia-rio-irq.h   |   12 +-
 drivers/rapidio/devices/lsi/axxia-rio-sysfs.c |   15 +-
 drivers/rapidio/devices/lsi/axxia-rio.c   |   16 +-
 drivers/rapidio/devices/lsi/axxia-rio.h   |4 +-
 drivers/rapidio/rio.c |   15 +-
 drivers/tty/serial/lsi_acp_serial.c   |   94 +-
 include/linux/rio-axxia.h |  322 +++
 kernel/irq/manage.c   |6 +-
 35 files changed, 3156 insertions(+), 2337 deletions(-)
 create mode 100644 arch/arm/boot/dts/axm55xxemu7.dts
 create mode 100644 arch/arm/mach-axxia/ddr_shutdown.c
 create mode 100644 include/linux/rio-axxia.h

-- 
1.7.9.5

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


[linux-yocto] [PATCH 03/30] LSI AXM55xx rapidio? Fixed offset of RAB_OBDSE_XX registers

2014-05-06 Thread Charlie Paul
From: ningligong ning...@lsi.com

The register base for the RAB was wrong changed from
0x10 to 0xC

Added the IB_VIRT stats SLEEPING and TRAN_PENDING

Signed-off-by: ningligong ning...@lsi.com
---
 drivers/rapidio/devices/lsi/axxia-rio-ds.h |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/rapidio/devices/lsi/axxia-rio-ds.h 
b/drivers/rapidio/devices/lsi/axxia-rio-ds.h
index 5c0d263..25633c0 100755
--- a/drivers/rapidio/devices/lsi/axxia-rio-ds.h
+++ b/drivers/rapidio/devices/lsi/axxia-rio-ds.h
@@ -73,9 +73,9 @@
 #define IB_VSID_M_PREFETCH_ENABLE  (2)
 #define IB_VSID_M_PREFETCH_WAKEUP  (4)
 
-#define RAB_OBDSE_CTRL(n)(RAB_REG_BASE + (0x2d28 + (0x10*(n
-#define RAB_OBDSE_STAT(n)(RAB_REG_BASE + (0x2d28 + (0x10*(n)))+0x4)
-#define RAB_OBDSE_DESC_ADDR(n)   (RAB_REG_BASE + (0x2d28 + (0x10*(n)))+0x8)
+#define RAB_OBDSE_CTRL(n)(RAB_REG_BASE + (0x2d28 + (0xC*(n
+#define RAB_OBDSE_STAT(n)(RAB_REG_BASE + (0x2d28 + (0xC*(n)))+0x4)
+#define RAB_OBDSE_DESC_ADDR(n)   (RAB_REG_BASE + (0x2d28 + (0xC*(n)))+0x8)
 
 #define RAB_IBVIRT_M_STAT(n) (RAB_REG_BASE + (0x2ef0 + (0x4*(n
 
@@ -95,6 +95,8 @@
 
 /* stats */
 #define IB_VIRT_M_STAT_ERROR_MASK   0x3FC
+#define IB_VIRT_M_STAT_SLEEPING(111)
+#define IB_VIRT_M_STAT_TRAN_PENDING(110)
 #define IB_VIRT_M_STAT_PDU_DROPPED (1  9)
 #define IB_VIRT_M_STAT_SEG_LOSS(1  8)
 #define IB_VIRT_M_STAT_MTU_LEN_MIS_ERR (1  7)
@@ -242,6 +244,8 @@ struct ibds_virt_m_cfg {
u32 num_hw_written_bufs;
 
u32 alias_reg_value;
+   u16 virt_vsid;
+   u16 num_data_streams;
 
 };
 
-- 
1.7.9.5

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


[linux-yocto] [PATCH 05/30] LSI AXM55xx: Fixes for mailbox open bounds checks.

2014-05-06 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

The bounds for the input and output mbox were wrong, as
a precaution the range was corrected. The correct range
is 1 - max, not 0 to max.

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 drivers/rapidio/devices/lsi/axxia-rio-irq.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.c 
b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
index 2ffa34b..cb16281 100644
--- a/drivers/rapidio/devices/lsi/axxia-rio-irq.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
@@ -1013,7 +1013,7 @@ static inline int choose_ob_dme(
if (len  sz)
continue;
 
-   if (dme-entries = (dme-entries_in_use+1)) {
+   if (dme-entries  (dme-entries_in_use+1)) {
(*ob_dme) = dme;
(*buf_sz) = sz;
return ret + i;
@@ -1290,7 +1290,7 @@ static int open_outb_mbox(struct rio_mport *mport, void 
*dev_id, int dme_no,
u64 descChainStart, descAddr;
int buf_sz = 0;
 
-   if ((entries = 0) || (entries  priv-desc_max_entries))
+   if ((entries  2) || (entries  priv-desc_max_entries))
return -EINVAL;
 
if (test_bit(RIO_IRQ_ENABLED, h-state))
@@ -1648,7 +1648,7 @@ static int open_inb_mbox(struct rio_mport *mport, void 
*dev_id,
if ((mbox  0) || (mbox = RIO_MAX_RX_MBOX))
return -EINVAL;
 
-   if ((entries = 0) || (entries  priv-desc_max_entries))
+   if ((entries  2) || (entries  priv-desc_max_entries))
return -EINVAL;
 
h = priv-ib_dme_irq[mbox];
-- 
1.7.9.5

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


[linux-yocto] [PATCH 06/30] LSI AXM55xx: Improve concurrency protection in AXXIA rapidio calls.

2014-05-06 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Added a state variable to the interrupt status so the interrupt
for rapidio. This status helps to identify a clearer state
when the interrupt is processed.

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 drivers/rapidio/devices/lsi/axxia-rio-ds.c  |2 ++
 drivers/rapidio/devices/lsi/axxia-rio-irq.c |   48 +--
 drivers/rapidio/devices/lsi/axxia-rio-irq.h |2 ++
 3 files changed, 34 insertions(+), 18 deletions(-)

diff --git a/drivers/rapidio/devices/lsi/axxia-rio-ds.c 
b/drivers/rapidio/devices/lsi/axxia-rio-ds.c
index 4e55ed7..2627b07 100755
--- a/drivers/rapidio/devices/lsi/axxia-rio-ds.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-ds.c
@@ -1819,6 +1819,7 @@ void axxia_rio_ds_port_irq_init(
ptr_ds_priv-ob_dse_irq[i].irq_state_reg_addr =
RAB_INTR_STAT_ODSE;
ptr_ds_priv-ob_dse_irq[i].irq_state_mask = (1  i);
+   ptr_ds_priv-ob_dse_irq[i].irq_state = 0;
ptr_ds_priv-ob_dse_irq[i].thrd_irq_fn = ob_dse_irq_handler;
ptr_ds_priv-ob_dse_irq[i].data = NULL;
ptr_ds_priv-ob_dse_irq[i].release_fn = release_ob_ds;
@@ -1838,6 +1839,7 @@ void axxia_rio_ds_port_irq_init(
ptr_ds_priv-ib_dse_vsid_irq[i].irq_state_reg_addr =
RAB_INTR_STAT_IBSE_VSID_M;
ptr_ds_priv-ib_dse_vsid_irq[i].irq_state_mask = (1  i);
+   ptr_ds_priv-ib_dse_vsid_irq[i].irq_state = 0;
ptr_ds_priv-ib_dse_vsid_irq[i].thrd_irq_fn =
ib_dse_vsid_m_irq_handler;
ptr_ds_priv-ib_dse_vsid_irq[i].data = NULL;
diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.c 
b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
index cb16281..9879b7e 100644
--- a/drivers/rapidio/devices/lsi/axxia-rio-irq.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
@@ -348,19 +348,9 @@ static void reset_state_counters(struct rio_priv *priv)
 static irqreturn_t thrd_irq_handler(int irq, void *data)
 {
struct rio_irq_handler *h = data;
-   struct rio_mport *mport = h-mport;
-   u32 state;
 
atomic_inc(thrd_handler_calls);
 
-   /**
-* Get current interrupt state and clear latched state
-* for interrupts handled by current thread.
-*/
-   __rio_local_read_config_32(mport, h-irq_state_reg_addr, state);
-   state = h-irq_state_mask;
-   __rio_local_write_config_32(mport, h-irq_state_reg_addr, state);
-
 #ifdef CONFIG_SRIO_IRQ_TIME
if (atomic_read(h-start_time))
h-thrd_tb = get_tb();
@@ -370,7 +360,7 @@ static irqreturn_t thrd_irq_handler(int irq, void *data)
 * Invoke handler callback
 */
test_and_set_bit(RIO_IRQ_ACTIVE, h-state);
-   h-thrd_irq_fn(h, state);
+   h-thrd_irq_fn(h, h-irq_state);
clear_bit(RIO_IRQ_ACTIVE, h-state);
 
return IRQ_HANDLED;
@@ -386,18 +376,25 @@ static irqreturn_t hw_irq_handler(int irq, void *data)
 {
struct rio_irq_handler *h = data;
struct rio_mport *mport = h-mport;
-   u32 state;
 
atomic_inc(hw_handler_calls);
 
-   __rio_local_read_config_32(mport, h-irq_state_reg_addr, state);
-   if (state  h-irq_state_mask) {
+   /**
+* Get current interrupt state and clear latched state
+* for interrupts handled by current thread.
+*/
+   __rio_local_read_config_32(mport, h-irq_state_reg_addr, h-irq_state);
+   h-irq_state = h-irq_state_mask;
+   __rio_local_write_config_32(mport, h-irq_state_reg_addr, h-irq_state);
+
+   if (h-irq_state  h-irq_state_mask) {
 #ifdef CONFIG_SRIO_IRQ_TIME
if (atomic_read(h-start_time))
h-irq_tb = get_tb();
 #endif
return IRQ_WAKE_THREAD;
}
+
return IRQ_NONE;
 }
 
@@ -1013,7 +1010,7 @@ static inline int choose_ob_dme(
if (len  sz)
continue;
 
-   if (dme-entries  (dme-entries_in_use+1)) {
+   if (dme-entries = (dme-entries_in_use+1)) {
(*ob_dme) = dme;
(*buf_sz) = sz;
return ret + i;
@@ -1198,10 +1195,10 @@ static void ob_dme_irq_handler(struct rio_irq_handler 
*h, u32 state)
struct rio_mport *mport = h-mport;
struct rio_priv *priv = mport-priv;
struct rio_msg_dme *mbox = h-data;
-   int i;
u32 dme_stat, dw0, dme_no = 31 - CNTLZW(state);
u32 dme_ctrl;
unsigned long flags;
+   int i;
 
/**
 * Clear latched state
@@ -1253,7 +1250,6 @@ static void ob_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
if (mport-outb_msg[dme_no].mcback) {
__ob_dme_event_dbg(priv, dme_no,

[linux-yocto] [PATCH 04/30] LSI AXM55xx: Fixed inbound data streaming ISR handling

2014-05-06 Thread Charlie Paul
From: ningligong ning...@lsi.com

1. Fixed inbound data stream interrupt service routine to properly
   handle packets received by all virtual VSID.
2. Moved checking for vsid_in_use of an inbound DSE, the vsid_in_use
   is only valid when other two bits are set.
Signed-off-by: ningligong ning...@lsi.com
---
 drivers/rapidio/devices/lsi/axxia-rio-ds.c |  226 
 1 file changed, 131 insertions(+), 95 deletions(-)

diff --git a/drivers/rapidio/devices/lsi/axxia-rio-ds.c 
b/drivers/rapidio/devices/lsi/axxia-rio-ds.c
index 02d3751..4e55ed7 100755
--- a/drivers/rapidio/devices/lsi/axxia-rio-ds.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-ds.c
@@ -242,6 +242,7 @@ int axxia_open_ob_data_stream(
 {
struct rio_priv *priv = mport-priv;
int rc = 0;
+   struct rio_priv *priv = mport-priv;
 
axxia_api_lock(priv);
 
@@ -379,7 +380,6 @@ int open_ob_data_stream(
__rio_local_write_config_32(mport, RAB_OBDSE_DESC_ADDR(dse_id),
des_chain_start_addr_phy_low);
 
-
h = (ptr_ds_priv-ob_dse_irq[dse_id]);
 
sprintf(ptr_dse_cfg-name, obds-%d, dse_id);
@@ -451,7 +451,6 @@ int axxia_add_ob_data_stream(
int rc = 0;
 
/* sanity check - TBD */
-
ptr_ds_priv = (priv-ds_priv_data);
 
/*
@@ -693,8 +692,10 @@ void ob_dse_irq_handler(struct rio_irq_handler *h, u32 
state)
ptr_hdr_desc-dw0);
 
/* free the buffer */
-   kfree((void *)ptr_hdr_desc-virt_data_buf);
-   ptr_hdr_desc-buf_status = DS_DBUF_FREED;
+   if (ptr_hdr_desc-buf_status != DS_DBUF_FREED) {
+   kfree((void *)ptr_hdr_desc-virt_data_buf);
+   ptr_hdr_desc-buf_status = DS_DBUF_FREED;
+   }
 
if (ptr_dse_cfg-hdr_read_ptr ==
(ptr_dse_cfg-max_num_hdr_desc - 1)) {
@@ -725,6 +726,7 @@ void ob_dse_irq_handler(struct rio_irq_handler *h, u32 
state)
(dse_stat  0x3F));
 
spin_unlock_irqrestore(ptr_dse_cfg-lock, flags);
+
return;
 }
 
@@ -831,8 +833,8 @@ int axxia_open_ib_data_stream(
int desc_dbuf_size,
int num_entries)
 {
-   struct rio_priv *priv = mport-priv;
int rc = 0;
+   struct rio_priv *priv = mport-priv;
 
axxia_api_lock(priv);
 
@@ -1050,6 +1052,7 @@ int open_ib_data_stream(
ptr_virt_m_cfg-cos = cos;
ptr_virt_m_cfg-source_id = source_id;
ptr_virt_m_cfg-desc_dbuf_size = desc_dbuf_size;
+   ptr_virt_m_cfg-virt_vsid = virt_vsid;
 
desc_chain_start_addr_phy =
virt_to_phys((void *)
@@ -1125,6 +1128,10 @@ int axxia_add_ibds_buffer(
u32 m_id;
u8  found_one = RIO_DS_FALSE;
u32 vsid_addr_reg;
+   u32 vsid;
+   u16 virt_vsid;
+   u32 alias_reg;
+   u32 vsid_m_stats;
 
unsigned long   data_addr_phy;
u32 data_addr_hi;
@@ -1136,11 +1143,20 @@ int axxia_add_ibds_buffer(
 
/* search through the virtual M table to find the one that has
**  the same source_id and cos */
+   /* find the mapping between incoming VSID and internal VSID */
+   __rio_local_read_config_32(mport, RAB_IBDS_VSID_ALIAS, alias_reg);
+
+   /* VSID = {16'b SourceID, 8'bCOS} */
+   vsid = ((source_id  0x)  16) | (cos  0xFF);
+
+   /* calculate the virtual M index */
+   (void)axxio_virt_vsid_convert(vsid, alias_reg, virt_vsid);
+
+
for (m_id = 0; m_id  RIO_MAX_NUM_IBDS_VSID_M; m_id++) {
ptr_virt_m_cfg = (ptr_ds_priv-ibds_vsid_m_cfg[m_id]);
 
-   if ((ptr_virt_m_cfg-source_id == source_id)
-   (ptr_virt_m_cfg-cos == cos)
+   if ((ptr_virt_m_cfg-virt_vsid == virt_vsid)
(ptr_virt_m_cfg-in_use == RIO_DS_TRUE)) {
found_one = RIO_DS_TRUE;
break;
@@ -1207,7 +1223,13 @@ int axxia_add_ibds_buffer(
vsid_addr_reg |= IB_VSID_M_PREFETCH_ENABLE;
 
/* wakeup bit is alway set each time a new buffer is added */
-   vsid_addr_reg |= IB_VSID_M_PREFETCH_WAKEUP;
+   __rio_local_read_config_32(mport,
+   RAB_IBVIRT_M_STAT(m_id),
+   vsid_m_stats);
+
+   if (vsid_m_stats  IB_VIRT_M_STAT_SLEEPING)
+   vsid_addr_reg |= IB_VSID_M_PREFETCH_WAKEUP;
+
__rio_local_write_config_32(mport,
RAB_IBDS_VSID_ADDR_HI(m_id),
vsid_addr_reg);
@@ -1247,96 +1269,93 @@ void ib_dse_vsid_m_irq_handler(struct rio_irq_handler 
*h, u32 state)
u32 dse_stat, vsid_m_stats;
   

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

2014-05-06 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

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 anders.b...@lsi.com
---
 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 519cda7..e58292b 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 08/30] LSI AXM55xx rapidio: Change the timers for inbound messages

2014-05-06 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Used 'atomic' counter to track available inbound messages
between interrupt and foreground code.

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 drivers/rapidio/devices/lsi/axxia-rio-irq.c |   18 --
 drivers/rapidio/devices/lsi/axxia-rio-irq.h |2 +-
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.c 
b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
index 9879b7e..73b5a4c 100644
--- a/drivers/rapidio/devices/lsi/axxia-rio-irq.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
@@ -1115,7 +1115,7 @@ static struct rio_msg_dme *alloc_message_engine(struct 
rio_mport *mport,
me-entries_in_use = 0;
me-write_idx = 0;
me-read_idx = 0;
-   me-pending = 0;
+   atomic_set(me-pending, 0);
me-tx_dme_tmo = 0;
me-dme_no = dme_no;
 
@@ -1474,6 +1474,7 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
u32 dw0;
int dme_no = 31 - CNTLZW(dme_mask);
int num_new;
+   int nPending;
dme_mask ^= (1  dme_no);
 
while (mb-me[letter]-dme_no != dme_no)
@@ -1550,7 +1551,7 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
me-write_idx = (me-write_idx + 1) %
 me-entries;
num_new++;
-   me-pending++;
+   atomic_inc(me-pending);
if (num_new == me-entries)
break;
}
@@ -1564,7 +1565,8 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
__ib_dme_event_dbg(priv, dme_no,
   1  RIO_IB_DME_RX_RING_FULL);
 
-   if (me-pending 
+   nPending = atomic_read(me-pending);
+   if (nPending 
mport-inb_msg[mbox_no].mcback) {
 
mport-inb_msg[mbox_no].mcback(mport,
@@ -2345,6 +2347,7 @@ void *axxia_get_inb_message(struct rio_mport *mport, int 
mbox, int letter,
struct rio_rx_mbox *mb;
struct rio_msg_dme *me;
unsigned long iflags;
+   int nPending;
void *buf = NULL;
 
if ((mbox  0) || (mbox = RIO_MAX_RX_MBOX))
@@ -2371,7 +2374,8 @@ void *axxia_get_inb_message(struct rio_mport *mport, int 
mbox, int letter,
__rio_local_write_config_32(mport, RAB_INTR_ENAB_IDME, intr);
}
 
-   while (me-pending) {
+   nPending = atomic_read(me-pending);
+   while (nPending) {
struct rio_msg_desc *desc = me-desc[me-read_idx];
u32 dw0, dw1;
 
@@ -2399,7 +2403,8 @@ void *axxia_get_inb_message(struct rio_mport *mport, int 
mbox, int letter,
(dw0  0xff) | DME_DESC_DW0_VALID);
}
me-read_idx = (me-read_idx + 1) % me-entries;
-   me-pending--;
+   atomic_dec(me-pending);
+   nPending--;
__ib_dme_event_dbg(priv, me-dme_no,
   1  RIO_IB_DME_DESC_ERR);
} else {
@@ -2447,7 +2452,8 @@ void *axxia_get_inb_message(struct rio_mport *mport, int 
mbox, int letter,
mb-next_rx_slot = (mb-next_rx_slot + 1) %
mb-ring_size;
me-read_idx = (me-read_idx + 1) % me-entries;
-   me-pending--;
+   atomic_dec(me-pending);
+   nPending--;
goto done;
}
}
diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.h 
b/drivers/rapidio/devices/lsi/axxia-rio-irq.h
index fde7140..7ed5fd8 100644
--- a/drivers/rapidio/devices/lsi/axxia-rio-irq.h
+++ b/drivers/rapidio/devices/lsi/axxia-rio-irq.h
@@ -216,7 +216,7 @@ struct rio_msg_dme {
int entries_in_use;
int write_idx;
int read_idx;
-   int pending;
+   atomic_t pending;
int tx_dme_tmo;
void *dev_id;
int dme_no;
-- 
1.7.9.5

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


[linux-yocto] [PATCH 14/30] LSI AXM55xx: Various bug fixes for rapidio endpoint controller.

2014-05-06 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Fix lockup issue processing inbound message descriptor chains.
Revise processing code for inbound/outbound message descriptor
chains to reduce overhead / improve performance.

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 drivers/rapidio/devices/lsi/axxia-rio-irq.c |  108 ---
 drivers/rapidio/devices/lsi/axxia-rio-irq.h |3 +-
 drivers/rapidio/devices/lsi/axxia-rio.c |2 +-
 drivers/rapidio/devices/lsi/axxia-rio.h |1 +
 drivers/rapidio/rio.c   |2 +-
 5 files changed, 85 insertions(+), 31 deletions(-)

diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.c 
b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
index 6a4d227..ae965f9 100644
--- a/drivers/rapidio/devices/lsi/axxia-rio-irq.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
@@ -1115,7 +1115,8 @@ static struct rio_msg_dme *alloc_message_engine(struct 
rio_mport *mport,
me-entries_in_use = 0;
me-write_idx = 0;
me-read_idx = 0;
-   atomic_set(me-pending, 0);
+   me-last_invalid_desc = 0;
+   me-last_compl_idx = 0;
me-tx_dme_tmo = 0;
me-dme_no = dme_no;
 
@@ -1223,6 +1224,9 @@ static void ob_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
for (i = 0; i  mbox-entries; i++) {
struct rio_msg_desc *desc = mbox-desc[i];
 
+   if (mbox-last_compl_idx != desc-desc_no)
+   continue;
+
if (!priv-internalDesc) {
dw0 = *((u32 *)DESC_TABLE_W0_MEM(mbox, desc-desc_no));
} else {
@@ -1243,6 +1247,8 @@ static void ob_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
__ob_dme_dw_dbg(priv, dw0);
 
mbox-entries_in_use--;
+   mbox-last_compl_idx = (mbox-last_compl_idx + 1) %
+   mbox-entries;
 
/**
* UP-call to net device handler
@@ -1532,6 +1538,7 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
if ((dw0  DME_DESC_DW0_READY_MASK) 
(dw0  DME_DESC_DW0_VALID)) {
 
+#ifdef OBSOLETE_BZ47185
/* Some chips clear this bit, some don't.
** Make sure in any event. */
if (!priv-internalDesc) {
@@ -1543,6 +1550,7 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
DESC_TABLE_W0(desc-desc_no),
dw0  ~DME_DESC_DW0_VALID);
}
+#endif /* OBSOLETE_BZ47185 */
 
if (mport-inb_msg[mbox_no].mcback)
mport-inb_msg[mbox_no].mcback(mport,
@@ -1556,7 +1564,6 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
me-write_idx = (me-write_idx + 1) %
 me-entries;
num_new++;
-   atomic_inc(me-pending);
if (num_new == me-entries)
break;
}
@@ -1570,6 +1577,7 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
__ib_dme_event_dbg(priv, dme_no,
   1  RIO_IB_DME_RX_RING_FULL);
 
+#ifdef OBSOLETE_BZ47185
if (dme_stat  IB_DME_STAT_SLEEPING) {
struct rio_msg_desc *desc;
u32 dme_ctrl;
@@ -1610,6 +1618,7 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
 RAB_IB_DME_CTRL(dme_no), dme_ctrl);
}
}
+#endif /* OBSOLETE_BZ47185 */
}
 }
 
@@ -1762,6 +1771,8 @@ static int open_inb_mbox(struct rio_mport *mport, void 
*dev_id,
 */
desc--;
dw0 |= DME_DESC_DW0_NXT_DESC_VALID;
+   dw0 = ~DME_DESC_DW0_VALID;
+   me-last_invalid_desc = desc-desc_no;
if (!priv-internalDesc) {
descChainStart =
(uintptr_t)virt_to_phys(me-descriptors);
@@ -2104,19 +2115,14 @@ void axxia_close_outb_mbox(struct rio_mport *mport, int 
mboxDme)
 static struct rio_msg_desc *get_ob_desc(struct rio_mport *mport,
struct rio_msg_dme *mb)
 {
-   int i, desc_num = mb-write_idx;
+   int desc_num = mb-write_idx;
struct rio_priv *priv = mport-priv;
+   struct rio_msg_desc *desc = mb-desc[desc_num];
+   int nxt_write_idx = (mb-write_idx + 1) % mb-entries;
+   u32 dw0;
 
-   /**
-* HW descriptor 

[linux-yocto] [PATCH 13/30] LSI AXM55xx/rapidio: Fix NULL pointer reference in rio_release_inb_mbox.

2014-05-06 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 drivers/rapidio/rio.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index 0fe82b3..928f1eb 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -343,7 +343,10 @@ int rio_release_inb_mbox(struct rio_mport *mport, int mbox)
mport-ops-close_inb_mbox(mport, mbox);
 
/* Release the mailbox resource */
-   return release_resource(mport-inb_msg[mbox].res);
+   if (mport-outb_msg[mbox].res)
+   return release_resource(mport-inb_msg[mbox].res);
+   else
+   return -ENOMEM;
} else
return -ENOSYS;
 }
-- 
1.7.9.5

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


[linux-yocto] [PATCH 18/30] i2c-axxia: Avoid timeout when interrupt delayed

2014-05-06 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

Changed the order in which the interrupt conditions are checked in the
interrupt handler. Need to check for transfer-complete before timeout-error,
otherwise a delayed interrupt may report a false timeout error (since the
timeout may expire after the transfer was completed).

Signed-off-by: Anders Berg anders.b...@lsi.com
---
 drivers/i2c/busses/i2c-axxia.c |   50 ++--
 1 file changed, 23 insertions(+), 27 deletions(-)

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index e58292b..43b433b 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -334,33 +334,6 @@ axxia_i2c_isr(int irq, void *_dev)
/* Clear interrupt */
writel(0x01, idev-regs-interrupt_status);
 
-   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,
-   status_str(idev-msg_err),
-   readl(idev-regs-mst_rx_bytes_xfrd),
-   readl(idev-regs-mst_rx_xfer),
-   readl(idev-regs-mst_tx_bytes_xfrd),
-   readl(idev-regs-mst_tx_xfer));
-   complete(idev-msg_complete);
-   return IRQ_HANDLED;
-   }
-
-   /* Stop completed? */
-   if (status  MST_STATUS_SCC) {
-   i2c_int_disable(idev, ~0);
-   complete(idev-msg_complete);
-   }
-
-   /* Transfer done? */
-   if (status  (MST_STATUS_SNS | MST_STATUS_SS)) {
-   if (i2c_m_rd(idev-msg)  idev-msg_xfrd  idev-msg-len)
-   axxia_i2c_empty_rx_fifo(idev);
-   i2c_int_disable(idev, ~0);
-   complete(idev-msg_complete);
-   }
-
/* RX FIFO needs service? */
if (i2c_m_rd(idev-msg)  (status  MST_STATUS_RFL))
axxia_i2c_empty_rx_fifo(idev);
@@ -373,6 +346,29 @@ axxia_i2c_isr(int irq, void *_dev)
i2c_int_disable(idev, MST_STATUS_TFL);
}
 
+   if (status  MST_STATUS_SCC) {
+   /* Stop completed? */
+   i2c_int_disable(idev, ~0);
+   complete(idev-msg_complete);
+   } else if (status  (MST_STATUS_SNS | MST_STATUS_SS)) {
+   /* Transfer done? */
+   if (i2c_m_rd(idev-msg)  idev-msg_xfrd  idev-msg-len)
+   axxia_i2c_empty_rx_fifo(idev);
+   i2c_int_disable(idev, ~0);
+   complete(idev-msg_complete);
+   } else if (unlikely(status  MST_STATUS_ERR)) {
+   /* Transfer error? */
+   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,
+   status_str(status),
+   readl(idev-regs-mst_rx_bytes_xfrd),
+   readl(idev-regs-mst_rx_xfer),
+   readl(idev-regs-mst_tx_bytes_xfrd),
+   readl(idev-regs-mst_tx_xfer));
+   complete(idev-msg_complete);
+   }
+
return IRQ_HANDLED;
 }
 
-- 
1.7.9.5

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


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

2014-05-06 Thread Charlie Paul
From: David Mercado david.merc...@windriver.com

Fix irq_set_affinity() to allow usage of buslocks with slow bus
IRQ controllers, such as the LSI Axxia GIC.

Signed-off-by: David Mercado david.merc...@windriver.com
---
 kernel/irq/manage.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index c891fe3..4291484 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -180,16 +180,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;
 }
 
-- 
1.7.9.5

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


[linux-yocto] [PATCH 16/30] LSI AXM55xx: Disable linkdown reset configuration.

2014-05-06 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 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 a26061d..8fd366f 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 12/30] LSI AXM55x rapidio: removed __devinit from init routines

2014-05-06 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Removed __devinit from the initialization routines. There
was no more need to insure that the driver was initializedi
before it is instanciated. The device is registered prior
to initialization.

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 drivers/rapidio/rio.c |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index 3148271..0fe82b3 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -414,7 +414,10 @@ int rio_release_outb_mbox(struct rio_mport *mport, int 
mbox)
mport-ops-close_outb_mbox(mport, mbox);
 
/* Release the mailbox resource */
-   return release_resource(mport-outb_msg[mbox].res);
+   if (mport-outb_msg[mbox].res)
+   return release_resource(mport-outb_msg[mbox].res);
+   else
+   return -ENOMEM;
} else
return -ENOSYS;
 }
@@ -1729,7 +1732,7 @@ static void rio_fixup_device(struct rio_dev *dev)
 {
 }
 
-static int __devinit rio_init(void)
+static int rio_init(void)
 {
struct rio_dev *dev = NULL;
 
@@ -1741,7 +1744,7 @@ static int __devinit rio_init(void)
  * @note No lock; Assuming this is used at boot time only,
  *   before start of user space
  */
-int __devinit rio_init_mports(void)
+int rio_init_mports(void)
 {
struct rio_mport *port;
 
-- 
1.7.9.5

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


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

2014-05-06 Thread Charlie Paul
From: David Mercado david.merc...@windriver.com

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

Signed-off-by: David Mercado david.merc...@windriver.com
---
 arch/arm/mach-axxia/axxia-gic.c | 1109 ---
 1 file changed, 563 insertions(+), 546 deletions(-)

diff --git a/arch/arm/mach-axxia/axxia-gic.c b/arch/arm/mach-axxia/axxia-gic.c
index 8a8e8eb..701d65f 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,24 +33,11 @@
  * registers are banked per-cpu for these sources.
  */
 
-#include linux/init.h
-#include linux/kernel.h
-#include linux/err.h
 #include linux/module.h
-#include linux/list.h
-#include linux/smp.h
-#include linux/cpu_pm.h
-#include linux/cpumask.h
 #include linux/io.h
-#include linux/of.h
 #include linux/of_address.h
-#include linux/of_irq.h
-#include linux/irqdomain.h
-#include linux/interrupt.h
-#include linux/percpu.h
-#include linux/slab.h
+#include linux/cpu_pm.h
 
-#include asm/irq.h
 #include asm/exception.h
 #include asm/smp_plat.h
 #include asm/mach/irq.h
@@ -87,13 +74,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 +94,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 +105,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 +127,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 +197,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, 

[linux-yocto] [PATCH 15/30] LSI AXM55xx: Configuration updates and bug fixes for rapidio.

2014-05-06 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Update the powerpc FDT settings for the latest AXXIA RIO code.
Update the ARM/PowerPC LSI configuration to build AXXIA RIO by default.
Add support to reset the AXXIA RIO controller when a Link Reset Request
symbol is received.

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 arch/powerpc/boot/dts/acp25xx.dts |   35 ++
 arch/powerpc/boot/dts/acp342x.dts |   37 +++---
 arch/powerpc/boot/dts/acp344x.dts |   37 +++---
 arch/powerpc/boot/dts/acp35xx.dts |   27 +++
 drivers/rapidio/devices/lsi/axxia-rio-irq.c   |   64 +++--
 drivers/rapidio/devices/lsi/axxia-rio-irq.h   |1 +
 drivers/rapidio/devices/lsi/axxia-rio-sysfs.c |   15 +++---
 drivers/rapidio/devices/lsi/axxia-rio.c   |2 +-
 8 files changed, 123 insertions(+), 95 deletions(-)

diff --git a/arch/powerpc/boot/dts/acp25xx.dts 
b/arch/powerpc/boot/dts/acp25xx.dts
index 1207631..02f6a28 100644
--- a/arch/powerpc/boot/dts/acp25xx.dts
+++ b/arch/powerpc/boot/dts/acp25xx.dts
@@ -283,27 +283,20 @@
 ;
 };
 
-rio0: rapidio@f002 {
-compatible = lsi,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 0x0 0x4000;
+linkdown-reset = 0x0200 0x100 0x0020 0x0043 0x0 
0x1;
+   interrupt-parent = MPIC;
+interrupts = 30 2;
+outb-dmes = 2 0x0003 1 0x0001;
+   enable_ds = 1;
 };
+
 };
diff --git a/arch/powerpc/boot/dts/acp342x.dts 
b/arch/powerpc/boot/dts/acp342x.dts
index c9c8a35..99d2858 100644
--- a/arch/powerpc/boot/dts/acp342x.dts
+++ b/arch/powerpc/boot/dts/acp342x.dts
@@ -284,27 +284,22 @@
 ;
 };
 
-rio0: rapidio@f002 {
-compatible = lsi,rapidio-delta;
+rio0: rapidio@0x208000 {
+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 0x0042 0x0 0x1000; /* SRIO Conf 0 region */
+ranges = 0x0 0x0 0x0020 0x8000 0x0 0x4000;
+   /*
+linkdown-reset = 0x0200 0x100 0x0020 0x0043 0x0 
0x1;
+   */
+   interrupt-parent = MPIC;
+interrupts = 30 2;
+outb-dmes = 2 0x0003 1 0x0001;
+   enable_ds = 1;
 };
+
 };
diff --git a/arch/powerpc/boot/dts/acp344x.dts 
b/arch/powerpc/boot/dts/acp344x.dts
index 1207631..51fa547 100644
--- a/arch/powerpc/boot/dts/acp344x.dts
+++ b/arch/powerpc/boot/dts/acp344x.dts
@@ -283,27 +283,22 @@
 ;
 };
 
-rio0: rapidio@f002 {
-compatible = lsi,rapidio-delta;
+rio0: rapidio@0x208000 {
+index = 0;
+status = okay;
+#address-cells = 2;
+#size-cells = 2;
+compatible = axxia,rapidio-delta;
 device_type = rapidio;
-enabled = 0;
-   

[linux-yocto] [PATCH 22/30] LSI sysdev/pci: Removing the power of 2 size restriction

2014-05-06 Thread Charlie Paul
From: SangeethaRao sangeetha@lsi.com

This patch removes the power of 2 size restriction
for PCIe inbound mapping in LSI PCIe driver

Signed-off-by: SangeethaRao sangeetha@lsi.com
---
 arch/powerpc/sysdev/lsi_pci.c |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/sysdev/lsi_pci.c b/arch/powerpc/sysdev/lsi_pci.c
index 75bdf53..f485343 100644
--- a/arch/powerpc/sysdev/lsi_pci.c
+++ b/arch/powerpc/sysdev/lsi_pci.c
@@ -114,8 +114,9 @@ static int __init acp_parse_dma_ranges(struct 
pci_controller *hose,
 * within 32 bits space
 */
if (cpu_addr != 0 || pci_addr  0x) {
-   printk(KERN_WARNING %s: Ignored unsupported dma range
-   0x%016llx...0x%016llx - 0x%016llx\n,
+   printk(KERN_WARNING %s: Ignored unsupported \
+   dma range\
+   0x%016llx...0x%016llx - 0x%016llx\n,\
   hose-dn-full_name,
   pci_addr, pci_addr + size - 1, cpu_addr);
continue;
@@ -148,15 +149,14 @@ static int __init acp_parse_dma_ranges(struct 
pci_controller *hose,
 * DMA bounce buffers
 */
if (size  total_memory) {
-   printk(KERN_ERR %s: dma-ranges too small 
-  (size=%llx total_memory=%llx)\n,
+   printk(KERN_ERR %s: dma-ranges too small \
+  (size=%llx total_memory=%llx)\n,\
   hose-dn-full_name, size, (u64)total_memory);
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) {
printk(KERN_ERR %s: dma-ranges unaligned\n,
   hose-dn-full_name);
return -ENXIO;
@@ -288,7 +288,7 @@ static int acp_pciex_validate_bdf(struct pciex_port *port,
/* Check we are within the mapped range */
if (bus-number  port-hose-last_busno) {
if (!message) {
-   printk(KERN_WARNING Warning! Probing bus %u
+   printk(KERN_WARNING Warning! Probing bus %u\
out of range !\n, bus-number);
message++;
}
-- 
1.7.9.5

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


[linux-yocto] [PATCH 29/30] LSI AXM55xx i2c: Adding support for AXM3500 I2C driver

2014-05-06 Thread Charlie Paul
From: SangeethaRao sangeetha@lsi.com

This patch adds i2c support for the 3500 board

Signed-off-by: SangeethaRao sangeetha@lsi.com
---
 drivers/i2c/busses/i2c-axxia.c |   11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index 43b433b..b2cdbba 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -14,7 +14,6 @@
 #include linux/init.h
 #include linux/platform_device.h
 #include linux/clk.h
-#include linux/clkdev.h
 #include linux/err.h
 #include linux/i2c.h
 #include linux/io.h
@@ -501,6 +500,10 @@ axxia_i2c_probe(struct platform_device *pdev)
u32 bus = pdev-id;
int irq = 0;
int ret = 0;
+   int speed_property = 0;
+
+   speed_property = of_find_compatible_node(NULL, NULL,
+   lsi,axxia35xx) != NULL;
 
base = of_iomap(np, 0);
if (!base) {
@@ -537,7 +540,11 @@ axxia_i2c_probe(struct platform_device *pdev)
 
of_property_read_u32(np, bus, bus);
 
-   of_property_read_u32(np, clock-frequency, idev-bus_clk_rate);
+   if (speed_property)
+   of_property_read_u32(np, speed, idev-bus_clk_rate);
+   else
+   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 */
-- 
1.7.9.5

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


[linux-yocto] [PATCH 25/30] i2c-axxia: Fixed i2c device minor numbers

2014-05-06 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

Added missing 'bus' property to the I2C device tree nodes (simulation dts
files). This is needed to get the I2C adapters numbered starting with 0.

Signed-off-by: Anders Berg anders.b...@lsi.com
---
 arch/arm/boot/dts/axm55xxsim.dts   |   24 
 arch/arm/boot/dts/axm55xxsim16.dts |   24 
 2 files changed, 16 insertions(+), 32 deletions(-)

diff --git a/arch/arm/boot/dts/axm55xxsim.dts b/arch/arm/boot/dts/axm55xxsim.dts
index b20b09a..511defa 100644
--- a/arch/arm/boot/dts/axm55xxsim.dts
+++ b/arch/arm/boot/dts/axm55xxsim.dts
@@ -306,45 +306,37 @@
 I2C0: i2c@0x02010084000 {
 compatible = lsi,api2c;
 device_type = i2c;
-enabled = 0;
-port = 0;
-/* bus_name = auto; */
-/* bus = 2; */
 reg = 0x20 0x10084000 0x00 0x1000;
interrupts = 0 19 4;
+bus = 0;
+enabled = 0;
 };
 
 I2C1: i2c@0x02010085000 {
 compatible = lsi,api2c;
 device_type = i2c;
-enabled = 0;
-port = 1;
-/* bus_name = auto; */
-/* bus = 3; */
 reg = 0x20 0x10085000 0x00 0x1000;
interrupts = 0 20 4;
+bus = 1;
+enabled = 0;
 };
 
 I2C2: i2c@0x02010086000 {
 compatible = lsi,api2c;
 device_type = i2c;
-enabled = 0;
-port = 2;
-/* bus_name = auto; */
-/* bus = 4; */
 reg = 0x20 0x10086000 0x00 0x1000;
interrupts = 0 21 4;
+bus = 2;
+enabled = 0;
 };
 
 SMB: i2c@0x02010087000 {
 compatible = lsi,api2c;
 device_type = i2c;
-enabled = 0;
-port = 3;
-bus_name = smb;
-/* bus = 5; */
 reg = 0x20 0x10087000 0x00 0x1000;
interrupts = 0 22 4;
+bus = 3;
+enabled = 0;
 };
 };
 
diff --git a/arch/arm/boot/dts/axm55xxsim16.dts 
b/arch/arm/boot/dts/axm55xxsim16.dts
index 0ce2ff4..1ddba7c 100644
--- a/arch/arm/boot/dts/axm55xxsim16.dts
+++ b/arch/arm/boot/dts/axm55xxsim16.dts
@@ -390,45 +390,37 @@
 I2C0: i2c@0x02010084000 {
 compatible = lsi,api2c;
 device_type = i2c;
-enabled = 0;
-port = 0;
-/* bus_name = auto; */
-/* bus = 2; */
 reg = 0x20 0x10084000 0x00 0x1000;
interrupts = 0 19 4;
+bus = 0;
+enabled = 0;
 };
 
 I2C1: i2c@0x02010085000 {
 compatible = lsi,api2c;
 device_type = i2c;
-enabled = 0;
-port = 1;
-/* bus_name = auto; */
-/* bus = 3; */
 reg = 0x20 0x10085000 0x00 0x1000;
interrupts = 0 20 4;
+bus = 1;
+enabled = 0;
 };
 
 I2C2: i2c@0x02010086000 {
 compatible = lsi,api2c;
 device_type = i2c;
-enabled = 0;
-port = 2;
-/* bus_name = auto; */
-/* bus = 4; */
 reg = 0x20 0x10086000 0x00 0x1000;
interrupts = 0 21 4;
+bus = 2;
+enabled = 0;
 };
 
 SMB: i2c@0x02010087000 {
 compatible = lsi,api2c;
 device_type = i2c;
-enabled = 0;
-port = 3;
-bus_name = smb;
-/* bus = 5; */
 reg = 0x20 0x10087000 0x00 0x1000;
interrupts = 0 22 4;
+bus = 3;
+enabled = 0;
 };
 };
 
-- 
1.7.9.5

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


[linux-yocto] [PATCH 26/30] LSI AXM55xx arm/axxia: improved robustness for DDR retention

2014-05-06 Thread Charlie Paul
From: Gary McGee gary.mc...@lsi.com

- 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 gary.mc...@lsi.com
---
 arch/arm/mach-axxia/Makefile|2 +-
 arch/arm/mach-axxia/ddr_retention.c |  231 
 arch/arm/mach-axxia/ddr_shutdown.c  |  332 +++
 3 files changed, 446 insertions(+), 119 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 47e386b..1352c37d 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_AXXIA_RIO)+= rapidio.o
 obj-$(CONFIG_SMP)  += platsmp.o headsmp.o
diff --git a/arch/arm/mach-axxia/ddr_retention.c 
b/arch/arm/mach-axxia/ddr_retention.c
index 7e4687d..6429151 100644
--- a/arch/arm/mach-axxia/ddr_retention.c
+++ b/arch/arm/mach-axxia/ddr_retention.c
@@ -26,7 +26,9 @@
 #include linux/syscore_ops.h
 #include linux/proc_fs.h
 #include linux/delay.h
+#include linux/prefetch.h
 #include linux/of.h
+
 #include asm/io.h
 #include asm/cacheflush.h
 #include mach/ncr.h
@@ -36,7 +38,13 @@ static void __iomem *apb;
 static void __iomem *dickens;
 static int ddr_retention_enabled;
 
-unsigned long ncp_caal_regions_acp55xx[] = {
+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 */
NCP_REGION_ID(0x0e, 0x05),  /* DPI_HFA */
@@ -54,16 +62,22 @@ unsigned long 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(0x28, 0x05),  /* EIOASM0 */
-   NCP_REGION_ID(0x29, 0x05),  /* EIOASM1 */
-   NCP_REGION_ID(0x2a, 0x05),  /* EIOAS2  */
-   NCP_REGION_ID(0x2b, 0x05),  /* EIOAS3  */
-   NCP_REGION_ID(0x2c, 0x05),  /* EIOAS4  */
-   NCP_REGION_ID(0x2d, 0x05),  /* EIOAS5  */
-   NCP_REGION_ID(0x32, 0x05),  /* ISBS*/
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  */
+   NCP_REGION_ID(0x2b, 0x05), /* EIOAS3  */
+   NCP_REGION_ID(0x2c, 0x05), /* EIOAS4  */
+   NCP_REGION_ID(0x2d, 0x05), /* EIOAS5  */
+   NCP_REGION_ID(0x32, 0x05), /* ISBS*/
+   NCP_REGION_ID(0xff, 0xff)
+};
+
+
 /*
   
--
   flush_l3
@@ -120,23 +134,41 @@ flush_l3(void)
}
 
asm volatile (dsb : : : memory);
-   asm volatile (dmb : : : memory);
 
return;
 }
 
 static void
-quiesce_vp_engine(void)
+quiesce_vp_engine(int engineType)
 {
-   unsigned long   *pCnalRegions = ncp_caal_regions_acp55xx;
+   unsigned long   *pEngineRegions;
unsigned long *pRegion;
+   unsigned longortOff, owtOff;
unsigned ort, owt;
unsigned long  buf = 0;
unsigned short node, target;
int  loop;
 
printk(KERN_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 */
@@ -145,15 +177,15 @@ quiesce_vp_engine(void)
pRegion++;
}
 
-   pRegion = pCnalRegions;
+   pRegion = pEngineRegions;
loop = 0;
 
while (*pRegion != 

[linux-yocto] [PATCH 30/30] i2c: axxia: Add support for 10-bit addressing

2014-05-06 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

Add support for I2c transfers using 10-bit address. The upper layer passes the
flag I2C_M_TEN to inform the driver that the msg-addr field is a 10-bit
address. The Axxia I2C controller will transmit a 10-bit address when the 5
most significant bits in address register 1 equals 5'b0. The least
significant part of the address is then read from address register 2.

Signed-off-by: Anders Berg anders.b...@lsi.com
---
 drivers/i2c/busses/i2c-axxia.c |   32 +++-
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index b2cdbba..db1a2d3 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -251,6 +251,12 @@ i2c_m_rd(const struct i2c_msg *msg)
 }
 
 static int
+i2c_m_ten(const struct i2c_msg *msg)
+{
+   return (msg-flags  I2C_M_TEN) != 0;
+}
+
+static int
 i2c_m_recv_len(const struct i2c_msg *msg)
 {
return (msg-flags  I2C_M_RECV_LEN) != 0;
@@ -376,6 +382,7 @@ static int
 axxia_i2c_xfer_msg(struct axxia_i2c_dev *idev, struct i2c_msg *msg)
 {
u32 int_mask = MST_STATUS_ERR | MST_STATUS_SNS;
+   u32 addr_1, addr_2;
int ret;
 
if (msg-len == 0 || msg-len  255)
@@ -391,17 +398,32 @@ axxia_i2c_xfer_msg(struct axxia_i2c_dev *idev, struct 
i2c_msg *msg)
writel(0, idev-regs-mst_tx_xfer);
/* RX # bytes */
writel(msg-len, idev-regs-mst_rx_xfer);
-   /* Chip address for write */
-   writel(CHIP_READ(msg-addr), idev-regs-mst_addr_1);
} else {
/* TX # bytes */
writel(msg-len, idev-regs-mst_tx_xfer);
/* RX 0 bytes */
writel(0, idev-regs-mst_rx_xfer);
-   /* Chip address for write */
-   writel(CHIP_WRITE(msg-addr), idev-regs-mst_addr_1);
}
-   writel(msg-addr  8, idev-regs-mst_addr_2);
+
+   if (i2c_m_ten(msg)) {
+   /* 10-bit address
+*   addr_1: 5'b0 | addr[9:8] | (R/W)
+*   addr_2: addr[7:0]
+*/
+   addr_1 = 0xF0 | ((msg-addr  7)  0x06);
+   addr_2 = msg-addr  0xFF;
+   } else {
+   /* 7-bit address
+*   addr_1: addr[6:0] | (R/W)
+*   addr_2: dont care
+*/
+   addr_1 = (msg-addr  1)  0xFF;
+   addr_2 = 0;
+   }
+   if (i2c_m_rd(msg))
+   addr_1 |= 1;
+   writel(addr_1, idev-regs-mst_addr_1);
+   writel(addr_2, idev-regs-mst_addr_2);
 
if (i2c_m_rd(msg)) {
int_mask |= MST_STATUS_RFL;
-- 
1.7.9.5

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


[linux-yocto] [PATCH 23/30] axxia: Fix a Size Warning in the SRIO Section of the Device Trees

2014-05-06 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

Signed-off-by: John Jacques john.jacq...@lsi.com
---
 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 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/boot/dts/acp25xx.dts 
b/arch/powerpc/boot/dts/acp25xx.dts
index b5463c5..9893cf9 100644
--- a/arch/powerpc/boot/dts/acp25xx.dts
+++ b/arch/powerpc/boot/dts/acp25xx.dts
@@ -290,7 +290,7 @@
 #size-cells = 2;
 compatible = axxia,rapidio-delta;
 device_type = rapidio;
-reg = 0x0020 0x0056 0x0 0x1000; /* SRIO Conf 0 region */
+reg = 0x0020 0x0056 0x1000; /* SRIO Conf 0 region */
 ranges = 0x0 0x0 0x0021 0x 0x0 0x4000;
/*
 linkdown-reset = 0x0200 0x100 0x0020 0x0043 0x0 
0x1;
diff --git a/arch/powerpc/boot/dts/acp342x.dts 
b/arch/powerpc/boot/dts/acp342x.dts
index 99d2858..6e02a8c 100644
--- a/arch/powerpc/boot/dts/acp342x.dts
+++ b/arch/powerpc/boot/dts/acp342x.dts
@@ -291,7 +291,7 @@
 #size-cells = 2;
 compatible = axxia,rapidio-delta;
 device_type = rapidio;
-reg = 0x0020 0x0042 0x0 0x1000; /* SRIO Conf 0 region */
+reg = 0x0020 0x0042 0x1000; /* SRIO Conf 0 region */
 ranges = 0x0 0x0 0x0020 0x8000 0x0 0x4000;
/*
 linkdown-reset = 0x0200 0x100 0x0020 0x0043 0x0 
0x1;
diff --git a/arch/powerpc/boot/dts/acp344x.dts 
b/arch/powerpc/boot/dts/acp344x.dts
index 51fa547..2c25007 100644
--- a/arch/powerpc/boot/dts/acp344x.dts
+++ b/arch/powerpc/boot/dts/acp344x.dts
@@ -290,7 +290,7 @@
 #size-cells = 2;
 compatible = axxia,rapidio-delta;
 device_type = rapidio;
-reg = 0x0020 0x0042 0x0 0x1000; /* SRIO Conf 0 region */
+reg = 0x0020 0x0042 0x1000; /* SRIO Conf 0 region */
 ranges = 0x0 0x0 0x0020 0x8000 0x0 0x4000;
/*
 linkdown-reset = 0x0200 0x100 0x0020 0x0043 0x0 
0x1;
diff --git a/arch/powerpc/boot/dts/acp35xx.dts 
b/arch/powerpc/boot/dts/acp35xx.dts
index 8fd366f..0bf153f 100644
--- a/arch/powerpc/boot/dts/acp35xx.dts
+++ b/arch/powerpc/boot/dts/acp35xx.dts
@@ -401,7 +401,7 @@
 #size-cells = 2;
 compatible = axxia,rapidio-delta;
 device_type = rapidio;
-reg = 0x0020 0x0056 0x0 0x1000; /* SRIO Conf 0 region */
+reg = 0x0020 0x0056 0x1000; /* SRIO Conf 0 region */
 ranges = 0x0 0x0 0x0021 0x 0x0 0x4000;
/*
 linkdown-reset = 0x0200 0x100 0x0020 0x0040A000 0x0 
0x1;
-- 
1.7.9.5

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


[linux-yocto] [PATCH 01/28] LSI AXM55xx: Validate SRIO link ready status during driver initialization.

2014-05-02 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Check whether the SRIO link ready status is valid for each driver instance.
Fix an issue with scanning/listing the set of network devices found when
multiple SRIO controller master ports are enabled.

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 arch/arm/include/asm/axxia-rio.h|5 -
 arch/arm/mach-axxia/rapidio.c   |   19 +++
 arch/powerpc/include/asm/axxia-rio.h|5 -
 drivers/rapidio/devices/lsi/axxia-rio.c |2 +-
 drivers/rapidio/rio.c   |1 +
 5 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/arch/arm/include/asm/axxia-rio.h b/arch/arm/include/asm/axxia-rio.h
index 492d476..8b7fba2 100644
--- a/arch/arm/include/asm/axxia-rio.h
+++ b/arch/arm/include/asm/axxia-rio.h
@@ -5,6 +5,8 @@
 #ifndef __ASM_AXXIA_RIO_H__
 #define __ASM_AXXIA_RIO_H__
 
+#include linux/platform_device.h
+
 /* Constants, Macros, etc. */
 
 #define AXXIA_RIO_SMALL_SYSTEM
@@ -76,7 +78,8 @@ extern int axxia_rio_apio_disable(struct rio_mport *mport);
 extern int axxia_rio_rpio_enable(struct rio_mport *mport, u32 mask, u32 bits);
 extern int axxia_rio_rpio_disable(struct rio_mport *mport);
 
-extern int axxia_rapidio_board_init(int devNum, int *portNdx);
+extern int axxia_rapidio_board_init(struct platform_device *dev, int devNum,
+   int *portNdx);
 
 
 /*/
diff --git a/arch/arm/mach-axxia/rapidio.c b/arch/arm/mach-axxia/rapidio.c
index 82deeaa..244550f 100644
--- a/arch/arm/mach-axxia/rapidio.c
+++ b/arch/arm/mach-axxia/rapidio.c
@@ -38,6 +38,7 @@
  * axxia_rapidio_board_init -
  *   Perform board-specific initialization to support use of RapidIO busses
  *
+ * @dev: [IN] RIO platform device
  * @ndx: [IN] Which instance of SRIOC driver needs support
  * @portNdx: [OUT] Which port to use for the specified controller
  *
@@ -45,24 +46,34 @@
  */
 int
 axxia_rapidio_board_init(
+   struct platform_device *dev,
int devNum,
int *portNdx)
 {
+   /* Reset the RIO port id to zero for this device */
void __iomem *gpregBase = ioremap(0x2010094000, 0x1000);
-   unsigned long srioCfg = 0;
+   unsigned long reg = 0;
 
if (gpregBase == NULL)
return -EFAULT;
 
-   srioCfg = inl((long unsigned int)(gpregBase + 0x60));
+   reg = inl((long unsigned int)(gpregBase + 0x60));
 
-   srioCfg = ~(0xf  (devNum * 4));
+   reg = ~(0xf  (devNum * 4));
 
-   outl_p(srioCfg, (long unsigned int)(gpregBase + 0x60));
+   outl_p(reg, (long unsigned int)(gpregBase + 0x60));
 
(*portNdx) = 0;
 
iounmap(gpregBase);
 
+   /* Verify that this device is actually enabled */
+   ncr_read(NCP_REGION_ID(0x115, 0), 0x23c, 4, reg);
+   if ((reg  (1  (21+(devNum*4 == 0) {
+   printk(KERN_INFO %s: SRIO%d link not ready\n,
+   dev-dev.of_node-full_name, devNum);
+   return -ENXIO;
+   }
+
return 0;
 }
diff --git a/arch/powerpc/include/asm/axxia-rio.h 
b/arch/powerpc/include/asm/axxia-rio.h
index b461b80..7d7865b 100644
--- a/arch/powerpc/include/asm/axxia-rio.h
+++ b/arch/powerpc/include/asm/axxia-rio.h
@@ -5,6 +5,8 @@
 #ifndef __ASM_AXXIA_RIO_H__
 #define __ASM_AXXIA_RIO_H__
 
+#include linux/platform_device.h
+
 /* Constants, Macros, etc. */
 
 #define AXXIA_RIO_SYSMEM_BARRIER() __asm__ __volatile__(msync)
@@ -72,7 +74,8 @@ extern int axxia_rio_apio_disable(struct rio_mport *mport);
 extern int axxia_rio_rpio_enable(struct rio_mport *mport, u32 mask, u32 bits);
 extern int axxia_rio_rpio_disable(struct rio_mport *mport);
 
-static inline int axxia_rapidio_board_init(int devNum, int *portNdx)
+static inline int axxia_rapidio_board_init(struct platform_device *dev,
+  int devNum, int *portNdx)
 {
(*portNdx) = 0;
return 0;
diff --git a/drivers/rapidio/devices/lsi/axxia-rio.c 
b/drivers/rapidio/devices/lsi/axxia-rio.c
index 5868569..4673b6b 100644
--- a/drivers/rapidio/devices/lsi/axxia-rio.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio.c
@@ -1624,7 +1624,7 @@ static int axxia_rio_setup(struct platform_device *dev)
  irq, linkdown_reset))
return -EFAULT;
 
-   rc = axxia_rapidio_board_init(ndx, portNdx);
+   rc = axxia_rapidio_board_init(dev, ndx, portNdx);
if (rc != 0)
return rc;
 
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index 5312777..3148271 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -1574,6 +1574,7 @@ retry:
}
kfree(nptr);
mport = rio_get_mport(RIO_ANY_ID, mport);
+   key = 0;
}
rdev = NULL;
 done:
-- 
1.7.9.5

-- 
___
linux-yocto mailing list
linux-yo...@yoctoproject.org

[linux-yocto] [PATCH 00/28] LSI AXXIA updates to 3.4 standard/axxia/base

2014-05-02 Thread Charlie Paul
Second set of patches ready for insertion after the previous 
28 patches get upadated.


Anders Berg (4):
  i2c-axxia: Adjust tLOW,tHIGH to match fast-mode requirements
  i2c-axxia: Avoid timeout when interrupt delayed
  i2c-axxia: Fixed i2c device minor numbers
  i2c: axxia: Add support for 10-bit addressing

David Mercado (4):
  LSI FEMAC Ethernet: Updated for upstream submittal
  kernel/irq/manage.c: Fix irq_set_affinity to allow use with buslocks
  LSI AXM55xx: Axxia GIC driver improvements (3rd gen)
  LSI AXM55xx: Fix PMU handler issue

Gary McGee (1):
  LSI AXM55xx: DDR retention fixes

John Jacques (4):
  axxia: Device tree and Target Name/Machine Type Update
  axxia: Fix a Size Warning in the SRIO Section of the Device Trees
  arch/powerpc: Updated the UART Driver to Support 3500
  arch/powerpc: Don't Try to Use NAND on Axxia 3500

Michael Bringmann (11):
  LSI AXM55xx: Validate SRIO link ready status during driver
initialization.
  LSI AXM55xx: Some code optimizations for AXXIA rapidio mport driver.
  LSI AXM55xx: Fixes for mailbox open bounds checks.
  LSI AXM55xx: Improve concurrency protection in AXXIA rapidio calls.
  LSI AXM55xx: Fix concurrency issue for variable.
  LSI AXM55xx: Various performance fixes for rapidio endpoint code.
  LSI AXM55xx/rapidio: Fix NULL pointer reference in
rio_release_inb_mbox.
  LSI AXM55xx: Various bug fixes for rapidio endpoint controller.
  LSI AXM55xx: Configuration updates and bug fixes for rapidio.
  LSI AXM55xx: Disable linkdown reset configuration.
  LSI AXM55xx: Move datastream APIs and symbols to public header file.

SangeethaRao (2):
  LSI sysdev/pci: Removing the power of 2 size restriction
  LSI AXM55xx i2c: Adding support for AXM3500 I2C driver

ningligong (2):
  LSI AXM55xx rapidio? Fixed offset of RAB_OBDSE_XX registers
  LSI AXM55xx: Fixed inbound data streaming ISR handling

 arch/arm/boot/dts/axm55xx.dts |4 +-
 arch/arm/boot/dts/axm55xxemu.dts  |   25 +-
 arch/arm/boot/dts/axm55xxemu7.dts |  217 +
 arch/arm/boot/dts/axm55xxsim.dts  |   26 +-
 arch/arm/boot/dts/axm55xxsim16.dts|   26 +-
 arch/arm/include/asm/axxia-rio.h  |5 +-
 arch/arm/mach-axxia/Makefile  |2 +-
 arch/arm/mach-axxia/axxia-gic.c   | 1160 +
 arch/arm/mach-axxia/axxia.c   |   40 +-
 arch/arm/mach-axxia/ddr_retention.c   |  258 +++---
 arch/arm/mach-axxia/ddr_shutdown.c|  332 +++
 arch/arm/mach-axxia/rapidio.c |   19 +-
 arch/powerpc/boot/dts/acp25xx.dts |   37 +-
 arch/powerpc/boot/dts/acp342x.dts |   37 +-
 arch/powerpc/boot/dts/acp344x.dts |   37 +-
 arch/powerpc/boot/dts/acp35xx.dts |   29 +-
 arch/powerpc/include/asm/axxia-rio.h  |5 +-
 arch/powerpc/sysdev/lsi_pci.c |   16 +-
 drivers/i2c/busses/i2c-axxia.c|  115 ++-
 drivers/mtd/nand/lsi_acp_nand.c   |9 +-
 drivers/net/ethernet/lsi/Kconfig  |   15 -
 drivers/net/ethernet/lsi/lsi_acp_mdio.c   |  201 +++--
 drivers/net/ethernet/lsi/lsi_acp_net.c|  871 +--
 drivers/net/ethernet/lsi/lsi_acp_net.h|  261 --
 drivers/rapidio/devices/lsi/axxia-rio-ds.c|  647 --
 drivers/rapidio/devices/lsi/axxia-rio-ds.h|  326 +--
 drivers/rapidio/devices/lsi/axxia-rio-irq.c   |  289 +++---
 drivers/rapidio/devices/lsi/axxia-rio-irq.h   |   12 +-
 drivers/rapidio/devices/lsi/axxia-rio-sysfs.c |   15 +-
 drivers/rapidio/devices/lsi/axxia-rio.c   |   16 +-
 drivers/rapidio/devices/lsi/axxia-rio.h   |4 +-
 drivers/rapidio/rio.c |   15 +-
 drivers/tty/serial/lsi_acp_serial.c   |   94 +-
 include/linux/rio-axxia.h |  322 +++
 kernel/irq/manage.c   |6 +-
 35 files changed, 3156 insertions(+), 2337 deletions(-)
 create mode 100644 arch/arm/boot/dts/axm55xxemu7.dts
 create mode 100644 arch/arm/mach-axxia/ddr_shutdown.c
 create mode 100644 include/linux/rio-axxia.h

-- 
1.7.9.5

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


[linux-yocto] [PATCH 03/28] LSI AXM55xx rapidio? Fixed offset of RAB_OBDSE_XX registers

2014-05-02 Thread Charlie Paul
From: ningligong ning...@lsi.com

The register base for the RAB was wrong changed from
0x10 to 0xC

Added the IB_VIRT stats SLEEPING and TRAN_PENDING

Signed-off-by: ningligong ning...@lsi.com
---
 drivers/rapidio/devices/lsi/axxia-rio-ds.h |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/rapidio/devices/lsi/axxia-rio-ds.h 
b/drivers/rapidio/devices/lsi/axxia-rio-ds.h
index 5c0d263..25633c0 100755
--- a/drivers/rapidio/devices/lsi/axxia-rio-ds.h
+++ b/drivers/rapidio/devices/lsi/axxia-rio-ds.h
@@ -73,9 +73,9 @@
 #define IB_VSID_M_PREFETCH_ENABLE  (2)
 #define IB_VSID_M_PREFETCH_WAKEUP  (4)
 
-#define RAB_OBDSE_CTRL(n)(RAB_REG_BASE + (0x2d28 + (0x10*(n
-#define RAB_OBDSE_STAT(n)(RAB_REG_BASE + (0x2d28 + (0x10*(n)))+0x4)
-#define RAB_OBDSE_DESC_ADDR(n)   (RAB_REG_BASE + (0x2d28 + (0x10*(n)))+0x8)
+#define RAB_OBDSE_CTRL(n)(RAB_REG_BASE + (0x2d28 + (0xC*(n
+#define RAB_OBDSE_STAT(n)(RAB_REG_BASE + (0x2d28 + (0xC*(n)))+0x4)
+#define RAB_OBDSE_DESC_ADDR(n)   (RAB_REG_BASE + (0x2d28 + (0xC*(n)))+0x8)
 
 #define RAB_IBVIRT_M_STAT(n) (RAB_REG_BASE + (0x2ef0 + (0x4*(n
 
@@ -95,6 +95,8 @@
 
 /* stats */
 #define IB_VIRT_M_STAT_ERROR_MASK   0x3FC
+#define IB_VIRT_M_STAT_SLEEPING(111)
+#define IB_VIRT_M_STAT_TRAN_PENDING(110)
 #define IB_VIRT_M_STAT_PDU_DROPPED (1  9)
 #define IB_VIRT_M_STAT_SEG_LOSS(1  8)
 #define IB_VIRT_M_STAT_MTU_LEN_MIS_ERR (1  7)
@@ -242,6 +244,8 @@ struct ibds_virt_m_cfg {
u32 num_hw_written_bufs;
 
u32 alias_reg_value;
+   u16 virt_vsid;
+   u16 num_data_streams;
 
 };
 
-- 
1.7.9.5

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


[linux-yocto] [PATCH 04/28] LSI AXM55xx: Fixed inbound data streaming ISR handling

2014-05-02 Thread Charlie Paul
From: ningligong ning...@lsi.com

1. Fixed inbound data stream interrupt service routine to properly
   handle packets received by all virtual VSID.
2. Moved checking for vsid_in_use of an inbound DSE, the vsid_in_use
   is only valid when other two bits are set.
Signed-off-by: ningligong ning...@lsi.com
---
 drivers/rapidio/devices/lsi/axxia-rio-ds.c |  226 
 1 file changed, 131 insertions(+), 95 deletions(-)

diff --git a/drivers/rapidio/devices/lsi/axxia-rio-ds.c 
b/drivers/rapidio/devices/lsi/axxia-rio-ds.c
index 02d3751..4e55ed7 100755
--- a/drivers/rapidio/devices/lsi/axxia-rio-ds.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-ds.c
@@ -242,6 +242,7 @@ int axxia_open_ob_data_stream(
 {
struct rio_priv *priv = mport-priv;
int rc = 0;
+   struct rio_priv *priv = mport-priv;
 
axxia_api_lock(priv);
 
@@ -379,7 +380,6 @@ int open_ob_data_stream(
__rio_local_write_config_32(mport, RAB_OBDSE_DESC_ADDR(dse_id),
des_chain_start_addr_phy_low);
 
-
h = (ptr_ds_priv-ob_dse_irq[dse_id]);
 
sprintf(ptr_dse_cfg-name, obds-%d, dse_id);
@@ -451,7 +451,6 @@ int axxia_add_ob_data_stream(
int rc = 0;
 
/* sanity check - TBD */
-
ptr_ds_priv = (priv-ds_priv_data);
 
/*
@@ -693,8 +692,10 @@ void ob_dse_irq_handler(struct rio_irq_handler *h, u32 
state)
ptr_hdr_desc-dw0);
 
/* free the buffer */
-   kfree((void *)ptr_hdr_desc-virt_data_buf);
-   ptr_hdr_desc-buf_status = DS_DBUF_FREED;
+   if (ptr_hdr_desc-buf_status != DS_DBUF_FREED) {
+   kfree((void *)ptr_hdr_desc-virt_data_buf);
+   ptr_hdr_desc-buf_status = DS_DBUF_FREED;
+   }
 
if (ptr_dse_cfg-hdr_read_ptr ==
(ptr_dse_cfg-max_num_hdr_desc - 1)) {
@@ -725,6 +726,7 @@ void ob_dse_irq_handler(struct rio_irq_handler *h, u32 
state)
(dse_stat  0x3F));
 
spin_unlock_irqrestore(ptr_dse_cfg-lock, flags);
+
return;
 }
 
@@ -831,8 +833,8 @@ int axxia_open_ib_data_stream(
int desc_dbuf_size,
int num_entries)
 {
-   struct rio_priv *priv = mport-priv;
int rc = 0;
+   struct rio_priv *priv = mport-priv;
 
axxia_api_lock(priv);
 
@@ -1050,6 +1052,7 @@ int open_ib_data_stream(
ptr_virt_m_cfg-cos = cos;
ptr_virt_m_cfg-source_id = source_id;
ptr_virt_m_cfg-desc_dbuf_size = desc_dbuf_size;
+   ptr_virt_m_cfg-virt_vsid = virt_vsid;
 
desc_chain_start_addr_phy =
virt_to_phys((void *)
@@ -1125,6 +1128,10 @@ int axxia_add_ibds_buffer(
u32 m_id;
u8  found_one = RIO_DS_FALSE;
u32 vsid_addr_reg;
+   u32 vsid;
+   u16 virt_vsid;
+   u32 alias_reg;
+   u32 vsid_m_stats;
 
unsigned long   data_addr_phy;
u32 data_addr_hi;
@@ -1136,11 +1143,20 @@ int axxia_add_ibds_buffer(
 
/* search through the virtual M table to find the one that has
**  the same source_id and cos */
+   /* find the mapping between incoming VSID and internal VSID */
+   __rio_local_read_config_32(mport, RAB_IBDS_VSID_ALIAS, alias_reg);
+
+   /* VSID = {16'b SourceID, 8'bCOS} */
+   vsid = ((source_id  0x)  16) | (cos  0xFF);
+
+   /* calculate the virtual M index */
+   (void)axxio_virt_vsid_convert(vsid, alias_reg, virt_vsid);
+
+
for (m_id = 0; m_id  RIO_MAX_NUM_IBDS_VSID_M; m_id++) {
ptr_virt_m_cfg = (ptr_ds_priv-ibds_vsid_m_cfg[m_id]);
 
-   if ((ptr_virt_m_cfg-source_id == source_id)
-   (ptr_virt_m_cfg-cos == cos)
+   if ((ptr_virt_m_cfg-virt_vsid == virt_vsid)
(ptr_virt_m_cfg-in_use == RIO_DS_TRUE)) {
found_one = RIO_DS_TRUE;
break;
@@ -1207,7 +1223,13 @@ int axxia_add_ibds_buffer(
vsid_addr_reg |= IB_VSID_M_PREFETCH_ENABLE;
 
/* wakeup bit is alway set each time a new buffer is added */
-   vsid_addr_reg |= IB_VSID_M_PREFETCH_WAKEUP;
+   __rio_local_read_config_32(mport,
+   RAB_IBVIRT_M_STAT(m_id),
+   vsid_m_stats);
+
+   if (vsid_m_stats  IB_VIRT_M_STAT_SLEEPING)
+   vsid_addr_reg |= IB_VSID_M_PREFETCH_WAKEUP;
+
__rio_local_write_config_32(mport,
RAB_IBDS_VSID_ADDR_HI(m_id),
vsid_addr_reg);
@@ -1247,96 +1269,93 @@ void ib_dse_vsid_m_irq_handler(struct rio_irq_handler 
*h, u32 state)
u32 dse_stat, vsid_m_stats;
   

[linux-yocto] [PATCH 02/28] LSI AXM55xx: Some code optimizations for AXXIA rapidio mport driver.

2014-05-02 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Correct 'slot' argument to outb msg callback, and remove unnecessary
memory allocations.

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 drivers/rapidio/devices/lsi/axxia-rio-irq.c |   47 +--
 drivers/rapidio/devices/lsi/axxia-rio-irq.h |6 
 2 files changed, 15 insertions(+), 38 deletions(-)

diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.c 
b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
index 91175a0..2ffa34b 100644
--- a/drivers/rapidio/devices/lsi/axxia-rio-irq.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
@@ -919,9 +919,6 @@ static void release_dme(struct kref *kref)
struct rio_msg_desc *desc;
int i;
 
-   if (me-tx_ack != NULL)
-   kfree(me-tx_ack);
-
if (me-desc) {
for (i = 0, desc = me-desc; i  me-entries; i++, desc++) {
if (desc-msg_virt != NULL)
@@ -1116,12 +1113,6 @@ static struct rio_msg_dme *alloc_message_engine(struct 
rio_mport *mport,
entries, GFP_KERNEL);
if (!me-descriptors)
goto err;
-   if (ack_buf) {
-   me-tx_ack = kzalloc(sizeof(struct rio_msg_tx_ack) * entries,
-GFP_KERNEL);
-   if (!me-tx_ack)
-   goto err;
-   }
me-entries = entries;
me-dev_id = dev_id;
me-entries_in_use = 0;
@@ -1207,7 +1198,7 @@ static void ob_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
struct rio_mport *mport = h-mport;
struct rio_priv *priv = mport-priv;
struct rio_msg_dme *mbox = h-data;
-   int i, ack_id = 0;
+   int i;
u32 dme_stat, dw0, dme_no = 31 - CNTLZW(state);
u32 dme_ctrl;
unsigned long flags;
@@ -1244,11 +1235,6 @@ static void ob_dme_irq_handler(struct rio_irq_handler 
*h, u32 state)
 
if ((dw0  DME_DESC_DW0_VALID) 
(dw0  DME_DESC_DW0_READY_MASK)) {
-   struct rio_msg_tx_ack *tx_ack = mbox-tx_ack[ack_id++];
-
-   tx_ack-err_state = DESC_STATE_TO_ERRNO(dw0);
-   tx_ack-cookie = desc-cookie;
-
if (!priv-internalDesc) {
*((u32 *)DESC_TABLE_W0_MEM(mbox, desc-desc_no))
= dw0  DME_DESC_DW0_NXT_DESC_VALID;
@@ -1260,26 +1246,23 @@ static void ob_dme_irq_handler(struct rio_irq_handler 
*h, u32 state)
__ob_dme_dw_dbg(priv, dw0);
 
mbox-entries_in_use--;
-   }
-   }
-   spin_unlock_irqrestore(mbox-lock, flags);
 
-   /**
-* UP-call to net device handler
-*/
-   if (mport-outb_msg[dme_no].mcback) {
-   for (i = 0; i  ack_id; i++) {
-   struct rio_msg_tx_ack *tx_ack = mbox-tx_ack[i];
-
-   __ob_dme_event_dbg(priv, dme_no,
-  1  RIO_OB_DME_TX_DESC_READY);
-   mport-outb_msg[dme_no].mcback(mport,
-  mbox-dev_id,
-  dme_no,
-  tx_ack-err_state,
-  tx_ack-cookie);
+   /**
+   * UP-call to net device handler
+   */
+   if (mport-outb_msg[dme_no].mcback) {
+   __ob_dme_event_dbg(priv, dme_no,
+   1  RIO_OB_DME_TX_DESC_READY);
+
+   mport-outb_msg[dme_no].mcback(mport,
+   mbox-dev_id,
+   dme_no,
+   i,
+   desc-cookie);
+   }
}
}
+   spin_unlock_irqrestore(mbox-lock, flags);
 }
 
 /**
diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.h 
b/drivers/rapidio/devices/lsi/axxia-rio-irq.h
index b456541..d98ebfd 100644
--- a/drivers/rapidio/devices/lsi/axxia-rio-irq.h
+++ b/drivers/rapidio/devices/lsi/axxia-rio-irq.h
@@ -205,11 +205,6 @@ struct rio_msg_desc {
void *cookie;
 };
 
-struct rio_msg_tx_ack {
-   int err_state;
-   void *cookie;
-};
-
 struct rio_msg_dme {
spinlock_t lock;
char name[16];
@@ -227,7 +222,6 @@ struct rio_msg_dme {
int dme_no;
struct rio_msg_desc *desc;
struct rio_desc *descriptors;
-   struct rio_msg_tx_ack *tx_ack;
 #ifdef CONFIG_SRIO_IRQ_TIME
u64 start_irq_tb;
u64 start_thrd_tb;
-- 
1.7.9.5

-- 
___
linux-yocto mailing list

[linux-yocto] [PATCH 06/28] LSI AXM55xx: Improve concurrency protection in AXXIA rapidio calls.

2014-05-02 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Added a state variable to the interrupt status so the interrupt
for rapidio. This status helps to identify a clearer state
when the interrupt is processed.

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 drivers/rapidio/devices/lsi/axxia-rio-ds.c  |2 ++
 drivers/rapidio/devices/lsi/axxia-rio-irq.c |   48 +--
 drivers/rapidio/devices/lsi/axxia-rio-irq.h |2 ++
 3 files changed, 34 insertions(+), 18 deletions(-)

diff --git a/drivers/rapidio/devices/lsi/axxia-rio-ds.c 
b/drivers/rapidio/devices/lsi/axxia-rio-ds.c
index 4e55ed7..2627b07 100755
--- a/drivers/rapidio/devices/lsi/axxia-rio-ds.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-ds.c
@@ -1819,6 +1819,7 @@ void axxia_rio_ds_port_irq_init(
ptr_ds_priv-ob_dse_irq[i].irq_state_reg_addr =
RAB_INTR_STAT_ODSE;
ptr_ds_priv-ob_dse_irq[i].irq_state_mask = (1  i);
+   ptr_ds_priv-ob_dse_irq[i].irq_state = 0;
ptr_ds_priv-ob_dse_irq[i].thrd_irq_fn = ob_dse_irq_handler;
ptr_ds_priv-ob_dse_irq[i].data = NULL;
ptr_ds_priv-ob_dse_irq[i].release_fn = release_ob_ds;
@@ -1838,6 +1839,7 @@ void axxia_rio_ds_port_irq_init(
ptr_ds_priv-ib_dse_vsid_irq[i].irq_state_reg_addr =
RAB_INTR_STAT_IBSE_VSID_M;
ptr_ds_priv-ib_dse_vsid_irq[i].irq_state_mask = (1  i);
+   ptr_ds_priv-ib_dse_vsid_irq[i].irq_state = 0;
ptr_ds_priv-ib_dse_vsid_irq[i].thrd_irq_fn =
ib_dse_vsid_m_irq_handler;
ptr_ds_priv-ib_dse_vsid_irq[i].data = NULL;
diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.c 
b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
index cb16281..9879b7e 100644
--- a/drivers/rapidio/devices/lsi/axxia-rio-irq.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
@@ -348,19 +348,9 @@ static void reset_state_counters(struct rio_priv *priv)
 static irqreturn_t thrd_irq_handler(int irq, void *data)
 {
struct rio_irq_handler *h = data;
-   struct rio_mport *mport = h-mport;
-   u32 state;
 
atomic_inc(thrd_handler_calls);
 
-   /**
-* Get current interrupt state and clear latched state
-* for interrupts handled by current thread.
-*/
-   __rio_local_read_config_32(mport, h-irq_state_reg_addr, state);
-   state = h-irq_state_mask;
-   __rio_local_write_config_32(mport, h-irq_state_reg_addr, state);
-
 #ifdef CONFIG_SRIO_IRQ_TIME
if (atomic_read(h-start_time))
h-thrd_tb = get_tb();
@@ -370,7 +360,7 @@ static irqreturn_t thrd_irq_handler(int irq, void *data)
 * Invoke handler callback
 */
test_and_set_bit(RIO_IRQ_ACTIVE, h-state);
-   h-thrd_irq_fn(h, state);
+   h-thrd_irq_fn(h, h-irq_state);
clear_bit(RIO_IRQ_ACTIVE, h-state);
 
return IRQ_HANDLED;
@@ -386,18 +376,25 @@ static irqreturn_t hw_irq_handler(int irq, void *data)
 {
struct rio_irq_handler *h = data;
struct rio_mport *mport = h-mport;
-   u32 state;
 
atomic_inc(hw_handler_calls);
 
-   __rio_local_read_config_32(mport, h-irq_state_reg_addr, state);
-   if (state  h-irq_state_mask) {
+   /**
+* Get current interrupt state and clear latched state
+* for interrupts handled by current thread.
+*/
+   __rio_local_read_config_32(mport, h-irq_state_reg_addr, h-irq_state);
+   h-irq_state = h-irq_state_mask;
+   __rio_local_write_config_32(mport, h-irq_state_reg_addr, h-irq_state);
+
+   if (h-irq_state  h-irq_state_mask) {
 #ifdef CONFIG_SRIO_IRQ_TIME
if (atomic_read(h-start_time))
h-irq_tb = get_tb();
 #endif
return IRQ_WAKE_THREAD;
}
+
return IRQ_NONE;
 }
 
@@ -1013,7 +1010,7 @@ static inline int choose_ob_dme(
if (len  sz)
continue;
 
-   if (dme-entries  (dme-entries_in_use+1)) {
+   if (dme-entries = (dme-entries_in_use+1)) {
(*ob_dme) = dme;
(*buf_sz) = sz;
return ret + i;
@@ -1198,10 +1195,10 @@ static void ob_dme_irq_handler(struct rio_irq_handler 
*h, u32 state)
struct rio_mport *mport = h-mport;
struct rio_priv *priv = mport-priv;
struct rio_msg_dme *mbox = h-data;
-   int i;
u32 dme_stat, dw0, dme_no = 31 - CNTLZW(state);
u32 dme_ctrl;
unsigned long flags;
+   int i;
 
/**
 * Clear latched state
@@ -1253,7 +1250,6 @@ static void ob_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
if (mport-outb_msg[dme_no].mcback) {
__ob_dme_event_dbg(priv, dme_no,

[linux-yocto] [PATCH 05/28] LSI AXM55xx: Fixes for mailbox open bounds checks.

2014-05-02 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 drivers/rapidio/devices/lsi/axxia-rio-irq.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.c 
b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
index 2ffa34b..cb16281 100644
--- a/drivers/rapidio/devices/lsi/axxia-rio-irq.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
@@ -1013,7 +1013,7 @@ static inline int choose_ob_dme(
if (len  sz)
continue;
 
-   if (dme-entries = (dme-entries_in_use+1)) {
+   if (dme-entries  (dme-entries_in_use+1)) {
(*ob_dme) = dme;
(*buf_sz) = sz;
return ret + i;
@@ -1290,7 +1290,7 @@ static int open_outb_mbox(struct rio_mport *mport, void 
*dev_id, int dme_no,
u64 descChainStart, descAddr;
int buf_sz = 0;
 
-   if ((entries = 0) || (entries  priv-desc_max_entries))
+   if ((entries  2) || (entries  priv-desc_max_entries))
return -EINVAL;
 
if (test_bit(RIO_IRQ_ENABLED, h-state))
@@ -1648,7 +1648,7 @@ static int open_inb_mbox(struct rio_mport *mport, void 
*dev_id,
if ((mbox  0) || (mbox = RIO_MAX_RX_MBOX))
return -EINVAL;
 
-   if ((entries = 0) || (entries  priv-desc_max_entries))
+   if ((entries  2) || (entries  priv-desc_max_entries))
return -EINVAL;
 
h = priv-ib_dme_irq[mbox];
-- 
1.7.9.5

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


[linux-yocto] [PATCH 08/28] axxia: Device tree and Target Name/Machine Type Update

2014-05-02 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

In some cases, the differences between simulation, emulation,
and hardware are important. This patch updates the device trees
to indicate the correct name and the arch/arm/mach-axxia code
to use it.

Signed-off-by: John Jacques john.jacq...@lsi.com
---
 arch/arm/boot/dts/axm55xxemu.dts|   25 +---
 arch/arm/boot/dts/axm55xxemu7.dts   |  217 +++
 arch/arm/boot/dts/axm55xxsim.dts|2 +-
 arch/arm/boot/dts/axm55xxsim16.dts  |2 +-
 arch/arm/mach-axxia/axxia.c |3 +-
 arch/arm/mach-axxia/ddr_retention.c |   33 --
 6 files changed, 247 insertions(+), 35 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 1b22b33..93222c1 100644
--- a/arch/arm/boot/dts/axm55xxemu.dts
+++ b/arch/arm/boot/dts/axm55xxemu.dts
@@ -24,7 +24,7 @@
 
 / {
model = AXM5516;
-   compatible = arm, lsi,axm5516;
+   compatible = arm, lsi,axm5516-emu;
interrupt-parent = gic;
#address-cells = 2;
#size-cells = 2;
@@ -68,29 +68,6 @@
reg = 3;
 cpu-release-addr = 0; // Fixed by the boot loader
};
-
-   /*
-   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 {
diff --git a/arch/arm/boot/dts/axm55xxemu7.dts 
b/arch/arm/boot/dts/axm55xxemu7.dts
new file mode 100644
index 000..6da4393
--- /dev/null
+++ b/arch/arm/boot/dts/axm55xxemu7.dts
@@ -0,0 +1,217 @@
+/*
+ * 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;
+   timer = axxia_timers;
+   ethernet0 = axxia_femac0;
+   };
+
+   cpus {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   cpu@0 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 0;
+cpu-release-addr = 0; // Fixed by the boot loader
+   };
+
+   cpu@1 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 1;
+cpu-release-addr = 0; // Fixed by the boot loader
+   };
+
+   cpu@2 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 2;
+cpu-release-addr = 0; // Fixed by the boot loader
+   };
+
+   cpu@3 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 3;
+cpu-release-addr = 0; // Fixed by the boot loader
+   };
+
+   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;
+  

[linux-yocto] [PATCH 07/28] LSI AXM55xx: Fix concurrency issue for variable.

2014-05-02 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Used 'atomic' counter to track available inbound messages between
interrupt and foreground code.
Also, enable both SRIO modules by default with check for SRIO link
ready status to validated the accesses.

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 arch/arm/boot/dts/axm55xx.dts   |4 ++--
 drivers/rapidio/devices/lsi/axxia-rio-irq.c |   18 --
 drivers/rapidio/devices/lsi/axxia-rio-irq.h |2 +-
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/arch/arm/boot/dts/axm55xx.dts b/arch/arm/boot/dts/axm55xx.dts
index 1cba111..826a6e6 100644
--- a/arch/arm/boot/dts/axm55xx.dts
+++ b/arch/arm/boot/dts/axm55xx.dts
@@ -439,7 +439,7 @@
 
 rio0: rapidio@0x31 {
 index = 0;
-status = disabled;
+status = okay;
 #address-cells = 2;
 #size-cells = 2;
 compatible = axxia,rapidio-delta;
@@ -454,7 +454,7 @@
 
 rio1: rapidio@0x314000 {
 index = 1;
-status = disabled;
+status = okay;
 #address-cells = 2;
 #size-cells = 2;
 compatible = axxia,rapidio-delta;
diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.c 
b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
index 9879b7e..73b5a4c 100644
--- a/drivers/rapidio/devices/lsi/axxia-rio-irq.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
@@ -1115,7 +1115,7 @@ static struct rio_msg_dme *alloc_message_engine(struct 
rio_mport *mport,
me-entries_in_use = 0;
me-write_idx = 0;
me-read_idx = 0;
-   me-pending = 0;
+   atomic_set(me-pending, 0);
me-tx_dme_tmo = 0;
me-dme_no = dme_no;
 
@@ -1474,6 +1474,7 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
u32 dw0;
int dme_no = 31 - CNTLZW(dme_mask);
int num_new;
+   int nPending;
dme_mask ^= (1  dme_no);
 
while (mb-me[letter]-dme_no != dme_no)
@@ -1550,7 +1551,7 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
me-write_idx = (me-write_idx + 1) %
 me-entries;
num_new++;
-   me-pending++;
+   atomic_inc(me-pending);
if (num_new == me-entries)
break;
}
@@ -1564,7 +1565,8 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
__ib_dme_event_dbg(priv, dme_no,
   1  RIO_IB_DME_RX_RING_FULL);
 
-   if (me-pending 
+   nPending = atomic_read(me-pending);
+   if (nPending 
mport-inb_msg[mbox_no].mcback) {
 
mport-inb_msg[mbox_no].mcback(mport,
@@ -2345,6 +2347,7 @@ void *axxia_get_inb_message(struct rio_mport *mport, int 
mbox, int letter,
struct rio_rx_mbox *mb;
struct rio_msg_dme *me;
unsigned long iflags;
+   int nPending;
void *buf = NULL;
 
if ((mbox  0) || (mbox = RIO_MAX_RX_MBOX))
@@ -2371,7 +2374,8 @@ void *axxia_get_inb_message(struct rio_mport *mport, int 
mbox, int letter,
__rio_local_write_config_32(mport, RAB_INTR_ENAB_IDME, intr);
}
 
-   while (me-pending) {
+   nPending = atomic_read(me-pending);
+   while (nPending) {
struct rio_msg_desc *desc = me-desc[me-read_idx];
u32 dw0, dw1;
 
@@ -2399,7 +2403,8 @@ void *axxia_get_inb_message(struct rio_mport *mport, int 
mbox, int letter,
(dw0  0xff) | DME_DESC_DW0_VALID);
}
me-read_idx = (me-read_idx + 1) % me-entries;
-   me-pending--;
+   atomic_dec(me-pending);
+   nPending--;
__ib_dme_event_dbg(priv, me-dme_no,
   1  RIO_IB_DME_DESC_ERR);
} else {
@@ -2447,7 +2452,8 @@ void *axxia_get_inb_message(struct rio_mport *mport, int 
mbox, int letter,
mb-next_rx_slot = (mb-next_rx_slot + 1) %
mb-ring_size;
me-read_idx = (me-read_idx + 1) % me-entries;
-   me-pending--;
+   atomic_dec(me-pending);
+   nPending--;
goto done;
}
}
diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.h 
b/drivers/rapidio/devices/lsi/axxia-rio-irq.h
index fde7140..7ed5fd8 100644
--- a/drivers/rapidio/devices/lsi/axxia-rio-irq.h
+++ 

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

2014-05-02 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

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 anders.b...@lsi.com
---
 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 519cda7..e58292b 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-yo...@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 10/28] LSI AXM55xx: Various performance fixes for rapidio endpoint code.

2014-05-02 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Increased the inbox mail buffer size by 8 times.
Removed __devinit from the initialization routines

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 drivers/rapidio/devices/lsi/axxia-rio-irq.c |   24 +---
 drivers/rapidio/devices/lsi/axxia-rio.c |4 ++--
 drivers/rapidio/rio.c   |9 ++---
 3 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.c 
b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
index 73b5a4c..6a4d227 100644
--- a/drivers/rapidio/devices/lsi/axxia-rio-irq.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
@@ -1010,7 +1010,7 @@ static inline int choose_ob_dme(
if (len  sz)
continue;
 
-   if (dme-entries = (dme-entries_in_use+1)) {
+   if (dme-entries  (dme-entries_in_use+1)) {
(*ob_dme) = dme;
(*buf_sz) = sz;
return ret + i;
@@ -1474,7 +1474,6 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
u32 dw0;
int dme_no = 31 - CNTLZW(dme_mask);
int num_new;
-   int nPending;
dme_mask ^= (1  dme_no);
 
while (mb-me[letter]-dme_no != dme_no)
@@ -1514,7 +1513,7 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
 #endif
/**
 * Set Valid flag to 0 on each desc with a new message.
-* Flag is reset when the message beloning to the desc
+* Flag is reset when the message belonging to the desc
 * is fetched in get_inb_message().
 * HW descriptor update and fetch is in order.
 */
@@ -1545,6 +1544,12 @@ static void ib_dme_irq_handler(struct rio_irq_handler 
*h, u32 state)
dw0  ~DME_DESC_DW0_VALID);
}
 
+   if (mport-inb_msg[mbox_no].mcback)
+   mport-inb_msg[mbox_no].mcback(mport,
+   me-dev_id,
+   mbox_no,
+   desc-desc_no);
+
__ib_dme_dw_dbg(priv, dw0);
__ib_dme_event_dbg(priv, dme_no,
   1  RIO_IB_DME_RX_PUSH);
@@ -1565,16 +1570,6 @@ static void ib_dme_irq_handler(struct rio_irq_handler 
*h, u32 state)
__ib_dme_event_dbg(priv, dme_no,
   1  RIO_IB_DME_RX_RING_FULL);
 
-   nPending = atomic_read(me-pending);
-   if (nPending 
-   mport-inb_msg[mbox_no].mcback) {
-
-   mport-inb_msg[mbox_no].mcback(mport,
-  me-dev_id,
-  mbox_no,
-  letter);
-   }
-
if (dme_stat  IB_DME_STAT_SLEEPING) {
struct rio_msg_desc *desc;
u32 dme_ctrl;
@@ -2129,8 +2124,7 @@ static struct rio_msg_desc *get_ob_desc(struct rio_mport 
*mport,
   DESC_TABLE_W0(desc-desc_no),
   dw0);
}
-   if (!(dw0  DME_DESC_DW0_VALID) ||
-   (dw0  DME_DESC_DW0_ERROR_MASK)) {
+   if (!(dw0  DME_DESC_DW0_VALID)) {
if (desc_num != mb-write_idx)
return NULL;
if (desc_num == mb-write_idx)
diff --git a/drivers/rapidio/devices/lsi/axxia-rio.c 
b/drivers/rapidio/devices/lsi/axxia-rio.c
index 4673b6b..1f1fc39 100644
--- a/drivers/rapidio/devices/lsi/axxia-rio.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio.c
@@ -1369,7 +1369,7 @@ static int rio_mport_dtb_setup(struct platform_device 
*dev,
return -ENOMEM;
}
rio_init_dbell_res(mport-riores[RIO_DOORBELL_RESOURCE], 0, 0x);
-   rio_init_mbox_res(mport-riores[RIO_INB_MBOX_RESOURCE], 0, 8);
+   rio_init_mbox_res(mport-riores[RIO_INB_MBOX_RESOURCE], 0, 64);
rio_init_mbox_res(mport-riores[RIO_OUTB_MBOX_RESOURCE], 0, 3);
sprintf(mport-name, RIO%d mport, mport-id);
 
@@ -1743,7 +1743,7 @@ err_ops:
 /*
   The probe function for RapidIO peer-to-peer network.
 */
-static int __devinit axxia_of_rio_rpn_probe(struct platform_device *dev)
+static int axxia_of_rio_rpn_probe(struct platform_device *dev)
 {
IODP(KERN_INFO Setting up RapidIO peer-to-peer network %s\n,
 

[linux-yocto] [PATCH 12/28] LSI AXM55xx: Various bug fixes for rapidio endpoint controller.

2014-05-02 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Fix lockup issue processing inbound message descriptor chains.
Revise processing code for inbound/outbound message descriptor
chains to reduce overhead / improve performance.

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 drivers/rapidio/devices/lsi/axxia-rio-irq.c |  108 ---
 drivers/rapidio/devices/lsi/axxia-rio-irq.h |3 +-
 drivers/rapidio/devices/lsi/axxia-rio.c |2 +-
 drivers/rapidio/devices/lsi/axxia-rio.h |1 +
 drivers/rapidio/rio.c   |2 +-
 5 files changed, 85 insertions(+), 31 deletions(-)

diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.c 
b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
index 6a4d227..ae965f9 100644
--- a/drivers/rapidio/devices/lsi/axxia-rio-irq.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
@@ -1115,7 +1115,8 @@ static struct rio_msg_dme *alloc_message_engine(struct 
rio_mport *mport,
me-entries_in_use = 0;
me-write_idx = 0;
me-read_idx = 0;
-   atomic_set(me-pending, 0);
+   me-last_invalid_desc = 0;
+   me-last_compl_idx = 0;
me-tx_dme_tmo = 0;
me-dme_no = dme_no;
 
@@ -1223,6 +1224,9 @@ static void ob_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
for (i = 0; i  mbox-entries; i++) {
struct rio_msg_desc *desc = mbox-desc[i];
 
+   if (mbox-last_compl_idx != desc-desc_no)
+   continue;
+
if (!priv-internalDesc) {
dw0 = *((u32 *)DESC_TABLE_W0_MEM(mbox, desc-desc_no));
} else {
@@ -1243,6 +1247,8 @@ static void ob_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
__ob_dme_dw_dbg(priv, dw0);
 
mbox-entries_in_use--;
+   mbox-last_compl_idx = (mbox-last_compl_idx + 1) %
+   mbox-entries;
 
/**
* UP-call to net device handler
@@ -1532,6 +1538,7 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
if ((dw0  DME_DESC_DW0_READY_MASK) 
(dw0  DME_DESC_DW0_VALID)) {
 
+#ifdef OBSOLETE_BZ47185
/* Some chips clear this bit, some don't.
** Make sure in any event. */
if (!priv-internalDesc) {
@@ -1543,6 +1550,7 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
DESC_TABLE_W0(desc-desc_no),
dw0  ~DME_DESC_DW0_VALID);
}
+#endif /* OBSOLETE_BZ47185 */
 
if (mport-inb_msg[mbox_no].mcback)
mport-inb_msg[mbox_no].mcback(mport,
@@ -1556,7 +1564,6 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
me-write_idx = (me-write_idx + 1) %
 me-entries;
num_new++;
-   atomic_inc(me-pending);
if (num_new == me-entries)
break;
}
@@ -1570,6 +1577,7 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
__ib_dme_event_dbg(priv, dme_no,
   1  RIO_IB_DME_RX_RING_FULL);
 
+#ifdef OBSOLETE_BZ47185
if (dme_stat  IB_DME_STAT_SLEEPING) {
struct rio_msg_desc *desc;
u32 dme_ctrl;
@@ -1610,6 +1618,7 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, 
u32 state)
 RAB_IB_DME_CTRL(dme_no), dme_ctrl);
}
}
+#endif /* OBSOLETE_BZ47185 */
}
 }
 
@@ -1762,6 +1771,8 @@ static int open_inb_mbox(struct rio_mport *mport, void 
*dev_id,
 */
desc--;
dw0 |= DME_DESC_DW0_NXT_DESC_VALID;
+   dw0 = ~DME_DESC_DW0_VALID;
+   me-last_invalid_desc = desc-desc_no;
if (!priv-internalDesc) {
descChainStart =
(uintptr_t)virt_to_phys(me-descriptors);
@@ -2104,19 +2115,14 @@ void axxia_close_outb_mbox(struct rio_mport *mport, int 
mboxDme)
 static struct rio_msg_desc *get_ob_desc(struct rio_mport *mport,
struct rio_msg_dme *mb)
 {
-   int i, desc_num = mb-write_idx;
+   int desc_num = mb-write_idx;
struct rio_priv *priv = mport-priv;
+   struct rio_msg_desc *desc = mb-desc[desc_num];
+   int nxt_write_idx = (mb-write_idx + 1) % mb-entries;
+   u32 dw0;
 
-   /**
-* HW descriptor 

[linux-yocto] [PATCH 14/28] LSI AXM55xx: Disable linkdown reset configuration.

2014-05-02 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 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 a26061d..8fd366f 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-yo...@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto


[linux-yocto] [PATCH 13/28] LSI AXM55xx: Configuration updates and bug fixes for rapidio.

2014-05-02 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Update the powerpc FDT settings for the latest AXXIA RIO code.
Update the ARM/PowerPC LSI configuration to build AXXIA RIO by default.
Add support to reset the AXXIA RIO controller when a Link Reset Request
symbol is received.

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 arch/powerpc/boot/dts/acp25xx.dts |   35 ++
 arch/powerpc/boot/dts/acp342x.dts |   37 +++---
 arch/powerpc/boot/dts/acp344x.dts |   37 +++---
 arch/powerpc/boot/dts/acp35xx.dts |   27 +++
 drivers/rapidio/devices/lsi/axxia-rio-irq.c   |   64 +++--
 drivers/rapidio/devices/lsi/axxia-rio-irq.h   |1 +
 drivers/rapidio/devices/lsi/axxia-rio-sysfs.c |   15 +++---
 drivers/rapidio/devices/lsi/axxia-rio.c   |2 +-
 8 files changed, 123 insertions(+), 95 deletions(-)

diff --git a/arch/powerpc/boot/dts/acp25xx.dts 
b/arch/powerpc/boot/dts/acp25xx.dts
index 1207631..02f6a28 100644
--- a/arch/powerpc/boot/dts/acp25xx.dts
+++ b/arch/powerpc/boot/dts/acp25xx.dts
@@ -283,27 +283,20 @@
 ;
 };
 
-rio0: rapidio@f002 {
-compatible = lsi,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 0x0 0x4000;
+linkdown-reset = 0x0200 0x100 0x0020 0x0043 0x0 
0x1;
+   interrupt-parent = MPIC;
+interrupts = 30 2;
+outb-dmes = 2 0x0003 1 0x0001;
+   enable_ds = 1;
 };
+
 };
diff --git a/arch/powerpc/boot/dts/acp342x.dts 
b/arch/powerpc/boot/dts/acp342x.dts
index c9c8a35..99d2858 100644
--- a/arch/powerpc/boot/dts/acp342x.dts
+++ b/arch/powerpc/boot/dts/acp342x.dts
@@ -284,27 +284,22 @@
 ;
 };
 
-rio0: rapidio@f002 {
-compatible = lsi,rapidio-delta;
+rio0: rapidio@0x208000 {
+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 0x0042 0x0 0x1000; /* SRIO Conf 0 region */
+ranges = 0x0 0x0 0x0020 0x8000 0x0 0x4000;
+   /*
+linkdown-reset = 0x0200 0x100 0x0020 0x0043 0x0 
0x1;
+   */
+   interrupt-parent = MPIC;
+interrupts = 30 2;
+outb-dmes = 2 0x0003 1 0x0001;
+   enable_ds = 1;
 };
+
 };
diff --git a/arch/powerpc/boot/dts/acp344x.dts 
b/arch/powerpc/boot/dts/acp344x.dts
index 1207631..51fa547 100644
--- a/arch/powerpc/boot/dts/acp344x.dts
+++ b/arch/powerpc/boot/dts/acp344x.dts
@@ -283,27 +283,22 @@
 ;
 };
 
-rio0: rapidio@f002 {
-compatible = lsi,rapidio-delta;
+rio0: rapidio@0x208000 {
+index = 0;
+status = okay;
+#address-cells = 2;
+#size-cells = 2;
+compatible = axxia,rapidio-delta;
 device_type = rapidio;
-enabled = 0;
-   

[linux-yocto] [PATCH 15/28] LSI AXM55xx: Move datastream APIs and symbols to public header file.

2014-05-02 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 drivers/rapidio/devices/lsi/axxia-rio-ds.c  |  539 ++-
 drivers/rapidio/devices/lsi/axxia-rio-ds.h  |  330 +---
 drivers/rapidio/devices/lsi/axxia-rio-irq.c |6 +-
 drivers/rapidio/devices/lsi/axxia-rio.c |6 +-
 drivers/rapidio/devices/lsi/axxia-rio.h |3 +-
 include/linux/rio-axxia.h   |  322 
 6 files changed, 634 insertions(+), 572 deletions(-)
 create mode 100644 include/linux/rio-axxia.h

diff --git a/drivers/rapidio/devices/lsi/axxia-rio-ds.c 
b/drivers/rapidio/devices/lsi/axxia-rio-ds.c
index 2627b07..0e5be61 100755
--- a/drivers/rapidio/devices/lsi/axxia-rio-ds.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-ds.c
@@ -44,24 +44,23 @@
 /* #define ALLOC_BUF_BY_KERNEL 1 */
 
 static inline void __ib_virt_m_dbg(
-   struct rio_ds_ibds_vsid_m_stats *ptr_ib_stats,
+   struct axxia_rio_ds_ibds_vsid_m_stats *ptr_ib_stats,
u32 virt_m_stat);
 
 static inline void __ob_dse_dbg(
-   struct rio_ds_obds_dse_stats *ptr_ob_stats,
+   struct axxia_rio_ds_obds_dse_stats *ptr_ob_stats,
u32 dse_stat);
 
 static inline void __ob_dse_dw_dbg(
-   struct rio_ds_obds_dse_stats *ptr_ob_stats,
+   struct axxia_rio_ds_obds_dse_stats *ptr_ob_stats,
u32 dw0);
 
 static inline void __ib_dse_dw_dbg(
-   struct rio_ds_ibds_vsid_m_stats *ptr_ib_stats,
+   struct axxia_rio_ds_ibds_vsid_m_stats *ptr_ib_stats,
u32 dw0);
 
-
 static inline void __ib_virt_m_dbg(
-   struct rio_ds_ibds_vsid_m_stats *ptr_ib_stats,
+   struct axxia_rio_ds_ibds_vsid_m_stats *ptr_ib_stats,
u32 virt_m_stat)
 {
if (virt_m_stat  IB_VIRT_M_STAT_ERROR_MASK) {
@@ -92,7 +91,7 @@ static inline void __ib_virt_m_dbg(
 }
 
 static inline void __ob_dse_dbg(
-   struct rio_ds_obds_dse_stats *ptr_ob_stats,
+   struct axxia_rio_ds_obds_dse_stats *ptr_ob_stats,
u32 dse_stat)
 {
if (dse_stat  OB_DSE_STAT_ERROR_MASK) {
@@ -111,7 +110,7 @@ static inline void __ob_dse_dbg(
 }
 
 static inline void __ob_dse_dw_dbg(
-   struct rio_ds_obds_dse_stats *ptr_ob_stats,
+   struct axxia_rio_ds_obds_dse_stats *ptr_ob_stats,
u32 dw0)
 {
if (dw0  OB_DSE_DESC_ERROR_MASK) {
@@ -123,7 +122,7 @@ static inline void __ob_dse_dw_dbg(
 }
 
 static inline void __ib_dse_dw_dbg(
-   struct rio_ds_ibds_vsid_m_stats *ptr_ib_stats,
+   struct axxia_rio_ds_ibds_vsid_m_stats *ptr_ib_stats,
u32 dw0)
 {
if (dw0  IB_DSE_DESC_ERROR_MASK) {
@@ -154,16 +153,16 @@ static inline void __ib_dse_dw_dbg(
  * Returns %0 on success
  /
 int axxia_data_stream_global_cfg(
-   struct rio_mport*mport,
+   struct rio_mport   *mport,
int mtu,
int ibds_avsid_mapping)
 {
-   struct rio_priv *priv = mport-priv;
-   struct rio_ds_priv  *ptr_ds_priv = (priv-ds_priv_data);
-   struct ibds_virt_m_cfg  *ptr_virt_m_cfg;
-   struct rio_obds_dse_cfg *ptr_dse_cfg;
-   int reg_val;
-   u32 mtu_value = 0;
+   struct rio_priv*priv = mport-priv;
+   struct axxia_rio_ds_cfg *ptr_ds_cfg = (priv-ds_cfg_data);
+   struct axxia_ibds_virt_m_cfg  *ptr_virt_m_cfg;
+   struct axxia_rio_obds_dse_cfg *ptr_dse_cfg;
+   int reg_val;
+   u32 mtu_value = 0;
int i;
 
/* sanity check */
@@ -176,13 +175,13 @@ int axxia_data_stream_global_cfg(
**  IBDS ALIAS M is used.
*/
for (i = 0; i  RIO_MAX_NUM_IBDS_VSID_M; i++) {
-   ptr_virt_m_cfg = (ptr_ds_priv-ibds_vsid_m_cfg[i]);
+   ptr_virt_m_cfg = (ptr_ds_cfg-ibds_vsid_m_cfg[i]);
if (ptr_virt_m_cfg-in_use == RIO_DS_TRUE)
return -EINVAL;
}
 
for (i = 0; i  RIO_MAX_NUM_OBDS_DSE; i++) {
-   ptr_dse_cfg = (ptr_ds_priv-obds_dse_cfg[i]);
+   ptr_dse_cfg = (ptr_ds_cfg-obds_dse_cfg[i]);
if (ptr_dse_cfg-in_use == RIO_DS_TRUE)
return -EINVAL;
}
@@ -203,8 +202,8 @@ int axxia_data_stream_global_cfg(
__rio_local_write_config_32(mport, RAB_IBDS_VSID_ALIAS, reg_val);
 
/* save information in the system */
-   ptr_ds_priv-mtu = mtu;
-   ptr_ds_priv-ibds_avsid_mapping = ibds_avsid_mapping;
+   ptr_ds_cfg-mtu = mtu;
+   ptr_ds_cfg-ibds_avsid_mapping = ibds_avsid_mapping;
 
return 0;
 }
@@ -240,7 +239,6 @@ int axxia_open_ob_data_stream(
int num_header_entries,
int num_data_entries)
 {
-   struct rio_priv *priv = mport-priv;
int rc = 0;
struct rio_priv *priv = mport-priv;
 
@@ -280,19 +278,20 @@ int open_ob_data_stream(

[linux-yocto] [PATCH 16/28] i2c-axxia: Avoid timeout when interrupt delayed

2014-05-02 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

Changed the order in which the interrupt conditions are checked in the
interrupt handler. Need to check for transfer-complete before timeout-error,
otherwise a delayed interrupt may report a false timeout error (since the
timeout may expire after the transfer was completed).

Signed-off-by: Anders Berg anders.b...@lsi.com
---
 drivers/i2c/busses/i2c-axxia.c |   50 ++--
 1 file changed, 23 insertions(+), 27 deletions(-)

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index e58292b..43b433b 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -334,33 +334,6 @@ axxia_i2c_isr(int irq, void *_dev)
/* Clear interrupt */
writel(0x01, idev-regs-interrupt_status);
 
-   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,
-   status_str(idev-msg_err),
-   readl(idev-regs-mst_rx_bytes_xfrd),
-   readl(idev-regs-mst_rx_xfer),
-   readl(idev-regs-mst_tx_bytes_xfrd),
-   readl(idev-regs-mst_tx_xfer));
-   complete(idev-msg_complete);
-   return IRQ_HANDLED;
-   }
-
-   /* Stop completed? */
-   if (status  MST_STATUS_SCC) {
-   i2c_int_disable(idev, ~0);
-   complete(idev-msg_complete);
-   }
-
-   /* Transfer done? */
-   if (status  (MST_STATUS_SNS | MST_STATUS_SS)) {
-   if (i2c_m_rd(idev-msg)  idev-msg_xfrd  idev-msg-len)
-   axxia_i2c_empty_rx_fifo(idev);
-   i2c_int_disable(idev, ~0);
-   complete(idev-msg_complete);
-   }
-
/* RX FIFO needs service? */
if (i2c_m_rd(idev-msg)  (status  MST_STATUS_RFL))
axxia_i2c_empty_rx_fifo(idev);
@@ -373,6 +346,29 @@ axxia_i2c_isr(int irq, void *_dev)
i2c_int_disable(idev, MST_STATUS_TFL);
}
 
+   if (status  MST_STATUS_SCC) {
+   /* Stop completed? */
+   i2c_int_disable(idev, ~0);
+   complete(idev-msg_complete);
+   } else if (status  (MST_STATUS_SNS | MST_STATUS_SS)) {
+   /* Transfer done? */
+   if (i2c_m_rd(idev-msg)  idev-msg_xfrd  idev-msg-len)
+   axxia_i2c_empty_rx_fifo(idev);
+   i2c_int_disable(idev, ~0);
+   complete(idev-msg_complete);
+   } else if (unlikely(status  MST_STATUS_ERR)) {
+   /* Transfer error? */
+   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,
+   status_str(status),
+   readl(idev-regs-mst_rx_bytes_xfrd),
+   readl(idev-regs-mst_rx_xfer),
+   readl(idev-regs-mst_tx_bytes_xfrd),
+   readl(idev-regs-mst_tx_xfer));
+   complete(idev-msg_complete);
+   }
+
return IRQ_HANDLED;
 }
 
-- 
1.7.9.5

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


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

2014-05-02 Thread Charlie Paul
From: David Mercado david.merc...@windriver.com

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

Signed-off-by: David Mercado david.merc...@windriver.com
---
 arch/arm/mach-axxia/axxia-gic.c | 1109 ---
 1 file changed, 563 insertions(+), 546 deletions(-)

diff --git a/arch/arm/mach-axxia/axxia-gic.c b/arch/arm/mach-axxia/axxia-gic.c
index 8a8e8eb..701d65f 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,24 +33,11 @@
  * registers are banked per-cpu for these sources.
  */
 
-#include linux/init.h
-#include linux/kernel.h
-#include linux/err.h
 #include linux/module.h
-#include linux/list.h
-#include linux/smp.h
-#include linux/cpu_pm.h
-#include linux/cpumask.h
 #include linux/io.h
-#include linux/of.h
 #include linux/of_address.h
-#include linux/of_irq.h
-#include linux/irqdomain.h
-#include linux/interrupt.h
-#include linux/percpu.h
-#include linux/slab.h
+#include linux/cpu_pm.h
 
-#include asm/irq.h
 #include asm/exception.h
 #include asm/smp_plat.h
 #include asm/mach/irq.h
@@ -87,13 +74,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 +94,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 +105,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 +127,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 +197,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, 

[linux-yocto] [PATCH 00/28] Resubmit LSI AXXIA updates to 3.4 standard/axxia/base

2014-05-02 Thread Charlie Paul
Sorry Bruce, those two patches appeared in my tree after a rebase.
I will put the --cc-supress in my submittals

Anders Berg (7):
  axxia: Fixed earlyprintk
  axxia: Define arch_is_coherent()
  ARM: 7465/1: Handle 4GB memory sizes in device tree and
mem=size@start option
  ARM: LPAE: use phys_addr_t in alloc_init_pud()
  ARM: 7499/1: mm: Fix vmalloc overlap check for !HIGHMEM
  arm: mmu: Fixed checkpatch issues with mmu
  drivers/i2c-axxia: Support I2C_M_RECV_LEN

David Mercado (2):
  LSI AXM55xx: Enable multi-cluster wfe/sev
  LSI AXM55XX: Add PMU support

John Jacques (6):
  arch/arm/mach-axxi: Updated DDR Retention to Wokr from Interrupt
Context
  arch/arm/mach-axxia: Clear MTC Errors During Initialization
  LSI: Fix Device Tree compatible fields
  powerpc/mpic: Disable preemption when calling mpic_processor_id()
  arm/mach-axxia: Same build for HW and simlation and DDR Retention
Reset and clock init.
  axxia: Remove Wrapper Functions

Michael Bringmann (1):
  LSI AXM55XX/rapidio: Stability and bug fix improvements , Correct
boundary, Expand valid condition.

Paul Butler (8):
  drivers/rapidio/devices: Initial Submittal of LSI rapidio
  drivers/rapidio: new files
  drivers/rapidio: modified files
  arm: rapidio updates
  powerpc: rapidio updates
  include: rapidio updates
  drivers: rapidio updates
  arm/mach-axxia: Updated PCIe driver to set PCIe

SangeethaRao (3):
  arch/powerpc/sysdev: Fixed PCIe enumeration issue on AXM3500
emulation
  drivers/usb: USB driver/dts on PPC was broken.
  arch/arm/mach-axxia: added support for ncr_read/ncr_write

ningligong (1):
  drivers/rapidio/lsi: squash a bunch rapidio stuff together and
Cleanup

 arch/arm/Kconfig|   19 +
 arch/arm/Kconfig.debug  |9 +
 arch/arm/Makefile   |3 -
 arch/arm/boot/dts/axm-sim.dts   |  403 
 arch/arm/boot/dts/axm55xx.dts   |   50 +-
 arch/arm/boot/dts/axm55xxemu.dts|   21 +-
 arch/arm/boot/dts/axm55xxsim.dts|   94 +-
 arch/arm/boot/dts/axm55xxsim16.dts  |  439 
 arch/arm/include/asm/axxia-rio.h|  135 ++
 arch/arm/include/asm/rio.h  |   37 +
 arch/arm/include/asm/setup.h|   14 +-
 arch/arm/include/asm/spinlock.h |4 +
 arch/arm/kernel/perf_event_v7.c |3 +-
 arch/arm/kernel/setup.c |   70 +-
 arch/arm/mach-axxia/Kconfig |3 -
 arch/arm/mach-axxia/Makefile|3 +-
 arch/arm/mach-axxia/axxia-gic.c |   25 +-
 arch/arm/mach-axxia/axxia.c |  123 +-
 arch/arm/mach-axxia/axxia.h |2 +-
 arch/arm/mach-axxia/clock.c |  185 +-
 arch/arm/mach-axxia/ddr_retention.c |  300 ++-
 arch/arm/mach-axxia/include/mach/debug-macro.S  |   16 +-
 arch/arm/mach-axxia/include/mach/hardware.h |   25 +-
 arch/arm/mach-axxia/include/mach/irqs.h |1 +
 arch/arm/mach-axxia/include/mach/memory.h   |   19 +
 arch/arm/mach-axxia/include/mach/ncr.h  |   44 +
 arch/arm/mach-axxia/ncr.c   |  597 +
 arch/arm/mach-axxia/pci.c   |7 +-
 arch/arm/mach-axxia/platsmp.c   |  155 +-
 arch/arm/mach-axxia/rapidio.c   |   68 +
 arch/arm/mach-axxia/wrappers.c  |  176 --
 arch/arm/mm/mmu.c   |   82 +-
 arch/powerpc/boot/dts/ACP344xV2.dts |   20 +-
 arch/powerpc/boot/dts/acp25xx.dts   |   16 +-
 arch/powerpc/boot/dts/acp342x.dts   |   21 +-
 arch/powerpc/boot/dts/acp344x.dts   |   16 +-
 arch/powerpc/boot/dts/lsi_acp342x.dts   |  317 +++
 arch/powerpc/boot/dts/lsi_acp344x.dts   |  355 +++
 arch/powerpc/include/asm/axxia-rio.h|  107 +
 arch/powerpc/include/asm/rio.h  |   46 +
 arch/powerpc/platforms/44x/Makefile |3 +-
 arch/powerpc/platforms/44x/acprio.c |   65 +
 arch/powerpc/platforms/44x/acpx1.c  |1 +
 arch/powerpc/sysdev/Makefile|2 -
 arch/powerpc/sysdev/lsi_acp_wrappers.c  |  132 --
 arch/powerpc/sysdev/lsi_pci.c   |   19 +-
 arch/powerpc/sysdev/mpic.c  |  119 +-
 drivers/i2c/busses/i2c-axxia.c  |  193 +-
 drivers/misc/Kconfig|2 +-
 drivers/misc/lsi-mtc.c  |9 +-
 drivers/misc/lsi-ncr.c  |  334 +--
 drivers/misc/lsi-smmon.c|  374 ++--
 drivers/net/ethernet/lsi/lsi_acp_net.c  |9 +-
 drivers/net/rionet.c|  135 +-
 drivers/rapidio/Kconfig |   85 +
 drivers/rapidio/Makefile|4 +-
 

[linux-yocto] [PATCH 04/28] arm: rapidio updates

2014-05-02 Thread Charlie Paul
From: Paul Butler paul.but...@windriver.com

- Added the RapidIO management options
- Added the rio device to the axm55xx
- Created the rio architecture support for arm
- Added a file to support the RAPIDIO Bus registration

Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/arm/Kconfig |   18 +
 arch/arm/boot/dts/axm55xx.dts|   16 
 arch/arm/include/asm/axxia-rio.h |   82 ++
 arch/arm/include/asm/rio.h   |   33 +++
 arch/arm/mach-axxia/Makefile |1 +
 arch/arm/mach-axxia/clock.c  |5 +++
 arch/arm/mach-axxia/rapidio.c|   44 
 7 files changed, 199 insertions(+)
 create mode 100644 arch/arm/include/asm/axxia-rio.h
 create mode 100644 arch/arm/include/asm/rio.h
 create mode 100644 arch/arm/mach-axxia/rapidio.c

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0b98e83..370eca8 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -344,6 +344,7 @@ config ARCH_AXXIA
select PCI
select PCI_DOMAINS if PCI
select ARCH_SUPPORTS_MSI if PCI
+select HAS_RAPIDIO if (!PREEMPT_RTB)
help
  This enables support for the LSI Axxia boards.
 
@@ -2358,3 +2359,20 @@ source security/Kconfig
 source crypto/Kconfig
 
 source lib/Kconfig
+
+menu RapidIO management options
+
+config HAS_RAPIDIO
+   bool
+   default n
+
+config RAPIDIO
+   bool RapidIO support
+   depends on HAS_RAPIDIO || PCI
+   help
+ If you say Y here, the kernel will include drivers and
+ infrastructure code to support RapidIO interconnect devices.
+
+source drivers/rapidio/Kconfig
+
+endmenu
diff --git a/arch/arm/boot/dts/axm55xx.dts b/arch/arm/boot/dts/axm55xx.dts
index aac791d..7ecb177 100644
--- a/arch/arm/boot/dts/axm55xx.dts
+++ b/arch/arm/boot/dts/axm55xx.dts
@@ -35,6 +35,7 @@
serial0   = axxia_serial0;
timer = axxia_timers;
ethernet0 = axxia_femac0;
+   rapidio0  = rio0;
};
 
cpus {
@@ -423,6 +424,21 @@
reg = 0x20 0x10098000 0 0x3000;
interrupts = 0 45 4;
};
+
+rio0: rapidio {
+index = 0;
+status = disabled;
+#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;
+};
+
 };
 
 /*
diff --git a/arch/arm/include/asm/axxia-rio.h b/arch/arm/include/asm/axxia-rio.h
new file mode 100644
index 000..f244c85
--- /dev/null
+++ b/arch/arm/include/asm/axxia-rio.h
@@ -0,0 +1,82 @@
+/*
+ * RapidIO support for LSI Axxia parts
+ *
+ */
+#ifndef __ASM_AXXIA_RIO_H__
+#define __ASM_AXXIA_RIO_H__
+
+/* Constants, Macros, etc. */
+
+#define AXXIA_RIO_SMALL_SYSTEM
+
+#define AXXIA_RIO_SYSMEM_BARRIER()
+
+#define AXXIA_RIO_DISABLE_MACHINE_CHECK()
+#define AXXIA_RIO_ENABLE_MACHINE_CHECK()
+#define AXXIA_RIO_IF_MACHINE_CHECK(mcsr)   (mcsr = 0)
+
+#define IN_SRIO8(a, v, ec) {v = inb((long unsigned int)a); ec = 0;}
+#define IN_SRIO16(a, v, ec){v = inw((long unsigned int)a); ec = 0;}
+#define IN_SRIO32(a, v, ec){v = inl((long unsigned int)a); ec = 0;}
+
+#define OUT_SRIO8(a, v)outb_p(v, (long unsigned int) a)
+#define OUT_SRIO16(a, v)   outw_p(v, (long unsigned int) a)
+#define OUT_SRIO32(a, v)   outl_p(v, (long unsigned int) a)
+
+#define _SWAP32(x) x)  0x00FF)  24) | (((x)  0xFF00)   
8) | (((x)  0x00FF)  8) | (((x)  0xFF00)  24))
+#define CORRECT_GRIO(a)_SWAP32(a)
+#define CORRECT_RAB(a) (a)
+
+/* ACP RIO board-specific stuff */
+
+extern int axxia_rio_apio_enable(struct rio_mport *mport, u32 mask, u32 bits);
+extern int axxia_rio_apio_disable(struct rio_mport *mport);
+extern int axxia_rio_rpio_enable(struct rio_mport *mport, u32 mask, u32 bits);
+extern int axxia_rio_rpio_disable(struct rio_mport *mport);
+
+extern int axxia_rapidio_board_init(void);
+
+
+/*/
+/* ACP RIO operational stuff */
+/*/
+
+/**
+ * CNTLZW - Count leading zeros word
+ * @val: value from which count number of leading zeros
+ *
+ * Return: number of zeros
+ */
+static inline u32 CNTLZW(u32 val)
+{
+   int n = 0;
+   if (val == 0)
+   return 32;
+   if ((val  0x) == 0)
+   n += 16; val = val  16;
+   /*        
+   // 16 bits from left are zero! so we omit 16 left bits */
+   if ((val  0xFF00) == 0)
+   n = n + 8; val = val  8;
+ 

[linux-yocto] [PATCH 06/28] include: rapidio updates

2014-05-02 Thread Charlie Paul
From: Paul Butler paul.but...@windriver.com

This patch adds the register definitions,
support for PW messages, destination IDs, direct IO and
driver support.

Signed-off-by: Paul Butler paul.but...@windriver.com
---
 include/asm-generic/vmlinux.lds.h |   10 ++
 include/linux/rio.h   |  231 ++---
 include/linux/rio_dio.h   |   67 +++
 include/linux/rio_drv.h   |  202 +---
 include/linux/rio_ids.h   |7 ++
 include/linux/rio_regs.h  |   26 +
 include/linux/riopw.h |   30 +
 7 files changed, 490 insertions(+), 83 deletions(-)
 create mode 100644 include/linux/rio_dio.h
 create mode 100644 include/linux/riopw.h

diff --git a/include/asm-generic/vmlinux.lds.h 
b/include/asm-generic/vmlinux.lds.h
index 5d2ca6f..290711d 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -274,6 +274,16 @@
}   \
\
/* RapidIO route ops */ \
+   .rio_dev_fixup : AT(ADDR(.rio_dev_fixup) - LOAD_OFFSET) {   \
+   VMLINUX_SYMBOL(__start_rio_dev_fixup_early) = .;\
+   *(.rio_dev_fixup_early) \
+   VMLINUX_SYMBOL(__end_rio_dev_fixup_early) = .;  \
+   VMLINUX_SYMBOL(__start_rio_dev_fixup_enable) = .;   \
+   *(.rio_dev_fixup_enable)\
+   VMLINUX_SYMBOL(__end_rio_dev_fixup_enable) = .; \
+   }   \
+   \
+   /* RapidIO route ops */ \
.rio_ops: AT(ADDR(.rio_ops) - LOAD_OFFSET) {\
VMLINUX_SYMBOL(__start_rio_switch_ops) = .; \
*(.rio_switch_ops)  \
diff --git a/include/linux/rio.h b/include/linux/rio.h
index 4d50611..ef300e2 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -20,6 +20,8 @@
 #include linux/errno.h
 #include linux/device.h
 #include linux/rio_regs.h
+#include linux/radix-tree.h
+#include asm/rio.h
 
 #define RIO_NO_HOPCOUNT-1
 #define RIO_INVALID_DESTID 0x
@@ -37,10 +39,14 @@
   entry is invalid (no route
   exists for the device ID) */
 
+#define RIO_INVALID_ROUTE_WEIGHT   0xff  /* Indicates that a route weight
+   entry is invalid (no route
+   exists for the device ID) */
+
 #define RIO_MAX_ROUTE_ENTRIES(size)(size ? (1  16) : (1  8))
 #define RIO_ANY_DESTID(size)   (size ? 0x : 0xff)
 
-#define RIO_MAX_MBOX   4
+#define RIO_MAX_MBOX   8
 #define RIO_MAX_MSG_SIZE   0x1000
 
 /*
@@ -77,6 +83,9 @@
 #define RIO_CTAG_RESRVD0xfffe /* Reserved */
 #define RIO_CTAG_UDEVID0x0001 /* Unique device identifier */
 
+#define RIO_DEVICE_INSERTION1
+#define RIO_DEVICE_EXTRACTION   2
+
 extern struct bus_type rio_bus_type;
 extern struct device rio_bus;
 extern struct list_head rio_devices;   /* list of all devices */
@@ -85,6 +94,15 @@ struct rio_mport;
 struct rio_dev;
 union rio_pw_msg;
 
+struct rio_switch_port {
+   struct rio_dev *rdev;
+#ifdef CONFIG_RAPIDIO_DYNAMIC_ROUTES
+   u8 *route_weights_table;
+#endif
+};
+
+#define NEW_STYLE 1
+
 /**
  * struct rio_switch - RIO switch info
  * @node: Node in global list of switches
@@ -104,7 +122,12 @@ union rio_pw_msg;
 struct rio_switch {
struct list_head node;
u16 switchid;
+#ifdef OLD_STYLE
u8 *route_table;
+#else
+   u32 port_init;
+   int update_lut;
+#endif
u32 port_ok;
int (*add_entry) (struct rio_mport *mport, u16 destid, u8 hopcount,
  u16 table, u16 route_destid, u8 route_port);
@@ -119,7 +142,9 @@ struct rio_switch {
int (*em_init) (struct rio_dev *dev);
int (*em_handle) (struct rio_dev *dev, u8 swport);
int (*sw_sysfs) (struct rio_dev *dev, int create);
-   struct rio_dev *nextdev[0];
+#ifdef OLD_STYLE
+   struct rio_switch_port port[0];
+#endif
 };
 
 /**
@@ -151,10 +176,19 @@ struct rio_switch {
  * @prev: Previous RIO device connected to the current one
  * @rswitch: struct rio_switch (if valid for this device)
  */
+#ifdef NEW_STYLE
+struct rio_dyn {
+   int prev_port;
+   u16 prev_destid;
+   u32 swpinfo;
+};
+#endif
+
 struct rio_dev {
struct list_head global_list;   /* node in list of all RIO devices */
struct list_head net_list;  /* node in per net list */
- 

[linux-yocto] [PATCH 05/28] powerpc: rapidio updates

2014-05-02 Thread Charlie Paul
From: Paul Butler paul.but...@windriver.com

Add the rapidio device to the powerpc tree
Add the rapidio support for the powerpc 44x lsi board

Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/powerpc/boot/dts/lsi_acp342x.dts |  317 +
 arch/powerpc/boot/dts/lsi_acp344x.dts |  355 +
 arch/powerpc/include/asm/axxia-rio.h  |  103 ++
 arch/powerpc/include/asm/rio.h|   41 
 arch/powerpc/platforms/44x/Makefile   |3 +-
 arch/powerpc/platforms/44x/acprio.c   |   65 ++
 arch/powerpc/platforms/44x/acpx1.c|1 +
 7 files changed, 884 insertions(+), 1 deletion(-)
 create mode 100644 arch/powerpc/boot/dts/lsi_acp342x.dts
 create mode 100644 arch/powerpc/boot/dts/lsi_acp344x.dts
 create mode 100644 arch/powerpc/include/asm/axxia-rio.h
 create mode 100644 arch/powerpc/platforms/44x/acprio.c

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 jwbo...@linux.vnet.ibm.com, David Gibson d...@au1.ibm.com
+ *
+ * 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;
+reg = 0x 0x 0x1000;
+};
+
+memory@8000 {
+device_type = memory;
+reg = 0x 0x 0x;
+};
+
+   MPIC: interrupt-controller {
+   compatible = chrp,open-pic;
+   interrupt-controller;
+   dcr-reg = 0xffc0 0x0003;
+   #address-cells = 0;
+   #size-cells = 0;
+   #interrupt-cells = 2;
+   pic-no-reset;
+   };
+
+   plb {
+   /* Could be PLB6, doesn't matter */
+   compatible = ibm,plb-4xx, ibm,plb4;
+   #address-cells = 2;
+   #size-cells = 1;
+   ranges;
+   clock-frequency = 0; // Filled in by zImage
+
+   POB0: opb {
+   compatible = ibm,opb-4xx, ibm,opb;
+   #address-cells = 1;
+   #size-cells = 1;
+   /* Wish there was a nicer way of specifying a full 
32-bit
+  range */
+   ranges = 0x 0x0020 0x 0x8000
+ 0x8000 0x0020 0x8000 0x8000;
+   clock-frequency = 0; // Filled in by zImage
+   UART0: serial@00404000 {
+

[linux-yocto] [PATCH 08/28] axxia: Fixed earlyprintk

2014-05-02 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

Add static mapping of the UART registers for CONFIG_DEBUG_LL. Also depends on
commit 2f409a to fix a bug with LPAE and static mappings.

Signed-off-by: Anders Berg anders.b...@lsi.com
---
 arch/arm/Kconfig.debug |9 +
 arch/arm/mach-axxia/axxia.c|   13 
 arch/arm/mach-axxia/include/mach/debug-macro.S |   16 ---
 arch/arm/mach-axxia/include/mach/hardware.h|   25 +++-
 4 files changed, 50 insertions(+), 13 deletions(-)

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 85348a0..762903c 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -89,6 +89,15 @@ choice
bool Kernel low-level debugging on 9263 and 9g45
depends on HAVE_AT91_DBGU1
 
+   config AXXIA_DEBUG_LL_UART0
+   bool Kernel low-level debugging via UART0
+   depends on ARCH_AXXIA
+   help
+   This enables the low-level debugging via the UART0
+   and should be used
+   with the
+   AXXIA hardware
+
config DEBUG_CLPS711X_UART1
bool Kernel low-level debugging messages via UART1
depends on ARCH_CLPS711X
diff --git a/arch/arm/mach-axxia/axxia.c b/arch/arm/mach-axxia/axxia.c
index df63dbd..7b725ef 100644
--- a/arch/arm/mach-axxia/axxia.c
+++ b/arch/arm/mach-axxia/axxia.c
@@ -46,6 +46,7 @@
 #include asm/mach/time.h
 #include asm/hardware/cache-l2x0.h
 #include asm/hardware/gic.h
+#include mach/hardware.h
 #include mach/timers.h
 #include mach/axxia-gic.h
 #include axxia.h
@@ -62,8 +63,20 @@ static const char *axxia_dt_match[] __initconst = {
 
 static void __iomem *ssp_base;
 
+static struct map_desc axxia_static_mappings[] __initdata = {
+#ifdef CONFIG_DEBUG_LL
+   {
+   .virtual=  AXXIA_DEBUG_UART_VIRT,
+   .pfn= __phys_to_pfn(AXXIA_DEBUG_UART_PHYS),
+   .length = SZ_4K,
+   .type   = MT_DEVICE
+   },
+#endif
+};
+
 void __init axxia_dt_map_io(void)
 {
+   iotable_init(axxia_static_mappings, ARRAY_SIZE(axxia_static_mappings));
 }
 
 void __init axxia_dt_init_early(void)
diff --git a/arch/arm/mach-axxia/include/mach/debug-macro.S 
b/arch/arm/mach-axxia/include/mach/debug-macro.S
index 83d6670..3a3755b 100644
--- a/arch/arm/mach-axxia/include/mach/debug-macro.S
+++ b/arch/arm/mach-axxia/include/mach/debug-macro.S
@@ -10,6 +10,8 @@
  * published by the Free Software Foundation.
  */
 
+#include mach/hardware.h
+
 /*
  * -- NOTE --
  *
@@ -19,19 +21,9 @@
 #error Axxia Peripherals Are Only Accessible Using the LPAE!
 #endif
 
-#define UART0_PHYSICAL_ADDRESS 0x00201008ULL
-#define UART1_PHYSICAL_ADDRESS 0x002010081000ULL
-#define UART2_PHYSICAL_ADDRESS 0x002010082000ULL
-#define UART3_PHYSICAL_ADDRESS 0x002010083000ULL
-
-#define UART0_VIRTUAL_ADDRESS 0xf008
-#define UART1_VIRTUAL_ADDRESS 0xf0081000
-#define UART2_VIRTUAL_ADDRESS 0xf0082000
-#define UART3_VIRTUAL_ADDRESS 0xf0083000
-
.macro  addruart, rp, rv, tmp
-   ldr \rp, =0x1008
-   ldr \rv, =0xf008
+   ldr \rp, =(AXXIA_DEBUG_UART_PHYS  0x)
+   ldr \rv, =AXXIA_DEBUG_UART_VIRT
.endm
 
 #include asm/hardware/debug-pl01x.S
diff --git a/arch/arm/mach-axxia/include/mach/hardware.h 
b/arch/arm/mach-axxia/include/mach/hardware.h
index 40a8c17..ce3790f 100644
--- a/arch/arm/mach-axxia/include/mach/hardware.h
+++ b/arch/arm/mach-axxia/include/mach/hardware.h
@@ -1 +1,24 @@
-/* empty */
+/*
+ * arch/arm/mach-axxia/include/mach/hardware.h
+ *
+ * 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 as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+#ifndef __MACH_HARDWARE_H
+#define __MACH_HARDWARE_H
+
+#define AXXIA_UART0_PHYS   0x201008
+#define AXXIA_UART1_PHYS   0x2010081000
+#define AXXIA_UART2_PHYS   0x2010082000
+#define AXXIA_UART3_PHYS   0x2010083000
+
+#ifdef CONFIG_AXXIA_DEBUG_LL_UART0
+#define AXXIA_DEBUG_UART_VIRT  0xf008
+#define AXXIA_DEBUG_UART_PHYS  AXXIA_UART0_PHYS
+#endif
+
+#endif
-- 
1.7.9.5

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


[linux-yocto] [PATCH 09/28] axxia: Define arch_is_coherent()

2014-05-02 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

By defining arch_is_coherent() == 1, we can avoid unnecessary cache maintenance
operations and the dma_alloc_coherent() will return normal memory.

Signed-off-by: Anders Berg anders.b...@lsi.com
---
 arch/arm/Kconfig  |1 +
 arch/arm/mach-axxia/include/mach/memory.h |   19 +++
 drivers/usb/host/ehci-ci13612.c   |   12 ++--
 3 files changed, 26 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/mach-axxia/include/mach/memory.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 370eca8..f763ad1 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -340,6 +340,7 @@ config ARCH_AXXIA
select ARM_TIMER_SP804
select ICST
select NEED_MACH_IO_H
+   select NEED_MACH_MEMORY_H
select ZONE_DMA
select PCI
select PCI_DOMAINS if PCI
diff --git a/arch/arm/mach-axxia/include/mach/memory.h 
b/arch/arm/mach-axxia/include/mach/memory.h
new file mode 100644
index 000..9df2aaf
--- /dev/null
+++ b/arch/arm/mach-axxia/include/mach/memory.h
@@ -0,0 +1,19 @@
+/*
+ * arch/arm/mach-axxia/include/mach/memory.h
+ *
+ * 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 as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
+
+#include mach/hardware.h
+
+#define arch_is_coherent() 1
+
+#endif
diff --git a/drivers/usb/host/ehci-ci13612.c b/drivers/usb/host/ehci-ci13612.c
index 2a30dab..b995a32 100644
--- a/drivers/usb/host/ehci-ci13612.c
+++ b/drivers/usb/host/ehci-ci13612.c
@@ -138,8 +138,7 @@ ci13612_fixup_usbcmd_rs(struct ehci_hcd *ehci)
port_status = ehci_readl(ehci, ehci-regs-port_status[0]);
pr_info(ehci-ci13612: port_status = 0x%x\n, port_status);
if (port_status  0x100) {
-   pr_err(ehci-ci13612: USB port is in reset status, 
-  not able to change HC status to run\n);
+   pr_err(ehci-ci13612: USB port is in reset status, not able to 
change HC status to run\n);
return -EFAULT;
}
return 0;
@@ -171,7 +170,7 @@ ci13612_fixup_txpburst(struct ehci_hcd *ehci)
ehci_writel(ehci, burst_size, ehci-regs-reserved[1]);
 }
 #else
-#define ci13612_fixup_txpburst(ehci) do { (void)ehci; } while(0)
+#define ci13612_fixup_txpburst(ehci) do { (void)ehci; } while (0)
 #endif
 
 static int ci13612_ehci_run(struct usb_hcd *hcd)
@@ -260,7 +259,8 @@ static int ci13612_ehci_probe(struct platform_device *pdev)
pdev-dev.coherent_dma_mask = DMA_BIT_MASK(32);
pdev-dev.dma_mask = pdev-dev.coherent_dma_mask;
 
-   hcd = usb_create_hcd(ci13612_hc_driver, pdev-dev, 
dev_name(pdev-dev));
+   hcd = usb_create_hcd(ci13612_hc_driver, pdev-dev,
+   dev_name(pdev-dev));
if (!hcd) {
retval = -ENOMEM;
goto fail_create_hcd;
@@ -285,8 +285,8 @@ static int ci13612_ehci_probe(struct platform_device *pdev)
/* Set address bits [39:32] to zero */
writel(0x0, gpreg_base + 0x8);
 #ifndef CONFIG_LSI_USB_SW_WORKAROUND
-   /* hprot pass-through (let the controller drive hprot[0:3] */
-   writel(0x100, gpreg_base + 0x74);
+   /* hprot cachable and bufferable */
+   writel(0xc, gpreg_base + 0x74);
 #endif
iounmap(gpreg_base);
}
-- 
1.7.9.5

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


[linux-yocto] [PATCH 12/28] ARM: LPAE: use phys_addr_t in alloc_init_pud()

2014-05-02 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

  commit 20d6956d8cd2452cec0889ff040f18afc03c2e6b upstream

  This patch fixes the alloc_init_pud() function to use phys_addr_t instead of
  unsigned long when passing in the phys argument.

  This is an extension to commit 97092e0 (ARM:
  pgtable: use phys_addr_t for physical addresses), which applied similar 
changes
  elsewhere in the ARM memory management code.

  Signed-off-by: Vitaly Andrianov vita...@ti.com
  Signed-off-by: Cyril Chemparathy cy...@ti.com
  Acked-by: Nicolas Pitre n...@linaro.org
  Acked-by: Catalin Marinas catalin.mari...@arm.com
  Tested-by: Santosh Shilimkar santosh.shilim...@ti.com
  Tested-by: Subash Patel subash...@samsung.com
  Signed-off-by: Will Deacon will.dea...@arm.comarm: mmu: Fix truncated 
40-bit physaddr (LPAE)
  Signed-off-by: Anders Berg anders.b...@lsi.com
---
 arch/arm/mm/mmu.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index f117e1f..0acc475 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -628,7 +628,7 @@ static void __init alloc_init_section(pud_t *pud, unsigned 
long addr,
 }
 
 static void __init alloc_init_pud(pgd_t *pgd, unsigned long addr,
-   unsigned long end, unsigned long phys, const struct mem_type *type)
+   unsigned long end, phys_addr_t phys, const struct mem_type *type)
 {
pud_t *pud = pud_offset(pgd, addr);
unsigned long next;
-- 
1.7.9.5

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


[linux-yocto] [PATCH 17/28] arch/arm/mach-axxia: Clear MTC Errors During Initialization

2014-05-02 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

The MTC status registers are not cleared by a reset.  So, clear them
during driver initialization.

Signed-off-by: John Jacques john.jacq...@lsi.com
---
 drivers/misc/lsi-mtc.c |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/lsi-mtc.c b/drivers/misc/lsi-mtc.c
index ebbdac8..8e1ae77 100644
--- a/drivers/misc/lsi-mtc.c
+++ b/drivers/misc/lsi-mtc.c
@@ -2731,6 +2731,7 @@ mtc_dev_ioctl(struct file *filp, unsigned int cmd, 
unsigned long arg)
{
struct ncp_axis_mtc_MTC_CONFIG0_REG_ADDR_r_t cfg0 = { 0 
};
int start_stop;
+
if (copy_from_user
((void *)start_stop, (void *)arg, sizeof(int))) {
printk(KERN_DEBUG MTC Error ioctl\n);
@@ -2740,6 +2741,10 @@ mtc_dev_ioctl(struct file *filp, unsigned int cmd, 
unsigned long arg)
if ((start_stop != 0)  (start_stop != 1))
return -EINVAL;
 
+   /* clear interrupt status before hit start */
+   if (start_stop == 1)
+   dev-regs-int_status = 0x7f;
+
cfg0 =
*((struct ncp_axis_mtc_MTC_CONFIG0_REG_ADDR_r_t *)
  (dev-regs-config0));
@@ -3080,6 +3085,8 @@ static long _mtc_config(struct mtc_device *dev, struct 
lsi_mtc_cfg_t *pMTCCfg)
   dev-regs-config1, dev-regs-execute);
 
 #endif
-   /* test */
+   /* clear ecc interrupt status */
+   dev-regs-ecc_int_status = 0xf;
+
return 0;
 }
-- 
1.7.9.5

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


[linux-yocto] [PATCH 19/28] arm/mach-axxia: Updated PCIe driver to set PCIe

2014-05-02 Thread Charlie Paul
From: Paul Butler paul.but...@windriver.com

 BASE_ADDR1 register

Updated PCIe driver to set PCIe BASE_ADDR1 register to 0x0 without
which PCIe inbound access wasn't working and we were seeing several
suprious PEI interrupts including BAR mismatch interrupt.

Signed-off-by: SangeethaRao sangeetha@lsi.com
Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/arm/mach-axxia/pci.c |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-axxia/pci.c b/arch/arm/mach-axxia/pci.c
index 2600892..49565e8 100644
--- a/arch/arm/mach-axxia/pci.c
+++ b/arch/arm/mach-axxia/pci.c
@@ -667,20 +667,23 @@ static int axxia_pcie_setup(int portno, struct 
pci_sys_data *sys)
 
/* Configure the inbound window size */
inbound_size = (u32) resource_size(port-inbound);
-   writel(inbound_size, port-regs + PCIE_RC_BAR0_SIZE);
+   writel(~(inbound_size-1), port-regs + PCIE_RC_BAR0_SIZE);
 
/* Verify BAR0 size */
{
u32 bar0_size;
writel(~0, port-regs + PCI_BASE_ADDRESS_0);
bar0_size = readl(port-regs + PCI_BASE_ADDRESS_0);
-   if ((bar0_size  ~0xf) != inbound_size)
+   if ((bar0_size  ~0xf) != ~(inbound_size-1))
pr_err(PCIE%d: Config BAR0 failed\n, port-index);
}
 
/* Set the BASE0 address to start of PCIe base */
writel(port-pci_bar, port-regs + PCI_BASE_ADDRESS_0);
 
+   /* Set the BASE1 address to 0x0 */
+   writel(0x0, port-regs + PCI_BASE_ADDRESS_1);
+
/* Setup TPAGE registers for inbound mapping
 *
 * We set the MSB of each TPAGE to select 128-bit AXI access. For the
-- 
1.7.9.5

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


[linux-yocto] [PATCH 10/28] LSI AXM55xx: Enable multi-cluster wfe/sev

2014-05-02 Thread Charlie Paul
From: David Mercado david.merc...@windriver.com

By default, the system does not enable the use of ARM wfe/sev instructions
across clusters, which breaks things like arch_spin_lock. This patch enables
this feature.

LSI AXM55xx: Disable use of wfe/sev in arch_spin_lock

By default, the system does not enable the use of ARM wfe/sev instructions
across clusters, which breaks things like arch_spin_lock. The previous
solution to enable wfe/sev to work across clusters still resulted in CPU
stalls. This patch instead removes the use of wfe/sev in arch/arm/include/
asm/spinlock.h altogether.

Signed-off-by: David Mercado david.merc...@windriver.com
---
 arch/arm/include/asm/spinlock.h |4 
 arch/arm/mach-axxia/axxia.c |1 +
 2 files changed, 5 insertions(+)

diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h
index 65fa3c8..022ef90 100644
--- a/arch/arm/include/asm/spinlock.h
+++ b/arch/arm/include/asm/spinlock.h
@@ -37,6 +37,10 @@
\
nop.w \
 )
+#elif CONFIG_ARCH_AXXIA || CONFIG_ARCH_AXXIA_SIM
+/* 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)
diff --git a/arch/arm/mach-axxia/axxia.c b/arch/arm/mach-axxia/axxia.c
index 7b725ef..d87bb61 100644
--- a/arch/arm/mach-axxia/axxia.c
+++ b/arch/arm/mach-axxia/axxia.c
@@ -253,6 +253,7 @@ l3_set_pstate(void __iomem *l3ctrl, unsigned int req, 
unsigned int act)
 void __init axxia_dt_init(void)
 {
void __iomem *l3ctrl;
+   void __iomem *apb2ser3_base;
int rc;
 
/* Enable L3-cache */
-- 
1.7.9.5

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


[linux-yocto] [PATCH 13/28] ARM: 7499/1: mm: Fix vmalloc overlap check for !HIGHMEM

2014-05-02 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

  commit 36418c516b31bff4ff949c7c618430a1a514debe upstream

  With !HIGHMEM, sanity_check_meminfo checks for banks that completely or
  partially overlap the vmalloc region. The test for partial overlap checks
  __va(bank-start + bank-size)  vmalloc_min. This is not appropriate if
  there is a non-linear translation between virtual and physical addresses,
  as bank-start + bank-size is actually in the bank following the one being
  interrogated.

  In most cases, even when using SPARSEMEM, this is not problematic as the
  subsequent bank will start at a higher va than the one in question. However
  if the physical to virtual address conversion is not monotonic increasing,
  the incorrect test could result in a bank not being truncated when it
  should be.

  This patch ensures we perform the va-pa conversion on memory from the
  bank we are interested in, not the following one.

  Reported-by: ??? (Steve) zhanzhe...@gmail.com
  Signed-off-by: Jonathan Austin jonathan.aus...@arm.com
  Acked-by: Nicolas Pitre n...@linaro.org
  Signed-off-by: Russell King rmk+ker...@arm.linux.org.ukarm/mmu:
   Fix detection of vmalloc area overlap
  Signed-off-by: Anders Berg anders.b...@lsi.com
---
 arch/arm/mm/mmu.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 0acc475..571102e 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -967,8 +967,8 @@ void __init sanity_check_meminfo(void)
 * Check whether this memory bank would partially overlap
 * the vmalloc area.
 */
-   if (__va(bank-start + bank-size)  vmalloc_min ||
-   __va(bank-start + bank-size)  __va(bank-start)) {
+   if (__va(bank-start + bank-size - 1) = vmalloc_min ||
+   __va(bank-start + bank-size - 1) = __va(bank-start)) {
unsigned long newsize = vmalloc_min - __va(bank-start);
printk(KERN_NOTICE Truncating RAM at %.8llx-%.8llx 
   to -%.8llx (vmalloc region overlap).\n,
-- 
1.7.9.5

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


[linux-yocto] [PATCH 16/28] arch/powerpc/sysdev: Fixed PCIe enumeration issue on AXM3500 emulation

2014-05-02 Thread Charlie Paul
From: SangeethaRao sangeetha@lsi.com

Signed-off-by: SangeethaRao sangeetha@lsi.com
---
 arch/powerpc/sysdev/lsi_pci.c |   19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/sysdev/lsi_pci.c b/arch/powerpc/sysdev/lsi_pci.c
index a25d396..75bdf53 100644
--- a/arch/powerpc/sysdev/lsi_pci.c
+++ b/arch/powerpc/sysdev/lsi_pci.c
@@ -20,6 +20,7 @@
 #include mm/mmu_decl.h
 
 #include ppc4xx_pci.h
+#include ../../../drivers/misc/lsi-ncr.h
 
 #include linux/interrupt.h
 
@@ -70,6 +71,7 @@ fixup_acp_pci_bridge(struct pci_dev *dev)
 
 DECLARE_PCI_FIXUP_HEADER(0x1000, 0x5101, fixup_acp_pci_bridge);
 DECLARE_PCI_FIXUP_HEADER(0x1000, 0x5108, fixup_acp_pci_bridge);
+DECLARE_PCI_FIXUP_HEADER(0x1000, 0x5102, fixup_acp_pci_bridge);
 
 static int __init acp_parse_dma_ranges(struct pci_controller *hose,
  void __iomem *reg,
@@ -954,6 +956,7 @@ acp_pciex_port_setup_hose(struct pciex_port *port)
u32 pci_status;
u32 link_state;
u32 pci_config;
+   u32 version;
 
/* Check if primary bridge */
if (of_get_property(port-node, primary, NULL))
@@ -1060,6 +1063,17 @@ acp_pciex_port_setup_hose(struct pciex_port *port)
}
}
 
+   /* get the device version */
+   if (0 != ncr_read(NCP_REGION_ID(0x16, 0xff), 0x0, 4, version)) {
+   printk(KERN_ERR Unable to detect ACP revision!\n);
+   goto fail;
+   }
+
+   port-acpChipType = (version  0xff);
+   printk(KERN_INFO Using PEI register set for ACP chipType %d\n,
+   port-acpChipType);
+
+
/*
 * Set bus numbers on our root port
*/
@@ -1171,11 +1185,6 @@ static void __init probe_acp_pciex_bridge(struct 
device_node *np)
return;
}
 
-
-   port-acpChipType = 0x2;
-   printk(KERN_INFO Using PEI register set for ACP chipType %d\n,
-   port-acpChipType);
-
/* Check for the PLX work-around. */
field = of_get_property(np, plx, NULL);
 
-- 
1.7.9.5

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


[linux-yocto] [PATCH 20/28] LSI AXM55XX: Add PMU support

2014-05-02 Thread Charlie Paul
From: David Mercado david.merc...@windriver.com

This patch adds PMU support to the Axxia AXM55xx platform. Note that
on this platform, all PMU IRQ lines are OR'ed together into a single
IRQ, and therefore, this implementation uses a rotating IRQ affinity
scheme to deal with it.

Signed-off-by: David Mercado david.merc...@windriver.com
---
 arch/arm/kernel/perf_event_v7.c |3 +-
 arch/arm/mach-axxia/axxia-gic.c |   25 --
 arch/arm/mach-axxia/axxia.c |   55 +++
 arch/arm/mach-axxia/include/mach/irqs.h |1 +
 4 files changed, 81 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c
index 7deaa7f..ae7d9d8 100644
--- a/arch/arm/kernel/perf_event_v7.c
+++ b/arch/arm/kernel/perf_event_v7.c
@@ -95,6 +95,7 @@ enum armv7_a5_perf_types {
 
 /* ARMv7 Cortex-A15 specific event types */
 enum armv7_a15_perf_types {
+   ARMV7_A15_PERFCTR_CPU_CYCLES= 0x11,
ARMV7_A15_PERFCTR_L1_DCACHE_ACCESS_READ = 0x40,
ARMV7_A15_PERFCTR_L1_DCACHE_ACCESS_WRITE= 0x41,
ARMV7_A15_PERFCTR_L1_DCACHE_REFILL_READ = 0x42,
@@ -489,7 +490,7 @@ static const unsigned 
armv7_a5_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
  * Cortex-A15 HW events mapping
  */
 static const unsigned armv7_a15_perf_map[PERF_COUNT_HW_MAX] = {
-   [PERF_COUNT_HW_CPU_CYCLES]  = ARMV7_PERFCTR_CPU_CYCLES,
+   [PERF_COUNT_HW_CPU_CYCLES]  = ARMV7_A15_PERFCTR_CPU_CYCLES,
[PERF_COUNT_HW_INSTRUCTIONS]= ARMV7_PERFCTR_INSTR_EXECUTED,
[PERF_COUNT_HW_CACHE_REFERENCES]= 
ARMV7_PERFCTR_L1_DCACHE_ACCESS,
[PERF_COUNT_HW_CACHE_MISSES]= 
ARMV7_PERFCTR_L1_DCACHE_REFILL,
diff --git a/arch/arm/mach-axxia/axxia-gic.c b/arch/arm/mach-axxia/axxia-gic.c
index e5ad304..8a8e8eb 100644
--- a/arch/arm/mach-axxia/axxia-gic.c
+++ b/arch/arm/mach-axxia/axxia-gic.c
@@ -283,6 +283,10 @@ static void gic_mask_irq(struct irq_data *d)
if ((irqid = IPI0_CPU0)  (irqid  MAX_AXM_IPI_NUM))
return;
 
+   /* Don't mess with the PMU IRQ either. */
+   if (irqid == IRQ_PMU)
+   return;
+
/* Deal with PPI interrupts directly. */
if ((irqid  16)  (irqid  32)) {
_gic_mask_irq(d);
@@ -327,6 +331,10 @@ static void gic_unmask_irq(struct irq_data *d)
if ((irqid = IPI0_CPU0)  (irqid  MAX_AXM_IPI_NUM))
return;
 
+   /* Don't mess with the PMU IRQ either. */
+   if (irqid == IRQ_PMU)
+   return;
+
/* Deal with PPI interrupts directly. */
if ((irqid  15)  (irqid  32)) {
_gic_unmask_irq(d);
@@ -565,8 +573,8 @@ static int gic_set_affinity(struct irq_data *d,
 * different than the prior cluster, remove the IRQ affinity
 * on the old cluster.
 */
-   if ((cpu_logical_map(cpu) / CORES_PER_CLUSTER) !=
-   (irq_cpuid[irqid] / CORES_PER_CLUSTER)) {
+   if ((irqid != IRQ_PMU)  ((cpu_logical_map(cpu) / CORES_PER_CLUSTER) !=
+   (irq_cpuid[irqid] / CORES_PER_CLUSTER))) {
/*
 * If old cpu assignment falls within the same cluster as
 * the cpu we're currently running on, set the IRQ affinity
@@ -775,6 +783,11 @@ static void __cpuinit gic_dist_init(struct gic_chip_data 
*gic)
}
 
/*
+* Set the PMU IRQ to the first cpu in this cluster.
+*/
+   writeb_relaxed(0x01, base + GIC_DIST_TARGET + IRQ_PMU);
+
+   /*
 * Set Axxia IPI interrupts to be edge triggered.
 */
for (i = IPI0_CPU0; i  MAX_AXM_IPI_NUM; i++) {
@@ -797,6 +810,14 @@ static void __cpuinit gic_dist_init(struct gic_chip_data 
*gic)
   base + GIC_DIST_ENABLE_SET + enableoff);
}
 
+   /*
+* Do the initial enable of the PMU IRQ here.
+*/
+   enablemask = 1  (IRQ_PMU % 32);
+   enableoff = (IRQ_PMU / 32) * 4;
+   writel_relaxed(enablemask,
+  base + GIC_DIST_ENABLE_SET + enableoff);
+
writel_relaxed(1, base + GIC_DIST_CTRL);
 }
 
diff --git a/arch/arm/mach-axxia/axxia.c b/arch/arm/mach-axxia/axxia.c
index 0e368a4..1c1f20e 100644
--- a/arch/arm/mach-axxia/axxia.c
+++ b/arch/arm/mach-axxia/axxia.c
@@ -46,6 +46,7 @@
 #include asm/mach/time.h
 #include asm/hardware/cache-l2x0.h
 #include asm/hardware/gic.h
+#include asm/pmu.h
 #include mach/hardware.h
 #include mach/timers.h
 #include mach/axxia-gic.h
@@ -178,6 +179,58 @@ static struct of_dev_auxdata axxia_auxdata_lookup[] 
__initdata = {
{}
 };
 
+static struct resource axxia_pmu_resources[] = {
+   [0] = {
+   .start  = IRQ_PMU,
+   .end= IRQ_PMU,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+/*
+ * The PMU IRQ lines of four cores are wired together into a single interrupt.
+ * Bounce the interrupt 

[linux-yocto] [PATCH 11/28] ARM: 7465/1: Handle 4GB memory sizes in device tree and mem=size@start option

2014-05-02 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

commit a5d5f7daa744b34477c4a12728bde0a1694a1707 upstream

The memory regions which are passed to arm_add_memory() from
device tree blobs via early_init_dt_add_memory_arch() can
have sizes which are larger than will fit in a 32 bit integer,
so switch to using a phys_addr_t to hold them, to avoid
silently dropping the top 32 bits of the size. Similarly, use
phys_addr_t in early_mem() so that mem=size@start command line
options specifying more than 4GB behave sensibly.

Acked-by: Will Deacon will.dea...@arm.com
Signed-off-by: Peter Maydell peter.mayd...@linaro.org
Signed-off-by: Russell King rmk+ker...@arm.linux.org.ukarm: Allow =4GB RAM 
to be configured
Signed-off-by: Anders Berg anders.b...@lsi.com
---
 arch/arm/include/asm/setup.h |   14 -
 arch/arm/kernel/setup.c  |   70 +-
 2 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index 23ebc0c..0fbe56d 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -173,14 +173,14 @@ struct tagtable {
int (*parse)(const struct tag *);
 };
 
-#define tag_member_present(tag,member) \
+#define tag_member_present(tag, member)\
((unsigned long)(((struct tag *)0L)-member + 1)   \
= (tag)-hdr.size * 4)
 
 #define tag_next(t)((struct tag *)((__u32 *)(t) + (t)-hdr.size))
 #define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type))  2)
 
-#define for_each_tag(t,base)   \
+#define for_each_tag(t, base)  \
for (t = base; t-hdr.size; t = tag_next(t))
 
 #ifdef __KERNEL__
@@ -196,7 +196,7 @@ static const struct tagtable __tagtable_##fn __tag = { tag, 
fn }
 
 struct membank {
phys_addr_t start;
-   unsigned long size;
+   phys_addr_t size;
unsigned int highmem;
 };
 
@@ -207,17 +207,17 @@ struct meminfo {
 
 extern struct meminfo meminfo;
 
-#define for_each_bank(iter,mi) \
+#define for_each_bank(iter, mi)\
for (iter = 0; iter  (mi)-nr_banks; iter++)
 
 #define bank_pfn_start(bank)   __phys_to_pfn((bank)-start)
 #define bank_pfn_end(bank) __phys_to_pfn((bank)-start + (bank)-size)
 #define bank_pfn_size(bank)((bank)-size  PAGE_SHIFT)
-#define bank_phys_start(bank)  (bank)-start
+#define bank_phys_start(bank)  ((bank)-start)
 #define bank_phys_end(bank)((bank)-start + (bank)-size)
-#define bank_phys_size(bank)   (bank)-size
+#define bank_phys_size(bank)   ((bank)-size)
 
-extern int arm_add_memory(phys_addr_t start, unsigned long size);
+extern int arm_add_memory(phys_addr_t start, phys_addr_t size);
 extern void early_print(const char *str, ...);
 extern void dump_machine_table(void);
 
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 467155b..ad28e29 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -328,7 +328,7 @@ static void __init cacheid_init(void)
cacheid = CACHEID_VIVT;
}
 
-   printk(CPU: %s data cache, %s instruction cache\n,
+   printk(KERN_INFO CPU: %s data cache, %s instruction cache\n,
cache_is_vivt() ? VIVT :
cache_is_vipt_aliasing() ? VIPT aliasing :
cache_is_vipt_nonaliasing() ? PIPT / VIPT nonaliasing : 
unknown,
@@ -358,7 +358,7 @@ void __init early_print(const char *str, ...)
 #ifdef CONFIG_DEBUG_LL
printascii(buf);
 #endif
-   printk(%s, buf);
+   printk(KERN_INFO %s, buf);
 }
 
 static void __init feat_v6_fixup(void)
@@ -419,13 +419,13 @@ void cpu_init(void)
msrcpsr_c, %7
:
: r (stk),
- PLC (PSR_F_BIT | PSR_I_BIT | IRQ_MODE),
+ PLC(PSR_F_BIT | PSR_I_BIT | IRQ_MODE),
  I (offsetof(struct stack, irq[0])),
- PLC (PSR_F_BIT | PSR_I_BIT | ABT_MODE),
+ PLC(PSR_F_BIT | PSR_I_BIT | ABT_MODE),
  I (offsetof(struct stack, abt[0])),
- PLC (PSR_F_BIT | PSR_I_BIT | UND_MODE),
+ PLC(PSR_F_BIT | PSR_I_BIT | UND_MODE),
  I (offsetof(struct stack, und[0])),
- PLC (PSR_F_BIT | PSR_I_BIT | SVC_MODE)
+ PLC(PSR_F_BIT | PSR_I_BIT | SVC_MODE)
: r14);
 }
 
@@ -454,9 +454,10 @@ static void __init setup_processor(void)
 */
list = lookup_processor_type(read_cpuid_id());
if (!list) {
-   printk(CPU configuration botched (ID %08x), unable 
-  to continue.\n, read_cpuid_id());
-   while (1);
+   printk(KERN_INFO CPU configuration botched (ID %08x), unable 
to continue.\n,
+   read_cpuid_id());
+   while (1)
+   ;
}
 
cpu_name = list-cpu_name;
@@ -475,7 +476,7 @@ static void __init setup_processor(void)

[linux-yocto] [PATCH 22/28] LSI: Fix Device Tree compatible fields

2014-05-02 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

The latest boot loader updates the frequency of the clocks in the
device tree; it expects there to be a place to put them.

Fix the device trees for ACP and AXM platforms such that the compatible
field uses the form manufacturer,model.

Signed-off-by: John Jacques john.jacq...@lsi.com
Signed-off-by: David Mercado david.merc...@windriver.com
Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/arm/boot/dts/axm55xx.dts   |4 ++--
 arch/arm/boot/dts/axm55xxemu.dts|   21 +++--
 arch/powerpc/boot/dts/ACP344xV2.dts |   20 ++--
 arch/powerpc/boot/dts/acp25xx.dts   |   16 
 arch/powerpc/boot/dts/acp342x.dts   |   14 +++---
 arch/powerpc/boot/dts/acp344x.dts   |   16 
 6 files changed, 54 insertions(+), 37 deletions(-)

diff --git a/arch/arm/boot/dts/axm55xx.dts b/arch/arm/boot/dts/axm55xx.dts
index f18550b..f0b325d 100644
--- a/arch/arm/boot/dts/axm55xx.dts
+++ b/arch/arm/boot/dts/axm55xx.dts
@@ -232,7 +232,7 @@
};
 
axxia_femac0: femac@0x201012 {
-   compatible = acp-femac;
+   compatible = lsi,acp-femac;
device_type = network;
reg = 0x20 0x1012 0 0x1000,
  0x20 0x10121000 0 0x1000,
@@ -314,7 +314,7 @@
 
USB0: usb@004a4000 {
device_type = usb;
-   compatible = acp-usb;
+   compatible = lsi,acp-usb;
enabled = 0;
reg = 0x20 0x1014 0x0 002,
  0x20 0x10094000 0x0 0002000;
diff --git a/arch/arm/boot/dts/axm55xxemu.dts b/arch/arm/boot/dts/axm55xxemu.dts
index 99d7a70..1b22b33 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
  *
@@ -93,6 +93,23 @@
*/
};
 
+   clocks {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   cpu {
+   frequency = 0; /* Filled in by the boot loader. */
+   };
+
+   peripheral {
+   frequency = 0; /* Filled in by the boot loader. */
+   };
+
+   emmc {
+   frequency = 0; /* Filled in by the boot loader. */
+   };
+   };
+
memory@ {
device_type = memory;
reg = 0 0x 0 0x1000;
@@ -153,7 +170,7 @@
};
 
 axxia_femac0: femac@0x201012 {
-compatible = acp-femac;
+compatible = lsi,acp-femac;
device_type = network;
reg = 0x20 0x1012 0 0x1000,
  0x20 0x10121000 0 0x1000,
diff --git a/arch/powerpc/boot/dts/ACP344xV2.dts 
b/arch/powerpc/boot/dts/ACP344xV2.dts
index 1a4040f..72db6b4 100644
--- a/arch/powerpc/boot/dts/ACP344xV2.dts
+++ b/arch/powerpc/boot/dts/ACP344xV2.dts
@@ -135,7 +135,7 @@
 clock-frequency = 0; // Filled in by zImage
 UART0: serial@00404000 {
 device_type = serial;
-compatible = acp-uart0;
+compatible = lsi,acp-uart0;
 enabled = 0;
 reg = 0x00404000 0x1000;
 clock-reg = 0x00408040 0x20;
@@ -146,7 +146,7 @@
 };
 UART1: serial@00405000 {
 device_type = serial;
-compatible = acp-uart1;
+compatible = lsi,acp-uart1;
 enabled = 0;
 reg = 0x00405000 0x1000;
 clock-reg = 0x00408060 0x20;
@@ -157,7 +157,7 @@
 };
 USB0: usb@004a4000 {
 device_type = usb;
-compatible = acp-usb;
+compatible = lsi,acp-usb;
 enabled = 0;
 reg = 0x004a 0x0002
   0x0040c000 0x1000;
@@ -167,7 +167,7 @@
 I2C: i2c@00403000 {
#address-cells = 1;
#size-cells = 0;
-compatible = acp-i2c;
+compatible = lsi,acp-i2c;
 enabled = 0;
reg = 0x403000 0x1000 0x408020 0x1000;
 interrupt-parent = MPIC;
@@ -182,7 +182,7 @@
#address-cells = 1;
#size-cells = 0;
   

[linux-yocto] [PATCH 18/28] drivers/usb: USB driver/dts on PPC was broken.

2014-05-02 Thread Charlie Paul
From: SangeethaRao sangeetha@lsi.com

Fixed the DTS to have correct entries and updated USB driver
to exclude 55xx relevant code from PPC build

drivers/usb: added a new ehci halt function

New halt function halts the EHCI controller.
This is to be called during startup since spinlocks are not
initialized at that point.

Signed-off-by: SangeethaRao sangeetha@lsi.com
---
 arch/powerpc/boot/dts/acp342x.dts |7 ---
 drivers/usb/host/ehci-ci13612.c   |   30 +-
 2 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/boot/dts/acp342x.dts 
b/arch/powerpc/boot/dts/acp342x.dts
index 4db67df..8e400e3 100644
--- a/arch/powerpc/boot/dts/acp342x.dts
+++ b/arch/powerpc/boot/dts/acp342x.dts
@@ -112,9 +112,10 @@
 };
 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;
 };
diff --git a/drivers/usb/host/ehci-ci13612.c b/drivers/usb/host/ehci-ci13612.c
index b995a32..3badbd8 100644
--- a/drivers/usb/host/ehci-ci13612.c
+++ b/drivers/usb/host/ehci-ci13612.c
@@ -32,6 +32,8 @@
 #include ehci-ci13612.h
 
 
+static int ci13612_ehci_halt(struct ehci_hcd *ehci);
+
 #ifdef CONFIG_LSI_USB_SW_WORKAROUND
 static void ci13612_usb_setup(struct usb_hcd *hcd)
 {
@@ -104,7 +106,7 @@ static int ci13612_ehci_init(struct usb_hcd *hcd)
ehci-sbrn = 0x20;
 
/* Reset is only allowed on a stopped controller */
-   ehci_halt(ehci);
+   ci13612_ehci_halt(ehci);
 
/* reset controller */
ehci_reset(ehci);
@@ -183,8 +185,11 @@ static int ci13612_ehci_run(struct usb_hcd *hcd)
if (retval)
return retval;
 
+
+#ifndef CONFIG_LSI_USB_SW_WORKAROUND
/* Setup AMBA interface to force INCR16 busts when possible */
writel(3, USB_SBUSCFG);
+#endif
 
retval = ehci_run(hcd);
if (retval)
@@ -192,10 +197,12 @@ static int ci13612_ehci_run(struct usb_hcd *hcd)
 
ci13612_fixup_txpburst(ehci);
 
+#ifndef CONFIG_LSI_USB_SW_WORKAROUND
/* Set ITC (bits [23:16]) to zero for interrupt on every micro-frame */
tmp = ehci_readl(ehci, ehci-regs-command);
tmp = 0x;
ehci_writel(ehci, tmp  0x, ehci-regs-command);
+#endif
 
return retval;
 }
@@ -238,6 +245,7 @@ static int ci13612_ehci_probe(struct platform_device *pdev)
 
irq = platform_get_irq(pdev, 0);
if (irq  0) {
+   dev_dbg(pdev-dev, error getting irq number\n);
retval = irq;
goto fail_create_hcd;
}
@@ -255,9 +263,12 @@ static int ci13612_ehci_probe(struct platform_device *pdev)
return -ENODEV;
}
 
+
+#ifndef CONFIG_LSI_USB_SW_WORKAROUND
/* Device using 32-bit addressing */
pdev-dev.coherent_dma_mask = DMA_BIT_MASK(32);
pdev-dev.dma_mask = pdev-dev.coherent_dma_mask;
+#endif
 
hcd = usb_create_hcd(ci13612_hc_driver, pdev-dev,
dev_name(pdev-dev));
@@ -316,6 +327,18 @@ static int ci13612_ehci_remove(struct platform_device 
*pdev)
return 0;
 }
 
+static int ci13612_ehci_halt(struct ehci_hcd *ehci)
+{
+   u32 temp;
+
+   temp = ehci_readl(ehci, ehci-regs-command);
+   temp = ~CMD_RUN;
+   ehci_writel(ehci, temp, ehci-regs-command);
+
+   return handshake(ehci, ehci-regs-status,
+   STS_HALT, STS_HALT, 16 * 125);
+}
+
 MODULE_ALIAS(platform:ci13612-ehci);
 
 static struct of_device_id ci13612_match[] = {
@@ -323,6 +346,10 @@ static struct of_device_id ci13612_match[] = {
.type   = usb,
.compatible = lsi,acp-usb,
},
+   {
+   .type   = usb,
+   .compatible = acp-usb,
+   },
{},
 };
 
@@ -333,4 +360,5 @@ static struct platform_driver ci13612_ehci_driver = {
.name = ci13612-ehci,
.of_match_table = ci13612_match,
},
+
 };
-- 
1.7.9.5

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


[linux-yocto] [PATCH 23/28] powerpc/mpic: Disable preemption when calling mpic_processor_id()

2014-05-02 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

  commit 32dda05f4ec2b854b594bd91590c46c5197d77e1 upstream

  Otherwise, we get a debug traceback due to the use of
  smp_processor_id() (or get_paca()) inside hard_smp_processor_id().
  mpic_host_map() is just looking for a default CPU, so it doesn't matter
  if we migrate after getting the CPU ID.

  Signed-off-by: Scott Wood scottw...@freescale.com
  Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org
  Signed-off-by: John Jacques john.jacq...@lsi.com
---
 arch/powerpc/sysdev/mpic.c |  119 +---
 1 file changed, 68 insertions(+), 51 deletions(-)

diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 9ee7043..a3d7951 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -142,7 +142,7 @@ static u32 mpic_infos[][MPIC_IDX_END] = {
},
 };
 
-#define MPIC_INFO(name) mpic-hw_set[MPIC_IDX_##name]
+#define MPIC_INFO(name) (mpic-hw_set[MPIC_IDX_##name])
 
 #else /* CONFIG_MPIC_WEIRD */
 
@@ -169,7 +169,7 @@ static inline u32 _mpic_read(enum mpic_reg_type type,
 struct mpic_reg_bank *rb,
 unsigned int reg)
 {
-   switch(type) {
+   switch (type) {
 #ifdef CONFIG_PPC_DCR
case mpic_access_dcr:
return dcr_read(rb-dhost, reg);
@@ -183,10 +183,10 @@ static inline u32 _mpic_read(enum mpic_reg_type type,
 }
 
 static inline void _mpic_write(enum mpic_reg_type type,
-  struct mpic_reg_bank *rb,
-  unsigned int reg, u32 value)
+   struct mpic_reg_bank *rb,
+   unsigned int reg, u32 value)
 {
-   switch(type) {
+   switch (type) {
 #ifdef CONFIG_PPC_DCR
case mpic_access_dcr:
dcr_write(rb-dhost, reg, value);
@@ -213,7 +213,8 @@ static inline u32 _mpic_ipi_read(struct mpic *mpic, 
unsigned int ipi)
return _mpic_read(type, mpic-gregs, offset);
 }
 
-static inline void _mpic_ipi_write(struct mpic *mpic, unsigned int ipi, u32 
value)
+static inline void _mpic_ipi_write(struct mpic *mpic,
+   unsigned int ipi, u32 value)
 {
unsigned int offset = MPIC_INFO(GREG_IPI_VECTOR_PRI_0) +
  (ipi * MPIC_INFO(GREG_IPI_STRIDE));
@@ -250,14 +251,16 @@ static inline u32 _mpic_cpu_read(struct mpic *mpic, 
unsigned int reg)
return _mpic_read(mpic-reg_type, mpic-cpuregs[cpu], reg);
 }
 
-static inline void _mpic_cpu_write(struct mpic *mpic, unsigned int reg, u32 
value)
+static inline void _mpic_cpu_write(struct mpic *mpic,
+   unsigned int reg, u32 value)
 {
unsigned int cpu = mpic_processor_id(mpic);
 
_mpic_write(mpic-reg_type, mpic-cpuregs[cpu], reg, value);
 }
 
-static inline u32 _mpic_irq_read(struct mpic *mpic, unsigned int src_no, 
unsigned int reg)
+static inline u32 _mpic_irq_read(struct mpic *mpic,
+   unsigned int src_no, unsigned int reg)
 {
unsigned intisu = src_no  mpic-isu_shift;
unsigned intidx = src_no  mpic-isu_mask;
@@ -289,16 +292,16 @@ static inline void _mpic_irq_write(struct mpic *mpic, 
unsigned int src_no,
 #endif
 }
 
-#define mpic_read(b,r) _mpic_read(mpic-reg_type,(b),(r))
-#define mpic_write(b,r,v)  _mpic_write(mpic-reg_type,(b),(r),(v))
-#define mpic_ipi_read(i)   _mpic_ipi_read(mpic,(i))
-#define mpic_ipi_write(i,v)_mpic_ipi_write(mpic,(i),(v))
-#define mpic_tm_read(i)_mpic_tm_read(mpic,(i))
-#define mpic_tm_write(i,v) _mpic_tm_write(mpic,(i),(v))
-#define mpic_cpu_read(i)   _mpic_cpu_read(mpic,(i))
-#define mpic_cpu_write(i,v)_mpic_cpu_write(mpic,(i),(v))
-#define mpic_irq_read(s,r) _mpic_irq_read(mpic,(s),(r))
-#define mpic_irq_write(s,r,v)  _mpic_irq_write(mpic,(s),(r),(v))
+#define mpic_read(b, r)_mpic_read(mpic-reg_type, (b), (r))
+#define mpic_write(b, r, v)_mpic_write(mpic-reg_type, (b), (r), (v))
+#define mpic_ipi_read(i)   _mpic_ipi_read(mpic, (i))
+#define mpic_ipi_write(i, v)   _mpic_ipi_write(mpic, (i), (v))
+#define mpic_tm_read(i)_mpic_tm_read(mpic, (i))
+#define mpic_tm_write(i, v)_mpic_tm_write(mpic, (i), (v))
+#define mpic_cpu_read(i)   _mpic_cpu_read(mpic, (i))
+#define mpic_cpu_write(i, v)   _mpic_cpu_write(mpic, (i), (v))
+#define mpic_irq_read(s, r)_mpic_irq_read(mpic, (s), (r))
+#define mpic_irq_write(s, r, v)_mpic_irq_write(mpic, (s), (r), (v))
 
 
 /*
@@ -333,7 +336,7 @@ static inline void mpic_map(struct mpic *mpic,
_mpic_map_mmio(mpic, phys_addr, rb, offset, size);
 }
 #else /* CONFIG_PPC_DCR */
-#define mpic_map(m,p,b,o,s)_mpic_map_mmio(m,p,b,o,s)
+#define mpic_map(m, p, b, o, s)_mpic_map_mmio(m, p, b, o, s)
 #endif /* !CONFIG_PPC_DCR */
 
 
@@ -345,7 +348,8 @@ static void __init mpic_test_broken_ipi(struct mpic *mpic)
 {
u32 r;
 
-  

[linux-yocto] [PATCH 25/28] drivers/i2c-axxia: Support I2C_M_RECV_LEN

2014-05-02 Thread Charlie Paul
From: Anders Berg anders.b...@lsi.com

Add support for the I2C_M_RECV_LEN flag to enable SMBus block data transfers.

scripts/setlocalversion strips out the tag if there is a match
since the Linux version is in Makefile.  Without the tag information,
there is no way to get back to the specific tag used in defect
reports etc.  This patch adds, in the LSI Axxia case, the lsi tag.

Add a timeout condition to the soft reset code.

Currently this will time out when running on simulator since it fails to clear
the soft reset bit.

Signed-off-by: John Jacques john.jacq...@lsi.com
Signed-off-by: Anders Berg anders.b...@lsi.com
---
 drivers/i2c/busses/i2c-axxia.c |  193 +---
 scripts/setlocalversion|8 ++
 2 files changed, 130 insertions(+), 71 deletions(-)

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index 8061998..519cda7 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -27,7 +27,8 @@
 #include linux/module.h
 
 #define SCL_WAIT_TIMEOUT_NS 2500
-#define I2C_TIMEOUT (msecs_to_jiffies(1000))
+#define I2C_XFER_TIMEOUT(msecs_to_jiffies(500))
+#define I2C_STOP_TIMEOUT(msecs_to_jiffies(100))
 #define TX_FIFO_SIZE8
 #define RX_FIFO_SIZE8
 
@@ -123,12 +124,10 @@ struct axxia_i2c_dev {
int irq;
/* xfer completion object */
struct completion msg_complete;
-   /* pointer to current message data */
-   u8 *msg_buf;
-   /* size of unsent data in the message buffer */
-   size_t msg_buf_remaining;
-   /* identifies read transfers */
-   int msg_read;
+   /* pointer to current message */
+   struct i2c_msg *msg;
+   /* number of bytes transferred in msg */
+   size_t msg_xfrd;
/* error code for completed message */
int msg_err;
/* current i2c bus clock rate */
@@ -168,10 +167,21 @@ axxia_i2c_init(struct axxia_i2c_dev *idev)
u32 t_setup;
u32 tmo_clk;
u32 prescale;
+   unsigned long timeout;
 
dev_dbg(idev-dev, rate=%uHz per_clk=%uMHz - ratio=1:%u\n,
idev-bus_clk_rate, clk_mhz, divisor);
 
+   /* Reset controller */
+   writel(0x01, idev-regs-soft_reset);
+   timeout = jiffies + msecs_to_jiffies(100);
+   while (readl(idev-regs-soft_reset)  1) {
+   if (time_after(jiffies, timeout)) {
+   dev_warn(idev-dev, Soft reset failed\n);
+   break;
+   }
+   }
+
/* Enable Master Mode */
writel(0x1, idev-regs-global_control);
 
@@ -186,8 +196,8 @@ axxia_i2c_init(struct axxia_i2c_dev *idev)
 
/* SDA Setup Time */
writel(t_setup, idev-regs-sda_setup_time);
-   /* SDA Hold Time, 5ns */
-   writel(ns_to_clk(5, clk_mhz), idev-regs-sda_hold_time);
+   /* SDA Hold Time, 300ns */
+   writel(ns_to_clk(300, clk_mhz), idev-regs-sda_hold_time);
/* Filter 50ns spikes */
writel(ns_to_clk(50, clk_mhz), idev-regs-spike_fltr_len);
 
@@ -228,15 +238,40 @@ axxia_i2c_init(struct axxia_i2c_dev *idev)
 }
 
 static int
-axxia_i2c_empty_rx_fifo(struct axxia_i2c_dev *idev)
+i2c_m_rd(const struct i2c_msg *msg)
 {
-   size_t rx_fifo_avail = readl(idev-regs-mst_rx_fifo);
-   int bytes_to_transfer = min(rx_fifo_avail, idev-msg_buf_remaining);
+   return (msg-flags  I2C_M_RD) != 0;
+}
 
-   idev-msg_buf_remaining -= bytes_to_transfer;
+static int
+i2c_m_recv_len(const struct i2c_msg *msg)
+{
+   return (msg-flags  I2C_M_RECV_LEN) != 0;
+}
 
-   while (0  bytes_to_transfer--)
-   *idev-msg_buf++ = readl(idev-regs-mst_data);
+static int
+axxia_i2c_empty_rx_fifo(struct axxia_i2c_dev *idev)
+{
+   struct i2c_msg *msg = idev-msg;
+   size_t rx_fifo_avail = readl(idev-regs-mst_rx_fifo);
+   int bytes_to_transfer = min(rx_fifo_avail, msg-len - idev-msg_xfrd);
+
+   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) {
+   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;
+   }
+   msg-len += c;
+   writel(msg-len, idev-regs-mst_rx_xfer);
+   }
+   msg-buf[idev-msg_xfrd++] = c;
+   }
 
return 0;
 }
@@ -244,18 +279,16 @@ axxia_i2c_empty_rx_fifo(struct axxia_i2c_dev *idev)
 static int
 axxia_i2c_fill_tx_fifo(struct axxia_i2c_dev *idev)
 {
+   struct i2c_msg *msg = idev-msg;
size_t tx_fifo_avail = TX_FIFO_SIZE - readl(idev-regs-mst_tx_fifo);
-   int 

[linux-yocto] [PATCH 28/28] axxia: Remove Wrapper Functions

2014-05-02 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

These functions were temporary.  They were added to allow
development to continue on an external module that was not,
at the time, released under the GPL.

Signed-off-by: John Jacques john.jacq...@lsi.com
Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/arm/mach-axxia/Makefile   |1 -
 arch/arm/mach-axxia/wrappers.c |  140 
 arch/powerpc/sysdev/Makefile   |2 -
 arch/powerpc/sysdev/lsi_acp_wrappers.c |  132 --
 4 files changed, 275 deletions(-)
 delete mode 100644 arch/arm/mach-axxia/wrappers.c
 delete mode 100644 arch/powerpc/sysdev/lsi_acp_wrappers.c

diff --git a/arch/arm/mach-axxia/Makefile b/arch/arm/mach-axxia/Makefile
index 85cee8f..47e386b 100644
--- a/arch/arm/mach-axxia/Makefile
+++ b/arch/arm/mach-axxia/Makefile
@@ -1,7 +1,6 @@
 #
 # Makefile for the linux kernel.
 #
-obj-y   += wrappers.o
 obj-y  += axxia.o
 obj-y  += clock.o
 obj-y   += io.o
diff --git a/arch/arm/mach-axxia/wrappers.c b/arch/arm/mach-axxia/wrappers.c
deleted file mode 100644
index 4d49825..000
--- a/arch/arm/mach-axxia/wrappers.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * arch/arm/mach-axxia/wrappers.c
- *
- * Copyright (C) 2013 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 linux/module.h
-#include asm/irq.h
-#include linux/io.h
-#include linux/irqdomain.h
-#include linux/skbuff.h
-#include linux/platform_device.h
-
-/*
-  
==
-  
==
-  MDIO
-  
==
-  
==
-*/
-
-/*
-  
==
-  
==
-  Platform Device Registration
-  
==
-  
==
-*/
-
-/*
-  
--
-  acp_platform_device_register
-*/
-
-int
-acp_platform_device_register(struct platform_device *pdev)
-{
-   return platform_device_register(pdev);
-}
-EXPORT_SYMBOL(acp_platform_device_register);
-
-/*
-  
--
-  acp_platform_device_unregister
-*/
-
-void
-acp_platform_device_unregister(struct platform_device *pdev)
-{
-   platform_device_unregister(pdev);
-
-   return;
-}
-EXPORT_SYMBOL(acp_platform_device_unregister);
-
-/*
-  
-  
-  SKB
-  
-  
-*/
-
-/*
-  
-  acp_skb_tstamp_tx
-*/
-
-void
-acp_skb_tstamp_tx(struct sk_buff *orig_skb,
- struct skb_shared_hwtstamps *hwtstamps) {
-   skb_tstamp_tx(orig_skb, hwtstamps);
-}
-EXPORT_SYMBOL(acp_skb_tstamp_tx);
-
-/*
-  
-  
-  Interrupts
-  
-  
-*/
-
-/*
- * -
- * acp_irq_create_mapping
- */
-unsigned int acp_irq_create_mapping(struct irq_domain *host,
-   irq_hw_number_t hwirq)
-{
-   unsigned int mapped_irq;
-
-   preempt_disable();
-   mapped_irq = irq_create_mapping(host, hwirq);
-   

[linux-yocto] [PATCH 27/28] LSI AXM55XX/rapidio: Stability and bug fix improvements , Correct boundary, Expand valid condition.

2014-05-02 Thread Charlie Paul
From: Michael Bringmann michael.bringm...@lsi.com

Add additional spinlocks/mutexes to each controller state to increase
concurrency and performance.  Fix some bound checks for full outbound
DME descriptor chains, correct a lockup/delay issue with errors in the
outbound DME chains, and remove a delay loop.

rapidio/LSI AXM55xx: Correct some boundary checks for argument values.

Also correct formatting of platform-specific function code.

LSI AXM55xx: Expand valid condition checks for inbound message DME chains.

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 arch/arm/include/asm/axxia-rio.h|   31 --
 drivers/rapidio/devices/lsi/axxia-rio-ds.c  |   22 ++--
 drivers/rapidio/devices/lsi/axxia-rio-irq.c |  156 ---
 drivers/rapidio/devices/lsi/axxia-rio-irq.h |   13 +--
 drivers/rapidio/devices/lsi/axxia-rio.c |3 +-
 drivers/rapidio/devices/lsi/axxia-rio.h |   16 ++-
 6 files changed, 101 insertions(+), 140 deletions(-)

diff --git a/arch/arm/include/asm/axxia-rio.h b/arch/arm/include/asm/axxia-rio.h
index e01d6a3..492d476 100644
--- a/arch/arm/include/asm/axxia-rio.h
+++ b/arch/arm/include/asm/axxia-rio.h
@@ -94,21 +94,32 @@ static inline u32 CNTLZW(u32 val)
int n = 0;
if (val == 0)
return 32;
-   if ((val  0x) == 0)
-   n += 16; val = val  16;
+
+   if ((val  0x) == 0) {
+   n += 16;
+   val = val  16;
+   }
/*        
// 16 bits from left are zero! so we omit 16 left bits */
-   if ((val  0xFF00) == 0)
-   n = n + 8; val = val  8;
+   if ((val  0xFF00) == 0) {
+   n = n + 8;
+   val = val  8;
+   }
/* 8 left bits are 0 */
-   if ((val  0xF000) == 0)
-   n = n + 4; val = val  4;
+   if ((val  0xF000) == 0) {
+   n = n + 4;
+   val = val  4;
+   }
/* 4 left bits are 0 */
-   if ((val  0xC000) == 0)
-   n = n + 2, val = val  2;
+   if ((val  0xC000) == 0) {
+   n = n + 2;
+   val = val  2;
+   }
/* 110 2 left bits are zero */
-   if ((val  0x8000) == 0)
-   n = n + 1, val = val  1;
+   if ((val  0x8000) == 0) {
+   n = n + 1;
+   val = val  1;
+   }
/* first left bit is zero */
return n;
 }
diff --git a/drivers/rapidio/devices/lsi/axxia-rio-ds.c 
b/drivers/rapidio/devices/lsi/axxia-rio-ds.c
index f4f44a6..02d3751 100755
--- a/drivers/rapidio/devices/lsi/axxia-rio-ds.c
+++ b/drivers/rapidio/devices/lsi/axxia-rio-ds.c
@@ -240,9 +240,10 @@ int axxia_open_ob_data_stream(
int num_header_entries,
int num_data_entries)
 {
+   struct rio_priv *priv = mport-priv;
int rc = 0;
 
-   axxia_api_lock();
+   axxia_api_lock(priv);
 
rc = open_ob_data_stream(mport,
dev_id,
@@ -250,7 +251,7 @@ int axxia_open_ob_data_stream(
num_header_entries,
num_data_entries);
 
-   axxia_api_unlock();
+   axxia_api_unlock(priv);
 
return rc;
 }
@@ -747,12 +748,12 @@ int axxia_close_ob_data_stream(
struct rio_ds_hdr_desc  *ptr_hdr_desc;
u32dse_ctrl, i;
 
-   axxia_api_lock();
+   axxia_api_lock(priv);
 
ptr_dse_cfg = (ptr_ds_priv-obds_dse_cfg[dse_id]);
 
if (ptr_dse_cfg-in_use == RIO_DS_FALSE) {
-   axxia_api_unlock();
+   axxia_api_unlock(priv);
return 0;
}
 
@@ -791,7 +792,7 @@ int axxia_close_ob_data_stream(
/* release the IRQ handler */
release_irq_handler((ptr_ds_priv-ob_dse_irq[dse_id]));
 
-   axxia_api_unlock();
+   axxia_api_unlock(priv);
 
return 0;
 }
@@ -830,9 +831,10 @@ int axxia_open_ib_data_stream(
int desc_dbuf_size,
int num_entries)
 {
+   struct rio_priv *priv = mport-priv;
int rc = 0;
 
-   axxia_api_lock();
+   axxia_api_lock(priv);
 
rc = open_ib_data_stream(mport,
 dev_id,
@@ -840,7 +842,7 @@ int axxia_open_ib_data_stream(
 cos,
 desc_dbuf_size,
 num_entries);
-   axxia_api_unlock();
+   axxia_api_unlock(priv);
 
return rc;
 }
@@ -1522,7 +1524,7 @@ int axxia_close_ib_data_stream(
struct rio_ids_data_desc *ptr_data_desc;
u8  virt_vsid;
 
-   axxia_api_lock();
+   axxia_api_lock(priv);
 
for (i = 0; i  (ptr_ds_priv-num_ibds_virtual_m); i++) {
ptr_virt_m_cfg = (ptr_ds_priv-ibds_vsid_m_cfg[i]);
@@ 

[linux-yocto] [PATCH 20/28] LSI sysdev/pci: Removing the power of 2 size restriction

2014-05-02 Thread Charlie Paul
From: SangeethaRao sangeetha@lsi.com

This patch removes the power of 2 size restriction
for PCIe inbound mapping in LSI PCIe driver

Signed-off-by: SangeethaRao sangeetha@lsi.com
---
 arch/powerpc/sysdev/lsi_pci.c |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/sysdev/lsi_pci.c b/arch/powerpc/sysdev/lsi_pci.c
index 75bdf53..f485343 100644
--- a/arch/powerpc/sysdev/lsi_pci.c
+++ b/arch/powerpc/sysdev/lsi_pci.c
@@ -114,8 +114,9 @@ static int __init acp_parse_dma_ranges(struct 
pci_controller *hose,
 * within 32 bits space
 */
if (cpu_addr != 0 || pci_addr  0x) {
-   printk(KERN_WARNING %s: Ignored unsupported dma range
-   0x%016llx...0x%016llx - 0x%016llx\n,
+   printk(KERN_WARNING %s: Ignored unsupported \
+   dma range\
+   0x%016llx...0x%016llx - 0x%016llx\n,\
   hose-dn-full_name,
   pci_addr, pci_addr + size - 1, cpu_addr);
continue;
@@ -148,15 +149,14 @@ static int __init acp_parse_dma_ranges(struct 
pci_controller *hose,
 * DMA bounce buffers
 */
if (size  total_memory) {
-   printk(KERN_ERR %s: dma-ranges too small 
-  (size=%llx total_memory=%llx)\n,
+   printk(KERN_ERR %s: dma-ranges too small \
+  (size=%llx total_memory=%llx)\n,\
   hose-dn-full_name, size, (u64)total_memory);
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) {
printk(KERN_ERR %s: dma-ranges unaligned\n,
   hose-dn-full_name);
return -ENXIO;
@@ -288,7 +288,7 @@ static int acp_pciex_validate_bdf(struct pciex_port *port,
/* Check we are within the mapped range */
if (bus-number  port-hose-last_busno) {
if (!message) {
-   printk(KERN_WARNING Warning! Probing bus %u
+   printk(KERN_WARNING Warning! Probing bus %u\
out of range !\n, bus-number);
message++;
}
-- 
1.7.9.5

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


[linux-yocto] [PATCH 22/28] arch/powerpc: Updated the UART Driver to Support 3500

2014-05-02 Thread Charlie Paul
From: John Jacques john.jacq...@lsi.com

Added code to support the UART on the 3500 board

Signed-off-by: John Jacques john.jacq...@lsi.com
---
 drivers/tty/serial/lsi_acp_serial.c |   94 +++
 1 file changed, 51 insertions(+), 43 deletions(-)

diff --git a/drivers/tty/serial/lsi_acp_serial.c 
b/drivers/tty/serial/lsi_acp_serial.c
index a41eab2..0f9f7ce 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;
 }
@@ -1135,6 +1098,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 = per_clock / 2500;
+   per_clock = 2500;
+   } else {
+   /* Emulation is much slower... */
+   divisor = per_clock / 325;
+   per_clock = 325;
+   }
+
+   --divisor;
+
+   if (divisor != in_le32(uap-timer_base + TIMER_LOAD)) {
+   while (0 ==
+  (in_le32((const volatile unsigned *)
+   (uap-port.membase + UART01x_FR)) 
+   UART011_FR_TXFE))
+   ;
+
+   while (0 !=
+  (in_le32((const volatile unsigned *)
+   (uap-port.membase + UART01x_FR)) 
+   UART01x_FR_BUSY))
+   ;
+
+   out_le32((uap-timer_base + TIMER_CONTROL), 0);
+   out_le32((uap-timer_base + TIMER_LOAD), divisor);
+   out_le32((uap-timer_base + TIMER_CONTROL),
+(TIMER_CONTROL_ENABLE |
+ TIMER_CONTROL_MODE));
+   }

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

2014-05-02 Thread Charlie Paul
From: David Mercado david.merc...@windriver.com

Fix irq_set_affinity() to allow usage of buslocks with slow bus
IRQ controllers, such as the LSI Axxia GIC.

Signed-off-by: David Mercado david.merc...@windriver.com
---
 kernel/irq/manage.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index c891fe3..4291484 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -180,16 +180,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;
 }
 
-- 
1.7.9.5

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


  1   2   3   >