* [RFC PATCH 0/7] usb: musb: add driver for control module
@ 2013-01-15 8:42 Kishon Vijay Abraham I
2013-01-15 8:42 ` [RFC PATCH 1/7] drivers: usb: phy: add a new driver for usb part of " Kishon Vijay Abraham I
` (6 more replies)
0 siblings, 7 replies; 21+ messages in thread
From: Kishon Vijay Abraham I @ 2013-01-15 8:42 UTC (permalink / raw)
To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ, b-cousson-l0cyMroinI0,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, rob-VoJi6FS/r0vR7s880joybQ,
linux-lFZ/pmaqli7XmaaqVzeoHQ, arnd-r2nGTMty4D4, balbi-l0cyMroinI0,
tony-4v6yS6AI5VpBDgjK7y7TUQ,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA
Cc: Kishon Vijay Abraham I
Added a new driver for the usb part of control module. This has an API
to power on the USB2 phy and an API to write to the mailbox depending on
whether MUSB has to act in host mode or in device mode.
Writing to control module registers for doing the above task which was
previously done in omap glue and in omap-usb2 phy is removed.
Also added the dt data to get MUSB working in OMAP platforms.
This series has patches for both drivers and ARCH folders, so If it has to
be split I'll do it.
This series was developed on
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git xceiv
Did basic enumeration testing in omap4 beagle, omap4 sdp and omap3 beagle.
Kishon Vijay Abraham I (7):
drivers: usb: phy: add a new driver for usb part of control module
ARM: OMAP: devices: create device for usb part of control module
ARM: OMAP2: MUSB: Specify omap4 has mailbox
drivers: usb: start using the control module driver
ARM: dts: omap: Add usb_otg and glue data
ARM: dts: omap: Add omap-usb2 dt data
ARM: dts: omap: Add omap control usb data
Documentation/devicetree/bindings/usb/omap-usb.txt | 25 ++-
Documentation/devicetree/bindings/usb/usb-phy.txt | 7 +-
arch/arm/boot/dts/omap3-beagle-xm.dts | 6 +
arch/arm/boot/dts/omap3-evm.dts | 6 +
arch/arm/boot/dts/omap3-overo.dtsi | 6 +
arch/arm/boot/dts/omap3.dtsi | 11 ++
arch/arm/boot/dts/omap4-panda.dts | 6 +
arch/arm/boot/dts/omap4-sdp.dts | 6 +
arch/arm/boot/dts/omap4.dtsi | 24 +++
arch/arm/mach-omap2/devices.c | 50 +++++
arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 13 --
arch/arm/mach-omap2/usb-musb.c | 3 +
drivers/usb/musb/Kconfig | 1 +
drivers/usb/musb/omap2430.c | 64 +++---
drivers/usb/musb/omap2430.h | 9 -
drivers/usb/phy/Kconfig | 10 +
drivers/usb/phy/Makefile | 1 +
drivers/usb/phy/omap-control-usb.c | 204 ++++++++++++++++++++
drivers/usb/phy/omap-usb2.c | 38 +---
include/linux/usb/musb.h | 2 +
include/linux/usb/omap_control_usb.h | 73 +++++++
include/linux/usb/omap_usb.h | 4 +-
22 files changed, 469 insertions(+), 100 deletions(-)
create mode 100644 drivers/usb/phy/omap-control-usb.c
create mode 100644 include/linux/usb/omap_control_usb.h
--
1.7.9.5
^ permalink raw reply [flat|nested] 21+ messages in thread
* [RFC PATCH 1/7] drivers: usb: phy: add a new driver for usb part of control module
2013-01-15 8:42 [RFC PATCH 0/7] usb: musb: add driver for control module Kishon Vijay Abraham I
@ 2013-01-15 8:42 ` Kishon Vijay Abraham I
[not found] ` <1358239378-10030-2-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
2013-01-15 8:42 ` [RFC PATCH 2/7] ARM: OMAP: devices: create device " Kishon Vijay Abraham I
` (5 subsequent siblings)
6 siblings, 1 reply; 21+ messages in thread
From: Kishon Vijay Abraham I @ 2013-01-15 8:42 UTC (permalink / raw)
To: grant.likely, b-cousson, rob.herring, rob, linux, arnd, balbi,
tony, devicetree-discuss, linux-doc, linux-kernel,
linux-arm-kernel, linux-usb, linux-omap
Cc: Kishon Vijay Abraham I
Added a new driver for the usb part of control module. This has an API
to power on the USB2 phy and an API to write to the mailbox depending on
whether MUSB has to act in host mode or in device mode.
Writing to control module registers for doing the above task which was
previously done in omap glue and in omap-usb2 phy will be removed.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
Documentation/devicetree/bindings/usb/omap-usb.txt | 21 +-
drivers/usb/phy/Kconfig | 9 +
drivers/usb/phy/Makefile | 1 +
drivers/usb/phy/omap-control-usb.c | 204 ++++++++++++++++++++
include/linux/usb/omap_control_usb.h | 73 +++++++
5 files changed, 307 insertions(+), 1 deletion(-)
create mode 100644 drivers/usb/phy/omap-control-usb.c
create mode 100644 include/linux/usb/omap_control_usb.h
diff --git a/Documentation/devicetree/bindings/usb/omap-usb.txt b/Documentation/devicetree/bindings/usb/omap-usb.txt
index 29a043e..d58dae3 100644
--- a/Documentation/devicetree/bindings/usb/omap-usb.txt
+++ b/Documentation/devicetree/bindings/usb/omap-usb.txt
@@ -1,4 +1,4 @@
-OMAP GLUE
+OMAP GLUE AND OTHER OMAP SPECIFIC COMPONENTS
OMAP MUSB GLUE
- compatible : Should be "ti,omap4-musb" or "ti,omap3-musb"
@@ -31,3 +31,22 @@ Board specific device node entry
mode = <3>;
power = <50>;
};
+
+OMAP CONTROL USB
+
+Required properties:
+ - compatible: Should be "ti,omap-control-usb"
+ - reg : Address and length of the register set for the device. It contains
+ the address of "control_dev_conf" and "otghs_control".
+ - reg-names: The names of the register addresses corresponding to the registers
+ filled in "reg".
+ - ti,has_mailbox: This is used to specify if the platform uses mailbox in
+ control module.
+
+omap_control_usb@4a002300 {
+ compatible = "ti,omap-control-usb";
+ reg = <0x4a002300 0x4>,
+ <0x4a00233c 0x4>;
+ reg-names = "control_dev_conf", "otghs_control";
+ ti,has_mailbox;
+};
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 5de6e7f..a7277ee 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -14,6 +14,15 @@ config OMAP_USB2
The USB OTG controller communicates with the comparator using this
driver.
+config OMAP_CONTROL_USB
+ tristate "OMAP CONTROL USB Driver"
+ depends on ARCH_OMAP2PLUS
+ help
+ Enable this to add support for the USB part present in the control
+ module. This driver has API to power on the PHY and to write to the
+ mailbox. The mailbox is present only in omap4 and the register to
+ power on the PHY is present in omap4 and omap5.
+
config USB_ISP1301
tristate "NXP ISP1301 USB transceiver support"
depends on USB || USB_GADGET
diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
index 1a579a8..0dea4d2 100644
--- a/drivers/usb/phy/Makefile
+++ b/drivers/usb/phy/Makefile
@@ -5,6 +5,7 @@
ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
obj-$(CONFIG_OMAP_USB2) += omap-usb2.o
+obj-$(CONFIG_OMAP_CONTROL_USB) += omap-control-usb.o
obj-$(CONFIG_USB_ISP1301) += isp1301.o
obj-$(CONFIG_MV_U3D_PHY) += mv_u3d_phy.o
obj-$(CONFIG_USB_EHCI_TEGRA) += tegra_usb_phy.o
diff --git a/drivers/usb/phy/omap-control-usb.c b/drivers/usb/phy/omap-control-usb.c
new file mode 100644
index 0000000..bed41a9
--- /dev/null
+++ b/drivers/usb/phy/omap-control-usb.c
@@ -0,0 +1,204 @@
+/*
+ * omap-control-usb.c - The USB part of control module.
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Author: Kishon Vijay Abraham I <kishon@ti.com>
+ *
+ * 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.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/of.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/usb/omap_control_usb.h>
+
+static struct omap_control_usb *control_usb;
+
+/**
+ * get_omap_control_dev - returns the device pointer for this control device
+ *
+ * This API should be called to get the device pointer for this control
+ * module device. This device pointer should be passed to all other API's
+ * in this driver.
+ *
+ * To be used by PHY driver and glue driver
+ */
+struct device *get_omap_control_dev(void)
+{
+ if (!control_usb)
+ return ERR_PTR(-ENODEV);
+
+ return control_usb->dev;
+}
+EXPORT_SYMBOL_GPL(get_omap_control_dev);
+
+/**
+ * omap_control_usb_phy_power - power on/off the phy using control module reg
+ * @dev: the control module device
+ * @on: 0 or 1, based on powering on or off the PHY
+ */
+void omap_control_usb_phy_power(struct device *dev, int on)
+{
+ u32 val;
+ struct omap_control_usb *control_usb = dev_get_drvdata(dev);
+
+ if (on) {
+ val = readl(control_usb->dev_conf);
+ if (val & PHY_PD)
+ writel(~PHY_PD, control_usb->dev_conf);
+ } else {
+ writel(PHY_PD, control_usb->dev_conf);
+ }
+}
+EXPORT_SYMBOL_GPL(omap_control_usb_phy_power);
+
+/**
+ * omap_control_usb_host_mode - set AVALID, VBUSVALID and ID pin in grounded
+ * @dev: struct device *
+ *
+ * This is an API to write to the mailbox register to notify the usb core that
+ * a usb device has been connected.
+ */
+void omap_control_usb_host_mode(struct device *dev)
+{
+ u32 val;
+ struct omap_control_usb *control_usb = dev_get_drvdata(dev);
+
+ val = AVALID | VBUSVALID;
+
+ writel(val, control_usb->otghs_control);
+}
+EXPORT_SYMBOL_GPL(omap_control_usb_host_mode);
+
+/**
+ * omap_control_usb_device_mode - set AVALID, VBUSVALID and ID pin in high
+ * impedance
+ * @dev: struct device *
+ *
+ * This is an API to write to the mailbox register to notify the usb core that
+ * it has been connected to a usb host.
+ */
+void omap_control_usb_device_mode(struct device *dev)
+{
+ u32 val;
+ struct omap_control_usb *control_usb = dev_get_drvdata(dev);
+
+ val = IDDIG | AVALID | VBUSVALID;
+
+ writel(val, control_usb->otghs_control);
+}
+EXPORT_SYMBOL_GPL(omap_control_usb_device_mode);
+
+/**
+ * omap_control_usb_set_sessionend - Enable SESSIONEND and IDIG to high
+ * impedance
+ * @dev: struct device *
+ *
+ * This is an API to write to the mailbox register to notify the usb core
+ * it's now in disconnected state.
+ */
+void omap_control_usb_set_sessionend(struct device *dev)
+{
+ u32 val;
+ struct omap_control_usb *control_usb = dev_get_drvdata(dev);
+
+ val = SESSEND | IDDIG;
+
+ writel(val, control_usb->otghs_control);
+}
+EXPORT_SYMBOL_GPL(omap_control_usb_set_sessionend);
+
+static int omap_control_usb_probe(struct platform_device *pdev)
+{
+ struct resource *res;
+ struct device_node *np = pdev->dev.of_node;
+ struct omap_control_usb_platform_data *pdata = pdev->dev.platform_data;
+
+ control_usb = devm_kzalloc(&pdev->dev, sizeof(*control_usb),
+ GFP_KERNEL);
+ if (!control_usb) {
+ dev_err(&pdev->dev, "unable to alloc memory for control usb\n");
+ return -ENOMEM;
+ }
+
+ if (np) {
+ control_usb->has_mailbox = of_property_read_bool(np,
+ "ti,has_mailbox");
+ } else if (pdata) {
+ control_usb->has_mailbox = pdata->has_mailbox;
+ } else {
+ dev_err(&pdev->dev, "no pdata present\n");
+ return -EINVAL;
+ }
+
+ control_usb->dev = &pdev->dev;
+
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+ "control_dev_conf");
+ control_usb->dev_conf = devm_request_and_ioremap(&pdev->dev, res);
+ if (control_usb->dev_conf == NULL) {
+ dev_err(&pdev->dev, "Failed to obtain io memory\n");
+ return -ENXIO;
+ }
+
+ if (control_usb->has_mailbox) {
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+ "otghs_control");
+ control_usb->otghs_control = devm_request_and_ioremap(
+ &pdev->dev, res);
+ if (control_usb->otghs_control == NULL) {
+ dev_err(&pdev->dev, "Failed to obtain io memory\n");
+ return -ENXIO;
+ }
+ }
+
+ dev_set_drvdata(control_usb->dev, control_usb);
+
+ return 0;
+}
+
+#ifdef CONFIG_OF
+static const struct of_device_id omap_control_usb_id_table[] = {
+ { .compatible = "ti,omap-control-usb" },
+ {}
+};
+MODULE_DEVICE_TABLE(of, omap_control_usb_id_table);
+#endif
+
+static struct platform_driver omap_control_usb_driver = {
+ .probe = omap_control_usb_probe,
+ .driver = {
+ .name = "omap-control-usb",
+ .owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(omap_control_usb_id_table),
+ },
+};
+
+static int __init omap_control_usb_init(void)
+{
+ return platform_driver_register(&omap_control_usb_driver);
+}
+subsys_initcall(omap_control_usb_init);
+
+static void __exit omap_control_usb_exit(void)
+{
+ platform_driver_unregister(&omap_control_usb_driver);
+}
+module_exit(omap_control_usb_exit);
+
+MODULE_ALIAS("platform: omap_control_usb");
+MODULE_AUTHOR("Texas Instruments Inc.");
+MODULE_DESCRIPTION("OMAP CONTROL USB DRIVER");
+MODULE_LICENSE("GPL v2");
diff --git a/include/linux/usb/omap_control_usb.h b/include/linux/usb/omap_control_usb.h
new file mode 100644
index 0000000..fbc7407
--- /dev/null
+++ b/include/linux/usb/omap_control_usb.h
@@ -0,0 +1,73 @@
+/*
+ * omap_control_usb.h - Header file for the USB part of control module.
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Author: Kishon Vijay Abraham I <kishon@ti.com>
+ *
+ * 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.
+ *
+ */
+
+#ifndef __OMAP_CONTROL_USB_H__
+#define __OMAP_CONTROL_USB_H__
+
+struct omap_control_usb {
+ struct device *dev;
+
+ u32 __iomem *dev_conf;
+ u32 __iomem *otghs_control;
+
+ u8 has_mailbox:1;
+};
+
+struct omap_control_usb_platform_data {
+ u8 has_mailbox:1;
+};
+
+#define PHY_PD BIT(0)
+
+#define AVALID BIT(0)
+#define BVALID BIT(1)
+#define VBUSVALID BIT(2)
+#define SESSEND BIT(3)
+#define IDDIG BIT(4)
+
+#if (defined(CONFIG_OMAP_CONTROL_USB) || \
+ defined(CONFIG_OMAP_CONTROL_USB_MODULE))
+extern struct device *get_omap_control_dev(void);
+extern void omap_control_usb_phy_power(struct device *dev, int on);
+extern void omap_control_usb_host_mode(struct device *dev);
+extern void omap_control_usb_device_mode(struct device *dev);
+extern void omap_control_usb_set_sessionend(struct device *dev);
+#else
+static inline struct device *get_omap_control_dev()
+{
+ return ERR_PTR(-ENODEV);
+}
+
+static inline void omap_control_usb_phy_power(struct device *dev, int on)
+{
+}
+
+static inline void omap_control_usb_host_mode(struct device *dev)
+{
+}
+
+static inline void omap_control_usb_device_mode(struct device *dev)
+{
+}
+
+static inline void omap_control_usb_set_sessionend(struct device *dev)
+{
+}
+#endif
+
+#endif /* __OMAP_CONTROL_USB_H__ */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [RFC PATCH 2/7] ARM: OMAP: devices: create device for usb part of control module
2013-01-15 8:42 [RFC PATCH 0/7] usb: musb: add driver for control module Kishon Vijay Abraham I
2013-01-15 8:42 ` [RFC PATCH 1/7] drivers: usb: phy: add a new driver for usb part of " Kishon Vijay Abraham I
@ 2013-01-15 8:42 ` Kishon Vijay Abraham I
2013-01-15 12:53 ` Sergei Shtylyov
2013-01-15 8:42 ` [RFC PATCH 4/7] drivers: usb: start using the control module driver Kishon Vijay Abraham I
` (4 subsequent siblings)
6 siblings, 1 reply; 21+ messages in thread
From: Kishon Vijay Abraham I @ 2013-01-15 8:42 UTC (permalink / raw)
To: grant.likely, b-cousson, rob.herring, rob, linux, arnd, balbi,
tony, devicetree-discuss, linux-doc, linux-kernel,
linux-arm-kernel, linux-usb, linux-omap
Cc: Kishon Vijay Abraham I
A seperate driver has been added to handle the usb part of control
module. A device for the above driver is created here, using the register
address information to be used by the driver for powering on the PHY and
for writing to the mailbox.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
arch/arm/mach-omap2/devices.c | 50 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 5e304d0..a761faf4 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -20,6 +20,7 @@
#include <linux/pinctrl/machine.h>
#include <linux/platform_data/omap4-keypad.h>
#include <linux/platform_data/omap_ocp2scp.h>
+#include <linux/usb/omap_control_usb.h>
#include <asm/mach-types.h>
#include <asm/mach/map.h>
@@ -254,6 +255,54 @@ static inline void omap_init_camera(void)
#endif
}
+#if (defined(CONFIG_OMAP_CONTROL_USB) || \
+ defined(CONFIG_OMAP_CONTROL_USB_MODULE))
+
+static struct omap_control_usb_platform_data omap4_control_usb_pdata = {
+ .has_mailbox = true,
+};
+
+struct resource omap4_control_usb_res[] = {
+ {
+ .name = "control_dev_conf",
+ .start = 0x4a002300,
+ .end = 0x4a002303,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "otghs_control",
+ .start = 0x4a00233c,
+ .end = 0x4a00233f,
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+static struct platform_device omap4_control_usb = {
+ .name = "omap-control-usb",
+ .id = -1,
+ .dev = {
+ .platform_data = &omap4_control_usb_pdata,
+ },
+ .num_resources = 2,
+ .resource = omap4_control_usb_res,
+};
+
+static inline void __init omap_init_control_usb(void)
+{
+ int ret = 0;
+
+ if (cpu_is_omap44xx()) {
+ ret = platform_device_register(&omap4_control_usb);
+ if (ret)
+ pr_err("Error registering omap_control_usb device: %d\n"
+ , ret);
+ }
+}
+
+#else
+static inline void omap_init_control_usb(void) { }
+#endif /* CONFIG_OMAP_CONTROL_USB */
+
int __init omap4_keyboard_init(struct omap4_keypad_platform_data
*sdp4430_keypad_data, struct omap_board_data *bdata)
{
@@ -721,6 +770,7 @@ static int __init omap2_init_devices(void)
omap_init_mbox();
/* If dtb is there, the devices will be created dynamically */
if (!of_have_populated_dt()) {
+ omap_init_control_usb();
omap_init_dmic();
omap_init_mcpdm();
omap_init_mcspi();
--
1.7.9.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [RFC PATCH 3/7] ARM: OMAP2: MUSB: Specify omap4 has mailbox
[not found] ` <1358239378-10030-1-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
@ 2013-01-15 8:42 ` Kishon Vijay Abraham I
2013-01-15 8:42 ` [RFC PATCH 5/7] ARM: dts: omap: Add usb_otg and glue data Kishon Vijay Abraham I
2013-01-15 8:42 ` [RFC PATCH 7/7] ARM: dts: omap: Add omap control usb data Kishon Vijay Abraham I
2 siblings, 0 replies; 21+ messages in thread
From: Kishon Vijay Abraham I @ 2013-01-15 8:42 UTC (permalink / raw)
To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ, b-cousson-l0cyMroinI0,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, rob-VoJi6FS/r0vR7s880joybQ,
linux-lFZ/pmaqli7XmaaqVzeoHQ, arnd-r2nGTMty4D4, balbi-l0cyMroinI0,
tony-4v6yS6AI5VpBDgjK7y7TUQ,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA
Cc: Kishon Vijay Abraham I
Added has_mailbox to the musb platform data to specify that omap uses
an external mailbox (in control module) to communicate with the musb
core during device connect and disconnect.
Signed-off-by: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
---
arch/arm/mach-omap2/usb-musb.c | 3 +++
include/linux/usb/musb.h | 2 ++
2 files changed, 5 insertions(+)
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 7b33b37..9d27e3f 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -85,6 +85,9 @@ 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 (cpu_is_omap44xx())
+ musb_plat.has_mailbox = true;
+
if (soc_is_am35xx()) {
oh_name = "am35x_otg_hs";
name = "musb-am35x";
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index eb50525..053c268 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -99,6 +99,8 @@ struct musb_hdrc_platform_data {
/* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */
u8 mode;
+ u8 has_mailbox:1;
+
/* for clk_get() */
const char *clock;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [RFC PATCH 4/7] drivers: usb: start using the control module driver
2013-01-15 8:42 [RFC PATCH 0/7] usb: musb: add driver for control module Kishon Vijay Abraham I
2013-01-15 8:42 ` [RFC PATCH 1/7] drivers: usb: phy: add a new driver for usb part of " Kishon Vijay Abraham I
2013-01-15 8:42 ` [RFC PATCH 2/7] ARM: OMAP: devices: create device " Kishon Vijay Abraham I
@ 2013-01-15 8:42 ` Kishon Vijay Abraham I
2013-01-15 8:42 ` [RFC PATCH 6/7] ARM: dts: omap: Add omap-usb2 dt data Kishon Vijay Abraham I
` (3 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: Kishon Vijay Abraham I @ 2013-01-15 8:42 UTC (permalink / raw)
To: grant.likely, b-cousson, rob.herring, rob, linux, arnd, balbi,
tony, devicetree-discuss, linux-doc, linux-kernel,
linux-arm-kernel, linux-usb, linux-omap
Cc: Kishon Vijay Abraham I
Start using the control module driver for powering on the PHY and for
writing to the mailbox instead of writing to the control module
registers on their own.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
Documentation/devicetree/bindings/usb/omap-usb.txt | 4 ++
Documentation/devicetree/bindings/usb/usb-phy.txt | 7 +--
arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 13 ----
drivers/usb/musb/Kconfig | 1 +
drivers/usb/musb/omap2430.c | 64 ++++++++------------
drivers/usb/musb/omap2430.h | 9 ---
drivers/usb/phy/Kconfig | 1 +
drivers/usb/phy/omap-usb2.c | 38 +++---------
include/linux/usb/omap_usb.h | 4 +-
9 files changed, 42 insertions(+), 99 deletions(-)
diff --git a/Documentation/devicetree/bindings/usb/omap-usb.txt b/Documentation/devicetree/bindings/usb/omap-usb.txt
index d58dae3..3f0152b 100644
--- a/Documentation/devicetree/bindings/usb/omap-usb.txt
+++ b/Documentation/devicetree/bindings/usb/omap-usb.txt
@@ -3,6 +3,9 @@ OMAP GLUE AND OTHER OMAP SPECIFIC COMPONENTS
OMAP MUSB GLUE
- compatible : Should be "ti,omap4-musb" or "ti,omap3-musb"
- ti,hwmods : must be "usb_otg_hs"
+ - ti,has_mailbox : to specify that omap uses an external mailbox
+ (in control module) to communicate with the musb core during device connect
+ and disconnect.
- multipoint : Should be "1" indicating the musb controller supports
multipoint. This is a MUSB configuration-specific setting.
- num_eps : Specifies the number of endpoints. This is also a
@@ -20,6 +23,7 @@ SOC specific device node entry
usb_otg_hs: usb_otg_hs@4a0ab000 {
compatible = "ti,omap4-musb";
ti,hwmods = "usb_otg_hs";
+ ti,has_mailbox;
multipoint = <1>;
num_eps = <16>;
ram_bits = <12>;
diff --git a/Documentation/devicetree/bindings/usb/usb-phy.txt b/Documentation/devicetree/bindings/usb/usb-phy.txt
index 80d4148..ee14cb7 100644
--- a/Documentation/devicetree/bindings/usb/usb-phy.txt
+++ b/Documentation/devicetree/bindings/usb/usb-phy.txt
@@ -4,14 +4,11 @@ OMAP USB2 PHY
Required properties:
- compatible: Should be "ti,omap-usb2"
- - reg : Address and length of the register set for the device. Also
-add the address of control module dev conf register until a driver for
-control module is added
+ - reg : Address and length of the register set for the device.
This is usually a subnode of ocp2scp to which it is connected.
usb2phy@4a0ad080 {
compatible = "ti,omap-usb2";
- reg = <0x4a0ad080 0x58>,
- <0x4a002300 0x4>;
+ reg = <0x4a0ad080 0x58>;
};
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 129d508..103f4ba 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -2698,13 +2698,6 @@ static struct resource omap44xx_usb_phy_and_pll_addrs[] = {
.end = 0x4a0ae000,
.flags = IORESOURCE_MEM,
},
- {
- /* XXX: Remove this once control module driver is in place */
- .name = "ctrl_dev",
- .start = 0x4a002300,
- .end = 0x4a002303,
- .flags = IORESOURCE_MEM,
- },
{ }
};
@@ -6152,12 +6145,6 @@ static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = {
.pa_end = 0x4a0ab7ff,
.flags = ADDR_TYPE_RT
},
- {
- /* XXX: Remove this once control module driver is in place */
- .pa_start = 0x4a00233c,
- .pa_end = 0x4a00233f,
- .flags = ADDR_TYPE_RT
- },
{ }
};
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
index 23a0b7f..de6e5ce 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -11,6 +11,7 @@ config USB_MUSB_HDRC
select NOP_USB_XCEIV if (SOC_TI81XX || SOC_AM33XX)
select TWL4030_USB if MACH_OMAP_3430SDP
select TWL6030_USB if MACH_OMAP_4430SDP || MACH_OMAP4_PANDA
+ select OMAP_CONTROL_USB if MACH_OMAP_4430SDP || MACH_OMAP4_PANDA
select USB_OTG_UTILS
help
Say Y here if your system has a dual role high speed USB
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index da00af4..3e7ceef 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -37,6 +37,7 @@
#include <linux/err.h>
#include <linux/delay.h>
#include <linux/usb/musb-omap.h>
+#include <linux/usb/omap_control_usb.h>
#include "musb_core.h"
#include "omap2430.h"
@@ -46,7 +47,7 @@ struct omap2430_glue {
struct platform_device *musb;
enum omap_musb_vbus_id_status status;
struct work_struct omap_musb_mailbox_work;
- u32 __iomem *control_otghs;
+ struct device *control_otghs;
};
#define glue_to_musb(g) platform_get_drvdata(g->musb)
@@ -54,26 +55,6 @@ struct omap2430_glue *_glue;
static struct timer_list musb_idle_timer;
-/**
- * omap4_usb_phy_mailbox - write to usb otg mailbox
- * @glue: struct omap2430_glue *
- * @val: the value to be written to the mailbox
- *
- * On detection of a device (ID pin is grounded), this API should be called
- * to set AVALID, VBUSVALID and ID pin is grounded.
- *
- * When OMAP is connected to a host (OMAP in device mode), this API
- * is called to set AVALID, VBUSVALID and ID pin in high impedance.
- *
- * XXX: This function will be removed once we have a seperate driver for
- * control module
- */
-static void omap4_usb_phy_mailbox(struct omap2430_glue *glue, u32 val)
-{
- if (glue->control_otghs)
- writel(val, glue->control_otghs);
-}
-
static void musb_do_idle(unsigned long _musb)
{
struct musb *musb = (void *)_musb;
@@ -269,7 +250,6 @@ EXPORT_SYMBOL_GPL(omap_musb_mailbox);
static void omap_musb_set_mailbox(struct omap2430_glue *glue)
{
- u32 val;
struct musb *musb = glue_to_musb(glue);
struct device *dev = musb->controller;
struct musb_hdrc_platform_data *pdata = dev->platform_data;
@@ -285,8 +265,8 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue)
musb->xceiv->last_event = USB_EVENT_ID;
if (musb->gadget_driver) {
pm_runtime_get_sync(dev);
- val = AVALID | VBUSVALID;
- omap4_usb_phy_mailbox(glue, val);
+ if (!IS_ERR(glue->control_otghs))
+ omap_control_usb_host_mode(glue->control_otghs);
omap2430_musb_set_vbus(musb, 1);
}
break;
@@ -299,8 +279,8 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue)
musb->xceiv->last_event = USB_EVENT_VBUS;
if (musb->gadget_driver)
pm_runtime_get_sync(dev);
- val = IDDIG | AVALID | VBUSVALID;
- omap4_usb_phy_mailbox(glue, val);
+ if (!IS_ERR(glue->control_otghs))
+ omap_control_usb_device_mode(glue->control_otghs);
break;
case OMAP_MUSB_ID_FLOAT:
@@ -317,8 +297,8 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue)
if (musb->xceiv->otg->set_vbus)
otg_set_vbus(musb->xceiv->otg, 0);
}
- val = SESSEND | IDDIG;
- omap4_usb_phy_mailbox(glue, val);
+ if (!IS_ERR(glue->control_otghs))
+ omap_control_usb_set_sessionend(glue->control_otghs);
break;
default:
dev_dbg(dev, "ID float\n");
@@ -415,7 +395,6 @@ err1:
static void omap2430_musb_enable(struct musb *musb)
{
u8 devctl;
- u32 val;
unsigned long timeout = jiffies + msecs_to_jiffies(1000);
struct device *dev = musb->controller;
struct omap2430_glue *glue = dev_get_drvdata(dev->parent);
@@ -425,8 +404,8 @@ static void omap2430_musb_enable(struct musb *musb)
switch (glue->status) {
case OMAP_MUSB_ID_GROUND:
- val = AVALID | VBUSVALID;
- omap4_usb_phy_mailbox(glue, val);
+ if (!IS_ERR(glue->control_otghs))
+ omap_control_usb_host_mode(glue->control_otghs);
if (data->interface_type != MUSB_INTERFACE_UTMI)
break;
devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
@@ -445,8 +424,8 @@ static void omap2430_musb_enable(struct musb *musb)
break;
case OMAP_MUSB_VBUS_VALID:
- val = IDDIG | AVALID | VBUSVALID;
- omap4_usb_phy_mailbox(glue, val);
+ if (!IS_ERR(glue->control_otghs))
+ omap_control_usb_device_mode(glue->control_otghs);
break;
default:
@@ -456,13 +435,12 @@ static void omap2430_musb_enable(struct musb *musb)
static void omap2430_musb_disable(struct musb *musb)
{
- u32 val;
struct device *dev = musb->controller;
struct omap2430_glue *glue = dev_get_drvdata(dev->parent);
if (glue->status != OMAP_MUSB_UNKNOWN) {
- val = SESSEND | IDDIG;
- omap4_usb_phy_mailbox(glue, val);
+ if (!IS_ERR(glue->control_otghs))
+ omap_control_usb_set_sessionend(glue->control_otghs);
}
}
@@ -523,9 +501,6 @@ static int omap2430_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- glue->control_otghs = devm_request_and_ioremap(&pdev->dev, res);
- if (glue->control_otghs == NULL)
- dev_dbg(&pdev->dev, "Failed to obtain control memory\n");
if (np) {
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
@@ -558,11 +533,22 @@ static int omap2430_probe(struct platform_device *pdev)
of_property_read_u32(np, "ram_bits", (u32 *)&config->ram_bits);
of_property_read_u32(np, "power", (u32 *)&pdata->power);
config->multipoint = of_property_read_bool(np, "multipoint");
+ pdata->has_mailbox = of_property_read_bool(np,
+ "ti,has_mailbox");
pdata->board_data = data;
pdata->config = config;
}
+ if (pdata->has_mailbox) {
+ glue->control_otghs = get_omap_control_dev();
+ if (IS_ERR(glue->control_otghs)) {
+ dev_vdbg(&pdev->dev, "Failed to get control device\n");
+ return -ENODEV;
+ }
+ } else {
+ glue->control_otghs = ERR_PTR(-ENODEV);
+ }
pdata->platform_ops = &omap2430_ops;
platform_set_drvdata(pdev, glue);
diff --git a/drivers/usb/musb/omap2430.h b/drivers/usb/musb/omap2430.h
index 8ef6566..1b5e83a 100644
--- a/drivers/usb/musb/omap2430.h
+++ b/drivers/usb/musb/omap2430.h
@@ -49,13 +49,4 @@
#define OTG_FORCESTDBY 0x414
# define ENABLEFORCE (1 << 0)
-/*
- * Control Module bit definitions
- * XXX: Will be removed once we have a driver for control module.
- */
-#define AVALID BIT(0)
-#define BVALID BIT(1)
-#define VBUSVALID BIT(2)
-#define SESSEND BIT(3)
-#define IDDIG BIT(4)
#endif /* __MUSB_OMAP243X_H__ */
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index a7277ee..16bdaca 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -8,6 +8,7 @@ config OMAP_USB2
tristate "OMAP USB2 PHY Driver"
depends on ARCH_OMAP2PLUS
select USB_OTG_UTILS
+ select OMAP_CONTROL_USB
help
Enable this to support the transceiver that is part of SOC. This
driver takes care of all the PHY functionality apart from comparator.
diff --git a/drivers/usb/phy/omap-usb2.c b/drivers/usb/phy/omap-usb2.c
index 26ae8f4..2152ce4 100644
--- a/drivers/usb/phy/omap-usb2.c
+++ b/drivers/usb/phy/omap-usb2.c
@@ -27,6 +27,7 @@
#include <linux/err.h>
#include <linux/pm_runtime.h>
#include <linux/delay.h>
+#include <linux/usb/omap_control_usb.h>
/**
* omap_usb2_set_comparator - links the comparator present in the sytem with
@@ -52,29 +53,6 @@ int omap_usb2_set_comparator(struct phy_companion *comparator)
}
EXPORT_SYMBOL_GPL(omap_usb2_set_comparator);
-/**
- * omap_usb_phy_power - power on/off the phy using control module reg
- * @phy: struct omap_usb *
- * @on: 0 or 1, based on powering on or off the PHY
- *
- * XXX: Remove this function once control module driver gets merged
- */
-static void omap_usb_phy_power(struct omap_usb *phy, int on)
-{
- u32 val;
-
- if (on) {
- val = readl(phy->control_dev);
- if (val & PHY_PD) {
- writel(~PHY_PD, phy->control_dev);
- /* XXX: add proper documentation for this delay */
- mdelay(200);
- }
- } else {
- writel(PHY_PD, phy->control_dev);
- }
-}
-
static int omap_usb_set_vbus(struct usb_otg *otg, bool enabled)
{
struct omap_usb *phy = phy_to_omapusb(otg->phy);
@@ -124,7 +102,7 @@ static int omap_usb2_suspend(struct usb_phy *x, int suspend)
struct omap_usb *phy = phy_to_omapusb(x);
if (suspend && !phy->is_suspended) {
- omap_usb_phy_power(phy, 0);
+ omap_control_usb_phy_power(phy->control_dev, 0);
pm_runtime_put_sync(phy->dev);
phy->is_suspended = 1;
} else if (!suspend && phy->is_suspended) {
@@ -134,7 +112,7 @@ static int omap_usb2_suspend(struct usb_phy *x, int suspend)
ret);
return ret;
}
- omap_usb_phy_power(phy, 1);
+ omap_control_usb_phy_power(phy->control_dev, 1);
phy->is_suspended = 0;
}
@@ -168,14 +146,14 @@ static int omap_usb2_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- phy->control_dev = devm_request_and_ioremap(&pdev->dev, res);
- if (phy->control_dev == NULL) {
- dev_err(&pdev->dev, "Failed to obtain io memory\n");
- return -ENXIO;
+ phy->control_dev = get_omap_control_dev();
+ if (IS_ERR(phy->control_dev)) {
+ dev_dbg(&pdev->dev, "Failed to get control device\n");
+ return -ENODEV;
}
phy->is_suspended = 1;
- omap_usb_phy_power(phy, 0);
+ omap_control_usb_phy_power(phy->control_dev, 0);
otg->set_host = omap_usb_set_host;
otg->set_peripheral = omap_usb_set_peripheral;
diff --git a/include/linux/usb/omap_usb.h b/include/linux/usb/omap_usb.h
index 0ea17f8..3db9b53 100644
--- a/include/linux/usb/omap_usb.h
+++ b/include/linux/usb/omap_usb.h
@@ -25,13 +25,11 @@ struct omap_usb {
struct usb_phy phy;
struct phy_companion *comparator;
struct device *dev;
- u32 __iomem *control_dev;
+ struct device *control_dev;
struct clk *wkupclk;
u8 is_suspended:1;
};
-#define PHY_PD 0x1
-
#define phy_to_omapusb(x) container_of((x), struct omap_usb, phy)
#if defined(CONFIG_OMAP_USB2) || defined(CONFIG_OMAP_USB2_MODULE)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [RFC PATCH 5/7] ARM: dts: omap: Add usb_otg and glue data
[not found] ` <1358239378-10030-1-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
2013-01-15 8:42 ` [RFC PATCH 3/7] ARM: OMAP2: MUSB: Specify omap4 has mailbox Kishon Vijay Abraham I
@ 2013-01-15 8:42 ` Kishon Vijay Abraham I
2013-01-15 8:42 ` [RFC PATCH 7/7] ARM: dts: omap: Add omap control usb data Kishon Vijay Abraham I
2 siblings, 0 replies; 21+ messages in thread
From: Kishon Vijay Abraham I @ 2013-01-15 8:42 UTC (permalink / raw)
To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ, b-cousson-l0cyMroinI0,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, rob-VoJi6FS/r0vR7s880joybQ,
linux-lFZ/pmaqli7XmaaqVzeoHQ, arnd-r2nGTMty4D4, balbi-l0cyMroinI0,
tony-4v6yS6AI5VpBDgjK7y7TUQ,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA
Cc: Kishon Vijay Abraham I
Add usb otg data node in omap4/omap3 device tree file. Also update
the node with board specific setting in omapx-<board>.dts file.
The dt data specifies among others the interface type (ULPI or UTMI), mode
which is mostly OTG, power that specifies the amount of power this can supply
when in host mode.
Acked-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
Signed-off-by: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
---
arch/arm/boot/dts/omap3-beagle-xm.dts | 6 ++++++
arch/arm/boot/dts/omap3-evm.dts | 6 ++++++
arch/arm/boot/dts/omap3-overo.dtsi | 6 ++++++
arch/arm/boot/dts/omap3.dtsi | 11 +++++++++++
arch/arm/boot/dts/omap4-panda.dts | 6 ++++++
arch/arm/boot/dts/omap4-sdp.dts | 6 ++++++
arch/arm/boot/dts/omap4.dtsi | 12 ++++++++++++
7 files changed, 53 insertions(+)
diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
index 3705a81..cb07583 100644
--- a/arch/arm/boot/dts/omap3-beagle-xm.dts
+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
@@ -107,3 +107,9 @@
*/
ti,pulldowns = <0x03a1c4>;
};
+
+&usb_otg_hs {
+ interface_type = <0>;
+ mode = <3>;
+ power = <50>;
+};
diff --git a/arch/arm/boot/dts/omap3-evm.dts b/arch/arm/boot/dts/omap3-evm.dts
index e8ba1c2..afb9ba9 100644
--- a/arch/arm/boot/dts/omap3-evm.dts
+++ b/arch/arm/boot/dts/omap3-evm.dts
@@ -59,3 +59,9 @@
&twl_gpio {
ti,use-leds;
};
+
+&usb_otg_hs {
+ interface_type = <0>;
+ mode = <3>;
+ power = <50>;
+};
diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi
index 89808ce..4b3d157 100644
--- a/arch/arm/boot/dts/omap3-overo.dtsi
+++ b/arch/arm/boot/dts/omap3-overo.dtsi
@@ -55,3 +55,9 @@
&twl_gpio {
ti,use-leds;
};
+
+&usb_otg_hs {
+ interface_type = <0>;
+ mode = <3>;
+ power = <50>;
+};
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 1acc261..8d03736 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -397,5 +397,16 @@
ti,timer-alwon;
ti,timer-secure;
};
+
+ usb_otg_hs: usb_otg_hs@480ab000 {
+ compatible = "ti,omap3-musb";
+ reg = <0x480ab000 0x1000>;
+ interrupts = <0 92 0x4>, <0 93 0x4>;
+ interrupt-names = "mc", "dma";
+ ti,hwmods = "usb_otg_hs";
+ multipoint = <1>;
+ num_eps = <16>;
+ ram_bits = <12>;
+ };
};
};
diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts
index 4122efe..612c9bb 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -206,3 +206,9 @@
&twl_usb_comparator {
usb-supply = <&vusb>;
};
+
+&usb_otg_hs {
+ interface_type = <1>;
+ mode = <3>;
+ power = <50>;
+};
diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 43e5258..582d7ee 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -428,3 +428,9 @@
&twl_usb_comparator {
usb-supply = <&vusb>;
};
+
+&usb_otg_hs {
+ interface_type = <1>;
+ mode = <3>;
+ power = <50>;
+};
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 739bb79..7bbf1fb 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -529,5 +529,17 @@
ti,hwmods = "timer11";
ti,timer-pwm;
};
+
+ usb_otg_hs: usb_otg_hs@4a0ab000 {
+ compatible = "ti,omap4-musb";
+ reg = <0x4a0ab000 0x7ff>;
+ interrupts = <0 92 0x4>, <0 93 0x4>;
+ interrupt-names = "mc", "dma";
+ ti,hwmods = "usb_otg_hs";
+ multipoint = <1>;
+ num_eps = <16>;
+ ram_bits = <12>;
+ ti,has_mailbox;
+ };
};
};
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [RFC PATCH 6/7] ARM: dts: omap: Add omap-usb2 dt data
2013-01-15 8:42 [RFC PATCH 0/7] usb: musb: add driver for control module Kishon Vijay Abraham I
` (2 preceding siblings ...)
2013-01-15 8:42 ` [RFC PATCH 4/7] drivers: usb: start using the control module driver Kishon Vijay Abraham I
@ 2013-01-15 8:42 ` Kishon Vijay Abraham I
[not found] ` <1358239378-10030-1-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
` (2 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: Kishon Vijay Abraham I @ 2013-01-15 8:42 UTC (permalink / raw)
To: grant.likely, b-cousson, rob.herring, rob, linux, arnd, balbi,
tony, devicetree-discuss, linux-doc, linux-kernel,
linux-arm-kernel, linux-usb, linux-omap
Cc: Kishon Vijay Abraham I
Add omap-usb2 data node in omap4 device tree file. Since omap-usb2 is
connected to ocp2scp, omap-usb2 dt data is added as a child node
of ocp2scp.
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
arch/arm/boot/dts/omap4.dtsi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 7bbf1fb..b7e2ba3 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -438,6 +438,10 @@
#size-cells = <1>;
ranges;
ti,hwmods = "ocp2scp_usb_phy";
+ usb2phy@4a0ad080 {
+ compatible = "ti,omap-usb2";
+ reg = <0x4a0ad080 0x58>;
+ };
};
timer1: timer@4a318000 {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [RFC PATCH 7/7] ARM: dts: omap: Add omap control usb data
[not found] ` <1358239378-10030-1-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
2013-01-15 8:42 ` [RFC PATCH 3/7] ARM: OMAP2: MUSB: Specify omap4 has mailbox Kishon Vijay Abraham I
2013-01-15 8:42 ` [RFC PATCH 5/7] ARM: dts: omap: Add usb_otg and glue data Kishon Vijay Abraham I
@ 2013-01-15 8:42 ` Kishon Vijay Abraham I
2 siblings, 0 replies; 21+ messages in thread
From: Kishon Vijay Abraham I @ 2013-01-15 8:42 UTC (permalink / raw)
To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ, b-cousson-l0cyMroinI0,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, rob-VoJi6FS/r0vR7s880joybQ,
linux-lFZ/pmaqli7XmaaqVzeoHQ, arnd-r2nGTMty4D4, balbi-l0cyMroinI0,
tony-4v6yS6AI5VpBDgjK7y7TUQ,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA
Cc: Kishon Vijay Abraham I
Add omap control usb data in omap4 device tree file. This will have the
register address of registers to power on the PHY and to write to
mailbox.
Signed-off-by: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
---
arch/arm/boot/dts/omap4.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index b7e2ba3..5d770be 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -545,5 +545,13 @@
ram_bits = <12>;
ti,has_mailbox;
};
+
+ omap_control_usb@4a002300 {
+ compatible = "ti,omap-control-usb";
+ reg = <0x4a002300 0x4>,
+ <0x4a00233c 0x4>;
+ reg-names = "control_dev_conf", "otghs_control";
+ ti,has_mailbox;
+ };
};
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [RFC PATCH 2/7] ARM: OMAP: devices: create device for usb part of control module
2013-01-15 8:42 ` [RFC PATCH 2/7] ARM: OMAP: devices: create device " Kishon Vijay Abraham I
@ 2013-01-15 12:53 ` Sergei Shtylyov
2013-01-15 14:26 ` kishon
0 siblings, 1 reply; 21+ messages in thread
From: Sergei Shtylyov @ 2013-01-15 12:53 UTC (permalink / raw)
To: Kishon Vijay Abraham I
Cc: grant.likely, b-cousson, rob.herring, rob, linux, arnd, balbi,
tony, devicetree-discuss, linux-doc, linux-kernel,
linux-arm-kernel, linux-usb, linux-omap
Hello.
On 15-01-2013 12:42, Kishon Vijay Abraham I wrote:
> A seperate driver has been added to handle the usb part of control
> module. A device for the above driver is created here, using the register
> address information to be used by the driver for powering on the PHY and
> for writing to the mailbox.
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---
> arch/arm/mach-omap2/devices.c | 50 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 50 insertions(+)
> diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
> index 5e304d0..a761faf4 100644
> --- a/arch/arm/mach-omap2/devices.c
> +++ b/arch/arm/mach-omap2/devices.c
[...]
> @@ -254,6 +255,54 @@ static inline void omap_init_camera(void)
> #endif
> }
>
> +#if (defined(CONFIG_OMAP_CONTROL_USB) || \
> + defined(CONFIG_OMAP_CONTROL_USB_MODULE))
() around || not needed, and you're indenting the second line too much.
> +static inline void __init omap_init_control_usb(void)
> +{
> + int ret = 0;
Initializer not needed.
> +
> + if (cpu_is_omap44xx()) {
> + ret = platform_device_register(&omap4_control_usb);
> + if (ret)
> + pr_err("Error registering omap_control_usb device: %d\n"
> + , ret);
Please leave the comma on the previous line.
WBR, Sergei
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [RFC PATCH 1/7] drivers: usb: phy: add a new driver for usb part of control module
[not found] ` <1358239378-10030-2-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
@ 2013-01-15 13:36 ` Arnd Bergmann
2013-01-15 14:24 ` kishon
0 siblings, 1 reply; 21+ messages in thread
From: Arnd Bergmann @ 2013-01-15 13:36 UTC (permalink / raw)
To: Kishon Vijay Abraham I
Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ, linux-doc-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, balbi-l0cyMroinI0,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
On Tuesday 15 January 2013, Kishon Vijay Abraham I wrote:
> +OMAP CONTROL USB
> +
> +Required properties:
> + - compatible: Should be "ti,omap-control-usb"
> + - reg : Address and length of the register set for the device. It contains
> + the address of "control_dev_conf" and "otghs_control".
> + - reg-names: The names of the register addresses corresponding to the registers
> + filled in "reg".
> + - ti,has_mailbox: This is used to specify if the platform uses mailbox in
> + control module.
I wonder whether we need to have a phandle here to connect the control device
to the actual usb device. What happens if you have multiple instances of
each?
Arnd
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [RFC PATCH 0/7] usb: musb: add driver for control module
2013-01-15 8:42 [RFC PATCH 0/7] usb: musb: add driver for control module Kishon Vijay Abraham I
` (4 preceding siblings ...)
[not found] ` <1358239378-10030-1-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
@ 2013-01-15 13:41 ` Arnd Bergmann
[not found] ` <201301151341.08297.arnd-r2nGTMty4D4@public.gmane.org>
2013-01-18 11:47 ` Felipe Balbi
6 siblings, 1 reply; 21+ messages in thread
From: Arnd Bergmann @ 2013-01-15 13:41 UTC (permalink / raw)
To: Kishon Vijay Abraham I
Cc: grant.likely, b-cousson, rob.herring, rob, linux, balbi, tony,
devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
linux-usb, linux-omap
On Tuesday 15 January 2013, Kishon Vijay Abraham I wrote:
> Added a new driver for the usb part of control module. This has an API
> to power on the USB2 phy and an API to write to the mailbox depending on
> whether MUSB has to act in host mode or in device mode.
>
> Writing to control module registers for doing the above task which was
> previously done in omap glue and in omap-usb2 phy is removed.
>
> Also added the dt data to get MUSB working in OMAP platforms.
> This series has patches for both drivers and ARCH folders, so If it has to
> be split I'll do it.
>
The series looks good to me, I just had a minor comment on one patch.
One a somewhat related topic, I wonder whether there are any plans
on your side to change this driver to support multiple bus glues
to be built for one kernel image. With a multiplatform kernel, we
may need all of TUSB6010/OMAP2PLUS/DSPS/UX500 for instance.
Arnd
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [RFC PATCH 1/7] drivers: usb: phy: add a new driver for usb part of control module
2013-01-15 13:36 ` Arnd Bergmann
@ 2013-01-15 14:24 ` kishon
2013-01-15 14:46 ` Arnd Bergmann
0 siblings, 1 reply; 21+ messages in thread
From: kishon @ 2013-01-15 14:24 UTC (permalink / raw)
To: Arnd Bergmann
Cc: grant.likely, b-cousson, rob.herring, rob, linux, balbi, tony,
devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
linux-usb, linux-omap
Hi Arnd,
On Tuesday 15 January 2013 07:06 PM, Arnd Bergmann wrote:
> On Tuesday 15 January 2013, Kishon Vijay Abraham I wrote:
>> +OMAP CONTROL USB
>> +
>> +Required properties:
>> + - compatible: Should be "ti,omap-control-usb"
>> + - reg : Address and length of the register set for the device. It contains
>> + the address of "control_dev_conf" and "otghs_control".
>> + - reg-names: The names of the register addresses corresponding to the registers
>> + filled in "reg".
>> + - ti,has_mailbox: This is used to specify if the platform uses mailbox in
>> + control module.
>
> I wonder whether we need to have a phandle here to connect the control device
> to the actual usb device. What happens if you have multiple instances of
> each?
Good point :-). Currently, none of the OMAP platforms have multiple
control modules and it doesn't seem to be in the future (AFAIK). While
it might be simpler to support multiple control devices with phandle, it
might face the same complications as faced by the USB PHY framework for
non-dt boot.
Thanks
Kishon
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [RFC PATCH 2/7] ARM: OMAP: devices: create device for usb part of control module
2013-01-15 12:53 ` Sergei Shtylyov
@ 2013-01-15 14:26 ` kishon
2013-01-17 16:43 ` Sergei Shtylyov
0 siblings, 1 reply; 21+ messages in thread
From: kishon @ 2013-01-15 14:26 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: grant.likely, b-cousson, rob.herring, rob, linux, arnd, balbi,
tony, devicetree-discuss, linux-doc, linux-kernel,
linux-arm-kernel, linux-usb, linux-omap
On Tuesday 15 January 2013 06:23 PM, Sergei Shtylyov wrote:
> Hello.
>
> On 15-01-2013 12:42, Kishon Vijay Abraham I wrote:
>
>> A seperate driver has been added to handle the usb part of control
>> module. A device for the above driver is created here, using the register
>> address information to be used by the driver for powering on the PHY and
>> for writing to the mailbox.
>
>> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
>> ---
>> arch/arm/mach-omap2/devices.c | 50
>> +++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 50 insertions(+)
>
>> diff --git a/arch/arm/mach-omap2/devices.c
>> b/arch/arm/mach-omap2/devices.c
>> index 5e304d0..a761faf4 100644
>> --- a/arch/arm/mach-omap2/devices.c
>> +++ b/arch/arm/mach-omap2/devices.c
> [...]
>> @@ -254,6 +255,54 @@ static inline void omap_init_camera(void)
>> #endif
>> }
>>
>> +#if (defined(CONFIG_OMAP_CONTROL_USB) || \
>> + defined(CONFIG_OMAP_CONTROL_USB_MODULE))
>
> () around || not needed, and you're indenting the second line too much.
>
>> +static inline void __init omap_init_control_usb(void)
>> +{
>> + int ret = 0;
>
> Initializer not needed.
>
>> +
>> + if (cpu_is_omap44xx()) {
>> + ret = platform_device_register(&omap4_control_usb);
>> + if (ret)
>> + pr_err("Error registering omap_control_usb device: %d\n"
>> + , ret);
>
> Please leave the comma on the previous line.
Sure. I'll fix it.
Thanks
Kishon
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [RFC PATCH 0/7] usb: musb: add driver for control module
[not found] ` <201301151341.08297.arnd-r2nGTMty4D4@public.gmane.org>
@ 2013-01-15 14:39 ` kishon
2013-01-15 15:04 ` Felipe Balbi
0 siblings, 1 reply; 21+ messages in thread
From: kishon @ 2013-01-15 14:39 UTC (permalink / raw)
To: Arnd Bergmann, balbi-l0cyMroinI0
Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ, linux-doc-u79uwXL29TY76Z2rM5mHXA,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Hi Arnd,
On Tuesday 15 January 2013 07:11 PM, Arnd Bergmann wrote:
> On Tuesday 15 January 2013, Kishon Vijay Abraham I wrote:
>> Added a new driver for the usb part of control module. This has an API
>> to power on the USB2 phy and an API to write to the mailbox depending on
>> whether MUSB has to act in host mode or in device mode.
>>
>> Writing to control module registers for doing the above task which was
>> previously done in omap glue and in omap-usb2 phy is removed.
>>
>> Also added the dt data to get MUSB working in OMAP platforms.
>> This series has patches for both drivers and ARCH folders, so If it has to
>> be split I'll do it.
>>
>
> The series looks good to me, I just had a minor comment on one patch.
>
> One a somewhat related topic, I wonder whether there are any plans
> on your side to change this driver to support multiple bus glues
> to be built for one kernel image. With a multiplatform kernel, we
> may need all of TUSB6010/OMAP2PLUS/DSPS/UX500 for instance.
We don't have plans as of now. I actually don't expect any changes in
the driver other than the Kconfig changes. Anyways the probe of glue's
other than the platform it's running won't get called. right Felipe?
Thanks
Kishon
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [RFC PATCH 1/7] drivers: usb: phy: add a new driver for usb part of control module
2013-01-15 14:24 ` kishon
@ 2013-01-15 14:46 ` Arnd Bergmann
0 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2013-01-15 14:46 UTC (permalink / raw)
To: kishon
Cc: grant.likely, b-cousson, rob.herring, rob, linux, balbi, tony,
devicetree-discuss, linux-doc, linux-kernel, linux-arm-kernel,
linux-usb, linux-omap
On Tuesday 15 January 2013, kishon wrote:
> Good point :-). Currently, none of the OMAP platforms have multiple
> control modules and it doesn't seem to be in the future (AFAIK). While
> it might be simpler to support multiple control devices with phandle, it
> might face the same complications as faced by the USB PHY framework for
> non-dt boot.
>
Maybe you can put the phandle into the binding then but don't use it
until hardware actually requires it. If anything needs it, then we
can always change the code later, but it's harder to change the
binding.
Arnd
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [RFC PATCH 0/7] usb: musb: add driver for control module
2013-01-15 14:39 ` kishon
@ 2013-01-15 15:04 ` Felipe Balbi
2013-01-15 16:06 ` B, Ravi
0 siblings, 1 reply; 21+ messages in thread
From: Felipe Balbi @ 2013-01-15 15:04 UTC (permalink / raw)
To: kishon
Cc: Arnd Bergmann, balbi, grant.likely, b-cousson, rob.herring, rob,
linux, tony, devicetree-discuss, linux-doc, linux-kernel,
linux-arm-kernel, linux-usb, linux-omap, ravibabu
[-- Attachment #1: Type: text/plain, Size: 1890 bytes --]
Hi,
On Tue, Jan 15, 2013 at 08:09:22PM +0530, kishon wrote:
> Hi Arnd,
>
> On Tuesday 15 January 2013 07:11 PM, Arnd Bergmann wrote:
> >On Tuesday 15 January 2013, Kishon Vijay Abraham I wrote:
> >>Added a new driver for the usb part of control module. This has an API
> >>to power on the USB2 phy and an API to write to the mailbox depending on
> >>whether MUSB has to act in host mode or in device mode.
> >>
> >>Writing to control module registers for doing the above task which was
> >>previously done in omap glue and in omap-usb2 phy is removed.
> >>
> >>Also added the dt data to get MUSB working in OMAP platforms.
> >>This series has patches for both drivers and ARCH folders, so If it has to
> >>be split I'll do it.
> >>
> >
> >The series looks good to me, I just had a minor comment on one patch.
> >
> >One a somewhat related topic, I wonder whether there are any plans
> >on your side to change this driver to support multiple bus glues
> >to be built for one kernel image. With a multiplatform kernel, we
> >may need all of TUSB6010/OMAP2PLUS/DSPS/UX500 for instance.
>
> We don't have plans as of now. I actually don't expect any changes in
> the driver other than the Kconfig changes. Anyways the probe of
> glue's other than the platform it's running won't get called. right
> Felipe?
AFAICT there's nothing preventing those from being built together as
long as you don't use DMA (yeah, that's a touchy subject still with
MUSB).
If there are any build breaks, please report them so bus glue owners can
fix. I see that at least the davinci folks need to work a bit
$ git grep -e "mach\/" drivers/usb/musb/
drivers/usb/musb/da8xx.c:#include <mach/da8xx.h>
drivers/usb/musb/davinci.c:#include <mach/cputype.h>
drivers/usb/musb/davinci.c:#include <mach/hardware.h>
I'm adding Ravi B to the loop here for those.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [RFC PATCH 0/7] usb: musb: add driver for control module
2013-01-15 15:04 ` Felipe Balbi
@ 2013-01-15 16:06 ` B, Ravi
2013-01-16 6:01 ` kishon
0 siblings, 1 reply; 21+ messages in thread
From: B, Ravi @ 2013-01-15 16:06 UTC (permalink / raw)
To: Balbi, Felipe, ABRAHAM, KISHON VIJAY
Cc: Arnd Bergmann, grant.likely@secretlab.ca, Cousson, Benoit,
rob.herring@calxeda.com, rob@landley.net, linux@arm.linux.org.uk,
tony@atomide.com, devicetree-discuss@lists.ozlabs.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org,
linux-omap@vger.kernel.org
> Hi,
>
> On Tue, Jan 15, 2013 at 08:09:22PM +0530, kishon wrote:
> > Hi Arnd,
> >
> > On Tuesday 15 January 2013 07:11 PM, Arnd Bergmann wrote:
> > >On Tuesday 15 January 2013, Kishon Vijay Abraham I wrote:
> > >>Added a new driver for the usb part of control module.
> This has an
> > >>API to power on the USB2 phy and an API to write to the mailbox
> > >>depending on whether MUSB has to act in host mode or in
> device mode.
> > >>
> > >>Writing to control module registers for doing the above
> task which
> > >>was previously done in omap glue and in omap-usb2 phy is removed.
> > >>
> > >>Also added the dt data to get MUSB working in OMAP platforms.
> > >>This series has patches for both drivers and ARCH
> folders, so If it
> > >>has to be split I'll do it.
> > >>
> > >
> > >The series looks good to me, I just had a minor comment on
> one patch.
> > >
> > >One a somewhat related topic, I wonder whether there are
> any plans on
> > >your side to change this driver to support multiple bus
> glues to be
> > >built for one kernel image. With a multiplatform kernel,
> we may need
> > >all of TUSB6010/OMAP2PLUS/DSPS/UX500 for instance.
> >
> > We don't have plans as of now. I actually don't expect any
> changes in
> > the driver other than the Kconfig changes. Anyways the
> probe of glue's
> > other than the platform it's running won't get called. right Felipe?
If understand correctly the control module driver used to configure the respective usb phy of SoC to respective usb modes using the common set of control module APIs. What if, if control module interface (register defintions) varies b/w different revision or spin of same type of SoCs, if usbphy type is changed. In this case whether the single instance of control module driver is good enough to cater of all cpu types of same SoC series ?
Whether cpu_is_xxx() can be used to differentiate b/w different cpu types in CM driver?
>
> AFAICT there's nothing preventing those from being built
> together as long as you don't use DMA (yeah, that's a touchy
> subject still with MUSB).
>
> If there are any build breaks, please report them so bus glue
> owners can fix. I see that at least the davinci folks need to
> work a bit
>
> $ git grep -e "mach\/" drivers/usb/musb/
> drivers/usb/musb/da8xx.c:#include <mach/da8xx.h>
> drivers/usb/musb/davinci.c:#include <mach/cputype.h>
> drivers/usb/musb/davinci.c:#include <mach/hardware.h>
>
> I'm adding Ravi B to the loop here for those.
>
> --
> balbi
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [RFC PATCH 0/7] usb: musb: add driver for control module
2013-01-15 16:06 ` B, Ravi
@ 2013-01-16 6:01 ` kishon
2013-01-16 7:13 ` Felipe Balbi
0 siblings, 1 reply; 21+ messages in thread
From: kishon @ 2013-01-16 6:01 UTC (permalink / raw)
To: B, Ravi
Cc: Balbi, Felipe, Arnd Bergmann, grant.likely@secretlab.ca,
Cousson, Benoit, rob.herring@calxeda.com, rob@landley.net,
linux@arm.linux.org.uk, tony@atomide.com,
devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org,
linux-omap@vger.kernel.org
Hi Ravi,
On Tuesday 15 January 2013 09:36 PM, B, Ravi wrote:
>> Hi,
>>
>> On Tue, Jan 15, 2013 at 08:09:22PM +0530, kishon wrote:
>>> Hi Arnd,
>>>
>>> On Tuesday 15 January 2013 07:11 PM, Arnd Bergmann wrote:
>>>> On Tuesday 15 January 2013, Kishon Vijay Abraham I wrote:
>>>>> Added a new driver for the usb part of control module.
>> This has an
>>>>> API to power on the USB2 phy and an API to write to the mailbox
>>>>> depending on whether MUSB has to act in host mode or in
>> device mode.
>>>>>
>>>>> Writing to control module registers for doing the above
>> task which
>>>>> was previously done in omap glue and in omap-usb2 phy is removed.
>>>>>
>>>>> Also added the dt data to get MUSB working in OMAP platforms.
>>>>> This series has patches for both drivers and ARCH
>> folders, so If it
>>>>> has to be split I'll do it.
>>>>>
>>>>
>>>> The series looks good to me, I just had a minor comment on
>> one patch.
>>>>
>>>> One a somewhat related topic, I wonder whether there are
>> any plans on
>>>> your side to change this driver to support multiple bus
>> glues to be
>>>> built for one kernel image. With a multiplatform kernel,
>> we may need
>>>> all of TUSB6010/OMAP2PLUS/DSPS/UX500 for instance.
>>>
>>> We don't have plans as of now. I actually don't expect any
>> changes in
>>> the driver other than the Kconfig changes. Anyways the
>> probe of glue's
>>> other than the platform it's running won't get called. right Felipe?
>
> If understand correctly the control module driver used to configure the respective usb phy of SoC to respective usb modes using the common set of control module APIs.
What if, if control module interface (register defintions) varies b/w
different revision or spin of same type of SoCs, if usbphy type is changed.
Well in that case, we can write to the registers based on the IP
revision check (I think thats the common practice to do).
In this case whether the single instance of control module driver is
good enough to cater of all cpu types of same SoC series ?
Of course. I don't see why we can't have the same driver to handle
different versions of the same IP.
The only reason where we might need multiple instance is if the SoC have
multiple control module which Arnd already pointed out.
> Whether cpu_is_xxx() can be used to differentiate b/w different cpu types in CM driver?
Not needed at all IMHO. We can use revision register to differentiate.
Btw I think Felipe looped you for a different reason ;-)
Thanks
Kishon
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [RFC PATCH 0/7] usb: musb: add driver for control module
2013-01-16 6:01 ` kishon
@ 2013-01-16 7:13 ` Felipe Balbi
0 siblings, 0 replies; 21+ messages in thread
From: Felipe Balbi @ 2013-01-16 7:13 UTC (permalink / raw)
To: kishon
Cc: B, Ravi, Balbi, Felipe, Arnd Bergmann, grant.likely@secretlab.ca,
Cousson, Benoit, rob.herring@calxeda.com, rob@landley.net,
linux@arm.linux.org.uk, tony@atomide.com,
devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org,
linux-omap@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 2813 bytes --]
On Wed, Jan 16, 2013 at 11:31:32AM +0530, kishon wrote:
> Hi Ravi,
>
> On Tuesday 15 January 2013 09:36 PM, B, Ravi wrote:
> >>Hi,
> >>
> >>On Tue, Jan 15, 2013 at 08:09:22PM +0530, kishon wrote:
> >>>Hi Arnd,
> >>>
> >>>On Tuesday 15 January 2013 07:11 PM, Arnd Bergmann wrote:
> >>>>On Tuesday 15 January 2013, Kishon Vijay Abraham I wrote:
> >>>>>Added a new driver for the usb part of control module.
> >>This has an
> >>>>>API to power on the USB2 phy and an API to write to the mailbox
> >>>>>depending on whether MUSB has to act in host mode or in
> >>device mode.
> >>>>>
> >>>>>Writing to control module registers for doing the above
> >>task which
> >>>>>was previously done in omap glue and in omap-usb2 phy is removed.
> >>>>>
> >>>>>Also added the dt data to get MUSB working in OMAP platforms.
> >>>>>This series has patches for both drivers and ARCH
> >>folders, so If it
> >>>>>has to be split I'll do it.
> >>>>>
> >>>>
> >>>>The series looks good to me, I just had a minor comment on
> >>one patch.
> >>>>
> >>>>One a somewhat related topic, I wonder whether there are
> >>any plans on
> >>>>your side to change this driver to support multiple bus
> >>glues to be
> >>>>built for one kernel image. With a multiplatform kernel,
> >>we may need
> >>>>all of TUSB6010/OMAP2PLUS/DSPS/UX500 for instance.
> >>>
> >>>We don't have plans as of now. I actually don't expect any
> >>changes in
> >>>the driver other than the Kconfig changes. Anyways the
> >>probe of glue's
> >>>other than the platform it's running won't get called. right Felipe?
> >
> >If understand correctly the control module driver used to configure the respective usb phy of SoC to respective usb modes using the common set of control module APIs.
> What if, if control module interface (register defintions) varies b/w
> different revision or spin of same type of SoCs, if usbphy type is
> changed.
> Well in that case, we can write to the registers based on the IP
> revision check (I think thats the common practice to do).
>
> In this case whether the single instance of control module driver is
> good enough to cater of all cpu types of same SoC series ?
> Of course. I don't see why we can't have the same driver to handle
> different versions of the same IP.
> The only reason where we might need multiple instance is if the SoC
> have multiple control module which Arnd already pointed out.
>
> >Whether cpu_is_xxx() can be used to differentiate b/w different cpu types in CM driver?
> Not needed at all IMHO. We can use revision register to differentiate.
>
> Btw I think Felipe looped you for a different reason ;-)
right, it was to look at removing <mach/*> inclusion from all
davinci-link glue layers (they should be combined, btw).
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [RFC PATCH 2/7] ARM: OMAP: devices: create device for usb part of control module
2013-01-15 14:26 ` kishon
@ 2013-01-17 16:43 ` Sergei Shtylyov
0 siblings, 0 replies; 21+ messages in thread
From: Sergei Shtylyov @ 2013-01-17 16:43 UTC (permalink / raw)
To: kishon
Cc: grant.likely, b-cousson, rob.herring, rob, linux, arnd, balbi,
tony, devicetree-discuss, linux-doc, linux-kernel,
linux-arm-kernel, linux-usb, linux-omap
Hello.
On 01/15/2013 05:26 PM, kishon wrote:
>> On 15-01-2013 12:42, Kishon Vijay Abraham I wrote:
>>> A seperate driver has been added to handle the usb part of control
>>> module. A device for the above driver is created here, using the register
>>> address information to be used by the driver for powering on the PHY and
>>> for writing to the mailbox.
>>> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
>>> ---
>>> arch/arm/mach-omap2/devices.c | 50
>>> +++++++++++++++++++++++++++++++++++++++++
>>> 1 file changed, 50 insertions(+)
>>> diff --git a/arch/arm/mach-omap2/devices.c
>>> b/arch/arm/mach-omap2/devices.c
>>> index 5e304d0..a761faf4 100644
>>> --- a/arch/arm/mach-omap2/devices.c
>>> +++ b/arch/arm/mach-omap2/devices.c
>> [...]
>>> @@ -254,6 +255,54 @@ static inline void omap_init_camera(void)
>>> #endif
>>> }
>>>
>>> +#if (defined(CONFIG_OMAP_CONTROL_USB) || \
>>> + defined(CONFIG_OMAP_CONTROL_USB_MODULE))
>> () around || not needed, and you're indenting the second line too much.
>>> +static inline void __init omap_init_control_usb(void)
>>> +{
>>> + int ret = 0;
>> Initializer not needed.
>>> +
>>> + if (cpu_is_omap44xx()) {
>>> + ret = platform_device_register(&omap4_control_usb);
>>> + if (ret)
>>> + pr_err("Error registering omap_control_usb device: %d\n"
>>> + , ret);
>> Please leave the comma on the previous line.
> Sure. I'll fix it.
Actually, you can use #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) now instead of
your above constuct.
WBR, Sergei
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [RFC PATCH 0/7] usb: musb: add driver for control module
2013-01-15 8:42 [RFC PATCH 0/7] usb: musb: add driver for control module Kishon Vijay Abraham I
` (5 preceding siblings ...)
2013-01-15 13:41 ` [RFC PATCH 0/7] usb: musb: add driver for control module Arnd Bergmann
@ 2013-01-18 11:47 ` Felipe Balbi
6 siblings, 0 replies; 21+ messages in thread
From: Felipe Balbi @ 2013-01-18 11:47 UTC (permalink / raw)
To: Kishon Vijay Abraham I
Cc: grant.likely, b-cousson, rob.herring, rob, linux, arnd, balbi,
tony, devicetree-discuss, linux-doc, linux-kernel,
linux-arm-kernel, linux-usb, linux-omap
[-- Attachment #1: Type: text/plain, Size: 868 bytes --]
Hi,
On Tue, Jan 15, 2013 at 02:12:51PM +0530, Kishon Vijay Abraham I wrote:
> Added a new driver for the usb part of control module. This has an API
> to power on the USB2 phy and an API to write to the mailbox depending on
> whether MUSB has to act in host mode or in device mode.
>
> Writing to control module registers for doing the above task which was
> previously done in omap glue and in omap-usb2 phy is removed.
>
> Also added the dt data to get MUSB working in OMAP platforms.
> This series has patches for both drivers and ARCH folders, so If it has to
> be split I'll do it.
>
> This series was developed on
> git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git xceiv
>
> Did basic enumeration testing in omap4 beagle, omap4 sdp and omap3 beagle.
can you resend without RFC tag so I can apply ?
Thank you
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2013-01-18 11:47 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15 8:42 [RFC PATCH 0/7] usb: musb: add driver for control module Kishon Vijay Abraham I
2013-01-15 8:42 ` [RFC PATCH 1/7] drivers: usb: phy: add a new driver for usb part of " Kishon Vijay Abraham I
[not found] ` <1358239378-10030-2-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
2013-01-15 13:36 ` Arnd Bergmann
2013-01-15 14:24 ` kishon
2013-01-15 14:46 ` Arnd Bergmann
2013-01-15 8:42 ` [RFC PATCH 2/7] ARM: OMAP: devices: create device " Kishon Vijay Abraham I
2013-01-15 12:53 ` Sergei Shtylyov
2013-01-15 14:26 ` kishon
2013-01-17 16:43 ` Sergei Shtylyov
2013-01-15 8:42 ` [RFC PATCH 4/7] drivers: usb: start using the control module driver Kishon Vijay Abraham I
2013-01-15 8:42 ` [RFC PATCH 6/7] ARM: dts: omap: Add omap-usb2 dt data Kishon Vijay Abraham I
[not found] ` <1358239378-10030-1-git-send-email-kishon-l0cyMroinI0@public.gmane.org>
2013-01-15 8:42 ` [RFC PATCH 3/7] ARM: OMAP2: MUSB: Specify omap4 has mailbox Kishon Vijay Abraham I
2013-01-15 8:42 ` [RFC PATCH 5/7] ARM: dts: omap: Add usb_otg and glue data Kishon Vijay Abraham I
2013-01-15 8:42 ` [RFC PATCH 7/7] ARM: dts: omap: Add omap control usb data Kishon Vijay Abraham I
2013-01-15 13:41 ` [RFC PATCH 0/7] usb: musb: add driver for control module Arnd Bergmann
[not found] ` <201301151341.08297.arnd-r2nGTMty4D4@public.gmane.org>
2013-01-15 14:39 ` kishon
2013-01-15 15:04 ` Felipe Balbi
2013-01-15 16:06 ` B, Ravi
2013-01-16 6:01 ` kishon
2013-01-16 7:13 ` Felipe Balbi
2013-01-18 11:47 ` Felipe Balbi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).