[linux-yocto] [PATCH 00/87] New standard/lsi branch - linux-yocto_3.4

2013-05-27 Thread Paul Butler
Creating a new branch in linux-yocto_3.4 for tracking LSI BSP changes.
Branched from standard/base at commit fff57da7886cf5e99c07adf6649610cb1cd89330

Benjamin Herrenschmidt (1):
  powerpc/mpic: Create a revmap with enough entries for IPIs and timers

David Mercado (4):
  LSI axm55xx: Add multi-cluster support for up to 16 cores
  LSI axm55xx: Fix boot issues with PREMPT_RT kernel
  LSI axm55xx: Add ability to parse specific core numbers in the DTB
  LSI acp34xx: Fixed build error in acp34xx serial driver

Fredrik Markstr (1):
  usb/host/ehci-ci13612: stop accessing the secondary register space

Jiang Lu (27):
  arch/arm: Updating Kconfig and Makefile for axxia
  arch/arm/tools/mach-types: adding axxia in the  mach-types
  ppc/47x: add cputable entries for ACP 34xx
  powerpc/47x: add acpx1 board support
  ACP34xx:Fix a few mismatch section warnings
  powerpc/acp34xx: add clk_get/_rate support for acp board
  LSI:ACP34xx:standardize debug macro
  lsi/ncr: add support to read/write access to configuration ring
resources
  lsi/nand: add acp3400 nand flash controller support
  lsi/ubootenv: add read access to the uboot env
  lsi/nand:Use EP501G1_NAND_1BIT_ECC0_STATUS to check HW ECC
  tty:ACP serial:extract clock freq from device tree
  kgdboc, acp serial: rx polling hook for the acp_serial driver
  drivers/dma: Add Common LSI-DMA driver for ACP34xx and AXM55xx.
  PowerPC:ACP34xx:Add app350 i2c controller driver
  SPI:pl022:Update driver to support of-platform drivers
  PowerPC:ACP34xx:Add SPI at25 eeprom support
  powerpc/4xx: add support for the PCIe controller on ACP34xx
  drivers/net: Added support for acp network driver
  net/acp: add the netpoll support for acp device
  LSI:NIC:Using default value when ubootenv driver not present
  powerpc/47x: Kernel support for KEXEC
  powerpc/44x: kexec for SMP 47x
  GPIO:pl061:Update driver to support of-platform drivers
  PowerPC:ACP34xx:Add support for pl061 gpio driver
  ACP34xx:Add device tree for ACP344x v2 board
  Acp34xx:disable device when enabled set to 0 in dts

John Jacques (7):
  arm/boot: Boot loader emulation code for AXM5516.
  arm/dts: add dts for LSI AXM5516 simulation and emulation/asic.
  arm/boot: change target name
  arm/boot: Updates for Emulation Bringup.
  arm/boot: Fix the problem with device tree loading in emulation
  arm/boot: add earlyprintk in the bootargs
  arm/boot: Use supersections for the early page table in the armv7 case

Kevin Hao (7):
  usb/ehci-ci13612: add support for ci13612 host controller
  usb/ehci-ci13612: use the of match method to probe the hcd
  usb/ehci-ci13612: use dynamic virtual address to map the hcd registers
  ppc/476: workaround for erratum #40 on dd2 core
  powerpc/44x: allow the kernel to be run from a non-zero physical
address
  powerpc/acpx1: add early debug support for acpx1 board
  powerpc/acpx1: make udbg do IO access in AS1

Michael Bringmann (9):
  drivers/i2c/ai2c: add dts support in the driver
  mach-axxia/i2c: fix editing typo.
  mach-axxia/i2c: remove unnecessary code
  arm/dts: add configurations for I2C busses
  mach-axxia/i2c: fix i2c platform data structure
  drivers/i2c/ai2c: add more dtb support
  drivers/i2c/ai2c: remove acp34xx from Makefile
  drivers/i2c/ai2c: Remove references to outdated types
  drivers/i2c/ai2c: Fix compile warning about unneeded label

Paul Butler (23):
  drivers/leds: Added support for RBS leds
  drivers/hwmon: add support for Analog Devices ADT75
  drivers/i2c/busses: adding ai2c driver
  drivers/usb/host/ehci-ci13612.c: replaced bugzilla comments
  drivers/usb/host/ehci-ci13612.c: fix a burst size issue
  fs/vmfs: adding arm vmfs patch
  arch/arm/boot/dts: adding new dts files
  arch/arm/boot/fmboot: adding support for Fast Models
  arch/arm/mach-axxia: adding mach-axxia support
  arch/arm/mach-axxia/axxia.c: Chip select control for SPI devices.
  arch/arm/mach-axxia/Makefile: adding i2c
  arch/arm/mm: proc-v7-2level.S and 3level - checking coherent walk bits
  arch/arm/mach-axxia: adding i2c code
  include/linux/i2c-axxia.h: added missing file to fix build bug
  arch/arm/mach-axxia: fixed section mismatch warnings
  arch/arm/mach-axxia: pci.c fixes incorrect device reference
  arm/asm/io.h: let ioremap() fall back to platform specific one
  drivers/tty: Add support for lsi acp serial driver and console
  drivers/usb: ehci-ci13612.c replaced hard-coded address and irq to use
dtb
  drivers/crypto/amcc/crypto4xx_core.c: added include for linux/module.h
  LSI acp34xx: Major rework of lsi_acp_net.c Ethernet driver
  drivers/crypto/amcc: removed section mismatch warning
  powerpc: fix section mismatch warnings

SangeethaRao (2):
  arm/dts: updating PCIe related files for TPAGE and BAR0
  arm/dts: updated for PCIe node name

Suzuki Poulose (1):
  powerpc/47x: Enable CRASH_DUMP

Wang Hui (2):
  drivers/i2c/ai2c: remove default y from Kconfig
  arm: fmboot: make the fmboot image

Wei Yang (2):
  powerpc/44x: Fix/Initialize PID to kernel PID before the TLB 

[linux-yocto] [PATCH 05/87] usb/ehci-ci13612: use the of match method to probe the hcd

2013-05-27 Thread Paul Butler
From: Kevin Hao kexin@windriver.com

The of platform has already registered ehci host controller
as a platform device. We can probe this device correctly by
just adding the corresponding of match table. Also move the
codes which check whether the ehci is enabled to the ci13612
specific file.

Signed-off-by: Kevin Hao kexin@windriver.com
---
 drivers/usb/host/ehci-ci13612.c | 16 
 drivers/usb/host/ehci-hcd.c | 39 ---
 2 files changed, 16 insertions(+), 39 deletions(-)

diff --git a/drivers/usb/host/ehci-ci13612.c b/drivers/usb/host/ehci-ci13612.c
index 09fd1c3..76919aa 100644
--- a/drivers/usb/host/ehci-ci13612.c
+++ b/drivers/usb/host/ehci-ci13612.c
@@ -23,6 +23,7 @@
 
 #include linux/platform_device.h
 #include linux/irq.h
+#include linux/of_platform.h
 #include ehci-ci13612.h
 
 
@@ -145,8 +146,14 @@ static int ci13612_ehci_probe(struct platform_device *pdev)
void __iomem *gpreg_base = (void __iomem *) 0xF000C000;
int irq;
int retval;
+   struct device_node *np = pdev-dev.of_node;
+   const int *enabled;
 
 
+   enabled = of_get_property(np, enabled, NULL);
+   if (!enabled || !*enabled)
+   return -ENODEV;
+
if (usb_disabled())
return -ENODEV;
 
@@ -204,10 +211,19 @@ static int ci13612_ehci_remove(struct platform_device 
*pdev)
 
 MODULE_ALIAS(platform:ci13612-ehci);
 
+static struct of_device_id ci13612_match[] = {
+   {
+   .type   = usb,
+   .compatible = acp-usb,
+   },
+   {},
+};
+
 static struct platform_driver ci13612_ehci_driver = {
.probe = ci13612_ehci_probe,
.remove = ci13612_ehci_remove,
.driver = {
.name = ci13612-ehci,
+   .of_match_table = ci13612_match,
},
 };
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index c05a245..6bdfc8d 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1396,42 +1396,10 @@ MODULE_LICENSE (GPL);
 #error missing bus glue for ehci-hcd
 #endif
 
-static void ci13612_device_release(struct device *dev)
-{
-}
-
-static struct platform_device ci13612_device = {
-   .name   = ci13612-ehci,
-   .id = -1,
-   .dev= {
-   .release = ci13612_device_release,
-   },
-};
-
 static int __init ehci_hcd_init(void)
 {
int retval = 0;
 
-#ifdef CONFIG_ACP
-
-   struct device_node *np = NULL;
-   int *enabled;
-
-   np = of_find_node_by_type(np, usb);
-
-   while (np  !of_device_is_compatible(np, acp-usb))
-   np = of_find_node_by_type(np, usb);
-
-   if (np)
-   enabled = of_get_property(np, enabled, NULL);
-   else
-   return -ENODEV;
-
-   if ((NULL == *enabled) || (0 == *enabled))
-   return -ENODEV;
-
-#endif
-
if (usb_disabled())
return -ENODEV;
 
@@ -1479,10 +1447,6 @@ static int __init ehci_hcd_init(void)
goto clean3;
 #endif
 
-   retval = platform_device_register(ci13612_device);
-   if (retval  0)
-   goto err_device_register;
-
 #ifdef XILINX_OF_PLATFORM_DRIVER
retval = platform_driver_register(XILINX_OF_PLATFORM_DRIVER);
if (retval  0)
@@ -1490,7 +1454,6 @@ static int __init ehci_hcd_init(void)
 #endif
return retval;
 
-err_device_register:
 #ifdef XILINX_OF_PLATFORM_DRIVER
/* platform_driver_unregister(XILINX_OF_PLATFORM_DRIVER); */
 clean4:
@@ -1524,8 +1487,6 @@ module_init(ehci_hcd_init);
 static void __exit ehci_hcd_cleanup(void)
 {
 
-platform_device_unregister(ci13612_device);
-
 #ifdef XILINX_OF_PLATFORM_DRIVER
platform_driver_unregister(XILINX_OF_PLATFORM_DRIVER);
 #endif
-- 
1.8.3

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


[linux-yocto] [PATCH 07/87] usb/host/ehci-ci13612: stop accessing the secondary register space

2013-05-27 Thread Paul Butler
From: Fredrik Markstr fredrik.markst...@gmail.com

Don't make the second register area mandatory, since we don't have it
in our on boards dts yet.

Signed-off-by: Fredrik Markstr fredrik.markst...@gmail.com
---
 drivers/usb/host/ehci-ci13612.c | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/host/ehci-ci13612.c b/drivers/usb/host/ehci-ci13612.c
index 7215c79..5d3a6bc 100644
--- a/drivers/usb/host/ehci-ci13612.c
+++ b/drivers/usb/host/ehci-ci13612.c
@@ -187,17 +187,19 @@ static int ci13612_ehci_probe(struct platform_device 
*pdev)
goto fail_put_hcd;
}
 
+   /* FIXME: This reported error since we don't have a second register
+ *  area defined in our dtb. Should we add it or stay backwards 
compatible ?
+ */
gpreg_base = of_iomap(np, 1);
if (!gpreg_base) {
-   dev_err(pdev-dev, of_iomap error\n);
-   retval = -ENOMEM;
-   goto fail_unmap;
+   dev_warn(pdev-dev, of_iomap error can't map region 1\n);
}
+   else {
+   /* Setup GPREG for USB to enable the 6-bit address line */
+   writel(0x0, gpreg_base + 0x8);
 
-   /* Setup GPREG for USB to enable the 6-bit address line */
-   writel(0x0, gpreg_base + 0x8);
-
-   iounmap(gpreg_base);
+   iounmap(gpreg_base);
+   }
 
retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (retval == 0) {
@@ -205,7 +207,6 @@ static int ci13612_ehci_probe(struct platform_device *pdev)
return retval;
}
 
-fail_unmap:
iounmap(hcd-regs);
 fail_put_hcd:
usb_put_hcd(hcd);
-- 
1.8.3

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


[linux-yocto] [PATCH 08/87] drivers/usb/host/ehci-ci13612.c: replaced bugzilla comments

2013-05-27 Thread Paul Butler
Signed-off-by: Paul Butler paul.but...@windriver.com
---
 drivers/usb/host/ehci-ci13612.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ehci-ci13612.c b/drivers/usb/host/ehci-ci13612.c
index 5d3a6bc..151376c 100644
--- a/drivers/usb/host/ehci-ci13612.c
+++ b/drivers/usb/host/ehci-ci13612.c
@@ -27,13 +27,12 @@
 #include ehci-ci13612.h
 
 
-/* Patch the code to fix the bugs in Bugzilla */
 static void ci13612_usb_setup(struct usb_hcd *hcd)
 {
int USB_TXFIFOTHRES, VUSB_HS_TX_BURST;
 
-   /* fix Bugzilla #31874 */
-   /* fix Bugzilla #32212 */
+   /* Fix a HW erratum where the USB core may overrun its transmit FIFO. */
+   /* Fix a HW erratum where the USB core may incorrectly fill its 
transmit FIFO. */
VUSB_HS_TX_BURST = inl(USB_HWTXBUF)  0x0f;
USB_TXFIFOTHRES = (inl(USB_TXFILLTUNING)  0x3f)  16;
 
@@ -94,7 +93,7 @@ static int ehci_run_fix(struct usb_hcd *hcd)
unsigned burst_size;
int retval;
 
-   /* fix Bugzilla 33669 */
+   /* Fix a HW erratum during the USB reset process. */
port_status = ehci_readl(ehci, ehci-regs-port_status[0]);
printk(KERN_INFO ehci_run: port_status = 0x%x\n, port_status);
if (port_status  0x100) {
-- 
1.8.3

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


[linux-yocto] [PATCH 09/87] drivers/usb/host/ehci-ci13612.c: fix a burst size issue

2013-05-27 Thread Paul Butler
Fix an issue that we found with the burst size on the AXI bus.

Signed-off-by: Paul Butler paul.but...@windriver.com
---
 drivers/usb/host/ehci-ci13612.c | 37 +++--
 drivers/usb/host/ehci-ci13612.h |  3 +++
 2 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/host/ehci-ci13612.c b/drivers/usb/host/ehci-ci13612.c
index 151376c..8b7102f 100644
--- a/drivers/usb/host/ehci-ci13612.c
+++ b/drivers/usb/host/ehci-ci13612.c
@@ -30,15 +30,32 @@
 static void ci13612_usb_setup(struct usb_hcd *hcd)
 {
int USB_TXFIFOTHRES, VUSB_HS_TX_BURST;
+   u32 deviceMode;
+   struct ehci_hcd *ehci = hcd_to_ehci(hcd);
 
/* Fix a HW erratum where the USB core may overrun its transmit FIFO. */
-   /* Fix a HW erratum where the USB core may incorrectly fill its 
transmit FIFO. */
+   /* Fix a HW erratum where the USB core may incorrectly fill its
+* transmit FIFO.
+*/
VUSB_HS_TX_BURST = inl(USB_HWTXBUF)  0x0f;
USB_TXFIFOTHRES = (inl(USB_TXFILLTUNING)  0x3f)  16;
 
-   printk(KERN_INFO ehci-ci13612 (ci13612_usb_setup): 
-VUSB_HS_TX_BURST = 0x%x, USB_TXFIFOTHRES = 0x%x\n,
-VUSB_HS_TX_BURST, USB_TXFIFOTHRES);
+   /* Fix related to an issue that we found with the burst size on
+* the AXI bus check if device or host mode
+*/
+   deviceMode = ehci_readl(ehci, hcd-regs + 0x1A8);
+
+   if ((deviceMode  0x3) == 0x2) {
+   /* device mode */
+   writel(0x0, hcd-regs + 0x90);
+   } else if ((deviceMode  0x3) == 0x3) {
+   /* host mode */
+   writel(0x6, hcd-regs + 0x90);
+   }
+
+   printk(KERN_INFO
+  ehci-ci13612 (ci13612_usb_setup): VUSB_HS_TX_BURST = 0x%x, 
USB_TXFIFOTHRES = 0x%x\n,
+   VUSB_HS_TX_BURST, USB_TXFIFOTHRES);
 
return;
 }
@@ -97,8 +114,8 @@ static int ehci_run_fix(struct usb_hcd *hcd)
port_status = ehci_readl(ehci, ehci-regs-port_status[0]);
printk(KERN_INFO ehci_run: port_status = 0x%x\n, port_status);
if (port_status  0x100) {
-   printk(KERN_ERR USB port is in reset status, not able to 
-   change host controller status to run\n);
+   printk(KERN_ERR
+  USB port is in reset status, not able to change host 
controller status to run\n);
return -EFAULT;
}
 
@@ -187,13 +204,13 @@ static int ci13612_ehci_probe(struct platform_device 
*pdev)
}
 
/* FIXME: This reported error since we don't have a second register
- *  area defined in our dtb. Should we add it or stay backwards 
compatible ?
- */
+* area defined in our dtb. Should we add it or stay backwards
+* compatible ?
+*/
gpreg_base = of_iomap(np, 1);
if (!gpreg_base) {
dev_warn(pdev-dev, of_iomap error can't map region 1\n);
-   }
-   else {
+   } else {
/* Setup GPREG for USB to enable the 6-bit address line */
writel(0x0, gpreg_base + 0x8);
 
diff --git a/drivers/usb/host/ehci-ci13612.h b/drivers/usb/host/ehci-ci13612.h
index bbba3f4..9d296ce 100644
--- a/drivers/usb/host/ehci-ci13612.h
+++ b/drivers/usb/host/ehci-ci13612.h
@@ -4,6 +4,9 @@
 #define ci13612_PHY_ADDR   0x0020004AULL
 #define ci13162_PHY_ADDR_SIZE  0x2
 
+#define GPREG_PHY_ADDR 0x00200040C000ULL
+#define GPREG_PHY_ADDR_SIZE0x1000
+
 /*
  * Host interface registers
  */
-- 
1.8.3

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


[linux-yocto] [PATCH 11/87] arch/arm/boot/dts: adding new dts files

2013-05-27 Thread Paul Butler
Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/arm/boot/dts/axm-sim.dts  | 329 ++
 arch/arm/boot/dts/axm-ve-tc1.dts   | 363 +
 arch/arm/boot/dts/axm-ve-tc2.dts   | 174 ++
 arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts | 238 +++
 4 files changed, 1104 insertions(+)
 create mode 100644 arch/arm/boot/dts/axm-sim.dts
 create mode 100644 arch/arm/boot/dts/axm-ve-tc1.dts
 create mode 100644 arch/arm/boot/dts/axm-ve-tc2.dts
 create mode 100644 arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts

diff --git a/arch/arm/boot/dts/axm-sim.dts b/arch/arm/boot/dts/axm-sim.dts
new file mode 100644
index 000..5977691
--- /dev/null
+++ b/arch/arm/boot/dts/axm-sim.dts
@@ -0,0 +1,329 @@
+/*
+ * arch/arm/boot/dts/axm5500-sim.dts
+ *
+ * Copyright (C) 2012 LSI
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/dts-v1/;
+
+/ {
+   model = AXM5516;
+   compatible = arm, lsi,axm5516;
+   interrupt-parent = gic;
+   #address-cells = 2;
+   #size-cells = 2;
+
+   chosen { };
+
+   aliases {
+   serial0 = axxia_serial0;
+   serial1 = axxia_serial1;
+   serial2 = axxia_serial2;
+   serial3 = axxia_serial3;
+   timer   = axxia_timers;
+   };
+
+   cpus {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   cpu@0 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 0;
+   };
+
+   cpu@1 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 1;
+   };
+
+   cpu@2 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 2;
+   };
+
+   cpu@3 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 3;
+   };
+   };
+
+   memory@ {
+   device_type = memory;
+   reg = 0 0x 0 0x4000;
+   };
+
+   gic: interrupt-controller@2001001000 {
+   compatible = arm,cortex-a15-gic, arm,cortex-a9-gic;
+   #interrupt-cells = 3;
+   #address-cells = 0;
+   interrupt-controller;
+   reg = 0x20 0x01001000 0 0x1000,
+ 0x20 0x01002000 0 0x100;
+   };
+
+   timer {
+   compatible = arm,armv7-timer;
+   interrupts = 1 13 0xf08,
+1 14 0xf08;
+   };
+
+
+   gpdma@202014 {
+   compatible = lsi,dma32;
+   reg = 0x20 0x2014 0x00 0x1000;
+   interrupts = 0 60 4, /* busy */
+0 61 4; /* error */
+
+   channel0 {
+   interrupts = 0 62 4;
+   };
+
+   channel1 {
+   interrupts = 0 63 4;
+   };
+   };
+
+   gpdma@2020141000 {
+   status = disabled;
+   compatible = lsi,dma32;
+   reg = 0x20 0x20141000 0x00 0x1000;
+   interrupts = 0 64 4, /* busy */
+0 65 4; /* error */
+
+   channel0 {
+   interrupts = 0 66 4;
+   };
+
+   channel1 {
+   interrupts = 0 67 4;
+   };
+   };
+
+   gpreg@2010094000  {
+   compatible = lsi,gpreg;
+   reg = 0x20 0x10094000 0 0x1000;
+   };
+
+   ethernet@2011 {
+   compatible = smsc,lan91c111;
+   device_type = network;
+   reg = 0x20 0x1100 0 0x1;
+   interrupts = 0 1 4;
+   phy-mode = mii;
+   reg-io-width = 4;
+   smsc,irq-active-high;
+   smsc,irq-push-pull;
+   };
+
+amba {
+   compatible = arm,amba-bus;
+   #address-cells = 2;
+   #size-cells = 2;
+   ranges;
+
+   mmci@020101E {
+ 

[linux-yocto] [PATCH 12/87] arch/arm/boot/fmboot: adding support for Fast Models

2013-05-27 Thread Paul Butler
Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/arm/boot/fmboot/Makefile   | 25 +
 arch/arm/boot/fmboot/fmboot.S   | 80 +
 arch/arm/boot/fmboot/fmboot.lds | 30 
 arch/arm/boot/fmboot/pack.py| 10 ++
 4 files changed, 145 insertions(+)
 create mode 100644 arch/arm/boot/fmboot/Makefile
 create mode 100644 arch/arm/boot/fmboot/fmboot.S
 create mode 100644 arch/arm/boot/fmboot/fmboot.lds
 create mode 100644 arch/arm/boot/fmboot/pack.py

diff --git a/arch/arm/boot/fmboot/Makefile b/arch/arm/boot/fmboot/Makefile
new file mode 100644
index 000..9b2b42e
--- /dev/null
+++ b/arch/arm/boot/fmboot/Makefile
@@ -0,0 +1,25 @@
+# Build an image for Fast Models
+
+AS = $(CROSS_COMPILE)gcc -c
+LD = $(CROSS_COMPILE)ld
+
+DTC = ../../../../scripts/dtc/dtc
+DTS = ../dts/axm-sim.dts
+ZIMAGE = ../zImage
+
+all: clean linux.fm
+
+clean:
+   rm -f linux.fm fmboot.o zImage.fm axm-sim.dtb
+
+linux.fm: fmboot.o fmboot.lds zImage.fm
+   $(LD) -o $@ --script=fmboot.lds
+
+zImage.fm: $(ZIMAGE) axm-sim.dtb
+   python pack.py $(ZIMAGE) axm-sim.dtb  $@
+
+axm-sim.dtb: $(DTS)
+   $(DTC) -O dtb -o $@ $
+
+fmboot.o: fmboot.S
+   $(AS) -o $@ $
diff --git a/arch/arm/boot/fmboot/fmboot.S b/arch/arm/boot/fmboot/fmboot.S
new file mode 100644
index 000..cd52371
--- /dev/null
+++ b/arch/arm/boot/fmboot/fmboot.S
@@ -0,0 +1,80 @@
+/*
+ * boot.S - simple register setup code for stand-alone Linux booting
+ *
+ * Copyright (C) 2011 ARM Limited. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE.txt file.
+ */
+
+#define SPIN_TABLE_BASE 0x1000
+
+   .syntax unified
+   .text
+
+   .globl  _start
+_start:
+   @
+   @ Program architected timer frequency
+   @
+   mrc p15, 0, r0, c0, c1, 1   @ CPUID_EXT_PFR1
+   lsr r0, r0, #16
+   andsr0, r0, #1  @ Check generic timer support
+   beq 1f
+   ldr r0, =1  @ 100MHz timer frequency
+   mcr p15, 0, r0, c14, c0, 0  @ CNTFRQ
+1:
+   @
+   @ CPU initialisation
+   @
+   mrc p15, 0, r0, c0, c0, 5   @ MPIDR (ARMv7 only)
+   and r0, r0, #15 @ CPU number
+   cmp r0, #0  @ primary CPU?
+   beq 2f
+
+   @
+   @ Secondary CPUs
+   @
+   ldr r1, =SPIN_TABLE_BASE
+   adr r2, 1f
+   ldmia   r2, {r3 - r7}   @ move the code to a location
+   stmia   r1, {r3 - r7}   @ less likely to be overridden
+   add r0, r1, #0x20   @ Entry point for secondary
+   @ CPUs @ SPIN_TABLE_BASE+0x20
+   mov r2, #0
+   str r2, [r0, #0]@ ensure initially zero
+   mov pc, r1  @ branch to the relocated code
+1:
+   wfe
+   ldr r1, [r0]
+   cmp r1, #0
+   beq 1b
+   mov pc, r1  @ branch to the given address
+
+   @
+   @ Kernel parameters
+   @
+2: mov r0, #0  @ Must be zero
+   mov r1, #0  @ Machine type (not needed)
+   adr r2, atags   @ ATAGS pointer
+   mov r3, #0
+   ldr lr, =kernel
+   mov pc, lr  @ jump to the kernel
+
+   .org0x100
+atags:
+   @ ATAG_CORE
+   .long   2
+   .long   0x54410001
+
+   @ ATAG_CMDLINE
+   .long   (1f - .)  2
+   .long   0x54410009
+   .asciz  root=/dev/mmcblk0 rootwait ip=none mem=1024M console=ttyAMA0
+
+   .align  2
+1:
+
+   @ ATAG_NONE
+   .long   0
+   .long   0x
diff --git a/arch/arm/boot/fmboot/fmboot.lds b/arch/arm/boot/fmboot/fmboot.lds
new file mode 100644
index 000..8cde9f8
--- /dev/null
+++ b/arch/arm/boot/fmboot/fmboot.lds
@@ -0,0 +1,30 @@
+/*
+ * fmboot.lds
+ *
+ * Copyright (C) 2011 ARM Limited. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE.txt file.
+ */
+
+OUTPUT_FORMAT(elf32-littlearm)
+OUTPUT_ARCH(arm)
+TARGET(binary)
+
+INPUT(./fmboot.o)
+INPUT(./zImage.fm)
+
+PHYS_OFFSET = 0x;
+
+SECTIONS
+{
+   . = PHYS_OFFSET;
+   .text : { fmboot.o }
+   . = PHYS_OFFSET + 0x8000 - 0x0;
+   kernel = . + 0x0;
+   .kernel : { ./zImage.fm }
+   . = PHYS_OFFSET + 0x0080;
+   filesystem = .;
+   .data : { *(.data) }
+   .bss : { *(.bss) }
+}
diff --git a/arch/arm/boot/fmboot/pack.py b/arch/arm/boot/fmboot/pack.py
new file mode 100644
index 000..fe2ce70
--- /dev/null
+++ b/arch/arm/boot/fmboot/pack.py
@@ -0,0 +1,10 @@
+import sys
+
+while len(sys.argv)  1:
+   f = 

[linux-yocto] [PATCH 14/87] arch/arm/mach-axxia/axxia.c: Chip select control for SPI devices.

2013-05-27 Thread Paul Butler
Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/arm/mach-axxia/axxia.c | 51 ++---
 1 file changed, 39 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-axxia/axxia.c b/arch/arm/mach-axxia/axxia.c
index 623957e..777f998 100644
--- a/arch/arm/mach-axxia/axxia.c
+++ b/arch/arm/mach-axxia/axxia.c
@@ -48,6 +48,7 @@
 #include mach/timers.h
 #include axxia.h
 #include pci.h
+#include i2c.h
 
 static const char *axxia_dt_match[] __initconst = {
lsi,axm5516,  /* AXM5516 */
@@ -157,19 +158,41 @@ static struct of_dev_auxdata axxia_auxdata_lookup[] 
__initdata = {
{}
 };
 
-struct pl022_config_chip spi_eeprom = {
-   .iface = SSP_INTERFACE_MOTOROLA_SPI,
-   .clk_freq = {
-   .cpsdvsr = 0,   /* value from 2 to 254 (even only!) */
-   .scr = 0,   /* value from 0 to 255 */
-   },
-   .com_mode = POLLING_TRANSFER,
+static inline void
+spidev_chip_select(u32 control, unsigned n)
+{
+   if (control == SSP_CHIP_SELECT)
+   writel(~(1n)  0x1F, ssp_base+0x30);
+   else
+   writel(0x1F, ssp_base+0x30);
+}
+
+static void spi_cs_eeprom0(u32 control) { spidev_chip_select(control, 0); }
+static void spi_cs_eeprom1(u32 control) { spidev_chip_select(control, 1); }
+static void spi_cs_eeprom2(u32 control) { spidev_chip_select(control, 2); }
+
+struct pl022_config_chip spi_eeprom0 = {
+   .iface  = SSP_INTERFACE_MOTOROLA_SPI,
+   .com_mode   = POLLING_TRANSFER,
+   .cs_control = spi_cs_eeprom0
+};
+
+struct pl022_config_chip spi_eeprom1 = {
+   .iface  = SSP_INTERFACE_MOTOROLA_SPI,
+   .com_mode   = POLLING_TRANSFER,
+   .cs_control = spi_cs_eeprom1
+};
+
+struct pl022_config_chip spi_eeprom2 = {
+   .iface  = SSP_INTERFACE_MOTOROLA_SPI,
+   .com_mode   = POLLING_TRANSFER,
+   .cs_control = spi_cs_eeprom2
 };
 
 static struct spi_board_info spi_devs[] __initdata = {
{
.modalias   = spidev,
-   .controller_data= spi_eeprom,
+   .controller_data= spi_eeprom0,
.bus_num= 0,
.chip_select= 0,
.max_speed_hz   = 1200,
@@ -177,7 +200,7 @@ static struct spi_board_info spi_devs[] __initdata = {
},
{
.modalias   = spidev,
-   .controller_data= spi_eeprom,
+   .controller_data= spi_eeprom1,
.bus_num= 0,
.chip_select= 1,
.max_speed_hz   = 1200,
@@ -185,7 +208,7 @@ static struct spi_board_info spi_devs[] __initdata = {
},
{
.modalias   = spidev,
-   .controller_data= spi_eeprom,
+   .controller_data= spi_eeprom2,
.bus_num= 0,
.chip_select= 2,
.max_speed_hz   = 1200,
@@ -208,11 +231,15 @@ void __init axxia_dt_init(void)
ssp_base =
of_iomap(of_find_compatible_node(NULL, NULL, arm,pl022), 0);
if (!WARN_ON(ssp_base == NULL)) {
-   printk(KERN_INFO SSPCSR = %08x\n, readl(ssp_base+0x30));
-   writel((0x1F  8) | (05) | (0x1F0), ssp_base+0x30);
+   /* Use legacy mode, bits 0..4 control nCS[0..4] pins */
+   writel(0x1F, ssp_base+0x30);
}
 
axxia_pcie_init();
+
+#ifdef CONFIG_I2C
+   axxia_register_i2c_busses();
+#endif
 }
 
 static void axxia_restart(char str, const char *cmd)
-- 
1.8.3

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


[linux-yocto] [PATCH 15/87] arch/arm: Updating Kconfig and Makefile for axxia

2013-05-27 Thread Paul Butler
From: Jiang Lu lu.ji...@windriver.com

Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/arm/Kconfig  | 23 +++
 arch/arm/Makefile |  3 ++-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a68ad22..5cab886 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -326,6 +326,27 @@ config ARCH_VERSATILE
help
  This enables support for ARM Ltd Versatile board.
 
+config ARCH_AXXIA
+   bool LSI Axxia family
+select ARCH_PHYS_ADDR_T_64BIT
+select ARCH_DMA_ADDR_T_64BIT
+   select ARCH_WANT_OPTIONAL_GPIOLIB
+   select ARM_AMBA
+   select COMMON_CLK
+   select CLKDEV_LOOKUP
+   select CLKSRC_MMIO
+   select GENERIC_CLOCKEVENTS
+   select HAVE_CLK
+   select HAVE_PATA_PLATFORM
+   select ARM_TIMER_SP804
+   select ICST
+   select NEED_MACH_IO_H
+   select PCI
+   select PCI_DOMAINS if PCI
+   select ARCH_SUPPORTS_MSI if PCI
+   help
+ This enables support for the LSI Axxia boards.
+
 config ARCH_VEXPRESS
bool ARM Ltd. Versatile Express family
select ARCH_WANT_OPTIONAL_GPIOLIB
@@ -1134,6 +1155,8 @@ source arch/arm/mach-ux500/Kconfig
 
 source arch/arm/mach-versatile/Kconfig
 
+source arch/arm/mach-axxia/Kconfig
+
 source arch/arm/mach-vexpress/Kconfig
 source arch/arm/plat-versatile/Kconfig
 
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index eb6ecae..db992cd 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -190,6 +190,7 @@ machine-$(CONFIG_ARCH_U300) := u300
 machine-$(CONFIG_ARCH_U8500)   := ux500
 machine-$(CONFIG_ARCH_VERSATILE)   := versatile
 machine-$(CONFIG_ARCH_VEXPRESS):= vexpress
+machine-$(CONFIG_ARCH_AXXIA)   := axxia
 machine-$(CONFIG_ARCH_VT8500)  := vt8500
 machine-$(CONFIG_ARCH_W90X900) := w90x900
 machine-$(CONFIG_FOOTBRIDGE)   := footbridge
@@ -307,7 +308,7 @@ define archhelp
   echo  '  Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
   echo  '* xipImage  - XIP kernel image, if configured 
(arch/$(ARCH)/boot/xipImage)'
   echo  '  uImage- U-Boot wrapped zImage'
-  echo  '  bootpImage- Combined zImage and initial RAM disk' 
+  echo  '  bootpImage- Combined zImage and initial RAM disk'
   echo  '  (supply initrd image via make variable 
INITRD=path)'
   echo  '  dtbs  - Build device tree blobs for enabled boards'
   echo  '  install   - Install uncompressed kernel'
-- 
1.8.3

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


[linux-yocto] [PATCH 16/87] arch/arm/mach-axxia/Makefile: adding i2c

2013-05-27 Thread Paul Butler
Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/arm/mach-axxia/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-axxia/Makefile b/arch/arm/mach-axxia/Makefile
index 6e157dd..c124b4b 100644
--- a/arch/arm/mach-axxia/Makefile
+++ b/arch/arm/mach-axxia/Makefile
@@ -6,5 +6,6 @@ obj-y   += clock.o
 obj-y   += io.o
 obj-y  += timers.o
 obj-y  += pci.o
+obj-$(CONFIG_I2C)  += i2c.o
 obj-$(CONFIG_SMP)  += platsmp.o headsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)  += hotplug.o
-- 
1.8.3

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


[linux-yocto] [PATCH 18/87] arch/arm/mm: proc-v7-2level.S and 3level - checking coherent walk bits

2013-05-27 Thread Paul Butler
Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/arm/mm/proc-v7-2level.S | 4 +++-
 arch/arm/mm/proc-v7-3level.S | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/proc-v7-2level.S b/arch/arm/mm/proc-v7-2level.S
index 42ac069..e3f2ba9 100644
--- a/arch/arm/mm/proc-v7-2level.S
+++ b/arch/arm/mm/proc-v7-2level.S
@@ -101,7 +101,9 @@ ENTRY(cpu_v7_set_pte_ext)
  ARM(  str r3, [r0, #2048]! )
  THUMB(add r0, r0, #2048 )
  THUMB(str r3, [r0] )
-   mcr p15, 0, r0, c7, c10, 1  @ flush_pte
+   mrc p15, 0, r3, c0, c1, 7   @ read ID_MMFR3
+   tst r3, #0xf  20  @ check the coherent walk bits
+   mcreq   p15, 0, r0, c7, c10, 1  @ clean D-cache to PoU
 #endif
mov pc, lr
 ENDPROC(cpu_v7_set_pte_ext)
diff --git a/arch/arm/mm/proc-v7-3level.S b/arch/arm/mm/proc-v7-3level.S
index 8de0f1d..6b30605 100644
--- a/arch/arm/mm/proc-v7-3level.S
+++ b/arch/arm/mm/proc-v7-3level.S
@@ -70,7 +70,9 @@ ENTRY(cpu_v7_set_pte_ext)
tst r3, #1  (55 - 32) @ L_PTE_DIRTY
orreq   r2, #L_PTE_RDONLY
 1: strdr2, r3, [r0]
-   mcr p15, 0, r0, c7, c10, 1  @ flush_pte
+   mrc p15, 0, r3, c0, c1, 7   @ read ID_MMFR3
+   tst r3, #0xf  20  @ check the coherent walk bits
+   mcreq   p15, 0, r0, c7, c10, 1  @ clean D-cache to PoU
 #endif
mov pc, lr
 ENDPROC(cpu_v7_set_pte_ext)
-- 
1.8.3

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


[linux-yocto] [PATCH 19/87] arch/arm/mach-axxia: adding i2c code

2013-05-27 Thread Paul Butler
Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/arm/mach-axxia/i2c.c | 121 ++
 arch/arm/mach-axxia/i2c.h |  45 +
 2 files changed, 166 insertions(+)
 create mode 100644 arch/arm/mach-axxia/i2c.c
 create mode 100644 arch/arm/mach-axxia/i2c.h

diff --git a/arch/arm/mach-axxia/i2c.c b/arch/arm/mach-axxia/i2c.c
new file mode 100644
index 000..ef90a5a
--- /dev/null
+++ b/arch/arm/mach-axxia/i2c.c
@@ -0,0 +1,121 @@
+/*
+ * linux/arch/arm/mach-axxia/i2c.c
+ *
+ * Helper module for board specific I2C bus registration
+ *
+ * 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 published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include linux/kernel.h
+#include linux/platform_device.h
+#include linux/i2c.h
+#include linux/i2c-axxia.h
+#include linux/slab.h
+#include linux/err.h
+#include linux/clk.h
+
+#include mach/irqs.h
+
+#include i2c.h
+
+/*
+* Local Definitions  State
+*/
+
+static const char name[] = axxia_ai2c;
+
+#define I2C_RESOURCE_BUILDER(base, irq)\
+   {   \
+   .start  = (base),   \
+   .end= (base) + AXXIA_I2C_SIZE,  \
+   .flags  = IORESOURCE_MEM,   \
+   },  \
+   {   \
+   .start  = (irq),\
+   .flags  = IORESOURCE_IRQ,   \
+   },
+
+/* Filler values for now; real values will be filled in
+ * based on chip type / chip version / etc. */
+static struct resource i2c_resources[][2] = {
+   { I2C_RESOURCE_BUILDER(0, 0) },
+};
+
+#define I2C_DEV_BUILDER(bus_id, res, data) \
+   {   \
+   .id = (bus_id), \
+   .name   = name, \
+   .num_resources  = ARRAY_SIZE(res),  \
+   .resource   = (res),\
+   .dev= { \
+   .platform_data  = (data),   \
+   },  \
+   }
+
+static struct axxia_i2c_bus_platform_data i2c_pdata[ARCH_AXXIA_MAX_I2C_BUSSES];
+static struct platform_device axxia_i2c_devices[ARCH_AXXIA_MAX_I2C_BUSSES] =
+{
+I2C_DEV_BUILDER(ARCH_AXXIA_MAX_I2C_BUS_NR, i2c_resources[0], 
i2c_pdata[0]),
+};
+
+
+static inline
+int
+axxia_add_i2c_bus(
+int ndx,
+int bus_id)
+{
+struct platform_device  *pdev;
+struct axxia_i2c_bus_platform_data  *pdata;
+struct resource *res;
+
+pdev = axxia_i2c_devices[ndx];
+res = pdev-resource;
+res[0].start = AXXIA1_I2C_BASE;
+res[0].end = res[0].start + AXXIA_I2C_SIZE;
+res[1].start = 0;   /* I2C interrup handle? */
+pdata = i2c_pdata[ndx];
+
+pdata-rev = AXXIA_I2C_IP_VERSION_2;
+pdata-flags = 0;
+
+return platform_device_register(pdev);
+}
+
+
+/**
+ * axxia_register_i2c_busses - register I2C busses with device descriptors
+ *
+ * Returns 0 on success or an error code.
+ */
+int __init
+axxia_register_i2c_busses(
+void)
+{
+int i;
+int err;
+
+for (i=0; i  ARCH_AXXIA_MAX_I2C_BUSSES; i++)
+{
+err = axxia_add_i2c_bus(i, i+ARCH_AXXIA_MAX_I2C_BUS_NR);
+if (err)
+return err;
+}
+
+return 0;
+}
diff --git a/arch/arm/mach-axxia/i2c.h b/arch/arm/mach-axxia/i2c.h
new file mode 100644
index 000..cc88104
--- /dev/null
+++ b/arch/arm/mach-axxia/i2c.h
@@ -0,0 +1,45 @@
+/*
+ * Helper module for board specific I2C bus registration
+ *
+ * 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 published by the Free Software Foundation.
+ *
+ * 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.  

[linux-yocto] [PATCH 21/87] arch/arm/mach-axxia: fixed section mismatch warnings

2013-05-27 Thread Paul Butler
Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/arm/mach-axxia/hotplug.c | 2 +-
 arch/arm/mach-axxia/pci.c | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-axxia/hotplug.c b/arch/arm/mach-axxia/hotplug.c
index c504a72..9ecd64d 100644
--- a/arch/arm/mach-axxia/hotplug.c
+++ b/arch/arm/mach-axxia/hotplug.c
@@ -56,7 +56,7 @@ static inline void cpu_leave_lowpower(void)
  : cc);
 }
 
-static inline void platform_do_lowpower(unsigned int cpu, int *spurious)
+static void __ref platform_do_lowpower(unsigned int cpu, int *spurious)
 {
/*
 * there is no power-control hardware on this platform, so all
diff --git a/arch/arm/mach-axxia/pci.c b/arch/arm/mach-axxia/pci.c
index 5ba4b80..b0f1a9a 100644
--- a/arch/arm/mach-axxia/pci.c
+++ b/arch/arm/mach-axxia/pci.c
@@ -481,8 +481,6 @@ static irqreturn_t
 acp_pcie_MSI_isr(int irq, void *arg)
 {
u32 intr_status;
-   u32 msg_fifo_stat;
-   u32 msg_fifo_info;
u8  msiIntr = 0, bit = 0;
struct axxia_pciex_port *port = (struct axxia_pciex_port *)arg;
void __iomem *mbase = (void __iomem *)port-cfg_addr;
@@ -777,7 +775,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, 
axxia_pcie_msi_enable);
 
 /* Port definition struct
  * Please note: PEI core#1 is not used in AXM5500 */
-static struct hw_pci axxia_pcie_hw[] = {
+static struct hw_pci __refdata axxia_pcie_hw[] = {
[0] = {
.nr_controllers = 1,
.domain = 0,
-- 
1.8.3

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


[linux-yocto] [PATCH 27/87] arm/dts: updated for PCIe node name

2013-05-27 Thread Paul Butler
From: SangeethaRao sangeetha@lsi.com

Signed-off-by: SangeethaRao sangeetha@lsi.com
Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/arm/boot/dts/axm55xxsim.dts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/axm55xxsim.dts b/arch/arm/boot/dts/axm55xxsim.dts
index 169aa82..1fc63c1 100644
--- a/arch/arm/boot/dts/axm55xxsim.dts
+++ b/arch/arm/boot/dts/axm55xxsim.dts
@@ -285,7 +285,7 @@
 
};
 
-PCIE0: pciex@0xf012 {
+PCIE0: pciex@0x30 {
 compatible = lsi,plb-pciex;
 device_type = pci;
 enabled = 0;
@@ -321,7 +321,7 @@
 ;
 };
 
-PCIE1: pciex@0xf0128000 {
+PCIE1: pciex@0x304000 {
 compatible = lsi,plb-pciex;
 device_type = pci;
 enabled = 0;
@@ -357,7 +357,7 @@
 ;
 };
 
-PCIE2: pciex@0xf013 {
+PCIE2: pciex@0x308000 {
 compatible = lsi,plb-pciex;
 device_type = pci;
 enabled = 0;
-- 
1.8.3

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


[linux-yocto] [PATCH 35/87] mach-axxia/i2c: fix editing typo.

2013-05-27 Thread Paul Butler
From: Michael Bringmann michael.bringm...@lsi.com

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 arch/arm/mach-axxia/i2c.c | 213 +-
 1 file changed, 156 insertions(+), 57 deletions(-)

diff --git a/arch/arm/mach-axxia/i2c.c b/arch/arm/mach-axxia/i2c.c
index ef90a5a..5f9eff3 100644
--- a/arch/arm/mach-axxia/i2c.c
+++ b/arch/arm/mach-axxia/i2c.c
@@ -23,11 +23,15 @@
 
 #include linux/kernel.h
 #include linux/platform_device.h
+#include linux/of_address.h
 #include linux/i2c.h
 #include linux/i2c-axxia.h
 #include linux/slab.h
 #include linux/err.h
 #include linux/clk.h
+#include linux/irq.h
+#include linux/of_irq.h
+#include linux/interrupt.h
 
 #include mach/irqs.h
 
@@ -39,62 +43,110 @@
 
 static const char name[] = axxia_ai2c;
 
-#define I2C_RESOURCE_BUILDER(base, irq)\
-   {   \
-   .start  = (base),   \
-   .end= (base) + AXXIA_I2C_SIZE,  \
-   .flags  = IORESOURCE_MEM,   \
-   },  \
-   {   \
-   .start  = (irq),\
-   .flags  = IORESOURCE_IRQ,   \
-   },
-
-/* Filler values for now; real values will be filled in
- * based on chip type / chip version / etc. */
-static struct resource i2c_resources[][2] = {
-   { I2C_RESOURCE_BUILDER(0, 0) },
-};
-
-#define I2C_DEV_BUILDER(bus_id, res, data) \
-   {   \
-   .id = (bus_id), \
-   .name   = name, \
-   .num_resources  = ARRAY_SIZE(res),  \
-   .resource   = (res),\
-   .dev= { \
-   .platform_data  = (data),   \
-   },  \
-   }
 
-static struct axxia_i2c_bus_platform_data i2c_pdata[ARCH_AXXIA_MAX_I2C_BUSSES];
-static struct platform_device axxia_i2c_devices[ARCH_AXXIA_MAX_I2C_BUSSES] =
-{
-I2C_DEV_BUILDER(ARCH_AXXIA_MAX_I2C_BUS_NR, i2c_resources[0], 
i2c_pdata[0]),
-};
+static struct axxia_i2c_bus_platform_data   *axxia_i2cx_ports;
+static unsigned int  axxia_i2cx_port_count;
+static struct platform_device   *axxia_i2cx_devices;
+static struct platform_device  **axxia_i2cx_device_ptrs;
 
 
 static inline
 int
 axxia_add_i2c_bus(
-int ndx,
-int bus_id)
+   struct device_node  *np,
+   struct platform_device  *pdev,
+   int  ndx,
+   int  bus_id)
 {
-struct platform_device  *pdev;
-struct axxia_i2c_bus_platform_data  *pdata;
-struct resource *res;
+   struct axxia_i2c_bus_platform_data  *pdata;
+   const u32pval;
+   const char  *val;
+   int  portno;
+
+   /* Get the port number from the device-tree */
+   if (!of_property_read_u32(np, port, (u32 *)pval)) {
+   portno = pval;
+   } else {
+   printk(KERN_ERR I2C: Can't find port number for %s\n,
+   np-full_name);
+   return -ENXIO;
+   }
+   if (portno  axxia_i2cx_port_count) {
+   printk(KERN_ERR I2C: port number out of range for %s\n,
+   np-full_name);
+   return -ENXIO;
+   }
+
+   pdata = axxia_i2cx_ports[ndx];
+   pdata-node  = of_node_get(np);
+
+   pdata-index = portno;
+
+   /* Verify device type */
+   val = of_get_property(np, device_type, NULL);
+   if (strcmp(val, i2c)) {
+   printk(KERN_ERR I2C%d: missing or incorrect device_type for 
%s\n,
+   portno, np-full_name);
+   return -ENXIO;
+   }
+
+   /* Get or insert bus name */
+   val = of_get_property(np, bus_name, NULL);
+   if (val)
+   strncpy(pdata-name, val, MAX_AXXIA_I2C_HWMOD_NAME_LEN);
+   else
+   sprintf(pdata-name, i2c%d, portno);
 
-pdev = axxia_i2c_devices[ndx];
-res = pdev-resource;
-res[0].start = AXXIA1_I2C_BASE;
-res[0].end = res[0].start + AXXIA_I2C_SIZE;
-res[1].start = 0;   /* I2C interrup handle? */
-pdata = i2c_pdata[ndx];
+   pdata-rev = AXXIA_I2C_IP_VERSION_2;/* AXM55xx */
 
-pdata-rev = AXXIA_I2C_IP_VERSION_2;
-pdata-flags = 0;
+   pdata-flags = AXXIA_I2C_FLAGS_NONE;
 
-return platform_device_register(pdev);
+   /* Get the bus number from the device-tree */
+   if (!of_property_read_u32(np, bus, (u32 *)pval))
+   pdata-bus_nr 

[linux-yocto] [PATCH 38/87] mach-axxia/i2c: fix i2c platform data structure

2013-05-27 Thread Paul Butler
From: Michael Bringmann michael.bringm...@lsi.com

Pass more data extracted from DTB block to configure an I2C bus,
instead of using hard-coded addresses in code.

Signed-off-by: Michael Bringmann michael.bringm...@lsi.com
---
 include/linux/i2c-axxia.h | 18 --
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/include/linux/i2c-axxia.h b/include/linux/i2c-axxia.h
index 5f1ae4a..435cd33 100644
--- a/include/linux/i2c-axxia.h
+++ b/include/linux/i2c-axxia.h
@@ -16,10 +16,24 @@
 #define AXXIA_I2C_IP_VERSION_2 2/* AXM55xx */
 
 /* struct axxia_i2c_bus_platform_data .flags meanings */
+#define AXXIA_I2C_FLAGS_NONE(0x)
+
+
+/*
+ * Maximum byte size of I2C bus name string including null terminator
+ */
+#define MAX_AXXIA_I2C_HWMOD_NAME_LEN16
+
 
 struct axxia_i2c_bus_platform_data {
-   u32 rev;
-   u32 flags;
+   struct device_node *node;
+   charname[MAX_AXXIA_I2C_HWMOD_NAME_LEN];
+   u32 index;
+   u32 rev;
+   u32 flags;
+   u32 bus_nr;
+   struct resource dev_space;
+   struct resource int_space;
 };
 
 #endif
-- 
1.8.3

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


[linux-yocto] [PATCH 43/87] LSI axm55xx: Add ability to parse specific core numbers in the DTB

2013-05-27 Thread Paul Butler
From: David Mercado david.merc...@windriver.com

Modified arch/arm/mach-axxia/platsmp.c to be able to parse the cpu
entries in the DTB and boot the specified core numbers.

Signed-off-by: David Mercado david.merc...@windriver.com
Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/arm/mach-axxia/platsmp.c | 53 +--
 1 file changed, 16 insertions(+), 37 deletions(-)

diff --git a/arch/arm/mach-axxia/platsmp.c b/arch/arm/mach-axxia/platsmp.c
index af344b9..3b202b9 100644
--- a/arch/arm/mach-axxia/platsmp.c
+++ b/arch/arm/mach-axxia/platsmp.c
@@ -14,6 +14,7 @@
 #include linux/device.h
 #include linux/io.h
 #include linux/jiffies.h
+#include linux/of.h
 #include linux/of_fdt.h
 #include asm/smp_plat.h
 #include asm/cacheflush.h
@@ -125,53 +126,31 @@ int __cpuinit boot_secondary(unsigned int cpu, struct 
task_struct *idle)
return pen_release != -1 ? -ENOSYS : 0;
 }
 
-static int __init axxia_dt_cpus_num(unsigned long node, const char *uname,
-   int depth, void *data)
-{
-   static int prev_depth = -1;
-   static int nr_cpus = -1;
-
-   if (prev_depth  depth  nr_cpus  0)
-   return nr_cpus;
-
-   if (nr_cpus  0  strcmp(uname, cpus) == 0)
-   nr_cpus = 0;
-
-   if (nr_cpus = 0) {
-   const char *device_type = of_get_flat_dt_prop(node,
-   device_type, NULL);
-
-   if (device_type  strcmp(device_type, cpu) == 0)
-   nr_cpus++;
-   }
-
-   prev_depth = depth;
-
-   return 0;
-}
-
 /*
  * Initialise the CPU possible map early - this describes the CPUs
  * which may be present or become present in the system.
  */
 void __init smp_init_cpus(void)
 {
-   int ncores = 0, i;
-
-   ncores = of_scan_flat_dt(axxia_dt_cpus_num, NULL);
+   int ncores = 0;
+   struct device_node *np;
+   u32 cpu_num;
 
-   if (ncores  2)
-   return;
-
-   if (ncores  nr_cpu_ids) {
-   pr_warn(SMP: %u cores greater than maximum (%u), clipping\n,
+   for_each_node_by_name(np, cpu) {
+   if (++ncores  nr_cpu_ids) {
+   pr_warn(SMP: More cores (%u) in DTB than max (%u)\n,
ncores, nr_cpu_ids);
-   ncores = nr_cpu_ids;
+   break;
+   }
+   if (!of_property_read_u32(np, reg, cpu_num)) {
+   if (cpu_num = 0  cpu_num  16)
+   set_cpu_possible(cpu_num, true);
+   else
+   pr_warn(SMP: Invalid cpu number (%u)\n,
+cpu_num);
+   }
}
 
-   for (i = 0; i  ncores; ++i)
-   set_cpu_possible(i, true);
-
set_smp_cross_call(axxia_gic_raise_softirq);
 }
 
-- 
1.8.3

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


[linux-yocto] [PATCH 44/87] arm/asm/io.h: let ioremap() fall back to platform specific one

2013-05-27 Thread Paul Butler
Signed-off-by: Paul Butler paul.but...@windriver.com
---
 arch/arm/include/asm/io.h | 20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 9af5563..1b37696 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -264,11 +264,21 @@ extern void _memset_io(volatile void __iomem *, int, 
size_t);
  * Documentation/io-mapping.txt.
  *
  */
-#define ioremap(cookie,size)   __arm_ioremap((cookie), (size), 
MT_DEVICE)
-#define ioremap_nocache(cookie,size)   __arm_ioremap((cookie), (size), 
MT_DEVICE)
-#define ioremap_cached(cookie,size)__arm_ioremap((cookie), (size), 
MT_DEVICE_CACHED)
-#define ioremap_wc(cookie,size)__arm_ioremap((cookie), (size), 
MT_DEVICE_WC)
-#define iounmap__arm_iounmap
+
+#ifndef __arch_ioremap
+#define __arch_ioremap __arm_ioremap
+#define __arch_iounmap __iounmap
+#endif
+
+#define ioremap(cookie, size) \
+   __arch_ioremap((cookie), (size), MT_DEVICE)
+#define ioremap_nocache(cookie, size) \
+   __arch_ioremap((cookie), (size), MT_DEVICE)
+#define ioremap_cached(cookie, size) \
+   __arch_ioremap((cookie), (size), MT_DEVICE_CACHED)
+#define ioremap_wc(cookie, size) \
+   __arch_ioremap((cookie), (size), MT_DEVICE_WC)
+#define iounmap__arch_iounmap
 
 /*
  * io{read,write}{8,16,32} macros
-- 
1.8.3

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


[linux-yocto] [PATCH 45/87] drivers/i2c/ai2c: remove default y from Kconfig

2013-05-27 Thread Paul Butler
From: Wang Hui hui.w...@windriver.com

If we set default y for this driver in the Kconfig, it will be built
when we build other platforms, it will bring building errors, so
remove it.

Signed-off-by: Wang Hui hui.w...@windriver.com
---
 drivers/i2c/busses/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 58acc26..411a2fc 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -919,7 +919,6 @@ config SCx200_ACB
 config I2C_AXXIA
tristate Axxia I2C bus support
select I2C_ALGOBIT
-   default y
help
  Say yes if you want to support the I2C bus on Axxia platforms.
 
-- 
1.8.3

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


[linux-yocto] [PATCH 46/87] arm: fmboot: make the fmboot image

2013-05-27 Thread Paul Butler
From: Wang Hui hui.w...@windriver.com

Signed-off-by: Wang Hui hui.w...@windriver.com
---
 arch/arm/boot/Makefile|  3 +++
 arch/arm/boot/fmboot/Makefile | 24 
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index c877087..e7df7e4 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -53,6 +53,9 @@ $(obj)/compressed/vmlinux: $(obj)/Image FORCE
 
 $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
$(call if_changed,objcopy)
+ifeq ($(MACHINE),arch/arm/mach-axxia/)
+   $(Q)$(MAKE) $(build)=$(obj)/fmboot $(obj)/linux.img
+endif
@echo '  Kernel: $@ is ready'
 
 endif
diff --git a/arch/arm/boot/fmboot/Makefile b/arch/arm/boot/fmboot/Makefile
index 14db83f..3ae512f 100644
--- a/arch/arm/boot/fmboot/Makefile
+++ b/arch/arm/boot/fmboot/Makefile
@@ -3,23 +3,23 @@
 AS = $(CROSS_COMPILE)gcc -c
 LD = $(CROSS_COMPILE)ld
 
-DTC = ../../../../scripts/dtc/dtc
-DTS = ../dts/axm55xxsim.dts
-ZIMAGE = ../zImage
-
-all: clean linux.img
+DTC = $(obj)/../../../../scripts/dtc/dtc
+DTS = $(obj)/../dts/axm55xxsim.dts
+ZIMAGE = $(obj)/../zImage
 
 clean:
-   rm -f linux.img fmboot.o zImage.fm axm55xxsim.dtb
+   rm -f $(obj)/../linux.img $(obj)/fmboot.o $(obj)/zImage.fm 
$(obj)/axm55xxsim.dtb
 
-linux.img: fmboot.o fmboot.lds zImage.fm
-   $(LD) -o $@ --script=fmboot.lds
+arch/arm/boot/linux.img: $(obj)/fmboot.o $(srctree)/$(obj)/fmboot.lds 
$(obj)/zImage.fm
+   cd $(obj)  $(LD) -o ../linux.img --script=$(srctree)/$(obj)/fmboot.lds
+   tar jcf $(obj)/../linux.img.tar.bz2 $(obj)/../linux.img
+   rm -rf $(obj)/../linux.img
 
-zImage.fm: $(ZIMAGE) axm55xxsim.dtb
-   python pack.py $(ZIMAGE) axm55xxsim.dtb  $@
+$(obj)/zImage.fm: $(ZIMAGE) $(obj)/axm55xxsim.dtb
+   python $(srctree)/$(obj)/pack.py $(ZIMAGE) $(obj)/axm55xxsim.dtb  $@
 
-axm55xxsim.dtb: $(DTS)
+$(obj)/axm55xxsim.dtb: $(DTS)
$(DTC) -O dtb -o $@ $
 
-fmboot.o: fmboot.S
+$(obj)/fmboot.o: $(obj)/fmboot.S
$(AS) -o $@ $
-- 
1.8.3

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


[linux-yocto] [PATCH 47/87] ppc/476: workaround for erratum #40 on dd2 core

2013-05-27 Thread Paul Butler
From: Kevin Hao kexin@windriver.com

Extracted from ibm.patch in lsi_acp_linux_3.8.1.28 tarball.

In a coherent multiprocessor system, one processor might initiate an
icbi to another processor. If at least one processor retries an msync
operation during this operation, it might cause a hang when a specific
alignment of operations occurs.

The workaround for this is to avoid I-cache miss after icbi and msync
sequence. We first trap the icbi instructions by using the instruction
opcode compare function of the processor, then the icbi is executed
from within the handler followed by an instruction cache touch of the
cache line containing the subsequent msync instruction.

Signed-off-by: Kevin Hao kexin@windriver.com
---
 arch/powerpc/include/asm/ppc-opcode.h |  2 ++
 arch/powerpc/include/asm/reg_booke.h  | 13 +
 arch/powerpc/kernel/head_44x.S| 24 
 arch/powerpc/kernel/misc_32.S | 30 ++
 arch/powerpc/kernel/traps.c   | 28 
 5 files changed, 97 insertions(+)

diff --git a/arch/powerpc/include/asm/ppc-opcode.h 
b/arch/powerpc/include/asm/ppc-opcode.h
index d81f994..dd43125 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -20,6 +20,8 @@
 #define PPC_INST_DCBA_MASK 0xfc0007fe
 #define PPC_INST_DCBAL 0x7c2005ec
 #define PPC_INST_DCBZL 0x7c2007ec
+#define PPC_INST_ICBI  0x7c0007ac
+#define PPC_INST_ICBI_MASK 0xfc0007fe
 #define PPC_INST_ISEL  0x7c1e
 #define PPC_INST_ISEL_MASK 0xfc3e
 #define PPC_INST_LDARX 0x7ca8
diff --git a/arch/powerpc/include/asm/reg_booke.h 
b/arch/powerpc/include/asm/reg_booke.h
index 8a97aa7..034d8c4 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -312,6 +312,8 @@
 #define ESR_IMCN   0x4000  /* Instr. Machine Check - Non-config */
 #define ESR_IMCB   0x2000  /* Instr. Machine Check - Bus error */
 #define ESR_IMCT   0x1000  /* Instr. Machine Check - Timeout */
+#define ESR_POT1   0x2000  /* 476 - IOCR1 trap */
+#define ESR_POT2   0x1000  /* 476 - IOCR2 trap */
 #define ESR_PIL0x0800  /* Program Exception - Illegal 
*/
 #define ESR_PPR0x0400  /* Program Exception - 
Privileged */
 #define ESR_PTR0x0200  /* Program Exception - Trap */
@@ -667,6 +669,17 @@
 #define MMUBE1_VBE30x0004
 #define MMUBE1_VBE40x0002
 #define MMUBE1_VBE50x0001
+#define SPRN_IOCCR 860
+#define IOCCR_IOCR1EN  0x8000
+#define IOCCR_IOCR1M   0x4000
+#define IOCCR_IOCR2EN  0x2000
+#define IOCCR_IOCR2M   0x1000
+#define IOCCR_IOCR1ME  0x0800
+#define IOCCR_IOCR2ME  0x0800
+#define IOCCR_IOCR1U   0x0200
+#define IOCCR_IOCR2U   0x0100
+#define SPRN_IOCR1 861
+#define SPRN_IOCR2 862
 
 #endif /* __ASM_POWERPC_REG_BOOKE_H__ */
 #endif /* __KERNEL__ */
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index 7dd2981..4aa3bd3 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -220,6 +220,10 @@ _ENTRY(_start);
li  r0,0
mtspr   SPRN_MCSR,r0
 
+#ifdef CONFIG_PPC_47x
+   bl  init_cpu_features
+#endif
+
/* Let's move on */
lis r4,start_kernel@h
ori r4,r4,start_kernel@l
@@ -1006,6 +1010,25 @@ skpinv:  addir4,r4,1 /* 
Increment */
 
 #ifdef CONFIG_PPC_47x
 
+/*
+ * per-processor initialization that depends on feature sections.
+ *
+ * We can't use the FTR_SECTION in init_cpu_state since early_init
+ * has not yet been called.
+ */
+_GLOBAL(init_cpu_features)
+BEGIN_FTR_SECTION
+   /* DD2 workaround, trap on icbi. Configure IOCR1 and enable
+* it in IOCCR.
+*/
+   LOAD_REG_IMMEDIATE(r3, (31  26) | (982  16))/* icbi */
+   lis r4,(IOCCR_IOCR1EN | IOCCR_IOCR1U)@h
+   mtspr   SPRN_IOCR1,r3
+   mtspr   SPRN_IOCCR,r4
+END_FTR_SECTION_IFSET(CPU_FTR_476_DD2)
+
+   blr
+
 #ifdef CONFIG_SMP
 
 /* Entry point for secondary 47x processors */
@@ -1013,6 +1036,7 @@ _GLOBAL(start_secondary_47x)
 mr  r24,r3  /* CPU number */
 
bl  init_cpu_state
+   bl  init_cpu_features
 
/* Now we need to bolt the rest of kernel memory which
 * is done in C code. We must be careful because our task
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index 7cd07b4..e98d6b0 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -1008,3 +1008,33 @@ relocate_new_kernel_end:
 relocate_new_kernel_size:
.long 

[linux-yocto] [PATCH 48/87] ppc/47x: add cputable entries for ACP 34xx

2013-05-27 Thread Paul Butler
From: Jiang Lu lu.ji...@windriver.com

This is based on the cputable.c from LSI. Currently our kernel only
support ACP 3448 SoC. But all the ACP 34xx SoC are using a 476 core,
and just have minor differences. They also use the same reference
board. Adding these cpu entries in cputable will make our kernel
boot on all these 34xx silicons.

Signed-off-by: Kevin Hao kexin@windriver.com
---
 arch/powerpc/include/asm/reg.h |  1 +
 arch/powerpc/kernel/cputable.c | 58 --
 arch/powerpc/kernel/head_44x.S |  3 +++
 3 files changed, 54 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index cae0ed7..b40b2f5 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -957,6 +957,7 @@
 #define PVR_405GP  0x4011
 #define PVR_4760x11a52000
 #define PVR_476FPE 0x7ff5
+#define PVR_476X2  0x11b22080
 #define PVR_STB03XXX   0x4031
 #define PVR_NP405H 0x4141
 #define PVR_NP405L 0x4161
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 455faa3..88479f1 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1831,9 +1831,23 @@ static struct cpu_spec __initdata cpu_specs[] = {
.platform   = ppc440,
},
{ /* 476 DD2 core */
+   .pvr_mask   = 0x800f,
+   .pvr_value  = 0x00052080,
+   .cpu_name   = 476, DD2,
+   .cpu_features   = CPU_FTRS_47X | CPU_FTR_476_DD2,
+   .cpu_user_features  = COMMON_USER_BOOKE |
+   PPC_FEATURE_HAS_FPU,
+   .mmu_features   = MMU_FTR_TYPE_47x |
+   MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL,
+   .icache_bsize   = 32,
+   .dcache_bsize   = 128,
+   .machine_check  = machine_check_47x,
+   .platform   = ppc470,
+   },
+   { /* X2 DD2 core */
.pvr_mask   = 0x,
-   .pvr_value  = 0x11a52080,
-   .cpu_name   = 476,
+   .pvr_value  = 0x11b22080,
+   .cpu_name   = 476, X2 DD2,
.cpu_features   = CPU_FTRS_47X | CPU_FTR_476_DD2,
.cpu_user_features  = COMMON_USER_BOOKE |
PPC_FEATURE_HAS_FPU,
@@ -1859,9 +1873,37 @@ static struct cpu_spec __initdata cpu_specs[] = {
.platform   = ppc470,
},
{ /* 476 iss */
-   .pvr_mask   = 0x,
-   .pvr_value  = 0x0005,
-   .cpu_name   = 476,
+   .pvr_mask   = 0x,
+   .pvr_value  = 0x12b520c0,
+   .cpu_name   = 476,
+   .cpu_features   = CPU_FTRS_47X | CPU_FTR_476_DD2,
+   .cpu_user_features  = COMMON_USER_BOOKE |
+   PPC_FEATURE_HAS_FPU,
+   .mmu_features   = MMU_FTR_TYPE_47x |
+   MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL,
+   .icache_bsize   = 32,
+   .dcache_bsize   = 128,
+   .machine_check  = machine_check_47x,
+   .platform   = ppc470,
+   },
+   { /* 476 DD3 core */
+   .pvr_mask   = 0x20c0,
+   .pvr_value  = 0x11a520c0,
+   .cpu_name   = 476, DD3,
+   .cpu_features   = CPU_FTRS_47X,
+   .cpu_user_features  = COMMON_USER_BOOKE |
+   PPC_FEATURE_HAS_FPU,
+   .mmu_features   = MMU_FTR_TYPE_47x |
+   MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL,
+   .icache_bsize   = 32,
+   .dcache_bsize   = 128,
+   .machine_check  = machine_check_47x,
+   .platform   = ppc470,
+   },
+   { /* 476 ACP25xx */
+   .pvr_mask   = 0x7ff520c1,
+   .pvr_value  = 0x7ff520c1,
+   .cpu_name   = 476, ACP25xx,
.cpu_features   = CPU_FTRS_47X,
.cpu_user_features  = COMMON_USER_BOOKE |
PPC_FEATURE_HAS_FPU,
@@ -1873,9 +1915,9 @@ static struct cpu_spec __initdata cpu_specs[] = {
.platform   = ppc470,
},
{ /* 476 others */
-   .pvr_mask   = 0x,
-   .pvr_value  = 0x11a5,
-   .cpu_name   = 476,
+   .pvr_mask   

[linux-yocto] [PATCH 56/87] lsi/ubootenv: add read access to the uboot env

2013-05-27 Thread Paul Butler
From: Jiang Lu lu.ji...@windriver.com

Extracted from lsi.patch in lsi_acp_linux_6.8.1.18 tarball.

Add the support to read the env value in env-0 and env-1
partitions. This function is needed by some drivers.

[Jiang: change file name to lsi_ubootenv.c]

Signed-off-by: Jiang Lu lu.ji...@windriver.com
---
 drivers/mtd/nand/Kconfig|   6 +
 drivers/mtd/nand/Makefile   |   1 +
 drivers/mtd/nand/lsi_ubootenv.c | 568 
 3 files changed, 575 insertions(+)
 create mode 100644 drivers/mtd/nand/lsi_ubootenv.c

diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 102ad83..44c1d75 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -534,4 +534,10 @@ config MTD_NAND_EP501X
  Enables NAND flash support for the Eureka EP501, EP501G1
  and EP501G3 controllers.
 
+config MTD_NAND_EP501X_UBOOTENV
+   tristate U-Boot Environment Access for LSI's APP and ACP
+   depends on ( MTD_NAND_EP501X  CRC32 )
+   help
+ Add U-Boot environment access on LSI's APP/ACP boards.
+
 endif # MTD_NAND
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 01a11f8..035b353 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -52,5 +52,6 @@ obj-$(CONFIG_MTD_NAND_RICOH)  += r852.o
 obj-$(CONFIG_MTD_NAND_JZ4740)  += jz4740_nand.o
 obj-$(CONFIG_MTD_NAND_GPMI_NAND)   += gpmi-nand/
 obj-$(CONFIG_MTD_NAND_EP501X)  += lsi_acp_nand.o
+obj-$(CONFIG_MTD_NAND_EP501X_UBOOTENV) += lsi_ubootenv.o
 
 nand-objs := nand_base.o nand_bbt.o
diff --git a/drivers/mtd/nand/lsi_ubootenv.c b/drivers/mtd/nand/lsi_ubootenv.c
new file mode 100644
index 000..d9ad283
--- /dev/null
+++ b/drivers/mtd/nand/lsi_ubootenv.c
@@ -0,0 +1,568 @@
+/*
+ * drivers/lsi/acp/ubootenv.c
+ *
+ * Copyright (C) 2009 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  021.1.1_pre.17  
USA
+ */
+
+#include linux/module.h
+#include linux/kernel.h
+#include linux/string.h
+#include linux/vmalloc.h
+#include linux/mtd/mtd.h
+#include linux/crc32.h
+#include linux/io.h
+
+/*
+  ==
+  Data types and Macros
+  ==
+*/
+#include asm/lsi/debug.h
+
+/*
+  ==
+  Global Variables
+  ==
+*/
+
+static struct kobject *ubootenv_kobj;
+
+
+static unsigned long uboot_env_size = (128 * 1024);
+static unsigned long uboot_env_cs_size = (128 * 1024);
+static int uboot_env_current = -1;
+
+#define ENVIRONMENT_DATA_SIZE(size) (size - (2 * sizeof(unsigned long)))
+
+typedef struct environment {
+
+   unsigned long crc32;
+   unsigned long flags;
+   unsigned char data[];
+
+} __packed environment_t;
+
+static environment_t *environment = (environment_t *) 0;
+
+static unsigned long crc32_lut[256] = {
+
+   /*   0 -- */   0u, 1996959894u, 3993919788u, 2567524794u,
+   /*   4 -- */   124634137u, 1886057615u, 3915621685u, 2657392035u,
+   /*   8 -- */   249268274u, 2044508324u, 3772115230u, 2547177864u,
+   /*  12 -- */   162941995u, 2125561021u, 3887607047u, 2428444049u,
+   /*  16 -- */   498536548u, 1789927666u, 4089016648u, 2227061214u,
+   /*  20 -- */   450548861u, 1843258603u, 4107580753u, 2211677639u,
+   /*  24 -- */   325883990u, 1684777152u, 4251122042u, 2321926636u,
+   /*  28 -- */   335633487u, 1661365465u, 4195302755u, 2366115317u,
+   /*  32 -- */   997073096u, 1281953886u, 3579855332u, 2724688242u,
+   /*  36 -- */  1006888145u, 1258607687u, 3524101629u, 2768942443u,
+   /*  40 -- */   901097722u, 1119000684u, 3686517206u, 2898065728u,
+   /*  44 -- */   853044451u, 1172266101u, 3705015759u, 2882616665u,
+   /*  48 -- */   651767980u, 1373503546u, 3369554304u, 3218104598u,
+   /*  52 -- */   565507253u, 1454621731u, 3485111705u, 3099436303u,
+   /*  56 -- */   671266974u, 1594198024u, 3322730930u, 2970347812u,
+   /*  60 -- */   795835527u, 1483230225u, 3244367275u, 3060149565u,
+   /*  64 -- */  1994146192u,   31158534u, 2563907772u, 4023717930u,
+   /*  68 -- */  1907459465u,  112637215u, 2680153253u, 

[linux-yocto] [PATCH 57/87] lsi/nand:Use EP501G1_NAND_1BIT_ECC0_STATUS to check HW ECC

2013-05-27 Thread Paul Butler
From: Jiang Lu lu.ji...@windriver.com

On ACP34xx, remounting a jffs2 partition will fail after writing file
with following error:
mount:/dev/mtdblock6 can't read superblock

This is caused by involving EP501G1_NAND_BCH_STATUS to check HW ECC
result. This patch reads EP501G1_NAND_1BIT_ECC0_STATUS to check HW
ECC result. When EP501G1_NAND_BCH_STATUS returns non-zero value,
EP501G1_NAND_1BIT_ECC0_STATUS reads zero, it indicate no HW ECC error.

Extract from vendor drop patch lsi-patch 3.8.1.12.

Signed-off-by: Jiang Lu lu.ji...@windriver.com
---
 drivers/mtd/nand/lsi_acp_nand.c | 104 +++-
 1 file changed, 16 insertions(+), 88 deletions(-)

diff --git a/drivers/mtd/nand/lsi_acp_nand.c b/drivers/mtd/nand/lsi_acp_nand.c
index 94b8e3c..eb9943a 100644
--- a/drivers/mtd/nand/lsi_acp_nand.c
+++ b/drivers/mtd/nand/lsi_acp_nand.c
@@ -2820,100 +2820,28 @@ static int
 report_ecc_errors_ep501g1(struct mtd_info *mtd, struct nand_chip *chip,
  uint8_t *buffer, int page)
 {
-   unsigned long bch_status;
-   int rc = 0;
+   unsigned long ecc_status;
int i;
-   int is_blank = 1;
-   uint8_t *data = buffer;
-   int section;
-   int syndrome;
-   unsigned long syndromes[8][8];
-
-   /* If there are no errors, return. */
-   bch_status = READL(chip-IO_ADDR_R + EP501G1_NAND_BCH_STATUS);
 
-   if (0 == bch_status)
-   goto report_ecc_errors_ep501g1_end;
+   for (i = 0; i  (mtd-writesize / 1024); ++i) {
+   ecc_status = readl(chip-IO_ADDR_R +
+  EP501G1_NAND_1BIT_ECC0_STATUS + (i * 4));
 
-   switch (mtd-writesize) {
-   case 512:
-   bch_status = 0x1;
-   break;
-   case 2048:
-   bch_status = 0xf;
-   break;
-   case 4096:
-   bch_status = 0xff;
-   break;
-   default:
-   printk(KERN_ERR Unexpected Page Size!\n);
-   rc = -1;
-   goto report_ecc_errors_ep501g1_end;
-   break;
-   }
-
-   /* Ignore fully erased blocks. */
-   if (NULL != data) {
-   for (i = 0; i  mtd-writesize; ++i) {
-   if (0xff != *data++) {
-   is_blank = 0;
-   break;
-   }
-   }
-   }
-
-   if (0 != is_blank)
-   goto report_ecc_errors_ep501g1_end;
-
-   /* Read the syndrome registers and split them into syndromes. */
-   for (section = 0; section  8; ++section) {
-   unsigned long address;
-   unsigned long value;
-
-   address = EP501G1_NAND_SYN_R12_S0 + (section * 0x10);
-
-   for (syndrome = 0; syndrome  8; syndrome += 2) {
-   value = READL(chip-IO_ADDR_R + address +
- (syndrome * 2));
-   syndromes[section][syndrome] =
-   (value  0x1fff);
-   syndromes[section][syndrome + 1] =
-   ((value  0x1fff)  16);
-   }
-   }
-
-#ifdef NOT_USED
-   /* Debug output (BCH status register and syndromes). */
-   printk(KERN_INFO BCH Status Register: 0x%02lx\n, bch_status);
-
-   for (section = 0; section  8; ++section) {
-   printk(KERN_INFO Syndromes, Section %d: , section);
-
-   for (syndrome = 0; syndrome  8; ++syndrome) {
-   printk(KERN_INFO 0x%04lx ,
-  syndromes[section][syndrome]);
-   }
-
-   printk(KERN_INFO \n);
-   }
-#endif
-
-   for (i = 0; i  4; ++i) {
-   if ((1  i) == (bch_status  (1  i))) {
-   rc = fix_section(((page * mtd-writesize) + (512 * i)),
-(void *)(buffer + (512 * i)),
-(int *)syndromes[i]);
-
-   if (-1 == rc)
-   printk(KERN_ERR
-  Uncorrectable ECC Error: Page %d\n,
-  page);
+   switch (ecc_status  (3  12)) {
+   case 01:
+   printk(KERN_ERR
+  Correctable ECC Error: %d:0x%lx\n,
+  i, ecc_status);
+   break;
+   case 02:
+   printk(KERN_ERR
+  Uncorrectable ECC Error: %d:0x%lx\n,
+  i, ecc_status);
+   break;
}
}
 
- report_ecc_errors_ep501g1_end:
-
-   return rc;
+   return 0;
 }
 
 /*
-- 
1.8.3

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


[linux-yocto] [PATCH 58/87] drivers/tty: Add support for lsi acp serial driver and console

2013-05-27 Thread Paul Butler
Add lsi acp serial driver.

Signed-off-by: Paul Butler paul.but...@windriver.com
---
 drivers/tty/serial/Kconfig  |   51 ++
 drivers/tty/serial/Makefile |3 +-
 drivers/tty/serial/lsi_acp_serial.c | 1248 +++
 3 files changed, 1301 insertions(+), 1 deletion(-)
 create mode 100644 drivers/tty/serial/lsi_acp_serial.c

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 070b442..ef88a8b 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1360,4 +1360,55 @@ config SERIAL_EFM32_UART_CONSOLE
depends on SERIAL_EFM32_UART=y
select SERIAL_CORE_CONSOLE
 
+config SERIAL_ACP
+   bool LSI's Serial Driver for the ACP
+   select SERIAL_CORE
+   help
+ Handles the serial ports (there are two) on LSI's ACP board
+ and the simulated serial port provided by ISS.
+
+config SERIAL_ACP_CONSOLE
+   bool Console on the ACP serial port
+   depends on SERIAL_ACP=y
+   select SERIAL_CORE_CONSOLE
+   help
+ If you say Y here, it will be possible to use a serial port as the
+ system console (the system console is the device which receives all
+ kernel messages and warnings and which allows logins in single user
+ mode). This could be useful if some terminal or printer is connected
+ to that serial port.
+
+ Even if you say Y here, the currently visible virtual console
+ (/dev/tty0) will still be used as the system console by default, but
+ you can alter that using a kernel command line option such as
+ console=ttyS1. (Try man bootparam or see the documentation of
+ your boot loader (grub or lilo or loadlin) about how to pass options
+ to the kernel at boot time.)
+
+ If you don't have a VGA card installed and you say Y here, the
+ kernel will automatically use the first serial line, /dev/ttyS0, as
+ system console.
+
+ You can set that using a kernel command line option such as
+ console=uart8250,io,0x3f8,9600n8
+ console=uart8250,mmio,0xff5e,115200n8.
+ and it will switch to normal serial console when the corresponding
+ port is ready.
+ earlycon=uart8250,io,0x3f8,9600n8
+ earlycon=uart8250,io,0x3f8,9600n8
+ earlycon=uart8250,mmio,0xff5e,115200n8.
+ it will not only setup early console.
+
+ If unsure, say N.
+
+   config SERIAL_ACP_CONSOLE_POLL
+   bool Don't use interrupts in the ACP serial driver
+   depends on SERIAL_ACP_CONSOLE
+   select CONSOLE_POLL
+   help
+ When selected, the ACP serial driver won't use interrupts.
+ This is only intended to be used for debugging.
+
+ If unsure, say N.
+
 endmenu
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index 7257c5d..9353c89 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_SERIAL_8250) += 8250/
 
 obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o
 obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o
+obj-$(CONFIG_SERIAL_ACP) += lsi_acp_serial.o
 obj-$(CONFIG_SERIAL_CLPS711X) += clps711x.o
 obj-$(CONFIG_SERIAL_PXA) += pxa.o
 obj-$(CONFIG_SERIAL_PNX8XXX) += pnx8xxx_uart.o
@@ -70,7 +71,7 @@ obj-$(CONFIG_SERIAL_ALTERA_JTAGUART) += altera_jtaguart.o
 obj-$(CONFIG_SERIAL_VT8500) += vt8500_serial.o
 obj-$(CONFIG_SERIAL_MRST_MAX3110)  += mrst_max3110.o
 obj-$(CONFIG_SERIAL_MFD_HSU)   += mfd.o
-obj-$(CONFIG_SERIAL_IFX6X60)   += ifx6x60.o
+obj-$(CONFIG_SERIAL_IFX6X60)   += ifx6x60.o
 obj-$(CONFIG_SERIAL_PCH_UART)  += pch_uart.o
 obj-$(CONFIG_SERIAL_MSM_SMD)   += msm_smd_tty.o
 obj-$(CONFIG_SERIAL_MXS_AUART) += mxs-auart.o
diff --git a/drivers/tty/serial/lsi_acp_serial.c 
b/drivers/tty/serial/lsi_acp_serial.c
new file mode 100644
index 000..f255ab8
--- /dev/null
+++ b/drivers/tty/serial/lsi_acp_serial.c
@@ -0,0 +1,1248 @@
+/*
+ *  drivers/tty/serial/lsi_acp_serial.c
+ *
+ *  Driver for AMBA serial ports on LSI's PPC based ACP.
+ *
+ *  Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
+ *
+ *  Copyright 1999 ARM Limited
+ *  Copyright (C) 2000 Deep Blue Solutions Ltd.
+ *  Copyright 2009 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  

[linux-yocto] [PATCH 59/87] tty:ACP serial:extract clock freq from device tree

2013-05-27 Thread Paul Butler
From: Jiang Lu lu.ji...@windriver.com

Extract clock freq info for acp serial device from device tree.

Extracted from lsi sdk 6.8.18.

Signed-off-by: Jiang Lu lu.ji...@windriver.com
---
 drivers/tty/serial/lsi_acp_serial.c | 17 ++---
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/tty/serial/lsi_acp_serial.c 
b/drivers/tty/serial/lsi_acp_serial.c
index f255ab8..49ffd30 100644
--- a/drivers/tty/serial/lsi_acp_serial.c
+++ b/drivers/tty/serial/lsi_acp_serial.c
@@ -53,7 +53,6 @@
 #include linux/io.h
 
 #include asm/lsi/acp_ncr.h
-#include asm/lsi/acp_clock.h
 
 #define SZ_4K (4*1024)
 #define UART_NR2
@@ -68,6 +67,7 @@
 #define MAX_BAUD_RATE 115200
 
 static int dt_baud_rate;
+static unsigned long per_clock;
 
 /*
   ==
@@ -121,15 +121,10 @@ struct uart_acp_port {
 static int
 get_clock_stuff(struct uart_acp_port *port, int baud_rate)
 {
-   unsigned long per_clock;
unsigned long divisor;
unsigned long ibrd;
unsigned long fbrd;
 
-   /* Get the speed of the peripheral clock. */
-   acp_clock_get(1, per_clock);
-   per_clock *= 1000;
-
/*
  Since the IBDR (integer part of the baud rate
  divisor) is a 16 bit quatity, find the minimum load
@@ -137,10 +132,11 @@ get_clock_stuff(struct uart_acp_port *port, int baud_rate)
  desired baud rate.
*/
 
-   if (is_asic()) {
+   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);
}
@@ -641,8 +637,7 @@ acp_serial_startup(struct uart_port *port)
return 0;
 
  clk_dis:
-   /*clk_disable(uap-clk);*/
-/* out:*/
+
return retval;
 }
 
@@ -1124,10 +1119,10 @@ acp_serial_add_ports(struct uart_driver *driver)
clk = of_get_property(np, clock-frequency, NULL);
 
if (clk  *clk)
-   uap-port.uartclk = *clk;
+   per_clock = *clk;
else {
printk(KERN_ERR serial clock frequency not found\n);
-   uap-port.uartclk = 650;
+   per_clock = 2;
}
 
speed = of_get_property(np, current-speed, NULL);
-- 
1.8.3

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


[linux-yocto] [PATCH 60/87] kgdboc, acp serial: rx polling hook for the acp_serial driver

2013-05-27 Thread Paul Butler
From: Jiang Lu lu.ji...@windriver.com

The patch is base upon Jason's commit
[
kgdboc, amba-pl011: rx polling hook for the amba-pl011 driver

The RX polling hook allows the debugger to hook character input so as
to allow entry to the kernel debugger with a control-c as an example.
]

Signed-off-by: Wei Yang wei.y...@windriver.com
---
 drivers/tty/serial/lsi_acp_serial.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/tty/serial/lsi_acp_serial.c 
b/drivers/tty/serial/lsi_acp_serial.c
index 49ffd30..96adf00 100644
--- a/drivers/tty/serial/lsi_acp_serial.c
+++ b/drivers/tty/serial/lsi_acp_serial.c
@@ -333,6 +333,10 @@ acp_serial_rx_chars(struct uart_acp_port *uap)
flag = TTY_FRAME;
}
 
+#ifdef CONFIG_CONSOLE_POLL
+   if (uap-port.poll_rx_cb  uap-port.poll_rx_cb(ch))
+   goto ignore_char;
+#endif
if (uart_handle_sysrq_char(uap-port, ch  255))
goto ignore_char;
 
-- 
1.8.3

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


[linux-yocto] [PATCH 61/87] drivers/dma: Add Common LSI-DMA driver for ACP34xx and AXM55xx.

2013-05-27 Thread Paul Butler
From: Jiang Lu lu.ji...@windriver.com

Signed-off-by: Paul Butler paul.but...@windriver.com
---
 drivers/dma/Kconfig |   8 +
 drivers/dma/Makefile|   1 +
 drivers/dma/lsi-dma32.c | 883 
 drivers/dma/lsi-dma32.h | 224 
 4 files changed, 1116 insertions(+)
 create mode 100644 drivers/dma/lsi-dma32.c
 create mode 100644 drivers/dma/lsi-dma32.h

diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index ef378b5..a5e8525 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -96,6 +96,14 @@ config AT_HDMAC
help
  Support the Atmel AHB DMA controller.
 
+config LSI_DMA
+   tristate LSI General Purpose DMA support
+   select DMA_ENGINE
+   select ASYNC_TX_ENABLE_CHANNEL_SWITCH
+   help
+ Enable support for the LSI General Purpose DMA controller found
+ on ACP34xx, AXM25xx and AXM55xx devices.
+
 config FSL_DMA
tristate Freescale Elo and Elo Plus DMA support
depends on FSL_SOC
diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
index 59c10e5..4e3c958 100644
--- a/drivers/dma/Makefile
+++ b/drivers/dma/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_INTEL_MID_DMAC) += intel_mid_dma.o
 obj-$(CONFIG_DMATEST) += dmatest.o
 obj-$(CONFIG_INTEL_IOATDMA) += ioat/
 obj-$(CONFIG_INTEL_IOP_ADMA) += iop-adma.o
+obj-$(CONFIG_LSI_DMA) += lsi-dma32.o
 obj-$(CONFIG_FSL_DMA) += fsldma.o
 obj-$(CONFIG_MPC512X_DMA) += mpc512x_dma.o
 obj-$(CONFIG_MV_XOR) += mv_xor.o
diff --git a/drivers/dma/lsi-dma32.c b/drivers/dma/lsi-dma32.c
new file mode 100644
index 000..b5d25d8
--- /dev/null
+++ b/drivers/dma/lsi-dma32.c
@@ -0,0 +1,883 @@
+/*
+ * Driver for the LSI DMA controller DMA-32.
+ *
+ * The driver is based on:
+ *
+ * lsi-dma.c - Copyright 2011 Mentor Graphics
+ * acp_gpdma.c - Copyright (c) 2011, Ericsson AB
+ *   Niclas Bengtsson niklas.x.bengts...@ericsson.com
+ *   Kerstin Jonsson kerstin.jons...@ericsson.com
+ *
+ * This 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.
+ * You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+#include linux/export.h
+#include linux/stat.h
+#include linux/module.h
+#include linux/init.h
+#include linux/kref.h
+#include linux/mm.h
+#include linux/interrupt.h
+#include linux/slab.h
+#include linux/platform_device.h
+#include linux/of_platform.h
+#include linux/of_address.h
+#include linux/of_irq.h
+#include linux/of.h
+#include linux/delay.h
+#include asm/page.h
+#include linux/bitops.h
+#include linux/atomic.h
+#include lsi-dma32.h
+
+#define rd32(_addr) readl((_addr))
+#define wr32(_value, _addr) writel((_value), (_addr))
+
+#ifdef DEBUG
+#define engine_dbg(engine, fmt, ...) \
+   do { \
+   struct gpdma_engine *_e = engine; \
+   (void)_e; \
+   printk(KERN_DEBUG dma0:  fmt, ##__VA_ARGS__); \
+   } while (0)
+
+#define ch_dbg(dmac, fmt, ...) \
+   do { \
+   struct gpdma_channel *_c = dmac; \
+   (void)_c; \
+   printk(KERN_DEBUG dma0ch%d: [%s]  fmt, \
+   dmac-channel, __func__, ##__VA_ARGS__); \
+   } while (0)
+#else
+#define engine_dbg(engine, fmt, ...) do {} while (0)
+#define ch_dbg(dmac, fmt, ...)   do {} while (0)
+#endif
+
+
+static dma_cookie_t gpdma_tx_submit(struct dma_async_tx_descriptor *txd);
+
+
+static void reset_channel(struct gpdma_channel *dmac)
+{
+   const int WAIT = 1024;
+   int i;
+
+   /* Pause channel */
+   wr32(DMA_STATUS_CH_PAUS_WR_EN | DMA_STATUS_CH_PAUSE,
+dmac-base+DMA_STATUS);
+   wmb();
+
+   /* Disable channel */
+   wr32(0, dmac-base+DMA_CHANNEL_CONFIG);
+   for (i = 0; rd32(dmac-base+DMA_CHANNEL_CONFIG)  i  WAIT; i++)
+   cpu_relax();
+   if (i == WAIT)
+   ch_dbg(dmac, Failed to DISABLE channel\n);
+
+   /* Clear FIFO */
+   wr32(DMA_CONFIG_CLEAR_FIFO, dmac-base+DMA_CHANNEL_CONFIG);
+   for (i = 0; rd32(dmac-base+DMA_CHANNEL_CONFIG)  i  WAIT; i++)
+   cpu_relax();
+   if (i == WAIT)
+   ch_dbg(dmac, Failed to clear FIFO\n);
+}
+
+static void soft_reset(struct gpdma_engine *engine)
+{
+   int i;
+   u32 cfg;
+
+   /* Reset all channels */
+   for (i = 0; i  engine-chip-num_channels; i++)
+   reset_channel(engine-channel[i]);
+
+   /* Reset GPDMA by writing Magic Number to reset reg */
+   wr32(GPDMA_MAGIC, engine-gbase + SOFT_RESET);
+   wmb();
+
+   /*
+*  Set has to be done twice???
+*  Yep! According to LSI code it has to be done twice,
+*  have no idea why.

[linux-yocto] [PATCH 63/87] SPI:pl022:Update driver to support of-platform drivers

2013-05-27 Thread Paul Butler
From: Jiang Lu lu.ji...@windriver.com

Since the PPC LSI ACP34xx board implements pl022 spi controller,
Update driver register interface to support ppc of-platform style
driver register interface.

The patch abstract the common code of probe, remove  PM routines
between ARM_AMBA style driver and of-platform driver, then fork
a new drivers for ppc of-platform.

The OF style driver extract device information from device-tree, including
cell-index, num-ss-bits, enalbe-dma , io address  irq.

Signed-off-by: Jiang Lu lu.ji...@windriver.com
---
 drivers/spi/Kconfig |   2 +-
 drivers/spi/spi-pl022.c | 316 +++-
 2 files changed, 234 insertions(+), 84 deletions(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 00c0240..71a835b 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -256,7 +256,7 @@ config SPI_ORION
 
 config SPI_PL022
tristate ARM AMBA PL022 SSP controller
-   depends on ARM_AMBA
+   depends on ARM_AMBA || OF_DEVICE
default y if MACH_U300
default y if ARCH_REALVIEW
default y if INTEGRATOR_IMPD1
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 469eb28..16c58a6 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -32,7 +32,12 @@
 #include linux/delay.h
 #include linux/clk.h
 #include linux/err.h
+#ifdef CONFIG_ARM_AMBA
 #include linux/amba/bus.h
+#else
+#include linux/of_platform.h
+#include linux/of.h
+#endif
 #include linux/amba/pl022.h
 #include linux/io.h
 #include linux/slab.h
@@ -41,6 +46,11 @@
 #include linux/scatterlist.h
 #include linux/pm_runtime.h
 
+#ifndef CONFIG_ARM_AMBA
+#define writew(b, addr) writel(b, addr)
+#define readw(addr) readl(addr)
+#endif
+
 /*
  * This macro is used to define some register default values.
  * reg is masked with mask, the OR:ed with an (again masked)
@@ -358,7 +368,11 @@ struct vendor_data {
  * @dummypage: a dummy page used for driving data on the bus with DMA
  */
 struct pl022 {
-   struct amba_device  *adev;
+#ifdef CONFIG_ARM_AMBA
+   struct amba_device  *dev;
+#else
+   struct platform_device  *dev;
+#endif
struct vendor_data  *vendor;
resource_size_t phybase;
void __iomem*virtbase;
@@ -504,7 +518,7 @@ static int flush(struct pl022 *pl022)
 {
unsigned long limit = loops_per_jiffy  1;
 
-   dev_dbg(pl022-adev-dev, flush\n);
+   dev_dbg(pl022-dev-dev, flush\n);
do {
while (readw(SSP_SR(pl022-virtbase))  SSP_SR_MASK_RNE)
readw(SSP_DR(pl022-virtbase));
@@ -644,7 +658,7 @@ static void readwriter(struct pl022 *pl022)
 * unused RX FIFO fill length, regardless of what the TX
 * FIFO status flag indicates.
 */
-   dev_dbg(pl022-adev-dev,
+   dev_dbg(pl022-dev-dev,
%s, rx: %p, rxend: %p, tx: %p, txend: %p\n,
__func__, pl022-rx, pl022-rx_end, pl022-tx, pl022-tx_end);
 
@@ -785,13 +799,13 @@ static void dma_callback(void *data)
struct scatterlist *sg;
unsigned int i;
 
-   dma_sync_sg_for_cpu(pl022-adev-dev,
+   dma_sync_sg_for_cpu(pl022-dev-dev,
pl022-sgt_rx.sgl,
pl022-sgt_rx.nents,
DMA_FROM_DEVICE);
 
for_each_sg(pl022-sgt_rx.sgl, sg, pl022-sgt_rx.nents, i) {
-   dev_dbg(pl022-adev-dev, SPI RX SG ENTRY: %d, i);
+   dev_dbg(pl022-dev-dev, SPI RX SG ENTRY: %d, i);
print_hex_dump(KERN_ERR, SPI RX: ,
   DUMP_PREFIX_OFFSET,
   16,
@@ -801,7 +815,7 @@ static void dma_callback(void *data)
   1);
}
for_each_sg(pl022-sgt_tx.sgl, sg, pl022-sgt_tx.nents, i) {
-   dev_dbg(pl022-adev-dev, SPI TX SG ENTRY: %d, i);
+   dev_dbg(pl022-dev-dev, SPI TX SG ENTRY: %d, i);
print_hex_dump(KERN_ERR, SPI TX: ,
   DUMP_PREFIX_OFFSET,
   16,
@@ -853,7 +867,7 @@ static void setup_dma_scatter(struct pl022 *pl022,
mapbytes, offset_in_page(bufp));
bufp += mapbytes;
bytesleft -= mapbytes;
-   dev_dbg(pl022-adev-dev,
+   dev_dbg(pl022-dev-dev,
set RX/TX target page @ %p, %d bytes, %d 
left\n,
bufp, mapbytes, bytesleft);
}
@@ -867,7 +881,7 @@ static void setup_dma_scatter(struct pl022 *pl022,
sg_set_page(sg, virt_to_page(pl022-dummypage),

[linux-yocto] [PATCH 65/87] powerpc/4xx: add support for the PCIe controller on ACP34xx

2013-05-27 Thread Paul Butler
From: Jiang Lu lu.ji...@windriver.com

Extracted from lsi.patch in lsi_acp_linux_6.8.1.18 tarball.

Add support for the PCIe controller on ACP34xx.

[Jiang: The main modifications include:
* Use dynamic virtual address for PCIe configuration space.
* Remove the fixup for the pci bridge.
* Refactor the setting of dma offset of acp pcie in order not
to mess up the pci-common.c.
* Cleanup code's indend issues.]

Signed-off-by: Jiang Lu lu.ji...@windriver.com
---
 arch/powerpc/sysdev/ppc4xx_pci.c | 954 ++-
 1 file changed, 951 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index 56e8b3c..b6c022d 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -34,8 +34,20 @@
 #include mm/mmu_decl.h
 
 #include ppc4xx_pci.h
+#ifdef CONFIG_ACP
+#include linux/interrupt.h
+#include asm/lsi/acp_ncr.h
+static int acp_plx;
+#endif
+
+#undef PRINT_CONFIG_ACCESSES
+/*#define PRINT_CONFIG_ACCESSES*/
 
 static int dma_offset_set;
+#ifdef CONFIG_ACP
+static u32 last_mpage;
+static u32 last_port;
+#endif
 
 #define U64_TO_U32_LOW(val)((u32)((val)  0xULL))
 #define U64_TO_U32_HIGH(val)   ((u32)((val)  32))
@@ -45,6 +57,11 @@ static int dma_offset_set;
 #define RES_TO_U32_HIGH(val)   \
((sizeof(resource_size_t)  sizeof(u32)) ? U64_TO_U32_HIGH(val) : (0))
 
+
+#define ACPX1_PCIE_MPAGE_UPPER(n) (0x1010 + (n * 8))
+#define ACPX1_PCIE_MPAGE_LOWER(n) (0x1014 + (n * 8))
+
+
 static inline int ppc440spe_revA(void)
 {
/* Catch both 440SPe variants, with and without RAID6 support */
@@ -87,7 +104,36 @@ static void fixup_ppc4xx_pci_bridge(struct pci_dev *dev)
printk(KERN_INFO PCI: Hiding 4xx host bridge resources %s\n,
   pci_name(dev));
 }
+
+
+static void __init
+fixup_acp_pci_bridge(struct pci_dev *dev)
+{
+   /* if we aren't a PCIe don't bother */
+   if (!pci_find_capability(dev, PCI_CAP_ID_EXP))
+   return ;
+
+   /*
+* Set the class appropriately for a bridge device
+*/
+   printk(KERN_INFO
+  PCI: Setting PCI Class to PCI_CLASS_BRIDGE_HOST for 
%04x:%04x\n,
+  dev-vendor, dev-device);
+
+
+   dev-class = PCI_CLASS_BRIDGE_HOST  8;
+
+   /*
+* Make the bridge transparent
+*/
+   dev-transparent = 1;
+
+   return ;
+}
+
 DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, fixup_ppc4xx_pci_bridge);
+DECLARE_PCI_FIXUP_HEADER(0x1000, 0x5101, fixup_acp_pci_bridge);
+DECLARE_PCI_FIXUP_HEADER(0x1000, 0x5108, fixup_acp_pci_bridge);
 
 static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose,
  void __iomem *reg,
@@ -340,6 +386,10 @@ static void __init ppc4xx_probe_pci_bridge(struct 
device_node *np)
   np-full_name);
return;
}
+
+   printk(KERN_INFO %s:%d - %s/0x%llx/0x%llx\n,
+  __FILE__, __LINE__, np-type, rsrc_cfg.start, rsrc_cfg.end);
+
/* Fetch host bridge internal registers address */
if (of_address_to_resource(np, 3, rsrc_reg)) {
printk(KERN_ERR %s: Can't get PCI internal register base !,
@@ -646,6 +696,9 @@ struct ppc4xx_pciex_port
struct resource cfg_space;
struct resource utl_regs;
void __iomem*utl_base;
+#ifdef CONFIG_ACP
+   int acpChipType;
+#endif
 };
 
 static struct ppc4xx_pciex_port *ppc4xx_pciex_ports;
@@ -939,6 +992,34 @@ static struct ppc4xx_pciex_hwops ppc440speB_pcie_hwops 
__initdata =
.check_link = ppc4xx_pciex_check_link_sdr,
 };
 
+#if defined(CONFIG_ACP)
+
+static int __init
+acp_pciex_core_init(struct device_node *np)
+{
+   return 3;
+}
+
+static int
+acp_pciex_port_init_hw(struct ppc4xx_pciex_port *port)
+{
+   return 0;
+}
+
+static int
+acp_pciex_setup_utl(struct ppc4xx_pciex_port *port)
+{
+   return 0;
+}
+
+static struct ppc4xx_pciex_hwops acp_pcie_hwops __initdata = {
+   .core_init  = acp_pciex_core_init,
+   .port_init_hw   = acp_pciex_port_init_hw,
+   .setup_utl  = acp_pciex_setup_utl
+};
+
+#endif
+
 static int __init ppc460ex_pciex_core_init(struct device_node *np)
 {
/* Nothing to do, return 2 ports */
@@ -1419,6 +1500,11 @@ static int __init ppc4xx_pciex_check_core_init(struct 
device_node *np)
if (core_init++)
return 0;
 
+#if defined(CONFIG_ACP)
+   if (of_device_is_compatible(np, lsi,plb-pciex))
+   ppc4xx_pciex_hwops = acp_pcie_hwops;
+#endif
+
 #ifdef CONFIG_44x
if (of_device_is_compatible(np, ibm,plb-pciex-440spe)) {
if (ppc440spe_revA())
@@ -1578,9 +1664,11 @@ static int ppc4xx_pciex_validate_bdf(struct 
ppc4xx_pciex_port *port,
PCI_SLOT(devfn) != 0)
return PCIBIOS_DEVICE_NOT_FOUND;
 
+#ifndef CONFIG_ACP
/* Check if we have 

[linux-yocto] [PATCH 67/87] net/acp: add the netpoll support for acp device

2013-05-27 Thread Paul Butler
From: Jiang Lu lu.ji...@windriver.com

Add the ndo_poll_controller hook function for acp device.

Signed-off-by: Kevin Hao kexin@windriver.com
---
 drivers/net/ethernet/lsi/lsi_acp_net.c | 19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/lsi/lsi_acp_net.c 
b/drivers/net/ethernet/lsi/lsi_acp_net.c
index bc5ee3b..c62db95 100644
--- a/drivers/net/ethernet/lsi/lsi_acp_net.c
+++ b/drivers/net/ethernet/lsi/lsi_acp_net.c
@@ -1722,7 +1722,6 @@ static irqreturn_t appnic_isr(int irq, void *device_id)
  APPNIC_DMA_INTERRUPT_ENABLE);
__napi_schedule(dev-napi);
} else {
-   pr_err(acp-femac: NAPI bug! Int while in poll\n);
write_mac(APPNIC_DMA_INTERRUPT_ENABLE_TRANSMIT,
  APPNIC_DMA_INTERRUPT_ENABLE);
}
@@ -1738,6 +1737,21 @@ static irqreturn_t appnic_isr(int irq, void *device_id)
return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling receive - used by netconsole and other diagnostic tools
+ * to allow network i/o with interrupts disabled.
+ */
+static void
+appnic_poll_controller(struct net_device *dev)
+{
+   disable_irq(dev-irq);
+   appnic_isr(dev-irq, dev);
+   enable_irq(dev-irq);
+}
+
+#endif
+
 /*
  * --
  * appnic_open
@@ -2149,6 +2163,9 @@ static const struct net_device_ops appnic_netdev_ops = {
.ndo_get_stats = appnic_get_stats,
.ndo_set_mac_address = appnic_set_mac_address,
.ndo_start_xmit = appnic_hard_start_xmit,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+   .ndo_poll_controller = appnic_poll_controller,
+#endif
 };
 
 /*
-- 
1.8.3

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


[linux-yocto] [PATCH 68/87] LSI:NIC:Using default value when ubootenv driver not present

2013-05-27 Thread Paul Butler
From: Jiang Lu lu.ji...@windriver.com

Force LSI NIC driver using default value when ubootenv driver not present.

Signed-off-by: Jiang Lu lu.ji...@windriver.com
---
 drivers/net/ethernet/lsi/lsi_acp_net.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/lsi/lsi_acp_net.c 
b/drivers/net/ethernet/lsi/lsi_acp_net.c
index c62db95..f8a5e66 100644
--- a/drivers/net/ethernet/lsi/lsi_acp_net.c
+++ b/drivers/net/ethernet/lsi/lsi_acp_net.c
@@ -2692,7 +2692,7 @@ device_tree_failed:
 * and use hard-coded values for device base addresses.
 */
unsigned char ethaddr_string[20];
-
+#ifdef CONFIG_MTD_NAND_EP501X_UBOOTENV
if (0 != ubootenv_get(ethaddr, ethaddr_string)) {
pr_err(acp-femac: Could not read ethernet address!\n);
return -EBUSY;
@@ -2731,10 +2731,15 @@ device_tree_failed:
 (unsigned long)ioremap(0x002000482000ULL, 0x1000);
appnic_device-interrupt = 33;
}
+#else
+   /* Neither dtb info nor ubootenv driver found. */
+   pr_err(Could not read ethernet address!\n);
+   return -EBUSY;
+#endif
}
 
 device_tree_succeeded:
-
+#ifdef CONFIG_MTD_NAND_EP501X_UBOOTENV
/* Override phy_address with u-boot environment variable if set. */
if (0 == ubootenv_get(phy_address, uboot_env_string)) {
/*
@@ -2765,7 +2770,7 @@ device_tree_succeeded:
return -EBUSY;
appnic_device-ad_value = res;
}
-
+#endif
/* ad_value should never be 0. Use default if so ... */
if (appnic_device-ad_value == 0) {
appnic_device-ad_value = (PHY_AUTONEG_ADVERTISE_100FULL |
-- 
1.8.3

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


[linux-yocto] [PATCH 69/87] powerpc/47x: Kernel support for KEXEC

2013-05-27 Thread Paul Butler
From: Jiang Lu lu.ji...@windriver.com

commit 68343020031585f861d93e2f25589598feadaff3 upstream

This patch adds support for creating 1:1 mapping for the PPC_47x during
a KEXEC. The implementation is similar to that of the PPC440x which is
described here :

http://patchwork.ozlabs.org/patch/104323/

PPC_47x MMU :

The 47x uses Unified TLB 1024 entries, with 4-way associative mapping
(4 x 256 entries). The index to be used is calculated by the MMU by
hashing the PID, EPN and TS. The software can choose to specify the way
by setting bit 0(enable way select) and the way in bits 1-2 in the TLB
Word 0.

Implementation:

The patch erases all the UTLB entries which includes the tlb covering
the mapping for our code. The shadow TLB caches the mapping for the
running code which helps us to continue the execution until we do
isync/rfi. We then create a tmp mapping for the current code in the
other address space (TS) and switch to it.

Then we create a 1:1 mapping(EPN=RPN) for 0-2GiB in the original
address space and switch to the new mapping.

TODO: Add SMP support.

Signed-off-by: Suzuki K. Poulose suz...@in.ibm.com
Signed-off-by: Josh Boyer jwbo...@gmail.com
Integrated-by: Wei Yang wei.y...@windriver.com
---
 arch/powerpc/Kconfig  |   2 +-
 arch/powerpc/kernel/misc_32.S | 194 --
 2 files changed, 189 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 619756f..8a850e4 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -356,7 +356,7 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE
 
 config KEXEC
bool kexec system call (EXPERIMENTAL)
-   depends on (PPC_BOOK3S || FSL_BOOKE || (44x  !SMP  !PPC_47x))  
EXPERIMENTAL
+   depends on (PPC_BOOK3S || FSL_BOOKE || (44x  !SMP))  EXPERIMENTAL
help
  kexec is a system call that implements the ability to shutdown your
  current kernel, and to start another kernel.  It is like a reboot
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index e98d6b0..c85fe05 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -738,7 +738,21 @@ relocate_new_kernel:
mr  r5, r31
 
li  r0, 0
-#elif defined(CONFIG_44x)   !defined(CONFIG_PPC_47x)
+#elif defined(CONFIG_44x)
+
+   /* Save our parameters */
+   mr  r29, r3
+   mr  r30, r4
+   mr  r31, r5
+#ifdef CONFIG_PPC_47x
+   /* Check for 47x cores */
+   mfspr   r3,SPRN_PVR
+   srwir3,r3,16
+   cmplwi  cr0,r3,PVR_476@h
+   beq setup_map_47x
+   cmplwi  cr0,r3,PVR_476_ISS@h
+   beq setup_map_47x
+#endif /* CONFIG_PPC_47x */
 
 /*
  * Code for setting up 1:1 mapping for PPC440x for KEXEC
@@ -753,13 +767,8 @@ relocate_new_kernel:
  * 5) Invalidate the tmp mapping.
  *
  * - Based on the kexec support code for FSL BookE
- * - Doesn't support 47x yet.
  *
  */
-   /* Save our parameters */
-   mr  r29, r3
-   mr  r30, r4
-   mr  r31, r5
 
/* Load our MSR_IS and TID to MMUCR for TLB search */
mfspr   r3,SPRN_PID
@@ -900,6 +909,179 @@ next_tlb:
li  r3, 0
tlbwe   r3, r24, PPC44x_TLB_PAGEID
sync
+   b ppc44x_map_done
+
+#ifdef CONFIG_PPC_47x
+
+   /* 1:1 mapping for 47x */
+
+setup_map_47x:
+
+   /*
+* Load the kernel pid (0) to PID and also to MMUCR[TID].
+* Also set the MSR IS-MMUCR STS
+*/
+   li  r3, 0
+   mtspr   SPRN_PID, r3/* Set PID */
+   mfmsr   r4  /* Get MSR */
+   andi.   r4, r4, MSR_IS@l/* TS=1? */
+   beq 1f  /* If not, leave STS=0 */
+   orisr3, r3, PPC47x_MMUCR_STS@h  /* Set STS=1 */
+1: mtspr   SPRN_MMUCR, r3  /* Put MMUCR */
+   sync
+
+   /* Find the entry we are running from */
+   bl  2f
+2: mflrr23
+   tlbsx   r23, 0, r23
+   tlbre   r24, r23, 0 /* TLB Word 0 */
+   tlbre   r25, r23, 1 /* TLB Word 1 */
+   tlbre   r26, r23, 2 /* TLB Word 2 */
+
+
+   /*
+* Invalidates all the tlb entries by writing to 256 RPNs(r4)
+* of 4k page size in all  4 ways (0-3 in r3).
+* This would invalidate the entire UTLB including the one we are
+* running from. However the shadow TLB entries would help us
+* to continue the execution, until we flush them (rfi/isync).
+*/
+   addis   r3, 0, 0x8000   /* specify the way */
+   addir4, 0, 0/* TLB Word0 = (EPN=0, VALID = 0) */
+   addir5, 0, 0
+   b   clear_utlb_entry
+
+   /* Align the loop to speed things up. from head_44x.S */
+   .align  6
+
+clear_utlb_entry:
+
+   tlbwe   r4, r3, 0
+   tlbwe   r5, r3, 1
+   tlbwe   r5, r3, 2
+   addis   r3, 

[linux-yocto] [PATCH 70/87] powerpc/47x: Enable CRASH_DUMP

2013-05-27 Thread Paul Butler
From: Suzuki Poulose suz...@in.ibm.com

commit 47da421981571c69ef29740cc55fa7248682e167 upstream

Now that we have KEXEC and relocatable kernel working on 47x (!SMP)
enable CRASH_DUMP.

Signed-off-by: Suzuki K. Poulose suz...@in.ibm.com
Signed-off-by: Josh Boyer jwbo...@gmail.com
Integrated-by: Wei Yang wei.y...@windriver.com
---
 arch/powerpc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 8a850e4..3f68c58 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -373,7 +373,7 @@ config KEXEC
 
 config CRASH_DUMP
bool Build a kdump crash kernel
-   depends on PPC64 || 6xx || FSL_BOOKE || (44x  !SMP  !PPC_47x)
+   depends on PPC64 || 6xx || FSL_BOOKE || (44x  !SMP)
select RELOCATABLE if PPC64 || 44x
select DYNAMIC_MEMSTART if FSL_BOOKE
help
-- 
1.8.3

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


[linux-yocto] [PATCH 71/87] powerpc/44x: Fix/Initialize PID to kernel PID before the TLB search

2013-05-27 Thread Paul Butler
From: Wei Yang wei.y...@windriver.com

commit f13bfcc6961a5c9f511c401292db522edcd0b061 upstream

Initialize the PID register with kernel pid (0) before we start
setting the TLB mapping for KEXEC. Also set the MMUCR[TID] to kernel
PID.

This was spotted while testing the kexec on ISS for 47x. ISS  doesn't
return a successful tlbsx for a kernel address with PID set to a user PID.
Though the hardware/qemu/simics work fine.

This patch is harmless and initializes the PID to 0 (kernel PID) which
is usually the case during a normal kernel boot. This would fix the kexec
on ISS for 440. I have tested this patch on sequoia board.

Signed-off-by: Suzuki K Poulose suz...@in.ibm.com
Cc: Josh Boyer jwbo...@gmail.com
Signed-off-by: Josh Boyer jwbo...@gmail.com
Integrated-by: Wei Yang wei.y...@windriver.com
---
 arch/powerpc/kernel/misc_32.S | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S
index c85fe05..0dfc0d5 100644
--- a/arch/powerpc/kernel/misc_32.S
+++ b/arch/powerpc/kernel/misc_32.S
@@ -770,8 +770,12 @@ relocate_new_kernel:
  *
  */
 
-   /* Load our MSR_IS and TID to MMUCR for TLB search */
-   mfspr   r3,SPRN_PID
+   /*
+* Load the PID with kernel PID (0).
+* Also load our MSR_IS and TID to MMUCR for TLB search.
+*/
+   li  r3, 0
+   mtspr   SPRN_PID, r3
mfmsr   r4
andi.   r4,r4,MSR_IS@l
beq wmmucr
-- 
1.8.3

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


[linux-yocto] [PATCH 73/87] powerpc/44x: kexec for SMP 47x

2013-05-27 Thread Paul Butler
From: Jiang Lu lu.ji...@windriver.com

Add SMP support for kexec on acp3400 board.
The implementation is similar to that of the 85xx which is described
here:
commit id: 933a41e419a954ef90605224e02c3ded78f3372 upstream
[
powerpc/85xx: kexec for SMP 85xx BookE systems

Adds support for kexec on 85xx machines for the BookE platform.
Including support for SMP machines
]

Signed-off-by: Wei Yang wei.y...@windriver.com
---
 arch/powerpc/Kconfig   |  4 +-
 arch/powerpc/platforms/44x/acpx1.c | 95 ++
 2 files changed, 97 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 3f68c58..410c9a5 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -356,7 +356,7 @@ config ARCH_ENABLE_MEMORY_HOTREMOVE
 
 config KEXEC
bool kexec system call (EXPERIMENTAL)
-   depends on (PPC_BOOK3S || FSL_BOOKE || (44x  !SMP))  EXPERIMENTAL
+   depends on (PPC_BOOK3S || FSL_BOOKE || 44x)  EXPERIMENTAL
help
  kexec is a system call that implements the ability to shutdown your
  current kernel, and to start another kernel.  It is like a reboot
@@ -373,7 +373,7 @@ config KEXEC
 
 config CRASH_DUMP
bool Build a kdump crash kernel
-   depends on PPC64 || 6xx || FSL_BOOKE || (44x  !SMP)
+   depends on PPC64 || 6xx || FSL_BOOKE || 44x
select RELOCATABLE if PPC64 || 44x
select DYNAMIC_MEMSTART if FSL_BOOKE
help
diff --git a/arch/powerpc/platforms/44x/acpx1.c 
b/arch/powerpc/platforms/44x/acpx1.c
index 2dce7ad..b698275 100644
--- a/arch/powerpc/platforms/44x/acpx1.c
+++ b/arch/powerpc/platforms/44x/acpx1.c
@@ -26,6 +26,8 @@
 #include linux/init.h
 #include linux/of_platform.h
 #include linux/rtc.h
+#include linux/kexec.h
+#include linux/highmem.h
 
 #include asm/machdep.h
 #include asm/prom.h
@@ -36,6 +38,7 @@
 #include asm/mpic.h
 #include asm/mmu.h
 
+#include sysdev/mpic.h
 #include acpclock.h
 
 static __initdata struct of_device_id acpx14xx_of_bus[] = {
@@ -85,6 +88,94 @@ static void __init acpx14xx_init_irq(void)
 }
 
 #ifdef CONFIG_SMP
+#ifdef CONFIG_KEXEC
+atomic_t kexec_down_cpus = ATOMIC_INIT(0);
+void smp_acpx14xx_kexec_cpu_down(int crash_shutdown, int secondary)
+{
+   local_irq_disable();
+
+   if (secondary) {
+   atomic_inc(kexec_down_cpus);
+   while (1);
+   }
+}
+
+static void smp_acpx14xx_kexec_down(void *arg)
+{
+   if (ppc_md.kexec_cpu_down)
+   ppc_md.kexec_cpu_down(0, 1);
+}
+
+static void map_and_flush(unsigned long paddr)
+{
+   struct page *page = pfn_to_page(paddr  PAGE_SHIFT);
+   unsigned long kaddr  = (unsigned long)kmap(page);
+
+   flush_dcache_range(kaddr, kaddr + PAGE_SIZE);
+   kunmap(page);
+}
+
+static void smp_acpx14xx_flush_dcache_kexec(struct kimage *image)
+{
+   kimage_entry_t *ptr, entry;
+   unsigned long paddr;
+   int i;
+
+   if (image-type == KEXEC_TYPE_DEFAULT) {
+   /* normal kexec images are stored in temporary pages */
+   for (ptr = image-head; (entry = *ptr)  !(entry  IND_DONE);
+ptr = (entry  IND_INDIRECTION) ?
+   phys_to_virt(entry  PAGE_MASK) : ptr + 1) {
+   if (!(entry  IND_DESTINATION))
+   map_and_flush(entry);
+   }
+   /* flush out last IND_DONE page */
+   map_and_flush(entry);
+   } else {
+   /* crash type kexec images are copied to the crash region */
+   for (i = 0; i  image-nr_segments; i++) {
+   struct kexec_segment *seg = image-segment[i];
+   for (paddr = seg-mem; paddr  seg-mem + seg-memsz;
+paddr += PAGE_SIZE) {
+   map_and_flush(paddr);
+   }
+   }
+   }
+
+   /* also flush the kimage struct to be passed in as well */
+   flush_dcache_range((unsigned long)image,
+  (unsigned long)image + sizeof(*image));
+}
+
+static void smp_acpx14xx_machine_kexec(struct kimage *image)
+{
+   int timeout = INT_MAX;
+   int i, num_cpus = num_present_cpus();
+
+   smp_acpx14xx_flush_dcache_kexec(image);
+
+   if (image-type == KEXEC_TYPE_DEFAULT)
+   smp_call_function(smp_acpx14xx_kexec_down, NULL, 0);
+
+   while ((atomic_read(kexec_down_cpus) != (num_cpus - 1)) 
+   (timeout  0)) {
+
+   timeout--;
+   }
+
+   if (!timeout)
+   printk(KERN_ERR Unable to bring down secondary cpu(s));
+
+   for_each_online_cpu(i) {
+   if (i == smp_processor_id())
+   continue;
+   mpic_reset_core(i);
+   }
+
+   default_machine_kexec(image);
+}
+#endif /* CONFIG_KEXEC */
+
 static void __cpuinit smp_acpx14xx_setup_cpu(int cpu)
 {
mpic_setup_this_cpu();
@@ -139,6 

[linux-yocto] [PATCH 76/87] PowerPC:ACP34xx:Add support for pl061 gpio driver

2013-05-27 Thread Paul Butler
From: Jiang Lu lu.ji...@windriver.com

ACP34xx GPIO block is consist of 2 ARM PrimeCell GPIO (PL061). Each
provide 8 gpio pins. The pins 4, 8, 11, 13(index starting from 0)
are reserved for some hardware.

The interrupt lines for each gpio (GPIOMIS[7:0]) are not connected
to PIC, it does not match the gpiolib framework's requirement.
As result, in dts for ACP34xx, the node for pl061 gpio should not
contain irq entry.

The driver update pl061 driver to use ACP34xx specific io routines,
and load init-pin map from device-tree to reserve certain pins for
hardware.

Signed-off-by: Jiang Lu lu.ji...@windriver.com
---
 drivers/gpio/gpio-pl061.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index a87b4d4..9d35136 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -30,6 +30,13 @@
 #include linux/slab.h
 #include linux/pm.h
 
+#ifdef CONFIG_PPC
+#define readb(addr) ((char)readl(addr))
+#define writeb(b, addr) writel(b, addr)
+
+#define GPIO_AFSEL 0x420
+#endif
+
 #define GPIODIR 0x400
 #define GPIOIS  0x404
 #define GPIOIBE 0x408
@@ -440,6 +447,13 @@ static int __devinit pl061_of_probe(struct platform_device 
*ofdev)
 
if (ret  0)
return ret;
+
+   prop = of_get_property(ofdev-dev.of_node, pins-map, len);
+   if (!prop || len  sizeof(*prop))
+   dev_warn(ofdev-dev, no 'pins-map' property\n);
+   else
+   writeb(*prop, chip-base + GPIO_AFSEL);
+
return 0;
 }
 
-- 
1.8.3

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


[linux-yocto] [PATCH 78/87] powerpc/acpx1: add early debug support for acpx1 board

2013-05-27 Thread Paul Butler
From: Kevin Hao kexin@windriver.com

This is based on the lsi.patch in lsi_acp_linux_3.8.1.28 tarball.

Signed-off-by: Kevin Hao kexin@windriver.com
---
 arch/powerpc/kernel/udbg_16550.c | 52 
 1 file changed, 52 insertions(+)

diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c
index 6837f83..c214a96 100644
--- a/arch/powerpc/kernel/udbg_16550.c
+++ b/arch/powerpc/kernel/udbg_16550.c
@@ -218,6 +218,57 @@ void udbg_init_pas_realmode(void)
 #endif /* CONFIG_PPC_MAPLE */
 
 #ifdef CONFIG_PPC_EARLY_DEBUG_44x
+#if defined(CONFIG_ACP)
+
+#include asm/io.h
+#include asm/udbg.h
+#include linux/amba/serial.h
+
+static void *uart_base;
+
+static void
+acp_putc(char c)
+{
+   while (0 != (in_le32(uart_base + UART01x_FR)  UART01x_FR_TXFF))
+   ;
+
+   if ('\n' == c) {
+   out_le32(uart_base + UART01x_DR, '\r');
+   while (0 != (in_le32(uart_base + UART01x_FR)  UART01x_FR_TXFF))
+   ;
+   }
+
+   out_le32(uart_base + UART01x_DR, c);
+
+   return;
+}
+
+static int
+acp_getc(void)
+{
+   while (0 != (in_le32(uart_base + UART01x_FR)  UART01x_FR_RXFE))
+   ;
+   return in_le32(uart_base + UART01x_DR);
+}
+
+void __init
+udbg_init_44x_as1(void)
+{
+   uart_base = (void *)0xf0004000; /* 34xx UART0 address... */
+
+   if (0x11 != in_le32(uart_base + 0xfe0) ||
+   0x10 != in_le32(uart_base + 0xfe4) ||
+   0x24 != in_le32(uart_base + 0xfe8) ||
+   0x00 != in_le32(uart_base + 0xfec))
+   uart_base = (void *)0xf0024000; /* 25xx UART0 address... */
+   udbg_putc = acp_putc;
+   udbg_getc = acp_getc;
+
+   return;
+}
+
+#else  /* CONFIG_ACP */
+
 #include platforms/44x/44x.h
 
 static void udbg_44x_as1_flush(void)
@@ -257,6 +308,7 @@ void __init udbg_init_44x_as1(void)
udbg_flush = udbg_44x_as1_flush;
udbg_getc = udbg_44x_as1_getc;
 }
+#endif /* CONFIG_ACP */
 #endif /* CONFIG_PPC_EARLY_DEBUG_44x */
 
 #ifdef CONFIG_PPC_EARLY_DEBUG_40x
-- 
1.8.3

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


[linux-yocto] [PATCH 77/87] ACP34xx:Add device tree for ACP344x v2 board

2013-05-27 Thread Paul Butler
From: Jiang Lu lu.ji...@windriver.com

Add device tree for ACP344x v2 board, the dts extracted from
lsi_axxia_u-boot_4.8.1.78, with following modification:
 *Add nand flash partition info.
 *Add gpio, dma, i2c, ssp device info.

Signed-off-by: Jiang Lu lu.ji...@windriver.com
---
 arch/powerpc/boot/dts/ACP344xV2.dts | 487 
 1 file changed, 487 insertions(+)
 create mode 100644 arch/powerpc/boot/dts/ACP344xV2.dts

diff --git a/arch/powerpc/boot/dts/ACP344xV2.dts 
b/arch/powerpc/boot/dts/ACP344xV2.dts
new file mode 100644
index 000..1a4040f
--- /dev/null
+++ b/arch/powerpc/boot/dts/ACP344xV2.dts
@@ -0,0 +1,487 @@
+/*
+ * 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;
+};
+
+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; // Fixed by the boot loader
+reset-type = 3; // 1=core, 2=chip, 3=system (default)
+};
+cpu@2 {
+device_type = cpu;
+model = PowerPC,4xx; // real CPU changed in sim
+reg = 2;
+clock-frequency = 0; // filled in by U-Boot
+timebase-frequency = 0; // filled in by U-Boot
+i-cache-line-size = 32;
+d-cache-line-size = 32;
+i-cache-size = 32768;
+d-cache-size = 32768;
+dcr-controller;
+dcr-access-method = native;
+status = disabled;
+enable-method = spin-table;
+cpu-release-addr = 0 0; // Fixed by the boot loader
+reset-type = 3; // 1=core, 2=chip, 3=system (default)
+};
+cpu@3 {
+device_type = cpu;
+model = PowerPC,4xx; // real CPU changed in sim
+reg = 3;
+clock-frequency = 0; // filled in by U-Boot
+timebase-frequency = 0; // filled in by U-Boot
+i-cache-line-size = 32;
+d-cache-line-size = 32;
+i-cache-size = 32768;
+d-cache-size = 32768;
+dcr-controller;
+dcr-access-method = native;
+status = disabled;
+enable-method = spin-table;
+cpu-release-addr = 0 0; // Fixed by the boot loader
+reset-type = 3; // 1=core, 2=chip, 3=system (default)
+};
+};
+
+memory {
+

[linux-yocto] [PATCH 79/87] powerpc/acpx1: make udbg do IO access in AS1

2013-05-27 Thread Paul Butler
From: Kevin Hao kexin@windriver.com

When using udbg on acpx1, we must be sure that all the IO accesses
are in AS1 because the tlb we create for early debug is set with AS1.
This is also compatible with other 4xx device.

Signed-off-by: Kevin Hao kexin@windriver.com
---
 arch/powerpc/kernel/udbg_16550.c | 30 --
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c
index c214a96..e7baf51 100644
--- a/arch/powerpc/kernel/udbg_16550.c
+++ b/arch/powerpc/kernel/udbg_16550.c
@@ -223,32 +223,34 @@ void udbg_init_pas_realmode(void)
 #include asm/io.h
 #include asm/udbg.h
 #include linux/amba/serial.h
+#include platforms/44x/44x.h
 
 static void *uart_base;
 
 static void
-acp_putc(char c)
+acp_putc_as1(char c)
 {
-   while (0 != (in_le32(uart_base + UART01x_FR)  UART01x_FR_TXFF))
+
+   while (0 != (as1_readb(uart_base + UART01x_FR)  UART01x_FR_TXFF))
;
 
if ('\n' == c) {
-   out_le32(uart_base + UART01x_DR, '\r');
-   while (0 != (in_le32(uart_base + UART01x_FR)  UART01x_FR_TXFF))
+   as1_writeb('\r', uart_base + UART01x_DR);
+   while (0 != (as1_readb(uart_base + UART01x_FR)  
UART01x_FR_TXFF))
;
}
 
-   out_le32(uart_base + UART01x_DR, c);
+   as1_writeb(c, uart_base + UART01x_DR);
 
return;
 }
 
 static int
-acp_getc(void)
+acp_getc_as1(void)
 {
-   while (0 != (in_le32(uart_base + UART01x_FR)  UART01x_FR_RXFE))
+   while (0 != (as1_readb(uart_base + UART01x_FR)  UART01x_FR_RXFE))
;
-   return in_le32(uart_base + UART01x_DR);
+   return as1_readb(uart_base + UART01x_DR);
 }
 
 void __init
@@ -256,13 +258,13 @@ udbg_init_44x_as1(void)
 {
uart_base = (void *)0xf0004000; /* 34xx UART0 address... */
 
-   if (0x11 != in_le32(uart_base + 0xfe0) ||
-   0x10 != in_le32(uart_base + 0xfe4) ||
-   0x24 != in_le32(uart_base + 0xfe8) ||
-   0x00 != in_le32(uart_base + 0xfec))
+   if (0x11 != as1_readb(uart_base + 0xfe0) ||
+   0x10 != as1_readb(uart_base + 0xfe4) ||
+   0x24 != as1_readb(uart_base + 0xfe8) ||
+   0x00 != as1_readb(uart_base + 0xfec))
uart_base = (void *)0xf0024000; /* 25xx UART0 address... */
-   udbg_putc = acp_putc;
-   udbg_getc = acp_getc;
+   udbg_putc = acp_putc_as1;
+   udbg_getc = acp_getc_as1;
 
return;
 }
-- 
1.8.3

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


[linux-yocto] [PATCH 80/87] powerpc/mpic: Create a revmap with enough entries for IPIs and timers

2013-05-27 Thread Paul Butler
From: Benjamin Herrenschmidt b...@kernel.crashing.org

upstream commit: 574ce79cea9d3fda109ffcc82f81733de4740e5c

The current mpic code creates a linear revmap just big enough for all
the sources, which happens to miss the IPIs and timers on some machines.

This will in turn break when the irqdomain code loses the fallback of
doing a linear search when the revmap fails (and really slows down IPIs
otherwise).

This happens for example on the U4 based Apple machines such as the
dual core PowerMac G5s.

Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org
[Yongli: Change the 'intvec_top' to 'intvec_top + 1' since we need pass
the irq count to function irq_domain_add_linear.]
Signed-off-by: Yongli He yongli...@windriver.com
---
 arch/powerpc/sysdev/mpic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 395af13..9ee7043 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1376,7 +1376,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
mpic-isu_mask = (1  mpic-isu_shift) - 1;
 
mpic-irqhost = irq_domain_add_linear(mpic-node,
-  last_irq + 1,
+  intvec_top + 1,
   mpic_host_ops, mpic);
 
/*
-- 
1.8.3

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


[linux-yocto] [PATCH 82/87] drivers/crypto/amcc/crypto4xx_core.c: added include for linux/module.h

2013-05-27 Thread Paul Butler
THIS_MODULE is left undefined and this fails to compile.
Needs to include linux/module.h

Signed-off-by: Paul Butler paul.but...@windriver.com
---
 drivers/crypto/amcc/crypto4xx_core.c | 31 ---
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/crypto/amcc/crypto4xx_core.c 
b/drivers/crypto/amcc/crypto4xx_core.c
index 13f8e1a..b554332 100644
--- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -19,6 +19,7 @@
  */
 
 #include linux/kernel.h
+#include linux/module.h
 #include linux/interrupt.h
 #include linux/spinlock_types.h
 #include linux/random.h
@@ -530,7 +531,7 @@ static u32 crypto4xx_fill_one_page(struct crypto4xx_device 
*dev,
(*idx)++;
 
return 0;
-}
+   }
 }
 
 static void crypto4xx_copy_pkt_to_dst(struct crypto4xx_device *dev,
@@ -1127,27 +1128,27 @@ static irqreturn_t crypto4xx_ce_interrupt_handler(int 
irq, void *data)
 struct crypto4xx_alg_common crypto4xx_alg[] = {
/* Crypto AES modes */
{ .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = {
-   .cra_name   = cbc(aes),
+   .cra_name   = cbc(aes),
.cra_driver_name = cbc-aes-ppc4xx,
-   .cra_priority   = CRYPTO4XX_CRYPTO_PRIORITY,
-   .cra_flags  = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
-   .cra_blocksize  = AES_BLOCK_SIZE,
-   .cra_ctxsize= sizeof(struct crypto4xx_ctx),
-   .cra_type   = crypto_ablkcipher_type,
+   .cra_priority   = CRYPTO4XX_CRYPTO_PRIORITY,
+   .cra_flags  = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC,
+   .cra_blocksize  = AES_BLOCK_SIZE,
+   .cra_ctxsize= sizeof(struct crypto4xx_ctx),
+   .cra_type   = crypto_ablkcipher_type,
.cra_init   = crypto4xx_alg_init,
.cra_exit   = crypto4xx_alg_exit,
-   .cra_module = THIS_MODULE,
-   .cra_u  = {
+   .cra_module = THIS_MODULE,
+   .cra_u  = {
.ablkcipher = {
-   .min_keysize= AES_MIN_KEY_SIZE,
-   .max_keysize= AES_MAX_KEY_SIZE,
+   .min_keysize= AES_MIN_KEY_SIZE,
+   .max_keysize= AES_MAX_KEY_SIZE,
.ivsize = AES_IV_SIZE,
-   .setkey = crypto4xx_setkey_aes_cbc,
-   .encrypt= crypto4xx_encrypt,
-   .decrypt= crypto4xx_decrypt,
+   .setkey = crypto4xx_setkey_aes_cbc,
+   .encrypt= crypto4xx_encrypt,
+   .decrypt= crypto4xx_decrypt,
}
}
-   }},
+   } },
 };
 
 /**
-- 
1.8.3

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


[linux-yocto] [PATCH 83/87] LSI acp34xx: Fixed build error in acp34xx serial driver

2013-05-27 Thread Paul Butler
From: David Mercado david.merc...@windriver.com

Removed new section of CONFIG_CONSOLE_POLL code that broke the
driver build.

Signed-off-by: David Mercado david.merc...@windriver.com
---
 drivers/tty/serial/lsi_acp_serial.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/tty/serial/lsi_acp_serial.c 
b/drivers/tty/serial/lsi_acp_serial.c
index 96adf00..49ffd30 100644
--- a/drivers/tty/serial/lsi_acp_serial.c
+++ b/drivers/tty/serial/lsi_acp_serial.c
@@ -333,10 +333,6 @@ acp_serial_rx_chars(struct uart_acp_port *uap)
flag = TTY_FRAME;
}
 
-#ifdef CONFIG_CONSOLE_POLL
-   if (uap-port.poll_rx_cb  uap-port.poll_rx_cb(ch))
-   goto ignore_char;
-#endif
if (uart_handle_sysrq_char(uap-port, ch  255))
goto ignore_char;
 
-- 
1.8.3

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


[linux-yocto] [PATCH 81/87] drivers/usb: ehci-ci13612.c replaced hard-coded address and irq to use dtb

2013-05-27 Thread Paul Butler
Signed-off-by: Paul Butler paul.but...@windriver.com
---
 drivers/usb/host/ehci-ci13612.c | 17 -
 drivers/usb/host/ehci-ci13612.h |  9 -
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/usb/host/ehci-ci13612.c b/drivers/usb/host/ehci-ci13612.c
index 8b7102f..34a48b3 100644
--- a/drivers/usb/host/ehci-ci13612.c
+++ b/drivers/usb/host/ehci-ci13612.c
@@ -163,7 +163,7 @@ static int ci13612_ehci_probe(struct platform_device *pdev)
int retval;
struct device_node *np = pdev-dev.of_node;
const int *enabled;
-
+   struct resource *res;
 
enabled = of_get_property(np, enabled, NULL);
if (!enabled || !*enabled)
@@ -173,10 +173,10 @@ static int ci13612_ehci_probe(struct platform_device 
*pdev)
return -ENODEV;
 
/* Map the irq in the PPC476 to get the irq number */
-   irq = irq_create_mapping(NULL, 31);
+   irq = platform_get_irq(pdev, 0);
 
if (NO_IRQ == irq) {
-   dev_dbg(pdev-dev, error mapping irq number\n);
+   dev_dbg(pdev-dev, error getting irq number\n);
retval = -EBUSY;
goto fail_create_hcd;
}
@@ -187,14 +187,21 @@ static int ci13612_ehci_probe(struct platform_device 
*pdev)
goto fail_create_hcd;
}
 
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   if (!res) {
+   dev_err(pdev-dev, Error: resource addr %s setup!\n,
+   dev_name(pdev-dev));
+   return -ENODEV;
+   }
+
hcd = usb_create_hcd(driver, pdev-dev, dev_name(pdev-dev));
if (!hcd) {
retval = -ENOMEM;
goto fail_create_hcd;
}
 
-   hcd-rsrc_start = ci13612_PHY_ADDR;
-   hcd-rsrc_len = 0x2;
+   hcd-rsrc_start = res-start;
+   hcd-rsrc_len = resource_size(res);
 
hcd-regs = of_iomap(np, 0);
if (!hcd-regs) {
diff --git a/drivers/usb/host/ehci-ci13612.h b/drivers/usb/host/ehci-ci13612.h
index 9d296ce..b257cf7 100644
--- a/drivers/usb/host/ehci-ci13612.h
+++ b/drivers/usb/host/ehci-ci13612.h
@@ -1,13 +1,4 @@
 /*
- * System definitions
- */
-#define ci13612_PHY_ADDR   0x0020004AULL
-#define ci13162_PHY_ADDR_SIZE  0x2
-
-#define GPREG_PHY_ADDR 0x00200040C000ULL
-#define GPREG_PHY_ADDR_SIZE0x1000
-
-/*
  * Host interface registers
  */
 
-- 
1.8.3

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


[linux-yocto] [PATCH 22/87] LSI axm55xx: Add multi-cluster support for up to 16 cores

2013-05-27 Thread Paul Butler
From: David Mercado david.merc...@windriver.com

The LSI axm55xx platform can have up to four clusters, each having four
A15 cores (so up to a total of 16 cores). The current setup assumes that
a single GIC will handle the IPI interrupts on a platform, but a single
GIC can only handle up to eight cores. On the axm55xx platform, an
external distributed interrupt IPI block is used in place of the GIC
software generated IPIs. In this commit, we replace the use of the
standard GIC driver with a axm55xx specific one that supports multiple
clusters.

Signed-off-by: David Mercado david.merc...@windriver.com
Signed-off-by: Wang Hui hui.w...@windriver.com
---
 arch/arm/boot/dts/axm-sim.dts|   80 +-
 arch/arm/boot/fmboot/fmboot.S|7 +-
 arch/arm/mach-axxia/Kconfig  |   13 +-
 arch/arm/mach-axxia/Makefile |1 +
 arch/arm/mach-axxia/axxia-gic.c  | 1133 ++
 arch/arm/mach-axxia/axxia.c  |   10 +-
 arch/arm/mach-axxia/headsmp.S|4 +-
 arch/arm/mach-axxia/include/mach/axxia-gic.h |   16 +
 arch/arm/mach-axxia/platsmp.c|   68 +-
 9 files changed, 1295 insertions(+), 37 deletions(-)
 create mode 100644 arch/arm/mach-axxia/axxia-gic.c
 create mode 100644 arch/arm/mach-axxia/include/mach/axxia-gic.h

diff --git a/arch/arm/boot/dts/axm-sim.dts b/arch/arm/boot/dts/axm-sim.dts
index 5977691..bb46808 100644
--- a/arch/arm/boot/dts/axm-sim.dts
+++ b/arch/arm/boot/dts/axm-sim.dts
@@ -1,5 +1,5 @@
 /*
- * arch/arm/boot/dts/axm5500-sim.dts
+ * arch/arm/boot/dts/axm-sim.dts
  *
  * Copyright (C) 2012 LSI
  *
@@ -64,6 +64,78 @@
compatible = arm,cortex-a15;
reg = 3;
};
+
+   cpu@4 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 4;
+   };
+
+   cpu@5 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 5;
+   };
+
+   cpu@6 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 6;
+   };
+
+   cpu@7 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 7;
+   };
+
+   cpu@8 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 8;
+   };
+
+   cpu@9 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 9;
+   };
+
+   cpu@10 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 10;
+   };
+
+   cpu@11 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 11;
+   };
+
+   cpu@12 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 12;
+   };
+
+   cpu@13 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 13;
+   };
+
+   cpu@14 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 14;
+   };
+
+   cpu@15 {
+   device_type = cpu;
+   compatible = arm,cortex-a15;
+   reg = 15;
+   };
};
 
memory@ {
@@ -76,8 +148,10 @@
#interrupt-cells = 3;
#address-cells = 0;
interrupt-controller;
-   reg = 0x20 0x01001000 0 0x1000,
- 0x20 0x01002000 0 0x100;
+   reg = 0x20 0x01001000 0 0x1000,  /* gic dist base */
+ 0x20 0x01002000 0 0x100,   /* gic cpu base */
+ 0x20 0x1003 0 0x100,   /* axm IPI mask reg base */
+ 0x20 0x1004 0 0x2; /* axm IPI send reg base */
};
 
timer {
diff --git a/arch/arm/boot/fmboot/fmboot.S b/arch/arm/boot/fmboot/fmboot.S
index cd52371..576d1df 100644
--- a/arch/arm/boot/fmboot/fmboot.S
+++ b/arch/arm/boot/fmboot/fmboot.S
@@ -28,7 +28,7 @@ _start:
@ CPU initialisation
@
mrc p15, 0, r0, c0, c0, 5   @ MPIDR (ARMv7 only)
-   and r0, r0, #15 @ CPU number
+   bic r0, #0xff00 @ CPU number
cmp r0, #0  @ primary CPU?
beq 2f
 
@@ -39,13 

Re: [linux-yocto] [PATCH 08/87] drivers/usb/host/ehci-ci13612.c: replaced bugzilla comments

2013-05-27 Thread Bruce Ashfield

On 13-05-27 12:55 PM, Paul Butler wrote:

Signed-off-by: Paul Butler paul.but...@windriver.com


Why wasn't this squashed into patch 4/87 ?

Bruce


---
  drivers/usb/host/ehci-ci13612.c | 7 +++
  1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ehci-ci13612.c b/drivers/usb/host/ehci-ci13612.c
index 5d3a6bc..151376c 100644
--- a/drivers/usb/host/ehci-ci13612.c
+++ b/drivers/usb/host/ehci-ci13612.c
@@ -27,13 +27,12 @@
  #include ehci-ci13612.h


-/* Patch the code to fix the bugs in Bugzilla */
  static void ci13612_usb_setup(struct usb_hcd *hcd)
  {
int USB_TXFIFOTHRES, VUSB_HS_TX_BURST;

-   /* fix Bugzilla #31874 */
-   /* fix Bugzilla #32212 */
+   /* Fix a HW erratum where the USB core may overrun its transmit FIFO. */
+   /* Fix a HW erratum where the USB core may incorrectly fill its 
transmit FIFO. */
VUSB_HS_TX_BURST = inl(USB_HWTXBUF)  0x0f;
USB_TXFIFOTHRES = (inl(USB_TXFILLTUNING)  0x3f)  16;

@@ -94,7 +93,7 @@ static int ehci_run_fix(struct usb_hcd *hcd)
unsigned burst_size;
int retval;

-   /* fix Bugzilla 33669 */
+   /* Fix a HW erratum during the USB reset process. */
port_status = ehci_readl(ehci, ehci-regs-port_status[0]);
printk(KERN_INFO ehci_run: port_status = 0x%x\n, port_status);
if (port_status  0x100) {



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


Re: [linux-yocto] [PATCH 09/87] drivers/usb/host/ehci-ci13612.c: fix a burst size issue

2013-05-27 Thread Bruce Ashfield

On 13-05-27 12:55 PM, Paul Butler wrote:

Fix an issue that we found with the burst size on the AXI bus.


Typically we elaborate on issues .. what is the user visible symptom
that someone sees with this problem ? That should be in the commit log,
as well as an explanation of how this fixes the problem.

Also, if this is the driver introduced in patch 4/87, why are we
keeping this distinct ? As documentation of who did what work ? Or
something else ?

Cheers,

Bruce



Signed-off-by: Paul Butler paul.but...@windriver.com
---
  drivers/usb/host/ehci-ci13612.c | 37 +++--
  drivers/usb/host/ehci-ci13612.h |  3 +++
  2 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/host/ehci-ci13612.c b/drivers/usb/host/ehci-ci13612.c
index 151376c..8b7102f 100644
--- a/drivers/usb/host/ehci-ci13612.c
+++ b/drivers/usb/host/ehci-ci13612.c
@@ -30,15 +30,32 @@
  static void ci13612_usb_setup(struct usb_hcd *hcd)
  {
int USB_TXFIFOTHRES, VUSB_HS_TX_BURST;
+   u32 deviceMode;
+   struct ehci_hcd *ehci = hcd_to_ehci(hcd);

/* Fix a HW erratum where the USB core may overrun its transmit FIFO. */
-   /* Fix a HW erratum where the USB core may incorrectly fill its 
transmit FIFO. */
+   /* Fix a HW erratum where the USB core may incorrectly fill its
+* transmit FIFO.
+*/
VUSB_HS_TX_BURST = inl(USB_HWTXBUF)  0x0f;
USB_TXFIFOTHRES = (inl(USB_TXFILLTUNING)  0x3f)  16;

-   printk(KERN_INFO ehci-ci13612 (ci13612_usb_setup): 
-VUSB_HS_TX_BURST = 0x%x, USB_TXFIFOTHRES = 0x%x\n,
-VUSB_HS_TX_BURST, USB_TXFIFOTHRES);
+   /* Fix related to an issue that we found with the burst size on
+* the AXI bus check if device or host mode
+*/
+   deviceMode = ehci_readl(ehci, hcd-regs + 0x1A8);
+
+   if ((deviceMode  0x3) == 0x2) {
+   /* device mode */
+   writel(0x0, hcd-regs + 0x90);
+   } else if ((deviceMode  0x3) == 0x3) {
+   /* host mode */
+   writel(0x6, hcd-regs + 0x90);
+   }
+
+   printk(KERN_INFO
+  ehci-ci13612 (ci13612_usb_setup): VUSB_HS_TX_BURST = 0x%x, 
USB_TXFIFOTHRES = 0x%x\n,
+   VUSB_HS_TX_BURST, USB_TXFIFOTHRES);

return;
  }
@@ -97,8 +114,8 @@ static int ehci_run_fix(struct usb_hcd *hcd)
port_status = ehci_readl(ehci, ehci-regs-port_status[0]);
printk(KERN_INFO ehci_run: port_status = 0x%x\n, port_status);
if (port_status  0x100) {
-   printk(KERN_ERR USB port is in reset status, not able to 
-   change host controller status to run\n);
+   printk(KERN_ERR
+  USB port is in reset status, not able to change host 
controller status to run\n);
return -EFAULT;
}

@@ -187,13 +204,13 @@ static int ci13612_ehci_probe(struct platform_device 
*pdev)
}

/* FIXME: This reported error since we don't have a second register
- *  area defined in our dtb. Should we add it or stay backwards 
compatible ?
- */
+* area defined in our dtb. Should we add it or stay backwards
+* compatible ?
+*/
gpreg_base = of_iomap(np, 1);
if (!gpreg_base) {
dev_warn(pdev-dev, of_iomap error can't map region 1\n);
-   }
-   else {
+   } else {
/* Setup GPREG for USB to enable the 6-bit address line */
writel(0x0, gpreg_base + 0x8);

diff --git a/drivers/usb/host/ehci-ci13612.h b/drivers/usb/host/ehci-ci13612.h
index bbba3f4..9d296ce 100644
--- a/drivers/usb/host/ehci-ci13612.h
+++ b/drivers/usb/host/ehci-ci13612.h
@@ -4,6 +4,9 @@
  #define ci13612_PHY_ADDR  0x0020004AULL
  #define ci13162_PHY_ADDR_SIZE 0x2

+#define GPREG_PHY_ADDR 0x00200040C000ULL
+#define GPREG_PHY_ADDR_SIZE0x1000
+
  /*
   * Host interface registers
   */



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


Re: [linux-yocto] [PATCH 12/87] arch/arm/boot/fmboot: adding support for Fast Models

2013-05-27 Thread Bruce Ashfield

On 13-05-27 12:55 PM, Paul Butler wrote:

What's a fast model ? .. yes I'm playing dumb, but patch headers should
describe the common questions about code they introduce.

Bruce


Signed-off-by: Paul Butler paul.but...@windriver.com
---
  arch/arm/boot/fmboot/Makefile   | 25 +
  arch/arm/boot/fmboot/fmboot.S   | 80 +
  arch/arm/boot/fmboot/fmboot.lds | 30 
  arch/arm/boot/fmboot/pack.py| 10 ++
  4 files changed, 145 insertions(+)
  create mode 100644 arch/arm/boot/fmboot/Makefile
  create mode 100644 arch/arm/boot/fmboot/fmboot.S
  create mode 100644 arch/arm/boot/fmboot/fmboot.lds
  create mode 100644 arch/arm/boot/fmboot/pack.py

diff --git a/arch/arm/boot/fmboot/Makefile b/arch/arm/boot/fmboot/Makefile
new file mode 100644
index 000..9b2b42e
--- /dev/null
+++ b/arch/arm/boot/fmboot/Makefile
@@ -0,0 +1,25 @@
+# Build an image for Fast Models
+
+AS = $(CROSS_COMPILE)gcc -c
+LD = $(CROSS_COMPILE)ld
+
+DTC = ../../../../scripts/dtc/dtc
+DTS = ../dts/axm-sim.dts
+ZIMAGE = ../zImage
+
+all: clean linux.fm
+
+clean:
+   rm -f linux.fm fmboot.o zImage.fm axm-sim.dtb
+
+linux.fm: fmboot.o fmboot.lds zImage.fm
+   $(LD) -o $@ --script=fmboot.lds
+
+zImage.fm: $(ZIMAGE) axm-sim.dtb
+   python pack.py $(ZIMAGE) axm-sim.dtb  $@
+
+axm-sim.dtb: $(DTS)
+   $(DTC) -O dtb -o $@ $
+
+fmboot.o: fmboot.S
+   $(AS) -o $@ $
diff --git a/arch/arm/boot/fmboot/fmboot.S b/arch/arm/boot/fmboot/fmboot.S
new file mode 100644
index 000..cd52371
--- /dev/null
+++ b/arch/arm/boot/fmboot/fmboot.S
@@ -0,0 +1,80 @@
+/*
+ * boot.S - simple register setup code for stand-alone Linux booting
+ *
+ * Copyright (C) 2011 ARM Limited. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE.txt file.
+ */
+
+#define SPIN_TABLE_BASE 0x1000
+
+   .syntax unified
+   .text
+
+   .globl  _start
+_start:
+   @
+   @ Program architected timer frequency
+   @
+   mrc p15, 0, r0, c0, c1, 1   @ CPUID_EXT_PFR1
+   lsr r0, r0, #16
+   andsr0, r0, #1  @ Check generic timer support
+   beq 1f
+   ldr r0, =1  @ 100MHz timer frequency
+   mcr p15, 0, r0, c14, c0, 0  @ CNTFRQ
+1:
+   @
+   @ CPU initialisation
+   @
+   mrc p15, 0, r0, c0, c0, 5   @ MPIDR (ARMv7 only)
+   and r0, r0, #15 @ CPU number
+   cmp r0, #0  @ primary CPU?
+   beq 2f
+
+   @
+   @ Secondary CPUs
+   @
+   ldr r1, =SPIN_TABLE_BASE
+   adr r2, 1f
+   ldmia   r2, {r3 - r7}   @ move the code to a location
+   stmia   r1, {r3 - r7}   @ less likely to be overridden
+   add r0, r1, #0x20   @ Entry point for secondary
+   @ CPUs @ SPIN_TABLE_BASE+0x20
+   mov r2, #0
+   str r2, [r0, #0]@ ensure initially zero
+   mov pc, r1  @ branch to the relocated code
+1:
+   wfe
+   ldr r1, [r0]
+   cmp r1, #0
+   beq 1b
+   mov pc, r1  @ branch to the given address
+
+   @
+   @ Kernel parameters
+   @
+2: mov r0, #0  @ Must be zero
+   mov r1, #0  @ Machine type (not needed)
+   adr r2, atags   @ ATAGS pointer
+   mov r3, #0
+   ldr lr, =kernel
+   mov pc, lr  @ jump to the kernel
+
+   .org0x100
+atags:
+   @ ATAG_CORE
+   .long   2
+   .long   0x54410001
+
+   @ ATAG_CMDLINE
+   .long   (1f - .)  2
+   .long   0x54410009
+   .asciz  root=/dev/mmcblk0 rootwait ip=none mem=1024M console=ttyAMA0
+
+   .align  2
+1:
+
+   @ ATAG_NONE
+   .long   0
+   .long   0x
diff --git a/arch/arm/boot/fmboot/fmboot.lds b/arch/arm/boot/fmboot/fmboot.lds
new file mode 100644
index 000..8cde9f8
--- /dev/null
+++ b/arch/arm/boot/fmboot/fmboot.lds
@@ -0,0 +1,30 @@
+/*
+ * fmboot.lds
+ *
+ * Copyright (C) 2011 ARM Limited. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE.txt file.
+ */
+
+OUTPUT_FORMAT(elf32-littlearm)
+OUTPUT_ARCH(arm)
+TARGET(binary)
+
+INPUT(./fmboot.o)
+INPUT(./zImage.fm)
+
+PHYS_OFFSET = 0x;
+
+SECTIONS
+{
+   . = PHYS_OFFSET;
+   .text : { fmboot.o }
+   . = PHYS_OFFSET + 0x8000 - 0x0;
+   kernel = . + 0x0;
+   .kernel : { ./zImage.fm }
+   . = PHYS_OFFSET + 0x0080;
+   filesystem = .;
+   .data : { *(.data) }
+   .bss : { *(.bss) }
+}
diff --git a/arch/arm/boot/fmboot/pack.py 

Re: [linux-yocto] [PATCH 14/87] arch/arm/mach-axxia/axxia.c: Chip select control for SPI devices.

2013-05-27 Thread Bruce Ashfield

On 13-05-27 12:55 PM, Paul Butler wrote:

Signed-off-by: Paul Butler paul.but...@windriver.com


Why is this separate from the patch that introduces mach-axxia ?

Bruce


---
  arch/arm/mach-axxia/axxia.c | 51 ++---
  1 file changed, 39 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-axxia/axxia.c b/arch/arm/mach-axxia/axxia.c
index 623957e..777f998 100644
--- a/arch/arm/mach-axxia/axxia.c
+++ b/arch/arm/mach-axxia/axxia.c
@@ -48,6 +48,7 @@
  #include mach/timers.h
  #include axxia.h
  #include pci.h
+#include i2c.h

  static const char *axxia_dt_match[] __initconst = {
lsi,axm5516,/* AXM5516 */
@@ -157,19 +158,41 @@ static struct of_dev_auxdata axxia_auxdata_lookup[] 
__initdata = {
{}
  };

-struct pl022_config_chip spi_eeprom = {
-   .iface = SSP_INTERFACE_MOTOROLA_SPI,
-   .clk_freq = {
-   .cpsdvsr = 0,   /* value from 2 to 254 (even only!) */
-   .scr = 0,   /* value from 0 to 255 */
-   },
-   .com_mode = POLLING_TRANSFER,
+static inline void
+spidev_chip_select(u32 control, unsigned n)
+{
+   if (control == SSP_CHIP_SELECT)
+   writel(~(1n)  0x1F, ssp_base+0x30);
+   else
+   writel(0x1F, ssp_base+0x30);
+}
+
+static void spi_cs_eeprom0(u32 control) { spidev_chip_select(control, 0); }
+static void spi_cs_eeprom1(u32 control) { spidev_chip_select(control, 1); }
+static void spi_cs_eeprom2(u32 control) { spidev_chip_select(control, 2); }
+
+struct pl022_config_chip spi_eeprom0 = {
+   .iface  = SSP_INTERFACE_MOTOROLA_SPI,
+   .com_mode   = POLLING_TRANSFER,
+   .cs_control = spi_cs_eeprom0
+};
+
+struct pl022_config_chip spi_eeprom1 = {
+   .iface  = SSP_INTERFACE_MOTOROLA_SPI,
+   .com_mode   = POLLING_TRANSFER,
+   .cs_control = spi_cs_eeprom1
+};
+
+struct pl022_config_chip spi_eeprom2 = {
+   .iface  = SSP_INTERFACE_MOTOROLA_SPI,
+   .com_mode   = POLLING_TRANSFER,
+   .cs_control = spi_cs_eeprom2
  };

  static struct spi_board_info spi_devs[] __initdata = {
{
.modalias   = spidev,
-   .controller_data= spi_eeprom,
+   .controller_data= spi_eeprom0,
.bus_num= 0,
.chip_select= 0,
.max_speed_hz   = 1200,
@@ -177,7 +200,7 @@ static struct spi_board_info spi_devs[] __initdata = {
},
{
.modalias   = spidev,
-   .controller_data= spi_eeprom,
+   .controller_data= spi_eeprom1,
.bus_num= 0,
.chip_select= 1,
.max_speed_hz   = 1200,
@@ -185,7 +208,7 @@ static struct spi_board_info spi_devs[] __initdata = {
},
{
.modalias   = spidev,
-   .controller_data= spi_eeprom,
+   .controller_data= spi_eeprom2,
.bus_num= 0,
.chip_select= 2,
.max_speed_hz   = 1200,
@@ -208,11 +231,15 @@ void __init axxia_dt_init(void)
ssp_base =
of_iomap(of_find_compatible_node(NULL, NULL, arm,pl022), 0);
if (!WARN_ON(ssp_base == NULL)) {
-   printk(KERN_INFO SSPCSR = %08x\n, readl(ssp_base+0x30));
-   writel((0x1F  8) | (05) | (0x1F0), ssp_base+0x30);
+   /* Use legacy mode, bits 0..4 control nCS[0..4] pins */
+   writel(0x1F, ssp_base+0x30);
}

axxia_pcie_init();
+
+#ifdef CONFIG_I2C
+   axxia_register_i2c_busses();
+#endif
  }

  static void axxia_restart(char str, const char *cmd)



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


Re: [linux-yocto] [PATCH 15/87] arch/arm: Updating Kconfig and Makefile for axxia

2013-05-27 Thread Bruce Ashfield

On 13-05-27 12:55 PM, Paul Butler wrote:

From: Jiang Lu lu.ji...@windriver.com

Signed-off-by: Paul Butler paul.but...@windriver.com
---
  arch/arm/Kconfig  | 23 +++
  arch/arm/Makefile |  3 ++-
  2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a68ad22..5cab886 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -326,6 +326,27 @@ config ARCH_VERSATILE
help
  This enables support for ARM Ltd Versatile board.

+config ARCH_AXXIA
+   bool LSI Axxia family
+select ARCH_PHYS_ADDR_T_64BIT
+select ARCH_DMA_ADDR_T_64BIT


Looks like a mix of tabs and whitespace .. or something else, but
regardless, these should line up.

Bruce


+   select ARCH_WANT_OPTIONAL_GPIOLIB
+   select ARM_AMBA
+   select COMMON_CLK
+   select CLKDEV_LOOKUP
+   select CLKSRC_MMIO
+   select GENERIC_CLOCKEVENTS
+   select HAVE_CLK
+   select HAVE_PATA_PLATFORM
+   select ARM_TIMER_SP804
+   select ICST
+   select NEED_MACH_IO_H
+   select PCI
+   select PCI_DOMAINS if PCI
+   select ARCH_SUPPORTS_MSI if PCI
+   help
+ This enables support for the LSI Axxia boards.
+
  config ARCH_VEXPRESS
bool ARM Ltd. Versatile Express family
select ARCH_WANT_OPTIONAL_GPIOLIB
@@ -1134,6 +1155,8 @@ source arch/arm/mach-ux500/Kconfig

  source arch/arm/mach-versatile/Kconfig

+source arch/arm/mach-axxia/Kconfig
+
  source arch/arm/mach-vexpress/Kconfig
  source arch/arm/plat-versatile/Kconfig

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index eb6ecae..db992cd 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -190,6 +190,7 @@ machine-$(CONFIG_ARCH_U300) := u300
  machine-$(CONFIG_ARCH_U8500)  := ux500
  machine-$(CONFIG_ARCH_VERSATILE)  := versatile
  machine-$(CONFIG_ARCH_VEXPRESS)   := vexpress
+machine-$(CONFIG_ARCH_AXXIA)   := axxia
  machine-$(CONFIG_ARCH_VT8500) := vt8500
  machine-$(CONFIG_ARCH_W90X900):= w90x900
  machine-$(CONFIG_FOOTBRIDGE)  := footbridge
@@ -307,7 +308,7 @@ define archhelp
echo  '  Image - Uncompressed kernel image 
(arch/$(ARCH)/boot/Image)'
echo  '* xipImage  - XIP kernel image, if configured 
(arch/$(ARCH)/boot/xipImage)'
echo  '  uImage- U-Boot wrapped zImage'
-  echo  '  bootpImage- Combined zImage and initial RAM disk'
+  echo  '  bootpImage- Combined zImage and initial RAM disk'
echo  '  (supply initrd image via make variable 
INITRD=path)'
echo  '  dtbs  - Build device tree blobs for enabled boards'
echo  '  install   - Install uncompressed kernel'



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


Re: [linux-yocto] [PATCH 18/87] arch/arm/mm: proc-v7-2level.S and 3level - checking coherent walk bits

2013-05-27 Thread Bruce Ashfield

On 13-05-27 12:55 PM, Paul Butler wrote:

Signed-off-by: Paul Butler paul.but...@windriver.com


These are common files, and not protected by #ifdefs, are these safe for all
v7 boards ?

Bruce


---
  arch/arm/mm/proc-v7-2level.S | 4 +++-
  arch/arm/mm/proc-v7-3level.S | 4 +++-
  2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/proc-v7-2level.S b/arch/arm/mm/proc-v7-2level.S
index 42ac069..e3f2ba9 100644
--- a/arch/arm/mm/proc-v7-2level.S
+++ b/arch/arm/mm/proc-v7-2level.S
@@ -101,7 +101,9 @@ ENTRY(cpu_v7_set_pte_ext)
   ARM( str r3, [r0, #2048]! )
   THUMB(   add r0, r0, #2048 )
   THUMB(   str r3, [r0] )
-   mcr p15, 0, r0, c7, c10, 1  @ flush_pte
+   mrc p15, 0, r3, c0, c1, 7   @ read ID_MMFR3
+   tst r3, #0xf  20@ check the coherent walk bits
+   mcreq   p15, 0, r0, c7, c10, 1  @ clean D-cache to PoU
  #endif
mov pc, lr
  ENDPROC(cpu_v7_set_pte_ext)
diff --git a/arch/arm/mm/proc-v7-3level.S b/arch/arm/mm/proc-v7-3level.S
index 8de0f1d..6b30605 100644
--- a/arch/arm/mm/proc-v7-3level.S
+++ b/arch/arm/mm/proc-v7-3level.S
@@ -70,7 +70,9 @@ ENTRY(cpu_v7_set_pte_ext)
tst r3, #1  (55 - 32)   @ L_PTE_DIRTY
orreq   r2, #L_PTE_RDONLY
  1:strdr2, r3, [r0]
-   mcr p15, 0, r0, c7, c10, 1  @ flush_pte
+   mrc p15, 0, r3, c0, c1, 7   @ read ID_MMFR3
+   tst r3, #0xf  20@ check the coherent walk bits
+   mcreq   p15, 0, r0, c7, c10, 1  @ clean D-cache to PoU
  #endif
mov pc, lr
  ENDPROC(cpu_v7_set_pte_ext)



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


Re: [linux-yocto] [PATCH 20/87] include/linux/i2c-axxia.h: added missing file to fix build bug

2013-05-27 Thread Bruce Ashfield

On 13-05-27 12:55 PM, Paul Butler wrote:

Same question. Other than tracking who did what, is there any reasn
why this isn't in the patch that introduced the driver ?

Bruced


Signed-off-by: Paul Butler paul.but...@windriver.com
---
  include/linux/i2c-axxia.h | 25 +
  1 file changed, 25 insertions(+)
  create mode 100644 include/linux/i2c-axxia.h

diff --git a/include/linux/i2c-axxia.h b/include/linux/i2c-axxia.h
new file mode 100644
index 000..5f1ae4a
--- /dev/null
+++ b/include/linux/i2c-axxia.h
@@ -0,0 +1,25 @@
+#ifndef __I2C_AXXIA_H__
+#define __I2C_AXXIA_H__
+
+#include linux/platform_device.h
+
+/*
+ * Version 2 of the I2C peripheral unit has a different register
+ * layout and extra registers.  The ID register in the V2 peripheral
+ * unit on the AXXIA4430 reports the same ID as the V1 peripheral
+ * unit on the AXXIA3530, so we must inform the driver which IP
+ * version we know it is running on from platform / cpu-specific
+ * code using these constants in the hwmod class definition.
+ */
+
+#define AXXIA_I2C_IP_VERSION_1 1/* ACP34xx */
+#define AXXIA_I2C_IP_VERSION_2 2/* AXM55xx */
+
+/* struct axxia_i2c_bus_platform_data .flags meanings */
+
+struct axxia_i2c_bus_platform_data {
+   u32 rev;
+   u32 flags;
+};
+
+#endif



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


Re: [linux-yocto] [PATCH 32/87] LSI axm55xx: Fix boot issues with PREMPT_RT kernel

2013-05-27 Thread Bruce Ashfield

On 13-05-27 12:56 PM, Paul Butler wrote:

From: David Mercado david.merc...@windriver.com

Modified arch/arm/mach-axxia/axxia-gic.c to to handle the slightly different
way in which a preempt_rt kernel manipulates the Axxia GIC API during boot.
Also updated arch/arm/configs/lsisim_defconfig to set the base level of
prempt_rt to CONFIG_PREEMPT_RTB.  The preempt_rt kernel must be set with


This doesn't match the patch ...

Bruce


a minimal preempt model, to enable CONFIG_GENERIC_LOCKBREAK, which in turn
allows spinlocks to work correctly across multiple clusters.

Signed-off-by: David Mercado david.merc...@windriver.com
Signed-off-by: Paul Butler paul.but...@windriver.com
---
  arch/arm/mach-axxia/axxia-gic.c | 54 +
  1 file changed, 44 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-axxia/axxia-gic.c b/arch/arm/mach-axxia/axxia-gic.c
index 058b837..20d04ea 100644
--- a/arch/arm/mach-axxia/axxia-gic.c
+++ b/arch/arm/mach-axxia/axxia-gic.c
@@ -155,9 +155,11 @@ static void gic_mask_irq(struct irq_data *d)
if (irqid = 1020)
return;

-   /* We should never be disabling the AXM IPI interrupts. */
-   if ((irqid = IPI0_CPU0)  (irqid  MAX_AXM_IPI_NUM))
+   /* Deal with PPI interrupts directly. */
+   if (irqid  16  irqid  32) {
+   _gic_mask_irq(d);
return;
+   }

/*
 * If the cpu that this interrupt is assigned to falls within
@@ -182,22 +184,54 @@ static void gic_mask_irq(struct irq_data *d)
}
  }

-static void gic_unmask_irq(struct irq_data *d)
+static void _gic_unmask_irq(void *arg)
  {
+   struct irq_data *d = (struct irq_data *)arg;
u32 mask = 1  (gic_irq(d) % 32);

-   /*
-* No need to run this at all clusters, since the kernel
-* also calls gic_set_affinity when unmasking interrupts.
-* In that routine we also unmask the interrupt, so doing
-* it here would be redundant.
-*/
raw_spin_lock(irq_controller_lock);
writel_relaxed(mask, gic_dist_base(d) + GIC_DIST_ENABLE_SET
-   + (gic_irq(d) / 32) * 4);
+   + (gic_irq(d) / 32) * 4);
raw_spin_unlock(irq_controller_lock);
  }

+static void gic_unmask_irq(struct irq_data *d)
+{
+   u32 pcpu = cpu_logical_map(smp_processor_id());
+   u32 irqid = gic_irq(d);
+
+   if (irqid = 1020)
+   return;
+
+   /* Deal with PPI interrupts directly. */
+   if (irqid  15  irqid  32) {
+   _gic_unmask_irq(d);
+   return;
+   }
+
+   /*
+* If the cpu that this interrupt is assigned to falls within
+* the same cluster as the cpu we're currently running on, do
+* the IRQ masking directly. Otherwise, use the IPI mechanism
+* to remotely do the masking.
+*/
+   if ((cpu_logical_map(irq_cpuid[irqid]) / 4) == (pcpu / 4)) {
+   _gic_unmask_irq(d);
+   } else {
+   /*
+* We are running here with local interrupts
+* disabled. Temporarily re-enable them to
+* avoid possible deadlock when calling
+* smp_call_function_single().
+*/
+   local_irq_enable();
+   smp_call_function_single(irq_cpuid[irqid],
+_gic_unmask_irq,
+d, 1);
+   local_irq_disable();
+   }
+}
+
  static void gic_eoi_irq(struct irq_data *d)
  {
/*



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


Re: [linux-yocto] [PATCH 48/87] ppc/47x: add cputable entries for ACP 34xx

2013-05-27 Thread Bruce Ashfield

On 13-05-27 12:56 PM, Paul Butler wrote:

From: Jiang Lu lu.ji...@windriver.com

This is based on the cputable.c from LSI. Currently our kernel only
support ACP 3448 SoC. But all the ACP 34xx SoC are using a 476 core,
and just have minor differences. They also use the same reference
board. Adding these cpu entries in cputable will make our kernel
boot on all these 34xx silicons.


This comment should be tweaked. The statement about our kernel, should
indicate that only the tested BSPs are teh ACP 3488, or something of
that nature.

Cheers,

Bruce



Signed-off-by: Kevin Hao kexin@windriver.com
---
  arch/powerpc/include/asm/reg.h |  1 +
  arch/powerpc/kernel/cputable.c | 58 --
  arch/powerpc/kernel/head_44x.S |  3 +++
  3 files changed, 54 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index cae0ed7..b40b2f5 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -957,6 +957,7 @@
  #define PVR_405GP 0x4011
  #define PVR_476   0x11a52000
  #define PVR_476FPE0x7ff5
+#define PVR_476X2  0x11b22080
  #define PVR_STB03XXX  0x4031
  #define PVR_NP405H0x4141
  #define PVR_NP405L0x4161
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 455faa3..88479f1 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1831,9 +1831,23 @@ static struct cpu_spec __initdata cpu_specs[] = {
.platform   = ppc440,
},
{ /* 476 DD2 core */
+   .pvr_mask   = 0x800f,
+   .pvr_value  = 0x00052080,
+   .cpu_name   = 476, DD2,
+   .cpu_features   = CPU_FTRS_47X | CPU_FTR_476_DD2,
+   .cpu_user_features  = COMMON_USER_BOOKE |
+   PPC_FEATURE_HAS_FPU,
+   .mmu_features   = MMU_FTR_TYPE_47x |
+   MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL,
+   .icache_bsize   = 32,
+   .dcache_bsize   = 128,
+   .machine_check  = machine_check_47x,
+   .platform   = ppc470,
+   },
+   { /* X2 DD2 core */
.pvr_mask   = 0x,
-   .pvr_value  = 0x11a52080,
-   .cpu_name   = 476,
+   .pvr_value  = 0x11b22080,
+   .cpu_name   = 476, X2 DD2,
.cpu_features   = CPU_FTRS_47X | CPU_FTR_476_DD2,
.cpu_user_features  = COMMON_USER_BOOKE |
PPC_FEATURE_HAS_FPU,
@@ -1859,9 +1873,37 @@ static struct cpu_spec __initdata cpu_specs[] = {
.platform   = ppc470,
},
{ /* 476 iss */
-   .pvr_mask   = 0x,
-   .pvr_value  = 0x0005,
-   .cpu_name   = 476,
+   .pvr_mask   = 0x,
+   .pvr_value  = 0x12b520c0,
+   .cpu_name   = 476,
+   .cpu_features   = CPU_FTRS_47X | CPU_FTR_476_DD2,
+   .cpu_user_features  = COMMON_USER_BOOKE |
+   PPC_FEATURE_HAS_FPU,
+   .mmu_features   = MMU_FTR_TYPE_47x |
+   MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL,
+   .icache_bsize   = 32,
+   .dcache_bsize   = 128,
+   .machine_check  = machine_check_47x,
+   .platform   = ppc470,
+   },
+   { /* 476 DD3 core */
+   .pvr_mask   = 0x20c0,
+   .pvr_value  = 0x11a520c0,
+   .cpu_name   = 476, DD3,
+   .cpu_features   = CPU_FTRS_47X,
+   .cpu_user_features  = COMMON_USER_BOOKE |
+   PPC_FEATURE_HAS_FPU,
+   .mmu_features   = MMU_FTR_TYPE_47x |
+   MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL,
+   .icache_bsize   = 32,
+   .dcache_bsize   = 128,
+   .machine_check  = machine_check_47x,
+   .platform   = ppc470,
+   },
+   { /* 476 ACP25xx */
+   .pvr_mask   = 0x7ff520c1,
+   .pvr_value  = 0x7ff520c1,
+   .cpu_name   = 476, ACP25xx,
.cpu_features   = CPU_FTRS_47X,
.cpu_user_features  = COMMON_USER_BOOKE |
PPC_FEATURE_HAS_FPU,
@@ -1873,9 +1915,9 @@ static struct cpu_spec __initdata cpu_specs[] = {
.platform   = ppc470,
 

Re: [linux-yocto] [PATCH 54/87] lsi/ncr: add support to read/write access to configuration ring resources

2013-05-27 Thread Bruce Ashfield

On 13-05-27 12:56 PM, Paul Butler wrote:

From: Jiang Lu lu.ji...@windriver.com

Extracted from lsi.patch in lsi_acp_linux_6.8.1.18 tarball.


This is typically an acceptable upstream reference, but I have to ask.
Is there a public location that we can point to for this tgz ?

Bruce



The Nuevo CPU Adapter (NCA) is the hardware engine that connects the
powerpc complex with the ACP3400 data patch accellerator engines.
This driver provides the CPU with read/write access to configuration
ring resources via NCA configuration commands.

[Jiang:
* Get the nca register virtual address by using ioremap instead
of using a fixed virtual address bolted in tlb entry.
* Move from driver/lsi/acp.c to arch/powerpc/sysdev/lsi_acp_ncr.c]

Signed-off-by: Jiang Lu lu.ji...@windriver.com
---
  arch/powerpc/include/asm/lsi/acp_ncr.h |  42 
  arch/powerpc/sysdev/Makefile   |   2 +
  arch/powerpc/sysdev/lsi_acp_ncr.c  | 375 +
  3 files changed, 419 insertions(+)
  create mode 100644 arch/powerpc/include/asm/lsi/acp_ncr.h
  create mode 100644 arch/powerpc/sysdev/lsi_acp_ncr.c

diff --git a/arch/powerpc/include/asm/lsi/acp_ncr.h 
b/arch/powerpc/include/asm/lsi/acp_ncr.h
new file mode 100644
index 000..a7399e7
--- /dev/null
+++ b/arch/powerpc/include/asm/lsi/acp_ncr.h
@@ -0,0 +1,42 @@
+/*
+ * asm/lsi/acp_ncr.h
+ *
+ * Copyright (C) 2010 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
+ */
+
+#ifndef __DRIVERS_LSI_ACP_NCR_H
+#define __DRIVERS_LSI_ACP_NCR_H
+
+#ifndef NCP_REGION_ID
+#define NCP_REGION_ID(node, target) \
+(unsigned long)node)  0x)  16) | ((target)  0x))
+#endif
+
+#ifndef NCP_NODE_ID
+#define NCP_NODE_ID(region) (((region)  16)  0x)
+#endif
+
+#ifndef NCP_TARGET_ID
+#define NCP_TARGET_ID(region) ((region)  0x)
+#endif
+
+int ncr_read(unsigned long, unsigned long, int, void *);
+int ncr_write(unsigned long, unsigned long, int, void *);
+
+int is_asic(void);
+
+#endif /*  __DRIVERS_LSI_ACP_NCR_H */
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index 1bd7ecb..af96e92 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -69,3 +69,5 @@ subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
  obj-$(CONFIG_PPC_XICS)+= xics/

  obj-$(CONFIG_GE_FPGA) += ge/
+
+obj-$(CONFIG_ACP)  += lsi_acp_ncr.o
diff --git a/arch/powerpc/sysdev/lsi_acp_ncr.c 
b/arch/powerpc/sysdev/lsi_acp_ncr.c
new file mode 100644
index 000..9802110
--- /dev/null
+++ b/arch/powerpc/sysdev/lsi_acp_ncr.c
@@ -0,0 +1,375 @@
+/*
+ *  Copyright (C) 2009 LSI Corporation
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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/io.h
+#include linux/module.h
+
+#include include/asm/lsi/acp_ncr.h
+
+static void __iomem *nca_address;
+
+#define WFC_TIMEOUT (40)
+
+#define LOCK_DOMAIN 0
+
+union command_data_register_0 {
+   unsigned long raw;
+   struct {
+   unsigned long start_done:1;
+   unsigned long unused:6;
+   unsigned long local_bit:1;
+   unsigned long status:2;
+   unsigned long byte_swap_enable:1;
+   unsigned long cfg_cmpl_int_enable:1;
+   unsigned long cmd_type:4;
+   unsigned long dbs:16;
+   } __packed bits;
+} __packed;
+
+union command_data_register_1 {
+   unsigned long raw;
+   struct {
+   unsigned long target_address:32;
+   } __packed bits;
+} __packed;
+
+union 

Re: [linux-yocto] [PATCH 60/87] kgdboc, acp serial: rx polling hook for the acp_serial driver

2013-05-27 Thread Bruce Ashfield

On 13-05-27 12:56 PM, Paul Butler wrote:

From: Jiang Lu lu.ji...@windriver.com

The patch is base upon Jason's commit


This commit header isn't appropriate for Linux yocto. The commit
header should just introduce the change, without referencing some
other commit we don't have in our tree.

Bruce


[
kgdboc, amba-pl011: rx polling hook for the amba-pl011 driver

The RX polling hook allows the debugger to hook character input so as
to allow entry to the kernel debugger with a control-c as an example.
]

Signed-off-by: Wei Yang wei.y...@windriver.com
---
  drivers/tty/serial/lsi_acp_serial.c | 4 
  1 file changed, 4 insertions(+)

diff --git a/drivers/tty/serial/lsi_acp_serial.c 
b/drivers/tty/serial/lsi_acp_serial.c
index 49ffd30..96adf00 100644
--- a/drivers/tty/serial/lsi_acp_serial.c
+++ b/drivers/tty/serial/lsi_acp_serial.c
@@ -333,6 +333,10 @@ acp_serial_rx_chars(struct uart_acp_port *uap)
flag = TTY_FRAME;
}

+#ifdef CONFIG_CONSOLE_POLL
+   if (uap-port.poll_rx_cb  uap-port.poll_rx_cb(ch))
+   goto ignore_char;
+#endif
if (uart_handle_sysrq_char(uap-port, ch  255))
goto ignore_char;




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


Re: [linux-yocto] [PATCH 00/87] New standard/lsi branch - linux-yocto_3.4

2013-05-27 Thread Bruce Ashfield

On 13-05-27 12:55 PM, Paul Butler wrote:

Creating a new branch in linux-yocto_3.4 for tracking LSI BSP changes.
Branched from standard/base at commit fff57da7886cf5e99c07adf6649610cb1cd89330



I added comments throughout the code. There are some minor cleanups
and references that are required.

We need to continue to work this code into a format that is destined
for the mainline kernel. Even my comments are not complete from that
point of view, but they are a step along the road.

Cheers,

Bruce


Benjamin Herrenschmidt (1):
   powerpc/mpic: Create a revmap with enough entries for IPIs and timers

David Mercado (4):
   LSI axm55xx: Add multi-cluster support for up to 16 cores
   LSI axm55xx: Fix boot issues with PREMPT_RT kernel
   LSI axm55xx: Add ability to parse specific core numbers in the DTB
   LSI acp34xx: Fixed build error in acp34xx serial driver

Fredrik Markstr (1):
   usb/host/ehci-ci13612: stop accessing the secondary register space

Jiang Lu (27):
   arch/arm: Updating Kconfig and Makefile for axxia
   arch/arm/tools/mach-types: adding axxia in the  mach-types
   ppc/47x: add cputable entries for ACP 34xx
   powerpc/47x: add acpx1 board support
   ACP34xx:Fix a few mismatch section warnings
   powerpc/acp34xx: add clk_get/_rate support for acp board
   LSI:ACP34xx:standardize debug macro
   lsi/ncr: add support to read/write access to configuration ring
 resources
   lsi/nand: add acp3400 nand flash controller support
   lsi/ubootenv: add read access to the uboot env
   lsi/nand:Use EP501G1_NAND_1BIT_ECC0_STATUS to check HW ECC
   tty:ACP serial:extract clock freq from device tree
   kgdboc, acp serial: rx polling hook for the acp_serial driver
   drivers/dma: Add Common LSI-DMA driver for ACP34xx and AXM55xx.
   PowerPC:ACP34xx:Add app350 i2c controller driver
   SPI:pl022:Update driver to support of-platform drivers
   PowerPC:ACP34xx:Add SPI at25 eeprom support
   powerpc/4xx: add support for the PCIe controller on ACP34xx
   drivers/net: Added support for acp network driver
   net/acp: add the netpoll support for acp device
   LSI:NIC:Using default value when ubootenv driver not present
   powerpc/47x: Kernel support for KEXEC
   powerpc/44x: kexec for SMP 47x
   GPIO:pl061:Update driver to support of-platform drivers
   PowerPC:ACP34xx:Add support for pl061 gpio driver
   ACP34xx:Add device tree for ACP344x v2 board
   Acp34xx:disable device when enabled set to 0 in dts

John Jacques (7):
   arm/boot: Boot loader emulation code for AXM5516.
   arm/dts: add dts for LSI AXM5516 simulation and emulation/asic.
   arm/boot: change target name
   arm/boot: Updates for Emulation Bringup.
   arm/boot: Fix the problem with device tree loading in emulation
   arm/boot: add earlyprintk in the bootargs
   arm/boot: Use supersections for the early page table in the armv7 case

Kevin Hao (7):
   usb/ehci-ci13612: add support for ci13612 host controller
   usb/ehci-ci13612: use the of match method to probe the hcd
   usb/ehci-ci13612: use dynamic virtual address to map the hcd registers
   ppc/476: workaround for erratum #40 on dd2 core
   powerpc/44x: allow the kernel to be run from a non-zero physical
 address
   powerpc/acpx1: add early debug support for acpx1 board
   powerpc/acpx1: make udbg do IO access in AS1

Michael Bringmann (9):
   drivers/i2c/ai2c: add dts support in the driver
   mach-axxia/i2c: fix editing typo.
   mach-axxia/i2c: remove unnecessary code
   arm/dts: add configurations for I2C busses
   mach-axxia/i2c: fix i2c platform data structure
   drivers/i2c/ai2c: add more dtb support
   drivers/i2c/ai2c: remove acp34xx from Makefile
   drivers/i2c/ai2c: Remove references to outdated types
   drivers/i2c/ai2c: Fix compile warning about unneeded label

Paul Butler (23):
   drivers/leds: Added support for RBS leds
   drivers/hwmon: add support for Analog Devices ADT75
   drivers/i2c/busses: adding ai2c driver
   drivers/usb/host/ehci-ci13612.c: replaced bugzilla comments
   drivers/usb/host/ehci-ci13612.c: fix a burst size issue
   fs/vmfs: adding arm vmfs patch
   arch/arm/boot/dts: adding new dts files
   arch/arm/boot/fmboot: adding support for Fast Models
   arch/arm/mach-axxia: adding mach-axxia support
   arch/arm/mach-axxia/axxia.c: Chip select control for SPI devices.
   arch/arm/mach-axxia/Makefile: adding i2c
   arch/arm/mm: proc-v7-2level.S and 3level - checking coherent walk bits
   arch/arm/mach-axxia: adding i2c code
   include/linux/i2c-axxia.h: added missing file to fix build bug
   arch/arm/mach-axxia: fixed section mismatch warnings
   arch/arm/mach-axxia: pci.c fixes incorrect device reference
   arm/asm/io.h: let ioremap() fall back to platform specific one
   drivers/tty: Add support for lsi acp serial driver and console
   drivers/usb: ehci-ci13612.c replaced hard-coded address and irq to use
 dtb
   drivers/crypto/amcc/crypto4xx_core.c: added include for linux/module.h
   LSI acp34xx: Major rework of lsi_acp_net.c Ethernet driver