Re: [PATCH 1/2] irqchip: omap-intc: Fix support for dm814 and dm816

2015-01-13 Thread Felipe Balbi
On Tue, Jan 13, 2015 at 02:23:25PM -0800, Tony Lindgren wrote:
 On dm81xx we have 128 interrupts like am33xx has. Let's add
 compatible flags for dm814x and dm816x, and document the
 existing binding.
 
 As the dm81xx are booting in device tree only mode, we can now
 also remove ti81xx_init_irq() legacy function.
 
 Cc: Brian Hutchinson b.hutch...@gmail.com
 Cc: Felipe Balbi ba...@ti.com
 Signed-off-by: Tony Lindgren t...@atomide.com

Thanks for documenting the binding :-s

Reviewed-by: Felipe Balbi ba...@ti.com
Acked-by: Felipe Balbi ba...@ti.com

 ---
  .../interrupt-controller/ti,omap-intc-irq.txt  | 28 
 ++
  drivers/irqchip/irq-omap-intc.c| 14 ---
  include/linux/irqchip/irq-omap-intc.h  |  1 -
  3 files changed, 33 insertions(+), 10 deletions(-)
  create mode 100644 
 Documentation/devicetree/bindings/interrupt-controller/ti,omap-intc-irq.txt
 
 diff --git 
 a/Documentation/devicetree/bindings/interrupt-controller/ti,omap-intc-irq.txt 
 b/Documentation/devicetree/bindings/interrupt-controller/ti,omap-intc-irq.txt
 new file mode 100644
 index 000..38ce5d03
 --- /dev/null
 +++ 
 b/Documentation/devicetree/bindings/interrupt-controller/ti,omap-intc-irq.txt
 @@ -0,0 +1,28 @@
 +Omap2/3 intc controller
 +
 +On TI omap2 and 3 the intc interrupt controller can provide
 +96 or 128 IRQ signals to the ARM host depending on the SoC.
 +
 +Required Properties:
 +- compatible: should be one of
 + ti,omap2-intc
 + ti,omap3-intc
 + ti,dm814-intc
 + ti,dm816-intc
 + ti,am33xx-intc
 +
 +- interrupt-controller : Identifies the node as an interrupt controller
 +- #interrupt-cells : Specifies the number of cells needed to encode interrupt
 +  source, should be 1 for intc
 +- interrupts: interrupt reference to primary interrupt controller
 +
 +Please refer to interrupts.txt in this directory for details of the common
 +Interrupt Controllers bindings used by client devices.
 +
 +Example:
 + intc: interrupt-controller@4820 {
 + compatible = ti,omap3-intc;
 + interrupt-controller;
 + #interrupt-cells = 1;
 + reg = 0x4820 0x1000;
 + };
 diff --git a/drivers/irqchip/irq-omap-intc.c b/drivers/irqchip/irq-omap-intc.c
 index 28718d3..b75a44a 100644
 --- a/drivers/irqchip/irq-omap-intc.c
 +++ b/drivers/irqchip/irq-omap-intc.c
 @@ -364,14 +364,6 @@ void __init omap3_init_irq(void)
   set_handle_irq(omap_intc_handle_irq);
  }
  
 -void __init ti81xx_init_irq(void)
 -{
 - omap_nr_irqs = 96;
 - omap_nr_pending = 4;
 - omap_init_irq(OMAP34XX_IC_BASE, NULL);
 - set_handle_irq(omap_intc_handle_irq);
 -}
 -
  static int __init intc_of_init(struct device_node *node,
struct device_node *parent)
  {
 @@ -383,7 +375,9 @@ static int __init intc_of_init(struct device_node *node,
   if (WARN_ON(!node))
   return -ENODEV;
  
 - if (of_device_is_compatible(node, ti,am33xx-intc)) {
 + if (of_device_is_compatible(node, ti,dm814-intc) ||
 + of_device_is_compatible(node, ti,dm816-intc) ||
 + of_device_is_compatible(node, ti,am33xx-intc)) {
   omap_nr_irqs = 128;
   omap_nr_pending = 4;
   }
 @@ -399,4 +393,6 @@ static int __init intc_of_init(struct device_node *node,
  
  IRQCHIP_DECLARE(omap2_intc, ti,omap2-intc, intc_of_init);
  IRQCHIP_DECLARE(omap3_intc, ti,omap3-intc, intc_of_init);
 +IRQCHIP_DECLARE(dm814x_intc, ti,dm814-intc, intc_of_init);
 +IRQCHIP_DECLARE(dm816x_intc, ti,dm816-intc, intc_of_init);
  IRQCHIP_DECLARE(am33xx_intc, ti,am33xx-intc, intc_of_init);
 diff --git a/include/linux/irqchip/irq-omap-intc.h 
 b/include/linux/irqchip/irq-omap-intc.h
 index e06b370..bda426a 100644
 --- a/include/linux/irqchip/irq-omap-intc.h
 +++ b/include/linux/irqchip/irq-omap-intc.h
 @@ -20,7 +20,6 @@
  
  void omap2_init_irq(void);
  void omap3_init_irq(void);
 -void ti81xx_init_irq(void);
  
  int omap_irq_pending(void);
  void omap_intc_save_context(void);
 -- 
 2.1.4
 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 2/2] irqchip: omap-intc: Remove unused legacy interface for omap2

2015-01-13 Thread Felipe Balbi
On Tue, Jan 13, 2015 at 02:23:26PM -0800, Tony Lindgren wrote:
 Nowadays omap2 is booting in device tree only mode so there is no
 need to keep the legacy interface around for omap2_init_irq().
 
 Cc: Felipe Balbi ba...@ti.com
 Signed-off-by: Tony Lindgren t...@atomide.com

Awesome, only one to go now.

Reviewed-by: Felipe Balbi ba...@ti.com
Acked-by: Felipe Balbi ba...@ti.com

 ---
  drivers/irqchip/irq-omap-intc.c   | 8 
  include/linux/irqchip/irq-omap-intc.h | 1 -
  2 files changed, 9 deletions(-)
 
 diff --git a/drivers/irqchip/irq-omap-intc.c b/drivers/irqchip/irq-omap-intc.c
 index b75a44a..ece8624 100644
 --- a/drivers/irqchip/irq-omap-intc.c
 +++ b/drivers/irqchip/irq-omap-intc.c
 @@ -348,14 +348,6 @@ out:
   omap_ack_irq(NULL);
  }
  
 -void __init omap2_init_irq(void)
 -{
 - omap_nr_irqs = 96;
 - omap_nr_pending = 3;
 - omap_init_irq(OMAP24XX_IC_BASE, NULL);
 - set_handle_irq(omap_intc_handle_irq);
 -}
 -
  void __init omap3_init_irq(void)
  {
   omap_nr_irqs = 96;
 diff --git a/include/linux/irqchip/irq-omap-intc.h 
 b/include/linux/irqchip/irq-omap-intc.h
 index bda426a..2e3d1af 100644
 --- a/include/linux/irqchip/irq-omap-intc.h
 +++ b/include/linux/irqchip/irq-omap-intc.h
 @@ -18,7 +18,6 @@
  #ifndef __INCLUDE_LINUX_IRQCHIP_IRQ_OMAP_INTC_H
  #define __INCLUDE_LINUX_IRQCHIP_IRQ_OMAP_INTC_H
  
 -void omap2_init_irq(void);
  void omap3_init_irq(void);
  
  int omap_irq_pending(void);
 -- 
 2.1.4
 

-- 
balbi


signature.asc
Description: Digital signature


Re: [patch-net-next 1/3] net: ethernet: cpsw: unroll IRQ request loop

2015-01-13 Thread David Miller
From: Felipe Balbi ba...@ti.com
Date: Tue, 13 Jan 2015 13:44:46 -0600

 + ret = devm_request_irq(pdev-dev, irq, cpsw_interrupt,
 + 0, dev_name(pdev-dev), priv);

When a function call spans multiple lines, the argument on the second
and subsequent lines must start on the first column after the openning
parenthesis of the function call.

If you are using only TAB characters to indent, you are likely not
doing it correctly.

 + ret = devm_request_irq(pdev-dev, irq, cpsw_interrupt,
 + 0, dev_name(pdev-dev), priv);

Likewise.

 + ret = devm_request_irq(pdev-dev, irq, cpsw_interrupt,
 + 0, dev_name(pdev-dev), priv);

Likewise.

 + ret = devm_request_irq(pdev-dev, irq, cpsw_interrupt,
 + 0, dev_name(pdev-dev), priv);

Likewise.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 3/3] ARM: dts: am335x-boneblack: Use new binding in ti,tilcdc,slave node

2015-01-13 Thread Jyri Sarha
Add node for NXP TDA19988 encoder and refer to it in the hdmi node
instead of referring to the i2c bus where the encoder is connected to.

Signed-off-by: Jyri Sarha jsa...@ti.com
---
 arch/arm/boot/dts/am335x-boneblack.dts |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/am335x-boneblack.dts 
b/arch/arm/boot/dts/am335x-boneblack.dts
index 5c42d25..c0c8e4b 100644
--- a/arch/arm/boot/dts/am335x-boneblack.dts
+++ b/arch/arm/boot/dts/am335x-boneblack.dts
@@ -70,10 +70,17 @@
status = okay;
 };
 
+i2c0 {
+   tda19988: tda19988@70 {
+   compatible = nxp,tda998x;
+   reg = 0x70;
+   };
+};
+
 / {
hdmi {
compatible = ti,tilcdc,slave;
-   i2c = i2c0;
+   i2c-slave = tda19988;
pinctrl-names = default, off;
pinctrl-0 = nxp_hdmi_bonelt_pins;
pinctrl-1 = nxp_hdmi_bonelt_off_pins;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 1/3] drm: encoder_slave: Add drm_i2c_encoder_attach()

2015-01-13 Thread Jyri Sarha
Add drm_i2c_encoder_attach() for attaching an already probed i2c
encoder. This is needed for instance if the encoder is probed from
device tree.

Signed-off-by: Jyri Sarha jsa...@ti.com
---
 drivers/gpu/drm/drm_encoder_slave.c |   51 +++
 include/drm/drm_encoder_slave.h |3 +++
 2 files changed, 54 insertions(+)

diff --git a/drivers/gpu/drm/drm_encoder_slave.c 
b/drivers/gpu/drm/drm_encoder_slave.c
index d18b88b..ed627f7 100644
--- a/drivers/gpu/drm/drm_encoder_slave.c
+++ b/drivers/gpu/drm/drm_encoder_slave.c
@@ -120,6 +120,57 @@ void drm_i2c_encoder_destroy(struct drm_encoder 
*drm_encoder)
 }
 EXPORT_SYMBOL(drm_i2c_encoder_destroy);
 
+/**
+ * drm_i2c_encoder_attach - Attach an I2C slave encoder
+ * @dev:   DRM device.
+ * @encoder:   Encoder to be attached to the I2C device. You aren't
+ * required to have called drm_encoder_init() before.
+ * @client:I2C encoder to be attached.
+ *
+ * Attach the I2C device specified to the specified drm_encoder_slave.
+ * The @slave_funcs field will be initialized with the hooks provided by
+ * the slave driver.
+ *
+ * Returns 0 on success or a negative errno on failure, in particular,
+ * -ENODEV is returned when no matching driver is found.
+ */
+int drm_i2c_encoder_attach(struct drm_device *dev,
+  struct drm_encoder_slave *encoder,
+  struct i2c_client *client)
+{
+   struct drm_i2c_encoder_driver *encoder_drv;
+   struct module *module = NULL;
+   int err = 0;
+
+   if (!client-dev.driver) {
+   err = -ENODEV;
+   goto fail;
+   }
+
+   module = client-dev.driver-owner;
+   if (!try_module_get(module)) {
+   err = -ENODEV;
+   goto fail;
+   }
+
+   encoder-bus_priv = client;
+
+   encoder_drv =
+   to_drm_i2c_encoder_driver(to_i2c_driver(client-dev.driver));
+
+   err = encoder_drv-encoder_init(client, dev, encoder);
+   if (err)
+   goto fail_put;
+
+   return 0;
+
+fail_put:
+   module_put(module);
+fail:
+   return err;
+}
+EXPORT_SYMBOL(drm_i2c_encoder_attach);
+
 /*
  * Wrapper fxns which can be plugged in to drm_encoder_helper_funcs:
  */
diff --git a/include/drm/drm_encoder_slave.h b/include/drm/drm_encoder_slave.h
index 8b9cc36..4f7f8d5 100644
--- a/include/drm/drm_encoder_slave.h
+++ b/include/drm/drm_encoder_slave.h
@@ -106,6 +106,9 @@ int drm_i2c_encoder_init(struct drm_device *dev,
 struct i2c_adapter *adap,
 const struct i2c_board_info *info);
 
+int drm_i2c_encoder_attach(struct drm_device *dev,
+  struct drm_encoder_slave *encoder,
+  struct i2c_client *client);
 
 /**
  * struct drm_i2c_encoder_driver
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 0/3] Make ti,tilcdc,slave DT binding more sensible

2015-01-13 Thread Jyri Sarha
These patches are needed for Beaglebone-back HDMI audio. There is no
direct dependency between these patches and the other (dts and ASoC)
changes needed for the HDMI audio so these changes can be merged
independently. I also feel that these changes make sense even without
the HDMI audio.

Best regards,
Jyri

Jyri Sarha (3):
  drm: encoder_slave: Add drm_i2c_encoder_attach()
  drm/tilcdc: slave: Add support for i2c-slave DT-parameter
  ARM: dts: am335x-boneblack: Use new binding in ti,tilcdc,slave node

 .../devicetree/bindings/drm/tilcdc/slave.txt   |4 +-
 arch/arm/boot/dts/am335x-boneblack.dts |9 +++-
 drivers/gpu/drm/drm_encoder_slave.c|   51 
 drivers/gpu/drm/tilcdc/tilcdc_slave.c  |   50 +++
 include/drm/drm_encoder_slave.h|3 ++
 5 files changed, 95 insertions(+), 22 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 2/3] drm/tilcdc: slave: Add support for i2c-slave DT-parameter

2015-01-13 Thread Jyri Sarha
It is more convenient to refer to the i2c slave encoder directly with
phandle than to refer to the i2c bus and to create the device manually.

Signed-off-by: Jyri Sarha jsa...@ti.com
---
 .../devicetree/bindings/drm/tilcdc/slave.txt   |4 +-
 drivers/gpu/drm/tilcdc/tilcdc_slave.c  |   50 
 2 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/Documentation/devicetree/bindings/drm/tilcdc/slave.txt 
b/Documentation/devicetree/bindings/drm/tilcdc/slave.txt
index 3d2c524..930550f 100644
--- a/Documentation/devicetree/bindings/drm/tilcdc/slave.txt
+++ b/Documentation/devicetree/bindings/drm/tilcdc/slave.txt
@@ -2,6 +2,8 @@ Device-Tree bindings for tilcdc DRM encoder slave output driver
 
 Required properties:
  - compatible: value should be ti,tilcdc,slave.
+ - i2c-slave: phandle for the encoder slave device
+ or
  - i2c: the phandle for the i2c device the encoder slave is connected to
 
 Recommended properties:
@@ -12,7 +14,7 @@ Example:
 
hdmi {
compatible = ti,tilcdc,slave;
-   i2c = i2c0;
+   i2c-slave = tda19988;
pinctrl-names = default;
pinctrl-0 = nxp_hdmi_bonelt_pins;
};
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave.c 
b/drivers/gpu/drm/tilcdc/tilcdc_slave.c
index 3775fd4..a1e2f86 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_slave.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_slave.c
@@ -25,6 +25,7 @@
 struct slave_module {
struct tilcdc_module base;
struct i2c_adapter *i2c;
+   struct i2c_client *slave;
 };
 #define to_slave_module(x) container_of(x, struct slave_module, base)
 
@@ -140,7 +141,12 @@ static struct drm_encoder *slave_encoder_create(struct 
drm_device *dev,
 
drm_encoder_helper_add(encoder, slave_encoder_helper_funcs);
 
-   ret = drm_i2c_encoder_init(dev, to_encoder_slave(encoder), mod-i2c, 
info);
+   if (mod-slave)
+   ret = drm_i2c_encoder_attach(dev, to_encoder_slave(encoder),
+mod-slave);
+   else
+   ret = drm_i2c_encoder_init(dev, to_encoder_slave(encoder),
+  mod-i2c, info);
if (ret)
goto fail;
 
@@ -309,12 +315,12 @@ static struct of_device_id slave_of_match[];
 static int slave_probe(struct platform_device *pdev)
 {
struct device_node *node = pdev-dev.of_node;
-   struct device_node *i2c_node;
+   struct device_node *slave_node;
struct slave_module *slave_mod;
struct tilcdc_module *mod;
struct pinctrl *pinctrl;
-   uint32_t i2c_phandle;
-   struct i2c_adapter *slavei2c;
+   struct i2c_adapter *slavei2c = NULL;
+   struct i2c_client *slave = NULL;
int ret = -EINVAL;
 
/* bail out early if no DT data: */
@@ -323,26 +329,29 @@ static int slave_probe(struct platform_device *pdev)
return -ENXIO;
}
 
-   /* Bail out early if i2c not specified */
-   if (of_property_read_u32(node, i2c, i2c_phandle)) {
-   dev_err(pdev-dev, could not get i2c bus phandle\n);
-   return ret;
-   }
-
-   i2c_node = of_find_node_by_phandle(i2c_phandle);
-   if (!i2c_node) {
-   dev_err(pdev-dev, could not get i2c bus node\n);
-   return ret;
+   slave_node = of_parse_phandle(node, i2c-slave, 0);
+   if (slave_node) {
+   slave = of_find_i2c_device_by_node(slave_node);
+   of_node_put(slave_node);
+   } else {
+   struct device_node *i2c_node = of_parse_phandle(node, i2c, 0);
+
+   if (!i2c_node) {
+   dev_err(pdev-dev,
+   phandle for i2c-slave or i2c not found\n);
+   return -ENODEV;
+   }
+   slavei2c = of_find_i2c_adapter_by_node(i2c_node);
+   of_node_put(i2c_node);
}
 
-   /* but defer the probe if it can't be initialized it might come later */
-   slavei2c = of_find_i2c_adapter_by_node(i2c_node);
-   of_node_put(i2c_node);
-
-   if (!slavei2c) {
+   /* defer the probe if either slave device or the i2c bus
+  was not found, they might come later */
+   if (!slavei2c  !slave) {
ret = -EPROBE_DEFER;
tilcdc_slave_probedefer(true);
-   dev_err(pdev-dev, could not get i2c\n);
+   dev_info(pdev-dev,
+could not get i2c-slave or i2c, probe defered\n);
return ret;
}
 
@@ -358,6 +367,7 @@ static int slave_probe(struct platform_device *pdev)
mod-preferred_bpp = slave_info.bpp;
 
slave_mod-i2c = slavei2c;
+   slave_mod-slave = slave;
 
tilcdc_module_init(mod, slave, slave_module_ops);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org

Re: [PATCH v3 14/21] ARM: imx6: convert GPC to stacked domains

2015-01-13 Thread Marc Zyngier
On 13/01/15 06:09, Linus Walleij wrote:

Hi Linus,

 On Mon, Jan 12, 2015 at 7:26 PM, Marc Zyngier marc.zyng...@arm.com wrote:
 
 IMX6 has been (ab)using the gic_arch_extn to provide
 wakeup from suspend, and it makes a lot of sense to convert
 this code to use stacked domains instead.

 This patch does just this, updating the DT files to actually
 reflect what the HW provides.

 BIG FAT WARNING: because the DTs were so far lying by not
 exposing the fact that the GPC block is actually the first
 interrupt controller in the chain, kernels with this patch
 applied wont have any suspend-resume facility when booted
 with old DTs, and old kernels with updated DTs won't even boot.

 Tested-by: Stefan Agner ste...@agner.ch
 Acked-by: Stefan Agner ste...@agner.ch
 Signed-off-by: Marc Zyngier marc.zyng...@arm.com
 
 (...)
 
 +static int imx_gpc_domain_alloc(struct irq_domain *domain,
 + unsigned int virq,
 
 Nutcase nitpick on this nice patch series: every time I see virq my
 OCD triggers, as I think the v in virq stand for virtual. These irqs
 are no more virtual than any other Linux irq numbers, hwirq is
 more to the point.
 
 I just refer to these as irq (sans v) in any code I write.

That's fair enough. I'll update that as I fix some other nits.

Thanks,

M.
-- 
Jazz is not dead. It just smells funny...
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 14/21] ARM: imx6: convert GPC to stacked domains

2015-01-13 Thread Marc Zyngier
On 12/01/15 19:00, Stefan Agner wrote:
 Hi Marc,
 
 On 2015-01-12 19:26, Marc Zyngier wrote:
 IMX6 has been (ab)using the gic_arch_extn to provide
 wakeup from suspend, and it makes a lot of sense to convert
 this code to use stacked domains instead.

 This patch does just this, updating the DT files to actually
 reflect what the HW provides.

 BIG FAT WARNING: because the DTs were so far lying by not
 exposing the fact that the GPC block is actually the first
 interrupt controller in the chain, kernels with this patch
 applied wont have any suspend-resume facility when booted
 with old DTs, and old kernels with updated DTs won't even boot.

 Tested-by: Stefan Agner ste...@agner.ch
 Acked-by: Stefan Agner ste...@agner.ch
 Signed-off-by: Marc Zyngier marc.zyng...@arm.com
 ---
  arch/arm/boot/dts/imx6qdl.dtsi  |   7 ++-
  arch/arm/boot/dts/imx6sl.dtsi   |   5 +-
  arch/arm/boot/dts/imx6sx.dtsi   |   5 +-
  arch/arm/mach-imx/common.h  |   1 -
  arch/arm/mach-imx/gpc.c | 127 
 
  arch/arm/mach-imx/mach-imx6q.c  |   1 -
  arch/arm/mach-imx/mach-imx6sl.c |   1 -
  arch/arm/mach-imx/mach-imx6sx.c |   1 -
  8 files changed, 117 insertions(+), 31 deletions(-)

 diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
 index 4fc03b7..aff9ded 100644
 --- a/arch/arm/boot/dts/imx6qdl.dtsi
 +++ b/arch/arm/boot/dts/imx6qdl.dtsi
 @@ -53,6 +53,7 @@
   interrupt-controller;
   reg = 0x00a01000 0x1000,
 0x00a00100 0x100;
 + interrupt-parent = intc;
   };

   clocks {
 @@ -82,7 +83,7 @@
   #address-cells = 1;
   #size-cells = 1;
   compatible = simple-bus;
 - interrupt-parent = intc;
 + interrupt-parent = gpc;
   ranges;

   dma_apbh: dma-apbh@0011 {
 @@ -122,6 +123,7 @@
   compatible = arm,cortex-a9-twd-timer;
   reg = 0x00a00600 0x20;
   interrupts = 1 13 0xf01;
 + interrupt-parent = intc;
   clocks = clks IMX6QDL_CLK_TWD;
   };

 @@ -694,8 +696,11 @@
   gpc: gpc@020dc000 {
   compatible = fsl,imx6q-gpc;
   reg = 0x020dc000 0x4000;
 + interrupt-controller;
 + #interrupt-cells = 3;
   interrupts = 0 89 IRQ_TYPE_LEVEL_HIGH,
0 90 IRQ_TYPE_LEVEL_HIGH;
 + interrupt-parent = intc;
   };

   gpr: iomuxc-gpr@020e {
 diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
 index 36ab8e0..35099b7 100644
 --- a/arch/arm/boot/dts/imx6sl.dtsi
 +++ b/arch/arm/boot/dts/imx6sl.dtsi
 @@ -72,6 +72,7 @@
   interrupt-controller;
   reg = 0x00a01000 0x1000,
 0x00a00100 0x100;
 + interrupt-parent = intc;
   };

   clocks {
 @@ -95,7 +96,7 @@
   #address-cells = 1;
   #size-cells = 1;
   compatible = simple-bus;
 - interrupt-parent = intc;
 + interrupt-parent = gpc;
   ranges;

   ocram: sram@0090 {
 @@ -603,7 +604,9 @@
   gpc: gpc@020dc000 {
   compatible = fsl,imx6sl-gpc, fsl,imx6q-gpc;
   reg = 0x020dc000 0x4000;
 + interrupt-controller;
 
 GPC is in three base device trees, and missing in all of them. So the
 first is fixed
 
 this one...
 
   interrupts = 0 89 IRQ_TYPE_LEVEL_HIGH;
 + interrupt-parent = intc;
   };

   gpr: iomuxc-gpr@020e {
 diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi
 index 7a24fee..c476e67 100644
 --- a/arch/arm/boot/dts/imx6sx.dtsi
 +++ b/arch/arm/boot/dts/imx6sx.dtsi
 @@ -88,6 +88,7 @@
   interrupt-controller;
   reg = 0x00a01000 0x1000,
 0x00a00100 0x100;
 + interrupt-parent = intc;
   };

   clocks {
 @@ -131,7 +132,7 @@
   #address-cells = 1;
   #size-cells = 1;
   compatible = simple-bus;
 - interrupt-parent = intc;
 + interrupt-parent = gpc;
   ranges;

   pmu {
 @@ -700,7 +701,9 @@
   gpc: gpc@020dc000 {
   compatible = fsl,imx6sx-gpc, fsl,imx6q-gpc;
   reg = 0x020dc000 0x4000;
 + interrupt-controller;
 
 
 ... and this one is still missing.
 
 Sorry I did not see that the first review.

I thought I had them fixed on Sunday, but it looks like I've dropped the
fixup 

[PATCH 3/4] ARM: OMAP3: Remove cm-t3517 legacy support

2015-01-13 Thread Tony Lindgren
This board is working with device tree based booting so there should
not be any need to keep the legacy booting support around. People
using this board can boot it with appended DTB with existing bootloader.

By removing the 3517 legacy booting support we can get a bit closer to
making all of omap3 boot in device tree only mode.

Cc: Dmitry Lifshitz lifsh...@compulab.co.il
Cc: Igor Grinberg grinb...@compulab.co.il
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Kconfig  |   6 -
 arch/arm/mach-omap2/Makefile |   1 -
 arch/arm/mach-omap2/board-cm-t3517.c | 335 ---
 3 files changed, 342 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/board-cm-t3517.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index ba3a7a1..209456e 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -252,12 +252,6 @@ config MACH_CM_T35
select MACH_CM_T3730
select OMAP_PACKAGE_CUS
 
-config MACH_CM_T3517
-   bool CompuLab CM-T3517 module
-   depends on ARCH_OMAP3
-   default y
-   select OMAP_PACKAGE_CBB
-
 config MACH_CM_T3730
bool
 
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 39b1ee1..29da3f4 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -250,7 +250,6 @@ obj-$(CONFIG_MACH_NOKIA_RX51)   += board-rx51.o 
sdram-nokia.o
 obj-$(CONFIG_MACH_NOKIA_RX51)  += board-rx51-peripherals.o
 obj-$(CONFIG_MACH_NOKIA_RX51)  += board-rx51-video.o
 obj-$(CONFIG_MACH_CM_T35)  += board-cm-t35.o
-obj-$(CONFIG_MACH_CM_T3517)+= board-cm-t3517.o
 obj-$(CONFIG_MACH_TOUCHBOOK)   += board-omap3touchbook.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c 
b/arch/arm/mach-omap2/board-cm-t3517.c
deleted file mode 100644
index 794756d..000
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * linux/arch/arm/mach-omap2/board-cm-t3517.c
- *
- * Support for the CompuLab CM-T3517 modules
- *
- * Copyright (C) 2010 CompuLab, Ltd.
- * Author: Igor Grinberg grinb...@compulab.co.il
- *
- * 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/init.h
-#include linux/platform_device.h
-#include linux/delay.h
-#include linux/gpio.h
-#include linux/leds.h
-#include linux/omap-gpmc.h
-#include linux/rtc-v3020.h
-#include linux/mtd/mtd.h
-#include linux/mtd/nand.h
-#include linux/mtd/partitions.h
-#include linux/mmc/host.h
-#include linux/can/platform/ti_hecc.h
-
-#include asm/mach-types.h
-#include asm/mach/arch.h
-#include asm/mach/map.h
-
-#include common.h
-#include linux/platform_data/mtd-nand-omap2.h
-
-#include am35xx.h
-
-#include mux.h
-#include control.h
-#include hsmmc.h
-#include common-board-devices.h
-#include am35xx-emac.h
-
-#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
-static struct gpio_led cm_t3517_leds[] = {
-   [0] = {
-   .gpio   = 186,
-   .name   = cm-t3517:green,
-   .default_trigger= heartbeat,
-   .active_low = 0,
-   },
-};
-
-static struct gpio_led_platform_data cm_t3517_led_pdata = {
-   .num_leds   = ARRAY_SIZE(cm_t3517_leds),
-   .leds   = cm_t3517_leds,
-};
-
-static struct platform_device cm_t3517_led_device = {
-   .name   = leds-gpio,
-   .id = -1,
-   .dev= {
-   .platform_data  = cm_t3517_led_pdata,
-   },
-};
-
-static void __init cm_t3517_init_leds(void)
-{
-   platform_device_register(cm_t3517_led_device);
-}
-#else
-static inline void cm_t3517_init_leds(void) {}
-#endif
-
-#if defined(CONFIG_CAN_TI_HECC) || defined(CONFIG_CAN_TI_HECC_MODULE)
-static struct resource cm_t3517_hecc_resources[] = {
-   {
-   .start  = AM35XX_IPSS_HECC_BASE,
-   .end= AM35XX_IPSS_HECC_BASE + SZ_16K - 1,
-   .flags  = IORESOURCE_MEM,
-   },
-   {
-   .start  = 24 + OMAP_INTC_START,
-   .flags  = IORESOURCE_IRQ,
-   },
-};
-
-static struct ti_hecc_platform_data cm_t3517_hecc_pdata = {
-   .scc_hecc_offset= 

[PATCH 2/4] ARM: OMAP3: Remove legacy support for am3517crane

2015-01-13 Thread Tony Lindgren
This board is working with device tree based booting so there should
not be any need to keep the legacy booting support around. People
using this board can boot it with appended DTB with existing bootloader.

By removing the 3517 legacy booting support we can get a bit closer to
making all of omap3 boot in device tree only mode.

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Kconfig |   5 --
 arch/arm/mach-omap2/Makefile|   2 -
 arch/arm/mach-omap2/board-am3517crane.c | 150 
 3 files changed, 157 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/board-am3517crane.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index dcf126d..ba3a7a1 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -213,11 +213,6 @@ config MACH_OVERO
default y
select OMAP_PACKAGE_CBB
 
-config MACH_CRANEBOARD
-   bool AM3517/05 CRANE board
-   depends on ARCH_OMAP3
-   select OMAP_PACKAGE_CBB
-
 config MACH_OMAP3_PANDORA
bool OMAP3 Pandora
depends on ARCH_OMAP3
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index b68fb66..39b1ee1 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -253,8 +253,6 @@ obj-$(CONFIG_MACH_CM_T35)   += board-cm-t35.o
 obj-$(CONFIG_MACH_CM_T3517)+= board-cm-t3517.o
 obj-$(CONFIG_MACH_TOUCHBOOK)   += board-omap3touchbook.o
 
-obj-$(CONFIG_MACH_CRANEBOARD)  += board-am3517crane.o
-
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o
 
 # Platform specific device init code
diff --git a/arch/arm/mach-omap2/board-am3517crane.c 
b/arch/arm/mach-omap2/board-am3517crane.c
deleted file mode 100644
index 8168dda..000
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Support for AM3517/05 Craneboard
- * http://www.mistralsolutions.com/products/craneboard.php
- *
- * Copyright (C) 2010 Mistral Solutions Pvt Ltd. www.mistralsolutions.com
- * Author: R.Srinath srin...@mistralsolutions.com
- *
- * Based on mach-omap2/board-am3517evm.c
- *
- * 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 version 2.
- *
- * This program is distributed as is WITHOUT ANY WARRANTY of any kind,
- * whether express or implied; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- */
-
-#include linux/kernel.h
-#include linux/init.h
-#include linux/gpio.h
-#include linux/mfd/tps65910.h
-#include linux/mtd/mtd.h
-#include linux/mtd/nand.h
-#include linux/mtd/partitions.h
-#include linux/omap-gpmc.h
-
-#include asm/mach-types.h
-#include asm/mach/arch.h
-#include asm/mach/map.h
-
-#include common.h
-#include common-board-devices.h
-#include board-flash.h
-
-#include am35xx-emac.h
-#include mux.h
-#include control.h
-
-#define GPIO_USB_POWER 35
-#define GPIO_USB_NRESET38
-
-#ifdef CONFIG_OMAP_MUX
-static struct omap_board_mux board_mux[] __initdata = {
-   OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
-   { .reg_offset = OMAP_MUX_TERMINATOR },
-};
-#endif
-
-static struct usbhs_phy_data phy_data[] __initdata = {
-   {
-   .port = 1,
-   .reset_gpio = GPIO_USB_NRESET,
-   .vcc_gpio = GPIO_USB_POWER,
-   .vcc_polarity = 1,
-   },
-};
-
-static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
-   .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
-};
-
-static struct mtd_partition crane_nand_partitions[] = {
-   {
-   .name   = X-Loader,
-   .offset = 0,
-   .size   = 4 * NAND_BLOCK_SIZE,
-   .mask_flags = MTD_WRITEABLE,
-   },
-   {
-   .name   = U-Boot,
-   .offset = MTDPART_OFS_APPEND,
-   .size   = 14 * NAND_BLOCK_SIZE,
-   .mask_flags = MTD_WRITEABLE,
-   },
-   {
-   .name   = U-Boot Env,
-   .offset = MTDPART_OFS_APPEND,
-   .size   = 2 * NAND_BLOCK_SIZE,
-   },
-   {
-   .name   = Kernel,
-   .offset = MTDPART_OFS_APPEND,
-   .size   = 40 * NAND_BLOCK_SIZE,
-   },
-   {
-   .name   = File System,
-   .offset = MTDPART_OFS_APPEND,
-   .size   = MTDPART_SIZ_FULL,
-   },
-};
-
-static struct tps65910_board tps65910_pdata = {
-   .irq = 7 + OMAP_INTC_START,
-   .en_ck32k_xtal = true,
-};
-
-static struct i2c_board_info __initdata tps65910_board_info[] = {
-   {
-   I2C_BOARD_INFO(tps65910, 0x2d),
-   

[PATCH 1/4] ARM: OMAP3: Remove legacy support for am3517-evm

2015-01-13 Thread Tony Lindgren
This board is working with device tree based booting so there should
not be any need to keep the legacy booting support around. People
using this board can boot it with appended DTB with existing bootloader.

By removing the 3517 legacy booting support we can get a bit closer to
making all of omap3 boot in device tree only mode.

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Kconfig   |   6 -
 arch/arm/mach-omap2/Makefile  |   2 -
 arch/arm/mach-omap2/board-am3517evm.c | 373 --
 3 files changed, 381 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/board-am3517evm.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 6ab656c..dcf126d 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -213,12 +213,6 @@ config MACH_OVERO
default y
select OMAP_PACKAGE_CBB
 
-config MACH_OMAP3517EVM
-   bool OMAP3517/ AM3517 EVM board
-   depends on ARCH_OMAP3
-   default y
-   select OMAP_PACKAGE_CBB
-
 config MACH_CRANEBOARD
bool AM3517/05 CRANE board
depends on ARCH_OMAP3
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 5d27dfd..b68fb66 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -253,8 +253,6 @@ obj-$(CONFIG_MACH_CM_T35)   += board-cm-t35.o
 obj-$(CONFIG_MACH_CM_T3517)+= board-cm-t3517.o
 obj-$(CONFIG_MACH_TOUCHBOOK)   += board-omap3touchbook.o
 
-obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o
-
 obj-$(CONFIG_MACH_CRANEBOARD)  += board-am3517crane.o
 
 obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o
diff --git a/arch/arm/mach-omap2/board-am3517evm.c 
b/arch/arm/mach-omap2/board-am3517evm.c
deleted file mode 100644
index 1c091b3..000
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * linux/arch/arm/mach-omap2/board-am3517evm.c
- *
- * Copyright (C) 2009 Texas Instruments Incorporated
- * Author: Ranjith Lohithakshan ranji...@ti.com
- *
- * Based on mach-omap2/board-omap3evm.c
- *
- * 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 version 2.
- *
- * This program is distributed as is WITHOUT ANY WARRANTY of any kind,
- * whether express or implied; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- */
-
-#include linux/kernel.h
-#include linux/init.h
-#include linux/clk.h
-#include linux/platform_device.h
-#include linux/gpio.h
-#include linux/platform_data/pca953x.h
-#include linux/can/platform/ti_hecc.h
-#include linux/davinci_emac.h
-#include linux/mmc/host.h
-#include linux/usb/musb.h
-#include linux/platform_data/gpio-omap.h
-
-#include am35xx.h
-#include asm/mach-types.h
-#include asm/mach/arch.h
-#include asm/mach/map.h
-
-#include common.h
-#include video/omapdss.h
-#include video/omap-panel-data.h
-
-#include am35xx-emac.h
-#include mux.h
-#include control.h
-#include hsmmc.h
-
-#define LCD_PANEL_PWR  176
-#define LCD_PANEL_BKLIGHT_PWR  182
-#define LCD_PANEL_PWM  181
-
-static struct i2c_board_info __initdata am3517evm_i2c1_boardinfo[] = {
-   {
-   I2C_BOARD_INFO(s35390a, 0x30),
-   },
-};
-
-/*
- * RTC - S35390A
- */
-#define GPIO_RTCS35390A_IRQ55
-
-static void __init am3517_evm_rtc_init(void)
-{
-   int r;
-
-   omap_mux_init_gpio(GPIO_RTCS35390A_IRQ, OMAP_PIN_INPUT_PULLUP);
-
-   r = gpio_request_one(GPIO_RTCS35390A_IRQ, GPIOF_IN, rtcs35390a-irq);
-   if (r  0) {
-   printk(KERN_WARNING failed to request GPIO#%d\n,
-   GPIO_RTCS35390A_IRQ);
-   return;
-   }
-
-   am3517evm_i2c1_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
-}
-
-/*
- * I2C GPIO Expander - TCA6416
- */
-
-/* Mounted on Base-Board */
-static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = {
-   .gpio_base  = OMAP_MAX_GPIO_LINES,
-};
-static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
-   {
-   I2C_BOARD_INFO(tlv320aic23, 0x1A),
-   },
-   {
-   I2C_BOARD_INFO(tca6416, 0x21),
-   .platform_data = am3517evm_gpio_expander_info_0,
-   },
-};
-
-/* Mounted on UI Card */
-static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_1 = {
-   .gpio_base  = OMAP_MAX_GPIO_LINES + 16,
-};
-static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
-   .gpio_base  = OMAP_MAX_GPIO_LINES + 32,
-};
-static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = {
-   {
-   I2C_BOARD_INFO(tca6416, 0x20),
-   .platform_data = am3517evm_ui_gpio_expander_info_1,
-   },
-   {
-   

[PATCH 4/4] ARM: OMAP3: Remove legacy support for am35xx-emac

2015-01-13 Thread Tony Lindgren
This is no longer needed now that 3517 is booting in device tree
only mode.

Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Makefile   |   3 -
 arch/arm/mach-omap2/am35xx-emac.c  | 114 -
 arch/arm/mach-omap2/am35xx-emac.h  |  15 
 arch/arm/mach-omap2/am35xx.h   |  46 
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  33 +
 arch/arm/mach-omap2/pdata-quirks.c |   1 -
 6 files changed, 2 insertions(+), 210 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/am35xx-emac.c
 delete mode 100644 arch/arm/mach-omap2/am35xx-emac.h
 delete mode 100644 arch/arm/mach-omap2/am35xx.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 29da3f4..bc1a056 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -281,7 +281,4 @@ ifneq ($(CONFIG_HWSPINLOCK_OMAP),)
 obj-y  += hwspinlock.o
 endif
 
-emac-$(CONFIG_TI_DAVINCI_EMAC) := am35xx-emac.o
-obj-y  += $(emac-m) $(emac-y)
-
 obj-y  += common-board-devices.o twl-common.o 
dss-common.o
diff --git a/arch/arm/mach-omap2/am35xx-emac.c 
b/arch/arm/mach-omap2/am35xx-emac.c
deleted file mode 100644
index 6a6935c..000
--- a/arch/arm/mach-omap2/am35xx-emac.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2011 Ilya Yanok, Emcraft Systems
- *
- * Based on mach-omap2/board-am3517evm.c
- * Copyright (C) 2009 Texas Instruments Incorporated
- * Author: Ranjith Lohithakshan ranji...@ti.com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * published by the Free Software Foundation.
- *
- * This program is distributed as is WITHOUT ANY WARRANTY of any kind,
- * whether express or implied; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- */
-
-#include linux/err.h
-#include linux/davinci_emac.h
-#include omap_device.h
-#include am35xx.h
-#include control.h
-#include am35xx-emac.h
-
-static void am35xx_enable_emac_int(void)
-{
-   u32 v;
-
-   v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
-   v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR |
- AM35XX_CPGMAC_C0_MISC_PULSE_CLR | AM35XX_CPGMAC_C0_RX_THRESH_CLR);
-   omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
-   omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
-}
-
-static void am35xx_disable_emac_int(void)
-{
-   u32 v;
-
-   v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
-   v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR);
-   omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
-   omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
-}
-
-static struct emac_platform_data am35xx_emac_pdata = {
-   .ctrl_reg_offset= AM35XX_EMAC_CNTRL_OFFSET,
-   .ctrl_mod_reg_offset= AM35XX_EMAC_CNTRL_MOD_OFFSET,
-   .ctrl_ram_offset= AM35XX_EMAC_CNTRL_RAM_OFFSET,
-   .ctrl_ram_size  = AM35XX_EMAC_CNTRL_RAM_SIZE,
-   .hw_ram_addr= AM35XX_EMAC_HW_RAM_ADDR,
-   .version= EMAC_VERSION_2,
-   .interrupt_enable   = am35xx_enable_emac_int,
-   .interrupt_disable  = am35xx_disable_emac_int,
-};
-
-static struct mdio_platform_data am35xx_mdio_pdata;
-
-static int __init omap_davinci_emac_dev_init(struct omap_hwmod *oh,
-   void *pdata, int pdata_len)
-{
-   struct platform_device *pdev;
-
-   pdev = omap_device_build(oh-class-name, 0, oh, pdata, pdata_len);
-   if (IS_ERR(pdev)) {
-   WARN(1, Can't build omap_device for %s:%s.\n,
-oh-class-name, oh-name);
-   return PTR_ERR(pdev);
-   }
-
-   return 0;
-}
-
-void __init am35xx_emac_init(unsigned long mdio_bus_freq, u8 rmii_en)
-{
-   struct omap_hwmod *oh;
-   u32 v;
-   int ret;
-
-   oh = omap_hwmod_lookup(davinci_mdio);
-   if (!oh) {
-   pr_err(Could not find davinci_mdio hwmod\n);
-   return;
-   }
-
-   am35xx_mdio_pdata.bus_freq = mdio_bus_freq;
-
-   ret = omap_davinci_emac_dev_init(oh, am35xx_mdio_pdata,
-sizeof(am35xx_mdio_pdata));
-   if (ret) {
-   pr_err(Could not build davinci_mdio hwmod device\n);
-   return;
-   }
-
-   oh = omap_hwmod_lookup(davinci_emac);
-   if (!oh) {
-   pr_err(Could not find davinci_emac hwmod\n);
-   return;
-   }
-
-   am35xx_emac_pdata.rmii_en = rmii_en;
-
-   ret = omap_davinci_emac_dev_init(oh, am35xx_emac_pdata,
-sizeof(am35xx_emac_pdata));
-   if (ret) {
-   

[PATCH 0/4] Drop legacy support for omap3517

2015-01-13 Thread Tony Lindgren
Hi all,

It seems we can now drop omap3517 legacy booting support to get
a bit closer to making all of omap3 boot in device tree only mode.

All these boards have at least minimal support for booting with
device tree, and pretty much anything supported with the legacy
board files can be configured also for device tree based booting
if not done already.

If anybody has issues booting 3517 with appended device tree,
please post the isssues to the mailing lists so we can promptly
fix those.

Regards,

Tony


Tony Lindgren (4):
  ARM: OMAP3: Remove legacy support for am3517-evm
  ARM: OMAP3: Remove legacy support for am3517crane
  ARM: OMAP3: Remove cm-t3517 legacy support
  ARM: OMAP3: Remove legacy support for am35xx-emac

 arch/arm/mach-omap2/Kconfig|  17 --
 arch/arm/mach-omap2/Makefile   |   8 -
 arch/arm/mach-omap2/am35xx-emac.c  | 114 -
 arch/arm/mach-omap2/am35xx-emac.h  |  15 --
 arch/arm/mach-omap2/am35xx.h   |  46 
 arch/arm/mach-omap2/board-am3517crane.c| 150 
 arch/arm/mach-omap2/board-am3517evm.c  | 373 -
 arch/arm/mach-omap2/board-cm-t3517.c   | 335 --
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  33 +--
 arch/arm/mach-omap2/pdata-quirks.c |   1 -
 10 files changed, 2 insertions(+), 1090 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/am35xx-emac.c
 delete mode 100644 arch/arm/mach-omap2/am35xx-emac.h
 delete mode 100644 arch/arm/mach-omap2/am35xx.h
 delete mode 100644 arch/arm/mach-omap2/board-am3517crane.c
 delete mode 100644 arch/arm/mach-omap2/board-am3517evm.c
 delete mode 100644 arch/arm/mach-omap2/board-cm-t3517.c

-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RFC 0/3] Make ti,tilcdc,slave DT binding more sensible

2015-01-13 Thread Jean-Francois Moine
On Tue, 13 Jan 2015 19:12:25 +0200
Jyri Sarha jsa...@ti.com wrote:

 These patches are needed for Beaglebone-back HDMI audio. There is no
 direct dependency between these patches and the other (dts and ASoC)
 changes needed for the HDMI audio so these changes can be merged
 independently. I also feel that these changes make sense even without
 the HDMI audio.
 
 Best regards,
 Jyri
 
 Jyri Sarha (3):
   drm: encoder_slave: Add drm_i2c_encoder_attach()
   drm/tilcdc: slave: Add support for i2c-slave DT-parameter
   ARM: dts: am335x-boneblack: Use new binding in ti,tilcdc,slave node
 
  .../devicetree/bindings/drm/tilcdc/slave.txt   |4 +-
  arch/arm/boot/dts/am335x-boneblack.dts |9 +++-
  drivers/gpu/drm/drm_encoder_slave.c|   51 
 
  drivers/gpu/drm/tilcdc/tilcdc_slave.c  |   50 +++
  include/drm/drm_encoder_slave.h|3 ++
  5 files changed, 95 insertions(+), 22 deletions(-)

Instead of adding code to have the slave encoder working, it would be
simpler to change the way tilcdc uses the tda998x.
I already proposed such a patch:

http://lists.freedesktop.org/archives/dri-devel/2014-March/056065.html

and the changes in the tda998x driver have been done by Russell:

commit: a8f4d4d63739e4bca459ff40636f1d9e4b7ef5e6
drm/i2c: tda998x: allow re-use of tda998x support code
and
commit: c707c3619ca81f499a5ce032021405e989a96ff0
drm/i2c: tda998x: add component support

-- 
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef |   http://moinejf.free.fr/
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/6] net: davinci_emac: Fix runtime pm calls for davinci_emac

2015-01-13 Thread Tony Lindgren
Commit 3ba97381343b (net: ethernet: davinci_emac: add pm_runtime support)
added support for runtime PM, but it causes issues on omap3 related devices
that actually gate the clocks:

Unhandled fault: external abort on non-linefetch (0x1008)
...
[c04160f0] (emac_dev_getnetstats) from [c04d6a3c] (dev_get_stats+0x78/0xc8)
[c04d6a3c] (dev_get_stats) from [c04e9ccc] (rtnl_fill_ifinfo+0x3b8/0x938)
[c04e9ccc] (rtnl_fill_ifinfo) from [c04eade4] (rtmsg_ifinfo+0x68/0xd8)
[c04eade4] (rtmsg_ifinfo) from [c04dd35c] (register_netdevice+0x3a0/0x4ec)
[c04dd35c] (register_netdevice) from [c04dd4bc] (register_netdev+0x14/0x24)
[c04dd4bc] (register_netdev) from [c041755c] 
(davinci_emac_probe+0x408/0x5c8)
[c041755c] (davinci_emac_probe) from [c0396d78] 
(platform_drv_probe+0x48/0xa4)

Let's fix it by moving the pm_runtime_get() call earlier, and also
add it to the emac_dev_getnetstats(). Also note that we want to use
pm_rutime_get_sync() as we don't want to have deferred_resume happen.

Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Felipe Balbi ba...@ti.com
Cc: Mark A. Greer mgr...@animalcreek.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 drivers/net/ethernet/ti/davinci_emac.c | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
b/drivers/net/ethernet/ti/davinci_emac.c
index 383ed52..deb43b3 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1538,7 +1538,7 @@ static int emac_dev_open(struct net_device *ndev)
int i = 0;
struct emac_priv *priv = netdev_priv(ndev);
 
-   pm_runtime_get(priv-pdev-dev);
+   pm_runtime_get_sync(priv-pdev-dev);
 
netif_carrier_off(ndev);
for (cnt = 0; cnt  ETH_ALEN; cnt++)
@@ -1726,6 +1726,8 @@ static struct net_device_stats 
*emac_dev_getnetstats(struct net_device *ndev)
u32 mac_control;
u32 stats_clear_mask;
 
+   pm_runtime_get_sync(priv-pdev-dev);
+
/* update emac hardware stats and reset the registers*/
 
mac_control = emac_read(EMAC_MACCONTROL);
@@ -1767,6 +1769,8 @@ static struct net_device_stats 
*emac_dev_getnetstats(struct net_device *ndev)
ndev-stats.tx_fifo_errors += emac_read(EMAC_TXUNDERRUN);
emac_write(EMAC_TXUNDERRUN, stats_clear_mask);
 
+   pm_runtime_put(priv-pdev-dev);
+
return ndev-stats;
 }
 
@@ -1981,12 +1985,16 @@ static int davinci_emac_probe(struct platform_device 
*pdev)
ndev-ethtool_ops = ethtool_ops;
netif_napi_add(ndev, priv-napi, emac_poll, EMAC_POLL_WEIGHT);
 
+   pm_runtime_enable(pdev-dev);
+   pm_runtime_get_sync(pdev-dev);
+
/* register the network device */
SET_NETDEV_DEV(ndev, pdev-dev);
rc = register_netdev(ndev);
if (rc) {
dev_err(pdev-dev, error in register_netdev\n);
rc = -ENODEV;
+   pm_runtime_put(pdev-dev);
goto no_cpdma_chan;
}
 
@@ -1996,9 +2004,7 @@ static int davinci_emac_probe(struct platform_device 
*pdev)
   (regs: %p, irq: %d)\n,
   (void *)priv-emac_base_phys, ndev-irq);
}
-
-   pm_runtime_enable(pdev-dev);
-   pm_runtime_resume(pdev-dev);
+   pm_runtime_put(pdev-dev);
 
return 0;
 
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/6] net: davinci_emac: Free clock after checking the frequency

2015-01-13 Thread Tony Lindgren
We only use clk_get() to get the frequency, the rest is done by
the runtime PM calls. Let's free the clock too.

Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Felipe Balbi ba...@ti.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 drivers/net/ethernet/ti/davinci_emac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
b/drivers/net/ethernet/ti/davinci_emac.c
index deb43b3..e9efc74 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1881,6 +1881,7 @@ static int davinci_emac_probe(struct platform_device 
*pdev)
return -EBUSY;
}
emac_bus_frequency = clk_get_rate(emac_clk);
+   clk_put(emac_clk);
 
/* TODO: Probe PHY here if possible */
 
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/6] net: davinci_emac: Fix hangs with interrupts

2015-01-13 Thread Tony Lindgren
On davinci_emac, we have pulse interrupts. This means that we need to
clear the EOI bits when disabling interrupts as otherwise the interrupts
keep happening. And we also need to not clear the EOI bits again when
enabling the interrupts as otherwise we will get tons of:

unexpected IRQ trap at vector 00

These errors almost certainly mean that the omap-intc.c is signaling
a spurious interrupt with the reserved irq 127 as we've seen earlier
on omap3.

Let's fix the issue by clearing the EOI bits when disabling the
interrupts. Let's also keep the comment for Rx Threshold and Misc
interrupts are not enabled for both enable and disable so people
are aware of this when potentially adding more support.

Note that eventually we should handle the RX and TX interrupts
separately like cpsw is now doing. However, so far I have not seen
any issues with this based on my testing, so it seems to behave a
little different compared to the cpsw that had a similar issue.

Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Felipe Balbi ba...@ti.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 drivers/net/ethernet/ti/davinci_emac.c | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
b/drivers/net/ethernet/ti/davinci_emac.c
index ea71251..383ed52 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -922,6 +922,16 @@ static void emac_int_disable(struct emac_priv *priv)
if (priv-int_disable)
priv-int_disable();
 
+   /* NOTE: Rx Threshold and Misc interrupts are not enabled */
+
+   /* ack rxen only then a new pulse will be generated */
+   emac_write(EMAC_DM646X_MACEOIVECTOR,
+   EMAC_DM646X_MAC_EOI_C0_RXEN);
+
+   /* ack txen- only then a new pulse will be generated */
+   emac_write(EMAC_DM646X_MACEOIVECTOR,
+   EMAC_DM646X_MAC_EOI_C0_TXEN);
+
local_irq_restore(flags);
 
} else {
@@ -951,15 +961,6 @@ static void emac_int_enable(struct emac_priv *priv)
 * register */
 
/* NOTE: Rx Threshold and Misc interrupts are not enabled */
-
-   /* ack rxen only then a new pulse will be generated */
-   emac_write(EMAC_DM646X_MACEOIVECTOR,
-   EMAC_DM646X_MAC_EOI_C0_RXEN);
-
-   /* ack txen- only then a new pulse will be generated */
-   emac_write(EMAC_DM646X_MACEOIVECTOR,
-   EMAC_DM646X_MAC_EOI_C0_TXEN);
-
} else {
/* Set DM644x control registers for interrupt control */
emac_ctrl_write(EMAC_CTRL_EWCTL, 0x1);
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/6] net: davinci_emac: Fix ioremap for devices with MDIO within the EMAC address space

2015-01-13 Thread Tony Lindgren
Some devices like dm816x have the MDIO registers within the first EMAC
instance address space. Let's fix the issue by allowing to pass an
optional second IO range for the EMAC control register area.

Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Felipe Balbi ba...@ti.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 drivers/net/ethernet/ti/davinci_emac.c | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
b/drivers/net/ethernet/ti/davinci_emac.c
index 4c8d82c..0342273 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1877,7 +1877,7 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, 
struct emac_priv *priv)
 static int davinci_emac_probe(struct platform_device *pdev)
 {
int rc = 0;
-   struct resource *res;
+   struct resource *res, *res_ctrl;
struct net_device *ndev;
struct emac_priv *priv;
unsigned long hw_ram_addr;
@@ -1936,11 +1936,20 @@ static int davinci_emac_probe(struct platform_device 
*pdev)
rc = PTR_ERR(priv-remap_addr);
goto no_pdata;
}
+
+   res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+   if (res_ctrl) {
+   priv-ctrl_base =
+   devm_ioremap_resource(pdev-dev, res_ctrl);
+   if (IS_ERR(priv-ctrl_base))
+   goto no_pdata;
+   } else {
+   priv-ctrl_base = priv-remap_addr + pdata-ctrl_mod_reg_offset;
+   }
+
priv-emac_base = priv-remap_addr + pdata-ctrl_reg_offset;
ndev-base_addr = (unsigned long)priv-remap_addr;
 
-   priv-ctrl_base = priv-remap_addr + pdata-ctrl_mod_reg_offset;
-
hw_ram_addr = pdata-hw_ram_addr;
if (!hw_ram_addr)
hw_ram_addr = (u32 __force)res-start + pdata-ctrl_ram_offset;
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/6] net: davinci_emac: Add support for emac on dm816x

2015-01-13 Thread Tony Lindgren
On dm816x we have two emac controllers with separate memory
areas.

Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Felipe Balbi ba...@ti.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 Documentation/devicetree/bindings/net/davinci_emac.txt | 3 ++-
 drivers/net/ethernet/ti/davinci_emac.c | 5 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/davinci_emac.txt 
b/Documentation/devicetree/bindings/net/davinci_emac.txt
index 0328088..24c5cda 100644
--- a/Documentation/devicetree/bindings/net/davinci_emac.txt
+++ b/Documentation/devicetree/bindings/net/davinci_emac.txt
@@ -4,7 +4,8 @@ This file provides information, what the device node
 for the davinci_emac interface contains.
 
 Required properties:
-- compatible: ti,davinci-dm6467-emac or ti,am3517-emac
+- compatible: ti,davinci-dm6467-emac, ti,am3517-emac or
+  ti,dm816-emac
 - reg: Offset and length of the register set for the device
 - ti,davinci-ctrl-reg-offset: offset to control register
 - ti,davinci-ctrl-mod-reg-offset: offset to control module register
diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
b/drivers/net/ethernet/ti/davinci_emac.c
index 0342273..5caee66 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -2101,9 +2101,14 @@ static const struct emac_platform_data am3517_emac_data 
= {
.hw_ram_addr= 0x01e2,
 };
 
+static const struct emac_platform_data dm816_emac_data = {
+   .version= EMAC_VERSION_2,
+};
+
 static const struct of_device_id davinci_emac_of_match[] = {
{.compatible = ti,davinci-dm6467-emac, },
{.compatible = ti,am3517-emac, .data = am3517_emac_data, },
+   {.compatible = ti,dm816-emac, .data = dm816_emac_data, },
{},
 };
 MODULE_DEVICE_TABLE(of, davinci_emac_of_match);
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/6] net: davinci_emac: Fix incomplete code for getting the phy from device tree

2015-01-13 Thread Tony Lindgren
Looks like the phy_id is never set up beyond getting the phandle.
Note that we can remove the ifdef for phy_node as there is a stub
for of_phy_connec() if CONFIG_OF is not set.

Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Felipe Balbi ba...@ti.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 drivers/net/ethernet/ti/davinci_emac.c | 23 ++-
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
b/drivers/net/ethernet/ti/davinci_emac.c
index e9efc74..4c8d82c 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -62,6 +62,7 @@
 #include linux/of.h
 #include linux/of_address.h
 #include linux/of_device.h
+#include linux/of_mdio.h
 #include linux/of_irq.h
 #include linux/of_net.h
 
@@ -343,9 +344,7 @@ struct emac_priv {
u32 multicast_hash_cnt[EMAC_NUM_MULTICAST_BITS];
u32 rx_addr_type;
const char *phy_id;
-#ifdef CONFIG_OF
struct device_node *phy_node;
-#endif
struct phy_device *phydev;
spinlock_t lock;
/*platform specific members*/
@@ -1597,8 +1596,20 @@ static int emac_dev_open(struct net_device *ndev)
cpdma_ctlr_start(priv-dma);
 
priv-phydev = NULL;
+
+   if (priv-phy_node) {
+   priv-phydev = of_phy_connect(ndev, priv-phy_node,
+ emac_adjust_link, 0, 0);
+   if (!priv-phydev) {
+   dev_err(emac_dev, could not connect to phy %s\n,
+   priv-phy_node-full_name);
+   ret = -ENODEV;
+   goto err;
+   }
+   }
+
/* use the first phy on the bus if pdata did not give us a phy id */
-   if (!priv-phy_id) {
+   if (!priv-phydev  !priv-phy_id) {
struct device *phy;
 
phy = bus_find_device(mdio_bus_type, NULL, NULL,
@@ -1607,7 +1618,7 @@ static int emac_dev_open(struct net_device *ndev)
priv-phy_id = dev_name(phy);
}
 
-   if (priv-phy_id  *priv-phy_id) {
+   if (!priv-phydev  priv-phy_id  *priv-phy_id) {
priv-phydev = phy_connect(ndev, priv-phy_id,
   emac_adjust_link,
   PHY_INTERFACE_MODE_MII);
@@ -1628,7 +1639,9 @@ static int emac_dev_open(struct net_device *ndev)
(mii_bus:phy_addr=%s, id=%x)\n,
priv-phydev-drv-name, dev_name(priv-phydev-dev),
priv-phydev-phy_id);
-   } else {
+   }
+
+   if (!priv-phydev) {
/* No PHY , fix the link, speed and duplex settings */
dev_notice(emac_dev, no phy, defaulting to 100/full\n);
priv-link = 1;
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch-net-next 1/3] net: ethernet: cpsw: unroll IRQ request loop

2015-01-13 Thread Felipe Balbi
This patch is in preparation for a nicer IRQ
handling scheme where we use different IRQ
handlers for each IRQ line (as it should be).

Later, we will also drop IRQs offset 0 and 3
because they are always disabled in this driver.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/net/ethernet/ti/cpsw.c | 62 --
 1 file changed, 47 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index e61ee8351272..6e04128b9543 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -2156,7 +2156,8 @@ static int cpsw_probe(struct platform_device *pdev)
void __iomem*ss_regs;
struct resource *res, *ss_res;
u32 slave_offset, sliver_offset, slave_size;
-   int ret = 0, i, k = 0;
+   int ret = 0, i;
+   int irq;
 
ndev = alloc_etherdev(sizeof(struct cpsw_priv));
if (!ndev) {
@@ -2345,24 +2346,55 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
}
 
-   while ((res = platform_get_resource(priv-pdev, IORESOURCE_IRQ, k))) {
-   if (k = ARRAY_SIZE(priv-irqs_table)) {
-   ret = -EINVAL;
-   goto clean_ale_ret;
-   }
+   irq = platform_get_irq(pdev, 0);
+   if (irq  0)
+   goto clean_ale_ret;
 
-   ret = devm_request_irq(pdev-dev, res-start, cpsw_interrupt,
-  0, dev_name(pdev-dev), priv);
-   if (ret  0) {
-   dev_err(priv-dev, error attaching irq (%d)\n, ret);
-   goto clean_ale_ret;
-   }
+   priv-irqs_table[0] = irq;
+   ret = devm_request_irq(pdev-dev, irq, cpsw_interrupt,
+   0, dev_name(pdev-dev), priv);
+   if (ret  0) {
+   dev_err(priv-dev, error attaching irq (%d)\n, ret);
+   goto clean_ale_ret;
+   }
 
-   priv-irqs_table[k] = res-start;
-   k++;
+   irq = platform_get_irq(pdev, 1);
+   if (irq  0)
+   goto clean_ale_ret;
+
+   priv-irqs_table[1] = irq;
+   ret = devm_request_irq(pdev-dev, irq, cpsw_interrupt,
+   0, dev_name(pdev-dev), priv);
+   if (ret  0) {
+   dev_err(priv-dev, error attaching irq (%d)\n, ret);
+   goto clean_ale_ret;
+   }
+
+   irq = platform_get_irq(pdev, 2);
+   if (irq  0)
+   goto clean_ale_ret;
+
+   priv-irqs_table[2] = irq;
+   ret = devm_request_irq(pdev-dev, irq, cpsw_interrupt,
+   0, dev_name(pdev-dev), priv);
+   if (ret  0) {
+   dev_err(priv-dev, error attaching irq (%d)\n, ret);
+   goto clean_ale_ret;
+   }
+
+   irq = platform_get_irq(pdev, 3);
+   if (irq  0)
+   goto clean_ale_ret;
+
+   priv-irqs_table[3] = irq;
+   ret = devm_request_irq(pdev-dev, irq, cpsw_interrupt,
+   0, dev_name(pdev-dev), priv);
+   if (ret  0) {
+   dev_err(priv-dev, error attaching irq (%d)\n, ret);
+   goto clean_ale_ret;
}
 
-   priv-num_irqs = k;
+   priv-num_irqs = 4;
 
ndev-features |= NETIF_F_HW_VLAN_CTAG_FILTER;
 
-- 
2.2.0

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/6] net: davinci_emac: Fix ioremap for devices with MDIO within the EMAC address space

2015-01-13 Thread Tony Lindgren
* Felipe Balbi ba...@ti.com [150113 11:57]:
 On Tue, Jan 13, 2015 at 11:29:27AM -0800, Tony Lindgren wrote:
  Some devices like dm816x have the MDIO registers within the first EMAC
  instance address space. Let's fix the issue by allowing to pass an
  optional second IO range for the EMAC control register area.
  
  Cc: Brian Hutchinson b.hutch...@gmail.com
  Cc: Felipe Balbi ba...@ti.com
  Signed-off-by: Tony Lindgren t...@atomide.com
  ---
   drivers/net/ethernet/ti/davinci_emac.c | 15 ---
   1 file changed, 12 insertions(+), 3 deletions(-)
  
  diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
  b/drivers/net/ethernet/ti/davinci_emac.c
  index 4c8d82c..0342273 100644
  --- a/drivers/net/ethernet/ti/davinci_emac.c
  +++ b/drivers/net/ethernet/ti/davinci_emac.c
  @@ -1877,7 +1877,7 @@ davinci_emac_of_get_pdata(struct platform_device 
  *pdev, struct emac_priv *priv)
   static int davinci_emac_probe(struct platform_device *pdev)
   {
  int rc = 0;
  -   struct resource *res;
  +   struct resource *res, *res_ctrl;
  struct net_device *ndev;
  struct emac_priv *priv;
  unsigned long hw_ram_addr;
  @@ -1936,11 +1936,20 @@ static int davinci_emac_probe(struct 
  platform_device *pdev)
  rc = PTR_ERR(priv-remap_addr);
  goto no_pdata;
  }
  +
  +   res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
  +   if (res_ctrl) {
 
 devm_ioremap_resource() will check for res_ctrl being a valid pointer,
 perhaps below would be slightly better ?
 
 
   res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
   priv-ctrl_base = devm_ioremap_resource(pdev-dev, res_ctrl);
   if (IS_ERR(priv-ctrl_base))
   priv-ctrl_base = priv-remap_addr + pdata-ctrl_mod_reg_offset;
 

We have a pile of devices using just one ioremap area so the second
ioremap area needs to be optional. That's why we only do it based on
if (res_ctrl).

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/6] Fixes for davinci_emac

2015-01-13 Thread Tony Lindgren
Hi,

Here are some fixes for davinci_emac for the issues I've noticed
recently.

Regards,

Tony

Tony Lindgren (6):
  net: davinci_emac: Fix hangs with interrupts
  net: davinci_emac: Fix runtime pm calls for davinci_emac
  net: davinci_emac: Free clock after checking the frequency
  net: davinci_emac: Fix incomplete code for getting the phy from device
tree
  net: davinci_emac: Fix ioremap for devices with MDIO within the EMAC
address space
  net: davinci_emac: Add support for emac on dm816x

 .../devicetree/bindings/net/davinci_emac.txt   |  3 +-
 drivers/net/ethernet/ti/davinci_emac.c | 77 --
 2 files changed, 58 insertions(+), 22 deletions(-)

-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/6] net: davinci_emac: Fix hangs with interrupts

2015-01-13 Thread Tony Lindgren
* Felipe Balbi ba...@ti.com [150113 11:40]:
 On Tue, Jan 13, 2015 at 11:29:23AM -0800, Tony Lindgren wrote:
  
  Note that eventually we should handle the RX and TX interrupts
  separately like cpsw is now doing. However, so far I have not seen
  any issues with this based on my testing, so it seems to behave a
  little different compared to the cpsw that had a similar issue.
 
 pretty much the same thing that happens with CPSW, I think that a future
 patch might want to change things so that we only write EOI to the IRQ
 that actually fires, though.

Yeah I agree that's totally the way to go for the future. I've tried to
expose that issue here with nuttcp but so far no luck.

Regards,

Tony 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/6] net: davinci_emac: Fix ioremap for devices with MDIO within the EMAC address space

2015-01-13 Thread Felipe Balbi
On Tue, Jan 13, 2015 at 11:29:27AM -0800, Tony Lindgren wrote:
 Some devices like dm816x have the MDIO registers within the first EMAC
 instance address space. Let's fix the issue by allowing to pass an
 optional second IO range for the EMAC control register area.
 
 Cc: Brian Hutchinson b.hutch...@gmail.com
 Cc: Felipe Balbi ba...@ti.com
 Signed-off-by: Tony Lindgren t...@atomide.com
 ---
  drivers/net/ethernet/ti/davinci_emac.c | 15 ---
  1 file changed, 12 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
 b/drivers/net/ethernet/ti/davinci_emac.c
 index 4c8d82c..0342273 100644
 --- a/drivers/net/ethernet/ti/davinci_emac.c
 +++ b/drivers/net/ethernet/ti/davinci_emac.c
 @@ -1877,7 +1877,7 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, 
 struct emac_priv *priv)
  static int davinci_emac_probe(struct platform_device *pdev)
  {
   int rc = 0;
 - struct resource *res;
 + struct resource *res, *res_ctrl;
   struct net_device *ndev;
   struct emac_priv *priv;
   unsigned long hw_ram_addr;
 @@ -1936,11 +1936,20 @@ static int davinci_emac_probe(struct platform_device 
 *pdev)
   rc = PTR_ERR(priv-remap_addr);
   goto no_pdata;
   }
 +
 + res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 + if (res_ctrl) {

devm_ioremap_resource() will check for res_ctrl being a valid pointer,
perhaps below would be slightly better ?


res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
priv-ctrl_base = devm_ioremap_resource(pdev-dev, res_ctrl);
if (IS_ERR(priv-ctrl_base))
priv-ctrl_base = priv-remap_addr + pdata-ctrl_mod_reg_offset;

-- 
balbi


signature.asc
Description: Digital signature


[PATCH RFC] ASoC: simple-card: Enable and disable DAI clocks as needed

2015-01-13 Thread Jyri Sarha
Call clk_prepare_enable() and clk_disable_unprepare() for cpu dai
clock and codec dai clock in dai statup and shutdown callbacks. This
to make sure the related clock are enabled when the audio device is
used.

Signed-off-by: Jyri Sarha jsa...@ti.com
---
This patch is needed for Beaglebone-back HDMI audio. There is no
direct dependency between this patch and the other (dts and DRM)
changes needed for the HDMI audio so these changes can be merged
independently. There are also some other TI EVMs that require this
functionality if they are to be used with simple-card.

 .../devicetree/bindings/sound/simple-card.txt  |5 +++
 include/sound/simple_card.h|1 +
 sound/soc/generic/simple-card.c|   34 
 3 files changed, 40 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt 
b/Documentation/devicetree/bindings/sound/simple-card.txt
index c3cba60..73bf314 100644
--- a/Documentation/devicetree/bindings/sound/simple-card.txt
+++ b/Documentation/devicetree/bindings/sound/simple-card.txt
@@ -75,6 +75,11 @@ Optional CPU/CODEC subnodes properties:
  it can be specified via clocks if 
system has
  clock node (= common clock), or 
system-clock-frequency
  (if system doens't support common 
clock)
+ If a clock is specified, it is
+ enabled with clk_prepare_enable()
+ in dai startup() and disabled with
+ clk_disable_unprepare() in dai
+ shutdown().
 
 Example 1 - single DAI link:
 
diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h
index 9b0ac77..1255ddb 100644
--- a/include/sound/simple_card.h
+++ b/include/sound/simple_card.h
@@ -20,6 +20,7 @@ struct asoc_simple_dai {
unsigned int sysclk;
int slots;
int slot_width;
+   struct clk *clk;
 };
 
 struct asoc_simple_card_info {
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index fb9240f..cb3998d 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -39,6 +39,37 @@ struct simple_card_data {
 #define simple_priv_to_link(priv, i) ((priv)-snd_card.dai_link + i)
 #define simple_priv_to_props(priv, i) ((priv)-dai_props + i)
 
+static int asoc_simple_card_startup(struct snd_pcm_substream *substream)
+{
+   struct snd_soc_pcm_runtime *rtd = substream-private_data;
+   struct simple_card_data *priv = snd_soc_card_get_drvdata(rtd-card);
+   struct simple_dai_props *dai_props =
+   priv-dai_props[rtd - rtd-card-rtd];
+   int ret;
+
+   ret = clk_prepare_enable(dai_props-cpu_dai.clk);
+   if (ret)
+   return ret;
+   
+   ret = clk_prepare_enable(dai_props-codec_dai.clk);
+   if (ret)
+   clk_disable_unprepare(dai_props-cpu_dai.clk);
+
+   return ret;
+}
+
+static void asoc_simple_card_shutdown(struct snd_pcm_substream *substream)
+{
+   struct snd_soc_pcm_runtime *rtd = substream-private_data;
+   struct simple_card_data *priv = snd_soc_card_get_drvdata(rtd-card);
+   struct simple_dai_props *dai_props =
+   priv-dai_props[rtd - rtd-card-rtd];
+
+   clk_disable_unprepare(dai_props-cpu_dai.clk);
+
+   clk_disable_unprepare(dai_props-codec_dai.clk);
+}
+
 static int asoc_simple_card_hw_params(struct snd_pcm_substream *substream,
  struct snd_pcm_hw_params *params)
 {
@@ -58,6 +89,8 @@ static int asoc_simple_card_hw_params(struct 
snd_pcm_substream *substream,
 }
 
 static struct snd_soc_ops asoc_simple_card_ops = {
+   .startup = asoc_simple_card_startup,
+   .shutdown = asoc_simple_card_shutdown,
.hw_params = asoc_simple_card_hw_params,
 };
 
@@ -219,6 +252,7 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
}
 
dai-sysclk = clk_get_rate(clk);
+   dai-clk = clk;
} else if (!of_property_read_u32(np, system-clock-frequency, val)) {
dai-sysclk = val;
} else {
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/6] net: davinci_emac: Free clock after checking the frequency

2015-01-13 Thread Tony Lindgren
* Tom Lendacky thomas.lenda...@amd.com [150113 11:51]:
 On 01/13/2015 01:29 PM, Tony Lindgren wrote:
 We only use clk_get() to get the frequency, the rest is done by
 the runtime PM calls. Let's free the clock too.
 
 Cc: Brian Hutchinson b.hutch...@gmail.com
 Cc: Felipe Balbi ba...@ti.com
 Signed-off-by: Tony Lindgren t...@atomide.com
 ---
   drivers/net/ethernet/ti/davinci_emac.c | 1 +
   1 file changed, 1 insertion(+)
 
 diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
 b/drivers/net/ethernet/ti/davinci_emac.c
 index deb43b3..e9efc74 100644
 --- a/drivers/net/ethernet/ti/davinci_emac.c
 +++ b/drivers/net/ethernet/ti/davinci_emac.c
 @@ -1881,6 +1881,7 @@ static int davinci_emac_probe(struct platform_device 
 *pdev)
  return -EBUSY;
  }
  emac_bus_frequency = clk_get_rate(emac_clk);
 +clk_put(emac_clk);
 
 The devm_clk_get call is used to get the clock so either a devm_clk_put
 needs to be used here or just let the devm_ call do its thing and
 automatically do the put when the module is unloaded.

Thanks good catch, updated patch below.

Runtime PM is really managing the clocks here and the driver
just checks the rate so let's devm_clk_put() it here.

Regards,

Tony.

8 -
From: Tony Lindgren t...@atomide.com
Date: Mon, 22 Dec 2014 08:19:06 -0800
Subject: [PATCH] net: davinci_emac: Free clock after checking the frequency

We only use clk_get() to get the frequency, the rest is done by
the runtime PM calls. Let's free the clock too.

Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Felipe Balbi ba...@ti.com
Signed-off-by: Tony Lindgren t...@atomide.com

--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1881,6 +1881,7 @@ static int davinci_emac_probe(struct platform_device 
*pdev)
return -EBUSY;
}
emac_bus_frequency = clk_get_rate(emac_clk);
+   devm_clk_put(pdev-dev, emac_clk);
 
/* TODO: Probe PHY here if possible */
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch-net-next 2/3] net: ethernet: cpsw: split out IRQ handler

2015-01-13 Thread Felipe Balbi
Now we can introduce dedicated IRQ handlers
for each of the IRQ events. This helps with
cleaning up a little bit of the clutter in
cpsw_interrupt() while also making sure that
TX IRQs will try to handle TX buffers while
RX IRQs will try to handle RX buffers.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/net/ethernet/ti/cpsw.c | 41 ++---
 1 file changed, 30 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 6e04128b9543..c9081bdbbcbc 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -754,18 +754,36 @@ requeue:
dev_kfree_skb_any(new_skb);
 }
 
-static irqreturn_t cpsw_interrupt(int irq, void *dev_id)
+static irqreturn_t cpsw_dummy_interrupt(int irq, void *dev_id)
 {
struct cpsw_priv *priv = dev_id;
int value = irq - priv-irqs_table[0];
 
-   /* NOTICE: Ending IRQ here. The trick with the 'value' variable above
-* is to make sure we will always write the correct value to the EOI
-* register. Namely 0 for RX_THRESH Interrupt, 1 for RX Interrupt, 2
-* for TX Interrupt and 3 for MISC Interrupt.
-*/
cpdma_ctlr_eoi(priv-dma, value);
 
+   return IRQ_HANDLED;
+}
+
+static irqreturn_t cpsw_tx_interrupt(int irq, void *dev_id)
+{
+   struct cpsw_priv *priv = dev_id;
+
+   cpdma_ctlr_eoi(priv-dma, CPDMA_EOI_TX);
+   cpdma_chan_process(priv-txch, 128);
+
+   priv = cpsw_get_slave_priv(priv, 1);
+   if (priv)
+   cpdma_chan_process(priv-txch, 128);
+
+   return IRQ_HANDLED;
+}
+
+static irqreturn_t cpsw_rx_interrupt(int irq, void *dev_id)
+{
+   struct cpsw_priv *priv = dev_id;
+
+   cpdma_ctlr_eoi(priv-dma, CPDMA_EOI_RX);
+
cpsw_intr_disable(priv);
if (priv-irq_enabled == true) {
cpsw_disable_irq(priv);
@@ -1617,7 +1635,8 @@ static void cpsw_ndo_poll_controller(struct net_device 
*ndev)
 
cpsw_intr_disable(priv);
cpdma_ctlr_int_ctrl(priv-dma, false);
-   cpsw_interrupt(ndev-irq, priv);
+   cpsw_rx_interrupt(priv-irq[1], priv);
+   cpsw_tx_interrupt(priv-irq[2], priv);
cpdma_ctlr_int_ctrl(priv-dma, true);
cpsw_intr_enable(priv);
 }
@@ -2351,7 +2370,7 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
 
priv-irqs_table[0] = irq;
-   ret = devm_request_irq(pdev-dev, irq, cpsw_interrupt,
+   ret = devm_request_irq(pdev-dev, irq, cpsw_dummy_interrupt,
0, dev_name(pdev-dev), priv);
if (ret  0) {
dev_err(priv-dev, error attaching irq (%d)\n, ret);
@@ -2363,7 +2382,7 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
 
priv-irqs_table[1] = irq;
-   ret = devm_request_irq(pdev-dev, irq, cpsw_interrupt,
+   ret = devm_request_irq(pdev-dev, irq, cpsw_rx_interrupt,
0, dev_name(pdev-dev), priv);
if (ret  0) {
dev_err(priv-dev, error attaching irq (%d)\n, ret);
@@ -2375,7 +2394,7 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
 
priv-irqs_table[2] = irq;
-   ret = devm_request_irq(pdev-dev, irq, cpsw_interrupt,
+   ret = devm_request_irq(pdev-dev, irq, cpsw_tx_interrupt,
0, dev_name(pdev-dev), priv);
if (ret  0) {
dev_err(priv-dev, error attaching irq (%d)\n, ret);
@@ -2387,7 +2406,7 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
 
priv-irqs_table[3] = irq;
-   ret = devm_request_irq(pdev-dev, irq, cpsw_interrupt,
+   ret = devm_request_irq(pdev-dev, irq, cpsw_dummy_interrupt,
0, dev_name(pdev-dev), priv);
if (ret  0) {
dev_err(priv-dev, error attaching irq (%d)\n, ret);
-- 
2.2.0

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch-net-next 3/3] net: ethernet: cpsw: don't requests IRQs we don't use

2015-01-13 Thread Felipe Balbi
CPSW never uses RX_THRESHOLD or MISC interrupts. In
fact, they are always kept masked in their appropriate
IRQ Enable register.

Instead of allocating an IRQ that never fires, it's best
to remove that code altogether and let future patches
implement it if anybody needs those.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/net/ethernet/ti/cpsw.c | 55 --
 1 file changed, 15 insertions(+), 40 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index c9081bdbbcbc..fd0acd9b41ae 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -754,16 +754,6 @@ requeue:
dev_kfree_skb_any(new_skb);
 }
 
-static irqreturn_t cpsw_dummy_interrupt(int irq, void *dev_id)
-{
-   struct cpsw_priv *priv = dev_id;
-   int value = irq - priv-irqs_table[0];
-
-   cpdma_ctlr_eoi(priv-dma, value);
-
-   return IRQ_HANDLED;
-}
-
 static irqreturn_t cpsw_tx_interrupt(int irq, void *dev_id)
 {
struct cpsw_priv *priv = dev_id;
@@ -1635,8 +1625,8 @@ static void cpsw_ndo_poll_controller(struct net_device 
*ndev)
 
cpsw_intr_disable(priv);
cpdma_ctlr_int_ctrl(priv-dma, false);
-   cpsw_rx_interrupt(priv-irq[1], priv);
-   cpsw_tx_interrupt(priv-irq[2], priv);
+   cpsw_rx_interrupt(priv-irq[0], priv);
+   cpsw_tx_interrupt(priv-irq[1], priv);
cpdma_ctlr_int_ctrl(priv-dma, true);
cpsw_intr_enable(priv);
 }
@@ -2358,30 +2348,27 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_dma_ret;
}
 
-   ndev-irq = platform_get_irq(pdev, 0);
+   ndev-irq = platform_get_irq(pdev, 1);
if (ndev-irq  0) {
dev_err(priv-dev, error getting irq resource\n);
ret = -ENOENT;
goto clean_ale_ret;
}
 
-   irq = platform_get_irq(pdev, 0);
-   if (irq  0)
-   goto clean_ale_ret;
-
-   priv-irqs_table[0] = irq;
-   ret = devm_request_irq(pdev-dev, irq, cpsw_dummy_interrupt,
-   0, dev_name(pdev-dev), priv);
-   if (ret  0) {
-   dev_err(priv-dev, error attaching irq (%d)\n, ret);
-   goto clean_ale_ret;
-   }
+   /* Grab RX and TX IRQs. Note that we also have RX_THRESHOLD and
+* MISC IRQs which are always kept disabled with this driver so
+* we will not request them.
+*
+* If anyone wants to implement support for those, make sure to
+* first request and append them to irqs_table array.
+*/
 
+   /* RX IRQ */
irq = platform_get_irq(pdev, 1);
if (irq  0)
goto clean_ale_ret;
 
-   priv-irqs_table[1] = irq;
+   priv-irqs_table[0] = irq;
ret = devm_request_irq(pdev-dev, irq, cpsw_rx_interrupt,
0, dev_name(pdev-dev), priv);
if (ret  0) {
@@ -2389,31 +2376,19 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
}
 
+   /* TX IRQ */
irq = platform_get_irq(pdev, 2);
if (irq  0)
goto clean_ale_ret;
 
-   priv-irqs_table[2] = irq;
+   priv-irqs_table[1] = irq;
ret = devm_request_irq(pdev-dev, irq, cpsw_tx_interrupt,
0, dev_name(pdev-dev), priv);
if (ret  0) {
dev_err(priv-dev, error attaching irq (%d)\n, ret);
goto clean_ale_ret;
}
-
-   irq = platform_get_irq(pdev, 3);
-   if (irq  0)
-   goto clean_ale_ret;
-
-   priv-irqs_table[3] = irq;
-   ret = devm_request_irq(pdev-dev, irq, cpsw_dummy_interrupt,
-   0, dev_name(pdev-dev), priv);
-   if (ret  0) {
-   dev_err(priv-dev, error attaching irq (%d)\n, ret);
-   goto clean_ale_ret;
-   }
-
-   priv-num_irqs = 4;
+   priv-num_irqs = 2;
 
ndev-features |= NETIF_F_HW_VLAN_CTAG_FILTER;
 
-- 
2.2.0

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/6] net: davinci_emac: Free clock after checking the frequency

2015-01-13 Thread Felipe Balbi
On Tue, Jan 13, 2015 at 01:48:24PM -0600, Tom Lendacky wrote:
 On 01/13/2015 01:29 PM, Tony Lindgren wrote:
 We only use clk_get() to get the frequency, the rest is done by
 the runtime PM calls. Let's free the clock too.
 
 Cc: Brian Hutchinson b.hutch...@gmail.com
 Cc: Felipe Balbi ba...@ti.com
 Signed-off-by: Tony Lindgren t...@atomide.com
 ---
   drivers/net/ethernet/ti/davinci_emac.c | 1 +
   1 file changed, 1 insertion(+)
 
 diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
 b/drivers/net/ethernet/ti/davinci_emac.c
 index deb43b3..e9efc74 100644
 --- a/drivers/net/ethernet/ti/davinci_emac.c
 +++ b/drivers/net/ethernet/ti/davinci_emac.c
 @@ -1881,6 +1881,7 @@ static int davinci_emac_probe(struct platform_device 
 *pdev)
  return -EBUSY;
  }
  emac_bus_frequency = clk_get_rate(emac_clk);
 +clk_put(emac_clk);
 
 The devm_clk_get call is used to get the clock so either a devm_clk_put
 needs to be used here or just let the devm_ call do its thing and
 automatically do the put when the module is unloaded.

instead, if you really don't need the clock for anything other than
getting its rate, why don't you just remove devm_ prefix from clk_get()?

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 1/7] ARM: OMAP2+: Remove unused ti81xx platform init code

2015-01-13 Thread Felipe Balbi
On Tue, Jan 13, 2015 at 03:13:51PM -0800, Tony Lindgren wrote:
 The support for 81xx was never working in mainline, and it
 will be only supported in device tree mode. Let's remove all
 the remaining 81xx related platform code.

you should probably also mention here that you're dropping unnecessary
non-DT AM33xx support since that has never booted on legacy mode.

Other than that

Reviewed-by: Felipe Balbi ba...@ti.com


 Cc: Brian Hutchinson b.hutch...@gmail.com
 Signed-off-by: Tony Lindgren t...@atomide.com
 ---
  arch/arm/mach-omap2/cclock3xxx_data.c   |  6 +-
  arch/arm/mach-omap2/omap_phy_internal.c | 35 
 -
  arch/arm/mach-omap2/usb-musb.c  | 12 ++-
  arch/arm/mach-omap2/usb.h   |  2 --
  4 files changed, 3 insertions(+), 52 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c 
 b/arch/arm/mach-omap2/cclock3xxx_data.c
 index 644ff32..e79c80b 100644
 --- a/arch/arm/mach-omap2/cclock3xxx_data.c
 +++ b/arch/arm/mach-omap2/cclock3xxx_data.c
 @@ -3634,10 +3634,6 @@ int __init omap3xxx_clk_init(void)
   omap_clocks_register(omap36xx_am35xx_omap3430es2plus_clks,

 ARRAY_SIZE(omap36xx_am35xx_omap3430es2plus_clks));
   omap_clocks_register(omap3xxx_clks, ARRAY_SIZE(omap3xxx_clks));
 - } else if (soc_is_am33xx()) {
 - cpu_mask = RATE_IN_AM33XX;
 - } else if (cpu_is_ti814x()) {
 - cpu_mask = RATE_IN_TI814X;
   } else if (cpu_is_omap34xx()) {
   if (omap_rev() == OMAP3430_REV_ES1_0) {
   cpu_mask = RATE_IN_3430ES1;
 @@ -3681,7 +3677,7 @@ int __init omap3xxx_clk_init(void)
* Lock DPLL5 -- here only until other device init code can
* handle this
*/
 - if (!cpu_is_ti81xx()  (omap_rev() = OMAP3430_REV_ES2_0))
 + if (omap_rev() = OMAP3430_REV_ES2_0)
   omap3_clk_lock_dpll5();
  
   /* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
 diff --git a/arch/arm/mach-omap2/omap_phy_internal.c 
 b/arch/arm/mach-omap2/omap_phy_internal.c
 index 1a19fa0..8e90356 100644
 --- a/arch/arm/mach-omap2/omap_phy_internal.c
 +++ b/arch/arm/mach-omap2/omap_phy_internal.c
 @@ -152,38 +152,3 @@ void am35x_set_mode(u8 musb_mode)
  
   omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
  }
 -
 -void ti81xx_musb_phy_power(u8 on)
 -{
 - void __iomem *scm_base = NULL;
 - u32 usbphycfg;
 -
 - scm_base = ioremap(TI81XX_SCM_BASE, SZ_2K);
 - if (!scm_base) {
 - pr_err(system control module ioremap failed\n);
 - return;
 - }
 -
 - usbphycfg = readl_relaxed(scm_base + USBCTRL0);
 -
 - if (on) {
 - if (cpu_is_ti816x()) {
 - usbphycfg |= TI816X_USBPHY0_NORMAL_MODE;
 - usbphycfg = ~TI816X_USBPHY_REFCLK_OSC;
 - } else if (cpu_is_ti814x()) {
 - usbphycfg = ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN
 - | USBPHY_DPINPUT | USBPHY_DMINPUT);
 - usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN
 - | USBPHY_DPOPBUFCTL | USBPHY_DMOPBUFCTL);
 - }
 - } else {
 - if (cpu_is_ti816x())
 - usbphycfg = ~TI816X_USBPHY0_NORMAL_MODE;
 - else if (cpu_is_ti814x())
 - usbphycfg |= USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN;
 -
 - }
 - writel_relaxed(usbphycfg, scm_base + USBCTRL0);
 -
 - iounmap(scm_base);
 -}
 diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
 index bc89723..e4562b2 100644
 --- a/arch/arm/mach-omap2/usb-musb.c
 +++ b/arch/arm/mach-omap2/usb-musb.c
 @@ -82,16 +82,8 @@ void __init usb_musb_init(struct omap_musb_board_data 
 *musb_board_data)
   musb_plat.mode = board_data-mode;
   musb_plat.extvbus = board_data-extvbus;
  
 - if (soc_is_am35xx()) {
 - oh_name = am35x_otg_hs;
 - name = musb-am35x;
 - } else if (cpu_is_ti81xx()) {
 - oh_name = usb_otg_hs;
 - name = musb-ti81xx;
 - } else {
 - oh_name = usb_otg_hs;
 - name = musb-omap2430;
 - }
 + oh_name = usb_otg_hs;
 + name = musb-omap2430;
  
  oh = omap_hwmod_lookup(oh_name);
  if (WARN(!oh, %s: could not find omap_hwmod for %s\n,
 diff --git a/arch/arm/mach-omap2/usb.h b/arch/arm/mach-omap2/usb.h
 index 4ba2ae7..3395365 100644
 --- a/arch/arm/mach-omap2/usb.h
 +++ b/arch/arm/mach-omap2/usb.h
 @@ -68,5 +68,3 @@ extern void am35x_musb_reset(void);
  extern void am35x_musb_phy_power(u8 on);
  extern void am35x_musb_clear_irq(void);
  extern void am35x_set_mode(u8 musb_mode);
 -extern void ti81xx_musb_phy_power(u8 on);
 -
 -- 
 2.1.4
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  

Re: [PATCH 2/7] ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks

2015-01-13 Thread Felipe Balbi
On Tue, Jan 13, 2015 at 03:13:52PM -0800, Tony Lindgren wrote:
 We need to check if we got the clock before trying to do anything
 with it. Otherwise we will get something like this:
 
 Unable to handle kernel paging request at virtual address fffe
 ...
 [c04bef78] (clk_prepare) from [c00338a4] 
 (omap2_clk_enable_init_clocks+0x50/0x8)
 [c00338a4] (omap2_clk_enable_init_clocks) from [c0876838] 
 (dm816x_dt_clk_init+0)
 ...
 
 Let's add check for the clock and WARN if the init clock was not
 found.
 
 Cc: Brian Hutchinson b.hutch...@gmail.com
 Signed-off-by: Tony Lindgren t...@atomide.com

Just one minor nit below, other than that:

Reviewed-by: Felipe Balbi ba...@ti.com

 ---
  arch/arm/mach-omap2/clock.c | 5 +
  1 file changed, 5 insertions(+)
 
 diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
 index 6ad5b4d..89a0732 100644
 --- a/arch/arm/mach-omap2/clock.c
 +++ b/arch/arm/mach-omap2/clock.c
 @@ -620,6 +620,11 @@ void omap2_clk_enable_init_clocks(const char 
 **clk_names, u8 num_clocks)
  
   for (i = 0; i  num_clocks; i++) {
   init_clk = clk_get(NULL, clk_names[i]);
 + if (IS_ERR(init_clk)) {
 + WARN(1, omap clock: could not find init clock %s\n,
 +  clk_names[i]);

you can combine the if with the WARN():

if (WARN(IS_ERR(init_clk), could not find init clock %s\n,
clk_names[i]))

not that I also removed that omap clock prefix because WARN() will
print the file name anyway.

 + continue;
 + }
   clk_prepare_enable(init_clk);
   }
  }
 -- 
 2.1.4
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 6/7] ARM: OMAP2+: Fix reboot for 81xx

2015-01-13 Thread Felipe Balbi
On Tue, Jan 13, 2015 at 03:13:56PM -0800, Tony Lindgren wrote:
 We are missing proper hooks for 81xx for reboot to work.
 
 Cc: Brian Hutchinson b.hutch...@gmail.com
 Signed-off-by: Tony Lindgren t...@atomide.com
 ---
  arch/arm/mach-omap2/Makefile |  1 +
  arch/arm/mach-omap2/common.h |  8 
  arch/arm/mach-omap2/ti81xx-restart.c | 31 +++
  3 files changed, 40 insertions(+)
  create mode 100644 arch/arm/mach-omap2/ti81xx-restart.c
 
 diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
 index 5d27dfd..3a6463f 100644
 --- a/arch/arm/mach-omap2/Makefile
 +++ b/arch/arm/mach-omap2/Makefile
 @@ -58,6 +58,7 @@ AFLAGS_sram34xx.o   :=-Wa,-march=armv7-a
  # Restart code (OMAP4/5 currently in omap4-common.c)
  obj-$(CONFIG_SOC_OMAP2420)   += omap2-restart.o
  obj-$(CONFIG_SOC_OMAP2430)   += omap2-restart.o
 +obj-$(CONFIG_SOC_TI81XX) += ti81xx-restart.o
  obj-$(CONFIG_SOC_AM33XX) += am33xx-restart.o
  obj-$(CONFIG_SOC_AM43XX) += omap4-restart.o
  obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o
 diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
 index 900ebdd..65b4371 100644
 --- a/arch/arm/mach-omap2/common.h
 +++ b/arch/arm/mach-omap2/common.h
 @@ -164,6 +164,14 @@ static inline void omap3xxx_restart(enum reboot_mode 
 mode, const char *cmd)
  }
  #endif
  
 +#ifdef CONFIG_SOC_TI81XX
 +void ti81xx_restart(enum reboot_mode mode, const char *cmd);
 +#else
 +static inline void ti81xx_restart(enum reboot_mode mode, const char *cmd)
 +{
 +}
 +#endif
 +
  #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
   defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
  void omap44xx_restart(enum reboot_mode mode, const char *cmd);
 diff --git a/arch/arm/mach-omap2/ti81xx-restart.c 
 b/arch/arm/mach-omap2/ti81xx-restart.c
 new file mode 100644
 index 000..68b29be
 --- /dev/null
 +++ b/arch/arm/mach-omap2/ti81xx-restart.c
 @@ -0,0 +1,31 @@
 +/*
 + * 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.
 + */
 +#include linux/kernel.h
 +#include linux/init.h
 +#include linux/reboot.h
 +
 +#include iomap.h
 +#include common.h
 +#include control.h
 +#include prm3xxx.h
 +
 +#define TI81XX_PRM_DEVICE_RSTCTRL0x00a0
 +#define TI81XX_GLOBAL_RST_COLD   BIT(1)
 +
 +/**
 + * ti81xx_restart - trigger a software restart of the SoC
 + * @mode: the reboot mode, see arch/arm/kernel/{setup,process}.c
 + * @cmd: passed from the userspace program rebooting the system (if provided)
 + *
 + * Resets the SoC.  For @cmd, see the 'reboot' syscall in
 + * kernel/sys.c.  No return value.
 + */
 +void ti81xx_restart(enum reboot_mode mode, const char *cmd)
 +{
 + omap2_prm_set_mod_reg_bits(TI81XX_GLOBAL_RST_COLD, 0,
 +TI81XX_PRM_DEVICE_RSTCTRL);

do you need to check that mode == REBOOT_COLD here ?

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH] ARM: OMAP2+: hwmod: Fix _wait_target_ready() for hwmods without sysc

2015-01-13 Thread Suman Anna
Hi Paul,

On 01/13/2015 05:29 PM, Paul Walmsley wrote:
 Hi Suman,
 
 thanks for pitching in on this!
 
 On Tue, 6 Jan 2015, Suman Anna wrote:
 
 You have removed the return from the above block on failure. If any DT
 entry doesn't have the reg property, this will hang the kernel boot.
 Just remove the reg entry from any of the existing DT, and you will
 run into the issue, this is what 6423d6df1440 (ARM: OMAP2+: hwmod:
 check for module address space during init) fixed. 
 
 Seems like that's the problem that we need to track down, then.  If a 
 hwmod has no MPU-accessible registers, it should still be possible to 
 init the clocks for the device, etc. ...

Yes true, and I should have rephrased above statement a little better -
its for modules with sysc but with no reg property to supply the base
for the module's SYSCONFIG or SYSSTATUS registers. The commit
6423d6df1440 has the explanation for the hang.

 
 Also, are you sure you want to turn the WARN into a pr_debug, it won't 
 even show during the kernel boot log if the reg base is missing.
 
 No, I'm not sure :-)  I guess it depends how many hwmods we'll have with 
 no MPU-accessible registers.  We don't seem to have address ranges for the 
 interconnects defined; we could fix that fairly easily.

The WARN_ON previously was to throw a eye-catchy print for the case
where hwmods have sysc but no address space defined (is an error
usually, but this is what we run into during the DT conversion of a
device as the hwmod and DTS changes come in through separate topic
branches).  I still think that the sysc check should be before the check
for _HWMOD_NO_MPU_PORT, a module with sysc mandates it has an MPU port.

regards
Suman
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ARM: OMAP: DRA7: hwmod: Make gpmc software supervised as the smart idle is broken

2015-01-13 Thread Keerthy
This patch fixes: 'omap_hwmod: gpmc: _wait_target_disable failed'
error during suspend.

This is because smart idle is broken.
Tested in dra7-evm D1 board.

Signed-off-by: Keerthy j-keer...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
index 9cdd8b8..29e55fe 100644
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -826,7 +826,8 @@ static struct omap_hwmod dra7xx_gpmc_hwmod = {
.name   = gpmc,
.class  = dra7xx_gpmc_hwmod_class,
.clkdm_name = l3main1_clkdm,
-   .flags  = HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET,
+   .flags  = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET |
+  HWMOD_SWSUP_SIDLE),
.main_clk   = l3_iclk_div,
.prcm = {
.omap4 = {
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/3] Convert omap_hsmmc to use common devicetree parsing code.

2015-01-13 Thread Ulf Hansson
On 12 January 2015 at 20:23, NeilBrown ne...@suse.de wrote:
 This is another resend with mmc_gpio_set_cd_isr() now returning
 void and being EXPORTed.

 I included
 WARN_ON(ctx-cd_gpio_isr);
 to guard against misuse.

 My goal is to get omap_hsmmc to use the common code for parsing of,
 particularly so that I can set cap-power-off-card, which omap_hsmmc
 doesn't explicitly report.

 Thanks,
 NeilBrown

 P.S. Sorry for delay - I've been travelling.

 ---

 NeilBrown (3):
   mmc: core: Allow host driver to provide isr for card-detect interrupts.
   mmc: omap_hsmmc: use slot-gpio library for gpio support.
   mmc: omap_hsmmc: use mmc_of_parse to parse common mmc configuration.


  drivers/mmc/core/slot-gpio.c  |   18 +++
  drivers/mmc/host/omap_hsmmc.c |  100 
 +
  include/linux/mmc/slot-gpio.h |2 +
  3 files changed, 40 insertions(+), 80 deletions(-)



Thanks! Applied for next.

Kind regards
Uffe
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RESEND(2) 1/2] usb: dwc3: gadget: Fix TRB preparation during SG

2015-01-13 Thread Amit Virdi
When scatter gather (SG) is used, multiple TRBs are prepared from one DWC3
request (dwc3_request). So while preparing TRBs, the 'last' flag should be set
only when it is the last TRB being prepared from the last dwc3_request entry.

The current implementation uses list_is_last to check if the dwc3_request is the
last entry from the request_list. However, list_is_last returns false for the
last entry too. This is because, while preparing the first TRB from a request,
the function dwc3_prepare_one_trb modifies the request's next and prev pointers
while moving the URB to req_queued. Hence, list_is_last always returns false no
matter what.

The correct way is not to access the modified pointers of dwc3_request but to
use list_empty macro instead.

Fixes: e5ba5ec833aa4a76980b512d6a6779643516b850 (usb: dwc3: gadget: fix scatter
gather implementation

Signed-off-by: Amit Virdi amit.vi...@st.com
Cc: sta...@vger.kernel.org # v3.9+
---
 drivers/usb/dwc3/gadget.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 4e2593993fae..cb8939134c32 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -879,8 +879,7 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep, bool 
starting)
 
if (i == (request-num_mapped_sgs - 1) ||
sg_is_last(s)) {
-   if (list_is_last(req-list,
-   dep-request_list))
+   if (list_empty(dep-request_list))
last_one = true;
chain = false;
}
-- 
1.8.0

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RESEND(2) 2/2] usb: dwc3: gadget: Stop TRB preparation after limit is reached

2015-01-13 Thread Amit Virdi
DWC3 gadget sets up a pool of 32 TRBs for each EP during initialization. This
means, the max TRBs that can be submitted for an EP is fixed to 32. Since the
request queue for an EP is a linked list, any number of requests can be queued
to it by the gadget layer.  However, the dwc3 driver must not submit TRBs more
than the pool it has created for. This limit wasn't respected when SG was used
resulting in submitting more than the max TRBs, eventually leading to
non-transfer of the TRBs submitted over the max limit.

Root cause:
When SG is used, there are two loops iterating to prepare TRBs:
 - Outer loop over the request_list
 - Inner loop over the SG list
The code was missing break to get out of the outer loop.

Signed-off-by: Amit Virdi amit.vi...@st.com
Cc: sta...@vger.kernel.org # v3.9+
---
 drivers/usb/dwc3/gadget.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index cb8939134c32..6c5e344822b9 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -897,6 +897,9 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep, bool 
starting)
if (last_one)
break;
}
+
+   if (last_one)
+   break;
} else {
dma = req-request.dma;
length = req-request.length;
-- 
1.8.0

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RESEND(2) 0/2] usb: dwc3: gadget: Bug fixes

2015-01-13 Thread Amit Virdi
This is a re-submission of patches [1/4] and [2/4] from:
http://www.spinics.net/lists/linux-usb/msg118841.html

Commit log of both these patches has been modified for aided clarity. These
patches have been rebased on Balbi's testing/next.

Patches [3/4] and [4/4] were accepted as they were. 

Amit Virdi (2):
  usb: dwc3: gadget: Fix TRB preparation during SG
  usb: dwc3: gadget: Stop TRB preparation after limit is reached

 drivers/usb/dwc3/gadget.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

-- 
1.8.0

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH RESEND 0/2] usb: dwc3: gadget: Bug fixes

2015-01-13 Thread Amit Virdi

On 1/13/2015 12:10 PM, Amit VIRDI wrote:

This is a re-submission of patches [1/4] and [2/4] from:
http://www.spinics.net/lists/linux-usb/msg118841.html

Commit log of both these patches has been modified for aided clarity. These
patches have been rebased on Balbi's testing/next.

Patches [3/4] and [4/4] were accepted as they were.

Amit Virdi (2):
   usb: dwc3: gadget: Fix TRB preparation during SG
   usb: dwc3: gadget: Stop TRB preparation after limit is reached

  drivers/usb/dwc3/gadget.c | 6 --
  1 file changed, 4 insertions(+), 2 deletions(-)



I was using older git version, so git failed to send patches to 
sta...@vger.kernel.org


Please discard this patchset. I'm resending with updated git
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] can: c_can: use regmap_update_bits() to modify RAMINIT register

2015-01-13 Thread Roger Quadros
use of regmap_read() and regmap_write() in c_can_hw_raminit_syscon()
is not safe as the RAMINIT register can be shared between different drivers
at least for TI SoCs.

To make the modification atomic we switch to using regmap_update_bits().

regmap_update_bits() skips writing to the register if it's read content is the
same as what is going to be written. This causes an issue for us when we
need to clear the DONE bit with the initial condition START:0, DONE:1 as
DONE bit must be written with 1 to clear it.

So we defer the clearing of DONE bit to later when we set the START bit.
There we are sure that START bit is changed from 0 to 1 so the write of
1 to already set DONE bit will happen.

Signed-off-by: Roger Quadros rog...@ti.com
---
 drivers/net/can/c_can/c_can_platform.c | 29 ++---
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/drivers/net/can/c_can/c_can_platform.c 
b/drivers/net/can/c_can/c_can_platform.c
index f363972..e36d105 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -103,27 +103,34 @@ static void c_can_hw_raminit_syscon(const struct 
c_can_priv *priv, bool enable)
mask = 1  raminit-bits.start | 1  raminit-bits.done;
regmap_read(raminit-syscon, raminit-reg, ctrl);
 
-   /* We clear the done and start bit first. The start bit is
+   /* We clear the start bit first. The start bit is
 * looking at the 0 - transition, but is not self clearing;
-* And we clear the init done bit as well.
 * NOTE: DONE must be written with 1 to clear it.
+* We can't clear the DONE bit here using regmap_update_bits()
+* as it will bypass the write if initial condition is START:0 DONE:1
+* e.g. on DRA7 which needs START pulse.
 */
-   ctrl = ~(1  raminit-bits.start);
-   ctrl |= 1  raminit-bits.done;
-   regmap_write(raminit-syscon, raminit-reg, ctrl);
+   ctrl = ~mask;  /* START = 0, DONE = 0 */
+   regmap_update_bits(raminit-syscon, raminit-reg, mask, ctrl);
 
-   ctrl = ~(1  raminit-bits.done);
-   c_can_hw_raminit_wait_syscon(priv, mask, ctrl);
+   /* check if START bit is 0. Ignore DONE bit for now
+* as it can be either 0 or 1.
+*/
+   c_can_hw_raminit_wait_syscon(priv, 1  raminit-bits.start, ctrl);
 
if (enable) {
-   /* Set start bit and wait for the done bit. */
+   /* Clear DONE bit  set START bit. */
ctrl |= 1  raminit-bits.start;
-   regmap_write(raminit-syscon, raminit-reg, ctrl);
-
+   /* DONE must be written with 1 to clear it */
+   ctrl |= 1  raminit-bits.done;
+   regmap_update_bits(raminit-syscon, raminit-reg, mask, ctrl);
+   /* prevent further clearing of DONE bit */
+   ctrl = ~(1  raminit-bits.done);
/* clear START bit if start pulse is needed */
if (raminit-needs_pulse) {
ctrl = ~(1  raminit-bits.start);
-   regmap_write(raminit-syscon, raminit-reg, ctrl);
+   regmap_update_bits(raminit-syscon, raminit-reg,
+  mask, ctrl);
}
 
ctrl |= 1  raminit-bits.done;
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 3/3] arm: dts: omap3-gta04: Add handling for tv output

2015-01-13 Thread Tomi Valkeinen
On 03/12/14 23:33, Marek Belisko wrote:
 Add handling for gta04 tv out chain:
 venc - opa362 - svideo
 
 Use invert-polarity in venc node because opa362
 is doing polarity inversion also.
 
 Signed-off-by: Marek Belisko ma...@goldelico.com
 ---
  arch/arm/boot/dts/omap3-gta04.dtsi | 49 
 ++
  1 file changed, 49 insertions(+)

Looks fine to me.

Tony, do you want to pick this up? I can take the first two patches via
fbdev.

 Tomi




signature.asc
Description: OpenPGP digital signature


Re: [PATCH] video: fbdev: omap2: dss: rfbi.c: Remove some unused functions

2015-01-13 Thread Tomi Valkeinen
On 21/12/14 19:02, Rickard Strandqvist wrote:
 Removes some functions that are not used anywhere:
 rfbi_init_display() rfbi_display_disable() rfbi_display_enable()
 rfbi_set_interface_timings() rfbi_set_data_lines() rfbi_set_pixel_size()
 rfbi_set_size() rfbi_update() rfbi_configure() rfbi_enable_te()
 rfbi_setup_te() rfbi_write_pixels() rfbi_write_data() rfbi_read_data()
 rfbi_write_command() rfbi_bus_unlock() rfbi_bus_lock()
 
 This was partially found by using a static code analysis program called 
 cppcheck.
 
 Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
 ---
  drivers/video/fbdev/omap2/dss/rfbi.c |  297 
 --
  1 file changed, 297 deletions(-)

It's true those functions are not used anywhere, but RFBI is currently
marked as BROKEN so it cannot be compiled and the functions do not do
any harm. I'd rather keep them, as they give an insight how the rfbi
should work if and when someone will fix the driver.

 Tomi




signature.asc
Description: OpenPGP digital signature


Re: [PATCH] video: fbdev: omap2: dss: dispc.c: Remove some unused functions

2015-01-13 Thread Tomi Valkeinen
On 01/01/15 17:29, Rickard Strandqvist wrote:
 Removes some functions that are not used anywhere:
 dispc_wb_go() dispc_wb_go_busy() dispc_wb_get_framedone_irq()
 dispc_mgr_get_clock_div() dispc_wb_is_enabled() dispc_wb_enable()
 dispc_wb_setup() dispc_enable_fifomerge() dispc_wb_set_channel_in()
 
 This was partially found by using a static code analysis program called 
 cppcheck.
 
 Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
 ---
  drivers/video/fbdev/omap2/dss/dispc.c |  124 
 -
  drivers/video/fbdev/omap2/dss/dss.h   |   12 
  2 files changed, 136 deletions(-)

The functions are for DSS's write-back functionality. We're going to
implement that hopefully sometime soon, so I don't want to remove those
functions.

 Tomi




signature.asc
Description: OpenPGP digital signature


Re: [RFC 0/5] i2c: omap: new fixes 2

2015-01-13 Thread Wolfram Sang
On Wed, Dec 03, 2014 at 06:33:57PM +0400, Alexander Kochetkov wrote:
 This pacth series intended for fixing problem reported
 by Tony Lindgren t...@atomide.com here[1]
 
 One of first four patched could fix the problem.
 Last patch provide event trace so I could resolve problem.
 It could be applied using 'git am' or 'patch -p1 ...'
 
 Patches are rebased on branch 'i2c/for-next' of
 git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
 (6e79807443cba7397cd855ed29d6faba51d4c893)
 
 Tony, could you check, does the series fix the problem reported[1]?
 If yes, could you bisect and point commit that solve.
 If no, could you provide trace output (with or without the patches
 from series).
 If no, could you check does i2c-omap.c from commit 
 ca1f8da9ac5ce6e63d8f6933f83fabc1f3f961f4.
 (the commit before my changes to kernel) work for you?
 
 Thank you.
 
 Regards,
 Alexander.

Thanks for working hard on this driver. I'll mark these patches as RFC,
since they did not get any additional tags from other people. If they
are intended for upstream, please resend a rebased version.

   Wolfram



signature.asc
Description: Digital signature


Re: [RFC 0/2] i2c: omap: new fixes for driver

2015-01-13 Thread Wolfram Sang
On Sun, Nov 30, 2014 at 01:00:01AM +0400, Alexander Kochetkov wrote:
 The first patch fix i2c-omap driver for omap2420, found by code review and
 later reported by Tony Lindgren t...@atomide.com here[1].
 Candidate for stable?
 
 The second patch unhide the reson of system lockup.
 
 The patch is rebased on branch 'i2c/for-next' of
 git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
 (6e79807443cba7397cd855ed29d6faba51d4c893)
 
 Tony, could you check, what the patches fix the problem reported[1]?
 Kevin, could you run tests for patches on all omap boards?
 
 Regards,
 Alexander.

Thanks for working hard on this driver. I'll mark these patches as RFC,
since they did not get any additional tags from other people. If they
are intended for upstream, please resend a rebased version.

   Wolfram



signature.asc
Description: Digital signature


Re: [PATCH] fbdev: omap2: Fix typo in tvc_probe_pdata

2015-01-13 Thread Tomi Valkeinen
On 05/01/15 15:09, Rasmus Villemoes wrote:
 Assigning ddata-invert_polarity to itself is not very useful; the
 context suggests that the right-hand side should have been
 pdata-invert_polarity.
 
 Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
 ---
  drivers/video/fbdev/omap2/displays-new/connector-analog-tv.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/video/fbdev/omap2/displays-new/connector-analog-tv.c 
 b/drivers/video/fbdev/omap2/displays-new/connector-analog-tv.c
 index 9a2b5ce58545..8511c648a15c 100644
 --- a/drivers/video/fbdev/omap2/displays-new/connector-analog-tv.c
 +++ b/drivers/video/fbdev/omap2/displays-new/connector-analog-tv.c
 @@ -208,7 +208,7 @@ static int tvc_probe_pdata(struct platform_device *pdev)
   ddata-in = in;
  
   ddata-connector_type = pdata-connector_type;
 - ddata-invert_polarity = ddata-invert_polarity;
 + ddata-invert_polarity = pdata-invert_polarity;
  
   dssdev = ddata-dssdev;
   dssdev-name = pdata-name;

Good catch, thanks! Queueing for 3.20 (as no one is using that flag in
3.19).

 Tomi




signature.asc
Description: OpenPGP digital signature


[PATCH v3 0/4] phy: ti-pipe3: fixes for 3.19-rc

2015-01-13 Thread Roger Quadros
Hi,

During system suspend L3INIT_960M_GFCLK and L3INIT_480M_GFCLK clocks remain
active on the DRA7 platform. This is because the pipe3 driver doesn't shut
them off as part of .suspend(). Patch 1 addresses this issue.

SATA on both OMAP5 and DRA7 breaks when SATA drive is plugged in after a
system suspend/resume or if AHCI_PLATFORM driver is used as module.
Patches 2,3,4 fix it.

Hope to get these patches in through the 3.19-rc cycle.

Tony,

Do you wish to take the DTS patches or let them go in through PHY tree?

cheers,
-roger

---
Changelog
- v3 : Commit message updated. dts changes moved to separate patch.
- v2 : Don't break SATA with old DTB.

Roger Quadros (4):
  phy: ti-pipe3: Disable clocks on system suspend
  phy: ti-pipe3: Fix SATA across suspend/resume
  ARM: dts: DRA7: Fix SATA PHY node
  ARM: dts: OMAP5: Fix SATA PHY node

 arch/arm/boot/dts/dra7.dtsi  |   4 +-
 arch/arm/boot/dts/omap5.dtsi |   4 +-
 drivers/phy/phy-ti-pipe3.c   | 142 +--
 3 files changed, 115 insertions(+), 35 deletions(-)

-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 1/4] phy: ti-pipe3: Disable clocks on system suspend

2015-01-13 Thread Roger Quadros
On system suspend, the runtime_suspend() driver hook doesn't get
called for USB phy and so the clocks are not disabled in the driver.
This causes the L3INIT_960M_GFCLK and L3INIT_480M_GFCLK to remain
active on the DRA7 platform while in system suspend.

In case of pcie-phy, the runtime_suspend hook gets called after
the suspend hook so we introduce a flag phy-enabled to keep
track if our clocks are enabled or not to prevent multiple
enable/disables.

Add suspend/resume hooks to the driver.
Move enabling/disabling clock code into helper functions.

Reported-by: Nishant Menon n...@ti.com
Signed-off-by: Roger Quadros rog...@ti.com
---
 drivers/phy/phy-ti-pipe3.c | 99 +++---
 1 file changed, 77 insertions(+), 22 deletions(-)

diff --git a/drivers/phy/phy-ti-pipe3.c b/drivers/phy/phy-ti-pipe3.c
index 1387b4d..e60ff14 100644
--- a/drivers/phy/phy-ti-pipe3.c
+++ b/drivers/phy/phy-ti-pipe3.c
@@ -28,6 +28,7 @@
 #include linux/delay.h
 #include linux/phy/omap_control_phy.h
 #include linux/of_platform.h
+#include linux/spinlock.h
 
 #definePLL_STATUS  0x0004
 #definePLL_GO  0x0008
@@ -83,6 +84,8 @@ struct ti_pipe3 {
struct clk  *div_clk;
struct pipe3_dpll_map   *dpll_map;
u8  id;
+   bool enabled;
+   spinlock_t lock;/* serialize clock enable/disable */
 };
 
 static struct pipe3_dpll_map dpll_map_usb[] = {
@@ -303,6 +306,7 @@ static int ti_pipe3_probe(struct platform_device *pdev)
return -ENOMEM;
 
phy-dev= pdev-dev;
+   spin_lock_init(phy-lock);
 
if (!of_device_is_compatible(node, ti,phy-pipe3-pcie)) {
match = of_match_device(of_match_ptr(ti_pipe3_id_table),
@@ -425,24 +429,14 @@ static int ti_pipe3_remove(struct platform_device *pdev)
 
 #ifdef CONFIG_PM
 
-static int ti_pipe3_runtime_suspend(struct device *dev)
+static int ti_pipe3_enable_clocks(struct ti_pipe3 *phy)
 {
-   struct ti_pipe3 *phy = dev_get_drvdata(dev);
-
-   if (!IS_ERR(phy-wkupclk))
-   clk_disable_unprepare(phy-wkupclk);
-   if (!IS_ERR(phy-refclk))
-   clk_disable_unprepare(phy-refclk);
-   if (!IS_ERR(phy-div_clk))
-   clk_disable_unprepare(phy-div_clk);
-
-   return 0;
-}
+   int ret = 0;
+   unsigned long flags;
 
-static int ti_pipe3_runtime_resume(struct device *dev)
-{
-   u32 ret = 0;
-   struct ti_pipe3 *phy = dev_get_drvdata(dev);
+   spin_lock_irqsave(phy-lock, flags);
+   if (phy-enabled)
+   goto err1;
 
if (!IS_ERR(phy-refclk)) {
ret = clk_prepare_enable(phy-refclk);
@@ -467,6 +461,9 @@ static int ti_pipe3_runtime_resume(struct device *dev)
goto err3;
}
}
+
+   phy-enabled = true;
+   spin_unlock_irqrestore(phy-lock, flags);
return 0;
 
 err3:
@@ -478,19 +475,77 @@ err2:
clk_disable_unprepare(phy-refclk);
 
 err1:
+   spin_unlock_irqrestore(phy-lock, flags);
+   return ret;
+}
+
+static void ti_pipe3_disable_clocks(struct ti_pipe3 *phy)
+{
+   unsigned long flags;
+
+   spin_lock_irqsave(phy-lock, flags);
+   if (!phy-enabled) {
+   spin_unlock_irqrestore(phy-lock, flags);
+   return;
+   }
+
+   if (!IS_ERR(phy-wkupclk))
+   clk_disable_unprepare(phy-wkupclk);
+   if (!IS_ERR(phy-refclk))
+   clk_disable_unprepare(phy-refclk);
+   if (!IS_ERR(phy-div_clk))
+   clk_disable_unprepare(phy-div_clk);
+   phy-enabled = false;
+   spin_unlock_irqrestore(phy-lock, flags);
+}
+
+static int ti_pipe3_runtime_suspend(struct device *dev)
+{
+   struct ti_pipe3 *phy = dev_get_drvdata(dev);
+
+   ti_pipe3_disable_clocks(phy);
+   return 0;
+}
+
+static int ti_pipe3_runtime_resume(struct device *dev)
+{
+   struct ti_pipe3 *phy = dev_get_drvdata(dev);
+   int ret = 0;
+
+   ret = ti_pipe3_enable_clocks(phy);
return ret;
 }
 
+static int ti_pipe3_suspend(struct device *dev)
+{
+   struct ti_pipe3 *phy = dev_get_drvdata(dev);
+
+   ti_pipe3_disable_clocks(phy);
+   return 0;
+}
+
+static int ti_pipe3_resume(struct device *dev)
+{
+   struct ti_pipe3 *phy = dev_get_drvdata(dev);
+   int ret;
+
+   ret = ti_pipe3_enable_clocks(phy);
+   if (ret)
+   return ret;
+
+   pm_runtime_disable(dev);
+   pm_runtime_set_active(dev);
+   pm_runtime_enable(dev);
+   return 0;
+}
+#endif
+
 static const struct dev_pm_ops ti_pipe3_pm_ops = {
SET_RUNTIME_PM_OPS(ti_pipe3_runtime_suspend,
   ti_pipe3_runtime_resume, NULL)
+   SET_SYSTEM_SLEEP_PM_OPS(ti_pipe3_suspend, ti_pipe3_resume)
 };
 
-#define DEV_PM_OPS (ti_pipe3_pm_ops)
-#else
-#define DEV_PM_OPS NULL
-#endif
-
 #ifdef CONFIG_OF
 static const struct 

[PATCH v3 4/4] ARM: dts: OMAP5: Fix SATA PHY node

2015-01-13 Thread Roger Quadros
The sata_ref_clk is a reference clock to the SATA phy.
This fixes SATA malfunction across suspend/resume or when
SATA driver is used as a module.

Signed-off-by: Roger Quadros rog...@ti.com
---
 arch/arm/boot/dts/omap5.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index b321fdf..bb498e7 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -929,8 +929,8 @@
  0x4A096800 0x40; /* pll_ctrl */
reg-names = phy_rx, phy_tx, pll_ctrl;
ctrl-module = omap_control_sata;
-   clocks = sys_clkin;
-   clock-names = sysclk;
+   clocks = sys_clkin, sata_ref_clk;
+   clock-names = sysclk, refclk;
#phy-cells = 0;
};
};
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 3/4] ARM: dts: DRA7: Fix SATA PHY node

2015-01-13 Thread Roger Quadros
The sata_ref_clk is a reference clock to the SATA phy.
This fixes SATA malfunction across suspend/resume or when
SATA driver is used as a module.

Signed-off-by: Roger Quadros rog...@ti.com
---
 arch/arm/boot/dts/dra7.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 22771bc..8d2a635 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -1090,8 +1090,8 @@
  0x4A096800 0x40; /* pll_ctrl */
reg-names = phy_rx, phy_tx, pll_ctrl;
ctrl-module = omap_control_sata;
-   clocks = sys_clkin1;
-   clock-names = sysclk;
+   clocks = sys_clkin1, sata_ref_clk;
+   clock-names = sysclk, refclk;
#phy-cells = 0;
};
 
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 2/4] phy: ti-pipe3: Fix SATA across suspend/resume

2015-01-13 Thread Roger Quadros
Failed test case: Boot without SATA drive connected. Suspend/resume
the board and then connect SATA drive. It fails to enumerate.

Due to Errata i783 SATA Lockup After SATA DPLL Unlock/Relock
we can't allow SATA DPLL to be in the unlocked state.
The SATA refclk (sata_ref_clk) is the source of the SATA_DPLL.
This clock is being controlled only by the AHCI SATA driver and is
shut off during system suspend (if the SATA drive was not already attached)
causing the SATA DPLL to be unlocked and so causing errata i783.

To prevent sata_ref_clk from being disabled, we add the control of
this clock to the SATA PHY driver and prevent it from being disabled.

This also fixes the issue of SATA not working on OMAP5/DRA7 when
AHCI platform driver is built as a module.

NOTE: Device tree changes also required for OMAP5  DRA7.

Signed-off-by: Roger Quadros rog...@ti.com
---
 drivers/phy/phy-ti-pipe3.c | 57 +-
 1 file changed, 41 insertions(+), 16 deletions(-)

diff --git a/drivers/phy/phy-ti-pipe3.c b/drivers/phy/phy-ti-pipe3.c
index e60ff14..456dec2 100644
--- a/drivers/phy/phy-ti-pipe3.c
+++ b/drivers/phy/phy-ti-pipe3.c
@@ -85,6 +85,7 @@ struct ti_pipe3 {
struct pipe3_dpll_map   *dpll_map;
u8  id;
bool enabled;
+   bool refclk_enabled;/* this flag is needed specifically for SATA */
spinlock_t lock;/* serialize clock enable/disable */
 };
 
@@ -333,21 +334,24 @@ static int ti_pipe3_probe(struct platform_device *pdev)
}
}
 
+   phy-refclk = devm_clk_get(phy-dev, refclk);
+   if (IS_ERR(phy-refclk)) {
+   dev_err(pdev-dev, unable to get refclk\n);
+   /* older DTBs have missing refclk in SATA PHY
+* so don't bail out in case of SATA PHY.
+*/
+   if (!of_device_is_compatible(node, ti,phy-pipe3-sata))
+   return PTR_ERR(phy-refclk);
+   }
+
if (!of_device_is_compatible(node, ti,phy-pipe3-sata)) {
phy-wkupclk = devm_clk_get(phy-dev, wkupclk);
if (IS_ERR(phy-wkupclk)) {
dev_err(pdev-dev, unable to get wkupclk\n);
return PTR_ERR(phy-wkupclk);
}
-
-   phy-refclk = devm_clk_get(phy-dev, refclk);
-   if (IS_ERR(phy-refclk)) {
-   dev_err(pdev-dev, unable to get refclk\n);
-   return PTR_ERR(phy-refclk);
-   }
} else {
phy-wkupclk = ERR_PTR(-ENODEV);
-   phy-refclk = ERR_PTR(-ENODEV);
}
 
if (of_device_is_compatible(node, ti,phy-pipe3-pcie)) {
@@ -428,6 +432,29 @@ static int ti_pipe3_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM
+static int ti_pipe3_enable_refclk(struct ti_pipe3 *phy)
+{
+   if (!IS_ERR(phy-refclk)  !phy-refclk_enabled) {
+   int ret;
+
+   ret = clk_prepare_enable(phy-refclk);
+   if (ret) {
+   dev_err(phy-dev, Failed to enable refclk %d\n, ret);
+   return ret;
+   }
+   phy-refclk_enabled = true;
+   }
+
+   return 0;
+}
+
+static void ti_pipe3_disable_refclk(struct ti_pipe3 *phy)
+{
+   if (!IS_ERR(phy-refclk))
+   clk_disable_unprepare(phy-refclk);
+
+   phy-refclk_enabled = false;
+}
 
 static int ti_pipe3_enable_clocks(struct ti_pipe3 *phy)
 {
@@ -438,13 +465,9 @@ static int ti_pipe3_enable_clocks(struct ti_pipe3 *phy)
if (phy-enabled)
goto err1;
 
-   if (!IS_ERR(phy-refclk)) {
-   ret = clk_prepare_enable(phy-refclk);
-   if (ret) {
-   dev_err(phy-dev, Failed to enable refclk %d\n, ret);
-   goto err1;
-   }
-   }
+   ret = ti_pipe3_enable_refclk(phy);
+   if (ret)
+   goto err1;
 
if (!IS_ERR(phy-wkupclk)) {
ret = clk_prepare_enable(phy-wkupclk);
@@ -474,6 +497,7 @@ err2:
if (!IS_ERR(phy-refclk))
clk_disable_unprepare(phy-refclk);
 
+   ti_pipe3_disable_refclk(phy);
 err1:
spin_unlock_irqrestore(phy-lock, flags);
return ret;
@@ -491,8 +515,9 @@ static void ti_pipe3_disable_clocks(struct ti_pipe3 *phy)
 
if (!IS_ERR(phy-wkupclk))
clk_disable_unprepare(phy-wkupclk);
-   if (!IS_ERR(phy-refclk))
-   clk_disable_unprepare(phy-refclk);
+   /* Don't disable refclk for SATA PHY due to Errata i783 */
+   if (!of_device_is_compatible(phy-dev-of_node, ti,phy-pipe3-sata))
+   ti_pipe3_disable_refclk(phy);
if (!IS_ERR(phy-div_clk))
clk_disable_unprepare(phy-div_clk);
phy-enabled = false;
-- 
2.1.0

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More 

Re: [PATCH v3 0/4] phy: ti-pipe3: fixes for 3.19-rc

2015-01-13 Thread Tony Lindgren
* Roger Quadros rog...@ti.com [150113 04:26]:
 Hi,
 
 During system suspend L3INIT_960M_GFCLK and L3INIT_480M_GFCLK clocks remain
 active on the DRA7 platform. This is because the pipe3 driver doesn't shut
 them off as part of .suspend(). Patch 1 addresses this issue.
 
 SATA on both OMAP5 and DRA7 breaks when SATA drive is plugged in after a
 system suspend/resume or if AHCI_PLATFORM driver is used as module.
 Patches 2,3,4 fix it.
 
 Hope to get these patches in through the 3.19-rc cycle.
 
 Tony,
 
 Do you wish to take the DTS patches or let them go in through PHY tree?

Those look ok to me to merge along with the fixes, will ack those two.

Regards,

Tony

 Changelog
 - v3 : Commit message updated. dts changes moved to separate patch.
 - v2 : Don't break SATA with old DTB.
 
 Roger Quadros (4):
   phy: ti-pipe3: Disable clocks on system suspend
   phy: ti-pipe3: Fix SATA across suspend/resume
   ARM: dts: DRA7: Fix SATA PHY node
   ARM: dts: OMAP5: Fix SATA PHY node
 
  arch/arm/boot/dts/dra7.dtsi  |   4 +-
  arch/arm/boot/dts/omap5.dtsi |   4 +-
  drivers/phy/phy-ti-pipe3.c   | 142 
 +--
  3 files changed, 115 insertions(+), 35 deletions(-)
 
 -- 
 2.1.0
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 3/4] ARM: dts: DRA7: Fix SATA PHY node

2015-01-13 Thread Tony Lindgren
* Roger Quadros rog...@ti.com [150113 04:26]:
 The sata_ref_clk is a reference clock to the SATA phy.
 This fixes SATA malfunction across suspend/resume or when
 SATA driver is used as a module.
 
 Signed-off-by: Roger Quadros rog...@ti.com

Acked-by: Tony Lindgren t...@atomide.com

 ---
  arch/arm/boot/dts/dra7.dtsi | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
 index 22771bc..8d2a635 100644
 --- a/arch/arm/boot/dts/dra7.dtsi
 +++ b/arch/arm/boot/dts/dra7.dtsi
 @@ -1090,8 +1090,8 @@
 0x4A096800 0x40; /* pll_ctrl */
   reg-names = phy_rx, phy_tx, pll_ctrl;
   ctrl-module = omap_control_sata;
 - clocks = sys_clkin1;
 - clock-names = sysclk;
 + clocks = sys_clkin1, sata_ref_clk;
 + clock-names = sysclk, refclk;
   #phy-cells = 0;
   };
  
 -- 
 2.1.0
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 4/4] ARM: dts: OMAP5: Fix SATA PHY node

2015-01-13 Thread Tony Lindgren
* Roger Quadros rog...@ti.com [150113 04:26]:
 The sata_ref_clk is a reference clock to the SATA phy.
 This fixes SATA malfunction across suspend/resume or when
 SATA driver is used as a module.
 
 Signed-off-by: Roger Quadros rog...@ti.com

Acked-by: Tony Lindgren t...@atomide.com

 ---
  arch/arm/boot/dts/omap5.dtsi | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
 index b321fdf..bb498e7 100644
 --- a/arch/arm/boot/dts/omap5.dtsi
 +++ b/arch/arm/boot/dts/omap5.dtsi
 @@ -929,8 +929,8 @@
 0x4A096800 0x40; /* pll_ctrl */
   reg-names = phy_rx, phy_tx, pll_ctrl;
   ctrl-module = omap_control_sata;
 - clocks = sys_clkin;
 - clock-names = sysclk;
 + clocks = sys_clkin, sata_ref_clk;
 + clock-names = sysclk, refclk;
   #phy-cells = 0;
   };
   };
 -- 
 2.1.0
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] ARM: dts: cm-t3x: add NAND support

2015-01-13 Thread Tony Lindgren
* Roger Quadros rog...@ti.com [150108 02:33]:
 On 08/01/15 02:16, Tony Lindgren wrote:
  * Dmitry Lifshitz lifsh...@compulab.co.il [141229 23:42]:
  On 12/29/2014 03:06 PM, Roger Quadros wrote:
  On 28/12/14 16:30, Dmitry Lifshitz wrote:
  --- a/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
  +++ b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
  @@ -50,7 +50,8 @@
   #include omap-gpmc-smsc911x.dtsi
 
   gpmc {
  -ranges = 5 0 0x2c00 0x0100;
  +ranges = 5 0 0x2c00 0x0100, /* CM-T3x30 SMSC9x Eth */
  + 0 0 0x 0x0100; /* CM-T3x NAND */
 
  Isn't this ranges property redundant as it will anyways be overridden by 
  the board specific dts?
 
 
  The ranges are specified here (and other files below) by design.
 
  We built a tree like structure to organize DT files -
  d234e4239 ARM: dts: sbc-t3x: refactor DT support
 
  It allows to inherit/override properties common for different boards.
 
  Our customers do not have to deal with a correct GPMC ranges settings, once
  they base on omap3-cm-t3x.dts core module DT file (in case they do not
  connect additional device to the bus).
 
  This is the point of Igor's comment to the previous patch version.
  
  Roger, do you still have pending issues with this patch?
 
 Sorry missed this one. Thanks for the explanations Dmitry.
 
 Acked-by: Roger Quadros rog...@ti.com

Applying into omap-for-v3.20/dt thanks.

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 3/3] arm: dts: omap3-gta04: Add handling for tv output

2015-01-13 Thread Tony Lindgren
* Tomi Valkeinen tomi.valkei...@ti.com [150113 02:14]:
 On 03/12/14 23:33, Marek Belisko wrote:
  Add handling for gta04 tv out chain:
  venc - opa362 - svideo
  
  Use invert-polarity in venc node because opa362
  is doing polarity inversion also.
  
  Signed-off-by: Marek Belisko ma...@goldelico.com
  ---
   arch/arm/boot/dts/omap3-gta04.dtsi | 49 
  ++
   1 file changed, 49 insertions(+)
 
 Looks fine to me.
 
 Tony, do you want to pick this up? I can take the first two patches via
 fbdev.

OK will pick the dtsi change.

Thanks,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/4] usb: dwc3: gadget: Stop TRB preparation after limit is reached

2015-01-13 Thread Felipe Balbi
Hi,

On Tue, Jan 13, 2015 at 10:18:20AM +0530, Amit Virdi wrote:
 On 1/13/2015 12:04 AM, Felipe Balbi wrote:
 Hi,
 
 On Tue, Jan 06, 2015 at 11:44:23AM +0530, Amit Virdi wrote:
 I can certainly provide the dwc3 specific kernel bootup logs, full
 regdump and any loglevel you want me to, if that helps
 
 Yeah, if you can provide those, then that'll help me verifying. Full
 logs from boot to failure point with VERBOSE_DEBUG enabled (considering
 you're not running on anything recent).
 
 
 Okay. I'll provide full verbose logs, along with the register dump,
 when I'm back to the office next week, for the working and non-working
 case, but how - as attachment or as inline?
 
 Either way will do but I have a feeling mailing list attachment size
 will bite you, so maybe it's best to make a tarball of both logs and
 send that as attachment. Compressed text will be very small.
 
 
 Attached are the dwc3 verbose logs and register dump without and with the
 fixes in this patchset.
 
 Sorry for the long delay, it has been a bit hectic.
 
 
 It's okay!
 
 I can see from your logs that we end up with a Transfer Not Ready
 (Transfer Active) event and endpoint has BUSY flag set. I also see that
 you're queueing 31 requests and all of them will use 2 TRBs, so we
 clearly go over our TRB table.
 
 This fix is, indeed, necessary but we need to improve commit log a bit
 so it's extremely clear what the error is. Later, we can improve how we
 handle requests in this driver, but that is outside of the scope of your
 patchset.
 
 Please improve commit log and resend your series so it can be applied.
 
 
 Alright! I'll improve the commit messages and, also, cc stable list while
 resending the patches. As I see, you have already picked patches [3/4] and
 [4/4]. So, I'll resend only [1/4] and [2/4]
 
 cheers
 
 
 Thank you for your patience and kind understanding.

Alright, I just applied your patches to testing/fixes. I'll start
testing today and should be able to send a pull request to Greg by the
end of the week, hopefully.

cheers

-- 
balbi


signature.asc
Description: Digital signature


[PATCH] OMAPDSS: hdmi5: remove unneeded check

2015-01-13 Thread Sudip Mukherjee
prior to this check we are checking for word_length_16b and if word_length_16b
is false then we are returning with -EINVAL.
So at this point word_length_16b can only be true.

Signed-off-by: Sudip Mukherjee su...@vectorindia.org
---
 drivers/video/fbdev/omap2/dss/hdmi5_core.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi5_core.c 
b/drivers/video/fbdev/omap2/dss/hdmi5_core.c
index a3cfe3d..6bf4b75 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5_core.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5_core.c
@@ -858,10 +858,7 @@ int hdmi5_audio_config(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp,
core_cfg.layout = HDMI_AUDIO_LAYOUT_8CH;
 
/* DMA settings */
-   if (word_length_16b)
-   audio_dma.transfer_size = 0x10;
-   else
-   audio_dma.transfer_size = 0x20;
+   audio_dma.transfer_size = 0x10;
audio_dma.block_size = 0xC0;
audio_dma.mode = HDMI_AUDIO_TRANSF_DMA;
audio_dma.fifo_threshold = 0x20; /* in number of samples */
-- 
1.8.1.2

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/6] net: davinci_emac: Fix hangs with interrupts

2015-01-13 Thread Felipe Balbi
On Tue, Jan 13, 2015 at 11:29:23AM -0800, Tony Lindgren wrote:
 On davinci_emac, we have pulse interrupts. This means that we need to
 clear the EOI bits when disabling interrupts as otherwise the interrupts
 keep happening. And we also need to not clear the EOI bits again when
 enabling the interrupts as otherwise we will get tons of:
 
 unexpected IRQ trap at vector 00
 
 These errors almost certainly mean that the omap-intc.c is signaling
 a spurious interrupt with the reserved irq 127 as we've seen earlier
 on omap3.
 
 Let's fix the issue by clearing the EOI bits when disabling the
 interrupts. Let's also keep the comment for Rx Threshold and Misc
 interrupts are not enabled for both enable and disable so people
 are aware of this when potentially adding more support.
 
 Note that eventually we should handle the RX and TX interrupts
 separately like cpsw is now doing. However, so far I have not seen
 any issues with this based on my testing, so it seems to behave a
 little different compared to the cpsw that had a similar issue.
 
 Cc: Brian Hutchinson b.hutch...@gmail.com
 Cc: Felipe Balbi ba...@ti.com

pretty much the same thing that happens with CPSW, I think that a future
patch might want to change things so that we only write EOI to the IRQ
that actually fires, though.

Reviewed-by: Felipe Balbi ba...@ti.com

 Signed-off-by: Tony Lindgren t...@atomide.com
 ---
  drivers/net/ethernet/ti/davinci_emac.c | 19 ++-
  1 file changed, 10 insertions(+), 9 deletions(-)
 
 diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
 b/drivers/net/ethernet/ti/davinci_emac.c
 index ea71251..383ed52 100644
 --- a/drivers/net/ethernet/ti/davinci_emac.c
 +++ b/drivers/net/ethernet/ti/davinci_emac.c
 @@ -922,6 +922,16 @@ static void emac_int_disable(struct emac_priv *priv)
   if (priv-int_disable)
   priv-int_disable();
  
 + /* NOTE: Rx Threshold and Misc interrupts are not enabled */
 +
 + /* ack rxen only then a new pulse will be generated */
 + emac_write(EMAC_DM646X_MACEOIVECTOR,
 + EMAC_DM646X_MAC_EOI_C0_RXEN);
 +
 + /* ack txen- only then a new pulse will be generated */
 + emac_write(EMAC_DM646X_MACEOIVECTOR,
 + EMAC_DM646X_MAC_EOI_C0_TXEN);
 +
   local_irq_restore(flags);
  
   } else {
 @@ -951,15 +961,6 @@ static void emac_int_enable(struct emac_priv *priv)
* register */
  
   /* NOTE: Rx Threshold and Misc interrupts are not enabled */
 -
 - /* ack rxen only then a new pulse will be generated */
 - emac_write(EMAC_DM646X_MACEOIVECTOR,
 - EMAC_DM646X_MAC_EOI_C0_RXEN);
 -
 - /* ack txen- only then a new pulse will be generated */
 - emac_write(EMAC_DM646X_MACEOIVECTOR,
 - EMAC_DM646X_MAC_EOI_C0_TXEN);
 -
   } else {
   /* Set DM644x control registers for interrupt control */
   emac_ctrl_write(EMAC_CTRL_EWCTL, 0x1);
 -- 
 2.1.4
 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 3/6] net: davinci_emac: Free clock after checking the frequency

2015-01-13 Thread Tom Lendacky

On 01/13/2015 01:29 PM, Tony Lindgren wrote:

We only use clk_get() to get the frequency, the rest is done by
the runtime PM calls. Let's free the clock too.

Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Felipe Balbi ba...@ti.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
  drivers/net/ethernet/ti/davinci_emac.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
b/drivers/net/ethernet/ti/davinci_emac.c
index deb43b3..e9efc74 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1881,6 +1881,7 @@ static int davinci_emac_probe(struct platform_device 
*pdev)
return -EBUSY;
}
emac_bus_frequency = clk_get_rate(emac_clk);
+   clk_put(emac_clk);


The devm_clk_get call is used to get the clock so either a devm_clk_put
needs to be used here or just let the devm_ call do its thing and
automatically do the put when the module is unloaded.

Thanks,
Tom



/* TODO: Probe PHY here if possible */



--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] net: davinci_emac: Fix runtime pm calls for davinci_emac

2015-01-13 Thread Felipe Balbi
On Tue, Jan 13, 2015 at 11:29:24AM -0800, Tony Lindgren wrote:
 Commit 3ba97381343b (net: ethernet: davinci_emac: add pm_runtime support)
 added support for runtime PM, but it causes issues on omap3 related devices
 that actually gate the clocks:
 
 Unhandled fault: external abort on non-linefetch (0x1008)
 ...
 [c04160f0] (emac_dev_getnetstats) from [c04d6a3c] 
 (dev_get_stats+0x78/0xc8)
 [c04d6a3c] (dev_get_stats) from [c04e9ccc] (rtnl_fill_ifinfo+0x3b8/0x938)
 [c04e9ccc] (rtnl_fill_ifinfo) from [c04eade4] (rtmsg_ifinfo+0x68/0xd8)
 [c04eade4] (rtmsg_ifinfo) from [c04dd35c] (register_netdevice+0x3a0/0x4ec)
 [c04dd35c] (register_netdevice) from [c04dd4bc] 
 (register_netdev+0x14/0x24)
 [c04dd4bc] (register_netdev) from [c041755c] 
 (davinci_emac_probe+0x408/0x5c8)
 [c041755c] (davinci_emac_probe) from [c0396d78] 
 (platform_drv_probe+0x48/0xa4)
 
 Let's fix it by moving the pm_runtime_get() call earlier, and also
 add it to the emac_dev_getnetstats(). Also note that we want to use
 pm_rutime_get_sync() as we don't want to have deferred_resume happen.
 
 Cc: Brian Hutchinson b.hutch...@gmail.com
 Cc: Felipe Balbi ba...@ti.com
 Cc: Mark A. Greer mgr...@animalcreek.com
 Signed-off-by: Tony Lindgren t...@atomide.com
 ---
  drivers/net/ethernet/ti/davinci_emac.c | 14 ++
  1 file changed, 10 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
 b/drivers/net/ethernet/ti/davinci_emac.c
 index 383ed52..deb43b3 100644
 --- a/drivers/net/ethernet/ti/davinci_emac.c
 +++ b/drivers/net/ethernet/ti/davinci_emac.c
 @@ -1538,7 +1538,7 @@ static int emac_dev_open(struct net_device *ndev)
   int i = 0;
   struct emac_priv *priv = netdev_priv(ndev);
  
 - pm_runtime_get(priv-pdev-dev);
 + pm_runtime_get_sync(priv-pdev-dev);

gotta check return value on all pm_runtime_get_sync() calls. IIRC,
there's a coccinelle script for checking and patching this.

-- 
balbi


signature.asc
Description: Digital signature


[PATCH 0/2] Add support for dm81xx to omap intc, remove unused legacy support

2015-01-13 Thread Tony Lindgren
Hi,

Here's a patch to get the ti81xx interrupt support working properly,
and to remove some unused legacy code.

Regards,

Tony

clone of xxx-81xx-mainline

Tony Lindgren (2):
  irqchip: omap-intc: Fix support for dm814 and dm816
  irqchip: omap-intc: Remove unused legacy interface for omap2

 .../interrupt-controller/ti,omap-intc-irq.txt  | 28 ++
 drivers/irqchip/irq-omap-intc.c| 22 -
 include/linux/irqchip/irq-omap-intc.h  |  2 --
 3 files changed, 33 insertions(+), 19 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/interrupt-controller/ti,omap-intc-irq.txt

-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] irqchip: omap-intc: Fix support for dm814 and dm816

2015-01-13 Thread Tony Lindgren
On dm81xx we have 128 interrupts like am33xx has. Let's add
compatible flags for dm814x and dm816x, and document the
existing binding.

As the dm81xx are booting in device tree only mode, we can now
also remove ti81xx_init_irq() legacy function.

Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Felipe Balbi ba...@ti.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 .../interrupt-controller/ti,omap-intc-irq.txt  | 28 ++
 drivers/irqchip/irq-omap-intc.c| 14 ---
 include/linux/irqchip/irq-omap-intc.h  |  1 -
 3 files changed, 33 insertions(+), 10 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/interrupt-controller/ti,omap-intc-irq.txt

diff --git 
a/Documentation/devicetree/bindings/interrupt-controller/ti,omap-intc-irq.txt 
b/Documentation/devicetree/bindings/interrupt-controller/ti,omap-intc-irq.txt
new file mode 100644
index 000..38ce5d03
--- /dev/null
+++ 
b/Documentation/devicetree/bindings/interrupt-controller/ti,omap-intc-irq.txt
@@ -0,0 +1,28 @@
+Omap2/3 intc controller
+
+On TI omap2 and 3 the intc interrupt controller can provide
+96 or 128 IRQ signals to the ARM host depending on the SoC.
+
+Required Properties:
+- compatible: should be one of
+   ti,omap2-intc
+   ti,omap3-intc
+   ti,dm814-intc
+   ti,dm816-intc
+   ti,am33xx-intc
+
+- interrupt-controller : Identifies the node as an interrupt controller
+- #interrupt-cells : Specifies the number of cells needed to encode interrupt
+source, should be 1 for intc
+- interrupts: interrupt reference to primary interrupt controller
+
+Please refer to interrupts.txt in this directory for details of the common
+Interrupt Controllers bindings used by client devices.
+
+Example:
+   intc: interrupt-controller@4820 {
+   compatible = ti,omap3-intc;
+   interrupt-controller;
+   #interrupt-cells = 1;
+   reg = 0x4820 0x1000;
+   };
diff --git a/drivers/irqchip/irq-omap-intc.c b/drivers/irqchip/irq-omap-intc.c
index 28718d3..b75a44a 100644
--- a/drivers/irqchip/irq-omap-intc.c
+++ b/drivers/irqchip/irq-omap-intc.c
@@ -364,14 +364,6 @@ void __init omap3_init_irq(void)
set_handle_irq(omap_intc_handle_irq);
 }
 
-void __init ti81xx_init_irq(void)
-{
-   omap_nr_irqs = 96;
-   omap_nr_pending = 4;
-   omap_init_irq(OMAP34XX_IC_BASE, NULL);
-   set_handle_irq(omap_intc_handle_irq);
-}
-
 static int __init intc_of_init(struct device_node *node,
 struct device_node *parent)
 {
@@ -383,7 +375,9 @@ static int __init intc_of_init(struct device_node *node,
if (WARN_ON(!node))
return -ENODEV;
 
-   if (of_device_is_compatible(node, ti,am33xx-intc)) {
+   if (of_device_is_compatible(node, ti,dm814-intc) ||
+   of_device_is_compatible(node, ti,dm816-intc) ||
+   of_device_is_compatible(node, ti,am33xx-intc)) {
omap_nr_irqs = 128;
omap_nr_pending = 4;
}
@@ -399,4 +393,6 @@ static int __init intc_of_init(struct device_node *node,
 
 IRQCHIP_DECLARE(omap2_intc, ti,omap2-intc, intc_of_init);
 IRQCHIP_DECLARE(omap3_intc, ti,omap3-intc, intc_of_init);
+IRQCHIP_DECLARE(dm814x_intc, ti,dm814-intc, intc_of_init);
+IRQCHIP_DECLARE(dm816x_intc, ti,dm816-intc, intc_of_init);
 IRQCHIP_DECLARE(am33xx_intc, ti,am33xx-intc, intc_of_init);
diff --git a/include/linux/irqchip/irq-omap-intc.h 
b/include/linux/irqchip/irq-omap-intc.h
index e06b370..bda426a 100644
--- a/include/linux/irqchip/irq-omap-intc.h
+++ b/include/linux/irqchip/irq-omap-intc.h
@@ -20,7 +20,6 @@
 
 void omap2_init_irq(void);
 void omap3_init_irq(void);
-void ti81xx_init_irq(void);
 
 int omap_irq_pending(void);
 void omap_intc_save_context(void);
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] irqchip: omap-intc: Remove unused legacy interface for omap2

2015-01-13 Thread Tony Lindgren
Nowadays omap2 is booting in device tree only mode so there is no
need to keep the legacy interface around for omap2_init_irq().

Cc: Felipe Balbi ba...@ti.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 drivers/irqchip/irq-omap-intc.c   | 8 
 include/linux/irqchip/irq-omap-intc.h | 1 -
 2 files changed, 9 deletions(-)

diff --git a/drivers/irqchip/irq-omap-intc.c b/drivers/irqchip/irq-omap-intc.c
index b75a44a..ece8624 100644
--- a/drivers/irqchip/irq-omap-intc.c
+++ b/drivers/irqchip/irq-omap-intc.c
@@ -348,14 +348,6 @@ out:
omap_ack_irq(NULL);
 }
 
-void __init omap2_init_irq(void)
-{
-   omap_nr_irqs = 96;
-   omap_nr_pending = 3;
-   omap_init_irq(OMAP24XX_IC_BASE, NULL);
-   set_handle_irq(omap_intc_handle_irq);
-}
-
 void __init omap3_init_irq(void)
 {
omap_nr_irqs = 96;
diff --git a/include/linux/irqchip/irq-omap-intc.h 
b/include/linux/irqchip/irq-omap-intc.h
index bda426a..2e3d1af 100644
--- a/include/linux/irqchip/irq-omap-intc.h
+++ b/include/linux/irqchip/irq-omap-intc.h
@@ -18,7 +18,6 @@
 #ifndef __INCLUDE_LINUX_IRQCHIP_IRQ_OMAP_INTC_H
 #define __INCLUDE_LINUX_IRQCHIP_IRQ_OMAP_INTC_H
 
-void omap2_init_irq(void);
 void omap3_init_irq(void);
 
 int omap_irq_pending(void);
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH 2/3] core: platform: fix an invalid kfree during of_platform_depopulate

2015-01-13 Thread Rob Herring
On Wed, Jan 7, 2015 at 11:30 AM, Suman Anna s-a...@ti.com wrote:
 Drivers can use of_platform_populate() to create platform devices
 for children of the device main node, and a complementary API
 of_platform_depopulate() is provided to delete these child devices.
 Any platform_data supplied for the OF devices through auxdata lookup
 data is populated directly in the device's platform_data field, unlike
 those created using platform API. The of_platform_depopulate()
 leverages the platform code for cleanup, and this will result in a
 kernel oops due to an invalid kfree on this direct populated
 platform_data.

 Fix this by resetting the platform data for OF devices during
 platform device cleanup.

We should probably copy the platform_data like is done for non-OF
platform devices. I'm sure there was some reason for it. It looks
strange doing this in release.

However, I'm inclined to not fix this and force users to move off of
auxdata. That's intended to be a temporary migration path and there
are only 54 instances of it that have platform_data. What device do
you care about?

Rob


 Signed-off-by: Suman Anna s-a...@ti.com
 ---
  drivers/base/platform.c | 2 ++
  1 file changed, 2 insertions(+)

 diff --git a/drivers/base/platform.c b/drivers/base/platform.c
 index 9421fed40905..129e69c8c894 100644
 --- a/drivers/base/platform.c
 +++ b/drivers/base/platform.c
 @@ -200,6 +200,8 @@ static void platform_device_release(struct device *dev)
 struct platform_object *pa = container_of(dev, struct platform_object,
   pdev.dev);

 +   if (pa-pdev.dev.of_node)
 +   pa-pdev.dev.platform_data = NULL;
 of_device_node_put(pa-pdev.dev);
 kfree(pa-pdev.dev.platform_data);
 kfree(pa-pdev.mfd_cell);
 --
 2.2.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH 2/3] core: platform: fix an invalid kfree during of_platform_depopulate

2015-01-13 Thread Suman Anna
Hi Rob,

On 01/13/2015 04:27 PM, Rob Herring wrote:
 On Wed, Jan 7, 2015 at 11:30 AM, Suman Anna s-a...@ti.com wrote:
 Drivers can use of_platform_populate() to create platform devices
 for children of the device main node, and a complementary API
 of_platform_depopulate() is provided to delete these child devices.
 Any platform_data supplied for the OF devices through auxdata lookup
 data is populated directly in the device's platform_data field, unlike
 those created using platform API. The of_platform_depopulate()
 leverages the platform code for cleanup, and this will result in a
 kernel oops due to an invalid kfree on this direct populated
 platform_data.

 Fix this by resetting the platform data for OF devices during
 platform device cleanup.
 
 We should probably copy the platform_data like is done for non-OF
 platform devices. I'm sure there was some reason for it. 

Yeah, that was my first thought too, but went with adding a checking
here as I am not aware of the original reason for not copying it, and it
seemed like unnecessary copying of static data without any real gain.

 It looks strange doing this in release.
 
 However, I'm inclined to not fix this and force users to move off of
 auxdata. That's intended to be a temporary migration path and there
 are only 54 instances of it that have platform_data. What device do
 you care about?

I use this mainly for the remoteproc devices (mainly differentiating
multiple instances of the same compatible type on the same SoC), but
fair enough, I can rework my driver to use some lookup based match data
instead. So far, none of the drivers who use of_platform_populate() did
supply platform data, so this particular crash is not seen/common.
platform_data does get used in the OMAP pdata-quirks, though
of_platform_depopulate() won't be called on those, as this is called in
init_machine.

regards
Suman

 
 Rob
 

 Signed-off-by: Suman Anna s-a...@ti.com
 ---
  drivers/base/platform.c | 2 ++
  1 file changed, 2 insertions(+)

 diff --git a/drivers/base/platform.c b/drivers/base/platform.c
 index 9421fed40905..129e69c8c894 100644
 --- a/drivers/base/platform.c
 +++ b/drivers/base/platform.c
 @@ -200,6 +200,8 @@ static void platform_device_release(struct device *dev)
 struct platform_object *pa = container_of(dev, struct 
 platform_object,
   pdev.dev);

 +   if (pa-pdev.dev.of_node)
 +   pa-pdev.dev.platform_data = NULL;
 of_device_node_put(pa-pdev.dev);
 kfree(pa-pdev.dev.platform_data);
 kfree(pa-pdev.mfd_cell);
 --
 2.2.1


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] clk: ti: Add support for FAPLL on dm816x

2015-01-13 Thread Tony Lindgren
On dm816x the clocks are sourced from a FAPLL (Flying Adder PLL)
that does not seem to be used on the other omap variants.

There are four instances of the FAPLL on dm816x that each have three
to seven child synthesizers.

I've set up the FAPLL as a single fapll.c driver. Later on we could
potentially have the PLL code generic. To do that, we would have to
consider the following:

1. Setting the PLL to bypass mode also sets the child synthesizers
   into bypass mode. As the bypass rate can also be generated by
   the PLL in regular mode, there's no way for the child synthesizers
   to detect the bypass mode based on the parent clock rate.

2. The PLL registers control the power for each of the child
   syntheriser.

Note that the clocks are currently still missing the set_rate
implementation so things are still running based on the bootloader
values. That's OK for now as most of the outputs have dividers and
those can be set using the existing TI component clock code.

I have verified that the extclk rates are correct for a few clocks,
so adding the set_rate support should be fairly trivial later on.

This code is partially based on the TI81XX-LINUX-PSP-04.04.00.02
patches published at:

http://downloads.ti.com/dsps/dsps_public_sw/psp/LinuxPSP/TI81XX_04_04/04_04_00_02/index_FDS.html

Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Paul Walmsley p...@pwsan.com
Cc: Tero Kristo t-kri...@ti.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 .../devicetree/bindings/clock/ti/fapll.txt |  33 ++
 drivers/clk/ti/Makefile|   1 +
 drivers/clk/ti/fapll.c | 410 +
 3 files changed, 444 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/ti/fapll.txt
 create mode 100644 drivers/clk/ti/fapll.c

diff --git a/Documentation/devicetree/bindings/clock/ti/fapll.txt 
b/Documentation/devicetree/bindings/clock/ti/fapll.txt
new file mode 100644
index 000..c19b3f2
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/ti/fapll.txt
@@ -0,0 +1,33 @@
+Binding for Texas Instruments FAPLL clock.
+
+Binding status: Unstable - ABI compatibility may be broken in the future
+
+This binding uses the common clock binding[1]. It assumes a
+register-mapped FAPLL with usually two selectable input clocks
+(reference clock and bypass clock), and one or more child
+syntesizers.
+
+[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
+
+Required properties:
+- compatible : shall be ti,dm816-fapll-clock
+- #clock-cells : from common clock binding; shall be set to 0.
+- clocks : link phandles of parent clocks (clk-ref and clk-bypass)
+- reg : address and length of the register set for controlling the FAPLL.
+
+Examples:
+   main_fapll: main_fapll {
+   #clock-cells = 1;
+   compatible = ti,dm816-fapll-clock;
+   reg = 0x400 0x40;
+   clocks = sys_clkin_ck sys_clkin_ck;
+   clock-indices = 1, 2, 3, 4, 5,
+   6, 7;
+   clock-output-names = main_pll_clk1,
+main_pll_clk2,
+main_pll_clk3,
+main_pll_clk4,
+main_pll_clk5,
+main_pll_clk6,
+main_pll_clk7;
+   };
diff --git a/drivers/clk/ti/Makefile b/drivers/clk/ti/Makefile
index ed4d0aa..e55438c 100644
--- a/drivers/clk/ti/Makefile
+++ b/drivers/clk/ti/Makefile
@@ -3,6 +3,7 @@ obj-y   += clk.o autoidle.o 
clockdomain.o
 clk-common = dpll.o composite.o divider.o gate.o \
  fixed-factor.o mux.o apll.o
 obj-$(CONFIG_SOC_AM33XX)   += $(clk-common) clk-33xx.o
+obj-$(CONFIG_SOC_TI81XX)   += $(clk-common) fapll.o
 obj-$(CONFIG_ARCH_OMAP2)   += $(clk-common) interface.o clk-2xxx.o
 obj-$(CONFIG_ARCH_OMAP3)   += $(clk-common) interface.o clk-3xxx.o
 obj-$(CONFIG_ARCH_OMAP4)   += $(clk-common) clk-44xx.o
diff --git a/drivers/clk/ti/fapll.c b/drivers/clk/ti/fapll.c
new file mode 100644
index 000..6ef8963
--- /dev/null
+++ b/drivers/clk/ti/fapll.c
@@ -0,0 +1,410 @@
+/*
+ * 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 version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include linux/clk-provider.h
+#include linux/delay.h
+#include linux/slab.h
+#include linux/err.h
+#include linux/of.h
+#include linux/of_address.h
+#include linux/clk/ti.h
+#include asm/div64.h
+
+/* 

[PATCH 2/2] clk: ti: Initialize clocks for dm816x

2015-01-13 Thread Tony Lindgren
The clocks on ti81xx are not compatible with omap3. On dm816x
the clock source is a FAPLL (Flying Adder PLL), and on dm814x
there seems to be an APLL (All Digital PLL).

Let's fix up things for dm816x in preparation for adding the
FAPLL support. As we already have a dummy ti81xx_dt_clk_init()
in place, let's use that for now to avoid adding a dependency
to the omap patches.

Later on if somebody adds dm814x support we can split the
ti81xx_dt_clk_init() clock init function as needed.

Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Paul Walmsley p...@pwsan.com
Cc: Tero Kristo t-kri...@ti.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 drivers/clk/ti/Makefile   |  2 +-
 drivers/clk/ti/clk-3xxx.c |  8 +--
 drivers/clk/ti/clk-816x.c | 53 +++
 3 files changed, 55 insertions(+), 8 deletions(-)
 create mode 100644 drivers/clk/ti/clk-816x.c

diff --git a/drivers/clk/ti/Makefile b/drivers/clk/ti/Makefile
index e55438c..36acc7d 100644
--- a/drivers/clk/ti/Makefile
+++ b/drivers/clk/ti/Makefile
@@ -3,7 +3,7 @@ obj-y   += clk.o autoidle.o 
clockdomain.o
 clk-common = dpll.o composite.o divider.o gate.o \
  fixed-factor.o mux.o apll.o
 obj-$(CONFIG_SOC_AM33XX)   += $(clk-common) clk-33xx.o
-obj-$(CONFIG_SOC_TI81XX)   += $(clk-common) fapll.o
+obj-$(CONFIG_SOC_TI81XX)   += $(clk-common) fapll.o clk-816x.o
 obj-$(CONFIG_ARCH_OMAP2)   += $(clk-common) interface.o clk-2xxx.o
 obj-$(CONFIG_ARCH_OMAP3)   += $(clk-common) interface.o clk-3xxx.o
 obj-$(CONFIG_ARCH_OMAP4)   += $(clk-common) clk-44xx.o
diff --git a/drivers/clk/ti/clk-3xxx.c b/drivers/clk/ti/clk-3xxx.c
index 0d1750a..383a06e 100644
--- a/drivers/clk/ti/clk-3xxx.c
+++ b/drivers/clk/ti/clk-3xxx.c
@@ -327,7 +327,6 @@ enum {
OMAP3_SOC_OMAP3430_ES1,
OMAP3_SOC_OMAP3430_ES2_PLUS,
OMAP3_SOC_OMAP3630,
-   OMAP3_SOC_TI81XX,
 };
 
 static int __init omap3xxx_dt_clk_init(int soc_type)
@@ -370,7 +369,7 @@ static int __init omap3xxx_dt_clk_init(int soc_type)
(clk_get_rate(clk_get_sys(NULL, core_ck)) / 100),
(clk_get_rate(clk_get_sys(NULL, arm_fck)) / 100));
 
-   if (soc_type != OMAP3_SOC_TI81XX  soc_type != OMAP3_SOC_OMAP3430_ES1)
+   if (soc_type != OMAP3_SOC_OMAP3430_ES1)
omap3_clk_lock_dpll5();
 
return 0;
@@ -390,8 +389,3 @@ int __init am35xx_dt_clk_init(void)
 {
return omap3xxx_dt_clk_init(OMAP3_SOC_AM35XX);
 }
-
-int __init ti81xx_dt_clk_init(void)
-{
-   return omap3xxx_dt_clk_init(OMAP3_SOC_TI81XX);
-}
diff --git a/drivers/clk/ti/clk-816x.c b/drivers/clk/ti/clk-816x.c
new file mode 100644
index 000..9451e65
--- /dev/null
+++ b/drivers/clk/ti/clk-816x.c
@@ -0,0 +1,53 @@
+/*
+ * 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 version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include linux/kernel.h
+#include linux/list.h
+#include linux/clk-provider.h
+#include linux/clk/ti.h
+
+static struct ti_dt_clk dm816x_clks[] = {
+   DT_CLK(NULL, sys_clkin, sys_clkin_ck),
+   DT_CLK(NULL, timer_sys_ck, sys_clkin_ck),
+   DT_CLK(NULL, sys_32k_ck, sys_32k_ck),
+   DT_CLK(NULL, mpu_ck, mpu_ck),
+   DT_CLK(NULL, timer1_fck, timer1_fck),
+   DT_CLK(NULL, timer2_fck, timer2_fck),
+   DT_CLK(NULL, timer3_fck, timer3_fck),
+   DT_CLK(NULL, timer4_fck, timer4_fck),
+   DT_CLK(NULL, timer5_fck, timer5_fck),
+   DT_CLK(NULL, timer6_fck, timer6_fck),
+   DT_CLK(NULL, timer7_fck, timer7_fck),
+   DT_CLK(NULL, sysclk4_ck, sysclk4_ck),
+   DT_CLK(NULL, sysclk5_ck, sysclk5_ck),
+   DT_CLK(NULL, sysclk6_ck, sysclk6_ck),
+   DT_CLK(NULL, sysclk10_ck, sysclk10_ck),
+   DT_CLK(NULL, sysclk18_ck, sysclk18_ck),
+   DT_CLK(NULL, sysclk24_ck, sysclk24_ck),
+   DT_CLK(4a10.ethernet, sysclk24_ck, sysclk24_ck),
+   { .node_name = NULL },
+};
+
+static const char *enable_init_clks[] = {
+   ddr_pll_clk1,
+   ddr_pll_clk2,
+   ddr_pll_clk3,
+};
+
+int __init ti81xx_dt_clk_init(void)
+{
+   ti_dt_clocks_register(dm816x_clks);
+   omap2_clk_disable_autoidle_all();
+   omap2_clk_enable_init_clocks(enable_init_clks,
+ARRAY_SIZE(enable_init_clks));
+
+   return 0;
+}
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] Minimal FAPLL clock support for dm816x

2015-01-13 Thread Tony Lindgren
Hi all,

Here's a minimal support for the FAPLL (Flying Adder PLL) on dm816x
which is a omap variant.

Regards,

Tony


Tony Lindgren (2):
  clk: ti: Add support for FAPLL on dm816x
  clk: ti: Initialize clocks for dm816x

 .../devicetree/bindings/clock/ti/fapll.txt |  33 ++
 drivers/clk/ti/Makefile|   1 +
 drivers/clk/ti/clk-3xxx.c  |   8 +-
 drivers/clk/ti/clk-816x.c  |  53 +++
 drivers/clk/ti/fapll.c | 410 +
 5 files changed, 498 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/ti/fapll.txt
 create mode 100644 drivers/clk/ti/clk-816x.c
 create mode 100644 drivers/clk/ti/fapll.c

-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH 1/3] of/device: manage resources similar to platform_device_add

2015-01-13 Thread Suman Anna
On 01/13/2015 04:00 PM, Rob Herring wrote:
 On Tue, Jan 13, 2015 at 3:25 PM, Suman Anna s-a...@ti.com wrote:
 Hi Rob,

 On 01/13/2015 02:38 PM, Rob Herring wrote:
 On Wed, Jan 7, 2015 at 11:30 AM, Suman Anna s-a...@ti.com wrote:
 Drivers can use of_platform_populate() to create platform devices
 for children of the device main node, and a complementary API
 of_platform_depopulate() is provided to delete these child platform
 devices. The of_platform_depopulate() leverages the platform API
 for performing the cleanup of these devices.

 The platform device resources are managed differently between
 of_device_add and platform_device_add, and this asymmetry causes
 a kernel oops in platform_device_del during removal of the resources.
 Manage the platform device resources similar to platform_device_add
 to fix this kernel oops.

 This is a known issue and has been attempted to be fixed before (I
 believe there is a revert in mainline). The problem is there are known
 devicetrees which have overlapping resources and they will break with
 your change.

 Are you referring to 02bbde7849e6 (Revert of: use
 platform_device_add)?
 
 I believe that's the one.
 
 That one seems to be in registration path, and
 this crash is in the unregistration path. If so, to fix the crash,
 should we be skipping the release_resource() for now in
 platform_device_del for DT nodes, or replace platform_device_unregister
 with of_device_unregister in of_platform_device_destroy()?
 
 IIRC, the problem is inserting a resource twice on add from 2
 different nodes, not the removal path. Perhaps we could make a
 collision non-fatal for in the DT case.

We may be talking two different things here, I understand that this
patch would create an issue with inserting a resource twice in the
devicetrees with overlapping resources (just like the commit that was
reverted above), but the crash is on devices with resources whose
parent, child, sibling pointers have never been initialized (the
of_device_add path does not touch these at all), and get dereferenced in
platform_device_del()-release_resource(). See the following that has a
better explanation [1].

regards
Suman

[1]
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-July/274412.html


 Grant may have some ideas on
 what's needed here.
 
 This is a common crash and we cannot use of_platform_depopulate() today
 in drivers to complement of_platform_populate().
 
 Yes, I know.
 
 Also, the platform_data crash is independent of this, I could reproduce
 that one even with using of_device_unregister in a loop in driver remove.
 
 Missed this one. I'll reply to that patch.
 
 Rob
 

 regards
 Suman


 Rob


 Signed-off-by: Suman Anna s-a...@ti.com
 ---
  drivers/of/device.c | 38 +-
  1 file changed, 37 insertions(+), 1 deletion(-)

 diff --git a/drivers/of/device.c b/drivers/of/device.c
 index 46d6c75c1404..fa27c1c71f29 100644
 --- a/drivers/of/device.c
 +++ b/drivers/of/device.c
 @@ -50,6 +50,8 @@ EXPORT_SYMBOL(of_dev_put);

  int of_device_add(struct platform_device *ofdev)
  {
 +   int i, ret;
 +
 BUG_ON(ofdev-dev.of_node == NULL);

 /* name and id have to be set so that the platform bus doesn't get
 @@ -63,7 +65,41 @@ int of_device_add(struct platform_device *ofdev)
 if (!ofdev-dev.parent)
 set_dev_node(ofdev-dev, 
 of_node_to_nid(ofdev-dev.of_node));

 -   return device_add(ofdev-dev);
 +   for (i = 0; i  ofdev-num_resources; i++) {
 +   struct resource *p, *r = ofdev-resource[i];
 +
 +   if (!r-name)
 +   r-name = dev_name(ofdev-dev);
 +
 +   p = r-parent;
 +   if (!p) {
 +   if (resource_type(r) == IORESOURCE_MEM)
 +   p = iomem_resource;
 +   else if (resource_type(r) == IORESOURCE_IO)
 +   p = ioport_resource;
 +   }
 +
 +   if (p  insert_resource(p, r)) {
 +   dev_err(ofdev-dev, failed to claim resource 
 %d\n,
 +   i);
 +   ret = -EBUSY;
 +   goto failed;
 +   }
 +   }
 +
 +   ret = device_add(ofdev-dev);
 +   if (ret == 0)
 +   return ret;
 +
 +failed:
 +   while (--i = 0) {
 +   struct resource *r = ofdev-resource[i];
 +   unsigned long type = resource_type(r);
 +
 +   if (type == IORESOURCE_MEM || type == IORESOURCE_IO)
 +   release_resource(r);
 +   }
 +   return ret;
  }

  int of_device_register(struct platform_device *pdev)
 --
 2.2.1



--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/6] net: davinci_emac: Free clock after checking the frequency

2015-01-13 Thread Tony Lindgren
* Felipe Balbi ba...@ti.com [150113 11:54]:
 On Tue, Jan 13, 2015 at 01:48:24PM -0600, Tom Lendacky wrote:
  On 01/13/2015 01:29 PM, Tony Lindgren wrote:
  We only use clk_get() to get the frequency, the rest is done by
  the runtime PM calls. Let's free the clock too.
  
  Cc: Brian Hutchinson b.hutch...@gmail.com
  Cc: Felipe Balbi ba...@ti.com
  Signed-off-by: Tony Lindgren t...@atomide.com
  ---
drivers/net/ethernet/ti/davinci_emac.c | 1 +
1 file changed, 1 insertion(+)
  
  diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
  b/drivers/net/ethernet/ti/davinci_emac.c
  index deb43b3..e9efc74 100644
  --- a/drivers/net/ethernet/ti/davinci_emac.c
  +++ b/drivers/net/ethernet/ti/davinci_emac.c
  @@ -1881,6 +1881,7 @@ static int davinci_emac_probe(struct platform_device 
  *pdev)
 return -EBUSY;
 }
 emac_bus_frequency = clk_get_rate(emac_clk);
  +  clk_put(emac_clk);
  
  The devm_clk_get call is used to get the clock so either a devm_clk_put
  needs to be used here or just let the devm_ call do its thing and
  automatically do the put when the module is unloaded.
 
 instead, if you really don't need the clock for anything other than
 getting its rate, why don't you just remove devm_ prefix from clk_get()?

That would make the fix two lines instead of one :) I guess up to David
to figure out which he prefers, I don't really have a preference here.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/6] net: davinci_emac: Fix ioremap for devices with MDIO within the EMAC address space

2015-01-13 Thread Felipe Balbi
On Tue, Jan 13, 2015 at 11:59:58AM -0800, Tony Lindgren wrote:
 * Felipe Balbi ba...@ti.com [150113 11:57]:
  On Tue, Jan 13, 2015 at 11:29:27AM -0800, Tony Lindgren wrote:
   Some devices like dm816x have the MDIO registers within the first EMAC
   instance address space. Let's fix the issue by allowing to pass an
   optional second IO range for the EMAC control register area.
   
   Cc: Brian Hutchinson b.hutch...@gmail.com
   Cc: Felipe Balbi ba...@ti.com
   Signed-off-by: Tony Lindgren t...@atomide.com
   ---
drivers/net/ethernet/ti/davinci_emac.c | 15 ---
1 file changed, 12 insertions(+), 3 deletions(-)
   
   diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
   b/drivers/net/ethernet/ti/davinci_emac.c
   index 4c8d82c..0342273 100644
   --- a/drivers/net/ethernet/ti/davinci_emac.c
   +++ b/drivers/net/ethernet/ti/davinci_emac.c
   @@ -1877,7 +1877,7 @@ davinci_emac_of_get_pdata(struct platform_device 
   *pdev, struct emac_priv *priv)
static int davinci_emac_probe(struct platform_device *pdev)
{
 int rc = 0;
   - struct resource *res;
   + struct resource *res, *res_ctrl;
 struct net_device *ndev;
 struct emac_priv *priv;
 unsigned long hw_ram_addr;
   @@ -1936,11 +1936,20 @@ static int davinci_emac_probe(struct 
   platform_device *pdev)
 rc = PTR_ERR(priv-remap_addr);
 goto no_pdata;
 }
   +
   + res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
   + if (res_ctrl) {
  
  devm_ioremap_resource() will check for res_ctrl being a valid pointer,
  perhaps below would be slightly better ?
  
  
  res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1);
  priv-ctrl_base = devm_ioremap_resource(pdev-dev, res_ctrl);
  if (IS_ERR(priv-ctrl_base))
  priv-ctrl_base = priv-remap_addr + pdata-ctrl_mod_reg_offset;
  
 
 We have a pile of devices using just one ioremap area so the second
 ioremap area needs to be optional. That's why we only do it based on
 if (res_ctrl).

fair enough

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 0/4] Drop legacy support for omap3517

2015-01-13 Thread Tony Lindgren
* Arnd Bergmann a...@arndb.de [150113 12:27]:
 On Tuesday 13 January 2015 09:57:41 Tony Lindgren wrote:
  
  It seems we can now drop omap3517 legacy booting support to get
  a bit closer to making all of omap3 boot in device tree only mode.
  
  All these boards have at least minimal support for booting with
  device tree, and pretty much anything supported with the legacy
  board files can be configured also for device tree based booting
  if not done already.
 
 Ah, very nice.
 
 Just out of curiosity, what are the remaining showstoppers for
 the 3430 and 3530 based boards?

Not much really. We're now printing a warning to get a people to
upgrade their systems. So with some boards we need to wait a while.

Then here are the remaining items that I'm aware of:

- A regression at least on some n900 with appended DTB not booting
  properly any longer reported by Pali

- A regression where the legacy ATAGs don't seem to get properly
  translated by the uncompress code for atag_rev at least reported
  by Pali

- A few missing .dts files for devkit8000, omap3logic, omap3stalker,
  omap3pandora and omap3touchbook

Pali and Sebastian probably know best of any other remaining
issues to drop n900 legacy booting.

If people have the boards listed above, please pitch in to do the
.dts files or send the boards to me and I can do minimal .dts
files for them.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC PATCH 1/3] of/device: manage resources similar to platform_device_add

2015-01-13 Thread Suman Anna
Hi Rob,

On 01/13/2015 02:38 PM, Rob Herring wrote:
 On Wed, Jan 7, 2015 at 11:30 AM, Suman Anna s-a...@ti.com wrote:
 Drivers can use of_platform_populate() to create platform devices
 for children of the device main node, and a complementary API
 of_platform_depopulate() is provided to delete these child platform
 devices. The of_platform_depopulate() leverages the platform API
 for performing the cleanup of these devices.

 The platform device resources are managed differently between
 of_device_add and platform_device_add, and this asymmetry causes
 a kernel oops in platform_device_del during removal of the resources.
 Manage the platform device resources similar to platform_device_add
 to fix this kernel oops.
 
 This is a known issue and has been attempted to be fixed before (I
 believe there is a revert in mainline). The problem is there are known
 devicetrees which have overlapping resources and they will break with
 your change.

Are you referring to 02bbde7849e6 (Revert of: use
platform_device_add)? That one seems to be in registration path, and
this crash is in the unregistration path. If so, to fix the crash,
should we be skipping the release_resource() for now in
platform_device_del for DT nodes, or replace platform_device_unregister
with of_device_unregister in of_platform_device_destroy()?

This is a common crash and we cannot use of_platform_depopulate() today
in drivers to complement of_platform_populate().

Also, the platform_data crash is independent of this, I could reproduce
that one even with using of_device_unregister in a loop in driver remove.

regards
Suman

 
 Rob
 

 Signed-off-by: Suman Anna s-a...@ti.com
 ---
  drivers/of/device.c | 38 +-
  1 file changed, 37 insertions(+), 1 deletion(-)

 diff --git a/drivers/of/device.c b/drivers/of/device.c
 index 46d6c75c1404..fa27c1c71f29 100644
 --- a/drivers/of/device.c
 +++ b/drivers/of/device.c
 @@ -50,6 +50,8 @@ EXPORT_SYMBOL(of_dev_put);

  int of_device_add(struct platform_device *ofdev)
  {
 +   int i, ret;
 +
 BUG_ON(ofdev-dev.of_node == NULL);

 /* name and id have to be set so that the platform bus doesn't get
 @@ -63,7 +65,41 @@ int of_device_add(struct platform_device *ofdev)
 if (!ofdev-dev.parent)
 set_dev_node(ofdev-dev, 
 of_node_to_nid(ofdev-dev.of_node));

 -   return device_add(ofdev-dev);
 +   for (i = 0; i  ofdev-num_resources; i++) {
 +   struct resource *p, *r = ofdev-resource[i];
 +
 +   if (!r-name)
 +   r-name = dev_name(ofdev-dev);
 +
 +   p = r-parent;
 +   if (!p) {
 +   if (resource_type(r) == IORESOURCE_MEM)
 +   p = iomem_resource;
 +   else if (resource_type(r) == IORESOURCE_IO)
 +   p = ioport_resource;
 +   }
 +
 +   if (p  insert_resource(p, r)) {
 +   dev_err(ofdev-dev, failed to claim resource %d\n,
 +   i);
 +   ret = -EBUSY;
 +   goto failed;
 +   }
 +   }
 +
 +   ret = device_add(ofdev-dev);
 +   if (ret == 0)
 +   return ret;
 +
 +failed:
 +   while (--i = 0) {
 +   struct resource *r = ofdev-resource[i];
 +   unsigned long type = resource_type(r);
 +
 +   if (type == IORESOURCE_MEM || type == IORESOURCE_IO)
 +   release_resource(r);
 +   }
 +   return ret;
  }

  int of_device_register(struct platform_device *pdev)
 --
 2.2.1


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/4] Drop legacy support for omap3517

2015-01-13 Thread Arnd Bergmann
On Tuesday 13 January 2015 09:57:41 Tony Lindgren wrote:
 
 It seems we can now drop omap3517 legacy booting support to get
 a bit closer to making all of omap3 boot in device tree only mode.
 
 All these boards have at least minimal support for booting with
 device tree, and pretty much anything supported with the legacy
 board files can be configured also for device tree based booting
 if not done already.

Ah, very nice.

Just out of curiosity, what are the remaining showstoppers for
the 3430 and 3530 based boards?

Arnd
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] net: davinci_emac: Fix runtime pm calls for davinci_emac

2015-01-13 Thread Tony Lindgren
* Felipe Balbi ba...@ti.com [150113 11:55]:
 On Tue, Jan 13, 2015 at 11:29:24AM -0800, Tony Lindgren wrote:
  --- a/drivers/net/ethernet/ti/davinci_emac.c
  +++ b/drivers/net/ethernet/ti/davinci_emac.c
  @@ -1538,7 +1538,7 @@ static int emac_dev_open(struct net_device *ndev)
  int i = 0;
  struct emac_priv *priv = netdev_priv(ndev);
   
  -   pm_runtime_get(priv-pdev-dev);
  +   pm_runtime_get_sync(priv-pdev-dev);
 
 gotta check return value on all pm_runtime_get_sync() calls. IIRC,
 there's a coccinelle script for checking and patching this.

Sure, here's an updated patch with error checking added.

Regards,

Tony

8 -
From: Tony Lindgren t...@atomide.com
Date: Mon, 22 Dec 2014 08:19:06 -0800
Subject: [PATCH] net: davinci_emac: Fix runtime pm calls for davinci_emac

Commit 3ba97381343b (net: ethernet: davinci_emac: add pm_runtime support)
added support for runtime PM, but it causes issues on omap3 related devices
that actually gate the clocks:

Unhandled fault: external abort on non-linefetch (0x1008)
...
[c04160f0] (emac_dev_getnetstats) from [c04d6a3c] (dev_get_stats+0x78/0xc8)
[c04d6a3c] (dev_get_stats) from [c04e9ccc] (rtnl_fill_ifinfo+0x3b8/0x938)
[c04e9ccc] (rtnl_fill_ifinfo) from [c04eade4] (rtmsg_ifinfo+0x68/0xd8)
[c04eade4] (rtmsg_ifinfo) from [c04dd35c] (register_netdevice+0x3a0/0x4ec)
[c04dd35c] (register_netdevice) from [c04dd4bc] (register_netdev+0x14/0x24)
[c04dd4bc] (register_netdev) from [c041755c] 
(davinci_emac_probe+0x408/0x5c8)
[c041755c] (davinci_emac_probe) from [c0396d78] 
(platform_drv_probe+0x48/0xa4)

Let's fix it by moving the pm_runtime_get() call earlier, and also add it to
the emac_dev_getnetstats(). Also note that we want to use pm_runtime_get_sync()
as we don't want to have deferred_resume happen. And let's also check the
return value for pm_runtime_get_sync() as noted by Felipe Balbi ba...@ti.com.

Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Felipe Balbi ba...@ti.com
Cc: Mark A. Greer mgr...@animalcreek.com
Signed-off-by: Tony Lindgren t...@atomide.com

--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1538,7 +1538,13 @@ static int emac_dev_open(struct net_device *ndev)
int i = 0;
struct emac_priv *priv = netdev_priv(ndev);
 
-   pm_runtime_get(priv-pdev-dev);
+   ret = pm_runtime_get_sync(priv-pdev-dev);
+   if (ret  0) {
+   pm_runtime_put_noidle(priv-pdev-dev);
+   dev_err(priv-pdev-dev, %s: failed to get_sync(%d)\n,
+   __func__, ret);
+   return ret;
+   }
 
netif_carrier_off(ndev);
for (cnt = 0; cnt  ETH_ALEN; cnt++)
@@ -1725,6 +1731,15 @@ static struct net_device_stats 
*emac_dev_getnetstats(struct net_device *ndev)
struct emac_priv *priv = netdev_priv(ndev);
u32 mac_control;
u32 stats_clear_mask;
+   int err;
+
+   err = pm_runtime_get_sync(priv-pdev-dev);
+   if (err  0) {
+   pm_runtime_put_noidle(priv-pdev-dev);
+   dev_err(priv-pdev-dev, %s: failed to get_sync(%d)\n,
+   __func__, err);
+   return ndev-stats;
+   }
 
/* update emac hardware stats and reset the registers*/
 
@@ -1767,6 +1782,8 @@ static struct net_device_stats 
*emac_dev_getnetstats(struct net_device *ndev)
ndev-stats.tx_fifo_errors += emac_read(EMAC_TXUNDERRUN);
emac_write(EMAC_TXUNDERRUN, stats_clear_mask);
 
+   pm_runtime_put(priv-pdev-dev);
+
return ndev-stats;
 }
 
@@ -1981,12 +1998,22 @@ static int davinci_emac_probe(struct platform_device 
*pdev)
ndev-ethtool_ops = ethtool_ops;
netif_napi_add(ndev, priv-napi, emac_poll, EMAC_POLL_WEIGHT);
 
+   pm_runtime_enable(pdev-dev);
+   rc = pm_runtime_get_sync(pdev-dev);
+   if (rc  0) {
+   pm_runtime_put_noidle(pdev-dev);
+   dev_err(pdev-dev, %s: failed to get_sync(%d)\n,
+   __func__, rc);
+   goto no_cpdma_chan;
+   }
+
/* register the network device */
SET_NETDEV_DEV(ndev, pdev-dev);
rc = register_netdev(ndev);
if (rc) {
dev_err(pdev-dev, error in register_netdev\n);
rc = -ENODEV;
+   pm_runtime_put(pdev-dev);
goto no_cpdma_chan;
}
 
@@ -1996,9 +2023,7 @@ static int davinci_emac_probe(struct platform_device 
*pdev)
   (regs: %p, irq: %d)\n,
   (void *)priv-emac_base_phys, ndev-irq);
}
-
-   pm_runtime_enable(pdev-dev);
-   pm_runtime_resume(pdev-dev);
+   pm_runtime_put(pdev-dev);
 
return 0;
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/6] net: davinci_emac: Free clock after checking the frequency

2015-01-13 Thread David Miller
From: Tony Lindgren t...@atomide.com
Date: Tue, 13 Jan 2015 11:54:16 -0800

 * Tom Lendacky thomas.lenda...@amd.com [150113 11:51]:
 On 01/13/2015 01:29 PM, Tony Lindgren wrote:
 We only use clk_get() to get the frequency, the rest is done by
 the runtime PM calls. Let's free the clock too.
 
 Cc: Brian Hutchinson b.hutch...@gmail.com
 Cc: Felipe Balbi ba...@ti.com
 Signed-off-by: Tony Lindgren t...@atomide.com
 ---
   drivers/net/ethernet/ti/davinci_emac.c | 1 +
   1 file changed, 1 insertion(+)
 
 diff --git a/drivers/net/ethernet/ti/davinci_emac.c 
 b/drivers/net/ethernet/ti/davinci_emac.c
 index deb43b3..e9efc74 100644
 --- a/drivers/net/ethernet/ti/davinci_emac.c
 +++ b/drivers/net/ethernet/ti/davinci_emac.c
 @@ -1881,6 +1881,7 @@ static int davinci_emac_probe(struct platform_device 
 *pdev)
 return -EBUSY;
 }
 emac_bus_frequency = clk_get_rate(emac_clk);
 +   clk_put(emac_clk);
 
 The devm_clk_get call is used to get the clock so either a devm_clk_put
 needs to be used here or just let the devm_ call do its thing and
 automatically do the put when the module is unloaded.
 
 Thanks good catch, updated patch below.

Please, once all the feedback has been addressed, repost the entire
series.

THanks.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/6] net: davinci_emac: Fix runtime pm calls for davinci_emac

2015-01-13 Thread Felipe Balbi
On Tue, Jan 13, 2015 at 12:54:40PM -0800, Tony Lindgren wrote:
 * Felipe Balbi ba...@ti.com [150113 11:55]:
  On Tue, Jan 13, 2015 at 11:29:24AM -0800, Tony Lindgren wrote:
   --- a/drivers/net/ethernet/ti/davinci_emac.c
   +++ b/drivers/net/ethernet/ti/davinci_emac.c
   @@ -1538,7 +1538,7 @@ static int emac_dev_open(struct net_device *ndev)
 int i = 0;
 struct emac_priv *priv = netdev_priv(ndev);

   - pm_runtime_get(priv-pdev-dev);
   + pm_runtime_get_sync(priv-pdev-dev);
  
  gotta check return value on all pm_runtime_get_sync() calls. IIRC,
  there's a coccinelle script for checking and patching this.
 
 Sure, here's an updated patch with error checking added.
 
 Regards,
 
 Tony
 
 8 -
 From: Tony Lindgren t...@atomide.com
 Date: Mon, 22 Dec 2014 08:19:06 -0800
 Subject: [PATCH] net: davinci_emac: Fix runtime pm calls for davinci_emac
 
 Commit 3ba97381343b (net: ethernet: davinci_emac: add pm_runtime support)
 added support for runtime PM, but it causes issues on omap3 related devices
 that actually gate the clocks:
 
 Unhandled fault: external abort on non-linefetch (0x1008)
 ...
 [c04160f0] (emac_dev_getnetstats) from [c04d6a3c] 
 (dev_get_stats+0x78/0xc8)
 [c04d6a3c] (dev_get_stats) from [c04e9ccc] (rtnl_fill_ifinfo+0x3b8/0x938)
 [c04e9ccc] (rtnl_fill_ifinfo) from [c04eade4] (rtmsg_ifinfo+0x68/0xd8)
 [c04eade4] (rtmsg_ifinfo) from [c04dd35c] (register_netdevice+0x3a0/0x4ec)
 [c04dd35c] (register_netdevice) from [c04dd4bc] 
 (register_netdev+0x14/0x24)
 [c04dd4bc] (register_netdev) from [c041755c] 
 (davinci_emac_probe+0x408/0x5c8)
 [c041755c] (davinci_emac_probe) from [c0396d78] 
 (platform_drv_probe+0x48/0xa4)
 
 Let's fix it by moving the pm_runtime_get() call earlier, and also add it to
 the emac_dev_getnetstats(). Also note that we want to use 
 pm_runtime_get_sync()
 as we don't want to have deferred_resume happen. And let's also check the
 return value for pm_runtime_get_sync() as noted by Felipe Balbi 
 ba...@ti.com.
 
 Cc: Brian Hutchinson b.hutch...@gmail.com
 Cc: Felipe Balbi ba...@ti.com
 Cc: Mark A. Greer mgr...@animalcreek.com

Reviewed-by: Felipe Balbi ba...@ti.com

 Signed-off-by: Tony Lindgren t...@atomide.com
 
 --- a/drivers/net/ethernet/ti/davinci_emac.c
 +++ b/drivers/net/ethernet/ti/davinci_emac.c
 @@ -1538,7 +1538,13 @@ static int emac_dev_open(struct net_device *ndev)
   int i = 0;
   struct emac_priv *priv = netdev_priv(ndev);
  
 - pm_runtime_get(priv-pdev-dev);
 + ret = pm_runtime_get_sync(priv-pdev-dev);
 + if (ret  0) {
 + pm_runtime_put_noidle(priv-pdev-dev);
 + dev_err(priv-pdev-dev, %s: failed to get_sync(%d)\n,
 + __func__, ret);
 + return ret;
 + }
  
   netif_carrier_off(ndev);
   for (cnt = 0; cnt  ETH_ALEN; cnt++)
 @@ -1725,6 +1731,15 @@ static struct net_device_stats 
 *emac_dev_getnetstats(struct net_device *ndev)
   struct emac_priv *priv = netdev_priv(ndev);
   u32 mac_control;
   u32 stats_clear_mask;
 + int err;
 +
 + err = pm_runtime_get_sync(priv-pdev-dev);
 + if (err  0) {
 + pm_runtime_put_noidle(priv-pdev-dev);
 + dev_err(priv-pdev-dev, %s: failed to get_sync(%d)\n,
 + __func__, err);
 + return ndev-stats;
 + }
  
   /* update emac hardware stats and reset the registers*/
  
 @@ -1767,6 +1782,8 @@ static struct net_device_stats 
 *emac_dev_getnetstats(struct net_device *ndev)
   ndev-stats.tx_fifo_errors += emac_read(EMAC_TXUNDERRUN);
   emac_write(EMAC_TXUNDERRUN, stats_clear_mask);
  
 + pm_runtime_put(priv-pdev-dev);
 +
   return ndev-stats;
  }
  
 @@ -1981,12 +1998,22 @@ static int davinci_emac_probe(struct platform_device 
 *pdev)
   ndev-ethtool_ops = ethtool_ops;
   netif_napi_add(ndev, priv-napi, emac_poll, EMAC_POLL_WEIGHT);
  
 + pm_runtime_enable(pdev-dev);
 + rc = pm_runtime_get_sync(pdev-dev);
 + if (rc  0) {
 + pm_runtime_put_noidle(pdev-dev);
 + dev_err(pdev-dev, %s: failed to get_sync(%d)\n,
 + __func__, rc);
 + goto no_cpdma_chan;
 + }
 +
   /* register the network device */
   SET_NETDEV_DEV(ndev, pdev-dev);
   rc = register_netdev(ndev);
   if (rc) {
   dev_err(pdev-dev, error in register_netdev\n);
   rc = -ENODEV;
 + pm_runtime_put(pdev-dev);
   goto no_cpdma_chan;
   }
  
 @@ -1996,9 +2023,7 @@ static int davinci_emac_probe(struct platform_device 
 *pdev)
  (regs: %p, irq: %d)\n,
  (void *)priv-emac_base_phys, ndev-irq);
   }
 -
 - pm_runtime_enable(pdev-dev);
 - pm_runtime_resume(pdev-dev);
 + pm_runtime_put(pdev-dev);
  
   return 0;
  

-- 
balbi


signature.asc
Description: Digital signature


Re: [RFC PATCH 1/3] of/device: manage resources similar to platform_device_add

2015-01-13 Thread Rob Herring
On Wed, Jan 7, 2015 at 11:30 AM, Suman Anna s-a...@ti.com wrote:
 Drivers can use of_platform_populate() to create platform devices
 for children of the device main node, and a complementary API
 of_platform_depopulate() is provided to delete these child platform
 devices. The of_platform_depopulate() leverages the platform API
 for performing the cleanup of these devices.

 The platform device resources are managed differently between
 of_device_add and platform_device_add, and this asymmetry causes
 a kernel oops in platform_device_del during removal of the resources.
 Manage the platform device resources similar to platform_device_add
 to fix this kernel oops.

This is a known issue and has been attempted to be fixed before (I
believe there is a revert in mainline). The problem is there are known
devicetrees which have overlapping resources and they will break with
your change.

Rob


 Signed-off-by: Suman Anna s-a...@ti.com
 ---
  drivers/of/device.c | 38 +-
  1 file changed, 37 insertions(+), 1 deletion(-)

 diff --git a/drivers/of/device.c b/drivers/of/device.c
 index 46d6c75c1404..fa27c1c71f29 100644
 --- a/drivers/of/device.c
 +++ b/drivers/of/device.c
 @@ -50,6 +50,8 @@ EXPORT_SYMBOL(of_dev_put);

  int of_device_add(struct platform_device *ofdev)
  {
 +   int i, ret;
 +
 BUG_ON(ofdev-dev.of_node == NULL);

 /* name and id have to be set so that the platform bus doesn't get
 @@ -63,7 +65,41 @@ int of_device_add(struct platform_device *ofdev)
 if (!ofdev-dev.parent)
 set_dev_node(ofdev-dev, of_node_to_nid(ofdev-dev.of_node));

 -   return device_add(ofdev-dev);
 +   for (i = 0; i  ofdev-num_resources; i++) {
 +   struct resource *p, *r = ofdev-resource[i];
 +
 +   if (!r-name)
 +   r-name = dev_name(ofdev-dev);
 +
 +   p = r-parent;
 +   if (!p) {
 +   if (resource_type(r) == IORESOURCE_MEM)
 +   p = iomem_resource;
 +   else if (resource_type(r) == IORESOURCE_IO)
 +   p = ioport_resource;
 +   }
 +
 +   if (p  insert_resource(p, r)) {
 +   dev_err(ofdev-dev, failed to claim resource %d\n,
 +   i);
 +   ret = -EBUSY;
 +   goto failed;
 +   }
 +   }
 +
 +   ret = device_add(ofdev-dev);
 +   if (ret == 0)
 +   return ret;
 +
 +failed:
 +   while (--i = 0) {
 +   struct resource *r = ofdev-resource[i];
 +   unsigned long type = resource_type(r);
 +
 +   if (type == IORESOURCE_MEM || type == IORESOURCE_IO)
 +   release_resource(r);
 +   }
 +   return ret;
  }

  int of_device_register(struct platform_device *pdev)
 --
 2.2.1

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/4] Drop legacy support for omap3517

2015-01-13 Thread Pali Rohár
On Tuesday 13 January 2015 21:42:20 Tony Lindgren wrote:
 * Arnd Bergmann a...@arndb.de [150113 12:27]:
  On Tuesday 13 January 2015 09:57:41 Tony Lindgren wrote:
   It seems we can now drop omap3517 legacy booting support
   to get a bit closer to making all of omap3 boot in device
   tree only mode.
   
   All these boards have at least minimal support for booting
   with device tree, and pretty much anything supported with
   the legacy board files can be configured also for device
   tree based booting if not done already.
  
  Ah, very nice.
  
  Just out of curiosity, what are the remaining showstoppers
  for the 3430 and 3530 based boards?
 
 Not much really. We're now printing a warning to get a people
 to upgrade their systems. So with some boards we need to wait
 a while.
 
 Then here are the remaining items that I'm aware of:
 
 - A regression at least on some n900 with appended DTB not
 booting properly any longer reported by Pali
 
 - A regression where the legacy ATAGs don't seem to get
 properly translated by the uncompress code for atag_rev at
 least reported by Pali
 
 - A few missing .dts files for devkit8000, omap3logic,
 omap3stalker, omap3pandora and omap3touchbook
 
 Pali and Sebastian probably know best of any other remaining
 issues to drop n900 legacy booting.
 
 If people have the boards listed above, please pitch in to do
 the .dts files or send the boards to me and I can do minimal
 .dts files for them.
 
 Regards,
 
 Tony

CCing Pavel Machek

He reported also some (still not fixed) regressions on n900.

-- 
Pali Rohár
pali.ro...@gmail.com


signature.asc
Description: This is a digitally signed message part.


Re: [RFC PATCH 1/3] of/device: manage resources similar to platform_device_add

2015-01-13 Thread Rob Herring
On Tue, Jan 13, 2015 at 3:25 PM, Suman Anna s-a...@ti.com wrote:
 Hi Rob,

 On 01/13/2015 02:38 PM, Rob Herring wrote:
 On Wed, Jan 7, 2015 at 11:30 AM, Suman Anna s-a...@ti.com wrote:
 Drivers can use of_platform_populate() to create platform devices
 for children of the device main node, and a complementary API
 of_platform_depopulate() is provided to delete these child platform
 devices. The of_platform_depopulate() leverages the platform API
 for performing the cleanup of these devices.

 The platform device resources are managed differently between
 of_device_add and platform_device_add, and this asymmetry causes
 a kernel oops in platform_device_del during removal of the resources.
 Manage the platform device resources similar to platform_device_add
 to fix this kernel oops.

 This is a known issue and has been attempted to be fixed before (I
 believe there is a revert in mainline). The problem is there are known
 devicetrees which have overlapping resources and they will break with
 your change.

 Are you referring to 02bbde7849e6 (Revert of: use
 platform_device_add)?

I believe that's the one.

 That one seems to be in registration path, and
 this crash is in the unregistration path. If so, to fix the crash,
 should we be skipping the release_resource() for now in
 platform_device_del for DT nodes, or replace platform_device_unregister
 with of_device_unregister in of_platform_device_destroy()?

IIRC, the problem is inserting a resource twice on add from 2
different nodes, not the removal path. Perhaps we could make a
collision non-fatal for in the DT case. Grant may have some ideas on
what's needed here.

 This is a common crash and we cannot use of_platform_depopulate() today
 in drivers to complement of_platform_populate().

Yes, I know.

 Also, the platform_data crash is independent of this, I could reproduce
 that one even with using of_device_unregister in a loop in driver remove.

Missed this one. I'll reply to that patch.

Rob


 regards
 Suman


 Rob


 Signed-off-by: Suman Anna s-a...@ti.com
 ---
  drivers/of/device.c | 38 +-
  1 file changed, 37 insertions(+), 1 deletion(-)

 diff --git a/drivers/of/device.c b/drivers/of/device.c
 index 46d6c75c1404..fa27c1c71f29 100644
 --- a/drivers/of/device.c
 +++ b/drivers/of/device.c
 @@ -50,6 +50,8 @@ EXPORT_SYMBOL(of_dev_put);

  int of_device_add(struct platform_device *ofdev)
  {
 +   int i, ret;
 +
 BUG_ON(ofdev-dev.of_node == NULL);

 /* name and id have to be set so that the platform bus doesn't get
 @@ -63,7 +65,41 @@ int of_device_add(struct platform_device *ofdev)
 if (!ofdev-dev.parent)
 set_dev_node(ofdev-dev, 
 of_node_to_nid(ofdev-dev.of_node));

 -   return device_add(ofdev-dev);
 +   for (i = 0; i  ofdev-num_resources; i++) {
 +   struct resource *p, *r = ofdev-resource[i];
 +
 +   if (!r-name)
 +   r-name = dev_name(ofdev-dev);
 +
 +   p = r-parent;
 +   if (!p) {
 +   if (resource_type(r) == IORESOURCE_MEM)
 +   p = iomem_resource;
 +   else if (resource_type(r) == IORESOURCE_IO)
 +   p = ioport_resource;
 +   }
 +
 +   if (p  insert_resource(p, r)) {
 +   dev_err(ofdev-dev, failed to claim resource 
 %d\n,
 +   i);
 +   ret = -EBUSY;
 +   goto failed;
 +   }
 +   }
 +
 +   ret = device_add(ofdev-dev);
 +   if (ret == 0)
 +   return ret;
 +
 +failed:
 +   while (--i = 0) {
 +   struct resource *r = ofdev-resource[i];
 +   unsigned long type = resource_type(r);
 +
 +   if (type == IORESOURCE_MEM || type == IORESOURCE_IO)
 +   release_resource(r);
 +   }
 +   return ret;
  }

  int of_device_register(struct platform_device *pdev)
 --
 2.2.1


--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/7] ARM: OMAP2+: Fix reboot for 81xx

2015-01-13 Thread Tony Lindgren
We are missing proper hooks for 81xx for reboot to work.

Cc: Brian Hutchinson b.hutch...@gmail.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Makefile |  1 +
 arch/arm/mach-omap2/common.h |  8 
 arch/arm/mach-omap2/ti81xx-restart.c | 31 +++
 3 files changed, 40 insertions(+)
 create mode 100644 arch/arm/mach-omap2/ti81xx-restart.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 5d27dfd..3a6463f 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -58,6 +58,7 @@ AFLAGS_sram34xx.o :=-Wa,-march=armv7-a
 # Restart code (OMAP4/5 currently in omap4-common.c)
 obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o
 obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o
+obj-$(CONFIG_SOC_TI81XX)   += ti81xx-restart.o
 obj-$(CONFIG_SOC_AM33XX)   += am33xx-restart.o
 obj-$(CONFIG_SOC_AM43XX)   += omap4-restart.o
 obj-$(CONFIG_ARCH_OMAP3)   += omap3-restart.o
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 900ebdd..65b4371 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -164,6 +164,14 @@ static inline void omap3xxx_restart(enum reboot_mode mode, 
const char *cmd)
 }
 #endif
 
+#ifdef CONFIG_SOC_TI81XX
+void ti81xx_restart(enum reboot_mode mode, const char *cmd);
+#else
+static inline void ti81xx_restart(enum reboot_mode mode, const char *cmd)
+{
+}
+#endif
+
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \
defined(CONFIG_SOC_DRA7XX) || defined(CONFIG_SOC_AM43XX)
 void omap44xx_restart(enum reboot_mode mode, const char *cmd);
diff --git a/arch/arm/mach-omap2/ti81xx-restart.c 
b/arch/arm/mach-omap2/ti81xx-restart.c
new file mode 100644
index 000..68b29be
--- /dev/null
+++ b/arch/arm/mach-omap2/ti81xx-restart.c
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+#include linux/kernel.h
+#include linux/init.h
+#include linux/reboot.h
+
+#include iomap.h
+#include common.h
+#include control.h
+#include prm3xxx.h
+
+#define TI81XX_PRM_DEVICE_RSTCTRL  0x00a0
+#define TI81XX_GLOBAL_RST_COLD BIT(1)
+
+/**
+ * ti81xx_restart - trigger a software restart of the SoC
+ * @mode: the reboot mode, see arch/arm/kernel/{setup,process}.c
+ * @cmd: passed from the userspace program rebooting the system (if provided)
+ *
+ * Resets the SoC.  For @cmd, see the 'reboot' syscall in
+ * kernel/sys.c.  No return value.
+ */
+void ti81xx_restart(enum reboot_mode mode, const char *cmd)
+{
+   omap2_prm_set_mod_reg_bits(TI81XX_GLOBAL_RST_COLD, 0,
+  TI81XX_PRM_DEVICE_RSTCTRL);
+   while (1);
+}
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 7/7] ARM: OMAP2+: Disable omap3 PM init for ti81xx

2015-01-13 Thread Tony Lindgren
We cannot use the omap3 pm support on 81xx.

Cc: Brian Hutchinson b.hutch...@gmail.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/io.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index b957776..e4a5630 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -568,7 +568,6 @@ void __init am35xx_init_late(void)
 void __init ti81xx_init_late(void)
 {
omap_common_late_init();
-   omap3_pm_init();
omap2_clk_enable_autoidle_all();
 }
 #endif
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/7] ARM: OMAP2+: Remove unused ti81xx platform init code

2015-01-13 Thread Tony Lindgren
The support for 81xx was never working in mainline, and it
will be only supported in device tree mode. Let's remove all
the remaining 81xx related platform code.

Cc: Brian Hutchinson b.hutch...@gmail.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/cclock3xxx_data.c   |  6 +-
 arch/arm/mach-omap2/omap_phy_internal.c | 35 -
 arch/arm/mach-omap2/usb-musb.c  | 12 ++-
 arch/arm/mach-omap2/usb.h   |  2 --
 4 files changed, 3 insertions(+), 52 deletions(-)

diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c 
b/arch/arm/mach-omap2/cclock3xxx_data.c
index 644ff32..e79c80b 100644
--- a/arch/arm/mach-omap2/cclock3xxx_data.c
+++ b/arch/arm/mach-omap2/cclock3xxx_data.c
@@ -3634,10 +3634,6 @@ int __init omap3xxx_clk_init(void)
omap_clocks_register(omap36xx_am35xx_omap3430es2plus_clks,
 
ARRAY_SIZE(omap36xx_am35xx_omap3430es2plus_clks));
omap_clocks_register(omap3xxx_clks, ARRAY_SIZE(omap3xxx_clks));
-   } else if (soc_is_am33xx()) {
-   cpu_mask = RATE_IN_AM33XX;
-   } else if (cpu_is_ti814x()) {
-   cpu_mask = RATE_IN_TI814X;
} else if (cpu_is_omap34xx()) {
if (omap_rev() == OMAP3430_REV_ES1_0) {
cpu_mask = RATE_IN_3430ES1;
@@ -3681,7 +3677,7 @@ int __init omap3xxx_clk_init(void)
 * Lock DPLL5 -- here only until other device init code can
 * handle this
 */
-   if (!cpu_is_ti81xx()  (omap_rev() = OMAP3430_REV_ES2_0))
+   if (omap_rev() = OMAP3430_REV_ES2_0)
omap3_clk_lock_dpll5();
 
/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c 
b/arch/arm/mach-omap2/omap_phy_internal.c
index 1a19fa0..8e90356 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -152,38 +152,3 @@ void am35x_set_mode(u8 musb_mode)
 
omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
 }
-
-void ti81xx_musb_phy_power(u8 on)
-{
-   void __iomem *scm_base = NULL;
-   u32 usbphycfg;
-
-   scm_base = ioremap(TI81XX_SCM_BASE, SZ_2K);
-   if (!scm_base) {
-   pr_err(system control module ioremap failed\n);
-   return;
-   }
-
-   usbphycfg = readl_relaxed(scm_base + USBCTRL0);
-
-   if (on) {
-   if (cpu_is_ti816x()) {
-   usbphycfg |= TI816X_USBPHY0_NORMAL_MODE;
-   usbphycfg = ~TI816X_USBPHY_REFCLK_OSC;
-   } else if (cpu_is_ti814x()) {
-   usbphycfg = ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN
-   | USBPHY_DPINPUT | USBPHY_DMINPUT);
-   usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN
-   | USBPHY_DPOPBUFCTL | USBPHY_DMOPBUFCTL);
-   }
-   } else {
-   if (cpu_is_ti816x())
-   usbphycfg = ~TI816X_USBPHY0_NORMAL_MODE;
-   else if (cpu_is_ti814x())
-   usbphycfg |= USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN;
-
-   }
-   writel_relaxed(usbphycfg, scm_base + USBCTRL0);
-
-   iounmap(scm_base);
-}
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index bc89723..e4562b2 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -82,16 +82,8 @@ void __init usb_musb_init(struct omap_musb_board_data 
*musb_board_data)
musb_plat.mode = board_data-mode;
musb_plat.extvbus = board_data-extvbus;
 
-   if (soc_is_am35xx()) {
-   oh_name = am35x_otg_hs;
-   name = musb-am35x;
-   } else if (cpu_is_ti81xx()) {
-   oh_name = usb_otg_hs;
-   name = musb-ti81xx;
-   } else {
-   oh_name = usb_otg_hs;
-   name = musb-omap2430;
-   }
+   oh_name = usb_otg_hs;
+   name = musb-omap2430;
 
 oh = omap_hwmod_lookup(oh_name);
 if (WARN(!oh, %s: could not find omap_hwmod for %s\n,
diff --git a/arch/arm/mach-omap2/usb.h b/arch/arm/mach-omap2/usb.h
index 4ba2ae7..3395365 100644
--- a/arch/arm/mach-omap2/usb.h
+++ b/arch/arm/mach-omap2/usb.h
@@ -68,5 +68,3 @@ extern void am35x_musb_reset(void);
 extern void am35x_musb_phy_power(u8 on);
 extern void am35x_musb_clear_irq(void);
 extern void am35x_set_mode(u8 musb_mode);
-extern void ti81xx_musb_phy_power(u8 on);
-
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/7] ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks

2015-01-13 Thread Tony Lindgren
We need to check if we got the clock before trying to do anything
with it. Otherwise we will get something like this:

Unable to handle kernel paging request at virtual address fffe
...
[c04bef78] (clk_prepare) from [c00338a4] 
(omap2_clk_enable_init_clocks+0x50/0x8)
[c00338a4] (omap2_clk_enable_init_clocks) from [c0876838] 
(dm816x_dt_clk_init+0)
...

Let's add check for the clock and WARN if the init clock was not
found.

Cc: Brian Hutchinson b.hutch...@gmail.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/clock.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 6ad5b4d..89a0732 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -620,6 +620,11 @@ void omap2_clk_enable_init_clocks(const char **clk_names, 
u8 num_clocks)
 
for (i = 0; i  num_clocks; i++) {
init_clk = clk_get(NULL, clk_names[i]);
+   if (IS_ERR(init_clk)) {
+   WARN(1, omap clock: could not find init clock %s\n,
+clk_names[i]);
+   continue;
+   }
clk_prepare_enable(init_clk);
}
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/7] Fixes and clean-up in preparation for booting ti81xx

2015-01-13 Thread Tony Lindgren
Hi all,

The ti81xx support has been in a sorry half-merged state for
past few years in the mainline kernel. Let's get it working
by first fixing the issues.

Note that another series of patches is needed to add the 81xx
related data files.

Regards,

Tony

Tony Lindgren (7):
  ARM: OMAP2+: Remove unused ti81xx platform init code
  ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks
  ARM: OMAP2+: Fix ti81xx devtype
  ARM: OMAP2+: Fix ti81xx class type
  ARM: OMAP2+: Fix dm814 and dm816 for clocks and timer init
  ARM: OMAP2+: Fix reboot for 81xx
  ARM: OMAP2+: Disable omap3 PM init for ti81xx

 arch/arm/mach-omap2/Makefile|  1 +
 arch/arm/mach-omap2/cclock3xxx_data.c   |  6 +
 arch/arm/mach-omap2/clock.c |  5 +
 arch/arm/mach-omap2/common.h| 11 -
 arch/arm/mach-omap2/control.h   |  4 
 arch/arm/mach-omap2/id.c|  2 ++
 arch/arm/mach-omap2/io.c| 26 -
 arch/arm/mach-omap2/omap_phy_internal.c | 35 -
 arch/arm/mach-omap2/powerdomains3xxx_data.c |  2 +-
 arch/arm/mach-omap2/prm_common.c|  4 
 arch/arm/mach-omap2/soc.h   |  4 ++--
 arch/arm/mach-omap2/ti81xx-restart.c| 31 +
 arch/arm/mach-omap2/timer.c |  2 ++
 arch/arm/mach-omap2/usb-musb.c  | 12 ++
 arch/arm/mach-omap2/usb.h   |  2 --
 15 files changed, 86 insertions(+), 61 deletions(-)
 create mode 100644 arch/arm/mach-omap2/ti81xx-restart.c

-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/7] ARM: OMAP2+: Fix ti81xx devtype

2015-01-13 Thread Tony Lindgren
Otherwise we get error Cannot detect omap type! and many
things can fail with following:

Unhandled fault: imprecise external abort (0xc06) at 0xc6031fb0

This is because the omap_type is being used to set up th SoC
specific functions for omaps.

Cc: Brian Hutchinson b.hutch...@gmail.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/control.h | 4 
 arch/arm/mach-omap2/id.c  | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index a3c0133..0fba6d1 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -53,6 +53,7 @@
 #define OMAP343X_CONTROL_GENERAL_WKUP  0xa60
 
 /* TI81XX spefic control submodules */
+#define TI81XX_CONTROL_DEVBOOT 0x040
 #define TI81XX_CONTROL_DEVCONF 0x600
 
 /* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
@@ -246,6 +247,9 @@
 #define OMAP3_PADCONF_SAD2D_MSTANDBY   0x250
 #define OMAP3_PADCONF_SAD2D_IDLEACK0x254
 
+/* TI81XX CONTROL_DEVBOOT register offsets */
+#define TI81XX_CONTROL_STATUS  (TI81XX_CONTROL_DEVBOOT + 0x000)
+
 /* TI81XX CONTROL_DEVCONF register offsets */
 #define TI81XX_CONTROL_DEVICE_ID   (TI81XX_CONTROL_DEVCONF + 0x000)
 
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index c25feba..2a2f4d5 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -56,6 +56,8 @@ int omap_type(void)
 
if (cpu_is_omap24xx()) {
val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
+   } else if (cpu_is_ti81xx()) {
+   val = omap_ctrl_readl(TI81XX_CONTROL_STATUS);
} else if (soc_is_am33xx() || soc_is_am43xx()) {
val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
} else if (cpu_is_omap34xx()) {
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/7] ARM: OMAP2+: Fix ti81xx class type

2015-01-13 Thread Tony Lindgren
Otherwise it will return true for cpu_is_omap34xx() which we don't
want for the clocks and hwmod. It's closer to am33xx for the clocks
and hwmod than to the omap34xx. We also want to be able to detect
814x and 816x separately as at least the clocks are different with
814x using a apll and 816x using a fapll for the source clocks.

Note that we can also remove omap3xxx_clk_init() call as it's wrong
and ti81xx are booting in device tree only mode.

Cc: Brian Hutchinson b.hutch...@gmail.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/common.h|  3 ++-
 arch/arm/mach-omap2/io.c| 25 +
 arch/arm/mach-omap2/powerdomains3xxx_data.c |  2 +-
 arch/arm/mach-omap2/soc.h   |  4 ++--
 4 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 377eea8..900ebdd 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -110,7 +110,8 @@ void omap3630_init_early(void);
 void omap3_init_early(void);   /* Do not use this one */
 void am33xx_init_early(void);
 void am35xx_init_early(void);
-void ti81xx_init_early(void);
+void ti814x_init_early(void);
+void ti816x_init_early(void);
 void am33xx_init_early(void);
 void am43xx_init_early(void);
 void am43xx_init_late(void);
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index a1bd6af..b957776 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -492,9 +492,28 @@ void __init am35xx_init_early(void)
omap_clk_soc_init = am35xx_dt_clk_init;
 }
 
-void __init ti81xx_init_early(void)
+void __init ti814x_init_early(void)
 {
-   omap2_set_globals_tap(OMAP343X_CLASS,
+   omap2_set_globals_tap(TI814X_CLASS,
+ OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE));
+   omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
+ NULL);
+   omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE));
+   omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE), NULL);
+   omap3xxx_check_revision();
+   ti81xx_check_features();
+   omap3xxx_voltagedomains_init();
+   omap3xxx_powerdomains_init();
+   omap3xxx_clockdomains_init();
+   omap3xxx_hwmod_init();
+   omap_hwmod_init_postsetup();
+   if (of_have_populated_dt())
+   omap_clk_soc_init = ti81xx_dt_clk_init;
+}
+
+void __init ti816x_init_early(void)
+{
+   omap2_set_globals_tap(TI816X_CLASS,
  OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE));
omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
  NULL);
@@ -509,8 +528,6 @@ void __init ti81xx_init_early(void)
omap_hwmod_init_postsetup();
if (of_have_populated_dt())
omap_clk_soc_init = ti81xx_dt_clk_init;
-   else
-   omap_clk_soc_init = omap3xxx_clk_init;
 }
 
 void __init omap3_init_late(void)
diff --git a/arch/arm/mach-omap2/powerdomains3xxx_data.c 
b/arch/arm/mach-omap2/powerdomains3xxx_data.c
index 328c103..70bc706 100644
--- a/arch/arm/mach-omap2/powerdomains3xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains3xxx_data.c
@@ -464,7 +464,7 @@ void __init omap3xxx_powerdomains_init(void)
 {
unsigned int rev;
 
-   if (!cpu_is_omap34xx())
+   if (!cpu_is_omap34xx()  !cpu_is_ti81xx())
return;
 
pwrdm_register_platform_funcs(omap3_pwrdm_operations);
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index c1a3b44..f97654d 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -423,13 +423,13 @@ IS_OMAP_TYPE(3430, 0x3430)
 #define OMAP3630_REV_ES1_1 (OMAP363X_CLASS | (0x1  8))
 #define OMAP3630_REV_ES1_2 (OMAP363X_CLASS | (0x2  8))
 
-#define TI816X_CLASS   0x81600034
+#define TI816X_CLASS   0x81600081
 #define TI8168_REV_ES1_0   TI816X_CLASS
 #define TI8168_REV_ES1_1   (TI816X_CLASS | (0x1  8))
 #define TI8168_REV_ES2_0   (TI816X_CLASS | (0x2  8))
 #define TI8168_REV_ES2_1   (TI816X_CLASS | (0x3  8))
 
-#define TI814X_CLASS   0x81400034
+#define TI814X_CLASS   0x81400081
 #define TI8148_REV_ES1_0   TI814X_CLASS
 #define TI8148_REV_ES2_0   (TI814X_CLASS | (0x1  8))
 #define TI8148_REV_ES2_1   (TI814X_CLASS | (0x2  8))
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/7] ARM: OMAP2+: Fix dm814 and dm816 for clocks and timer init

2015-01-13 Thread Tony Lindgren
Fix dm814 and dm816 clocks and timer init.

Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Paul Walmsley p...@pwsan.com
Cc: Tero Kristo t-kri...@ti.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/prm_common.c | 4 
 arch/arm/mach-omap2/timer.c  | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index 779940c..b658785 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -571,6 +571,10 @@ static const struct of_device_id 
omap_prcm_dt_match_table[] = {
{ .compatible = ti,am3-scrm },
{ .compatible = ti,am4-prcm },
{ .compatible = ti,am4-scrm },
+   { .compatible = ti,dm814-prcm },
+   { .compatible = ti,dm814-scrm },
+   { .compatible = ti,dm816-prcm },
+   { .compatible = ti,dm816-scrm },
{ .compatible = ti,omap2-prcm },
{ .compatible = ti,omap2-scrm },
{ .compatible = ti,omap3-prm },
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 4f61148..376b099 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -146,6 +146,8 @@ static const struct of_device_id omap_timer_match[] 
__initconst = {
{ .compatible = ti,omap3430-timer, },
{ .compatible = ti,omap4430-timer, },
{ .compatible = ti,omap5430-timer, },
+   { .compatible = ti,dm814-timer, },
+   { .compatible = ti,dm816-timer, },
{ .compatible = ti,am335x-timer, },
{ .compatible = ti,am335x-timer-1ms, },
{ }
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] ARM: OMAP2+: Add dm816x hwmod support

2015-01-13 Thread Tony Lindgren
Add minimal hwmod support that works at least on dm8168. This
is based on the code in the earlier TI CDP tree, and an earlier
patch by Aida Mynzhasova aida.mynzhas...@skitlab.ru.

I've set up things to work pretty much the same way as for
am33xx. We are basically using cm33xx.c with a different set
of clocks and clockdomains.

This code is based on the TI81XX-LINUX-PSP-04.04.00.02 patches
published at:

http://downloads.ti.com/dsps/dsps_public_sw/psp/LinuxPSP/TI81XX_04_04/04_04_00_02/index_FDS.html

Cc: Aida Mynzhasova aida.mynzhas...@skitlab.ru
Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Paul Walmsley p...@pwsan.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Makefile   |1 +
 arch/arm/mach-omap2/io.c   |8 +-
 arch/arm/mach-omap2/omap_hwmod.c   |2 +-
 arch/arm/mach-omap2/omap_hwmod.h   |1 +
 arch/arm/mach-omap2/omap_hwmod_81xx_data.c | 1025 
 5 files changed, 1034 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/mach-omap2/omap_hwmod_81xx_data.c

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 352873c..926bc39 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -226,6 +226,7 @@ obj-$(CONFIG_SOC_AM33XX)+= 
omap_hwmod_33xx_43xx_ipblock_data.o
 obj-$(CONFIG_SOC_AM43XX)   += omap_hwmod_43xx_data.o
 obj-$(CONFIG_SOC_AM43XX)   += 
omap_hwmod_33xx_43xx_interconnect_data.o
 obj-$(CONFIG_SOC_AM43XX)   += omap_hwmod_33xx_43xx_ipblock_data.o
+obj-$(CONFIG_SOC_TI81XX)   += omap_hwmod_81xx_data.o
 obj-$(CONFIG_ARCH_OMAP4)   += omap_hwmod_44xx_data.o
 obj-$(CONFIG_SOC_OMAP5)+= omap_hwmod_54xx_data.o
 obj-$(CONFIG_SOC_DRA7XX)   += omap_hwmod_7xx_data.o
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index ccf238c..3ab0685 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -502,10 +502,12 @@ void __init ti814x_init_early(void)
omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE), NULL);
omap3xxx_check_revision();
ti81xx_check_features();
+   am33xx_prm_init();
+   am33xx_cm_init();
omap3xxx_voltagedomains_init();
omap3xxx_powerdomains_init();
ti81xx_clockdomains_init();
-   omap3xxx_hwmod_init();
+   ti81xx_hwmod_init();
omap_hwmod_init_postsetup();
if (of_have_populated_dt())
omap_clk_soc_init = ti81xx_dt_clk_init;
@@ -521,10 +523,12 @@ void __init ti816x_init_early(void)
omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE), NULL);
omap3xxx_check_revision();
ti81xx_check_features();
+   am33xx_prm_init();
+   am33xx_cm_init();
omap3xxx_voltagedomains_init();
omap3xxx_powerdomains_init();
ti81xx_clockdomains_init();
-   omap3xxx_hwmod_init();
+   ti81xx_hwmod_init();
omap_hwmod_init_postsetup();
if (of_have_populated_dt())
omap_clk_soc_init = ti81xx_dt_clk_init;
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index cbb908d..d7e6d5c 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -4142,7 +4142,7 @@ void __init omap_hwmod_init(void)
soc_ops.deassert_hardreset = _omap4_deassert_hardreset;
soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted;
soc_ops.init_clkdm = _init_clkdm;
-   } else if (soc_is_am33xx()) {
+   } else if (cpu_is_ti816x() || soc_is_am33xx()) {
soc_ops.enable_module = _omap4_enable_module;
soc_ops.disable_module = _omap4_disable_module;
soc_ops.wait_target_ready = _omap4_wait_target_ready;
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 35ca6ef..4b070b4 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -763,6 +763,7 @@ extern int omap3xxx_hwmod_init(void);
 extern int omap44xx_hwmod_init(void);
 extern int omap54xx_hwmod_init(void);
 extern int am33xx_hwmod_init(void);
+extern int ti81xx_hwmod_init(void);
 extern int dra7xx_hwmod_init(void);
 int am43xx_hwmod_init(void);
 
diff --git a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
new file mode 100644
index 000..41d0e42
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
@@ -0,0 +1,1025 @@
+/*
+ * DM81xx hwmod data.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ * Copyright (C) 2013 SKTB SKiT, http://www.skitlab.ru/
+ *
+ * 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 version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether 

[PATCH 1/2] ARM: OMAP2+: Add clock domain support for dm816x

2015-01-13 Thread Tony Lindgren
From: Aida Mynzhasova aida.mynzhas...@skitlab.ru

This patch adds required definitions and structures for clockdomain
initialization, so omap3xxx_clockdomains_init() was substituted by
new ti81xx_clockdomains_init() while early initialization of
TI81XX platform.

This code is based on the TI81XX-LINUX-PSP-04.04.00.02 patches
published at:

http://downloads.ti.com/dsps/dsps_public_sw/psp/LinuxPSP/TI81XX_04_04/04_04_00_02/index_FDS.html

Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Paul Walmsley p...@pwsan.com
Signed-off-by: Aida Mynzhasova aida.mynzhas...@skitlab.ru
[t...@atomide.com: updated to apply, renamed to clockdomains81xx.c
 fixed to use am33xx_clkdm_operations]
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/Makefile|   2 +
 arch/arm/mach-omap2/clockdomain.h   |   1 +
 arch/arm/mach-omap2/clockdomains81xx_data.c | 191 
 arch/arm/mach-omap2/cm81xx.h|  61 +
 arch/arm/mach-omap2/io.c|   4 +-
 5 files changed, 257 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/clockdomains81xx_data.c
 create mode 100644 arch/arm/mach-omap2/cm81xx.h

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 3a6463f..352873c 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -171,6 +171,8 @@ obj-$(CONFIG_ARCH_OMAP4)+= $(clockdomain-common)
 obj-$(CONFIG_ARCH_OMAP4)   += clockdomains44xx_data.o
 obj-$(CONFIG_SOC_AM33XX)   += $(clockdomain-common)
 obj-$(CONFIG_SOC_AM33XX)   += clockdomains33xx_data.o
+obj-$(CONFIG_SOC_TI81XX)   += $(clockdomain-common)
+obj-$(CONFIG_SOC_TI81XX)   += clockdomains81xx_data.o
 obj-$(CONFIG_SOC_AM43XX)   += $(clockdomain-common)
 obj-$(CONFIG_SOC_AM43XX)   += clockdomains43xx_data.o
 obj-$(CONFIG_SOC_OMAP5)+= $(clockdomain-common)
diff --git a/arch/arm/mach-omap2/clockdomain.h 
b/arch/arm/mach-omap2/clockdomain.h
index 82c37b1..77bab5f 100644
--- a/arch/arm/mach-omap2/clockdomain.h
+++ b/arch/arm/mach-omap2/clockdomain.h
@@ -216,6 +216,7 @@ extern void __init omap242x_clockdomains_init(void);
 extern void __init omap243x_clockdomains_init(void);
 extern void __init omap3xxx_clockdomains_init(void);
 extern void __init am33xx_clockdomains_init(void);
+extern void __init ti81xx_clockdomains_init(void);
 extern void __init omap44xx_clockdomains_init(void);
 extern void __init omap54xx_clockdomains_init(void);
 extern void __init dra7xx_clockdomains_init(void);
diff --git a/arch/arm/mach-omap2/clockdomains81xx_data.c 
b/arch/arm/mach-omap2/clockdomains81xx_data.c
new file mode 100644
index 000..05c4635
--- /dev/null
+++ b/arch/arm/mach-omap2/clockdomains81xx_data.c
@@ -0,0 +1,191 @@
+/*
+ * TI81XX Clock Domain data.
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
+ * Copyright (C) 2013 SKTB SKiT, http://www.skitlab.ru/
+ *
+ * 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 version 2.
+ *
+ * This program is distributed as is WITHOUT ANY WARRANTY of any
+ * kind, whether express or implied; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_81XX_H
+#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_81XX_H
+
+#include linux/kernel.h
+#include linux/io.h
+
+#include clockdomain.h
+
+#include cm81xx.h
+
+/*
+ * - Add other domains as required
+ * - Fill up associated powerdomans (especially ALWON powerdomains are NULL at
+ *   the moment
+ * - Consider dependencies across domains (probably not applicable till now)
+ */
+
+/* Common TI81XX */
+static struct clockdomain alwon_l3_slow_81xx_clkdm = {
+   .name   = l3s_clkdm,
+   .pwrdm  = { .name = alwon_pwrdm },
+   .cm_inst= TI81XX_CM_ALWON_MOD,
+   .clkdm_offs = TI81XX_CM_ALWON_L3_SLOW_CLKDM,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+};
+
+static struct clockdomain alwon_l3_med_81xx_clkdm = {
+   .name   = alwon_l3_med_clkdm,
+   .pwrdm  = { .name = alwon_pwrdm },
+   .cm_inst= TI81XX_CM_ALWON_MOD,
+   .clkdm_offs = TI81XX_CM_ALWON_L3_MED_CLKDM,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+};
+
+static struct clockdomain alwon_l3_fast_81xx_clkdm = {
+   .name   = alwon_l3_fast_clkdm,
+   .pwrdm  = { .name = alwon_pwrdm },
+   .cm_inst= TI81XX_CM_ALWON_MOD,
+   .clkdm_offs = TI81XX_CM_ALWON_L3_FAST_CLKDM,
+   .flags  = CLKDM_CAN_HWSUP_SWSUP,
+};
+
+static struct clockdomain alwon_ethernet_81xx_clkdm = {
+   .name   = alwon_ethernet_clkdm,
+   .pwrdm  = { .name = 

[PATCH 0/2] Add clockdomain and hwmod data needed to boot dm816x

2015-01-13 Thread Tony Lindgren
Hi,

These patches add the basic data needed for booting dm816x
after the fixes I posted earlier today. Note that also the
device tree related changes are needed that will be posted
in another series.

Regards,

Tony


Aida Mynzhasova (1):
  ARM: OMAP2+: Add clock domain support for dm816x

Tony Lindgren (1):
  ARM: OMAP2+: Add dm816x hwmod support

 arch/arm/mach-omap2/Makefile|3 +
 arch/arm/mach-omap2/clockdomain.h   |1 +
 arch/arm/mach-omap2/clockdomains81xx_data.c |  191 +
 arch/arm/mach-omap2/cm81xx.h|   61 ++
 arch/arm/mach-omap2/io.c|   12 +-
 arch/arm/mach-omap2/omap_hwmod.c|2 +-
 arch/arm/mach-omap2/omap_hwmod.h|1 +
 arch/arm/mach-omap2/omap_hwmod_81xx_data.c  | 1025 +++
 8 files changed, 1291 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/mach-omap2/clockdomains81xx_data.c
 create mode 100644 arch/arm/mach-omap2/cm81xx.h
 create mode 100644 arch/arm/mach-omap2/omap_hwmod_81xx_data.c

-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ARM: OMAP2+: hwmod: Fix _wait_target_ready() for hwmods without sysc

2015-01-13 Thread Paul Walmsley
Hi Suman,

thanks for pitching in on this!

On Tue, 6 Jan 2015, Suman Anna wrote:

 You have removed the return from the above block on failure. If any DT
 entry doesn't have the reg property, this will hang the kernel boot.
 Just remove the reg entry from any of the existing DT, and you will
 run into the issue, this is what 6423d6df1440 (ARM: OMAP2+: hwmod:
 check for module address space during init) fixed. 

Seems like that's the problem that we need to track down, then.  If a 
hwmod has no MPU-accessible registers, it should still be possible to 
init the clocks for the device, etc. ...

 Also, are you sure you want to turn the WARN into a pr_debug, it won't 
 even show during the kernel boot log if the reg base is missing.

No, I'm not sure :-)  I guess it depends how many hwmods we'll have with 
no MPU-accessible registers.  We don't seem to have address ranges for the 
interconnects defined; we could fix that fairly easily. 


- Paul
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/4] Device tree related changes to boot dm816x

2015-01-13 Thread Tony Lindgren
Hi,

Here are the device tree related changes to boot dm816x 
boards as tested on a dm8168-evm.

Note that these depend on the other related patches I've
posted today. To make it easier to figure out what all is
needed, i've also posted a temporary test branch with all
the necessary patches applied to a tmp-testing-dm81xx branch
at:

https://git.kernel.org/cgit/linux/kernel/git/tmlind/linux-omap.git/log/?h=tmp-testing-dm81xx

Regards,

Tony


Tony Lindgren (4):
  ARM: OMAP2+: Add board-generic.c entry for ti81xx
  ARM: dts: Add basic dm816x device tree configuration
  ARM: dts: Add basic clocks for dm816x
  ARM: dts: Add minimal support for dm8168-evm

 arch/arm/boot/dts/Makefile   |   1 +
 arch/arm/boot/dts/dm8168-evm.dts | 105 ++
 arch/arm/boot/dts/dm816x-clocks.dtsi | 250 +++
 arch/arm/boot/dts/dm816x.dtsi| 375 +++
 arch/arm/mach-omap2/board-generic.c  |  34 
 5 files changed, 765 insertions(+)
 create mode 100644 arch/arm/boot/dts/dm8168-evm.dts
 create mode 100644 arch/arm/boot/dts/dm816x-clocks.dtsi
 create mode 100644 arch/arm/boot/dts/dm816x.dtsi

-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] ARM: dts: Add basic dm816x device tree configuration

2015-01-13 Thread Tony Lindgren
Similar to other omap variants, let's add dm816x support.

Note that this is based on generated data from the
TI81XX-LINUX-PSP-04.04.00.02 patches published at:

http://downloads.ti.com/dsps/dsps_public_sw/psp/LinuxPSP/TI81XX_04_04/04_04_00_02/index_FDS.html

I've verified the basic functionality, but have not been
able to test all the devices on dm8168-evm.

Cc: Brian Hutchinson b.hutch...@gmail.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/boot/dts/dm816x.dtsi | 374 ++
 1 file changed, 374 insertions(+)
 create mode 100644 arch/arm/boot/dts/dm816x.dtsi

diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi
new file mode 100644
index 000..7d575ac
--- /dev/null
+++ b/arch/arm/boot/dts/dm816x.dtsi
@@ -0,0 +1,374 @@
+/*
+ * 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.
+ */
+
+#include dt-bindings/gpio/gpio.h
+
+#include skeleton.dtsi
+
+/ {
+   compatible = ti,dm816;
+   interrupt-parent = intc;
+
+   aliases {
+   i2c0 = i2c1;
+   i2c1 = i2c2;
+   serial0 = uart1;
+   serial1 = uart2;
+   serial2 = uart3;
+   ethernet0 = eth0;
+   ethernet1 = eth1;
+   };
+
+   cpus {
+   #address-cells = 1;
+   #size-cells = 0;
+   cpu@0 {
+   compatible = arm,cortex-a8;
+   device_type = cpu;
+   reg = 0;
+   };
+   };
+
+   pmu {
+   compatible = arm,cortex-a8-pmu;
+   interrupts = 3;
+   };
+
+   /*
+* The soc node represents the soc top level view. It is used for IPs
+* that are not memory mapped in the MPU view or for the MPU itself.
+*/
+   soc {
+   compatible = ti,omap-infra;
+   mpu {
+   compatible = ti,omap3-mpu;
+   ti,hwmods = mpu;
+   };
+   };
+
+   /*
+* XXX: Use a flat representation of the dm816x interconnect.
+* The real dm816x interconnect network is quite complex. Since
+* it will not bring real advantage to represent that in DT
+* for the moment, just use a fake OCP bus entry to represent
+* the whole bus hierarchy.
+*/
+   ocp {
+   compatible = ti,omap3-l3-smx, simple-bus;
+   reg = 0x4400 0x1;
+   interrupts = 9 10;
+   #address-cells = 1;
+   #size-cells = 1;
+   ranges;
+   ti,hwmods = l3_main;
+
+   prcm: prcm@4818 {
+   compatible = ti,dm816-prcm;
+   reg = 0x4818 0x4000;
+
+   prcm_clocks: clocks {
+   #address-cells = 1;
+   #size-cells = 0;
+   };
+
+   prcm_clockdomains: clockdomains {
+   };
+   };
+
+   scrm: scrm@4814 {
+   compatible = ti,dm816-scrm;
+   reg = 0x4814 0x21000;
+   #address-cells = 1;
+   #size-cells = 1;
+   ranges = 0 0x4814 0x21000;
+
+   scrm_clocks: clocks {
+   #address-cells = 1;
+   #size-cells = 0;
+   };
+
+   scrm_clockdomains: clockdomains {
+   };
+   };
+
+   cm: syscon@44e1 {
+   compatible = ti,am33xx-controlmodule, syscon;
+   reg = 0x44e1 0x800;
+   };
+
+   edma: edma@4900 {
+   compatible = ti,edma3;
+   ti,hwmods = tpcc, tptc0, tptc1, tptc2, tptc3;
+   reg =   0x4900 0x1,
+   0x44e10f90 0x40;
+   interrupts = 12 13 14;
+   #dma-cells = 1;
+   };
+
+   elm: elm@4808 {
+   compatible = ti,816-elm;
+   ti,hwmods = elm;
+   reg = 0x4808 0x2000;
+   interrupts = 4;
+   };
+
+   gpio1: gpio@48032000 {
+   compatible = ti,omap3-gpio;
+   ti,hwmods = gpio1;
+   reg = 0x48032000 0x1000;
+   interrupts = 97;
+   };
+
+   gpio2: gpio@4804c000 {
+   compatible = ti,omap3-gpio;
+   ti,hwmods = gpio2;
+   reg = 0x4804c000 0x1000;
+   

[PATCH 3/4] ARM: dts: Add basic clocks for dm816x

2015-01-13 Thread Tony Lindgren
The clocks on dm816x are a bit different from the other omap
variants. The clocks are sourced from a FAPLL (Flying Adder PLL)
unlike on other omaps. Other than that, it's a similar setup
to am33xx with extra muxes and dividers that can be defined
as existing component clocks.

Cc: Brian Hutchinson b.hutch...@gmail.com
Cc: Paul Walmsley p...@pwsan.com
Cc: Tero Kristo t-kri...@ti.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/boot/dts/dm816x-clocks.dtsi | 250 +++
 arch/arm/boot/dts/dm816x.dtsi|   1 +
 2 files changed, 251 insertions(+)
 create mode 100644 arch/arm/boot/dts/dm816x-clocks.dtsi

diff --git a/arch/arm/boot/dts/dm816x-clocks.dtsi 
b/arch/arm/boot/dts/dm816x-clocks.dtsi
new file mode 100644
index 000..50d9d33
--- /dev/null
+++ b/arch/arm/boot/dts/dm816x-clocks.dtsi
@@ -0,0 +1,250 @@
+/*
+ * 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.
+ */
+
+scrm {
+   main_fapll: main_fapll {
+   #clock-cells = 1;
+   compatible = ti,dm816-fapll-clock;
+   reg = 0x400 0x40;
+   clocks = sys_clkin_ck sys_clkin_ck;
+   clock-indices = 1, 2, 3, 4, 5,
+   6, 7;
+   clock-output-names = main_pll_clk1,
+main_pll_clk2,
+main_pll_clk3,
+main_pll_clk4,
+main_pll_clk5,
+main_pll_clk6,
+main_pll_clk7;
+   };
+
+   ddr_fapll: ddr_fapll {
+   #clock-cells = 1;
+   compatible = ti,dm816-fapll-clock;
+   reg = 0x440 0x30;
+   clocks = sys_clkin_ck sys_clkin_ck;
+   clock-indices = 1, 2, 3, 4;
+   clock-output-names = ddr_pll_clk1,
+ddr_pll_clk2,
+ddr_pll_clk3,
+ddr_pll_clk4;
+   };
+
+   video_fapll: video_fapll {
+   #clock-cells = 1;
+   compatible = ti,dm816-fapll-clock;
+   reg = 0x470 0x30;
+   clocks = sys_clkin_ck sys_clkin_ck;
+   clock-indices = 1, 2, 3;
+   clock-output-names = video_pll_clk1,
+video_pll_clk2,
+video_pll_clk3;
+   };
+
+   audio_fapll: audio_fapll {
+   #clock-cells = 1;
+   compatible = ti,dm816-fapll-clock;
+   reg = 0x4a0 0x30;
+   clocks = main_fapll 7,  sys_clkin_ck;
+   clock-indices = 1, 2, 3, 4, 5;
+   clock-output-names = audio_pll_clk1,
+audio_pll_clk2,
+audio_pll_clk3,
+audio_pll_clk4,
+audio_pll_clk5;
+   };
+};
+
+scrm_clocks {
+   secure_32k_ck: secure_32k_ck {
+   #clock-cells = 0;
+   compatible = fixed-clock;
+   clock-frequency = 32768;
+   };
+
+   sys_32k_ck: sys_32k_ck {
+   #clock-cells = 0;
+   compatible = fixed-clock;
+   clock-frequency = 32768;
+   };
+
+   tclkin_ck: tclkin_ck {
+   #clock-cells = 0;
+   compatible = fixed-clock;
+   clock-frequency = 32768;
+   };
+
+   sys_clkin_ck: sys_clkin_ck {
+   #clock-cells = 0;
+   compatible = fixed-clock;
+   clock-frequency = 2700;
+   };
+};
+
+/* 0x4818 */
+prcm_clocks {
+   clkout_pre_ck: clkout_pre_ck {
+   #clock-cells = 0;
+   compatible = ti,mux-clock;
+   clocks = main_fapll 5 ddr_fapll 1 video_fapll 1
+ audio_fapll 1;
+   reg = 0x100;
+   };
+
+   clkout_div_ck: clkout_div_ck {
+   #clock-cells = 0;
+   compatible = ti,divider-clock;
+   clocks = clkout_pre_ck;
+   ti,bit-shift = 3;
+   ti,max-div = 8;
+   reg = 0x100;
+   };
+
+   clkout_ck: clkout_ck {
+   #clock-cells = 0;
+   compatible = ti,gate-clock;
+   clocks = clkout_div_ck;
+   ti,bit-shift = 7;
+   reg = 0x100;
+   };
+
+   /* CM_DPLL clocks p1795 */
+   sysclk1_ck: sysclk1_ck {
+   #clock-cells = 0;
+   compatible = ti,divider-clock;
+   clocks = main_fapll 1;
+   ti,max-div = 7;
+   reg = 0x0300;
+   };
+
+   sysclk2_ck: sysclk2_ck {
+   #clock-cells = 0;
+   compatible = 

[PATCH 4/4] ARM: dts: Add minimal support for dm8168-evm

2015-01-13 Thread Tony Lindgren
This allows booting the device with basic functionality.

Note that at least on my revision c board the DDR3 does
not seem to work properly and only some of the memory
can be reliably used.

Also, the mainline u-boot does not seem to properly
initialize the ethernet, so I've been using the old TI
u-boot at:

http://arago-project.org/git/projects/?p=u-boot-omap3.git;a=summary

Cc: Brian Hutchinson b.hutch...@gmail.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/boot/dts/Makefile   |   1 +
 arch/arm/boot/dts/dm8168-evm.dts | 105 +++
 2 files changed, 106 insertions(+)
 create mode 100644 arch/arm/boot/dts/dm8168-evm.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 91bd5bd..fe15c7a 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -348,6 +348,7 @@ dtb-$(CONFIG_ARCH_OMAP3) += am3517-craneboard.dtb \
omap3-sbc-t3730.dtb \
omap3-thunder.dtb \
omap3-zoom3.dtb
+dtb-$(CONFIG_SOC_TI81XX) += dm8168-evm.dtb
 dtb-$(CONFIG_SOC_AM33XX) += am335x-base0033.dtb \
am335x-bone.dtb \
am335x-boneblack.dtb \
diff --git a/arch/arm/boot/dts/dm8168-evm.dts b/arch/arm/boot/dts/dm8168-evm.dts
new file mode 100644
index 000..9acd4ff
--- /dev/null
+++ b/arch/arm/boot/dts/dm8168-evm.dts
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ */
+/dts-v1/;
+
+#include dm816x.dtsi
+
+/ {
+   model = DM8168 EVM;
+   compatible = ti,dm8168-evm, ti,dm8168;
+
+   memory {
+   device_type = memory;
+   reg = 0x8000 0x4000/* 1 GB */
+  0xc000 0x4000;  /* 1 GB */
+   };
+
+   /* FDC6331L controlled by SD_POW pin */
+   vmmcsd_fixed: fixedregulator@0 {
+   compatible = regulator-fixed;
+   regulator-name = vmmcsd_fixed;
+   regulator-min-microvolt = 330;
+   regulator-max-microvolt = 330;
+   };
+};
+
+i2c1 {
+   extgpio0: pcf8575@20 {
+   compatible = nxp,pcf8575;
+   reg = 0x20;
+   gpio-controller;
+   #gpio-cells = 2;
+   };
+};
+
+i2c2 {
+   extgpio1: pcf8575@20 {
+   compatible = nxp,pcf8575;
+   reg = 0x20;
+   gpio-controller;
+   #gpio-cells = 2;
+   };
+};
+
+gpmc {
+   ranges = 0 0 0x0400 0x0100;   /* CS0: 16MB for NAND */
+
+   nand@0,0 {
+   linux,mtd-name= micron,mt29f2g16aadwp;
+   reg = 0 0 4; /* CS0, offset 0, IO size 4 */
+   #address-cells = 1;
+   #size-cells = 1;
+   ti,nand-ecc-opt = bch8;
+   nand-bus-width = 16;
+   gpmc,device-width = 2;
+   gpmc,sync-clk-ps = 0;
+   gpmc,cs-on-ns = 0;
+   gpmc,cs-rd-off-ns = 44;
+   gpmc,cs-wr-off-ns = 44;
+   gpmc,adv-on-ns = 6;
+   gpmc,adv-rd-off-ns = 34;
+   gpmc,adv-wr-off-ns = 44;
+   gpmc,we-on-ns = 0;
+   gpmc,we-off-ns = 40;
+   gpmc,oe-on-ns = 0;
+   gpmc,oe-off-ns = 54;
+   gpmc,access-ns = 64;
+   gpmc,rd-cycle-ns = 82;
+   gpmc,wr-cycle-ns = 82;
+   gpmc,wait-on-read = true;
+   gpmc,wait-on-write = true;
+   gpmc,bus-turnaround-ns = 0;
+   gpmc,cycle2cycle-delay-ns = 0;
+   gpmc,clk-activation-ns = 0;
+   gpmc,wait-monitoring-ns = 0;
+   gpmc,wr-access-ns = 40;
+   gpmc,wr-data-mux-bus-ns = 0;
+   partition@0 {
+   label = X-Loader;
+   reg = 0 0x8;
+   };
+   partition@0x8 {
+   label = U-Boot;
+   reg = 0x8 0x1c;
+   };
+   partition@0x1c {
+   label = Environment;
+   reg = 0x24 0x4;
+   };
+   partition@0x28 {
+   label = Kernel;
+   reg = 0x28 0x50;
+   };
+   partition@0x78 {
+   label = Filesystem;
+   reg = 0x78 0xf88;
+   };
+   };
+};
+
+mmc1 {
+   vmmc-supply = vmmcsd_fixed;
+};
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4] ARM: OMAP2+: Add board-generic.c entry for ti81xx

2015-01-13 Thread Tony Lindgren
This allows booting ti81xx boards with with when a .dts
file is in place.

Cc: Brian Hutchinson b.hutch...@gmail.com
Signed-off-by: Tony Lindgren t...@atomide.com
---
 arch/arm/mach-omap2/board-generic.c | 34 ++
 1 file changed, 34 insertions(+)

diff --git a/arch/arm/mach-omap2/board-generic.c 
b/arch/arm/mach-omap2/board-generic.c
index 608079a..e95b8f7 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -142,6 +142,40 @@ DT_MACHINE_START(AM3517_DT, Generic AM3517 (Flattened 
Device Tree))
.dt_compat  = am3517_boards_compat,
.restart= omap3xxx_restart,
 MACHINE_END
+
+static const char *const ti814x_boards_compat[] __initconst = {
+   ti,dm8148,
+   ti,dm814,
+   NULL,
+};
+
+DT_MACHINE_START(TI81XX_DT, Generic ti814x (Flattened Device Tree))
+   .reserve= omap_reserve,
+   .map_io = ti81xx_map_io,
+   .init_early = ti814x_init_early,
+   .init_machine   = omap_generic_init,
+   .init_late  = ti81xx_init_late,
+   .init_time  = omap3_gptimer_timer_init,
+   .dt_compat  = ti814x_boards_compat,
+   .restart= ti81xx_restart,
+MACHINE_END
+
+static const char *const ti816x_boards_compat[] __initconst = {
+   ti,dm8168,
+   ti,dm816,
+   NULL,
+};
+
+DT_MACHINE_START(TI816X_DT, Generic ti816x (Flattened Device Tree))
+   .reserve= omap_reserve,
+   .map_io = ti81xx_map_io,
+   .init_early = ti816x_init_early,
+   .init_machine   = omap_generic_init,
+   .init_late  = ti81xx_init_late,
+   .init_time  = omap3_gptimer_timer_init,
+   .dt_compat  = ti816x_boards_compat,
+   .restart= ti81xx_restart,
+MACHINE_END
 #endif
 
 #ifdef CONFIG_SOC_AM33XX
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  1   2   >