From: Christoph Fritz <chf.fritz@googlemail.com>
To: barebox@lists.infradead.org
Subject: [PATCH 15/18] arm: am33xx: add usb platform helper code
Date: Fri, 13 Jun 2014 09:54:32 +0200 [thread overview]
Message-ID: <1402646075-22747-16-git-send-email-chf.fritz@googlemail.com> (raw)
In-Reply-To: <1402646075-22747-1-git-send-email-chf.fritz@googlemail.com>
---
arch/arm/mach-omap/Makefile | 2 +-
arch/arm/mach-omap/am33xx_usb.c | 65 ++++++++++++++++++++++++++
arch/arm/mach-omap/include/mach/am33xx-usb.h | 11 +++++
3 files changed, 77 insertions(+), 1 deletion(-)
create mode 100644 arch/arm/mach-omap/am33xx_usb.c
create mode 100644 arch/arm/mach-omap/include/mach/am33xx-usb.h
diff --git a/arch/arm/mach-omap/Makefile b/arch/arm/mach-omap/Makefile
index c9b6f4b..789f91b 100644
--- a/arch/arm/mach-omap/Makefile
+++ b/arch/arm/mach-omap/Makefile
@@ -23,7 +23,7 @@ obj-$(CONFIG_ARCH_OMAP3) += omap3_generic.o auxcr.o
pbl-$(CONFIG_ARCH_OMAP3) += omap3_generic.o auxcr.o
obj-$(CONFIG_ARCH_OMAP4) += omap4_generic.o omap4_clock.o
pbl-$(CONFIG_ARCH_OMAP4) += omap4_generic.o omap4_clock.o
-obj-pbl-$(CONFIG_ARCH_AM33XX) += am33xx_generic.o am33xx_clock.o am33xx_mux.o
+obj-pbl-$(CONFIG_ARCH_AM33XX) += am33xx_generic.o am33xx_clock.o am33xx_mux.o am33xx_usb.o
obj-$(CONFIG_OMAP3_CLOCK_CONFIG) += omap3_clock.o
pbl-$(CONFIG_OMAP3_CLOCK_CONFIG) += omap3_clock.o
obj-$(CONFIG_OMAP_GPMC) += gpmc.o devices-gpmc-nand.o
diff --git a/arch/arm/mach-omap/am33xx_usb.c b/arch/arm/mach-omap/am33xx_usb.c
new file mode 100644
index 0000000..b4d570e
--- /dev/null
+++ b/arch/arm/mach-omap/am33xx_usb.c
@@ -0,0 +1,65 @@
+#include <driver.h>
+#include <common.h>
+#include <linux/ioport.h>
+#include <mach/am33xx-silicon.h>
+#include <mach/am33xx-usb.h>
+
+#ifdef CONFIG_USB_MUSB_HOST
+static struct resource am33xx_usb_resources[] = {
+ {
+ .name = "am33xx_usbss",
+ .start = AM33XX_USBSS_BASE,
+ .end = AM33XX_USBSS_BASE + 1024 - 1,
+ .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
+ }, {
+ .name = "am33xx_usb0",
+ .start = AM33XX_USB0_BASE,
+ .end = AM33XX_USB0_BASE + 767 - 1,
+ .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
+ }, {
+ .name = "am33xx_usb1",
+ .start = AM33XX_USB1_BASE,
+ .end = AM33XX_USB1_BASE + 767 - 1,
+ .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
+ }, {
+ .name = "am33xx_usb0phy",
+ .start = AM33XX_USB0_PHY_BASE,
+ .end = AM33XX_USB0_PHY_BASE + 255 - 1,
+ .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
+ }, {
+ .name = "am33xx_usb1phy",
+ .start = AM33XX_USB1_PHY_BASE,
+ .end = AM33XX_USB1_PHY_BASE + 255 - 1,
+ .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
+ }, {
+ .name = "am33xx_usb0core",
+ .start = AM33XX_USB0_CORE_BASE,
+ .end = AM33XX_USB0_CORE_BASE + 1023 - 1,
+ .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
+ }, {
+ .name = "am33xx_usb1core",
+ .start = AM33XX_USB1_CORE_BASE,
+ .end = AM33XX_USB1_CORE_BASE + 1023 - 1,
+ .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
+ }, {
+ .name = "am33xx_ctrl_device_base",
+ .start = AM33XX_IDCODE_REG,
+ .end = AM33XX_IDCODE_REG + 128 - 1,
+ .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
+ },
+};
+
+struct device_d *am33xx_add_usb(struct am33xx_usb_pdata *a_pdata)
+{
+ return add_generic_device_res("am33xx_usb", -1,
+ am33xx_usb_resources,
+ ARRAY_SIZE(am33xx_usb_resources),
+ a_pdata);
+}
+#else
+struct device_d *am33xx_add_usb(struct am33xx_usb_pdata *a_pdata)
+{
+ return NULL;
+}
+#endif
+EXPORT_SYMBOL(am33xx_add_usb0);
diff --git a/arch/arm/mach-omap/include/mach/am33xx-usb.h b/arch/arm/mach-omap/include/mach/am33xx-usb.h
new file mode 100644
index 0000000..ff3b000
--- /dev/null
+++ b/arch/arm/mach-omap/include/mach/am33xx-usb.h
@@ -0,0 +1,11 @@
+#ifndef H_BAREBOX_ARCH_ARM_MACH_OMAP_MACH_AUSB_H
+#define H_BAREBOX_ARCH_ARM_MACH_OMAP_MACH_AUSB_H
+
+struct am33xx_usb_pdata {
+ unsigned int bus_number;
+};
+
+struct device_d;
+struct device_d *am33xx_add_usb(struct am33xx_usb_pdata *a_pdata);
+
+#endif /* H_BAREBOX_ARCH_ARM_MACH_OMAP_MACH_AUSB_H */
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-06-13 7:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-13 7:54 [RFC][PATCH 00/18] am33x: add musb Christoph Fritz
2014-06-13 7:54 ` [PATCH 01/18] arm: am33xx: add USB clocks Christoph Fritz
2014-06-13 7:54 ` [PATCH 02/18] arm: am33xx: add pinmux config for USB Christoph Fritz
2014-06-13 7:54 ` [PATCH 03/18] linux wrapper: add more dummy spin_lock stubs Christoph Fritz
2014-06-13 7:54 ` [PATCH 05/18] musb: delete unused include files Christoph Fritz
2014-06-13 7:54 ` [PATCH 06/18] musb: move musb.h to path include/usb Christoph Fritz
2014-06-13 7:54 ` [PATCH 07/18] musb: drop gadget support - remove appropriate files Christoph Fritz
2014-06-13 7:54 ` [PATCH 08/18] musb: use __BAREBOX__ macro Christoph Fritz
2014-06-13 7:54 ` [PATCH 09/18] musb: adapt Kconfig and Makefiles Christoph Fritz
2014-06-13 7:54 ` [PATCH 10/18] arm: pcm051: enable musb in defconfig Christoph Fritz
2014-06-13 7:54 ` [PATCH 11/18] musb: adapt driver to work on barebox Christoph Fritz
2014-06-14 20:53 ` Michael Grzeschik
2014-06-17 9:55 ` Christoph Fritz
2014-06-13 7:54 ` [PATCH 12/18] musb: only support USB_SPEED_HIGH devices Christoph Fritz
2014-06-13 7:54 ` [PATCH 13/18] usb: add musb support Christoph Fritz
2014-06-13 7:54 ` [PATCH 14/18] arm: am33xx: add usb base addresses Christoph Fritz
2014-06-13 7:54 ` Christoph Fritz [this message]
2014-06-13 7:54 ` [PATCH 16/18] musb: add barebox gluecode Christoph Fritz
2014-06-13 7:54 ` [PATCH 17/18] arm: pcm051: enable USB pinmux Christoph Fritz
2014-06-13 7:54 ` [PATCH 18/18] arm: pcm051: enable USB Christoph Fritz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1402646075-22747-16-git-send-email-chf.fritz@googlemail.com \
--to=chf.fritz@googlemail.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox