[PATCH v8 0/8] Add tested id switch and vbus connect detect support for Chipidea
Changes for v7: - Add ci_supports_gadget helper to know if the controller supports gadget, if the controller supports gadget, it needs to read otgsc to know the vbus value, basically, if the controller supports gadget, it will support host as well [3/8] - At ci_hdrc_probe, it needs to add free memory at error path [3/8] - Cosolidate ci-driver = NULL at ci13xxx_stop [8/8] Changes for v6: For Patch 8/8, we only need to set ci-driver to NULL when usb cable is not connected, for other changes, it will case some runtime pm unmatch and un-align with udc-core composite driver problems. Changes for v5: - Add Alex comments for init/destroy function [3/8] [4/8] - Remove memset(ci-gadget, 0, sizeof(ci-gadget)) at destory function [4/8] - Add Kishon's comment: Change the format of struct usb_otg otg at drivers/usb/chipidea/ci.h [1/8] - Add comments for CI_VBUS_STABLE_TIMEOUT [3/8] - Change the otg_set_peripheral return value check as the fully chipidea driver users don't need it. [4/8] - Fix one bug that the oops when re-plug in usb cable after rmmod gadget [8/8] Anyone who has tested this patchset, please give a tested-by, thanks. This patchset adds tested otg id switch function and vbus connect/disconnect detection for chipidea driver. The mainly design of id/vbus handling follows msm otg driver. I hope the msm usb maintainer can have a look of this patchset, and give some comments, and move the whole msm usb driver to chipidea framework if possible in the future. This patch is fully tested at imx6 sabrelite platform. My chipidea repo: https://github.com/hzpeterchen/linux-usb.git which is rebased of Sascha's git (git://git.pengutronix.de/git/imx/linux-2.6.git tags/usb-chipidea-otg-for-next) At sascha's tag, it finishes some dr_mode and phy_type patches, in that way, we can choose host-only and gadget-only function at dts file as well as we can choose different phy setting. Besides sascha's work, there are some Michael Grzeschik/Marc Kleine-Budde usbmisc patch, imx chipidea suspend/resume patch, and one pin control patch for imx6 Peter Chen (8): Revert USB: chipidea: add vbus detect for udc usb: chipidea: add otg file usb: chipidea: add otg id switch and vbus connect/disconnect detect usb: chipidea: consolidate kinds of APIs for both roles usb: chipidea: udc: add pullup/pulldown dp at hw_device_state usb: chipidea: udc: retire the flag CI13_PULLUP_ON_VBUS usb: chipidea: imx: add internal vbus regulator control usb: chipidea: udc: fix the oops when plugs in usb cable after rmmod gadget drivers/usb/chipidea/Makefile |2 +- drivers/usb/chipidea/bits.h| 10 ++ drivers/usb/chipidea/ci.h | 12 ++- drivers/usb/chipidea/ci13xxx_imx.c | 80 drivers/usb/chipidea/ci13xxx_msm.c |1 - drivers/usb/chipidea/core.c| 189 drivers/usb/chipidea/host.c|6 + drivers/usb/chipidea/host.h|4 +- drivers/usb/chipidea/otg.c | 68 + drivers/usb/chipidea/otg.h |9 ++ drivers/usb/chipidea/udc.c | 112 ++ drivers/usb/chipidea/udc.h |4 +- include/linux/usb/chipidea.h |1 - 13 files changed, 390 insertions(+), 108 deletions(-) create mode 100644 drivers/usb/chipidea/otg.c create mode 100644 drivers/usb/chipidea/otg.h -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v8 1/8] Revert USB: chipidea: add vbus detect for udc
vbus register is at otgsc, and vbus detect does not belong to device function. Revert this patch, and will move vbus detect function to drivers/usb/chipidea/udc.c This reverts commit 8c4fc031954b4eb72daf13d3c907a985a3eee208. Signed-off-by: Peter Chen peter.c...@freescale.com diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h index e25d126..d738603 100644 --- a/drivers/usb/chipidea/ci.h +++ b/drivers/usb/chipidea/ci.h @@ -139,7 +139,6 @@ struct ci13xxx { enum ci_rolerole; boolis_otg; struct work_struct work; - struct work_struct vbus_work; struct workqueue_struct *wq; struct dma_pool *qh_pool; diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 2f45bba..d214448 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -305,18 +305,6 @@ static u32 hw_test_and_clear_intr_active(struct ci13xxx *ci) return reg; } -static void hw_enable_vbus_intr(struct ci13xxx *ci) -{ - hw_write(ci, OP_OTGSC, OTGSC_AVVIS, OTGSC_AVVIS); - hw_write(ci, OP_OTGSC, OTGSC_AVVIE, OTGSC_AVVIE); - queue_work(ci-wq, ci-vbus_work); -} - -static void hw_disable_vbus_intr(struct ci13xxx *ci) -{ - hw_write(ci, OP_OTGSC, OTGSC_AVVIE, 0); -} - /** * hw_test_and_clear_setup_guard: test clear setup guard (execute without *interruption) @@ -383,16 +371,6 @@ static int hw_usb_reset(struct ci13xxx *ci) return 0; } -static void vbus_work(struct work_struct *work) -{ - struct ci13xxx *ci = container_of(work, struct ci13xxx, vbus_work); - - if (hw_read(ci, OP_OTGSC, OTGSC_AVV)) - usb_gadget_vbus_connect(ci-gadget); - else - usb_gadget_vbus_disconnect(ci-gadget); -} - /** * UTIL block */ @@ -1392,7 +1370,6 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active) if (is_active) { pm_runtime_get_sync(_gadget-dev); hw_device_reset(ci, USBMODE_CM_DC); - hw_enable_vbus_intr(ci); hw_device_state(ci, ci-ep0out-qh.dma); } else { hw_device_state(ci, 0); @@ -1567,10 +1544,8 @@ static int ci13xxx_start(struct usb_gadget *gadget, pm_runtime_get_sync(ci-gadget.dev); if (ci-platdata-flags CI13XXX_PULLUP_ON_VBUS) { if (ci-vbus_active) { - if (ci-platdata-flags CI13XXX_REGS_SHARED) { + if (ci-platdata-flags CI13XXX_REGS_SHARED) hw_device_reset(ci, USBMODE_CM_DC); - hw_enable_vbus_intr(ci); - } } else { pm_runtime_put_sync(ci-gadget.dev); goto done; @@ -1676,13 +1651,6 @@ static irqreturn_t udc_irq(struct ci13xxx *ci) } else { retval = IRQ_NONE; } - - intr = hw_read(ci, OP_OTGSC, ~0); - hw_write(ci, OP_OTGSC, ~0, intr); - - if (intr (OTGSC_AVVIE OTGSC_AVVIS)) - queue_work(ci-wq, ci-vbus_work); - spin_unlock(ci-lock); return retval; @@ -1758,7 +1726,6 @@ static int udc_start(struct ci13xxx *ci) retval = hw_device_reset(ci, USBMODE_CM_DC); if (retval) goto put_transceiver; - hw_enable_vbus_intr(ci); } retval = device_register(ci-gadget.dev); @@ -1821,9 +1788,6 @@ static void udc_stop(struct ci13xxx *ci) if (ci == NULL) return; - hw_disable_vbus_intr(ci); - cancel_work_sync(ci-vbus_work); - usb_del_gadget_udc(ci-gadget); destroy_eps(ci); @@ -1864,7 +1828,6 @@ int ci_hdrc_gadget_init(struct ci13xxx *ci) rdrv-irq = udc_irq; rdrv-name = gadget; ci-roles[CI_ROLE_GADGET] = rdrv; - INIT_WORK(ci-vbus_work, vbus_work); return 0; } -- 1.7.0.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v8 2/8] usb: chipidea: add otg file
Implement struct usb_otg, In that way, calling otg_set_peripheral will not be failed at udc.c. Signed-off-by: Peter Chen peter.c...@freescale.com diff --git a/drivers/usb/chipidea/Makefile b/drivers/usb/chipidea/Makefile index d92ca32..11f513c 100644 --- a/drivers/usb/chipidea/Makefile +++ b/drivers/usb/chipidea/Makefile @@ -2,7 +2,7 @@ ccflags-$(CONFIG_USB_CHIPIDEA_DEBUG) := -DDEBUG obj-$(CONFIG_USB_CHIPIDEA) += ci_hdrc.o -ci_hdrc-y := core.o +ci_hdrc-y := core.o otg.o ci_hdrc-$(CONFIG_USB_CHIPIDEA_UDC) += udc.o ci_hdrc-$(CONFIG_USB_CHIPIDEA_HOST)+= host.o ci_hdrc-$(CONFIG_USB_CHIPIDEA_DEBUG) += debug.o diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h index d738603..697e369 100644 --- a/drivers/usb/chipidea/ci.h +++ b/drivers/usb/chipidea/ci.h @@ -129,6 +129,7 @@ struct hw_bank { * @vbus_active: is VBUS active * @transceiver: pointer to USB PHY, if any * @hcd: pointer to usb_hcd for ehci host driver + * @otg: for otg support */ struct ci13xxx { struct device *dev; @@ -164,6 +165,7 @@ struct ci13xxx { boolglobal_phy; struct usb_phy *transceiver; struct usb_hcd *hcd; + struct usb_otg otg; }; static inline struct ci_role_driver *ci_role(struct ci13xxx *ci) diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c new file mode 100644 index 000..7dea3b3 --- /dev/null +++ b/drivers/usb/chipidea/otg.c @@ -0,0 +1,60 @@ +/* + * otg.c - ChipIdea USB IP core OTG driver + * + * Copyright (C) 2012 Freescale Semiconductor, Inc. + * + * Author: Peter Chen + * + * 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/platform_device.h +#include linux/module.h +#include linux/io.h +#include linux/irq.h +#include linux/kernel.h +#include linux/slab.h +#include linux/usb/gadget.h +#include linux/usb/otg.h +#include linux/usb/chipidea.h + +#include ci.h +#include udc.h +#include bits.h +#include host.h +#include debug.h + +static int ci_otg_set_peripheral(struct usb_otg *otg, + struct usb_gadget *periph) +{ + otg-gadget = periph; + + return 0; +} + +static int ci_otg_set_host(struct usb_otg *otg, struct usb_bus *host) +{ + otg-host = host; + + return 0; +} + +/** + * ci_hdrc_otg_init - initialize device related bits + * ci: the controller + * + * This function create otg struct, if the device can switch between + * device and host. + */ +int ci_hdrc_otg_init(struct ci13xxx *ci) +{ + /* Useless at current */ + ci-otg.set_peripheral = ci_otg_set_peripheral; + ci-otg.set_host = ci_otg_set_host; + if (!IS_ERR_OR_NULL(ci-transceiver)) + ci-transceiver-otg = ci-otg; + + return 0; +} diff --git a/drivers/usb/chipidea/otg.h b/drivers/usb/chipidea/otg.h new file mode 100644 index 000..b4c6b3e --- /dev/null +++ b/drivers/usb/chipidea/otg.h @@ -0,0 +1,6 @@ +#ifndef __DRIVERS_USB_CHIPIDEA_OTG_H +#define __DRIVERS_USB_CHIPIDEA_OTG_H + +int ci_hdrc_otg_init(struct ci13xxx *ci); + +#endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */ -- 1.7.0.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v8 3/8] usb: chipidea: add otg id switch and vbus connect/disconnect detect
The main design flow is the same with msm otg driver, that is the id and vbus interrupt are handled at core driver, others are handled by individual drivers. - At former design, when switch usb role from device-host, it will call udc_stop, it will remove the gadget driver, so when switch role from host-device, it can't add gadget driver any more. At new design, when role switch occurs, the gadget just calls usb_gadget_vbus_disconnect/usb_gadget_vbus_connect as well as reset controller, it will not free any device/gadget structure - Add vbus connect and disconnect to core interrupt handler, it can notify udc driver by calling usb_gadget_vbus_disconnect /usb_gadget_vbus_connect. - vbus interrupt needs to be handled when gadget function is enabled Signed-off-by: Peter Chen peter.c...@freescale.com diff --git a/drivers/usb/chipidea/bits.h b/drivers/usb/chipidea/bits.h index d8ffc2f..58ef56c 100644 --- a/drivers/usb/chipidea/bits.h +++ b/drivers/usb/chipidea/bits.h @@ -77,11 +77,21 @@ #define OTGSC_ASVIS BIT(18) #define OTGSC_BSVIS BIT(19) #define OTGSC_BSEIS BIT(20) +#define OTGSC_1MSIS BIT(21) +#define OTGSC_DPIS BIT(22) #define OTGSC_IDIE BIT(24) #define OTGSC_AVVIE BIT(25) #define OTGSC_ASVIE BIT(26) #define OTGSC_BSVIE BIT(27) #define OTGSC_BSEIE BIT(28) +#define OTGSC_1MSIE BIT(29) +#define OTGSC_DPIE BIT(30) +#define OTGSC_INT_EN_BITS (OTGSC_IDIE | OTGSC_AVVIE | OTGSC_ASVIE \ + | OTGSC_BSVIE | OTGSC_BSEIE | OTGSC_1MSIE \ + | OTGSC_DPIE) +#define OTGSC_INT_STATUS_BITS (OTGSC_IDIS | OTGSC_AVVIS | OTGSC_ASVIS \ + | OTGSC_BSVIS | OTGSC_BSEIS | OTGSC_1MSIS \ + | OTGSC_DPIS) /* USBMODE */ #define USBMODE_CM(0x03UL 0) diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h index 697e369..325d790 100644 --- a/drivers/usb/chipidea/ci.h +++ b/drivers/usb/chipidea/ci.h @@ -130,6 +130,7 @@ struct hw_bank { * @transceiver: pointer to USB PHY, if any * @hcd: pointer to usb_hcd for ehci host driver * @otg: for otg support + * @events: events for otg, and handled at ci_role_work */ struct ci13xxx { struct device *dev; @@ -140,6 +141,7 @@ struct ci13xxx { enum ci_rolerole; boolis_otg; struct work_struct work; + struct delayed_work dwork; struct workqueue_struct *wq; struct dma_pool *qh_pool; @@ -166,6 +168,8 @@ struct ci13xxx { struct usb_phy *transceiver; struct usb_hcd *hcd; struct usb_otg otg; + boolid_event; + boolb_sess_valid_event; }; static inline struct ci_role_driver *ci_role(struct ci13xxx *ci) @@ -314,4 +318,6 @@ int hw_port_test_set(struct ci13xxx *ci, u8 mode); u8 hw_port_test_get(struct ci13xxx *ci); +void ci_handle_vbus_change(struct ci13xxx *ci); + #endif /* __DRIVERS_USB_CHIPIDEA_CI_H */ diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c index 136869b..793fdba 100644 --- a/drivers/usb/chipidea/ci13xxx_imx.c +++ b/drivers/usb/chipidea/ci13xxx_imx.c @@ -110,7 +110,8 @@ static int ci13xxx_imx_probe(struct platform_device *pdev) pdata-capoffset = DEF_CAPOFFSET; pdata-flags = CI13XXX_REQUIRE_TRANSCEIVER | CI13XXX_PULLUP_ON_VBUS | - CI13XXX_DISABLE_STREAMING; + CI13XXX_DISABLE_STREAMING | + CI13XXX_REGS_SHARED; pdata-phy_mode = of_usb_get_phy_mode(pdev-dev.of_node); pdata-dr_mode = of_usb_get_dr_mode(pdev-dev.of_node); diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index c89f2aa..fbb6984 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -75,6 +75,7 @@ #include bits.h #include host.h #include debug.h +#include otg.h /* Controller register map */ static uintptr_t ci_regs_nolpm[] = { @@ -201,6 +202,14 @@ static int hw_device_init(struct ci13xxx *ci, void __iomem *base) if (ci-hw_ep_max ENDPT_MAX) return -ENODEV; + /* Disable all interrupts bits */ + hw_write(ci, OP_USBINTR, 0x, 0); + ci_disable_otg_interrupt(ci, OTGSC_INT_EN_BITS); + + /* Clear all interrupts status bits*/ + hw_write(ci, OP_USBSTS, 0x, 0x); + ci_clear_otg_interrupt(ci, OTGSC_INT_STATUS_BITS); + dev_dbg(ci-dev, ChipIdea HDRC found, lpm: %d; cap: %p op: %p\n, ci-hw_bank.lpm, ci-hw_bank.cap, ci-hw_bank.op); @@ -302,24 +311,132 @@ static enum ci_role ci_otg_role(struct ci13xxx *ci) } /** - * ci_role_work - perform role
[PATCH v8 5/8] usb: chipidea: udc: add pullup/pulldown dp at hw_device_state
- During the connect/disconnect host, we need to pullup and pulldown dp - Make sure the dp is not pullup until the vbus is on when flag CI13XXX_PULLUP_ON_VBUS is set - Using hw_device_state when set run/stop bit Signed-off-by: Peter Chen peter.c...@freescale.com diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index e82dae4..597ae64 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -91,8 +91,10 @@ static int hw_device_state(struct ci13xxx *ci, u32 dma) /* interrupt, error, port change, reset, sleep/suspend */ hw_write(ci, OP_USBINTR, ~0, USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI); + hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS); } else { hw_write(ci, OP_USBINTR, ~0, 0); + hw_write(ci, OP_USBCMD, USBCMD_RS, 0); } return 0; } @@ -1424,10 +1426,14 @@ static int ci13xxx_pullup(struct usb_gadget *_gadget, int is_on) { struct ci13xxx *ci = container_of(_gadget, struct ci13xxx, gadget); + if ((ci-platdata-flags CI13XXX_PULLUP_ON_VBUS) + !ci-vbus_active) + return -ENOTSUPP; + if (is_on) - hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS); + hw_device_state(ci, ci-ep0out-qh.dma); else - hw_write(ci, OP_USBCMD, USBCMD_RS, 0); + hw_device_state(ci, 0); return 0; } -- 1.7.0.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v8 6/8] usb: chipidea: udc: retire the flag CI13_PULLUP_ON_VBUS
(change CI13XXX to CI13 to avoid junk email check) Now, we have handled vbus session in core driver when the vbus interrupt occurs, so our pullup operations are all according to vbus. Of cource, the software can still call .pullup when device connects to host if it wants to connect/disconnect with host. Signed-off-by: Peter Chen peter.c...@freescale.com diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c index 793fdba..3ed119e 100644 --- a/drivers/usb/chipidea/ci13xxx_imx.c +++ b/drivers/usb/chipidea/ci13xxx_imx.c @@ -109,7 +109,6 @@ static int ci13xxx_imx_probe(struct platform_device *pdev) pdata-name = ci13xxx_imx; pdata-capoffset = DEF_CAPOFFSET; pdata-flags = CI13XXX_REQUIRE_TRANSCEIVER | - CI13XXX_PULLUP_ON_VBUS | CI13XXX_DISABLE_STREAMING | CI13XXX_REGS_SHARED; diff --git a/drivers/usb/chipidea/ci13xxx_msm.c b/drivers/usb/chipidea/ci13xxx_msm.c index 7d16681..5755ee8 100644 --- a/drivers/usb/chipidea/ci13xxx_msm.c +++ b/drivers/usb/chipidea/ci13xxx_msm.c @@ -49,7 +49,6 @@ static struct ci13xxx_platform_data ci13xxx_msm_platdata = { .name = ci13xxx_msm, .flags = CI13XXX_REGS_SHARED | CI13XXX_REQUIRE_TRANSCEIVER | - CI13XXX_PULLUP_ON_VBUS | CI13XXX_DISABLE_STREAMING, .notify_event = ci13xxx_msm_notify_event, diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 597ae64..b57b735 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -1360,9 +1360,6 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active) unsigned long flags; int gadget_ready = 0; - if (!(ci-platdata-flags CI13XXX_PULLUP_ON_VBUS)) - return -EOPNOTSUPP; - spin_lock_irqsave(ci-lock, flags); ci-vbus_active = is_active; if (ci-driver) @@ -1426,8 +1423,7 @@ static int ci13xxx_pullup(struct usb_gadget *_gadget, int is_on) { struct ci13xxx *ci = container_of(_gadget, struct ci13xxx, gadget); - if ((ci-platdata-flags CI13XXX_PULLUP_ON_VBUS) - !ci-vbus_active) + if (!ci-vbus_active) return -ENOTSUPP; if (is_on) @@ -1551,14 +1547,12 @@ static int ci13xxx_start(struct usb_gadget *gadget, ci-driver = driver; pm_runtime_get_sync(ci-gadget.dev); - if (ci-platdata-flags CI13XXX_PULLUP_ON_VBUS) { - if (ci-vbus_active) { - if (ci-platdata-flags CI13XXX_REGS_SHARED) - hw_device_reset(ci, USBMODE_CM_DC); - } else { - pm_runtime_put_sync(ci-gadget.dev); - goto done; - } + if (ci-vbus_active) { + if (ci-platdata-flags CI13XXX_REGS_SHARED) + hw_device_reset(ci, USBMODE_CM_DC); + } else { + pm_runtime_put_sync(ci-gadget.dev); + goto done; } retval = hw_device_state(ci, ci-ep0out-qh.dma); @@ -1581,8 +1575,7 @@ static int ci13xxx_stop(struct usb_gadget *gadget, spin_lock_irqsave(ci-lock, flags); - if (!(ci-platdata-flags CI13XXX_PULLUP_ON_VBUS) || - ci-vbus_active) { + if (ci-vbus_active) { hw_device_state(ci, 0); if (ci-platdata-notify_event) ci-platdata-notify_event(ci, diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index b314647..d543e4a 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h @@ -18,7 +18,6 @@ struct ci13xxx_platform_data { unsigned longflags; #define CI13XXX_REGS_SHAREDBIT(0) #define CI13XXX_REQUIRE_TRANSCEIVERBIT(1) -#define CI13XXX_PULLUP_ON_VBUS BIT(2) #define CI13XXX_DISABLE_STREAMING BIT(3) enum usb_dr_modedr_mode; #define CI13XXX_CONTROLLER_RESET_EVENT 0 -- 1.7.0.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v8 7/8] usb: chipidea: imx: add internal vbus regulator control
- For host, the vbus should always be on. - For otg, the vbus is off defaultly, the vbus needs to be turned on/off when usb role switches. Signed-off-by: Peter Chen peter.c...@freescale.com diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h index 3ebe87a..bd78078 100644 --- a/drivers/usb/chipidea/ci.h +++ b/drivers/usb/chipidea/ci.h @@ -131,6 +131,7 @@ struct hw_bank { * @hcd: pointer to usb_hcd for ehci host driver * @otg: for otg support * @events: events for otg, and handled at ci_role_work + * @reg_vbus: used to control internal vbus regulator */ struct ci13xxx { struct device *dev; @@ -170,6 +171,7 @@ struct ci13xxx { struct usb_otg otg; boolid_event; boolb_sess_valid_event; + struct regulator*reg_vbus; }; static inline struct ci_role_driver *ci_role(struct ci13xxx *ci) diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c index 3ed119e..5499cf8 100644 --- a/drivers/usb/chipidea/ci13xxx_imx.c +++ b/drivers/usb/chipidea/ci13xxx_imx.c @@ -85,11 +85,43 @@ EXPORT_SYMBOL_GPL(usbmisc_get_init_data); /* End of common functions shared by usbmisc drivers*/ +static int ci13xxx_otg_set_vbus(struct usb_otg *otg, bool enabled) +{ + struct ci13xxx *ci = container_of(otg, struct ci13xxx, otg); + struct regulator *reg_vbus = ci-reg_vbus; + int ret; + + WARN_ON(!reg_vbus); + + if (reg_vbus) { + if (enabled) { + ret = regulator_enable(reg_vbus); + if (ret) { + dev_err(ci-dev, + Failed to enable vbus regulator, ret=%d\n, + ret); + return ret; + } + } else { + ret = regulator_disable(reg_vbus); + if (ret) { + dev_err(ci-dev, + Failed to disable vbus regulator, ret=%d\n, + ret); + return ret; + } + } + } + + return 0; +} + static int ci13xxx_imx_probe(struct platform_device *pdev) { struct ci13xxx_imx_data *data; struct ci13xxx_platform_data *pdata; struct platform_device *plat_ci; + struct ci13xxx *ci; struct resource *res; struct regulator *reg_vbus; struct pinctrl *pinctrl; @@ -163,20 +195,11 @@ static int ci13xxx_imx_probe(struct platform_device *pdev) data-phy = phy; } - /* we only support host now, so enable vbus here */ reg_vbus = devm_regulator_get(pdev-dev, vbus); - if (!IS_ERR(reg_vbus)) { - ret = regulator_enable(reg_vbus); - if (ret) { - dev_err(pdev-dev, - Failed to enable vbus regulator, err=%d\n, - ret); - goto err_clk; - } + if (!IS_ERR(reg_vbus)) data-reg_vbus = reg_vbus; - } else { + else reg_vbus = NULL; - } pdata-phy = data-phy; @@ -186,7 +209,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev) if (!pdev-dev.dma_mask) { ret = -ENOMEM; dev_err(pdev-dev, Failed to alloc dma_mask!\n); - goto err; + goto err_clk; } *pdev-dev.dma_mask = DMA_BIT_MASK(32); dma_set_coherent_mask(pdev-dev, *pdev-dev.dma_mask); @@ -197,7 +220,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev) if (ret) { dev_err(pdev-dev, usbmisc init failed, ret=%d\n, ret); - goto err; + goto err_clk; } } @@ -209,20 +232,39 @@ static int ci13xxx_imx_probe(struct platform_device *pdev) dev_err(pdev-dev, Can't register ci_hdrc platform device, err=%d\n, ret); - goto err; + goto err_clk; } data-ci_pdev = plat_ci; platform_set_drvdata(pdev, data); + ci = platform_get_drvdata(plat_ci); + /* +* Internal vbus on/off policy +* - Always on for host only function +* - Always off for gadget only function +* - call otg.set_vbus to control on/off according usb role +*/ + + if (ci-roles[CI_ROLE_HOST] !ci-roles[CI_ROLE_GADGET] +reg_vbus) { + ret = regulator_enable(reg_vbus); + if (ret) { + dev_err(pdev-dev, +
[PATCH v8 8/8] usb: chipidea: udc: fix the oops when plugs in usb cable after rmmod gadget
When we rmmod gadget, the ci-driver needs to be cleared. Otherwise, we plug in usb cable again, the driver will consider gadget is there, in fact, it is removed. Below is the oops this patch fixes. root@freescale ~$ ci_hdrc ci_hdrc.0: Connected to host Unable to handle kernel paging request at virtual address 7f01171c pgd = 80004000 [7f01171c] *pgd=4fa1e811, *pte=, *ppte= Internal error: Oops: 7 [#1] SMP ARM Modules linked in: f_acm libcomposite u_serial [last unloaded: g_serial] CPU: 0Not tainted (3.8.0-rc5+ #221) PC is at _gadget_stop_activity+0xbc/0x128 LR is at ep_fifo_flush+0x68/0xa0 pc : [803634cc]lr : [80363938]psr: 2193 sp : 806c7dc8 ip : fp : 806c7de4 r10: r9 : 80710ea4 r8 : r7 : bf834094 r6 : bf834098 r5 : bf834010 r4 : bf8340a0 r3 : 7f011708 r2 : 01940194 r1 : a193 r0 : bf834014 Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c53c7d Table: 4f06404a DAC: 0017 Process swapper/0 (pid: 0, stack limit = 0x806c6238) Stack: (0x806c7dc8 to 0x806c8000) 7dc0: bf834010 bf809950 bf834010 004b 806c7e44 806c7de8 7de0: 80365400 8036341c ec1c ec1c 0040 fff5ede0 bf834014 7e00: 000a1220 002e d958 806c7e3c 806c7e20 8004e870 bf834010 7e20: bf809950 004b 004b 80710ea4 806c7e5c 806c7e48 7e40: 80362888 80365154 bfb35180 bf809950 806c7e9c 806c7e60 8008111c 803627f4 7e60: 00989680 bf809900 bf809964 812df8c0 bf809900 bf809950 806c3f2c 7e80: 004b 412fc09a 806c7eb4 806c7ea0 80081368 800810b8 7ea0: bf809900 bf809950 806c7ecc 806c7eb8 800843c8 8008130c 004b 806cf748 7ec0: 806c7ee4 806c7ed0 80081088 8008432c 806c6000 806cf748 806c7f0c 806c7ee8 7ee0: 8000fa44 8008105c f400010c 806ce974 806c7f30 f4000110 806d29e8 412fc09a 7f00: 806c7f2c 806c7f10 80008584 8000f9f4 8000fbd0 6013 806c7f64 7f20: 806c7f84 806c7f30 8000eac0 80008554 000f 8001aea0 7f40: 806c6000 80712a48 804f0040 806d29e8 412fc09a 806c7f84 7f60: 806c7f88 806c7f78 8000fbcc 8000fbd0 6013 806c7fac 806c7f88 7f80: 8001015c 8000fb9c 806cf5b0 80712980 806a4528 8fff 1000406a 412fc09a 7fa0: 806c7fbc 806c7fb0 804e5334 800100ac 806c7ff4 806c7fc0 80668940 804e52d4 7fc0: 806684bc 806a4528 10c53c7d 806ce94c 7fe0: 806a4524 806d29dc 806c7ff8 10008078 806686b0 Backtrace: [80363410] (_gadget_stop_activity+0x0/0x128) from [80365400] (udc_irq+0x2b8/0xf38) r7:004b r6:bf834010 r5:bf809950 r4:bf834010 [80365148] (udc_irq+0x0/0xf38) from [80362888] (ci_irq+0xa0/0xf4) [803627e8] (ci_irq+0x0/0xf4) from [8008111c] (handle_irq_event_percpu+0x70/0x254) r5:bf809950 r4:bfb35180 [800810ac] (handle_irq_event_percpu+0x0/0x254) from [80081368] (handle_irq_event+0x68/0x88) [80081300] (handle_irq_event+0x0/0x88) from [800843c8] (handle_fasteoi_irq+0xa8/0x178) r5:bf809950 r4:bf809900 [80084320] (handle_fasteoi_irq+0x0/0x178) from [80081088] (generic_handle_irq+0x38/0x40) r5:806cf748 r4:004b [80081050] (generic_handle_irq+0x0/0x40) from [8000fa44] (handle_IRQ+0x5c/0xbc) r5:806cf748 r4:806c6000 [8000f9e8] (handle_IRQ+0x0/0xbc) from [80008584] (gic_handle_irq+0x3c/0x70) r9:412fc09a r8:806d29e8 r7:f4000110 r6:806c7f30 r5:806ce974 r4:f400010c [80008548] (gic_handle_irq+0x0/0x70) from [8000eac0] (__irq_svc+0x40/0x54) Exception stack(0x806c7f30 to 0x806c7f78) 7f20: 000f 8001aea0 7f40: 806c6000 80712a48 804f0040 806d29e8 412fc09a 806c7f84 7f60: 806c7f88 806c7f78 8000fbcc 8000fbd0 6013 r7:806c7f64 r6: r5:6013 r4:8000fbd0 [8000fb90] (default_idle+0x0/0x4c) from [8001015c] (cpu_idle+0xbc/0xf8) [800100a0] (cpu_idle+0x0/0xf8) from [804e5334] (rest_init+0x6c/0x84) r9:412fc09a r8:1000406a r7:8fff r6:806a4528 r5:80712980 r4:806cf5b0 [804e52c8] (rest_init+0x0/0x84) from [80668940] (start_kernel+0x29c/0x2ec) [806686a4] (start_kernel+0x0/0x2ec) from [10008078] (0x10008078) Code: e12fff33 e5953200 e353 0a02 (e5933014) ---[ end trace aade28ad434062bd ]--- Kernel panic - not syncing: 0xbf8bdfa8) df60: 000f 8001aea0 bf8bc000 80712a48 804f0040 df80: 806d29e8 412fc09a bf8bdfb4 bf8bdfb8 bf8bdfa8 8000fbcc 8000fbd0 dfa0: 6013 r7:bf8bdf94 r6:
[PATCH v8 4/8] usb: chipidea: consolidate kinds of APIs for both roles
- Create/destroy the gadget at udc's init and destory function - start/stop API are used at otg id switch and probe routine - Defer some gadget operations at ci's delayed work queue Signed-off-by: Peter Chen peter.c...@freescale.com diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h index 325d790..3ebe87a 100644 --- a/drivers/usb/chipidea/ci.h +++ b/drivers/usb/chipidea/ci.h @@ -205,7 +205,6 @@ static inline void ci_role_stop(struct ci13xxx *ci) ci-roles[role]-stop(ci); } - /** * REGISTERS */ diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index fbb6984..eacaf9f 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -360,27 +360,16 @@ static void ci_handle_id_switch(struct ci13xxx *ci) ci_role(ci)-name, ci-roles[role]-name); /* 1. Finish the current role */ - if (ci-role == CI_ROLE_GADGET) { - usb_gadget_vbus_disconnect(ci-gadget); - /* host doesn't care B_SESSION_VALID event */ - ci_clear_otg_interrupt(ci, OTGSC_BSVIS); - ci_disable_otg_interrupt(ci, OTGSC_BSVIE); - ci-role = CI_ROLE_END; - /* reset controller */ - hw_device_reset(ci, USBMODE_CM_IDLE); - } else if (ci-role == CI_ROLE_HOST) { - ci_role_stop(ci); - /* reset controller */ - hw_device_reset(ci, USBMODE_CM_IDLE); - } + ci_role_stop(ci); + hw_device_reset(ci, USBMODE_CM_IDLE); /* 2. Turn on/off vbus according to coming role */ - if (ci_otg_role(ci) == CI_ROLE_GADGET) { + if (role == CI_ROLE_GADGET) { otg_set_vbus(ci-otg, false); /* wait vbus lower than OTGSC_BSV */ hw_wait_reg(ci, OP_OTGSC, OTGSC_BSV, 0, CI_VBUS_STABLE_TIMEOUT); - } else if (ci_otg_role(ci) == CI_ROLE_HOST) { + } else if (role == CI_ROLE_HOST) { otg_set_vbus(ci-otg, true); /* wait vbus higher than OTGSC_AVV */ hw_wait_reg(ci, OP_OTGSC, OTGSC_AVV, OTGSC_AVV, @@ -388,13 +377,7 @@ static void ci_handle_id_switch(struct ci13xxx *ci) } /* 3. Begin the new role */ - if (ci_otg_role(ci) == CI_ROLE_GADGET) { - ci-role = role; - ci_clear_otg_interrupt(ci, OTGSC_BSVIS); - ci_enable_otg_interrupt(ci, OTGSC_BSVIE); - } else if (ci_otg_role(ci) == CI_ROLE_HOST) { - ci_role_start(ci, role); - } + ci_role_start(ci, role); } } @@ -433,8 +416,24 @@ static void ci_delayed_work(struct work_struct *work) struct delayed_work *dwork = to_delayed_work(work); struct ci13xxx *ci = container_of(dwork, struct ci13xxx, dwork); - otg_set_vbus(ci-otg, true); + if (ci-role == CI_ROLE_GADGET) { + /* +* if it is device mode: +* - Enable vbus detect +* - If it has already connected to host, notify udc +*/ + ci_enable_otg_interrupt(ci, OTGSC_BSVIE); + ci_handle_vbus_change(ci); + } else if (ci-is_otg (ci-role == CI_ROLE_HOST)) { + /* USB Device at the MicroB to A cable */ + otg_set_vbus(ci-otg, true); + } +} +static inline void ci_role_destroy(struct ci13xxx *ci) +{ + ci_hdrc_gadget_destroy(ci); + ci_hdrc_host_destroy(ci); } static ssize_t show_role(struct device *dev, struct device_attribute *attr, @@ -577,7 +576,6 @@ static int ci_hdrc_probe(struct platform_device *pdev) void __iomem*base; int ret; enum usb_dr_mode dr_mode; - u32 otgsc; if (!dev-platform_data) { dev_err(dev, platform data missing\n); @@ -674,18 +672,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) if (ret) { dev_err(dev, can't start %s role\n, ci_role(ci)-name); ret = -ENODEV; - goto rm_wq; - } - - otgsc = hw_read(ci, OP_OTGSC, ~0); - /* -* if it is device mode: -* - Enable vbus detect -* - If it has already connected to host, notify udc -*/ - if (ci-role == CI_ROLE_GADGET) { - ci_enable_otg_interrupt(ci, OTGSC_BSVIE); - ci_handle_vbus_change(ci); + goto free_memory; } platform_set_drvdata(pdev, ci);
Re: Linux USB file storage gadget with new UDC
Hi, Thanks, i added in UDC driver to call bulk_in_complete for every request over a bulk in ep, now the gadget driver is able to process UDC shouldn't call bulk_in_complete() directly, you should be calling request-complete() instead. Yes, the UDC driver calls the request-complete() which in turn calls the bulk_in_complete(). I am sorry my writing is not clear. When it comes to SCSI Read Format Capacities command, the gadget driver gives attention condition error in check_command() in the code snippet below, and the command is not processed by do_read_format_capacities(). if (curlun curlun-unit_attention_data != SS_NO_SENSE fsg-cmnd[0] != INQUIRY fsg-cmnd[0] != REQUEST_SENSE) { curlun-sense_data = curlun-unit_attention_data; curlun-unit_attention_data = SS_NO_SENSE; return -EINVAL; } Besides the code snippet, the only place that sets unit_attention data to SS_NO_SENSE is in handle_exception(). How is UDC driver able to overcome this problem? SCSI READ CAPACITY also has the same attention condition problem. What can i do now? Victor -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 01/13] usb: phy: nop: Add device tree support and binding information
On 02/05/2013 09:26 AM, Felipe Balbi wrote: Hi, On Mon, Feb 04, 2013 at 05:58:48PM +0200, Roger Quadros wrote: The PHY clock, clock rate, VCC regulator and RESET regulator can now be provided via device tree. Signed-off-by: Roger Quadros rog...@ti.com --- .../devicetree/bindings/usb/usb-nop-xceiv.txt | 34 drivers/usb/otg/nop-usb-xceiv.c| 31 ++ 2 files changed, 65 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt diff --git a/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt new file mode 100644 index 000..d7e2726 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt @@ -0,0 +1,34 @@ +USB NOP PHY + +Required properties: +- compatible: should be usb-nop-xceiv + +Optional properties: +- clocks: phandle to the PHY clock. Use as per Documentation/devicetree + /bindings/clock/clock-bindings.txt + This property is required if clock-frequency is specified. + +- clock-names: Should be main_clk + +- clock-frequency: the clock frequency (in Hz) that the PHY clock must + be configured to. + +- vcc-supply: phandle to the regulator that provides RESET to the PHY. + +- reset-supply: phandle to the regulator that provides power to the PHY. + +Example: + +hsusb1_phy { +compatible = usb-nop-xceiv; +clock-frequency = 1920; +clocks = osc 0; +clock-names = main_clk; +vcc-supply = hsusb1_vcc_regulator; +reset-supply = hsusb1_reset_regulator; +}; + +hsusb1_phy is a NOP USB PHY device that gets its clock from an oscillator +and expects that clock to be configured to 19.2MHz by the NOP PHY driver. +hsusb1_vcc_regulator provides power to the PHY and hsusb1_reset_regulator +controls RESET. diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c index ac027a1..adbb7ab 100644 --- a/drivers/usb/otg/nop-usb-xceiv.c +++ b/drivers/usb/otg/nop-usb-xceiv.c @@ -34,6 +34,7 @@ #include linux/slab.h #include linux/clk.h #include linux/regulator/consumer.h +#include linux/of.h struct nop_usb_xceiv { struct usb_phy phy; @@ -138,8 +139,19 @@ static int nop_set_host(struct usb_otg *otg, struct usb_bus *host) return 0; } +static void nop_xeiv_get_dt_pdata(struct device *dev, asking to remove, but xeiv != xceiv :-) +struct nop_usb_xceiv_platform_data *pdata) +{ +struct device_node *node = dev-of_node; +u32 clk_rate; + +if (!of_property_read_u32(node, clock-frequency, clk_rate)) +pdata-clk_rate = clk_rate; +} + static int nop_usb_xceiv_probe(struct platform_device *pdev) { +struct device *dev = pdev-dev; struct nop_usb_xceiv_platform_data *pdata = pdev-dev.platform_data; struct nop_usb_xceiv*nop; enum usb_phy_type type = USB_PHY_TYPE_USB2; @@ -153,6 +165,17 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev) if (!nop-phy.otg) return -ENOMEM; +if (dev-of_node) { +pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); +if (!pdata) { +dev_err(dev, Memory allocation failure\n); +return -ENOMEM; +} +nop_xeiv_get_dt_pdata(dev, pdata); actually, I would prefer to not create pdata at all. I mean, ideally pdata would be used to initialize fields in your own structure, so first move clk_rate to your own private structure, copy pdata's clk_rate value to that, then you don't need this hackery when using DT. OK, got it. Will revise. cheers, -roger -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 02/13] USB: phy: nop: Defer probe if device needs VCC/RESET
On 02/05/2013 07:54 AM, kishon wrote: On Monday 04 February 2013 09:28 PM, Roger Quadros wrote: Add 2 flags, needs_vcc and needs_reset to platform data. If the flag is set and the regulator couldn't be found then we bail out with -EPROBE_DEFER. For device tree boot we depend on presensce of vcc-supply/ reset-supply properties to decide if we should bail out with -EPROBE_DEFER or just continue in case the regulator can't be found. This is required for proper functionality in cases where the regulator is needed but is probed later than the PHY device. Signed-off-by: Roger Quadros rog...@ti.com --- drivers/usb/otg/nop-usb-xceiv.c |8 include/linux/usb/nop-usb-xceiv.h |4 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c index adbb7ab..7860e7569 100644 --- a/drivers/usb/otg/nop-usb-xceiv.c +++ b/drivers/usb/otg/nop-usb-xceiv.c @@ -147,6 +147,10 @@ static void nop_xeiv_get_dt_pdata(struct device *dev, if (!of_property_read_u32(node, clock-frequency, clk_rate)) pdata-clk_rate = clk_rate; +if (of_property_read_bool(node, vcc-supply)) +pdata-needs_vcc = true; This can be written as.. pdata-needs_vcc = of_property_read_bool(node, vcc-supply); OK. +if (of_property_read_bool(node, reset-supply)) +pdata-needs_reset = true; same here.. } static int nop_usb_xceiv_probe(struct platform_device *pdev) @@ -205,12 +209,16 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev) if (IS_ERR(nop-vcc)) { dev_dbg(pdev-dev, Error getting vcc regulator: %ld\n, PTR_ERR(nop-vcc)); +if (pdata-needs_vcc) +return -EPROBE_DEFER; } nop-reset = devm_regulator_get(pdev-dev, reset); if (IS_ERR(nop-reset)) { dev_dbg(pdev-dev, Error getting reset regulator: %ld\n, PTR_ERR(nop-reset)); +if (pdata-needs_reset) +return -EPROBE_DEFER; } nop-dev= pdev-dev; diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/nop-usb-xceiv.h index 3265b61..148d351 100644 --- a/include/linux/usb/nop-usb-xceiv.h +++ b/include/linux/usb/nop-usb-xceiv.h @@ -6,6 +6,10 @@ struct nop_usb_xceiv_platform_data { enum usb_phy_type type; unsigned long clk_rate; + +/* if set fails with -EPROBE_DEFER if can't get regulator */ +unsigned int needs_vcc:1; +unsigned int needs_reset:1; how about u8 here? Not sure. Bitfields are usually defined as unsigned int. cheers, -roger -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 04/13] mfd: omap-usb-tll: Add device tree support
On 02/05/2013 08:04 AM, kishon wrote: On Monday 04 February 2013 09:28 PM, Roger Quadros wrote: Enable this driver to probe in device tree boot. CC: Samuel Ortiz sa...@linux.intel.com Signed-off-by: Roger Quadros rog...@ti.com --- .../devicetree/bindings/mfd/omap-usb-tll.txt | 17 + drivers/mfd/omap-usb-tll.c |9 + 2 files changed, 26 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-tll.txt diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-tll.txt b/Documentation/devicetree/bindings/mfd/omap-usb-tll.txt new file mode 100644 index 000..835cf4f --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/omap-usb-tll.txt @@ -0,0 +1,17 @@ +OMAP HS USB Host TLL (Transceiver-Less Interface) + +Required properties: + +- compatible : should be ti,usbhs-tll +- reg : should contain one register range i.e. start and length +- interrupts : should contain the TLL module's interrupt +- ti,hwmod : must contain usb_tll_hs + +Example: + +usbhstll: usbhstll@0x4a062000 { The node name shouldn't have 0x. This comment applies to all your patches adding device tree support. OK, will fix. cheers, -roger -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 09/13] mfd: omap-usb-host: Add device tree support and binding information
On 02/05/2013 08:16 AM, kishon wrote: On Monday 04 February 2013 09:28 PM, Roger Quadros wrote: Allows the OMAP HS USB host controller to be specified via device tree. CC: Samuel Ortiz sa...@linux.intel.com Signed-off-by: Roger Quadros rog...@ti.com --- .../devicetree/bindings/mfd/omap-usb-host.txt | 68 drivers/mfd/omap-usb-host.c| 83 ++-- 2 files changed, 145 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-host.txt diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt new file mode 100644 index 000..2196893 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt @@ -0,0 +1,68 @@ +OMAP HS USB Host + +Required properties: + +- compatible: should be ti,usbhs-host +- reg: should contain one register range i.e. start and length +- ti,hwmods: must contain usb_host_hs + +Optional properties: + +- nports: number of USB ports. Usually this is automatically detected + from the IP's revision register but can be overridden by specifying + this property. + +- portN_mode: Integer specifying the port mode for port N, where N can be + from 1 to nports. The port mode must be as per enum usbhs_omap_port_mode + in include/linux/platform_data/usb-omap.h + If the port mode is not specified, that port is treated as unused. + +- single_ulpi_bypass: Must be present if the controller contains a single + ULPI bypass control bit. e.g. OMAP3 silicon = ES2.1 + +Required properties if child node exists: + +- #address-cells: Must be 1 +- #size-cells: Must be 1 +- ranges: must be present + +Properties for children: + +The OMAP HS USB Host subsystem contains EHCI and OHCI controllers. +See Documentation/devicetree/bindings/usb/omap-ehci.txt and +omap3-ohci.txt + +Example for OMAP4: + +usbhshost: usbhshost@0x4a064000 { +compatible = ti,usbhs-host; +reg = 0x4a064000 0x800; +ti,hwmods = usb_host_hs; +#address-cells = 1; +#size-cells = 1; +ranges; + +usbhsohci: ohci@0x4a064800 { +compatible = ti,omap3-ohci, usb-ohci; +reg = 0x4a064800 0x400; +interrupt-parent = gic; +interrupts = 0 76 0x4; +}; + +usbhsehci: ehci@0x4a064c00 { +compatible = ti,omap-ehci, usb-ehci; +reg = 0x4a064c00 0x400; +interrupt-parent = gic; +interrupts = 0 77 0x4; +}; +}; + +usbhshost { +port1_mode = 1; /* OMAP_EHCI_PORT_MODE_PHY */ +port2_mode = 2; /* OMAP_EHCI_PORT_MODE_TLL */ +port3_mode = 1; /* OMAP_EHCI_PORT_MODE_PHY */ +}; + +usbhsehci { +phy = hsusb1_phy 0 hsusb3_phy; +}; diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index f8ed08e..0f67856 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -1,8 +1,9 @@ /** * omap-usb-host.c - The USBHS core driver for OMAP EHCI OHCI * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com + * Copyright (C) 2011-2013 Texas Instruments Incorporated - http://www.ti.com * Author: Keshava Munegowda keshava_mgo...@ti.com + * Author: Roger Quadros rog...@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 of @@ -27,6 +28,8 @@ #include linux/platform_device.h #include linux/platform_data/usb-omap.h #include linux/pm_runtime.h +#include linux/of.h +#include linux/of_platform.h #include omap-usb.h @@ -464,6 +467,37 @@ static void omap_usbhs_init(struct device *dev) pm_runtime_put_sync(dev); } +static int usbhs_omap_get_dt_pdata(struct device_node *node, +struct usbhs_omap_platform_data *pdata) +{ +int ret, i; + +ret = of_property_read_u32(node, nports, pdata-nports); +if (ret) +pdata-nports = 0; + +/* get port modes */ +for (i = 0; i OMAP3_HS_USB_PORTS; i++) { +char prop[11]; + +snprintf(prop, sizeof(prop), port%d_mode, i + 1); +ret = of_property_read_u32(node, prop, pdata-port_mode[i]); +if (ret) +pdata-port_mode[i] = OMAP_USBHS_PORT_MODE_UNUSED; +} + +/* get flags */ +pdata-single_ulpi_bypass = of_property_read_bool(node, +single_ulpi_bypass); +return 0; +} + +static struct of_device_id usbhs_child_match_table[] __initdata = { +{ .compatible = ti,omap-ehci, }, +{ .compatible = ti,omap-ohci, }, +{ } +}; + /** * usbhs_omap_probe - initialize TI-based HCDs * @@ -479,6 +513,21 @@ static int usbhs_omap_probe(struct platform_device *pdev) inti; boolneed_logic_fck; +if (dev-of_node) { +/* For DT boot we populate platform data from OF node */ +
Re: [PATCH 10/13] ARM: dts: OMAP4: Add HS USB Host IP nodes
On 02/05/2013 08:24 AM, kishon wrote: On Monday 04 February 2013 09:28 PM, Roger Quadros wrote: Adds device nodes for HS USB Host module, TLL module, OHCI and EHCI controllers. Signed-off-by: Roger Quadros rog...@ti.com --- arch/arm/boot/dts/omap4.dtsi | 30 ++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi index 739bb79..3429280 100644 --- a/arch/arm/boot/dts/omap4.dtsi +++ b/arch/arm/boot/dts/omap4.dtsi @@ -529,5 +529,35 @@ ti,hwmods = timer11; ti,timer-pwm; }; + +usbhstll: usbhstll@0x4a062000 { +compatible = ti,usbhs-tll; +reg = 0x4a062000 0x1000; +interrupts = 0 78 0x4; +ti,hwmods = usb_tll_hs; +}; + +usbhshost: usbhshost@0x4a064000 { +compatible = ti,usbhs-host; +reg = 0x4a064000 0x800; +ti,hwmods = usb_host_hs; +#address-cells = 1; +#size-cells = 1; +ranges; + +usbhsohci: ohci@0x4a064800 { +compatible = ti,omap3-ohci, usb-ohci; +reg = 0x4a064800 0x400; +interrupt-parent = gic; Just curious.. Were you facing issues if you are not having interrupt-parent here? It's also missing in your dt node usbhstll. Yes I was. Interrupt-parent is not there in any of the children which are at the same level as usbhstll. cheers, -roger -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 10/13] ARM: dts: OMAP4: Add HS USB Host IP nodes
On Tuesday 05 February 2013 02:24 PM, Roger Quadros wrote: On 02/05/2013 08:24 AM, kishon wrote: On Monday 04 February 2013 09:28 PM, Roger Quadros wrote: Adds device nodes for HS USB Host module, TLL module, OHCI and EHCI controllers. Signed-off-by: Roger Quadros rog...@ti.com --- arch/arm/boot/dts/omap4.dtsi | 30 ++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi index 739bb79..3429280 100644 --- a/arch/arm/boot/dts/omap4.dtsi +++ b/arch/arm/boot/dts/omap4.dtsi @@ -529,5 +529,35 @@ ti,hwmods = timer11; ti,timer-pwm; }; + +usbhstll: usbhstll@0x4a062000 { +compatible = ti,usbhs-tll; +reg = 0x4a062000 0x1000; +interrupts = 0 78 0x4; +ti,hwmods = usb_tll_hs; +}; + +usbhshost: usbhshost@0x4a064000 { +compatible = ti,usbhs-host; +reg = 0x4a064000 0x800; +ti,hwmods = usb_host_hs; +#address-cells = 1; +#size-cells = 1; +ranges; + +usbhsohci: ohci@0x4a064800 { +compatible = ti,omap3-ohci, usb-ohci; +reg = 0x4a064800 0x400; +interrupt-parent = gic; Just curious.. Were you facing issues if you are not having interrupt-parent here? It's also missing in your dt node usbhstll. Yes I was. Interrupt-parent is not there in any of the children which are at the same level as usbhstll. Cool. Thought so :-) Thanks Kishon -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 10/13] ARM: dts: OMAP4: Add HS USB Host IP nodes
On 02/05/2013 09:41 AM, Felipe Balbi wrote: On Mon, Feb 04, 2013 at 05:58:57PM +0200, Roger Quadros wrote: Adds device nodes for HS USB Host module, TLL module, OHCI and EHCI controllers. Signed-off-by: Roger Quadros rog...@ti.com --- arch/arm/boot/dts/omap4.dtsi | 30 ++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi index 739bb79..3429280 100644 --- a/arch/arm/boot/dts/omap4.dtsi +++ b/arch/arm/boot/dts/omap4.dtsi @@ -529,5 +529,35 @@ ti,hwmods = timer11; ti,timer-pwm; }; + +usbhstll: usbhstll@0x4a062000 { +compatible = ti,usbhs-tll; +reg = 0x4a062000 0x1000; +interrupts = 0 78 0x4; +ti,hwmods = usb_tll_hs; +}; + +usbhshost: usbhshost@0x4a064000 { +compatible = ti,usbhs-host; +reg = 0x4a064000 0x800; +ti,hwmods = usb_host_hs; +#address-cells = 1; +#size-cells = 1; +ranges; + +usbhsohci: ohci@0x4a064800 { usbhsohci is a bit misleading :-) How about we stick to ohci and ehci for these nodes ? :-) Was just thinking of a unique label that will point to the OHCI/EHCI controller in the HS USB subsystem. We need the label to provide PHY information in the board DT. If we are sure we won't have another OHCI/EHCI controller then I can just use ehci/ohci. cheers, -roger -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 01/13] usb: phy: nop: Add device tree support and binding information
On Tue, Feb 05, 2013 at 10:30:49AM +0200, Roger Quadros wrote: On 02/05/2013 09:26 AM, Felipe Balbi wrote: Hi, On Mon, Feb 04, 2013 at 05:58:48PM +0200, Roger Quadros wrote: The PHY clock, clock rate, VCC regulator and RESET regulator can now be provided via device tree. Signed-off-by: Roger Quadros rog...@ti.com --- .../devicetree/bindings/usb/usb-nop-xceiv.txt | 34 drivers/usb/otg/nop-usb-xceiv.c| 31 ++ 2 files changed, 65 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt diff --git a/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt new file mode 100644 index 000..d7e2726 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt @@ -0,0 +1,34 @@ +USB NOP PHY + +Required properties: +- compatible: should be usb-nop-xceiv + +Optional properties: +- clocks: phandle to the PHY clock. Use as per Documentation/devicetree + /bindings/clock/clock-bindings.txt + This property is required if clock-frequency is specified. + +- clock-names: Should be main_clk + +- clock-frequency: the clock frequency (in Hz) that the PHY clock must + be configured to. + +- vcc-supply: phandle to the regulator that provides RESET to the PHY. + +- reset-supply: phandle to the regulator that provides power to the PHY. + +Example: + + hsusb1_phy { + compatible = usb-nop-xceiv; + clock-frequency = 1920; + clocks = osc 0; + clock-names = main_clk; + vcc-supply = hsusb1_vcc_regulator; + reset-supply = hsusb1_reset_regulator; + }; + +hsusb1_phy is a NOP USB PHY device that gets its clock from an oscillator +and expects that clock to be configured to 19.2MHz by the NOP PHY driver. +hsusb1_vcc_regulator provides power to the PHY and hsusb1_reset_regulator +controls RESET. diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c index ac027a1..adbb7ab 100644 --- a/drivers/usb/otg/nop-usb-xceiv.c +++ b/drivers/usb/otg/nop-usb-xceiv.c @@ -34,6 +34,7 @@ #include linux/slab.h #include linux/clk.h #include linux/regulator/consumer.h +#include linux/of.h struct nop_usb_xceiv { struct usb_phy phy; @@ -138,8 +139,19 @@ static int nop_set_host(struct usb_otg *otg, struct usb_bus *host) return 0; } +static void nop_xeiv_get_dt_pdata(struct device *dev, asking to remove, but xeiv != xceiv :-) + struct nop_usb_xceiv_platform_data *pdata) +{ + struct device_node *node = dev-of_node; + u32 clk_rate; + + if (!of_property_read_u32(node, clock-frequency, clk_rate)) + pdata-clk_rate = clk_rate; +} + static int nop_usb_xceiv_probe(struct platform_device *pdev) { + struct device *dev = pdev-dev; struct nop_usb_xceiv_platform_data *pdata = pdev-dev.platform_data; struct nop_usb_xceiv*nop; enum usb_phy_type type = USB_PHY_TYPE_USB2; @@ -153,6 +165,17 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev) if (!nop-phy.otg) return -ENOMEM; + if (dev-of_node) { + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) { + dev_err(dev, Memory allocation failure\n); + return -ENOMEM; + } + nop_xeiv_get_dt_pdata(dev, pdata); actually, I would prefer to not create pdata at all. I mean, ideally pdata would be used to initialize fields in your own structure, so first move clk_rate to your own private structure, copy pdata's clk_rate value to that, then you don't need this hackery when using DT. OK, got it. Will revise. Cool, after that you can add my: Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 02/13] USB: phy: nop: Defer probe if device needs VCC/RESET
On Tue, Feb 05, 2013 at 10:44:05AM +0200, Roger Quadros wrote: diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/nop-usb-xceiv.h index 3265b61..148d351 100644 --- a/include/linux/usb/nop-usb-xceiv.h +++ b/include/linux/usb/nop-usb-xceiv.h @@ -6,6 +6,10 @@ struct nop_usb_xceiv_platform_data { enum usb_phy_type type; unsigned long clk_rate; + +/* if set fails with -EPROBE_DEFER if can't get regulator */ +unsigned int needs_vcc:1; +unsigned int needs_reset:1; how about u8 here? Not sure. Bitfields are usually defined as unsigned int. IIRC the benefit is that compiler can try to optimize those flags. I mean, if you have 32 1-bit flags, compiler will combine those in a single u32. Someone correct me if I'm wrong. after you fix other comments from kishon (about of_read_bool()), you can add my: Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 01/30] USB: EHCI: split ehci-omap out to a separate driver
On Mon, Jan 28, 2013 at 01:30:02PM +0200, Roger Quadros wrote: From: Alan Stern st...@rowland.harvard.edu This patch (as1645) converts ehci-omap over to the new ehci-hcd is a library approach, so that it can coexist peacefully with other EHCI platform drivers and can make use of the private area allocated at the end of struct ehci_hcd. Signed-off-by: Alan Stern st...@rowland.harvard.edu for ehci-omap: Acked-by: Felipe Balbi ba...@ti.com --- drivers/usb/host/Kconfig |2 +- drivers/usb/host/Makefile|1 + drivers/usb/host/ehci-hcd.c |6 +--- drivers/usb/host/ehci-omap.c | 76 +++--- 4 files changed, 37 insertions(+), 48 deletions(-) diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 3a21c5d..11e102e 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -155,7 +155,7 @@ config USB_EHCI_MXC Variation of ARC USB block used in some Freescale chips. config USB_EHCI_HCD_OMAP - bool EHCI support for OMAP3 and later chips + tristate EHCI support for OMAP3 and later chips depends on USB_EHCI_HCD ARCH_OMAP default y ---help--- diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index 001fbff..56de410 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile @@ -27,6 +27,7 @@ obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o obj-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o obj-$(CONFIG_USB_EHCI_HCD_PLATFORM) += ehci-platform.o obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o +obj-$(CONFIG_USB_EHCI_HCD_OMAP) += ehci-omap.o obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o obj-$(CONFIG_USB_ISP116X_HCD)+= isp116x-hcd.o diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 09537b2..5a35246 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -1251,11 +1251,6 @@ MODULE_LICENSE (GPL); #define PLATFORM_DRIVER ehci_hcd_sh_driver #endif -#ifdef CONFIG_USB_EHCI_HCD_OMAP -#include ehci-omap.c -#definePLATFORM_DRIVER ehci_hcd_omap_driver -#endif - #ifdef CONFIG_PPC_PS3 #include ehci-ps3.c #define PS3_SYSTEM_BUS_DRIVER ps3_ehci_driver @@ -1345,6 +1340,7 @@ MODULE_LICENSE (GPL); !IS_ENABLED(CONFIG_USB_EHCI_HCD_PLATFORM) \ !IS_ENABLED(CONFIG_USB_CHIPIDEA_HOST) \ !IS_ENABLED(CONFIG_USB_EHCI_MXC) \ + !IS_ENABLED(CONFIG_USB_EHCI_HCD_OMAP) \ !defined(PLATFORM_DRIVER) \ !defined(PS3_SYSTEM_BUS_DRIVER) \ !defined(OF_PLATFORM_DRIVER) \ diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index b96a4bf..30fc482 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -36,6 +36,9 @@ * - convert to use hwmod and runtime PM */ +#include linux/kernel.h +#include linux/module.h +#include linux/io.h #include linux/platform_device.h #include linux/slab.h #include linux/usb/ulpi.h @@ -43,6 +46,10 @@ #include linux/pm_runtime.h #include linux/gpio.h #include linux/clk.h +#include linux/usb.h +#include linux/usb/hcd.h + +#include ehci.h #include linux/platform_data/usb-omap.h @@ -57,9 +64,11 @@ #define EHCI_INSNREG05_ULPI_EXTREGADD_SHIFT 8 #define EHCI_INSNREG05_ULPI_WRDATA_SHIFT0 -/*-*/ +#define DRIVER_DESC OMAP-EHCI Host Controller driver -static const struct hc_driver ehci_omap_hc_driver; +static const char hcd_name[] = ehci-omap; + +/*-*/ static inline void ehci_write(void __iomem *base, u32 reg, u32 val) @@ -166,6 +175,12 @@ static void disable_put_regulator( /* configure so an HC device and id are always provided */ /* always called with process context; sleeping is OK */ +static struct hc_driver __read_mostly ehci_omap_hc_driver; + +static const struct ehci_driver_overrides ehci_omap_overrides __initdata = { + .reset =omap_ehci_init, +}; + /** * ehci_hcd_omap_probe - initialize TI-based HCDs * @@ -315,56 +330,33 @@ static struct platform_driver ehci_hcd_omap_driver = { /*.suspend = ehci_hcd_omap_suspend, */ /*.resume = ehci_hcd_omap_resume, */ .driver = { - .name = ehci-omap, + .name = hcd_name, } }; /*-*/ -static const struct hc_driver ehci_omap_hc_driver = { - .description= hcd_name, - .product_desc = OMAP-EHCI Host Controller, - .hcd_priv_size = sizeof(struct ehci_hcd), - - /* - * generic hardware linkage - */ - .irq= ehci_irq, - .flags = HCD_MEMORY
Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend
On Tue, Jan 29, 2013 at 10:30:05AM -0500, Alan Stern wrote: On Tue, 29 Jan 2013, Roger Quadros wrote: For each port that is in PHY mode we obtain a PHY device using the USB PHY library and put it out of suspend. It is up to platform code to associate the PHY to the controller's port and it is upto the PHY driver to manage the PHY's resources. s/upto/up to/ Also remove wired spacing around declarations we come across. s/wired/weird/ -- not that people care about misspellings in the Changelog. You don't have to resubmit the patch just to fix these two items. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Alan Stern st...@rowland.harvard.edu Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 02/30] usb: phy: nop: use devm_kzalloc()
On Mon, Jan 28, 2013 at 01:30:03PM +0200, Roger Quadros wrote: Use resource managed kzalloc. Signed-off-by: Roger Quadros rog...@ti.com --- Acked-by: Felipe Balbi ba...@ti.com drivers/usb/otg/nop-usb-xceiv.c | 16 1 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c index a3ce24b..7ffb0c8 100644 --- a/drivers/usb/otg/nop-usb-xceiv.c +++ b/drivers/usb/otg/nop-usb-xceiv.c @@ -100,15 +100,13 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev) enum usb_phy_type type = USB_PHY_TYPE_USB2; int err; - nop = kzalloc(sizeof *nop, GFP_KERNEL); + nop = devm_kzalloc(pdev-dev, sizeof *nop, GFP_KERNEL); if (!nop) return -ENOMEM; - nop-phy.otg = kzalloc(sizeof *nop-phy.otg, GFP_KERNEL); - if (!nop-phy.otg) { - kfree(nop); + nop-phy.otg = devm_kzalloc(pdev-dev, sizeof *nop-phy.otg, GFP_KERNEL); + if (!nop-phy.otg) return -ENOMEM; - } if (pdata) type = pdata-type; @@ -127,7 +125,7 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev) if (err) { dev_err(pdev-dev, can't register transceiver, err: %d\n, err); - goto exit; + return err; } platform_set_drvdata(pdev, nop); @@ -135,10 +133,6 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev) ATOMIC_INIT_NOTIFIER_HEAD(nop-phy.notifier); return 0; -exit: - kfree(nop-phy.otg); - kfree(nop); - return err; } static int nop_usb_xceiv_remove(struct platform_device *pdev) @@ -148,8 +142,6 @@ static int nop_usb_xceiv_remove(struct platform_device *pdev) usb_remove_phy(nop-phy); platform_set_drvdata(pdev, NULL); - kfree(nop-phy.otg); - kfree(nop); return 0; } -- 1.7.4.1 -- balbi signature.asc Description: Digital signature
Re: [PATCH v2 03/30] usb: phy: nop: Manage PHY clock
Hi, On Mon, Jan 28, 2013 at 01:30:04PM +0200, Roger Quadros wrote: If the PHY has a clock associated to it then manage the clock. We just enable the clock in .init() and disable it in .shutdown(). Add clk_rate parameter in platform data and configure the clock rate during probe if supplied. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com --- drivers/usb/otg/nop-usb-xceiv.c | 54 - include/linux/usb/nop-usb-xceiv.h |1 + 2 files changed, 54 insertions(+), 1 deletions(-) diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c index 7ffb0c8..849eb9d 100644 --- a/drivers/usb/otg/nop-usb-xceiv.c +++ b/drivers/usb/otg/nop-usb-xceiv.c @@ -32,10 +32,12 @@ #include linux/usb/otg.h #include linux/usb/nop-usb-xceiv.h #include linux/slab.h +#include linux/clk.h struct nop_usb_xceiv { struct usb_phy phy; struct device *dev; + struct clk *clk; }; static struct platform_device *pd; @@ -64,6 +66,24 @@ static int nop_set_suspend(struct usb_phy *x, int suspend) return 0; } +static int nop_init(struct usb_phy *phy) +{ + struct nop_usb_xceiv *nop = dev_get_drvdata(phy-dev); + + if (!IS_ERR(nop-clk)) + clk_enable(nop-clk); + + return 0; +} + +static void nop_shutdown(struct usb_phy *phy) +{ + struct nop_usb_xceiv *nop = dev_get_drvdata(phy-dev); + + if (!IS_ERR(nop-clk)) + clk_disable(nop-clk); +} + static int nop_set_peripheral(struct usb_otg *otg, struct usb_gadget *gadget) { if (!otg) @@ -111,10 +131,34 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev) if (pdata) type = pdata-type; + nop-clk = devm_clk_get(pdev-dev, main_clk); + if (IS_ERR(nop-clk)) { + dev_dbg(pdev-dev, Can't get phy clock: %ld\n, + PTR_ERR(nop-clk)); + } + + if (!IS_ERR(nop-clk) pdata pdata-clk_rate) { + err = clk_set_rate(nop-clk, pdata-clk_rate); + if (err) { + dev_err(pdev-dev, Error setting clock rate\n); + return err; + } + } + + if (!IS_ERR(nop-clk)) { + err = clk_prepare(nop-clk); + if (err) { + dev_err(pdev-dev, Error preparing clock\n); + return err; + } + } + nop-dev= pdev-dev; nop-phy.dev= nop-dev; nop-phy.label = nop-xceiv; nop-phy.set_suspend= nop_set_suspend; + nop-phy.init = nop_init; + nop-phy.shutdown = nop_shutdown; nop-phy.state = OTG_STATE_UNDEFINED; nop-phy.otg-phy = nop-phy; @@ -125,7 +169,7 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev) if (err) { dev_err(pdev-dev, can't register transceiver, err: %d\n, err); - return err; + goto err_add; } platform_set_drvdata(pdev, nop); @@ -133,12 +177,20 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev) ATOMIC_INIT_NOTIFIER_HEAD(nop-phy.notifier); return 0; + +err_add: + if (!IS_ERR(nop-clk)) + clk_unprepare(nop-clk); + return err; } static int nop_usb_xceiv_remove(struct platform_device *pdev) { struct nop_usb_xceiv *nop = platform_get_drvdata(pdev); + if (!IS_ERR(nop-clk)) + clk_unprepare(nop-clk); + usb_remove_phy(nop-phy); platform_set_drvdata(pdev, NULL); diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/nop-usb-xceiv.h index 28884c7..3265b61 100644 --- a/include/linux/usb/nop-usb-xceiv.h +++ b/include/linux/usb/nop-usb-xceiv.h @@ -5,6 +5,7 @@ struct nop_usb_xceiv_platform_data { enum usb_phy_type type; + unsigned long clk_rate; }; #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) defined(MODULE)) -- 1.7.4.1 -- balbi signature.asc Description: Digital signature
Re: [PATCH v2 05/30] usb: phy: nop: Handle RESET for the PHY
On Mon, Jan 28, 2013 at 01:30:06PM +0200, Roger Quadros wrote: We expect the RESET line to be modeled as a regulator with supply name reset. The regulator should be modeled such that enabling the regulator brings the PHY device out of RESET and disabling the regulator holds the device in RESET. They PHY will be held in RESET in .shutdown() and brought out of RESET in .init(). Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com --- drivers/usb/otg/nop-usb-xceiv.c | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c index 0a9628c..3060ed0 100644 --- a/drivers/usb/otg/nop-usb-xceiv.c +++ b/drivers/usb/otg/nop-usb-xceiv.c @@ -40,6 +40,7 @@ struct nop_usb_xceiv { struct device *dev; struct clk *clk; struct regulator*vcc; + struct regulator*reset; }; static struct platform_device *pd; @@ -80,6 +81,12 @@ static int nop_init(struct usb_phy *phy) if (!IS_ERR(nop-clk)) clk_enable(nop-clk); + if (!IS_ERR(nop-reset)) { + /* De-assert RESET */ + if (regulator_enable(nop-reset)) + dev_err(phy-dev, Failed to de-assert reset\n); + } + return 0; } @@ -87,6 +94,12 @@ static void nop_shutdown(struct usb_phy *phy) { struct nop_usb_xceiv *nop = dev_get_drvdata(phy-dev); + if (!IS_ERR(nop-reset)) { + /* Assert RESET */ + if (regulator_disable(nop-reset)) + dev_err(phy-dev, Failed to assert reset\n); + } + if (!IS_ERR(nop-clk)) clk_disable(nop-clk); @@ -171,6 +184,12 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev) PTR_ERR(nop-vcc)); } + nop-reset = devm_regulator_get(pdev-dev, reset); + if (IS_ERR(nop-reset)) { + dev_dbg(pdev-dev, Error getting reset regulator: %ld\n, + PTR_ERR(nop-reset)); + } + nop-dev= pdev-dev; nop-phy.dev= nop-dev; nop-phy.label = nop-xceiv; -- 1.7.4.1 -- balbi signature.asc Description: Digital signature
Re: [PATCH 06/30] usb: phy: nop: use new PHY API to register PHY
On Mon, Jan 28, 2013 at 01:30:07PM +0200, Roger Quadros wrote: We would need to support multiple PHYs of the same type so use the new PHY API usb_add_phy_dev() to register the PHY. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com --- drivers/usb/otg/nop-usb-xceiv.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c index 3060ed0..ac027a1 100644 --- a/drivers/usb/otg/nop-usb-xceiv.c +++ b/drivers/usb/otg/nop-usb-xceiv.c @@ -197,12 +197,13 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev) nop-phy.init = nop_init; nop-phy.shutdown = nop_shutdown; nop-phy.state = OTG_STATE_UNDEFINED; + nop-phy.type = type; nop-phy.otg-phy = nop-phy; nop-phy.otg-set_host = nop_set_host; nop-phy.otg-set_peripheral= nop_set_peripheral; - err = usb_add_phy(nop-phy, type); + err = usb_add_phy_dev(nop-phy); if (err) { dev_err(pdev-dev, can't register transceiver, err: %d\n, err); -- 1.7.4.1 -- balbi signature.asc Description: Digital signature
Re: [PATCH 07/30] mfd: omap-usb-host: update nports in platform_data
On Mon, Jan 28, 2013 at 01:30:08PM +0200, Roger Quadros wrote: EHCI driver would need to know the number of ports available on the platform. We set the nports parameter of platform_data based on IP version if it was not already provided. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Samuel Ortiz sa...@linux.intel.com Acked-by: Felipe Balbi ba...@ti.com --- drivers/mfd/omap-usb-host.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index 6b5edf6..0874352 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -575,6 +575,7 @@ static int usbhs_omap_probe(struct platform_device *pdev) omap-usbhs_rev, omap-nports); break; } + pdata-nports = omap-nports; } i = sizeof(struct clk *) * omap-nports; -- 1.7.4.1 -- balbi signature.asc Description: Digital signature
Re: [PATCH 08/30] mfd: omap-usb-host: Remove PHY reset handling code
On Mon, Jan 28, 2013 at 01:30:09PM +0200, Roger Quadros wrote: PHY reset GPIO handling will be done in the PHY driver Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Samuel Ortiz sa...@linux.intel.com Acked-by: Felipe Balbi ba...@ti.com --- drivers/mfd/omap-usb-host.c | 47 --- 1 files changed, 0 insertions(+), 47 deletions(-) diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index 0874352..502a779 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -430,24 +430,10 @@ static unsigned omap_usbhs_rev2_hostconfig(struct usbhs_hcd_omap *omap, static void omap_usbhs_init(struct device *dev) { struct usbhs_hcd_omap *omap = dev_get_drvdata(dev); - struct usbhs_omap_platform_data *pdata = omap-pdata; unsignedreg; dev_dbg(dev, starting TI HSUSB Controller\n); - if (pdata-phy_reset) { - if (gpio_is_valid(pdata-reset_gpio_port[0])) - gpio_request_one(pdata-reset_gpio_port[0], - GPIOF_OUT_INIT_LOW, USB1 PHY reset); - - if (gpio_is_valid(pdata-reset_gpio_port[1])) - gpio_request_one(pdata-reset_gpio_port[1], - GPIOF_OUT_INIT_LOW, USB2 PHY reset); - - /* Hold the PHY in RESET for enough time till DIR is high */ - udelay(10); - } - pm_runtime_get_sync(dev); reg = usbhs_read(omap-uhh_base, OMAP_UHH_HOSTCONFIG); @@ -476,37 +462,8 @@ static void omap_usbhs_init(struct device *dev) dev_dbg(dev, UHH setup done, uhh_hostconfig=%x\n, reg); pm_runtime_put_sync(dev); - if (pdata-phy_reset) { - /* Hold the PHY in RESET for enough time till - * PHY is settled and ready - */ - udelay(10); - - if (gpio_is_valid(pdata-reset_gpio_port[0])) - gpio_set_value_cansleep - (pdata-reset_gpio_port[0], 1); - - if (gpio_is_valid(pdata-reset_gpio_port[1])) - gpio_set_value_cansleep - (pdata-reset_gpio_port[1], 1); - } -} - -static void omap_usbhs_deinit(struct device *dev) -{ - struct usbhs_hcd_omap *omap = dev_get_drvdata(dev); - struct usbhs_omap_platform_data *pdata = omap-pdata; - - if (pdata-phy_reset) { - if (gpio_is_valid(pdata-reset_gpio_port[0])) - gpio_free(pdata-reset_gpio_port[0]); - - if (gpio_is_valid(pdata-reset_gpio_port[1])) - gpio_free(pdata-reset_gpio_port[1]); - } } - /** * usbhs_omap_probe - initialize TI-based HCDs * @@ -710,8 +667,6 @@ static int usbhs_omap_probe(struct platform_device *pdev) return 0; err_alloc: - omap_usbhs_deinit(pdev-dev); - for (i = 0; i omap-nports; i++) { if (!IS_ERR(omap-utmi_clk[i])) clk_put(omap-utmi_clk[i]); @@ -756,8 +711,6 @@ static int usbhs_omap_remove(struct platform_device *pdev) struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev); int i; - omap_usbhs_deinit(pdev-dev); - for (i = 0; i omap-nports; i++) { if (!IS_ERR(omap-utmi_clk[i])) clk_put(omap-utmi_clk[i]); -- 1.7.4.1 -- balbi signature.asc Description: Digital signature
Re: [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap()
On Mon, Jan 28, 2013 at 01:30:10PM +0200, Roger Quadros wrote: Make use of devm_request_and_ioremap() and correct comment. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com --- drivers/usb/host/ehci-omap.c | 19 +-- 1 files changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 30fc482..fd2f5450 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -216,23 +216,17 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, ehci); - if (!res) { - dev_err(dev, UHH EHCI get resource failed\n); - return -ENODEV; - } - - regs = ioremap(res-start, resource_size(res)); + regs = devm_request_and_ioremap(dev, res); if (!regs) { - dev_err(dev, UHH EHCI ioremap failed\n); - return -ENOMEM; + dev_err(dev, Resource request/ioremap failed\n); + return -EADDRNOTAVAIL; } hcd = usb_create_hcd(ehci_omap_hc_driver, dev, dev_name(dev)); if (!hcd) { - dev_err(dev, failed to create hcd with err %d\n, ret); - ret = -ENOMEM; - goto err_io; + dev_err(dev, Failed to create HCD\n); + return -ENOMEM; } hcd-rsrc_start = res-start; @@ -285,8 +279,6 @@ err_pm_runtime: pm_runtime_put_sync(dev); usb_put_hcd(hcd); -err_io: - iounmap(regs); return ret; } @@ -306,7 +298,6 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev) usb_remove_hcd(hcd); disable_put_regulator(dev-platform_data); - iounmap(hcd-regs); usb_put_hcd(hcd); pm_runtime_put_sync(dev); -- 1.7.4.1 -- balbi signature.asc Description: Digital signature
Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend
On Tue, Jan 29, 2013 at 10:30:05AM -0500, Alan Stern wrote: On Tue, 29 Jan 2013, Roger Quadros wrote: For each port that is in PHY mode we obtain a PHY device using the USB PHY library and put it out of suspend. It is up to platform code to associate the PHY to the controller's port and it is upto the PHY driver to manage the PHY's resources. s/upto/up to/ Also remove wired spacing around declarations we come across. s/wired/weird/ -- not that people care about misspellings in the Changelog. You don't have to resubmit the patch just to fix these two items. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Alan Stern st...@rowland.harvard.edu Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH v2 11/30] usb: ehci-omap: Remove PHY reset handling code
On Mon, Jan 28, 2013 at 12:34:16PM -0500, Alan Stern wrote: On Mon, 28 Jan 2013, Roger Quadros wrote: Reset GPIO handling for the PHY must be done in the PHY driver. We use the PHY helpers instead to reset the PHY. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Alan Stern st...@rowland.harvard.edu Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH v2 12/30] usb: ehci-omap: Remove PHY regulator handling code
On Mon, Jan 28, 2013 at 12:35:25PM -0500, Alan Stern wrote: On Mon, 28 Jan 2013, Roger Quadros wrote: PHY regulator handling must be done in the PHY driver Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Alan Stern st...@rowland.harvard.edu Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH v2 13/30] ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data
On Mon, Jan 28, 2013 at 01:30:14PM +0200, Roger Quadros wrote: Add platform device and data for 'nop-usb-xceiv'. This will be used as PHY for HS USB port 1, so provide binding information for it. Get rid of managing the PHY clock as it will be done by the PHY driver. For that to work we create a clock alias that links the PHY clock name to the PHY device name. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH v2 14/30] ARM: OMAP2+: omap4panda: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:15PM +0200, Roger Quadros wrote: Model RESET and Power for HS USB Port 1 as GPIO fixed regulators and link them to the 'nop-usb-xceiv' PHY by making them as reset and vcc supplies. The RESET and Power will then be managed by the PHY driver. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 17/30] ARM: OMAP3: 3630SDP: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:18PM +0200, Roger Quadros wrote: Add 2 platform devices for 'nop-usb-xceiv'. These will be used as PHYs for HS USB ports 1 and 2 so provide binding information for them. Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and link them to the 2 PHYs we just created. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 15/30] ARM: OMAP3: Beagle: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:16PM +0200, Roger Quadros wrote: Add platform device for 'nop-usb-xceiv'. This will be used as a PHY for HS USB Port 2, so provide binding information for it. Model RESET and Power for HS USB Port 2 as GPIO fixed regulators and link them to the 'nop-usb-xceiv' PHY. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 19/30] ARM: OMAP: AM3517evm: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:20PM +0200, Roger Quadros wrote: Add 2 platform devices for 'nop-usb-xceiv'. These will be used as a PHY for HS USB Port 1 and 2, so provide binding information for them. Model RESET for HS USB Port 1 as GPIO fixed regulator and link it to the 'nop-usb-xceiv' PHY on port 1. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 21/30] ARM: OMAP3: cm-t3517: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:22PM +0200, Roger Quadros wrote: Add 2 platform devices for 'nop-usb-xceiv'. These will be used as PHYs for HS USB ports 1 and 2 so provide binding information for them. Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and link them to the 2 PHYs we just created. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 20/30] ARM: OMAP3: cm-t35: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:21PM +0200, Roger Quadros wrote: Add 2 platform devices for 'nop-usb-xceiv'. These will be used as PHYs for HS USB ports 1 and 2 so provide binding information for them. Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and link them to the 2 PHYs we just created. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 22/30] ARM: OMAP: devkit8000: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:23PM +0200, Roger Quadros wrote: Add platform device for 'nop-usb-xceiv'. This will be used as a PHY for HS USB Port 1, so provide binding information for it. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 23/30] ARM: OMAP3: igep0020: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:24PM +0200, Roger Quadros wrote: Add 2 platform devices for 'nop-usb-xceiv'. These will be used as PHYs for HS USB ports 1 and 2 so provide binding information for them. Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and link them to the 2 PHYs we just created. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 24/30] ARM: OMAP3: omap3evm: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:25PM +0200, Roger Quadros wrote: Add platform device for 'nop-usb-xceiv'. This will be used as a PHY for HS USB Port 2, so provide binding information for it. Model RESET for HS USB Port 2 as GPIO fixed regulator and link it to the 'nop-usb-xceiv' PHY. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 25/30] ARM: OMAP3: omap3pandora: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:26PM +0200, Roger Quadros wrote: Add platform device for 'nop-usb-xceiv'. This will be used as a PHY for HS USB Port 2, so provide binding information for it. Model RESET for HS USB Port 2 as GPIO fixed regulator and link it to the 'nop-usb-xceiv' PHY. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 26/30] ARM: OMAP3: omap3stalker: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:27PM +0200, Roger Quadros wrote: Add platform device for 'nop-usb-xceiv'. This will be used as a PHY for HS USB Port 2, so provide binding information for it. Model RESET for HS USB Port 2 as GPIO fixed regulator and link it to the 'nop-usb-xceiv' PHY. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
how to specify an OMAP clock in device tree?
Hi Rajendra, On 02/04/2013 05:58 PM, Roger Quadros wrote: Provide the RESET and Power regulators for the USB PHY, the USB Host port mode and the PHY device. Also provide pin multiplexer information for the USB host pins. Signed-off-by: Roger Quadros rog...@ti.com --- arch/arm/boot/dts/omap4-panda.dts | 55 + 1 files changed, 55 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts index 4122efe..fe2d3d4 100644 --- a/arch/arm/boot/dts/omap4-panda.dts +++ b/arch/arm/boot/dts/omap4-panda.dts @@ -57,6 +57,35 @@ AFML, Line In, AFMR, Line In; }; + + /* HS USB Port 1 RESET */ + hsusb1_reset: hsusb1_reset_reg { + compatible = regulator-fixed; + regulator-name = hsusb1_reset; + regulator-min-microvolt = 330; + regulator-max-microvolt = 330; + gpio = gpio2 30 0; /* gpio_62 */ + startup-delay-us = 7; + enable-active-high; + }; + + /* HS USB Port 1 Power */ + hsusb1_power: hsusb1_power_reg { + compatible = regulator-fixed; + regulator-name = hsusb1_vbus; + regulator-min-microvolt = 330; + regulator-max-microvolt = 330; + gpio = gpio1 1 0;/* gpio_1 */ + startup-delay-us = 7; + enable-active-high; + }; + + /* HS USB Host PHY on PORT 1 */ + hsusb1_phy: hsusb1_phy { + compatible = usb-nop-xceiv; + reset-supply = hsusb1_reset; + vcc-supply = hsusb1_power; + }; This is the patch I was discussing with you about before. Let me explain the problem again. The Pandaboard has a USB PHY whose reference clock is provided by FREF_CLK3 pin which is a clock generated by the OMAP. The PHY driver expects a reference to this clock in the PHY device node. See the above node hsusb1_phy. we would need something like hsusb1_phy { ... clocks = fref_clk3; clock-names = main_clk; ... }; Currently on OMAP, there is no way to provide a phandle to this clock. Is it practical to provide device tree based implementation of at least the externally accessible OMAP clocks? cheers, -roger }; omap4_pmx_core { @@ -67,6 +96,7 @@ mcbsp1_pins dss_hdmi_pins tpd12s015_pins + hsusbb1_pins ; twl6040_pins: pinmux_twl6040_pins { @@ -110,6 +140,23 @@ 0x58 0x10b /* hdmi_hpd.gpio_63 INPUT PULLDOWN | MODE3 */ ; }; -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 27/30] ARM: OMAP3: omap3touchbook: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:28PM +0200, Roger Quadros wrote: Add 2 platform devices for 'nop-usb-xceiv'. These will be used as a PHY for HS USB Ports 1 and 2, so provide binding information for them. Model RESET for HS USB Port 2 as GPIO fixed regulator and link it to the respective 'nop-usb-xceiv' PHY. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 16/30] ARM: OMAP3: 3430SDP: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:17PM +0200, Roger Quadros wrote: Add 2 platform devices for 'nop-usb-xceiv'. These will be used as PHYs for HS USB ports 1 and 2 so provide binding information for them. Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and link them to the 2 PHYs we just created. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 18/30] ARM: OMAP: AM3517crane: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:19PM +0200, Roger Quadros wrote: Add platform device for 'nop-usb-xceiv'. This will be used as a PHY for HS USB Port 1, so provide binding information for it. Model RESET and Power for HS USB Port 1 as GPIO fixed regulators and link them to the 'nop-usb-xceiv' PHY. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 29/30] ARM: OMAP: zoom: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:30PM +0200, Roger Quadros wrote: Add platform device for 'nop-usb-xceiv'. This will be used as a PHY for HS USB Port 2, so provide binding information for it. Model RESET for HS USB Port 2 as GPIO fixed regulator and link it to the 'nop-usb-xceiv' PHY. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 31/31] USB: ehci-omap: Select NOP USB transceiver driver
On Mon, Feb 04, 2013 at 04:03:10PM -0500, Alan Stern wrote: On Mon, 4 Feb 2013, Roger Quadros wrote: In PHY mode we need to have the nop-usb-xceiv transceiver driver to operate, so select it in Kconfig. CC: Alan Stern st...@rowland.harvard.edu Signed-off-by: Roger Quadros rog...@ti.com --- drivers/usb/host/Kconfig |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 11e102e..2d2975d 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -157,6 +157,7 @@ config USB_EHCI_MXC config USB_EHCI_HCD_OMAP tristate EHCI support for OMAP3 and later chips depends on USB_EHCI_HCD ARCH_OMAP + select NOP_USB_XCEIV default y ---help--- Enables support for the on-chip EHCI controller on Acked-by: Alan Stern st...@rowland.harvard.edu Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 28/30] ARM: OMAP3: overo: Adapt to ehci-omap changes
On Mon, Jan 28, 2013 at 01:30:29PM +0200, Roger Quadros wrote: Add platform device for 'nop-usb-xceiv'. This will be used as a PHY for HS USB Port 2, so provide binding information for it. Model RESET for HS USB Port 2 as GPIO fixed regulator and link it to the 'nop-usb-xceiv' PHY. Signed-off-by: Roger Quadros rog...@ti.com Acked-by: Felipe Balbi ba...@ti.com -- balbi signature.asc Description: Digital signature
Re: [PATCH 02/13] USB: phy: nop: Defer probe if device needs VCC/RESET
On 02/05/2013 11:09 AM, Felipe Balbi wrote: On Tue, Feb 05, 2013 at 10:44:05AM +0200, Roger Quadros wrote: diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/nop-usb-xceiv.h index 3265b61..148d351 100644 --- a/include/linux/usb/nop-usb-xceiv.h +++ b/include/linux/usb/nop-usb-xceiv.h @@ -6,6 +6,10 @@ struct nop_usb_xceiv_platform_data { enum usb_phy_type type; unsigned long clk_rate; + +/* if set fails with -EPROBE_DEFER if can't get regulator */ +unsigned int needs_vcc:1; +unsigned int needs_reset:1; how about u8 here? Not sure. Bitfields are usually defined as unsigned int. IIRC the benefit is that compiler can try to optimize those flags. I mean, if you have 32 1-bit flags, compiler will combine those in a single u32. Someone correct me if I'm wrong. Yes you are right. Kishon was asking me to use u8 instead of unsigned int, which I don't think is necessary. AFAIK, it is a norm to use unsigned int when defining a bitfield. Compilers are known to behave funny with bitfields. I don't mind using bool for each. cheers, -roger -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 09/13] mfd: omap-usb-host: Add device tree support and binding information
On 02/05/2013 08:16 AM, kishon wrote: On Monday 04 February 2013 09:28 PM, Roger Quadros wrote: Allows the OMAP HS USB host controller to be specified via device tree. CC: Samuel Ortiz sa...@linux.intel.com Signed-off-by: Roger Quadros rog...@ti.com --- .../devicetree/bindings/mfd/omap-usb-host.txt | 68 drivers/mfd/omap-usb-host.c| 83 ++-- 2 files changed, 145 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-host.txt diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt new file mode 100644 index 000..2196893 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt @@ -0,0 +1,68 @@ +OMAP HS USB Host + +Required properties: + +- compatible: should be ti,usbhs-host +- reg: should contain one register range i.e. start and length +- ti,hwmods: must contain usb_host_hs + +Optional properties: + +- nports: number of USB ports. Usually this is automatically detected + from the IP's revision register but can be overridden by specifying + this property. + +- portN_mode: Integer specifying the port mode for port N, where N can be + from 1 to nports. The port mode must be as per enum usbhs_omap_port_mode + in include/linux/platform_data/usb-omap.h + If the port mode is not specified, that port is treated as unused. + +- single_ulpi_bypass: Must be present if the controller contains a single + ULPI bypass control bit. e.g. OMAP3 silicon = ES2.1 + +Required properties if child node exists: + +- #address-cells: Must be 1 +- #size-cells: Must be 1 +- ranges: must be present + +Properties for children: + +The OMAP HS USB Host subsystem contains EHCI and OHCI controllers. +See Documentation/devicetree/bindings/usb/omap-ehci.txt and +omap3-ohci.txt + +Example for OMAP4: + +usbhshost: usbhshost@0x4a064000 { +compatible = ti,usbhs-host; +reg = 0x4a064000 0x800; +ti,hwmods = usb_host_hs; +#address-cells = 1; +#size-cells = 1; +ranges; + +usbhsohci: ohci@0x4a064800 { +compatible = ti,omap3-ohci, usb-ohci; +reg = 0x4a064800 0x400; +interrupt-parent = gic; +interrupts = 0 76 0x4; +}; + +usbhsehci: ehci@0x4a064c00 { +compatible = ti,omap-ehci, usb-ehci; +reg = 0x4a064c00 0x400; +interrupt-parent = gic; +interrupts = 0 77 0x4; +}; +}; + +usbhshost { +port1_mode = 1; /* OMAP_EHCI_PORT_MODE_PHY */ +port2_mode = 2; /* OMAP_EHCI_PORT_MODE_TLL */ +port3_mode = 1; /* OMAP_EHCI_PORT_MODE_PHY */ +}; + +usbhsehci { +phy = hsusb1_phy 0 hsusb3_phy; +}; diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index f8ed08e..0f67856 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -1,8 +1,9 @@ /** * omap-usb-host.c - The USBHS core driver for OMAP EHCI OHCI * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com + * Copyright (C) 2011-2013 Texas Instruments Incorporated - http://www.ti.com * Author: Keshava Munegowda keshava_mgo...@ti.com + * Author: Roger Quadros rog...@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 of @@ -27,6 +28,8 @@ #include linux/platform_device.h #include linux/platform_data/usb-omap.h #include linux/pm_runtime.h +#include linux/of.h +#include linux/of_platform.h #include omap-usb.h @@ -464,6 +467,37 @@ static void omap_usbhs_init(struct device *dev) pm_runtime_put_sync(dev); } +static int usbhs_omap_get_dt_pdata(struct device_node *node, +struct usbhs_omap_platform_data *pdata) +{ +int ret, i; + +ret = of_property_read_u32(node, nports, pdata-nports); +if (ret) +pdata-nports = 0; + +/* get port modes */ +for (i = 0; i OMAP3_HS_USB_PORTS; i++) { +char prop[11]; + +snprintf(prop, sizeof(prop), port%d_mode, i + 1); +ret = of_property_read_u32(node, prop, pdata-port_mode[i]); +if (ret) +pdata-port_mode[i] = OMAP_USBHS_PORT_MODE_UNUSED; +} + +/* get flags */ +pdata-single_ulpi_bypass = of_property_read_bool(node, +single_ulpi_bypass); +return 0; +} + +static struct of_device_id usbhs_child_match_table[] __initdata = { +{ .compatible = ti,omap-ehci, }, +{ .compatible = ti,omap-ohci, }, +{ } +}; + /** * usbhs_omap_probe - initialize TI-based HCDs * @@ -479,6 +513,21 @@ static int usbhs_omap_probe(struct platform_device *pdev) inti; boolneed_logic_fck; +if (dev-of_node) { +/* For DT boot we populate platform data from OF node */ +
Re: how to specify an OMAP clock in device tree?
On Tuesday 05 February 2013 03:04 PM, Roger Quadros wrote: Hi Rajendra, On 02/04/2013 05:58 PM, Roger Quadros wrote: Provide the RESET and Power regulators for the USB PHY, the USB Host port mode and the PHY device. Also provide pin multiplexer information for the USB host pins. Signed-off-by: Roger Quadros rog...@ti.com --- arch/arm/boot/dts/omap4-panda.dts | 55 + 1 files changed, 55 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts index 4122efe..fe2d3d4 100644 --- a/arch/arm/boot/dts/omap4-panda.dts +++ b/arch/arm/boot/dts/omap4-panda.dts @@ -57,6 +57,35 @@ AFML, Line In, AFMR, Line In; }; + + /* HS USB Port 1 RESET */ + hsusb1_reset: hsusb1_reset_reg { + compatible = regulator-fixed; + regulator-name = hsusb1_reset; + regulator-min-microvolt = 330; + regulator-max-microvolt = 330; + gpio = gpio2 30 0; /* gpio_62 */ + startup-delay-us = 7; + enable-active-high; + }; + + /* HS USB Port 1 Power */ + hsusb1_power: hsusb1_power_reg { + compatible = regulator-fixed; + regulator-name = hsusb1_vbus; + regulator-min-microvolt = 330; + regulator-max-microvolt = 330; + gpio = gpio1 1 0; /* gpio_1 */ + startup-delay-us = 7; + enable-active-high; + }; + + /* HS USB Host PHY on PORT 1 */ + hsusb1_phy: hsusb1_phy { + compatible = usb-nop-xceiv; + reset-supply = hsusb1_reset; + vcc-supply = hsusb1_power; + }; This is the patch I was discussing with you about before. Let me explain the problem again. The Pandaboard has a USB PHY whose reference clock is provided by FREF_CLK3 pin which is a clock generated by the OMAP. The PHY driver expects a reference to this clock in the PHY device node. Well, the driver just does a clk_get(dev, main_clk); and clk_get() is then able to either pick the reference from the PHY dt node or from a clkdev entry. The problem here seems to be that you are not able to add a clkdev entry because the device name wouldn't be fixed, since you have a node in the form of 'node: node {'. All other onchip OMAP devices don't have this issue because they have an entry in the form of 'node: node@addr' and hence have a fixed device name and hence can add a clkdev entry for the clocks they want to control. I don't know if there is any good way to define the DT node for the on board PHY in such a way that the device name is always fixed, in which case you can then add a clkdev entry for 'dev, main_clk' mapping to the onchip clock that provides the clock, but if there is one, then that should fix your problem. See the above node hsusb1_phy. we would need something like hsusb1_phy { ... clocks = fref_clk3; clock-names = main_clk; ... }; Currently on OMAP, there is no way to provide a phandle to this clock. Is it practical to provide device tree based implementation of at least the externally accessible OMAP clocks? cheers, -roger }; omap4_pmx_core { @@ -67,6 +96,7 @@ mcbsp1_pins dss_hdmi_pins tpd12s015_pins + hsusbb1_pins ; twl6040_pins: pinmux_twl6040_pins { @@ -110,6 +140,23 @@ 0x58 0x10b /* hdmi_hpd.gpio_63 INPUT PULLDOWN | MODE3 */ ; }; -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v8 19/22] ARM: OMAP3: clock data: get rid of unused USB host clock aliases and dummies
Hi Paul, On 01/21/2013 05:03 PM, Paul Walmsley wrote: Hi On Mon, 21 Jan 2013, Roger Quadros wrote: On 01/18/2013 10:27 PM, Paul Walmsley wrote: On Fri, 18 Jan 2013, Roger Quadros wrote: We don't need multiple aliases for the OMAP USB host clocks and neither the dummy clocks so remove them. CC: Paul Walmsley p...@pwsan.com CC: Rajendra Nayak rna...@ti.com CC: Benoit Cousson b-cous...@ti.com CC: Mike Turquette mturque...@linaro.com Signed-off-by: Roger Quadros rog...@ti.com Reviewed-by: Felipe Balbi ba...@ti.com Acked-by: Paul Walmsley p...@pwsan.com Per Tony's earlier request, you can drop this patch and patch 20 from your series now. I've got them queued for 3.10 or late 3.9 merge window. Should have mentioned it earlier, but just this patch without the rest of the cleanup patches will break USB Host on OMAP3, as the old driver bails out if optional clock nodes are missing. Including patch 20 doesn't seem to cause a problem with OMAP4 though. I've got these two patches queued for merging after your other patches go upstream -- e.g., probably 3.10. Do you foresee any problems with that? FYI, the usbhost patches are already in linux-next. cheers, -roger -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 00/13] Device tree support for OMAP HS USB Host
On Monday 04 February 2013 09:28 PM, Roger Quadros wrote: This patchset adds device tree support for OMAP's High Speed USB Host subsystem. Board adaptation for Panda and Beagleboard is also provided. Tested on Beagleboard. Will only work with Panda if we provide a reference to the PHY clock But there is no reference provided even for Beagle. Does it work because the default clk speed is 192Mhz? generator in the device tree in PATCH 11. I do not know how to do that as there is no way to provide a phandle to any of the OMAP generated clocks in the device tree. Suggestions welcome:). -- To unsubscribe from this list: send the line unsubscribe linux-usb 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 00/30] USB: omap-ehci: Move PHY management to PHY driver
Hi Tony Greg, What's the best way to get these patches in? All patches have been acked by respective maintainers. If Tony can Ack the arch/arm/mach-omap2 stuff then should I send a pull request directly to Greg? or the other way round? Tony, fyi, these patches should not interfere with the dw3c/musb stuff sent by Felipe Kishon. cheers, -roger On 01/28/2013 01:30 PM, Roger Quadros wrote: Hi, The OMAP's High Speed Host controller can interface to ULPI/UTMI PHYs transparently i.e. whithout requiring the device drivers to access the PHY. However, the OS must ensure that the PHY has the necessary resources (power/clock/reset) enabled before it is used. Till now, the omap-ehci driver was managing the power and reset of the PHY whereas, clock enabling was left to the bootloader or board files. In this patchset we make the NOP PHY driver (nop-usb-xceiv.c) handle all the PHY resources that are available so that it can be used by platforms like OMAP. The board files add the PHY as a platform device and use usb_bind_phy() (API introduced in [2]) to bind the PHY device to the controller's port. The ehci-omap driver then uses usb_get_phy_dev() to get the PHY device associated to the controller's port. All this results in a much cleaner code and makes USB PHY resource management work properly on OMAP. NOTE: Tested on 4460ES-B1 Panda and BeagleBoard C4 only. Other boards are only build tested. Patches are based on Linux-3.8-rc5 and depend on [1] [PATCH v9 00/20] OMAP USB Host cleanup https://lkml.org/lkml/2013/1/23/155 [2] [PATCH v2 0/6] USB: Add support for multiple PHYs of same type https://lkml.org/lkml/2013/1/24/876 v2: - Added Alan's patch to split ehci-omap into separate driver - Addressed Russell King's comments on usage of clk/regulator framework. - Adapted all board using ehci-omap to using the PHY mechanism. The following changes since commit e18d48b7f7e563664a41d4658b8cc15679ee4745: usb: otg: utils: add facilities in phy lib to support multiple PHYs of same type (2013-01-28 12:20:54 +0200) git://github.com/rogerq/linux.git linux-usbhost15 --- Alan Stern (1): USB: EHCI: split ehci-omap out to a separate driver Roger Quadros (29): usb: phy: nop: use devm_kzalloc() usb: phy: nop: Manage PHY clock usb: phy: nop: Handle power supply regulator for the PHY usb: phy: nop: Handle RESET for the PHY usb: phy: nop: use new PHY API to register PHY mfd: omap-usb-host: update nports in platform_data mfd: omap-usb-host: Remove PHY reset handling code USB: ehci-omap: Use devm_request_and_ioremap() USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend usb: ehci-omap: Remove PHY reset handling code usb: ehci-omap: Remove PHY regulator handling code ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data ARM: OMAP2+: omap4panda: Adapt to ehci-omap changes ARM: OMAP3: Beagle: Adapt to ehci-omap changes ARM: OMAP3: 3430SDP: Adapt to ehci-omap changes ARM: OMAP3: 3630SDP: Adapt to ehci-omap changes ARM: OMAP: AM3517crane: Adapt to ehci-omap changes ARM: OMAP: AM3517evm: Adapt to ehci-omap changes ARM: OMAP3: cm-t35: Adapt to ehci-omap changes ARM: OMAP3: cm-t3517: Adapt to ehci-omap changes ARM: OMAP: devkit8000: Adapt to ehci-omap changes ARM: OMAP3: igep0020: Adapt to ehci-omap changes ARM: OMAP3: omap3evm: Adapt to ehci-omap changes ARM: OMAP3: omap3pandora: Adapt to ehci-omap changes ARM: OMAP3: omap3stalker: Adapt to ehci-omap changes ARM: OMAP3: omap3touchbook: Adapt to ehci-omap changes ARM: OMAP3: overo: Adapt to ehci-omap changes ARM: OMAP: zoom: Adapt to ehci-omap changes ARM: OMAP: USB: Remove unused fields from struct usbhs_omap_platform_data arch/arm/mach-omap2/board-3430sdp.c| 99 +++- arch/arm/mach-omap2/board-3630sdp.c| 100 +++- arch/arm/mach-omap2/board-am3517crane.c| 95 ++-- arch/arm/mach-omap2/board-am3517evm.c | 66 +++- arch/arm/mach-omap2/board-cm-t35.c | 95 ++- arch/arm/mach-omap2/board-cm-t3517.c | 97 +++- arch/arm/mach-omap2/board-devkit8000.c | 20 ++- arch/arm/mach-omap2/board-igep0020.c | 112 +++-- arch/arm/mach-omap2/board-omap3beagle.c| 93 ++- arch/arm/mach-omap2/board-omap3evm.c | 63 ++-- arch/arm/mach-omap2/board-omap3pandora.c | 54 +- arch/arm/mach-omap2/board-omap3stalker.c | 52 +- arch/arm/mach-omap2/board-omap3touchbook.c | 62 ++- arch/arm/mach-omap2/board-omap4panda.c | 123 ++ arch/arm/mach-omap2/board-overo.c | 55 ++- arch/arm/mach-omap2/board-zoom.c | 56 ++- drivers/mfd/omap-usb-host.c| 48 +-- drivers/usb/host/Kconfig |2 +- drivers/usb/host/Makefile |1 + drivers/usb/host/ehci-hcd.c
Re: [PATCH 00/13] Device tree support for OMAP HS USB Host
On 02/05/2013 01:25 PM, Rajendra Nayak wrote: On Monday 04 February 2013 09:28 PM, Roger Quadros wrote: This patchset adds device tree support for OMAP's High Speed USB Host subsystem. Board adaptation for Panda and Beagleboard is also provided. Tested on Beagleboard. Will only work with Panda if we provide a reference to the PHY clock But there is no reference provided even for Beagle. Does it work because the default clk speed is 192Mhz? On beagle board the PHY is connected differently, i.e. as the clock receptor. The PHY clock comes directly from the USB_CLK pin. On Panda the PHY is the clock provider to the USB_CLK pin. For that it needs a reference clock at the REFCLK pin which comes from FREF_CLK3. generator in the device tree in PATCH 11. I do not know how to do that as there is no way to provide a phandle to any of the OMAP generated clocks in the device tree. Suggestions welcome:). cheers, -roger -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 9/9] USB chipidea i.MX: use devm_usb_get_phy_by_phandle to get phy
Hello. On 04-02-2013 17:24, Sascha Hauer wrote: Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- drivers/usb/chipidea/ci13xxx_imx.c | 39 +--- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c index b598bb8f..136869b 100644 --- a/drivers/usb/chipidea/ci13xxx_imx.c +++ b/drivers/usb/chipidea/ci13xxx_imx.c [...] @@ -147,19 +146,21 @@ static int ci13xxx_imx_probe(struct platform_device *pdev) return ret; } + phy = devm_usb_get_phy_by_phandle(pdev-dev, fsl,usbphy, 0); + No need for emoty line here. Keep the style as it was please. + if (PTR_ERR(phy) == -EPROBE_DEFER) { Is it valid to call PTR_ERR() on non-error pointer? Isn't it better to do this check under *else* clause below the next *if*. + ret = -EPROBE_DEFER; + goto err_clk; + } + This empty line is also not needed, I think. + if (!IS_ERR(phy)) { + ret = usb_phy_init(phy); + if (ret) { + dev_err(pdev-dev, unable to init phy: %d\n, ret); + goto err_clk; } + + data-phy = phy; } /* we only support host now, so enable vbus here */ WBR, Sergei -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 9/9] USB chipidea i.MX: use devm_usb_get_phy_by_phandle to get phy
On Tue, Feb 05, 2013 at 03:45:12PM +0400, Sergei Shtylyov wrote: Hello. On 04-02-2013 17:24, Sascha Hauer wrote: Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- drivers/usb/chipidea/ci13xxx_imx.c | 39 +--- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c index b598bb8f..136869b 100644 --- a/drivers/usb/chipidea/ci13xxx_imx.c +++ b/drivers/usb/chipidea/ci13xxx_imx.c [...] @@ -147,19 +146,21 @@ static int ci13xxx_imx_probe(struct platform_device *pdev) return ret; } +phy = devm_usb_get_phy_by_phandle(pdev-dev, fsl,usbphy, 0); + No need for emoty line here. Keep the style as it was please. +if (PTR_ERR(phy) == -EPROBE_DEFER) { Is it valid to call PTR_ERR() on non-error pointer? Why shouldn't it? Isn't it better to do this check under *else* clause below the next *if*. For better readability, yes. Sascha +ret = -EPROBE_DEFER; +goto err_clk; +} + This empty line is also not needed, I think. +if (!IS_ERR(phy)) { +ret = usb_phy_init(phy); +if (ret) { +dev_err(pdev-dev, unable to init phy: %d\n, ret); +goto err_clk; } + +data-phy = phy; } /* we only support host now, so enable vbus here */ WBR, Sergei -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 09/13] mfd: omap-usb-host: Add device tree support and binding information
Hi, On Tuesday 05 February 2013 04:28 PM, Roger Quadros wrote: On 02/05/2013 08:16 AM, kishon wrote: On Monday 04 February 2013 09:28 PM, Roger Quadros wrote: Allows the OMAP HS USB host controller to be specified via device tree. CC: Samuel Ortiz sa...@linux.intel.com Signed-off-by: Roger Quadros rog...@ti.com --- .../devicetree/bindings/mfd/omap-usb-host.txt | 68 drivers/mfd/omap-usb-host.c| 83 ++-- 2 files changed, 145 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-host.txt diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt new file mode 100644 index 000..2196893 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt @@ -0,0 +1,68 @@ +OMAP HS USB Host + +Required properties: + +- compatible: should be ti,usbhs-host +- reg: should contain one register range i.e. start and length +- ti,hwmods: must contain usb_host_hs + +Optional properties: + +- nports: number of USB ports. Usually this is automatically detected + from the IP's revision register but can be overridden by specifying + this property. + +- portN_mode: Integer specifying the port mode for port N, where N can be + from 1 to nports. The port mode must be as per enum usbhs_omap_port_mode + in include/linux/platform_data/usb-omap.h + If the port mode is not specified, that port is treated as unused. + +- single_ulpi_bypass: Must be present if the controller contains a single + ULPI bypass control bit. e.g. OMAP3 silicon = ES2.1 + +Required properties if child node exists: + +- #address-cells: Must be 1 +- #size-cells: Must be 1 +- ranges: must be present + +Properties for children: + +The OMAP HS USB Host subsystem contains EHCI and OHCI controllers. +See Documentation/devicetree/bindings/usb/omap-ehci.txt and +omap3-ohci.txt + +Example for OMAP4: + +usbhshost: usbhshost@0x4a064000 { +compatible = ti,usbhs-host; +reg = 0x4a064000 0x800; +ti,hwmods = usb_host_hs; +#address-cells = 1; +#size-cells = 1; +ranges; + +usbhsohci: ohci@0x4a064800 { +compatible = ti,omap3-ohci, usb-ohci; +reg = 0x4a064800 0x400; +interrupt-parent = gic; +interrupts = 0 76 0x4; +}; + +usbhsehci: ehci@0x4a064c00 { +compatible = ti,omap-ehci, usb-ehci; +reg = 0x4a064c00 0x400; +interrupt-parent = gic; +interrupts = 0 77 0x4; +}; +}; + +usbhshost { +port1_mode = 1; /* OMAP_EHCI_PORT_MODE_PHY */ +port2_mode = 2; /* OMAP_EHCI_PORT_MODE_TLL */ +port3_mode = 1; /* OMAP_EHCI_PORT_MODE_PHY */ +}; + +usbhsehci { +phy = hsusb1_phy 0 hsusb3_phy; +}; diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index f8ed08e..0f67856 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -1,8 +1,9 @@ /** * omap-usb-host.c - The USBHS core driver for OMAP EHCI OHCI * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com + * Copyright (C) 2011-2013 Texas Instruments Incorporated - http://www.ti.com * Author: Keshava Munegowda keshava_mgo...@ti.com + * Author: Roger Quadros rog...@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 of @@ -27,6 +28,8 @@ #include linux/platform_device.h #include linux/platform_data/usb-omap.h #include linux/pm_runtime.h +#include linux/of.h +#include linux/of_platform.h #include omap-usb.h @@ -464,6 +467,37 @@ static void omap_usbhs_init(struct device *dev) pm_runtime_put_sync(dev); } +static int usbhs_omap_get_dt_pdata(struct device_node *node, +struct usbhs_omap_platform_data *pdata) +{ +int ret, i; + +ret = of_property_read_u32(node, nports, pdata-nports); +if (ret) +pdata-nports = 0; + +/* get port modes */ +for (i = 0; i OMAP3_HS_USB_PORTS; i++) { +char prop[11]; + +snprintf(prop, sizeof(prop), port%d_mode, i + 1); +ret = of_property_read_u32(node, prop, pdata-port_mode[i]); +if (ret) +pdata-port_mode[i] = OMAP_USBHS_PORT_MODE_UNUSED; +} + +/* get flags */ +pdata-single_ulpi_bypass = of_property_read_bool(node, +single_ulpi_bypass); +return 0; +} + +static struct of_device_id usbhs_child_match_table[] __initdata = { +{ .compatible = ti,omap-ehci, }, +{ .compatible = ti,omap-ohci, }, +{ } +}; + /** * usbhs_omap_probe - initialize TI-based HCDs * @@ -479,6 +513,21 @@ static int usbhs_omap_probe(struct platform_device *pdev) inti; boolneed_logic_fck; +if (dev-of_node) { +/* For DT boot we populate platform data from OF node */ +pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); +
Re: [PATCH 09/13] mfd: omap-usb-host: Add device tree support and binding information
On 02/05/2013 02:11 PM, kishon wrote: Hi, On Tuesday 05 February 2013 04:28 PM, Roger Quadros wrote: On 02/05/2013 08:16 AM, kishon wrote: On Monday 04 February 2013 09:28 PM, Roger Quadros wrote: Allows the OMAP HS USB host controller to be specified via device tree. CC: Samuel Ortiz sa...@linux.intel.com Signed-off-by: Roger Quadros rog...@ti.com --- .../devicetree/bindings/mfd/omap-usb-host.txt | 68 drivers/mfd/omap-usb-host.c| 83 ++-- 2 files changed, 145 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-host.txt diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt new file mode 100644 index 000..2196893 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt @@ -0,0 +1,68 @@ +OMAP HS USB Host + +Required properties: + +- compatible: should be ti,usbhs-host +- reg: should contain one register range i.e. start and length +- ti,hwmods: must contain usb_host_hs + +Optional properties: + +- nports: number of USB ports. Usually this is automatically detected + from the IP's revision register but can be overridden by specifying + this property. + +- portN_mode: Integer specifying the port mode for port N, where N can be + from 1 to nports. The port mode must be as per enum usbhs_omap_port_mode + in include/linux/platform_data/usb-omap.h + If the port mode is not specified, that port is treated as unused. + +- single_ulpi_bypass: Must be present if the controller contains a single + ULPI bypass control bit. e.g. OMAP3 silicon = ES2.1 + +Required properties if child node exists: + +- #address-cells: Must be 1 +- #size-cells: Must be 1 +- ranges: must be present + +Properties for children: + +The OMAP HS USB Host subsystem contains EHCI and OHCI controllers. +See Documentation/devicetree/bindings/usb/omap-ehci.txt and +omap3-ohci.txt + +Example for OMAP4: + +usbhshost: usbhshost@0x4a064000 { +compatible = ti,usbhs-host; +reg = 0x4a064000 0x800; +ti,hwmods = usb_host_hs; +#address-cells = 1; +#size-cells = 1; +ranges; + +usbhsohci: ohci@0x4a064800 { +compatible = ti,omap3-ohci, usb-ohci; +reg = 0x4a064800 0x400; +interrupt-parent = gic; +interrupts = 0 76 0x4; +}; + +usbhsehci: ehci@0x4a064c00 { +compatible = ti,omap-ehci, usb-ehci; +reg = 0x4a064c00 0x400; +interrupt-parent = gic; +interrupts = 0 77 0x4; +}; +}; + +usbhshost { +port1_mode = 1; /* OMAP_EHCI_PORT_MODE_PHY */ +port2_mode = 2; /* OMAP_EHCI_PORT_MODE_TLL */ +port3_mode = 1; /* OMAP_EHCI_PORT_MODE_PHY */ +}; + +usbhsehci { +phy = hsusb1_phy 0 hsusb3_phy; +}; diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index f8ed08e..0f67856 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -1,8 +1,9 @@ /** * omap-usb-host.c - The USBHS core driver for OMAP EHCI OHCI * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com + * Copyright (C) 2011-2013 Texas Instruments Incorporated - http://www.ti.com * Author: Keshava Munegowda keshava_mgo...@ti.com + * Author: Roger Quadros rog...@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 of @@ -27,6 +28,8 @@ #include linux/platform_device.h #include linux/platform_data/usb-omap.h #include linux/pm_runtime.h +#include linux/of.h +#include linux/of_platform.h #include omap-usb.h @@ -464,6 +467,37 @@ static void omap_usbhs_init(struct device *dev) pm_runtime_put_sync(dev); } +static int usbhs_omap_get_dt_pdata(struct device_node *node, +struct usbhs_omap_platform_data *pdata) +{ +int ret, i; + +ret = of_property_read_u32(node, nports, pdata-nports); +if (ret) +pdata-nports = 0; + +/* get port modes */ +for (i = 0; i OMAP3_HS_USB_PORTS; i++) { +char prop[11]; + +snprintf(prop, sizeof(prop), port%d_mode, i + 1); +ret = of_property_read_u32(node, prop, pdata-port_mode[i]); +if (ret) +pdata-port_mode[i] = OMAP_USBHS_PORT_MODE_UNUSED; +} + +/* get flags */ +pdata-single_ulpi_bypass = of_property_read_bool(node, +single_ulpi_bypass); +return 0; +} + +static struct of_device_id usbhs_child_match_table[] __initdata = { +{ .compatible = ti,omap-ehci, }, +{ .compatible = ti,omap-ohci, }, +{ } +}; + /** * usbhs_omap_probe - initialize TI-based HCDs * @@ -479,6 +513,21 @@ static int usbhs_omap_probe(struct platform_device *pdev) inti;
Re: [PATCH 08/13] USB: ehci-omap: Add device tree support and binding information
On Mon, Feb 04, 2013 at 03:58:55PM +, Roger Quadros wrote: Allows the OMAP EHCI controller to be specified via device tree. Signed-off-by: Roger Quadros rog...@ti.com --- .../devicetree/bindings/usb/omap-ehci.txt | 34 ++ drivers/usb/host/ehci-omap.c | 36 +++- 2 files changed, 69 insertions(+), 1 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/omap-ehci.txt diff --git a/Documentation/devicetree/bindings/usb/omap-ehci.txt b/Documentation/devicetree/bindings/usb/omap-ehci.txt new file mode 100644 index 000..90e6e3a --- /dev/null +++ b/Documentation/devicetree/bindings/usb/omap-ehci.txt @@ -0,0 +1,34 @@ +OMAP HS USB EHCI controller + +This device is usually the child of the omap-usb-host +Documentation/devicetree/bindings/mfd/omap-usb-host.txt + +Required properties: + +- compatible: should be ti,omap-ehci +- reg: should contain one register range i.e. start and length +- interrupt-parent: phandle to the interrupt controller +- interrupts: description of the interrupt line + +Optional properties: + +- phy: list of phandles to PHY nodes. + This property is required if at least one of the ports are in + PHY mode i.e. OMAP_EHCI_PORT_MODE_PHY Any reason for not calling this phys, given it's a list? [...] Thanks, Mark. -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v5 0/2] Adding USB 3.0 DRD-phy support for exynos5250
Based on 'usb-next' Changes from v4: - Modifying function names and driver names to follow a common naming convention. usb2phy for samsung-usb2phy driver usb3phy for samsung-usb3phy driver - Changing file names samsung-usb2.c to samsung-usb2phy.c and, samsung-usb3.c to samsung-usb3phy.c - Removing dependencies for SAMSUNG_USB2PHY and SAMSUNG_USB3PHY. - Arranging SAMSUNG_USB2PHY and SAMSUNG_USB3PHY to select SAMSUNG_USBPHY, which is the usb-phy helper driver. Vivek Gautam (2): usb: phy: samsung: Common out the generic stuff usb: phy: samsung: Add PHY support for USB 3.0 controller drivers/usb/phy/Kconfig | 25 +- drivers/usb/phy/Makefile |2 + drivers/usb/phy/samsung-usb2phy.c | 511 ++ drivers/usb/phy/samsung-usb3phy.c | 349 ++ drivers/usb/phy/samsung-usbphy.c | 717 + drivers/usb/phy/samsung-usbphy.h | 328 + 6 files changed, 1219 insertions(+), 713 deletions(-) create mode 100644 drivers/usb/phy/samsung-usb2phy.c create mode 100644 drivers/usb/phy/samsung-usb3phy.c create mode 100644 drivers/usb/phy/samsung-usbphy.h -- 1.7.6.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v5 1/2] usb: phy: samsung: Common out the generic stuff
Moving register and structure definitions to header file, and keeping the generic functions to be used across multiple PHYs in common phy helper driver under SAMSUNG_USBPHY, and moving USB 2.0 PHY driver under SAMSUNG_USB2PHY. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com --- drivers/usb/phy/Kconfig | 17 +- drivers/usb/phy/Makefile |1 + drivers/usb/phy/samsung-usb2phy.c | 511 ++ drivers/usb/phy/samsung-usbphy.c | 717 + drivers/usb/phy/samsung-usbphy.h | 247 + 5 files changed, 780 insertions(+), 713 deletions(-) create mode 100644 drivers/usb/phy/samsung-usb2phy.c create mode 100644 drivers/usb/phy/samsung-usbphy.h diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index 65217a5..b28878d 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig @@ -66,10 +66,17 @@ config USB_RCAR_PHY To compile this driver as a module, choose M here: the module will be called rcar-phy. -config SAMSUNG_USBPHY - bool Samsung USB PHY controller Driver - depends on USB_S3C_HSOTG || USB_EHCI_S5P || USB_OHCI_EXYNOS +config SAMSUNG_USB2PHY + bool Samsung USB 2.0 PHY controller Driver + select SAMSUNG_USBPHY select USB_OTG_UTILS help - Enable this to support Samsung USB phy controller for samsung - SoCs. + Enable this to support Samsung USB 2.0 (High Speed) PHY controller + driver for Samsung SoCs. + +config SAMSUNG_USBPHY + bool Samsung USB PHY Driver + help + Enable this to support Samsung USB phy helper driver for Samsung SoCs. + This driver provides common interface to interact, for Samsung USB 2.0 PHY + driver and later for Samsung USB 3.0 PHY driver. diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile index b13faa1..1efa174 100644 --- a/drivers/usb/phy/Makefile +++ b/drivers/usb/phy/Makefile @@ -12,3 +12,4 @@ obj-$(CONFIG_MV_U3D_PHY) += mv_u3d_phy.o obj-$(CONFIG_USB_EHCI_TEGRA) += tegra_usb_phy.o obj-$(CONFIG_USB_RCAR_PHY) += rcar-phy.o obj-$(CONFIG_SAMSUNG_USBPHY) += samsung-usbphy.o +obj-$(CONFIG_SAMSUNG_USB2PHY) += samsung-usb2phy.o diff --git a/drivers/usb/phy/samsung-usb2phy.c b/drivers/usb/phy/samsung-usb2phy.c new file mode 100644 index 000..55ac3a8 --- /dev/null +++ b/drivers/usb/phy/samsung-usb2phy.c @@ -0,0 +1,511 @@ +/* linux/drivers/usb/phy/samsung-usb2phy.c + * + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * Author: Praveen Paneri p.pan...@samsung.com + * + * Samsung USB2.0 PHY transceiver; talks to S3C HS OTG controller, EHCI-S5P and + * OHCI-EXYNOS controllers. + * + * 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. + */ + +#include linux/module.h +#include linux/platform_device.h +#include linux/clk.h +#include linux/delay.h +#include linux/device.h +#include linux/err.h +#include linux/io.h +#include linux/of.h +#include linux/usb/otg.h +#include linux/usb/samsung_usb_phy.h +#include linux/platform_data/samsung-usbphy.h + +#include samsung-usbphy.h + +int samsung_usb2phy_set_host(struct usb_otg *otg, struct usb_bus *host) +{ + if (!otg) + return -ENODEV; + + if (!otg-host) + otg-host = host; + + return 0; +} + +static bool exynos5_phyhost_is_on(void *regs) +{ + u32 reg; + + reg = readl(regs + EXYNOS5_PHY_HOST_CTRL0); + + return !(reg HOST_CTRL0_SIDDQ); +} + +static void samsung_exynos5_usb2phy_enable(struct samsung_usbphy *sphy) +{ + void __iomem *regs = sphy-regs; + u32 phyclk = sphy-ref_clk_freq; + u32 phyhost; + u32 phyotg; + u32 phyhsic; + u32 ehcictrl; + u32 ohcictrl; + + /* +* phy_usage helps in keeping usage count for phy +* so that the first consumer enabling the phy is also +* the last consumer to disable it. +*/ + + atomic_inc(sphy-phy_usage); + + if (exynos5_phyhost_is_on(regs)) { + dev_info(sphy-dev, Already power on PHY\n); + return; + } + + /* Host configuration */ + phyhost = readl(regs + EXYNOS5_PHY_HOST_CTRL0); + + /* phy reference clock configuration */ + phyhost = ~HOST_CTRL0_FSEL_MASK; + phyhost |= HOST_CTRL0_FSEL(phyclk); + + /* host phy reset */ + phyhost = ~(HOST_CTRL0_PHYSWRST | + HOST_CTRL0_PHYSWRSTALL | + HOST_CTRL0_SIDDQ | +
[PATCH v5 2/2] usb: phy: samsung: Add PHY support for USB 3.0 controller
Adding PHY driver support for USB 3.0 controller for Samsung's SoCs. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com --- drivers/usb/phy/Kconfig |8 + drivers/usb/phy/Makefile |1 + drivers/usb/phy/samsung-usb3phy.c | 349 + drivers/usb/phy/samsung-usbphy.h | 81 + 4 files changed, 439 insertions(+), 0 deletions(-) create mode 100644 drivers/usb/phy/samsung-usb3phy.c diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index b28878d..723d7b1 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig @@ -74,6 +74,14 @@ config SAMSUNG_USB2PHY Enable this to support Samsung USB 2.0 (High Speed) PHY controller driver for Samsung SoCs. +config SAMSUNG_USB3PHY + bool Samsung USB 3.0 PHY controller Driver + select SAMSUNG_USBPHY + select USB_OTG_UTILS + help + Enable this to support Samsung USB 3.0 (Super Speed) phy controller + for samsung SoCs. + config SAMSUNG_USBPHY bool Samsung USB PHY Driver help diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile index 1efa174..77f0b2e 100644 --- a/drivers/usb/phy/Makefile +++ b/drivers/usb/phy/Makefile @@ -13,3 +13,4 @@ obj-$(CONFIG_USB_EHCI_TEGRA) += tegra_usb_phy.o obj-$(CONFIG_USB_RCAR_PHY) += rcar-phy.o obj-$(CONFIG_SAMSUNG_USBPHY) += samsung-usbphy.o obj-$(CONFIG_SAMSUNG_USB2PHY) += samsung-usb2phy.o +obj-$(CONFIG_SAMSUNG_USB3PHY) += samsung-usb3phy.o diff --git a/drivers/usb/phy/samsung-usb3phy.c b/drivers/usb/phy/samsung-usb3phy.c new file mode 100644 index 000..70e2c7b --- /dev/null +++ b/drivers/usb/phy/samsung-usb3phy.c @@ -0,0 +1,349 @@ +/* linux/drivers/usb/phy/samsung-usb3phy.c + * + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * Author: Vivek Gautam gautam.vi...@samsung.com + * + * Samsung USB 3.0 PHY transceiver; talks to DWC3 controller. + * + * 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. + */ + +#include linux/module.h +#include linux/platform_device.h +#include linux/clk.h +#include linux/delay.h +#include linux/err.h +#include linux/io.h +#include linux/of.h +#include linux/usb/samsung_usb_phy.h +#include linux/platform_data/samsung-usbphy.h + +#include samsung-usbphy.h + +/* + * Sets the phy clk as EXTREFCLK (XXTI) which is internal clock from clock core. + */ +static u32 samsung_usb3phy_set_refclk(struct samsung_usbphy *sphy) +{ + u32 reg; + u32 refclk; + + refclk = sphy-ref_clk_freq; + + reg = PHYCLKRST_REFCLKSEL_EXT_REFCLK | + PHYCLKRST_FSEL(refclk); + + switch (refclk) { + case FSEL_CLKSEL_50M: + reg |= (PHYCLKRST_MPLL_MULTIPLIER_50M_REF | + PHYCLKRST_SSC_REFCLKSEL(0x00)); + break; + case FSEL_CLKSEL_20M: + reg |= (PHYCLKRST_MPLL_MULTIPLIER_20MHZ_REF | + PHYCLKRST_SSC_REFCLKSEL(0x00)); + break; + case FSEL_CLKSEL_19200K: + reg |= (PHYCLKRST_MPLL_MULTIPLIER_19200KHZ_REF | + PHYCLKRST_SSC_REFCLKSEL(0x88)); + break; + case FSEL_CLKSEL_24M: + default: + reg |= (PHYCLKRST_MPLL_MULTIPLIER_24MHZ_REF | + PHYCLKRST_SSC_REFCLKSEL(0x88)); + break; + } + + return reg; +} + +static int samsung_exynos5_usb3phy_enable(struct samsung_usbphy *sphy) +{ + void __iomem *regs = sphy-regs; + u32 phyparam0; + u32 phyparam1; + u32 linksystem; + u32 phybatchg; + u32 phytest; + u32 phyclkrst; + + /* Reset USB 3.0 PHY */ + writel(0x0, regs + EXYNOS5_DRD_PHYREG0); + + phyparam0 = readl(regs + EXYNOS5_DRD_PHYPARAM0); + /* Select PHY CLK source */ + phyparam0 = ~PHYPARAM0_REF_USE_PAD; + /* Set Loss-of-Signal Detector sensitivity */ + phyparam0 = ~PHYPARAM0_REF_LOSLEVEL_MASK; + phyparam0 |= PHYPARAM0_REF_LOSLEVEL; + writel(phyparam0, regs + EXYNOS5_DRD_PHYPARAM0); + + writel(0x0, regs + EXYNOS5_DRD_PHYRESUME); + + /* +* Setting the Frame length Adj value[6:1] to default 0x20 +* See xHCI 1.0 spec, 5.2.4 +*/ + linksystem = LINKSYSTEM_XHCI_VERSION_CONTROL | + LINKSYSTEM_FLADJ(0x20); + writel(linksystem, regs + EXYNOS5_DRD_LINKSYSTEM); + + phyparam1 = readl(regs + EXYNOS5_DRD_PHYPARAM1); + /* Set Tx De-Emphasis level */ + phyparam1 =
Re: [PATCH 08/13] USB: ehci-omap: Add device tree support and binding information
On 02/05/2013 02:33 PM, Mark Rutland wrote: On Mon, Feb 04, 2013 at 03:58:55PM +, Roger Quadros wrote: Allows the OMAP EHCI controller to be specified via device tree. Signed-off-by: Roger Quadros rog...@ti.com --- .../devicetree/bindings/usb/omap-ehci.txt | 34 ++ drivers/usb/host/ehci-omap.c | 36 +++- 2 files changed, 69 insertions(+), 1 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/omap-ehci.txt diff --git a/Documentation/devicetree/bindings/usb/omap-ehci.txt b/Documentation/devicetree/bindings/usb/omap-ehci.txt new file mode 100644 index 000..90e6e3a --- /dev/null +++ b/Documentation/devicetree/bindings/usb/omap-ehci.txt @@ -0,0 +1,34 @@ +OMAP HS USB EHCI controller + +This device is usually the child of the omap-usb-host +Documentation/devicetree/bindings/mfd/omap-usb-host.txt + +Required properties: + +- compatible: should be ti,omap-ehci +- reg: should contain one register range i.e. start and length +- interrupt-parent: phandle to the interrupt controller +- interrupts: description of the interrupt line + +Optional properties: + +- phy: list of phandles to PHY nodes. + This property is required if at least one of the ports are in + PHY mode i.e. OMAP_EHCI_PORT_MODE_PHY Any reason for not calling this phys, given it's a list? No good reason. phys seems more appropriate. Thanks. cheers, -roger -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 0/2] ARM: Exynos5250: Enabling samsung usb phy
Based on for-next of 'linux-samsung' tree. Aligned with following patches for separate PHY drivers for USB 2.0 and USB 3.0 for Samsung SoCs. [PATCH v5 1/2] usb: phy: samsung: Common out the generic stuff [PATCH v5 2/2] usb: phy: samsung: Add PHY support for USB 3.0 controller Changes from v2: - Putting device nodes in order of device addresses. Changes from v1: - Putting separate device nodes for usb 2.0 phy and usb 3.0 phy based on separate driver for samsung usb 3.0 phy and samsung usb 2.0 phy: [PATCH v3 0/2] Adding USB 3.0 DRD-phy support for exynos5250 [PATCH v8 0/4] Adding usb2.0 host-phy support for exynos5250 - Aligning as per the patch: usb: phy: samsung: Add support to set pmu isolation - Replaced phy-handle approach for PHY CONTROL registers to child nodes. - Removing AUX data entry from exynos5250 dt file. Vivek Gautam (2): ARM: Exynos5250: Enabling samsung-usb2phy driver ARM: Exynos5250: Enabling samsung-usb3phy driver arch/arm/boot/dts/exynos5250.dtsi | 25 + 1 files changed, 25 insertions(+), 0 deletions(-) -- 1.7.6.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb 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/2] ARM: Exynos5250: Enabling samsung-usb2phy driver
Adding device node for Samsung USB 2.0 PHY controller driver on Exynos5250 along with the necessary device data to be parsed. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com --- arch/arm/boot/dts/exynos5250.dtsi | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi index 30485de..d1865a8 100644 --- a/arch/arm/boot/dts/exynos5250.dtsi +++ b/arch/arm/boot/dts/exynos5250.dtsi @@ -99,6 +99,19 @@ interrupts = 0 65 0; }; + usbphy@1213 { + compatible = samsung,exynos5250-usb2phy; + reg = 0x1213 0x100; + #address-cells = 1; + #size-cells = 1; + ranges; + + usbphy-sys { + reg = 0x10040704 0x8, + 0x10050230 0x4; + }; + }; + serial@12C0 { compatible = samsung,exynos4210-uart; reg = 0x12C0 0x100; -- 1.7.6.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb 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/2] ARM: Exynos5250: Enabling samsung-usb3phy driver
Adding device node for Samsung USB 3.0 PHY controller driver on Exynos5250 along with the necessary device data to be parsed. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com --- arch/arm/boot/dts/exynos5250.dtsi | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi index d1865a8..451dcdb 100644 --- a/arch/arm/boot/dts/exynos5250.dtsi +++ b/arch/arm/boot/dts/exynos5250.dtsi @@ -99,6 +99,18 @@ interrupts = 0 65 0; }; + usbphy@1210 { + compatible = samsung,exynos5250-usb3phy; + reg = 0x1210 0x100; + #address-cells = 1; + #size-cells = 1; + ranges; + + usbphy-sys { + reg = 0x10040704 0x8; + }; + }; + usbphy@1213 { compatible = samsung,exynos5250-usb2phy; reg = 0x1213 0x100; -- 1.7.6.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RFC] usb: dwc3: Set GCTL.PrtCapDir based on selected mode.
Now that machines may select the mode of working of DWC3, we can set the Port capability direction based on selected mode. Signed-off-by: Vivek Gautam gautam.vi...@samsung.com --- drivers/usb/dwc3/core.c | 11 --- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 177f4c6..f4c47f7 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -479,7 +479,6 @@ static int dwc3_probe(struct platform_device *pdev) switch (mode) { case DWC3_MODE_DEVICE: - dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE); ret = dwc3_gadget_init(dwc); if (ret) { dev_err(dev, failed to initialize gadget\n); @@ -487,7 +486,6 @@ static int dwc3_probe(struct platform_device *pdev) } break; case DWC3_MODE_HOST: - dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_HOST); ret = dwc3_host_init(dwc); if (ret) { dev_err(dev, failed to initialize host\n); @@ -495,7 +493,6 @@ static int dwc3_probe(struct platform_device *pdev) } break; case DWC3_MODE_DRD: - dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG); ret = dwc3_host_init(dwc); if (ret) { dev_err(dev, failed to initialize host\n); @@ -514,6 +511,14 @@ static int dwc3_probe(struct platform_device *pdev) } dwc-mode = mode; +#if IS_ENABLED(CONFIG_USB_DWC3_HOST) + dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_HOST); +#elif IS_ENABLED(CONFIG_USB_DWC3_GADGET) + dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE); +#else + dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG); +#endif + ret = dwc3_debugfs_init(dwc); if (ret) { dev_err(dev, failed to initialize debugfs\n); -- 1.7.6.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
usbip-utils USBIP_VERSION
Hi. I was trying to bring together Linux Windows usbip and faced a problem with currently published on SourceForge windows driver and tools. usbip.exe -l host is saying: usbip err: ... (usbip_recv_op_common) recv op_common, -1 ... Debugging and tcpdumping showed that problem lies in that Windows side thinks it speaks 0x0106 version of the protocol and Linux side think it is 0x0111. Git tree of Linux shows that its define in drivers/staging/usbip/userspace/configure.ac USBIP_VERSION was changing 0x0106 - 0x0100 - 0x0111 without obvious (to me at least) reasons. So Linux-side rejects connections because of protocol mistmatch. Currently, I have recompiled usbip-utils on Linux system with fixed version and it became speaking to Windows now. But I have not tested devices yet. I think this should be fixed somehow in usbip-utils - by downgrading version, or accepting other compatible versions. -- Alexander Zubkov -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: how to specify an OMAP clock in device tree?
On 02/05/2013 01:15 PM, Rajendra Nayak wrote: On Tuesday 05 February 2013 03:04 PM, Roger Quadros wrote: Hi Rajendra, On 02/04/2013 05:58 PM, Roger Quadros wrote: Provide the RESET and Power regulators for the USB PHY, the USB Host port mode and the PHY device. Also provide pin multiplexer information for the USB host pins. Signed-off-by: Roger Quadros rog...@ti.com --- arch/arm/boot/dts/omap4-panda.dts | 55 + 1 files changed, 55 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/dts/omap4-panda.dts b/arch/arm/boot/dts/omap4-panda.dts index 4122efe..fe2d3d4 100644 --- a/arch/arm/boot/dts/omap4-panda.dts +++ b/arch/arm/boot/dts/omap4-panda.dts @@ -57,6 +57,35 @@ AFML, Line In, AFMR, Line In; }; + +/* HS USB Port 1 RESET */ +hsusb1_reset: hsusb1_reset_reg { +compatible = regulator-fixed; +regulator-name = hsusb1_reset; +regulator-min-microvolt = 330; +regulator-max-microvolt = 330; +gpio = gpio2 30 0;/* gpio_62 */ +startup-delay-us = 7; +enable-active-high; +}; + +/* HS USB Port 1 Power */ +hsusb1_power: hsusb1_power_reg { +compatible = regulator-fixed; +regulator-name = hsusb1_vbus; +regulator-min-microvolt = 330; +regulator-max-microvolt = 330; +gpio = gpio1 1 0;/* gpio_1 */ +startup-delay-us = 7; +enable-active-high; +}; + +/* HS USB Host PHY on PORT 1 */ +hsusb1_phy: hsusb1_phy { +compatible = usb-nop-xceiv; +reset-supply = hsusb1_reset; +vcc-supply = hsusb1_power; +}; This is the patch I was discussing with you about before. Let me explain the problem again. The Pandaboard has a USB PHY whose reference clock is provided by FREF_CLK3 pin which is a clock generated by the OMAP. The PHY driver expects a reference to this clock in the PHY device node. Well, the driver just does a clk_get(dev, main_clk); and clk_get() is then able to either pick the reference from the PHY dt node or from a clkdev entry. The problem here seems to be that you are not able to add a clkdev entry because the device name wouldn't be fixed, since you have a node in the form of 'node: node {'. All other onchip OMAP devices don't have this issue because they have an entry in the form of 'node: node@addr' and hence have a fixed device name and hence can add a clkdev entry for the clocks they want to control. I don't know if there is any good way to define the DT node for the on board PHY in such a way that the device name is always fixed, in which case you can then add a clkdev entry for 'dev, main_clk' mapping to the onchip clock that provides the clock, but if there is one, then that should fix your problem. Fixing the device name doesn't really solve the problem. Not all OMAP boards will use the same clock for the external device. So you can't provide this information in some common clock data file. The data has to come from a board specific location, which in the DT boot case is the board's dts file. I think all we need to do is register a clock provider using of_clk_add_provider() and provide a clk_src_get() hook that can get the right clock. usage e.g. /* provider */ clks: omapclocks { compatible = ti,omapclocks; #clock-cells = 1; }; /* consumer */ hsusb1_phy: hsusb1_phy { compatible = usb-nop-xceiv; clocks = clks auxclk3_ck; /* FREF_CLK3 */ clock-names = main-clk; }; The only problem I see is that the argument to the clks phandle cannot be a string. It needs to be u32. In that case we need to map all clocks into a u32 index. If we can do that only for auxclks, my problem is solved for panda. The usage e.g then changes to /* provider */ aux_clks: omap_aux_clocks { compatible = ti,omap_aux_clocks; #clock-cells = 1; }; /* consumer */ hsusb1_phy: hsusb1_phy { compatible = usb-nop-xceiv; clocks = aux_clks 3; /* FREF_CLK3 */ clock-names = main-clk; }; Does this idea sound reasonable? regards, -roger -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: how to specify an OMAP clock in device tree?
On Tuesday 05 February 2013 07:16 PM, Roger Quadros wrote: Fixing the device name doesn't really solve the problem. Not all OMAP boards will use the same clock for the external device. Are you saying different OMAP boards will use different Internal clocks? Or different OMAP boards will use a single Internal clock or an external one. -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: how to specify an OMAP clock in device tree?
On 02/05/2013 04:13 PM, Rajendra Nayak wrote: On Tuesday 05 February 2013 07:16 PM, Roger Quadros wrote: Fixing the device name doesn't really solve the problem. Not all OMAP boards will use the same clock for the external device. Are you saying different OMAP boards will use different Internal clocks? Or different OMAP boards will use a single Internal clock or an external one. All I was saying is that one board can use for example auxclk1 whereas another one can use auxclk3, both generated by OMAP for the same PHY configuration. cheers, -roger -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 09/13] mfd: omap-usb-host: Add device tree support and binding information
Hi, I have a few comments on the binding and the way it's parsed. On Mon, Feb 04, 2013 at 03:58:56PM +, Roger Quadros wrote: Allows the OMAP HS USB host controller to be specified via device tree. CC: Samuel Ortiz sa...@linux.intel.com Signed-off-by: Roger Quadros rog...@ti.com --- .../devicetree/bindings/mfd/omap-usb-host.txt | 68 drivers/mfd/omap-usb-host.c| 83 ++-- 2 files changed, 145 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-host.txt diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt new file mode 100644 index 000..2196893 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt @@ -0,0 +1,68 @@ +OMAP HS USB Host + +Required properties: + +- compatible: should be ti,usbhs-host +- reg: should contain one register range i.e. start and length +- ti,hwmods: must contain usb_host_hs + +Optional properties: + +- nports: number of USB ports. Usually this is automatically detected + from the IP's revision register but can be overridden by specifying + this property. It would be nice if this were num-ports, as atmel-usb is already using that, and it's clear that it's a number of ports rather than some other meaning of 'n'. From a quick grep of binding documents, out of nTHING(s), nr-THINGs, and num-THINGs, num-THINGs seems to be the most common. It would be nice if new bindings could standardise this. + +- portN_mode: Integer specifying the port mode for port N, where N can be + from 1 to nports. The port mode must be as per enum usbhs_omap_port_mode + in include/linux/platform_data/usb-omap.h + If the port mode is not specified, that port is treated as unused. I'm against devicetree bindings refering to Linux internals. It makes a poorly documented ABI that someone might change in future without realising the implications, and it makes it stupidly difficult to read a dts. Everything required should be specified in the binding document (or another linked binding document). It might be better to describe this with a string property that gets mapped by your dt parsing code to whatever internal representation you need. That way it's far easier for a human to verify the dts is correct, and you know by construction that the parsed value is something you can handle in the driver. It would be nicer is you used '-' rather than '_' for consistency with devicetree bindings in general. + +- single_ulpi_bypass: Must be present if the controller contains a single + ULPI bypass control bit. e.g. OMAP3 silicon = ES2.1 Again it would be nicer to have '-' rather than '_' here. It might be worth prefixing this ti,. + +Required properties if child node exists: + +- #address-cells: Must be 1 +- #size-cells: Must be 1 +- ranges: must be present + +Properties for children: + +The OMAP HS USB Host subsystem contains EHCI and OHCI controllers. +See Documentation/devicetree/bindings/usb/omap-ehci.txt and +omap3-ohci.txt + +Example for OMAP4: + +usbhshost: usbhshost@0x4a064000 { + compatible = ti,usbhs-host; + reg = 0x4a064000 0x800; + ti,hwmods = usb_host_hs; + #address-cells = 1; + #size-cells = 1; + ranges; + + usbhsohci: ohci@0x4a064800 { + compatible = ti,omap3-ohci, usb-ohci; + reg = 0x4a064800 0x400; + interrupt-parent = gic; + interrupts = 0 76 0x4; + }; + + usbhsehci: ehci@0x4a064c00 { + compatible = ti,omap-ehci, usb-ehci; + reg = 0x4a064c00 0x400; + interrupt-parent = gic; + interrupts = 0 77 0x4; + }; +}; + +usbhshost { + port1_mode = 1; /* OMAP_EHCI_PORT_MODE_PHY */ + port2_mode = 2; /* OMAP_EHCI_PORT_MODE_TLL */ + port3_mode = 1; /* OMAP_EHCI_PORT_MODE_PHY */ With a string property, these values would be self-documenting. +}; + +usbhsehci { + phy = hsusb1_phy 0 hsusb3_phy; +}; diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index f8ed08e..0f67856 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -1,8 +1,9 @@ /** * omap-usb-host.c - The USBHS core driver for OMAP EHCI OHCI * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com + * Copyright (C) 2011-2013 Texas Instruments Incorporated - http://www.ti.com * Author: Keshava Munegowda keshava_mgo...@ti.com + * Author: Roger Quadros rog...@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 of @@ -27,6 +28,8 @@ #include linux/platform_device.h #include linux/platform_data/usb-omap.h #include linux/pm_runtime.h +#include linux/of.h +#include linux/of_platform.h #include omap-usb.h @@
Re: how to specify an OMAP clock in device tree?
On Tuesday 05 February 2013 07:48 PM, Roger Quadros wrote: On 02/05/2013 04:13 PM, Rajendra Nayak wrote: On Tuesday 05 February 2013 07:16 PM, Roger Quadros wrote: Fixing the device name doesn't really solve the problem. Not all OMAP boards will use the same clock for the external device. Are you saying different OMAP boards will use different Internal clocks? Or different OMAP boards will use a single Internal clock or an external one. All I was saying is that one board can use for example auxclk1 whereas another one can use auxclk3, both generated by OMAP for the same PHY configuration. Ok, so lets keep DT aside for a while. How would something like this work in a non-DT world? Would the driver then be able to do a clk_get(dev, main_clk); and get say auxclk1 on one board and auxclk3 on another? cheers, -roger -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: how to specify an OMAP clock in device tree?
On 02/05/2013 04:21 PM, Rajendra Nayak wrote: On Tuesday 05 February 2013 07:48 PM, Roger Quadros wrote: On 02/05/2013 04:13 PM, Rajendra Nayak wrote: On Tuesday 05 February 2013 07:16 PM, Roger Quadros wrote: Fixing the device name doesn't really solve the problem. Not all OMAP boards will use the same clock for the external device. Are you saying different OMAP boards will use different Internal clocks? Or different OMAP boards will use a single Internal clock or an external one. All I was saying is that one board can use for example auxclk1 whereas another one can use auxclk3, both generated by OMAP for the same PHY configuration. Ok, so lets keep DT aside for a while. How would something like this work in a non-DT world? Would the driver then be able to do a clk_get(dev, main_clk); and get say auxclk1 on one board and auxclk3 on another? Yes, all you need to do is specify an alias to the clock in the board file. e.g. in board 1 file clk_add_alias(main_clk, phy.1, auxclk1_ck, NULL); in board 2 file clk_add_alias(main_clk, phy.1, auxclk3_ck, NULL); cheers, -roger -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: how to specify an OMAP clock in device tree?
On Tuesday 05 February 2013 07:59 PM, Roger Quadros wrote: On 02/05/2013 04:21 PM, Rajendra Nayak wrote: On Tuesday 05 February 2013 07:48 PM, Roger Quadros wrote: On 02/05/2013 04:13 PM, Rajendra Nayak wrote: On Tuesday 05 February 2013 07:16 PM, Roger Quadros wrote: Fixing the device name doesn't really solve the problem. Not all OMAP boards will use the same clock for the external device. Are you saying different OMAP boards will use different Internal clocks? Or different OMAP boards will use a single Internal clock or an external one. All I was saying is that one board can use for example auxclk1 whereas another one can use auxclk3, both generated by OMAP for the same PHY configuration. Ok, so lets keep DT aside for a while. How would something like this work in a non-DT world? Would the driver then be able to do a clk_get(dev, main_clk); and get say auxclk1 on one board and auxclk3 on another? Yes, all you need to do is specify an alias to the clock in the board file. Can we then create a special board specific node for panda and do similar things from DT? See a similar discussion below on how to handle the gpio_request() we had as part of board files http://www.spinics.net/lists/linux-omap/msg85248.html e.g. in board 1 file clk_add_alias(main_clk, phy.1, auxclk1_ck, NULL); in board 2 file clk_add_alias(main_clk, phy.1, auxclk3_ck, NULL); cheers, -roger -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 09/13] mfd: omap-usb-host: Add device tree support and binding information
On 02/05/2013 04:20 PM, Mark Rutland wrote: Hi, I have a few comments on the binding and the way it's parsed. On Mon, Feb 04, 2013 at 03:58:56PM +, Roger Quadros wrote: Allows the OMAP HS USB host controller to be specified via device tree. CC: Samuel Ortiz sa...@linux.intel.com Signed-off-by: Roger Quadros rog...@ti.com --- .../devicetree/bindings/mfd/omap-usb-host.txt | 68 drivers/mfd/omap-usb-host.c| 83 ++-- 2 files changed, 145 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-host.txt diff --git a/Documentation/devicetree/bindings/mfd/omap-usb-host.txt b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt new file mode 100644 index 000..2196893 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/omap-usb-host.txt @@ -0,0 +1,68 @@ +OMAP HS USB Host + +Required properties: + +- compatible: should be ti,usbhs-host +- reg: should contain one register range i.e. start and length +- ti,hwmods: must contain usb_host_hs + +Optional properties: + +- nports: number of USB ports. Usually this is automatically detected + from the IP's revision register but can be overridden by specifying + this property. It would be nice if this were num-ports, as atmel-usb is already using that, and it's clear that it's a number of ports rather than some other meaning of 'n'. From a quick grep of binding documents, out of nTHING(s), nr-THINGs, and num-THINGs, num-THINGs seems to be the most common. It would be nice if new bindings could standardise this. Agreed. + +- portN_mode: Integer specifying the port mode for port N, where N can be + from 1 to nports. The port mode must be as per enum usbhs_omap_port_mode + in include/linux/platform_data/usb-omap.h + If the port mode is not specified, that port is treated as unused. I'm against devicetree bindings refering to Linux internals. It makes a poorly documented ABI that someone might change in future without realising the implications, and it makes it stupidly difficult to read a dts. Everything required should be specified in the binding document (or another linked binding document). It might be better to describe this with a string property that gets mapped by your dt parsing code to whatever internal representation you need. That way it's far easier for a human to verify the dts is correct, and you know by construction that the parsed value is something you can handle in the driver. As string makes it self documenting, I'll convert it to a string and update the binding document. It would be nicer is you used '-' rather than '_' for consistency with devicetree bindings in general. OK. + +- single_ulpi_bypass: Must be present if the controller contains a single + ULPI bypass control bit. e.g. OMAP3 silicon = ES2.1 Again it would be nicer to have '-' rather than '_' here. It might be worth prefixing this ti,. Is prefixing with ti really required? how does it better? + +Required properties if child node exists: + +- #address-cells: Must be 1 +- #size-cells: Must be 1 +- ranges: must be present + +Properties for children: + +The OMAP HS USB Host subsystem contains EHCI and OHCI controllers. +See Documentation/devicetree/bindings/usb/omap-ehci.txt and +omap3-ohci.txt + +Example for OMAP4: + +usbhshost: usbhshost@0x4a064000 { +compatible = ti,usbhs-host; +reg = 0x4a064000 0x800; +ti,hwmods = usb_host_hs; +#address-cells = 1; +#size-cells = 1; +ranges; + +usbhsohci: ohci@0x4a064800 { +compatible = ti,omap3-ohci, usb-ohci; +reg = 0x4a064800 0x400; +interrupt-parent = gic; +interrupts = 0 76 0x4; +}; + +usbhsehci: ehci@0x4a064c00 { +compatible = ti,omap-ehci, usb-ehci; +reg = 0x4a064c00 0x400; +interrupt-parent = gic; +interrupts = 0 77 0x4; +}; +}; + +usbhshost { +port1_mode = 1; /* OMAP_EHCI_PORT_MODE_PHY */ +port2_mode = 2; /* OMAP_EHCI_PORT_MODE_TLL */ +port3_mode = 1; /* OMAP_EHCI_PORT_MODE_PHY */ With a string property, these values would be self-documenting. +}; + +usbhsehci { +phy = hsusb1_phy 0 hsusb3_phy; +}; diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index f8ed08e..0f67856 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -1,8 +1,9 @@ /** * omap-usb-host.c - The USBHS core driver for OMAP EHCI OHCI * - * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com + * Copyright (C) 2011-2013 Texas Instruments Incorporated - http://www.ti.com * Author: Keshava Munegowda keshava_mgo...@ti.com + * Author: Roger Quadros rog...@ti.com * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public
Re: [PATCH 1/2] usb: phy: Add USB host phy support on Exyno4412
Hi, On Tue, Feb 5, 2013 at 6:55 AM, Dongjin Kim tobet...@gmail.com wrote: This patch adds host phy support for Samsung's Exynos4412 SoC to samsung-usbphy driver. This patch is created upon http://git.kernel.org/?p=linux/kernel/git/balbi/usb.git;a=commit;h=2564b526b8cf01e6c36285edfd40a438e683c2b8; Cc: Praveen Paneri p.pan...@samsung.com Signed-off-by: Dongjin Kim tobet...@gmail.com --- drivers/usb/phy/samsung-usbphy.c | 156 +- 1 file changed, 154 insertions(+), 2 deletions(-) diff --git a/drivers/usb/phy/samsung-usbphy.c b/drivers/usb/phy/samsung-usbphy.c index 6ea5537..c800fa4 100644 --- a/drivers/usb/phy/samsung-usbphy.c +++ b/drivers/usb/phy/samsung-usbphy.c @@ -47,7 +47,7 @@ #define PHYCLK_MODE_USB11 (0x1 6) #define PHYCLK_EXT_OSC (0x1 5) -#define PHYCLK_COMMON_ON_N (0x1 4) +#define PHYCLK_COMMON_ON_N_PHY0(0x1 4) #define PHYCLK_ID_PULL (0x1 2) #define PHYCLK_CLKSEL_MASK (0x3 0) #define PHYCLK_CLKSEL_48M (0x0 0) @@ -60,6 +60,22 @@ #define RSTCON_HLINK_SWRST (0x1 1) #define RSTCON_SWRST (0x1 0) +/* For Exynos4412 */ +#define PHYCLK_COMMON_ON_N_PHY1(0x1 7) + +#define PHYPWR_NORMAL_MASK_HSIC1 (0x7 12) +#define PHYPWR_NORMAL_MASK_HSIC0 (0x7 9) +#define PHYPWR_NORMAL_MASK_PHY1(0x7 6) + +#define PHYPWR_ANALOG_POWERDOWN_PHY1 (0x1 7) + +#define RSTCON_HLINK_SWRST_MASK(0xf 7) +#define RSTCON_PHY1_SWRST_MASK (0xf 3) +#define RSTCON_PHY0_SWRST_MASK (0x7 0) + +#define EXYNOS4_PHY_HSIC_CTRL0 (0x04) +#define EXYNOS4_PHY_HSIC_CTRL1 (0x08) + /* EXYNOS5 */ #define EXYNOS5_PHY_HOST_CTRL0 (0x00) @@ -174,6 +190,7 @@ enum samsung_cpu_type { TYPE_S3C64XX, TYPE_EXYNOS4210, + TYPE_EXYNOS4412, Shouldn't you add it under the TYPE_EXYNOS4X12. We will have to add a separate support for 4212 then. TYPE_EXYNOS5250, }; @@ -322,6 +339,17 @@ static void samsung_usbphy_set_isolation(struct samsung_usbphy *sphy, bool on) en_mask = sphy-drv_data-hostphy_en_mask; } break; + case TYPE_EXYNOS4412: + if (sphy-phy_type == USB_PHY_TYPE_DEVICE) { + reg = sphy-pmuregs + + sphy-drv_data-devphy_reg_offset; + en_mask = sphy-drv_data-devphy_en_mask; + } else if (sphy-phy_type == USB_PHY_TYPE_HOST) { + reg = sphy-pmuregs + + sphy-drv_data-hostphy_reg_offset; + en_mask = sphy-drv_data-hostphy_en_mask; + } + break; default: dev_err(sphy-dev, Invalid SoC type\n); return; @@ -422,6 +450,29 @@ static int samsung_usbphy_get_refclk_freq(struct samsung_usbphy *sphy) refclk_freq = FSEL_CLKSEL_24M; break; } + } else if (sphy-drv_data-cpu_type == TYPE_EXYNOS4412) { + switch (clk_get_rate(ref_clk)) { + case 9600 * KHZ: + refclk_freq = FSEL_CLKSEL_9600K; + break; + case 10 * MHZ: + refclk_freq = FSEL_CLKSEL_10M; + break; + case 12 * MHZ: + refclk_freq = FSEL_CLKSEL_12M; + break; + case 19200 * KHZ: + refclk_freq = FSEL_CLKSEL_19200K; + break; + case 20 * MHZ: + refclk_freq = FSEL_CLKSEL_20M; + break; + case 24 * MHZ: + default: + /* default reference clock */ + refclk_freq = FSEL_CLKSEL_24M; + break; + } } else { switch (clk_get_rate(ref_clk)) { case 12 * MHZ: @@ -561,6 +612,69 @@ static void samsung_exynos5_usbphy_enable(struct samsung_usbphy *sphy) writel(ohcictrl, regs + EXYNOS5_PHY_HOST_OHCICTRL); } +static bool exynos4_phyhost_is_on(void *regs) +{ + u32 reg; + + reg = readl(regs + SAMSUNG_PHYPWR); + + return !(reg PHYPWR_ANALOG_POWERDOWN_PHY1); +} + +static void samsung_exynos4412_usbphy_enable(struct samsung_usbphy *sphy) +{ + void __iomem *regs = sphy-regs; + u32 phypwr; + u32 phyclk; + u32 rstcon; + + /* +* phy_usage helps in keeping usage count for phy +* so
Re: how to specify an OMAP clock in device tree?
On 02/05/2013 04:36 PM, Rajendra Nayak wrote: On Tuesday 05 February 2013 07:59 PM, Roger Quadros wrote: On 02/05/2013 04:21 PM, Rajendra Nayak wrote: On Tuesday 05 February 2013 07:48 PM, Roger Quadros wrote: On 02/05/2013 04:13 PM, Rajendra Nayak wrote: On Tuesday 05 February 2013 07:16 PM, Roger Quadros wrote: Fixing the device name doesn't really solve the problem. Not all OMAP boards will use the same clock for the external device. Are you saying different OMAP boards will use different Internal clocks? Or different OMAP boards will use a single Internal clock or an external one. All I was saying is that one board can use for example auxclk1 whereas another one can use auxclk3, both generated by OMAP for the same PHY configuration. Ok, so lets keep DT aside for a while. How would something like this work in a non-DT world? Would the driver then be able to do a clk_get(dev, main_clk); and get say auxclk1 on one board and auxclk3 on another? Yes, all you need to do is specify an alias to the clock in the board file. Can we then create a special board specific node for panda and do similar things from DT? See a similar discussion below on how to handle the gpio_request() we had as part of board files http://www.spinics.net/lists/linux-omap/msg85248.html Doesn't look very elegant to me, but I wouldn't mind if there is no better option. Even then, we can't rely on the device name as its index can change based on where it is located in the dts file. e.g. in the beginning it may be named phy.8, and if a device node is added before it, it will get changed to phy.9 e.g. in board 1 file clk_add_alias(main_clk, phy.1, auxclk1_ck, NULL); in board 2 file clk_add_alias(main_clk, phy.1, auxclk3_ck, NULL); cheers, -roger -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[GIT PULL] ARM part of USB patches
Hi Tony, As discussed, I'm sending a pull request for the arch/arm part of my USB patches. These patches are necessary to get MUSB functional in both dt and non-dt boot. Also added dt data for dwc3 present in OMAP. This patch series *depends* on some of the patches which are merged in usb-next. Thanks Kishon The following changes since commit 88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7: Linux 3.8-rc6 (2013-02-01 12:08:14 +1100) are available in the git repository at: git://gitorious.org/linux-usb/linux-usb.git arm-usb-dt for you to fetch changes up to 09084a48903c6056e20e27ae5054902958a10275: ARM: dts: omap5: add dwc3 core dt data (2013-02-05 20:11:46 +0530) Kishon Vijay Abraham I (12): ARM: OMAP4: remove control module address space from PHY and OTG ARM: OMAP: devices: create device for usb part of control module ARM: OMAP2: MUSB: Specify omap4 has mailbox ARM: dts: omap: Add omap control usb data ARM: dts: omap: Add omap-usb2 dt data ARM: dts: omap: Add usb_otg and glue data ARM: OMAP: USB: Add phy binding information ARM: dts: omap5: Add omap control usb data ARM: dts: omap5: Add ocp2scp data ARM: dts: omap5: Add omap-usb3 and omap-usb2 dt data ARM: dts: omap5: add dwc3 omap dt data ARM: dts: omap5: add dwc3 core dt data Documentation/devicetree/bindings/usb/omap-usb.txt |1 + 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 | 12 arch/arm/boot/dts/omap4-panda.dts |6 ++ arch/arm/boot/dts/omap4-sdp.dts|6 ++ arch/arm/boot/dts/omap4.dtsi | 26 ++ arch/arm/boot/dts/omap5.dtsi | 48 arch/arm/boot/dts/twl4030.dtsi |2 +- arch/arm/mach-omap2/board-2430sdp.c|2 ++ arch/arm/mach-omap2/board-3430sdp.c|2 ++ arch/arm/mach-omap2/board-4430sdp.c|2 ++ arch/arm/mach-omap2/board-cm-t35.c |2 ++ arch/arm/mach-omap2/board-devkit8000.c |2 ++ arch/arm/mach-omap2/board-igep0020.c |2 ++ arch/arm/mach-omap2/board-ldp.c|2 ++ arch/arm/mach-omap2/board-omap3beagle.c|2 ++ arch/arm/mach-omap2/board-omap3evm.c |2 ++ arch/arm/mach-omap2/board-omap3logic.c |2 ++ arch/arm/mach-omap2/board-omap3pandora.c |2 ++ arch/arm/mach-omap2/board-omap3stalker.c |2 ++ arch/arm/mach-omap2/board-omap3touchbook.c |2 ++ arch/arm/mach-omap2/board-omap4panda.c |2 ++ arch/arm/mach-omap2/board-overo.c |2 ++ arch/arm/mach-omap2/board-rm680.c |2 ++ arch/arm/mach-omap2/board-zoom-peripherals.c |2 ++ arch/arm/mach-omap2/devices.c | 45 + arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 13 - arch/arm/mach-omap2/usb-musb.c |3 +++ include/linux/usb/musb.h |2 ++ 31 files changed, 202 insertions(+), 14 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL] ARM part of USB patches
Hi Tony, Greg, On Tuesday 05 February 2013 08:54 PM, kishon wrote: Hi Tony, As discussed, I'm sending a pull request for the arch/arm part of my USB patches. These patches are necessary to get MUSB functional in both dt and non-dt boot. Also added dt data for dwc3 present in OMAP. This patch series *depends* on some of the patches which are merged in usb-next. This patch series should go in only after USB. Or else it will break compilation. Thanks Kishon Thanks Kishon The following changes since commit 88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7: Linux 3.8-rc6 (2013-02-01 12:08:14 +1100) are available in the git repository at: git://gitorious.org/linux-usb/linux-usb.git arm-usb-dt for you to fetch changes up to 09084a48903c6056e20e27ae5054902958a10275: ARM: dts: omap5: add dwc3 core dt data (2013-02-05 20:11:46 +0530) Kishon Vijay Abraham I (12): ARM: OMAP4: remove control module address space from PHY and OTG ARM: OMAP: devices: create device for usb part of control module ARM: OMAP2: MUSB: Specify omap4 has mailbox ARM: dts: omap: Add omap control usb data ARM: dts: omap: Add omap-usb2 dt data ARM: dts: omap: Add usb_otg and glue data ARM: OMAP: USB: Add phy binding information ARM: dts: omap5: Add omap control usb data ARM: dts: omap5: Add ocp2scp data ARM: dts: omap5: Add omap-usb3 and omap-usb2 dt data ARM: dts: omap5: add dwc3 omap dt data ARM: dts: omap5: add dwc3 core dt data Documentation/devicetree/bindings/usb/omap-usb.txt |1 + 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 | 12 arch/arm/boot/dts/omap4-panda.dts |6 ++ arch/arm/boot/dts/omap4-sdp.dts|6 ++ arch/arm/boot/dts/omap4.dtsi | 26 ++ arch/arm/boot/dts/omap5.dtsi | 48 arch/arm/boot/dts/twl4030.dtsi |2 +- arch/arm/mach-omap2/board-2430sdp.c|2 ++ arch/arm/mach-omap2/board-3430sdp.c|2 ++ arch/arm/mach-omap2/board-4430sdp.c|2 ++ arch/arm/mach-omap2/board-cm-t35.c |2 ++ arch/arm/mach-omap2/board-devkit8000.c |2 ++ arch/arm/mach-omap2/board-igep0020.c |2 ++ arch/arm/mach-omap2/board-ldp.c|2 ++ arch/arm/mach-omap2/board-omap3beagle.c|2 ++ arch/arm/mach-omap2/board-omap3evm.c |2 ++ arch/arm/mach-omap2/board-omap3logic.c |2 ++ arch/arm/mach-omap2/board-omap3pandora.c |2 ++ arch/arm/mach-omap2/board-omap3stalker.c |2 ++ arch/arm/mach-omap2/board-omap3touchbook.c |2 ++ arch/arm/mach-omap2/board-omap4panda.c |2 ++ arch/arm/mach-omap2/board-overo.c |2 ++ arch/arm/mach-omap2/board-rm680.c |2 ++ arch/arm/mach-omap2/board-zoom-peripherals.c |2 ++ arch/arm/mach-omap2/devices.c | 45 + arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 13 - arch/arm/mach-omap2/usb-musb.c |3 +++ include/linux/usb/musb.h |2 ++ 31 files changed, 202 insertions(+), 14 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [REVERT][v3.x.y] EHCI: Update qTD next pointer in QH overlay region during unlink
On 02/04/2013 05:04 PM, Alan Stern wrote: On Fri, 1 Feb 2013, Joseph Salisbury wrote: Hi Alan, There is a tar file[0] attached to the bug report[1]. The tar file contains a few examples of failed and successful recording attempts while collecting usbmon traces. There is a readme.txt file available after extracting the files. The bug reporter states that only the first recording after boot fails. Subsequent recordings succeed will succeed. Thanks again for reviewing this, Alan. Just let me know if you would like any additional data or testing. Thanks, Joe [0] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1088733/+attachment/3510887/+files/usbmon-1088733.tar.gz [1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1088733 I have replied to the original report at bugs.launchpad.net with a diagnostic patch. Maybe it will help indicate what's going wrong. Alan Stern Thanks so much for the assistance, Alan. I'll work with the bug reporter to build a kernel with the patch and test. Joe -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 09/13] mfd: omap-usb-host: Add device tree support and binding information
[...] + +- single_ulpi_bypass: Must be present if the controller contains a single + ULPI bypass control bit. e.g. OMAP3 silicon = ES2.1 Again it would be nicer to have '-' rather than '_' here. It might be worth prefixing this ti,. Is prefixing with ti really required? how does it better? I thought single-ulpi-bypass sounded rather generic, but it probably is specific enough as-is. I don't know enough about USB hardware to have strong feelings either way. [...] Thanks for the in-depth review :). You're welcome. Thanks, Mark. -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 12/15] USB: gadget/freescale: disable non-multiplatform drivers
On Monday 21 January 2013, Greg Kroah-Hartman wrote: On Mon, Jan 21, 2013 at 08:41:38PM +0200, Felipe Balbi wrote: Hi, On Mon, Jan 21, 2013 at 05:16:05PM +, Arnd Bergmann wrote: Both the fsl_mxc gadget and the imx_udc gadget drivers fail to build without the mach/hardware.h file that is not available when building for multiplatform. Let's disable these drivers for v3.8 in combination with CONFIG_ARCH_MULTIPLATFORM, and fix them properly in v3.9 unless someone has an better solution. Without this patch, building allyesconfig results in: drivers/usb/gadget/fsl_mxc_udc.c:21:27: fatal error: mach/hardware.h: No such file or directory Signed-off-by: Arnd Bergmann a...@arndb.de Cc: Felipe Balbi ba...@ti.com Cc: Shawn Guo shawn@linaro.org Cc: Greg Kroah-Hartman gre...@linuxfoundation.org Cc: linux-usb@vger.kernel.org NAK, I prefer to see a real fix for the problem (which in fact is already in my fixes branch). I'll pull that branch now, sorry for the delay. Apparently it hasn't made it into the upstream kernel yet, and it also doesn't seem to be in linux-next. Maybe this got lost while you were travelling? Arnd -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Linux USB file storage gadget with new UDC
On Tue, 5 Feb 2013, victor yeo wrote: Thanks, i added in UDC driver to call bulk_in_complete for every request over a bulk in ep, now the gadget driver is able to process the SCSI Inquiry command. When it comes to SCSI Read Format Capacities command, the gadget driver gives attention condition error in check_command() in the code snippet below, and the command is not processed by do_read_format_capacities(). if (curlun curlun-unit_attention_data != SS_NO_SENSE fsg-cmnd[0] != INQUIRY fsg-cmnd[0] != REQUEST_SENSE) { curlun-sense_data = curlun-unit_attention_data; curlun-unit_attention_data = SS_NO_SENSE; return -EINVAL; } Besides the code snippet, the only place that sets unit_attention data to SS_NO_SENSE is in handle_exception(). How is UDC driver able to overcome this problem? What problem? This all sounds perfectly normal. Maybe you should post the kernel debugging log. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [REVERT][v3.x.y] EHCI: Update qTD next pointer in QH overlay region during unlink
On Tue, 5 Feb 2013, Joseph Salisbury wrote: I have replied to the original report at bugs.launchpad.net with a diagnostic patch. Maybe it will help indicate what's going wrong. Alan Stern Thanks so much for the assistance, Alan. I'll work with the bug reporter to build a kernel with the patch and test. The bug reporter may not need any help, considering that he was already able to carry out a git bisection search. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb 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 00/30] USB: omap-ehci: Move PHY management to PHY driver
On Tue, Feb 05, 2013 at 01:28:51PM +0200, Roger Quadros wrote: Hi Tony Greg, What's the best way to get these patches in? All patches have been acked by respective maintainers. If Tony can Ack the arch/arm/mach-omap2 stuff then should I send a pull request directly to Greg? or the other way round? Tony, fyi, these patches should not interfere with the dw3c/musb stuff sent by Felipe Kishon. I'm fine with Tony just taking them all if he wants to. thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 12/15] USB: gadget/freescale: disable non-multiplatform drivers
On Tue, Feb 05, 2013 at 04:27:18PM +, Arnd Bergmann wrote: On Monday 21 January 2013, Greg Kroah-Hartman wrote: On Mon, Jan 21, 2013 at 08:41:38PM +0200, Felipe Balbi wrote: Hi, On Mon, Jan 21, 2013 at 05:16:05PM +, Arnd Bergmann wrote: Both the fsl_mxc gadget and the imx_udc gadget drivers fail to build without the mach/hardware.h file that is not available when building for multiplatform. Let's disable these drivers for v3.8 in combination with CONFIG_ARCH_MULTIPLATFORM, and fix them properly in v3.9 unless someone has an better solution. Without this patch, building allyesconfig results in: drivers/usb/gadget/fsl_mxc_udc.c:21:27: fatal error: mach/hardware.h: No such file or directory Signed-off-by: Arnd Bergmann a...@arndb.de Cc: Felipe Balbi ba...@ti.com Cc: Shawn Guo shawn@linaro.org Cc: Greg Kroah-Hartman gre...@linuxfoundation.org Cc: linux-usb@vger.kernel.org NAK, I prefer to see a real fix for the problem (which in fact is already in my fixes branch). I'll pull that branch now, sorry for the delay. Apparently it hasn't made it into the upstream kernel yet, and it also doesn't seem to be in linux-next. Maybe this got lost while you were travelling? Hm, no, I thought I got Felipe's fixes branch up into Linus's tree already. Felipe, did I miss something from you? If so, please resend or let me know, as I don't have anything pending on my side. thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-usb 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 00/30] USB: omap-ehci: Move PHY management to PHY driver
* Greg KH gre...@linuxfoundation.org [130205 09:00]: On Tue, Feb 05, 2013 at 01:28:51PM +0200, Roger Quadros wrote: Hi Tony Greg, What's the best way to get these patches in? All patches have been acked by respective maintainers. If Tony can Ack the arch/arm/mach-omap2 stuff then should I send a pull request directly to Greg? or the other way round? Tony, fyi, these patches should not interfere with the dw3c/musb stuff sent by Felipe Kishon. I'm fine with Tony just taking them all if he wants to. OK. Roger, can you please do me a pull request with these against v3.8-rc6? Regards, Tony -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL] ARM part of USB patches
On Tue, Feb 05, 2013 at 08:56:13PM +0530, kishon wrote: Hi Tony, Greg, On Tuesday 05 February 2013 08:54 PM, kishon wrote: Hi Tony, As discussed, I'm sending a pull request for the arch/arm part of my USB patches. These patches are necessary to get MUSB functional in both dt and non-dt boot. Also added dt data for dwc3 present in OMAP. This patch series *depends* on some of the patches which are merged in usb-next. This patch series should go in only after USB. Or else it will break compilation. Then it probably should go through the USB tree, right? We don't want to break bisectability. thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[GIT PATCH] USB fixes for 3.8-rc6
The following changes since commit 949db153b6466c6f7cad5a427ecea94985927311: Linux 3.8-rc5 (2013-01-25 11:57:28 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/ tags/usb-3.8-rc6 for you to fetch changes up to 200e0d994d9d1919b28c87f1a5fb99a8e13b8a0f: USB: storage: optimize to match the Huawei USB storage devices and support new switch command (2013-02-04 10:41:40 -0800) USB fixes for 3.8-rc6 Here are a few tiny USB fixes for 3.8-rc6. Nothing major here, some host controller bug fixes to resolve a number of bugs that people have reported, and a bunch of additional device ids are added to a number of drivers (which caused code to be deleted from the usb-storage driver, always nice.) Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org Alan Stern (9): USB: XHCI: fix memory leak of URB-private data USB: EHCI: remove ASS/PSS polling timeout USB: EHCI: unlink one async QH at a time USB: add usb_hcd_{start,end}_port_resume USB: EHCI: notify usbcore about port resumes USB: UHCI: notify usbcore about port resumes USB: EHCI: fix timer bug affecting port resume USB: EHCI: fix for leaking isochronous data USB: EHCI: fix bug in scheduling periodic split transfers Bjørn Mork (1): USB: option: add Changhong CH690 Daniele Palmas (2): USB: qcserial: add Telit Gobi QDL device USB: option: add support for Telit LE920 David Moore (1): usb: Prevent dead ports when xhci is not enabled Greg Kroah-Hartman (1): Merge tag 'for-usb-linus-2012-01-24' of git://git.kernel.org/.../sarah/xhci into usb-linus Lan Tianyu (1): usb: Using correct way to clear usb3.0 device's remote wakeup feature. Luis Llorente Campo (1): USB: add OWL CM-160 support to cp210x driver Nickolai Zeldovich (1): drivers: xhci: fix incorrect bit test Petr Kubánek (1): USB: ftdi_sio: add Zolix FTDI PID Sarah Sharp (2): xhci: Fix isoc TD encoding. xhci: Fix TD size for isochronous URBs. Sven Killig (1): USB: ftdi_sio: add PID/VID entries for ELV WS 300 PC II fangxiaozhi (2): USB: storage: Define a new macro for USB storage match rules USB: storage: optimize to match the Huawei USB storage devices and support new switch command drivers/usb/core/hcd.c | 44 + drivers/usb/core/hub.c | 70 ++-- drivers/usb/host/ehci-hcd.c| 1 + drivers/usb/host/ehci-hub.c| 9 +- drivers/usb/host/ehci-q.c | 50 +++--- drivers/usb/host/ehci-sched.c | 9 +- drivers/usb/host/ehci-timer.c | 29 ++-- drivers/usb/host/pci-quirks.c | 1 + drivers/usb/host/uhci-hub.c| 3 + drivers/usb/host/xhci-ring.c | 13 +- drivers/usb/serial/cp210x.c| 1 + drivers/usb/serial/ftdi_sio.c | 2 + drivers/usb/serial/ftdi_sio_ids.h | 9 +- drivers/usb/serial/option.c| 13 ++ drivers/usb/serial/qcserial.c | 1 + drivers/usb/storage/initializers.c | 76 - drivers/usb/storage/initializers.h | 4 +- drivers/usb/storage/unusual_devs.h | 329 + drivers/usb/storage/usb.c | 12 ++ drivers/usb/storage/usual-tables.c | 15 ++ include/linux/usb.h| 2 + include/linux/usb/hcd.h| 3 + include/uapi/linux/usb/ch9.h | 6 + 23 files changed, 310 insertions(+), 392 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL] ARM part of USB patches
* gre...@linuxfoundation.org gre...@linuxfoundation.org [130205 09:28]: On Tue, Feb 05, 2013 at 08:56:13PM +0530, kishon wrote: Hi Tony, Greg, On Tuesday 05 February 2013 08:54 PM, kishon wrote: Hi Tony, As discussed, I'm sending a pull request for the arch/arm part of my USB patches. These patches are necessary to get MUSB functional in both dt and non-dt boot. Also added dt data for dwc3 present in OMAP. This patch series *depends* on some of the patches which are merged in usb-next. This patch series should go in only after USB. Or else it will break compilation. Then it probably should go through the USB tree, right? We don't want to break bisectability. Looks like this branch needs to be based on at least 01658f0f (usb: phy: add a new driver for usb part of control module) to compile. Probably needs other USB patches too to make sense. This branch has a high likelihood of conflicting with .dts files, so Kishon, I suggest you do two branches: 1. A branch for Greg based on top of the USB changes This branch should contain: ARM: OMAP4: remove control module address space from PHY and OTG ARM: OMAP: devices: create device for usb part of control module ARM: OMAP2: MUSB: Specify omap4 has mailbox ARM: OMAP: USB: Add phy binding information Naturally please make sure they compile and boot on their own. Looks like this will only cause few trivial include merge conflicts with what I have queued up. You can add my Acked-by: Tony Lindgren t...@atomide.com for those. 2. A branch for Benoit based on v3.8-rc6 That branch should contain all the .dts changes as those will most likely cause nasty merge conflicts otherwise with what Benoit has queued up. Regards, Tony -- To unsubscribe from this list: send the line unsubscribe linux-usb 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/2] usb: phy: Add USB host phy support on Exyno4412
Hello Praveen, Thank you for reviewing. I was also considered to use TYPE_4X12, but in some other thread some people prefer to use 4412 instead of 4X12 because no 4212 based hardware yet. :) Anyway, TYPE_4X12 is also fine to me. And as you pointed out about PHY0, while testing my patch with my hardware I also wondered why PHY0 has to be enabled. Unless USBPHY its status was monitored as halted it didn't work at all. Now I find the reason that the first is power for USB block is wrong (not stable) and the second is when the hardware is initialized at first, like power up, URSTCON's initial value is 0x79, which means HSIC0, HSIC1, PHY1 and OTG is in reset state. So it has to be released before USB starts. So I am finding the good place to initiate URSTCON properly, u-boot or kernel itself. Do you have any advice on this? Thank you again. Dongjin. On Tue, Feb 5, 2013 at 11:38 PM, Praveen Paneri p.pan...@samsung.com wrote: Hi, On Tue, Feb 5, 2013 at 6:55 AM, Dongjin Kim tobet...@gmail.com wrote: This patch adds host phy support for Samsung's Exynos4412 SoC to samsung-usbphy driver. This patch is created upon http://git.kernel.org/?p=linux/kernel/git/balbi/usb.git;a=commit;h=2564b526b8cf01e6c36285edfd40a438e683c2b8; Cc: Praveen Paneri p.pan...@samsung.com Signed-off-by: Dongjin Kim tobet...@gmail.com --- drivers/usb/phy/samsung-usbphy.c | 156 +- 1 file changed, 154 insertions(+), 2 deletions(-) diff --git a/drivers/usb/phy/samsung-usbphy.c b/drivers/usb/phy/samsung-usbphy.c index 6ea5537..c800fa4 100644 --- a/drivers/usb/phy/samsung-usbphy.c +++ b/drivers/usb/phy/samsung-usbphy.c @@ -47,7 +47,7 @@ #define PHYCLK_MODE_USB11 (0x1 6) #define PHYCLK_EXT_OSC (0x1 5) -#define PHYCLK_COMMON_ON_N (0x1 4) +#define PHYCLK_COMMON_ON_N_PHY0(0x1 4) #define PHYCLK_ID_PULL (0x1 2) #define PHYCLK_CLKSEL_MASK (0x3 0) #define PHYCLK_CLKSEL_48M (0x0 0) @@ -60,6 +60,22 @@ #define RSTCON_HLINK_SWRST (0x1 1) #define RSTCON_SWRST (0x1 0) +/* For Exynos4412 */ +#define PHYCLK_COMMON_ON_N_PHY1(0x1 7) + +#define PHYPWR_NORMAL_MASK_HSIC1 (0x7 12) +#define PHYPWR_NORMAL_MASK_HSIC0 (0x7 9) +#define PHYPWR_NORMAL_MASK_PHY1(0x7 6) + +#define PHYPWR_ANALOG_POWERDOWN_PHY1 (0x1 7) + +#define RSTCON_HLINK_SWRST_MASK(0xf 7) +#define RSTCON_PHY1_SWRST_MASK (0xf 3) +#define RSTCON_PHY0_SWRST_MASK (0x7 0) + +#define EXYNOS4_PHY_HSIC_CTRL0 (0x04) +#define EXYNOS4_PHY_HSIC_CTRL1 (0x08) + /* EXYNOS5 */ #define EXYNOS5_PHY_HOST_CTRL0 (0x00) @@ -174,6 +190,7 @@ enum samsung_cpu_type { TYPE_S3C64XX, TYPE_EXYNOS4210, + TYPE_EXYNOS4412, Shouldn't you add it under the TYPE_EXYNOS4X12. We will have to add a separate support for 4212 then. TYPE_EXYNOS5250, }; @@ -322,6 +339,17 @@ static void samsung_usbphy_set_isolation(struct samsung_usbphy *sphy, bool on) en_mask = sphy-drv_data-hostphy_en_mask; } break; + case TYPE_EXYNOS4412: + if (sphy-phy_type == USB_PHY_TYPE_DEVICE) { + reg = sphy-pmuregs + + sphy-drv_data-devphy_reg_offset; + en_mask = sphy-drv_data-devphy_en_mask; + } else if (sphy-phy_type == USB_PHY_TYPE_HOST) { + reg = sphy-pmuregs + + sphy-drv_data-hostphy_reg_offset; + en_mask = sphy-drv_data-hostphy_en_mask; + } + break; default: dev_err(sphy-dev, Invalid SoC type\n); return; @@ -422,6 +450,29 @@ static int samsung_usbphy_get_refclk_freq(struct samsung_usbphy *sphy) refclk_freq = FSEL_CLKSEL_24M; break; } + } else if (sphy-drv_data-cpu_type == TYPE_EXYNOS4412) { + switch (clk_get_rate(ref_clk)) { + case 9600 * KHZ: + refclk_freq = FSEL_CLKSEL_9600K; + break; + case 10 * MHZ: + refclk_freq = FSEL_CLKSEL_10M; + break; + case 12 * MHZ: + refclk_freq = FSEL_CLKSEL_12M; + break; + case 19200 * KHZ: + refclk_freq = FSEL_CLKSEL_19200K; + break; + case
Re: [GIT PULL] ARM part of USB patches
On Tue, Feb 05, 2013 at 10:19:47AM -0800, Tony Lindgren wrote: * gre...@linuxfoundation.org gre...@linuxfoundation.org [130205 09:28]: On Tue, Feb 05, 2013 at 08:56:13PM +0530, kishon wrote: Hi Tony, Greg, On Tuesday 05 February 2013 08:54 PM, kishon wrote: Hi Tony, As discussed, I'm sending a pull request for the arch/arm part of my USB patches. These patches are necessary to get MUSB functional in both dt and non-dt boot. Also added dt data for dwc3 present in OMAP. This patch series *depends* on some of the patches which are merged in usb-next. This patch series should go in only after USB. Or else it will break compilation. Then it probably should go through the USB tree, right? We don't want to break bisectability. Looks like this branch needs to be based on at least 01658f0f (usb: phy: add a new driver for usb part of control module) to compile. Probably needs other USB patches too to make sense. This branch has a high likelihood of conflicting with .dts files, so Kishon, I suggest you do two branches: 1. A branch for Greg based on top of the USB changes This branch should contain: ARM: OMAP4: remove control module address space from PHY and OTG ARM: OMAP: devices: create device for usb part of control module ARM: OMAP2: MUSB: Specify omap4 has mailbox ARM: OMAP: USB: Add phy binding information Naturally please make sure they compile and boot on their own. Looks like this will only cause few trivial include merge conflicts with what I have queued up. You can add my Acked-by: Tony Lindgren t...@atomide.com for those. If that happens, please send me patches in email, I don't take git pull requests, especially for something as small as 4 patches. thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[-next-20130204] usb/hcd: irq 18: nobody cared
With -next-20130204: [ 33.855570] irq 18: nobody cared (try booting with the irqpoll option) [ 33.855580] Pid: 0, comm: swapper/4 Not tainted 3.8.0-next-20130204-xeon #20130204 [ 33.855582] Call Trace: [ 33.855585] IRQ [810f1076] __report_bad_irq+0x36/0xe0 [ 33.855600] [810f152a] note_interrupt+0x1aa/0x200 [ 33.855606] [8101edf2] ? mwait_idle+0x82/0x1b0 [ 33.855610] [810eed89] handle_irq_event_percpu+0xc9/0x260 [ 33.855614] [810eef68] handle_irq_event+0x48/0x70 [ 33.855618] [810f20ba] handle_fasteoi_irq+0x5a/0x100 [ 33.855624] [810182f2] handle_irq+0x22/0x40 [ 33.855630] [816e2a9a] do_IRQ+0x5a/0xd0 [ 33.855636] [816d97ad] common_interrupt+0x6d/0x6d [ 33.855638] EOI [810f8e2a] ? rcu_eqs_enter_common+0x4a/0x320 [ 33.855646] [8101edf2] ? mwait_idle+0x82/0x1b0 [ 33.855649] [8101ed99] ? mwait_idle+0x29/0x1b0 [ 33.855653] [8101f8a6] cpu_idle+0x116/0x130 [ 33.855658] [816c0c0f] start_secondary+0x251/0x258 [ 33.855660] handlers: [ 33.855664] [814f98a0] usb_hcd_irq [ 33.855667] Disabling IRQ #18 From earlier in the boot log: [1.297020] uhci_hcd :00:1d.2: setting latency timer to 64 [1.297032] uhci_hcd :00:1d.2: UHCI Host Controller [1.297040] uhci_hcd :00:1d.2: new USB bus registered, assigned bus number 4 [1.297076] uhci_hcd :00:1d.2: irq 18, io base 0xff40 [1.297213] hub 4-0:1.0: USB hub found [1.297221] hub 4-0:1.0: 2 ports detected lsusb: ... Bus 004 Device 002: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS Bus 004 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver ... Didn't have this problem with -next-20120125. One of these commits, maybe? next/drivers/usb/core$ git log --oneline next-20130125..next-20130204 -- * 2c2e865 usb: forbid memory allocation with I/O during bus reset e9121a8 Merge remote-tracking branch 'usb/usb-next' 3b2ab2b Revert usb: Register usb port's acpi power resources da0aa71 USB: add usb_hcd_{start,end}_port_resume 192fef1 usb: enable usb port device's async suspend. f6cced1 usb: expose usb port's pm qos flags to user space ad493e5 usb: add usb port auto power off mechanism 971fcd4 usb: add runtime pm support for usb port device 88bb965 usb: Register usb port's acpi power resources 54a3ac0 usb: Using correct way to clear usb3.0 device's remote wakeup feature. I didn't see any changes in the drivers/hid/hid-logitech-dj.c or usbhid but maybe it's doing something wrong anyway? I'll open a bugzilla if a bunch more info is necessary. Regards, Peter Hurley -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [-next-20130204] usb/hcd: irq 18: nobody cared
On Tue, 5 Feb 2013, Peter Hurley wrote: With -next-20130204: [ 33.855570] irq 18: nobody cared (try booting with the irqpoll option) [ 33.855580] Pid: 0, comm: swapper/4 Not tainted 3.8.0-next-20130204-xeon #20130204 [ 33.855582] Call Trace: [ 33.855585] IRQ [810f1076] __report_bad_irq+0x36/0xe0 [ 33.855600] [810f152a] note_interrupt+0x1aa/0x200 [ 33.855606] [8101edf2] ? mwait_idle+0x82/0x1b0 [ 33.855610] [810eed89] handle_irq_event_percpu+0xc9/0x260 [ 33.855614] [810eef68] handle_irq_event+0x48/0x70 [ 33.855618] [810f20ba] handle_fasteoi_irq+0x5a/0x100 [ 33.855624] [810182f2] handle_irq+0x22/0x40 [ 33.855630] [816e2a9a] do_IRQ+0x5a/0xd0 [ 33.855636] [816d97ad] common_interrupt+0x6d/0x6d [ 33.855638] EOI [810f8e2a] ? rcu_eqs_enter_common+0x4a/0x320 [ 33.855646] [8101edf2] ? mwait_idle+0x82/0x1b0 [ 33.855649] [8101ed99] ? mwait_idle+0x29/0x1b0 [ 33.855653] [8101f8a6] cpu_idle+0x116/0x130 [ 33.855658] [816c0c0f] start_secondary+0x251/0x258 [ 33.855660] handlers: [ 33.855664] [814f98a0] usb_hcd_irq [ 33.855667] Disabling IRQ #18 From earlier in the boot log: [1.297020] uhci_hcd :00:1d.2: setting latency timer to 64 [1.297032] uhci_hcd :00:1d.2: UHCI Host Controller [1.297040] uhci_hcd :00:1d.2: new USB bus registered, assigned bus number 4 [1.297076] uhci_hcd :00:1d.2: irq 18, io base 0xff40 [1.297213] hub 4-0:1.0: USB hub found [1.297221] hub 4-0:1.0: 2 ports detected lsusb: ... Bus 004 Device 002: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS Bus 004 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver ... Didn't have this problem with -next-20120125. One of these commits, maybe? next/drivers/usb/core$ git log --oneline next-20130125..next-20130204 -- * 2c2e865 usb: forbid memory allocation with I/O during bus reset e9121a8 Merge remote-tracking branch 'usb/usb-next' 3b2ab2b Revert usb: Register usb port's acpi power resources da0aa71 USB: add usb_hcd_{start,end}_port_resume 192fef1 usb: enable usb port device's async suspend. f6cced1 usb: expose usb port's pm qos flags to user space ad493e5 usb: add usb port auto power off mechanism 971fcd4 usb: add runtime pm support for usb port device 88bb965 usb: Register usb port's acpi power resources 54a3ac0 usb: Using correct way to clear usb3.0 device's remote wakeup feature. None of those commits seems likely to have caused the problem. The most likely is da0aa71, combined with one you didn't mention: 840008bb USB: UHCI: notify usbcore about port resumes If you revert these two commits, does that make any difference? What if you revert all of these commits? I didn't see any changes in the drivers/hid/hid-logitech-dj.c or usbhid but maybe it's doing something wrong anyway? I'll open a bugzilla if a bunch more info is necessary. If the suggestion above doesn't work out, bisection may be the best way to find the answer. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 12/15] USB: gadget/freescale: disable non-multiplatform drivers
Hi, On Tue, Feb 05, 2013 at 09:00:27AM -0800, Greg Kroah-Hartman wrote: On Tue, Feb 05, 2013 at 04:27:18PM +, Arnd Bergmann wrote: On Monday 21 January 2013, Greg Kroah-Hartman wrote: On Mon, Jan 21, 2013 at 08:41:38PM +0200, Felipe Balbi wrote: Hi, On Mon, Jan 21, 2013 at 05:16:05PM +, Arnd Bergmann wrote: Both the fsl_mxc gadget and the imx_udc gadget drivers fail to build without the mach/hardware.h file that is not available when building for multiplatform. Let's disable these drivers for v3.8 in combination with CONFIG_ARCH_MULTIPLATFORM, and fix them properly in v3.9 unless someone has an better solution. Without this patch, building allyesconfig results in: drivers/usb/gadget/fsl_mxc_udc.c:21:27: fatal error: mach/hardware.h: No such file or directory Signed-off-by: Arnd Bergmann a...@arndb.de Cc: Felipe Balbi ba...@ti.com Cc: Shawn Guo shawn@linaro.org Cc: Greg Kroah-Hartman gre...@linuxfoundation.org Cc: linux-usb@vger.kernel.org NAK, I prefer to see a real fix for the problem (which in fact is already in my fixes branch). I'll pull that branch now, sorry for the delay. Apparently it hasn't made it into the upstream kernel yet, and it also doesn't seem to be in linux-next. Maybe this got lost while you were travelling? Hm, no, I thought I got Felipe's fixes branch up into Linus's tree already. Felipe, did I miss something from you? If so, please resend or let me know, as I don't have anything pending on my side. I don't have anything pending in my fixes branch: $ git log fixes ^linus/master $ git show-branch linus/master [linus/master] Merge branch 'fix-max-write' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm It's building find for me: $ crossmake drivers/usb/gadget/fsl_udc_core.o \ drivers/usb/gadget/fsl_mxc_udc.o /dev/null (crossmake is an alias to make ARCH=arm) Arnd, are you maybe missing a merge of v3.8-rc6 ? I can see that imx_udc.c is broken still, but there are no maintainers for that driver. I'm adding Sascha to Cc list, maybe he knows someone who can help, but if this driver isn't fixed in 2 merge windows, I will schedule for removal from tree and someone else will have to re-introduce it later without all the bogus includes. build breaks --- sound/soc/fsl/imx-pcm.c: In function 'snd_imx_pcm_mmap': sound/soc/fsl/imx-pcm.c:28:2: error: 'KBUILD_MODNAME' undeclared (first use in this function) sound/soc/fsl/imx-pcm.c:28:2: note: each undeclared identifier is reported only once for each function it appears in make[3]: *** [sound/soc/fsl/imx-pcm.o] Error 1 drivers/video/omap2/dss/dss.c: In function 'dss_calc_clock_div': drivers/video/omap2/dss/dss.c:572:20: error: 'CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK' undeclared (first use in this function) drivers/video/omap2/dss/dss.c:572:20: note: each undeclared identifier is reported only once for each function it appears in make[4]: *** [drivers/video/omap2/dss/dss.o] Error 1 -- balbi signature.asc Description: Digital signature
Re: [PATCH 12/15] USB: gadget/freescale: disable non-multiplatform drivers
On Tuesday 05 February 2013, Felipe Balbi wrote: [linus/master] Merge branch 'fix-max-write' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm It's building find for me: $ crossmake drivers/usb/gadget/fsl_udc_core.o \ drivers/usb/gadget/fsl_mxc_udc.o /dev/null (crossmake is an alias to make ARCH=arm) Arnd, are you maybe missing a merge of v3.8-rc6 ? I can see that imx_udc.c is broken still, but there are no maintainers for that driver. I'm adding Sascha to Cc list, maybe he knows someone who can help, but if this driver isn't fixed in 2 merge windows, I will schedule for removal from tree and someone else will have to re-introduce it later without all the bogus includes. Ah, I see what happened now: I submitted a patch that lumped together two patches, disabling both fsl_mxc_udc and imx_udc. You already had a fix for the first one, so I dropped my patch, but now I see the build error for the second one that my patch was avoiding. The last patch to imx_udc that seems to have seen more than just build testing was probably USB: gadget: imx_udc: don't queue more data when zlp is to be sent, while fsl_mxc_udc looks actively maintained. It's not completely clear to me whether these are actually two drivers for the same hardware, of whether imx_udc is the i.mx1 variant and fsl_mxc_udc is the i.mx2 variant. What I can say is that no platform in the kernel currently defines an imx_udc platform_device, so it is certainly unused, and has been since at least e08300043e in 2010. I would suggest that we mark the imx_udc driver as 'depends on BROKEN' right away, since no in-tree user needs it, and any out of tree user is already broken in 3.8. I also wouldn't mind removing the driver unless the imx maintainers have a plan for it. build breaks --- sound/soc/fsl/imx-pcm.c: In function 'snd_imx_pcm_mmap': sound/soc/fsl/imx-pcm.c:28:2: error: 'KBUILD_MODNAME' undeclared (first use in this function) sound/soc/fsl/imx-pcm.c:28:2: note: each undeclared identifier is reported only once for each function it appears in make[3]: *** [sound/soc/fsl/imx-pcm.o] Error 1 drivers/video/omap2/dss/dss.c: In function 'dss_calc_clock_div': drivers/video/omap2/dss/dss.c:572:20: error: 'CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK' undeclared (first use in this function) drivers/video/omap2/dss/dss.c:572:20: note: each undeclared identifier is reported only once for each function it appears in make[4]: *** [drivers/video/omap2/dss/dss.o] Error 1 Yes, I submitted patches for these, too, and like this case, we decided to drop my patch in favor of a better fix, which has not yet gone in. Today I sent emails about these as well, in the hope that we can find a solution. Arnd -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html