-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'davinci-for-v4.7/soc' of git://git.kernel.org/pub/scm/linu…
…x/kernel/git/nsekhar/linux-davinci into next/soc Merge "DaVinci SoC updates for v4.7" from Sekhar Nori: These are preparatory patches to support a USB PHY driver for USB on DA850 SoC. This should eventually lead to USB working again on this device. * tag 'davinci-for-v4.7/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci: ARM: davinci: clk: add set_parent callback for mux clocks ARM: davinci: da8xx: move usb code to new file ARM: davinci: use IRQCHIP_DECLARE for cp_intc ARM: davinci: remove unused DA8XX_NUM_UARTS ARM: davinci: simplify call to of populate ARM: DaVinci USB: removed deprecated properties from MUSB config
- Loading branch information
Showing
7 changed files
with
132 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/* | ||
* DA8xx USB | ||
*/ | ||
#include <linux/dma-mapping.h> | ||
#include <linux/init.h> | ||
#include <linux/platform_data/usb-davinci.h> | ||
#include <linux/platform_device.h> | ||
#include <linux/usb/musb.h> | ||
|
||
#include <mach/common.h> | ||
#include <mach/cputype.h> | ||
#include <mach/da8xx.h> | ||
#include <mach/irqs.h> | ||
|
||
#define DA8XX_USB0_BASE 0x01e00000 | ||
#define DA8XX_USB1_BASE 0x01e25000 | ||
|
||
#if IS_ENABLED(CONFIG_USB_MUSB_HDRC) | ||
|
||
static struct musb_hdrc_config musb_config = { | ||
.multipoint = true, | ||
.num_eps = 5, | ||
.ram_bits = 10, | ||
}; | ||
|
||
static struct musb_hdrc_platform_data usb_data = { | ||
/* OTG requires a Mini-AB connector */ | ||
.mode = MUSB_OTG, | ||
.clock = "usb20", | ||
.config = &musb_config, | ||
}; | ||
|
||
static struct resource da8xx_usb20_resources[] = { | ||
{ | ||
.start = DA8XX_USB0_BASE, | ||
.end = DA8XX_USB0_BASE + SZ_64K - 1, | ||
.flags = IORESOURCE_MEM, | ||
}, | ||
{ | ||
.start = IRQ_DA8XX_USB_INT, | ||
.flags = IORESOURCE_IRQ, | ||
.name = "mc", | ||
}, | ||
}; | ||
|
||
static u64 usb_dmamask = DMA_BIT_MASK(32); | ||
|
||
static struct platform_device usb_dev = { | ||
.name = "musb-da8xx", | ||
.id = -1, | ||
.dev = { | ||
.platform_data = &usb_data, | ||
.dma_mask = &usb_dmamask, | ||
.coherent_dma_mask = DMA_BIT_MASK(32), | ||
}, | ||
.resource = da8xx_usb20_resources, | ||
.num_resources = ARRAY_SIZE(da8xx_usb20_resources), | ||
}; | ||
|
||
int __init da8xx_register_usb20(unsigned int mA, unsigned int potpgt) | ||
{ | ||
usb_data.power = mA > 510 ? 255 : mA / 2; | ||
usb_data.potpgt = (potpgt + 1) / 2; | ||
|
||
return platform_device_register(&usb_dev); | ||
} | ||
|
||
#else | ||
|
||
int __init da8xx_register_usb20(unsigned int mA, unsigned int potpgt) | ||
{ | ||
return 0; | ||
} | ||
|
||
#endif /* CONFIG_USB_MUSB_HDRC */ | ||
|
||
static struct resource da8xx_usb11_resources[] = { | ||
[0] = { | ||
.start = DA8XX_USB1_BASE, | ||
.end = DA8XX_USB1_BASE + SZ_4K - 1, | ||
.flags = IORESOURCE_MEM, | ||
}, | ||
[1] = { | ||
.start = IRQ_DA8XX_IRQN, | ||
.end = IRQ_DA8XX_IRQN, | ||
.flags = IORESOURCE_IRQ, | ||
}, | ||
}; | ||
|
||
static u64 da8xx_usb11_dma_mask = DMA_BIT_MASK(32); | ||
|
||
static struct platform_device da8xx_usb11_device = { | ||
.name = "ohci", | ||
.id = 0, | ||
.dev = { | ||
.dma_mask = &da8xx_usb11_dma_mask, | ||
.coherent_dma_mask = DMA_BIT_MASK(32), | ||
}, | ||
.num_resources = ARRAY_SIZE(da8xx_usb11_resources), | ||
.resource = da8xx_usb11_resources, | ||
}; | ||
|
||
int __init da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata) | ||
{ | ||
da8xx_usb11_device.dev.platform_data = pdata; | ||
return platform_device_register(&da8xx_usb11_device); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters