Skip to contentSkip to conversation

add dfu support for at91 sam9260 based boards

PATCH New Heiko Schocher 4 participants 15 messages Jun 15, 2015 – Aug 10, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover add dfu support for at91 sam9260 based boards

add dfu supprt for at91 sam9260 based boards. The USB gadget driver is ported from linux:

b2ba27a5c56ff: usb: gadget: at91_udc: move prepare clk into process context

it drops a lot of checkpatch warnings/errors:

checkpatch.pl found 12 error(s), 31 warning(s), 43 checks(s)

but for further updates I did not fix them.
The errors are all from this sort:

error: drivers/usb/gadget/at91_udc.c,87: space prohibited before open square bracket '['

a lot of "line over 80 characters" warnings ...

Heiko Schocher (3):
ARM: at91: add cpu.h
usb: gadget: at91_udc: add support for at91_udc
at91, taurus, smartweb: add dfu support

 arch/arm/mach-at91/include/mach/cpu.h |  149 +++
 board/siemens/smartweb/smartweb.c     |   29 +
 board/siemens/taurus/taurus.c         |   27 +
 drivers/usb/gadget/Makefile           |    1 +
 drivers/usb/gadget/at91_udc.c         | 2203 +++++++++++++++++++++++++++++++++
 drivers/usb/gadget/at91_udc.h         |  171 +++
 include/configs/smartweb.h            |   34 +-
 include/configs/taurus.h              |   28 +-
 include/linux/usb/at91_udc.h          |   20 +
 9 files changed, 2657 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/mach-at91/include/mach/cpu.h
 create mode 100644 drivers/usb/gadget/at91_udc.c
 create mode 100644 drivers/usb/gadget/at91_udc.h
 create mode 100644 include/linux/usb/at91_udc.h
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/3 ARM: at91: add cpu.h

add cpu.h from linux:

7538ec7d1e5: ARM: at91: remove no-MMU at91x40 support

so it is easier to port linux code, which is based on it.

---

 arch/arm/mach-at91/include/mach/cpu.h | 149 ++++++++++++++++++++++++++++++++++
 1 file changed, 149 insertions(+)
 create mode 100644 arch/arm/mach-at91/include/mach/cpu.h
arch/arm/mach-at91/include/mach/cpu.h new file +149 -0
new file mode 100644
index 0000000..a5e698d
@@ -0,0 +1,149 @@
+/*
+ * from linux:
+ * 7538ec7d1e5: ARM: at91: remove no-MMU at91x40 support
+ *
+ * arch/arm/mach-at91/include/mach/cpu.h
+ *
+ * Copyright (C) 2006 SAN People
+ * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ *
+ */
+
+#ifndef __AT91_MACH_CPU_H__
+#define __AT91_MACH_CPU_H__
+
+#ifdef CONFIG_AT91RM9200
+#define cpu_is_at91rm9200()	(1)
+#else
+#define cpu_is_at91rm9200()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9260
+#define cpu_is_at91sam9260()	(1)
+#else
+#define cpu_is_at91sam9260()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G20
+#define cpu_is_at91sam9g20()	(1)
+#else
+#define cpu_is_at91sam9g20()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9XE
+#define cpu_is_at91sam9xe()	(1)
+#else
+#define cpu_is_at91sam9xe()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9261
+#define cpu_is_at91sam9261()	(1)
+#else
+#define cpu_is_at91sam9261()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G10
+#define cpu_is_at91sam9g10()	(1)
+#else
+#define cpu_is_at91sam9g10()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9263
+#define cpu_is_at91sam9263()	(1)
+#else
+#define cpu_is_at91sam9263()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9RL
+#define cpu_is_at91sam9rl()	(1)
+#else
+#define cpu_is_at91sam9rl()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G45
+#define cpu_is_at91sam9g45()	(1)
+#else
+#define cpu_is_at91sam9g45()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G45ES
+#define cpu_is_at91sam9g45es()	(1)
+#else
+#define cpu_is_at91sam9g45es()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9M10
+#define cpu_is_at91sam9m10()	(1)
+#else
+#define cpu_is_at91sam9m10()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G46
+#define cpu_is_at91sam9g46()	(1)
+#else
+#define cpu_is_at91sam9g46()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9M11
+#define cpu_is_at91sam9m11()	(1)
+#else
+#define cpu_is_at91sam9m11()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9X5
+#define cpu_is_at91sam9x5()	(1)
+#else
+#define cpu_is_at91sam9x5()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G15
+#define cpu_is_at91sam9g15()	(1)
+#else
+#define cpu_is_at91sam9g15()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G35
+#define cpu_is_at91sam9g35()	(1)
+#else
+#define cpu_is_at91sam9g35()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9X35
+#define cpu_is_at91sam9x35()	(1)
+#else
+#define cpu_is_at91sam9x35()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G25
+#define cpu_is_at91sam9g25()	(1)
+#else
+#define cpu_is_at91sam9g25()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9X25
+#define cpu_is_at91sam9x25()	(1)
+#else
+#define cpu_is_at91sam9x25()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9N12
+#define cpu_is_at91sam9n12()	(1)
+#else
+#define cpu_is_at91sam9n12()	(0)
+#endif
+
+#ifdef CONFIG_SAMA5D3
+#define cpu_is_sama5d3()	(1)
+#else
+#define cpu_is_sama5d3()	(0)
+#endif
+
+#ifdef CONFIG_SAMA5D4
+#define cpu_is_sama5d4()	(1)
+#else
+#define cpu_is_sama5d4()	(0)
+#endif
+
+#endif
Signature · 1 line
2.1.0
#2 lore raw

PATCH 1/3 ARM: at91: add cpu.h

Quoted 31 lines · Heiko Schocher

add cpu.h from linux:

7538ec7d1e5: ARM: at91: remove no-MMU at91x40 support

so it is easier to port linux code, which is based on it.

---

 arch/arm/mach-at91/include/mach/cpu.h | 149
++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+)
 create mode 100644 arch/arm/mach-at91/include/mach/cpu.h
(quoted diff) +0 -0

b/arch/arm/mach-at91/include/mach/cpu.h new file mode 100644 index 0000000..a5e698d

arch/arm/mach-at91/include/mach/cpu.h new file +8 -0
@@ -0,0 +1,149 @@
+/*
+ * from linux:
+ * 7538ec7d1e5: ARM: at91: remove no-MMU at91x40 support
+ *
+ * arch/arm/mach-at91/include/mach/cpu.h
+ *
+ * Copyright (C) 2006 SAN People
+ * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD

<[email protected]> + *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ */

arch/arm/mach-at91/include/mach/cpu.h line 21

Quoted 9 lines
arch/arm/mach-at91/include/mach/cpu.h new file +9 -0
+
+#ifndef __AT91_MACH_CPU_H__
+#define __AT91_MACH_CPU_H__
+
+#ifdef CONFIG_AT91RM9200
+#define cpu_is_at91rm9200()	(1)
+#else
+#define cpu_is_at91rm9200()	(0)
+#endif

The () are not needed .

Best regards,
Marek Vasut

#3 lore raw

PATCH 1/3 ARM: at91: add cpu.h

In reply to Heiko Schocher

Hi,

Quoted 6 lines · Heiko Schocher

add cpu.h from linux:

7538ec7d1e5: ARM: at91: remove no-MMU at91x40 support

so it is easier to port linux code, which is based on it.

That file doesn't exist anymore, see f56d8f7c29320abe6f923fa1b3cb7adcc3252a24 and I think the cpu_is_xxx removal was finished a few linux versions ago so you should not need that.

Quoted 170 lines

---

 arch/arm/mach-at91/include/mach/cpu.h | 149 ++++++++++++++++++++++++++++++++++
 1 file changed, 149 insertions(+)
 create mode 100644 arch/arm/mach-at91/include/mach/cpu.h
arch/arm/mach-at91/include/mach/cpu.h new file +149 -0
new file mode 100644
index 0000000..a5e698d
@@ -0,0 +1,149 @@
+/*
+ * from linux:
+ * 7538ec7d1e5: ARM: at91: remove no-MMU at91x40 support
+ *
+ * arch/arm/mach-at91/include/mach/cpu.h
+ *
+ * Copyright (C) 2006 SAN People
+ * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ *
+ */
+
+#ifndef __AT91_MACH_CPU_H__
+#define __AT91_MACH_CPU_H__
+
+#ifdef CONFIG_AT91RM9200
+#define cpu_is_at91rm9200()	(1)
+#else
+#define cpu_is_at91rm9200()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9260
+#define cpu_is_at91sam9260()	(1)
+#else
+#define cpu_is_at91sam9260()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G20
+#define cpu_is_at91sam9g20()	(1)
+#else
+#define cpu_is_at91sam9g20()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9XE
+#define cpu_is_at91sam9xe()	(1)
+#else
+#define cpu_is_at91sam9xe()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9261
+#define cpu_is_at91sam9261()	(1)
+#else
+#define cpu_is_at91sam9261()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G10
+#define cpu_is_at91sam9g10()	(1)
+#else
+#define cpu_is_at91sam9g10()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9263
+#define cpu_is_at91sam9263()	(1)
+#else
+#define cpu_is_at91sam9263()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9RL
+#define cpu_is_at91sam9rl()	(1)
+#else
+#define cpu_is_at91sam9rl()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G45
+#define cpu_is_at91sam9g45()	(1)
+#else
+#define cpu_is_at91sam9g45()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G45ES
+#define cpu_is_at91sam9g45es()	(1)
+#else
+#define cpu_is_at91sam9g45es()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9M10
+#define cpu_is_at91sam9m10()	(1)
+#else
+#define cpu_is_at91sam9m10()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G46
+#define cpu_is_at91sam9g46()	(1)
+#else
+#define cpu_is_at91sam9g46()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9M11
+#define cpu_is_at91sam9m11()	(1)
+#else
+#define cpu_is_at91sam9m11()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9X5
+#define cpu_is_at91sam9x5()	(1)
+#else
+#define cpu_is_at91sam9x5()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G15
+#define cpu_is_at91sam9g15()	(1)
+#else
+#define cpu_is_at91sam9g15()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G35
+#define cpu_is_at91sam9g35()	(1)
+#else
+#define cpu_is_at91sam9g35()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9X35
+#define cpu_is_at91sam9x35()	(1)
+#else
+#define cpu_is_at91sam9x35()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9G25
+#define cpu_is_at91sam9g25()	(1)
+#else
+#define cpu_is_at91sam9g25()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9X25
+#define cpu_is_at91sam9x25()	(1)
+#else
+#define cpu_is_at91sam9x25()	(0)
+#endif
+
+#ifdef CONFIG_AT91SAM9N12
+#define cpu_is_at91sam9n12()	(1)
+#else
+#define cpu_is_at91sam9n12()	(0)
+#endif
+
+#ifdef CONFIG_SAMA5D3
+#define cpu_is_sama5d3()	(1)
+#else
+#define cpu_is_sama5d3()	(0)
+#endif
+
+#ifdef CONFIG_SAMA5D4
+#define cpu_is_sama5d4()	(1)
+#else
+#define cpu_is_sama5d4()	(0)
+#endif
+
+#endif
Signature · 6 lines
2.1.0

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
Signature · 1 line
Alexandre Belloni
#4 lore raw

PATCH 2/3 usb: gadget: at91_udc: add support for at91_udc

In reply to Heiko Schocher

ported from linux:

b2ba27a5c56ff: usb: gadget: at91_udc: move prepare clk into process context

---
checkpatch detects a lot of errors, but as this code is copied from linux, I tend to not fix them, so later updates with linux code is easier.

 drivers/usb/gadget/Makefile   |    1 +
 drivers/usb/gadget/at91_udc.c | 2203 +++++++++++++++++++++++++++++++++++++++++
 drivers/usb/gadget/at91_udc.h |  171 ++++
 include/linux/usb/at91_udc.h  |   20 +
 4 files changed, 2395 insertions(+)
 create mode 100644 drivers/usb/gadget/at91_udc.c
 create mode 100644 drivers/usb/gadget/at91_udc.h
 create mode 100644 include/linux/usb/at91_udc.h
drivers/usb/gadget/Makefile +1 -0
index 70bb550..22323fa 100644
@@ -10,6 +10,7 @@ obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o usbstring.o
 
 # new USB gadget layer dependencies
 ifdef CONFIG_USB_GADGET
+obj-$(CONFIG_USB_GADGET_AT91) += at91_udc.o
 obj-$(CONFIG_USB_GADGET_ATMEL_USBA) += atmel_usba_udc.o
 obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
 obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG_PHY) += s3c_udc_otg_phy.o
drivers/usb/gadget/at91_udc.c new file +2203 -0

2,203 lines not on this page · raw message

drivers/usb/gadget/at91_udc.h new file +171 -0

171 lines not on this page · raw message

include/linux/usb/at91_udc.h new file +20 -0
new file mode 100644
index 0000000..eb88e1d
@@ -0,0 +1,20 @@
+/*
+ * Platform data definitions for Atmel USBA gadget driver
+ * [Original from Linux kernel: include/linux/usb/atmel_usba_udc.h]
+ *
+ * SPDX-License-Identifier:     GPL-2.0+
+ */
+#ifndef __LINUX_USB_AT91_UDC_H__
+#define __LINUX_USB_AT91_UDC_H__
+
+struct at91_udc_data {
+	int	vbus_pin;		/* high == host powering us */
+	u8	vbus_active_low;	/* vbus polarity */
+	u8	vbus_polled;		/* Use polling, not interrupt */
+	int	pullup_pin;		/* active == D+ pulled up */
+	u8	pullup_active_low;	/* true == pullup_pin is active low */
+	unsigned long	baseaddr;
+};
+
+extern int at91_udc_probe(struct at91_udc_data *pdata);
+#endif
Signature · 1 line
2.1.0
#5 lore raw

PATCH 2/3 usb: gadget: at91_udc: add support for at91_udc

Hi Heiko,

Quoted 5 lines

ported from linux:

b2ba27a5c56ff: usb: gadget: at91_udc: move prepare clk into process context

IMHO, presented above description is not enough. I'd prefer to see one patch which adds the code from linux - including the exact commit message.

Then, u-boot specific adjustments should be applied in a separate patch.

In that way you would:
1. Avoid #ifdef __UBOOT__
2. Make the process of updating code easier

Quoted 33 lines

---
checkpatch detects a lot of errors, but as this code is copied from linux, I tend to not fix them, so later updates with linux code is easier.

 drivers/usb/gadget/Makefile   |    1 +
 drivers/usb/gadget/at91_udc.c | 2203

+++++++++++++++++++++++++++++++++++++++++
drivers/usb/gadget/at91_udc.h | 171 ++++
include/linux/usb/at91_udc.h | 20 + 4 files changed, 2395
insertions(+) create mode 100644 drivers/usb/gadget/at91_udc.c

 create mode 100644 drivers/usb/gadget/at91_udc.h
 create mode 100644 include/linux/usb/at91_udc.h
drivers/usb/gadget/Makefile +0 -0
index 70bb550..22323fa 100644
@@ -10,6 +10,7 @@ obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o

usbstring.o

 # new USB gadget layer dependencies
 ifdef CONFIG_USB_GADGET
drivers/usb/gadget/Makefile +1 -0
+obj-$(CONFIG_USB_GADGET_AT91) += at91_udc.o
 obj-$(CONFIG_USB_GADGET_ATMEL_USBA) += atmel_usba_udc.o
 obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
 obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG_PHY) += s3c_udc_otg_phy.o
(quoted diff) +0 -0

b/drivers/usb/gadget/at91_udc.c new file mode 100644 index 0000000..f4ae13b

drivers/usb/gadget/at91_udc.c new file +0 -0

@@

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#6 lore raw

PATCH 2/3 usb: gadget: at91_udc: add support for at91_udc

Hello Luaksz,

Am 21.07.2015 um 08:59 schrieb Lukasz Majewski:

Quoted 11 lines

Hi Heiko,

Quoted 5 lines

ported from linux:

b2ba27a5c56ff: usb: gadget: at91_udc: move prepare clk into process context

IMHO, presented above description is not enough. I'd prefer to see one patch which adds the code from linux - including the exact commit message.

Ok, I change this.

Quoted 4 lines

Then, u-boot specific adjustments should be applied in a separate patch.

In that way you would:
1. Avoid #ifdef __UBOOT__

Hmm.. I change this, but I do not hate this define, if I debug in the Code I immediately see, if it is linux code, or U-Boot specific ... we had such a discussion also on other places ... maybe we need here a decision, if we remove this define complete?

Quoted 1 line

2. Make the process of updating code easier

I soon post a v2, just did a rebase and found some compile errors for the smartweb board ...

bye,
Heiko

Quoted 36 lines
Quoted 35 lines

---
checkpatch detects a lot of errors, but as this code is copied from linux, I tend to not fix them, so later updates with linux code is easier.

  drivers/usb/gadget/Makefile   |    1 +
  drivers/usb/gadget/at91_udc.c | 2203

+++++++++++++++++++++++++++++++++++++++++
drivers/usb/gadget/at91_udc.h | 171 ++++
include/linux/usb/at91_udc.h | 20 + 4 files changed, 2395
insertions(+) create mode 100644 drivers/usb/gadget/at91_udc.c
create mode 100644 drivers/usb/gadget/at91_udc.h create mode 100644 include/linux/usb/at91_udc.h

drivers/usb/gadget/Makefile +0 -0
index 70bb550..22323fa 100644
@@ -10,6 +10,7 @@ obj-$(CONFIG_USB_ETHER) += epautoconf.o config.o

usbstring.o

  # new USB gadget layer dependencies
  ifdef CONFIG_USB_GADGET
drivers/usb/gadget/Makefile +1 -0
+obj-$(CONFIG_USB_GADGET_AT91) += at91_udc.o
  obj-$(CONFIG_USB_GADGET_ATMEL_USBA) += atmel_usba_udc.o
  obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
  obj-$(CONFIG_USB_GADGET_S3C_UDC_OTG_PHY) += s3c_udc_otg_phy.o
(quoted diff) +0 -0

b/drivers/usb/gadget/at91_udc.c new file mode 100644 index 0000000..f4ae13b

drivers/usb/gadget/at91_udc.c new file +0 -0

@@

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#7 lore raw

PATCH 3/3 at91, taurus, smartweb: add dfu support

In reply to Heiko Schocher

[root at pollux dfu-util]# ./src/dfu-util -l
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2014 Tormod Volden and Stefan Schmidt This program is Free Software and has ABSOLUTELY NO WARRANTY Please report bugs to dfu-util at lists.gnumonks.org

Found DFU: [0908:02d2] ver=0212, devnum=119, cfg=1, intf=0, alt=0, name="Linux", serial="UNKNOWN" [root at pollux dfu-util]#

---

 board/siemens/smartweb/smartweb.c | 29 +++++++++++++++++++++++++++++
 board/siemens/taurus/taurus.c     | 27 +++++++++++++++++++++++++++
 include/configs/smartweb.h        | 34 ++++++++++++++++++++++++++++++----
 include/configs/taurus.h          | 28 +++++++++++++++++++++++++++-
 4 files changed, 113 insertions(+), 5 deletions(-)
board/siemens/smartweb/smartweb.c +29 -0
index cf8a7f5..2d42488 100644
@@ -25,6 +25,7 @@
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_spi.h>
 #include <spi.h>
+#include <asm/arch/clk.h>
 #include <asm/arch/gpio.h>
 #include <watchdog.h>
 #ifdef CONFIG_MACB
@@ -108,6 +109,29 @@ static void smartweb_macb_hw_init(void)
 }
 #endif /* CONFIG_MACB */
 
+#ifdef CONFIG_USB_GADGET_AT91
+#include <linux/usb/at91_udc.h>
+
+void at91_udp_hw_init(void)
+{
+	at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
+
+	/* Enable PLLB */
+	writel(get_pllb_init(), &pmc->pllbr);
+	while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
+		;
+
+	/* Enable UDPCK clock, MCK is enabled in at91_clock_init() */
+	at91_periph_clk_enable(ATMEL_ID_UDP);
+
+	writel(AT91SAM926x_PMC_UDP, &pmc->scer);
+}
+
+struct at91_udc_data board_udc_data  = {
+	.baseaddr = ATMEL_BASE_UDP0,
+};
+#endif
+
 int board_early_init_f(void)
 {
 	/* enable this here, as we have SPL without serial support */
@@ -134,6 +158,11 @@ int board_init(void)
 	at91_set_gpio_output(AT91_PIN_PC10, 0);
 	at91_set_gpio_output(AT91_PIN_PC11, 1);
 
+#ifdef CONFIG_USB_GADGET_AT91
+	at91_udp_hw_init();
+	at91_udc_probe(&board_udc_data);
+#endif
+
 	return 0;
 }
 
board/siemens/taurus/taurus.c +27 -0
index d10411c..54f67da 100644
@@ -272,6 +272,29 @@ void spi_cs_deactivate(struct spi_slave *slave)
 	at91_set_gpio_value(TAURUS_SPI_CS_PIN, 1);
 }
 
+#ifdef CONFIG_USB_GADGET_AT91
+#include <linux/usb/at91_udc.h>
+
+void at91_udp_hw_init(void)
+{
+	at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
+
+	/* Enable PLLB */
+	writel(get_pllb_init(), &pmc->pllbr);
+	while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
+		;
+
+	/* Enable UDPCK clock, MCK is enabled in at91_clock_init() */
+	at91_periph_clk_enable(ATMEL_ID_UDP);
+
+	writel(AT91SAM926x_PMC_UDP, &pmc->scer);
+}
+
+struct at91_udc_data board_udc_data  = {
+	.baseaddr = ATMEL_BASE_UDP0,
+};
+#endif
+
 int board_init(void)
 {
 	/* adress of boot parameters */
@@ -284,6 +307,10 @@ int board_init(void)
 	taurus_macb_hw_init();
 #endif
 	at91_spi0_hw_init(TAURUS_SPI_MASK);
+#ifdef CONFIG_USB_GADGET_AT91
+	at91_udp_hw_init();
+	at91_udc_probe(&board_udc_data);
+#endif
 
 	return 0;
 }
include/configs/smartweb.h +30 -4
index 9f22139..baec73b 100644
@@ -75,7 +75,7 @@
 
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN \
-	ROUND(3 * CONFIG_ENV_SIZE + (128 << 10), 0x1000)
+	ROUND(3 * CONFIG_ENV_SIZE + 4*1024*1024, 0x1000)
 
 /* NAND flash settings */
 #define CONFIG_NAND_ATMEL
@@ -140,15 +140,42 @@
 
 #if !defined(CONFIG_SPL_BUILD)
 /* USB configuration */
+#define CONFIG_CMD_USB
 #define CONFIG_USB_ATMEL
 #define CONFIG_USB_ATMEL_CLK_SEL_PLLB
 #define CONFIG_USB_OHCI_NEW
-#define CONFIG_USB_STORAGE
-#define CONFIG_DOS_PARTITION
 #define CONFIG_SYS_USB_OHCI_CPU_INIT
 #define CONFIG_SYS_USB_OHCI_REGS_BASE	ATMEL_UHP_BASE
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME	"at91sam9260"
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	2
+
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_ASIX
+#define CONFIG_USB_ETHER_MCS7830
+
+/* USB DFU support */
+#define CONFIG_CMD_MTDPARTS
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+
+#define CONFIG_USB_GADGET
+#define CONFIG_USB_GADGET_AT91
+
+/* DFU class support */
+#define CONFIG_CMD_DFU
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_DFU_NAND
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_VBUS_DRAW	2
+#define CONFIG_SYS_DFU_DATA_BUF_SIZE	(1 << 20)
+#define DFU_MANIFEST_POLL_TIMEOUT	25000
+
+/* USB DFU IDs */
+#define CONFIG_G_DNL_VENDOR_NUM 0x0908
+#define CONFIG_G_DNL_PRODUCT_NUM 0x02d2
+#define CONFIG_G_DNL_MANUFACTURER "Siemens AG"
+
+#define CONFIG_SYS_CACHELINE_SIZE	0x2000
 #endif
 
 /* General Boot Parameter */
@@ -195,7 +222,6 @@
 #undef CONFIG_CMD_LOADS
 
 #define CONFIG_CMD_NAND
-#define CONFIG_CMD_USB
 #define CONFIG_CMD_FAT
 
 #ifdef CONFIG_MACB
include/configs/taurus.h +27 -1
index dd35a8f..99cf302 100644
@@ -128,12 +128,38 @@
 /* USB */
 #if defined(CONFIG_BOARD_TAURUS)
 #define CONFIG_USB_ATMEL
+#define CONFIG_USB_ATMEL_CLK_SEL_PLLB
 #define CONFIG_USB_OHCI_NEW
 #define CONFIG_SYS_USB_OHCI_CPU_INIT
 #define CONFIG_SYS_USB_OHCI_REGS_BASE		0x00500000
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME		"at91sam9260"
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	2
 #define CONFIG_USB_STORAGE
+
+/* USB DFU support */
+#define CONFIG_CMD_MTDPARTS
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+
+#define CONFIG_USB_GADGET
+#define CONFIG_USB_GADGET_AT91
+
+/* DFU class support */
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_DFU
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_DFU_NAND
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_VBUS_DRAW	2
+#define CONFIG_SYS_DFU_DATA_BUF_SIZE	(1 << 20)
+#define DFU_MANIFEST_POLL_TIMEOUT	25000
+
+/* USB DFU IDs */
+#define CONFIG_G_DNL_VENDOR_NUM 0x0908
+#define CONFIG_G_DNL_PRODUCT_NUM 0x02d2
+#define CONFIG_G_DNL_MANUFACTURER "Siemens AG"
+
+#define CONFIG_SYS_CACHELINE_SIZE	0x2000
 #endif
 
 /* SPI EEPROM */
@@ -251,7 +277,7 @@
  * Size of malloc() pool
  */
 #define CONFIG_SYS_MALLOC_LEN \
-	ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)
+	ROUND(3 * CONFIG_ENV_SIZE + 4*1024*1024, 0x1000)
 
 /* Defines for SPL */
 #define CONFIG_SPL_FRAMEWORK
Signature · 1 line
2.1.0
#8 lore raw

PATCH 3/3 at91, taurus, smartweb: add dfu support

Quoted 37 lines · Heiko Schocher

[root at pollux dfu-util]# ./src/dfu-util -l
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2014 Tormod Volden and Stefan Schmidt This program is Free Software and has ABSOLUTELY NO WARRANTY Please report bugs to dfu-util at lists.gnumonks.org

Found DFU: [0908:02d2] ver=0212, devnum=119, cfg=1, intf=0, alt=0, name="Linux", serial="UNKNOWN" [root at pollux dfu-util]#

---

 board/siemens/smartweb/smartweb.c | 29 +++++++++++++++++++++++++++++
 board/siemens/taurus/taurus.c     | 27 +++++++++++++++++++++++++++
 include/configs/smartweb.h        | 34 ++++++++++++++++++++++++++++++----
 include/configs/taurus.h          | 28 +++++++++++++++++++++++++++-
 4 files changed, 113 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

b/board/siemens/smartweb/smartweb.c index cf8a7f5..2d42488 100644

board/siemens/smartweb/smartweb.c +2 -0
@@ -25,6 +25,7 @@
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_spi.h>
 #include <spi.h>
+#include <asm/arch/clk.h>
 #include <asm/arch/gpio.h>
 #include <watchdog.h>
 #ifdef CONFIG_MACB
@@ -108,6 +109,29 @@ static void smartweb_macb_hw_init(void)
 }
 #endif /* CONFIG_MACB */
 
+#ifdef CONFIG_USB_GADGET_AT91

board/siemens/smartweb/smartweb.c static void smartweb_macb_hw_init(void) · line 122

Quoted 10 lines
board/siemens/smartweb/smartweb.c +10 -0
+#include <linux/usb/at91_udc.h>
+
+void at91_udp_hw_init(void)
+{
+	at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
+
+	/* Enable PLLB */
+	writel(get_pllb_init(), &pmc->pllbr);
+	while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
+		;

Unbounded loops are no good :-)

Quoted 5 lines
board/siemens/smartweb/smartweb.c +5 -0
+	/* Enable UDPCK clock, MCK is enabled in at91_clock_init() */
+	at91_periph_clk_enable(ATMEL_ID_UDP);
+
+	writel(AT91SAM926x_PMC_UDP, &pmc->scer);
+}

[...]

#9 lore raw

PATCH 3/3 at91, taurus, smartweb: add dfu support

In reply to Heiko Schocher

Hi Heiko,

Quoted 208 lines

[root at pollux dfu-util]# ./src/dfu-util -l
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2014 Tormod Volden and Stefan Schmidt This program is Free Software and has ABSOLUTELY NO WARRANTY Please report bugs to dfu-util at lists.gnumonks.org

Found DFU: [0908:02d2] ver=0212, devnum=119, cfg=1, intf=0, alt=0, name="Linux", serial="UNKNOWN" [root at pollux dfu-util]#

---

 board/siemens/smartweb/smartweb.c | 29 +++++++++++++++++++++++++++++
 board/siemens/taurus/taurus.c     | 27 +++++++++++++++++++++++++++
 include/configs/smartweb.h        | 34

++++++++++++++++++++++++++++++---- include/configs/taurus.h | 28 +++++++++++++++++++++++++++- 4 files changed, 113 insertions(+), 5 deletions(-)

(quoted diff) +0 -0

b/board/siemens/smartweb/smartweb.c index cf8a7f5..2d42488 100644

board/siemens/smartweb/smartweb.c +29 -0
@@ -25,6 +25,7 @@
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_spi.h>
 #include <spi.h>
+#include <asm/arch/clk.h>
 #include <asm/arch/gpio.h>
 #include <watchdog.h>
 #ifdef CONFIG_MACB
@@ -108,6 +109,29 @@ static void smartweb_macb_hw_init(void)
 }
 #endif /* CONFIG_MACB */
 
+#ifdef CONFIG_USB_GADGET_AT91
+#include <linux/usb/at91_udc.h>
+
+void at91_udp_hw_init(void)
+{
+	at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
+
+	/* Enable PLLB */
+	writel(get_pllb_init(), &pmc->pllbr);
+	while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
+		;
+
+	/* Enable UDPCK clock, MCK is enabled in at91_clock_init() */
+	at91_periph_clk_enable(ATMEL_ID_UDP);
+
+	writel(AT91SAM926x_PMC_UDP, &pmc->scer);
+}
+
+struct at91_udc_data board_udc_data  = {
+	.baseaddr = ATMEL_BASE_UDP0,
+};
+#endif
+
 int board_early_init_f(void)
 {
 	/* enable this here, as we have SPL without serial support */
@@ -134,6 +158,11 @@ int board_init(void)
 	at91_set_gpio_output(AT91_PIN_PC10, 0);
 	at91_set_gpio_output(AT91_PIN_PC11, 1);
 
+#ifdef CONFIG_USB_GADGET_AT91
+	at91_udp_hw_init();
+	at91_udc_probe(&board_udc_data);
+#endif
+
 	return 0;
 }
 
(quoted diff) +0 -0

b/board/siemens/taurus/taurus.c index d10411c..54f67da 100644

board/siemens/taurus/taurus.c +27 -0
@@ -272,6 +272,29 @@ void spi_cs_deactivate(struct spi_slave *slave)
 	at91_set_gpio_value(TAURUS_SPI_CS_PIN, 1);
 }
 
+#ifdef CONFIG_USB_GADGET_AT91
+#include <linux/usb/at91_udc.h>
+
+void at91_udp_hw_init(void)
+{
+	at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
+
+	/* Enable PLLB */
+	writel(get_pllb_init(), &pmc->pllbr);
+	while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
+		;
+
+	/* Enable UDPCK clock, MCK is enabled in at91_clock_init() */
+	at91_periph_clk_enable(ATMEL_ID_UDP);
+
+	writel(AT91SAM926x_PMC_UDP, &pmc->scer);
+}
+
+struct at91_udc_data board_udc_data  = {
+	.baseaddr = ATMEL_BASE_UDP0,
+};
+#endif
+
 int board_init(void)
 {
 	/* adress of boot parameters */
@@ -284,6 +307,10 @@ int board_init(void)
 	taurus_macb_hw_init();
 #endif
 	at91_spi0_hw_init(TAURUS_SPI_MASK);
+#ifdef CONFIG_USB_GADGET_AT91
+	at91_udp_hw_init();
+	at91_udc_probe(&board_udc_data);
+#endif
 
 	return 0;
 }
include/configs/smartweb.h +30 -4
index 9f22139..baec73b 100644
@@ -75,7 +75,7 @@
 
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN \
-	ROUND(3 * CONFIG_ENV_SIZE + (128 << 10), 0x1000)
+	ROUND(3 * CONFIG_ENV_SIZE + 4*1024*1024, 0x1000)
 
 /* NAND flash settings */
 #define CONFIG_NAND_ATMEL
@@ -140,15 +140,42 @@
 
 #if !defined(CONFIG_SPL_BUILD)
 /* USB configuration */
+#define CONFIG_CMD_USB
 #define CONFIG_USB_ATMEL
 #define CONFIG_USB_ATMEL_CLK_SEL_PLLB
 #define CONFIG_USB_OHCI_NEW
-#define CONFIG_USB_STORAGE
-#define CONFIG_DOS_PARTITION
 #define CONFIG_SYS_USB_OHCI_CPU_INIT
 #define CONFIG_SYS_USB_OHCI_REGS_BASE	ATMEL_UHP_BASE
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME	"at91sam9260"
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	2
+
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_ASIX
+#define CONFIG_USB_ETHER_MCS7830
+
+/* USB DFU support */
+#define CONFIG_CMD_MTDPARTS
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+
+#define CONFIG_USB_GADGET
+#define CONFIG_USB_GADGET_AT91
+
+/* DFU class support */
+#define CONFIG_CMD_DFU
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_DFU_NAND
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_VBUS_DRAW	2
+#define CONFIG_SYS_DFU_DATA_BUF_SIZE	(1 << 20)
+#define DFU_MANIFEST_POLL_TIMEOUT	25000
+
+/* USB DFU IDs */
+#define CONFIG_G_DNL_VENDOR_NUM 0x0908
+#define CONFIG_G_DNL_PRODUCT_NUM 0x02d2
+#define CONFIG_G_DNL_MANUFACTURER "Siemens AG"
+
+#define CONFIG_SYS_CACHELINE_SIZE	0x2000
 #endif
 
 /* General Boot Parameter */
@@ -195,7 +222,6 @@
 #undef CONFIG_CMD_LOADS
 
 #define CONFIG_CMD_NAND
-#define CONFIG_CMD_USB
 #define CONFIG_CMD_FAT
 
 #ifdef CONFIG_MACB
include/configs/taurus.h +8 -0
index dd35a8f..99cf302 100644
@@ -128,12 +128,38 @@
 /* USB */
 #if defined(CONFIG_BOARD_TAURUS)
 #define CONFIG_USB_ATMEL
+#define CONFIG_USB_ATMEL_CLK_SEL_PLLB
 #define CONFIG_USB_OHCI_NEW
 #define CONFIG_SYS_USB_OHCI_CPU_INIT
 #define CONFIG_SYS_USB_OHCI_REGS_BASE		0x00500000
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME		"at91sam9260"
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	2
 #define CONFIG_USB_STORAGE
+
+/* USB DFU support */
+#define CONFIG_CMD_MTDPARTS
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+
+#define CONFIG_USB_GADGET

include/configs/taurus.h line 154

Quoted 10 lines
include/configs/taurus.h +10 -0
+#define CONFIG_USB_GADGET_AT91
+
+/* DFU class support */
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_DFU
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_DFU_NAND
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USB_GADGET_VBUS_DRAW	2
+#define CONFIG_SYS_DFU_DATA_BUF_SIZE	(1 << 20)
					^^^^^^^^^ Here you can use SZ_1M

Please correct other places where you can replace (1 << X) with SZ_X.

Quoted 20 lines
include/configs/taurus.h +9 -1
+#define DFU_MANIFEST_POLL_TIMEOUT	25000
+
+/* USB DFU IDs */
+#define CONFIG_G_DNL_VENDOR_NUM 0x0908
+#define CONFIG_G_DNL_PRODUCT_NUM 0x02d2
+#define CONFIG_G_DNL_MANUFACTURER "Siemens AG"
+
+#define CONFIG_SYS_CACHELINE_SIZE	0x2000
 #endif
 
 /* SPI EEPROM */
@@ -251,7 +277,7 @@
  * Size of malloc() pool
  */
 #define CONFIG_SYS_MALLOC_LEN \
-	ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)
+	ROUND(3 * CONFIG_ENV_SIZE + 4*1024*1024, 0x1000)
 
 /* Defines for SPL */
 #define CONFIG_SPL_FRAMEWORK
Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#10 lore raw

cover add dfu support for at91 sam9260 based boards

In reply to Heiko Schocher

Hi Marek,

Quoted 16 lines

add dfu supprt for at91 sam9260 based boards. The USB gadget driver is ported from linux:

b2ba27a5c56ff: usb: gadget: at91_udc: move prepare clk into process context

it drops a lot of checkpatch warnings/errors:

checkpatch.pl found 12 error(s), 31 warning(s), 43 checks(s)

but for further updates I did not fix them.
The errors are all from this sort:

error: drivers/usb/gadget/at91_udc.c,87: space prohibited before open square bracket '['

Quoted 7 lines

a lot of "line over 80 characters" warnings ...

Heiko Schocher (3):
ARM: at91: add cpu.h
usb: gadget: at91_udc: add support for at91_udc at91, taurus, smartweb: add dfu support

Marek, do you plan to review this patch series?

(I would need at least one review before I pull the code).

Quoted 17 lines
 arch/arm/mach-at91/include/mach/cpu.h |  149 +++
 board/siemens/smartweb/smartweb.c     |   29 +
 board/siemens/taurus/taurus.c         |   27 +
 drivers/usb/gadget/Makefile           |    1 +
 drivers/usb/gadget/at91_udc.c         | 2203
+++++++++++++++++++++++++++++++++
drivers/usb/gadget/at91_udc.h         |  171 +++
include/configs/smartweb.h            |   34 +-
include/configs/taurus.h              |   28 +-
include/linux/usb/at91_udc.h          |   20 + 9 files changed, 2657

insertions(+), 5 deletions(-) create mode 100644 arch/arm/mach-at91/include/mach/cpu.h create mode 100644 drivers/usb/gadget/at91_udc.c create mode 100644 drivers/usb/gadget/at91_udc.h create mode 100644 include/linux/usb/at91_udc.h

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#11 lore raw

cover add dfu support for at91 sam9260 based boards

Hello Lukasz,

Am 20.07.2015 um 16:03 schrieb Lukasz Majewski:

Quoted 21 lines

Hi Marek,

Quoted 19 lines

add dfu supprt for at91 sam9260 based boards. The USB gadget driver is ported from linux:

b2ba27a5c56ff: usb: gadget: at91_udc: move prepare clk into process context

it drops a lot of checkpatch warnings/errors:

checkpatch.pl found 12 error(s), 31 warning(s), 43 checks(s)

but for further updates I did not fix them.
The errors are all from this sort:

error: drivers/usb/gadget/at91_udc.c,87: space prohibited before open square bracket '['

a lot of "line over 80 characters" warnings ...

Quoted 8 lines
Quoted 4 lines

Heiko Schocher (3):
ARM: at91: add cpu.h
usb: gadget: at91_udc: add support for at91_udc at91, taurus, smartweb: add dfu support

Marek, do you plan to review this patch series?

(I would need at least one review before I pull the code).

Maybe a Reviewed-by or Acked-by from you (and Marek) is enough, as it is maybe pickedup by Andreas Biessmann (at91 maintainer)

Thanks!

bye,
Heiko

Quoted 21 lines
Quoted 18 lines

  arch/arm/mach-at91/include/mach/cpu.h |  149 +++
  board/siemens/smartweb/smartweb.c     |   29 +
  board/siemens/taurus/taurus.c         |   27 +
  drivers/usb/gadget/Makefile           |    1 +
  drivers/usb/gadget/at91_udc.c         | 2203
+++++++++++++++++++++++++++++++++
drivers/usb/gadget/at91_udc.h         |  171 +++
include/configs/smartweb.h            |   34 +-
include/configs/taurus.h              |   28 +-
include/linux/usb/at91_udc.h          |   20 + 9 files changed, 2657

insertions(+), 5 deletions(-) create mode 100644 arch/arm/mach-at91/include/mach/cpu.h create mode 100644 drivers/usb/gadget/at91_udc.c create mode 100644 drivers/usb/gadget/at91_udc.h create mode 100644 include/linux/usb/at91_udc.h

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#12 lore raw

cover add dfu support for at91 sam9260 based boards

Hi Heiko,

Quoted 29 lines

Hello Lukasz,

Am 20.07.2015 um 16:03 schrieb Lukasz Majewski:

Quoted 26 lines

Hi Marek,

Quoted 23 lines

add dfu supprt for at91 sam9260 based boards. The USB gadget driver is ported from linux:

b2ba27a5c56ff: usb: gadget: at91_udc: move prepare clk into process context

it drops a lot of checkpatch warnings/errors:

checkpatch.pl found 12 error(s), 31 warning(s), 43 checks(s)

but for further updates I did not fix them.
The errors are all from this sort:

error: drivers/usb/gadget/at91_udc.c,87: space prohibited before open square bracket '['

a lot of "line over 80 characters" warnings ...

Heiko Schocher (3):
ARM: at91: add cpu.h
usb: gadget: at91_udc: add support for at91_udc at91, taurus, smartweb: add dfu support

Quoted 7 lines
Quoted 3 lines

Marek, do you plan to review this patch series?

(I would need at least one review before I pull the code).

Maybe a Reviewed-by or Acked-by from you (and Marek) is enough, as it is maybe pickedup by Andreas Biessmann (at91 maintainer)

No problem. I will review the code.

Quoted 26 lines

Thanks!

bye,
Heiko

Quoted 21 lines
Quoted 18 lines

  arch/arm/mach-at91/include/mach/cpu.h |  149 +++
  board/siemens/smartweb/smartweb.c     |   29 +
  board/siemens/taurus/taurus.c         |   27 +
  drivers/usb/gadget/Makefile           |    1 +
  drivers/usb/gadget/at91_udc.c         | 2203
+++++++++++++++++++++++++++++++++
drivers/usb/gadget/at91_udc.h         |  171 +++
include/configs/smartweb.h            |   34 +-
include/configs/taurus.h              |   28 +-
include/linux/usb/at91_udc.h          |   20 + 9 files changed,

2657 insertions(+), 5 deletions(-) create mode 100644 arch/arm/mach-at91/include/mach/cpu.h create mode 100644 drivers/usb/gadget/at91_udc.c create mode 100644 drivers/usb/gadget/at91_udc.h create mode 100644 include/linux/usb/at91_udc.h

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#13 lore raw

cover add dfu support for at91 sam9260 based boards

In reply to Lukasz Majewski
Quoted 20 lines · Lukasz Majewski

Hi Marek,

Quoted 18 lines

add dfu supprt for at91 sam9260 based boards. The USB gadget driver is ported from linux:

b2ba27a5c56ff: usb: gadget: at91_udc: move prepare clk into process context

it drops a lot of checkpatch warnings/errors:

checkpatch.pl found 12 error(s), 31 warning(s), 43 checks(s)

but for further updates I did not fix them.
The errors are all from this sort:

error: drivers/usb/gadget/at91_udc.c,87: space prohibited before open square bracket '['

a lot of "line over 80 characters" warnings ...

Quoted 8 lines
Quoted 4 lines

Heiko Schocher (3):
ARM: at91: add cpu.h
usb: gadget: at91_udc: add support for at91_udc
at91, taurus, smartweb: add dfu support

Marek, do you plan to review this patch series?

(I would need at least one review before I pull the code).

I took a brief look. One thing I don't quite like is the omnipresent #ifdef __UBOOT__ stuff. I'd much rather love to see some kind of a porting layer so the driver can just be picked from linux as-is, but that might be too much hassle.

Otherwise, I'm fine with it, though I nitpicked a bit.

Best regards,
Marek Vasut

#14 lore raw

cover add dfu support for at91 sam9260 based boards

Hello Marek,

Am 21.07.2015 um 04:03 schrieb Marek Vasut:

Quoted 26 lines · Lukasz Majewski
Quoted 25 lines

Hi Marek,

Quoted 22 lines

add dfu supprt for at91 sam9260 based boards. The USB gadget driver is ported from linux:

b2ba27a5c56ff: usb: gadget: at91_udc: move prepare clk into process context

it drops a lot of checkpatch warnings/errors:

checkpatch.pl found 12 error(s), 31 warning(s), 43 checks(s)

but for further updates I did not fix them.
The errors are all from this sort:

error: drivers/usb/gadget/at91_udc.c,87: space prohibited before open square bracket '['

a lot of "line over 80 characters" warnings ...

Heiko Schocher (3):
ARM: at91: add cpu.h
usb: gadget: at91_udc: add support for at91_udc at91, taurus, smartweb: add dfu support

Quoted 8 lines
Quoted 3 lines

Marek, do you plan to review this patch series?

(I would need at least one review before I pull the code).

I took a brief look. One thing I don't quite like is the omnipresent #ifdef __UBOOT__ stuff. I'd much rather love to see some kind of a porting layer so the driver can just be picked from linux as-is, but that might be too much hassle.

Yes, such a layer would be beautiful, but it is possible? We have no processes/task switching in U-Boot ... a lot of board do not use irqs ...

Quoted 1 line

Otherwise, I'm fine with it, though I nitpicked a bit.

I just prepare a v2 ...

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany