Skip to contentSkip to conversation

tftp booting the panda board

U-Boot New Gilles Chanteperdrix 4 participants 13 messages May 9, 2011 – May 18, 2011

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

Hi,

I am trying to tftpboot the panda board, this basically works, but I still have some issues.

The panda board uses an SMSC95xx chip, and so requires USB2.0

Using the u-boot git head, we have support for network adapters over USB, and the patches from Simon Glass, we get support for the ethernet chip. So, the only missing piece of the puzzle is USB EHCI for OMAP4/Panda.

I tried to implement it, the patches will follow shortly, but have several remaining issues:
- the EHCI stop routine, implemented as in the Linux kernel driver, has timeouts when trying to wait for the UHH reset;
- the SMSC95XX is unstable, if I start USB, stop USB, then start again, the SMSC95XX initialization hangs, this does not happen without this driver
- if I launch bootp, and say, the server does not answer to the bootp protocol, the smsc95xx driver does not seem to be able to recover from the first timeout, any further attempt causes a timeout.

Regards.

Signature · 1 line
                                                                Gilles.
#1 lore raw

PATCH 1/3 omap4: add support for gpios

Copied from omap3.

---
 arch/arm/cpu/armv7/omap4/Makefile      |    1 +
 arch/arm/cpu/armv7/omap4/gpio.c        |  169 ++++++++++++++++++++++++++++++++
 arch/arm/include/asm/arch-omap4/gpio.h |   93 +++++++++++++++++
 3 files changed, 263 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/omap4/gpio.c
 create mode 100644 arch/arm/include/asm/arch-omap4/gpio.h
arch/arm/cpu/armv7/omap4/Makefile +1 -0
index 987dc9d..c39693a 100644
@@ -29,6 +29,7 @@ SOBJS	+= lowlevel_init.o
 
 COBJS	+= board.o
 COBJS	+= mem.o
+COBJS	+= gpio.o
 COBJS	+= sys_info.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
arch/arm/cpu/armv7/omap4/gpio.c new file +169 -0

169 lines not on this page · raw message

arch/arm/include/asm/arch-omap4/gpio.h new file +93 -0

93 lines not on this page · raw message

Signature · 1 line
1.7.2.5
#2 lore raw

PATCH 1/3 omap4: add support for gpios

Quoted 1 line · Gilles Chanteperdrix

Copied from omap3.

I have not looked at the code but if it truly is a copy (other than some base addresses) is there a way to share with omap3?

--john

#3 lore raw

PATCH 1/3 omap4: add support for gpios

Quoted 5 lines · John Rigby
Quoted 1 line · Gilles Chanteperdrix

Copied from omap3.

I have not looked at the code but if it truly is a copy (other than some base addresses) is there a way to share with omap3?

Yes, probably. The linux code is full of switch/cases, but that is because it has to support compiling one kernel for all omaps. We can do something simple with a header defining the same defines to different values depending on the actual processor.

Signature · 1 line
                                                                Gilles.
#4 lore raw

PATCH 1/3 omap4: add support for gpios

In reply to John Rigby
Quoted 5 lines · John Rigby
Quoted 1 line · Gilles Chanteperdrix

Copied from omap3.

I have not looked at the code but if it truly is a copy (other than some base addresses) is there a way to share with omap3?

I am going to fix this and resend another round of patches. But, it this the only thing I should fix?

For instance, in part of the patch, I used hardcoded hardware addresses, in other part, I put some #define for register addresses in the .c file, in other part, the #define are in a common header. What is the policy in u-boot for this particular point?

Signature · 1 line
                                                                Gilles.
#5 lore raw

PATCH 1/3 omap4: add support for gpios

Quoted 4 lines

I am going to fix this and resend another round of patches. But, it this the only thing I should fix?

My comment was not a complete review only a comment about sharing.

#6 lore raw

PATCH 1/3 omap4: add support for gpios

Quoted 5 lines · John Rigby
Quoted 4 lines

I am going to fix this and resend another round of patches. But, it this the only thing I should fix?

My comment was not a complete review only a comment about sharing.

I got that, I am just trying to get more comments before I send another round of patches, in order to avoid having to send 10 rounds of patches.

Maybe the patches were sent to the wrong person?

Signature · 1 line
                                                                Gilles.
#7 lore raw

PATCH 2/3 omap4: add support for EHCI

In reply to Gilles Chanteperdrix

As board may need some specific support, implement inner functions to be called by the boards implementaions of ehci_hcd_start, ehci_hcd_stop.

---
 arch/arm/include/asm/arch-omap4/ehci.h |    8 +
 drivers/usb/host/Makefile              |    1 +
 drivers/usb/host/ehci-omap4.c          |  268 ++++++++++++++++++++++++++++++++
 3 files changed, 277 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-omap4/ehci.h
 create mode 100644 drivers/usb/host/ehci-omap4.c
arch/arm/include/asm/arch-omap4/ehci.h new file +8 -0
new file mode 100644
index 0000000..fc84f6a
@@ -0,0 +1,8 @@
+#ifndef EHCI_H
+#define EHCI_H
+
+int omap4_ehci_hcd_init(void);
+
+int omap4_ehci_hcd_stop(void);
+
+#endif /* EHCI_H */
drivers/usb/host/Makefile +1 -0
index 51b2494..5a5b971 100644
@@ -46,6 +46,7 @@ COBJS-$(CONFIG_USB_EHCI_IXP4XX) += ehci-ixp.o
 COBJS-$(CONFIG_USB_EHCI_KIRKWOOD) += ehci-kirkwood.o
 COBJS-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o
 COBJS-$(CONFIG_USB_EHCI_VCT) += ehci-vct.o
+COBJS-$(CONFIG_USB_EHCI_OMAP4) += ehci-omap4.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/usb/host/ehci-omap4.c new file +268 -0

268 lines not on this page · raw message

Signature · 1 line
1.7.2.5
#8 lore raw

PATCH 2/3 omap4: add support for EHCI

drivers/usb/host/ehci-omap4.c line 2

Quoted 8 lines · Gilles Chanteperdrix
drivers/usb/host/ehci-omap4.c new file +2 -0
new file mode 100644
index 0000000..19cd286
@@ -0,0 +1,268 @@
+/*
+ * OMAP4 EHCI port, copied from linux/drivers/usb/host/ehci-omap.c

So the file in linux is for both omap[34] yet here in u-boot it is only for omap4. I admittedly know very little about EHCI internals but it seems to me that it would be nice if this could support both in u-boot.

I see from git history that omap3 support went in some months ago with only some new routines in beagle.c and no new usb files so could some omap usb expert explain.

Thanks,
John

#9 lore raw

PATCH 2/3 omap4: add support for EHCI

Quoted 16 lines · John Rigby

drivers/usb/host/ehci-omap4.c line 2

Quoted 8 lines · Gilles Chanteperdrix
drivers/usb/host/ehci-omap4.c new file +2 -0
new file mode 100644
index 0000000..19cd286
@@ -0,0 +1,268 @@
+/*
+ * OMAP4 EHCI port, copied from linux/drivers/usb/host/ehci-omap.c

So the file in linux is for both omap[34] yet here in u-boot it is only for omap4. I admittedly know very little about EHCI internals but it seems to me that it would be nice if this could support both in u-boot.

Quoted 3 lines

I see from git history that omap3 support went in some months ago with only some new routines in beagle.c and no new usb files so could some omap usb expert explain.

I am far from an expert. But I saw a previous post for EHCI on omap3 saying "this file is sufficiently specific to be specific for each board". So, I started writing a panda specific board, but found that there was not really much code specific to panda, and most of the code was specific to omap4.

This said, there is more than one way to do it on omap4, the processor can be configured different ways to get EHCI support (as far as I understood the processor even has two different EHCI controllers). So maybe a panda-only file was not a bad idea after all...

Signature · 1 line
                                                                Gilles.
#10 lore raw

PATCH 2/3 omap4: add support for EHCI

In reply to Gilles Chanteperdrix

Dear Gilles Chanteperdrix,

Quoted 5 lines · In message <1304975091-21848-2-git-send-email-gilles.chanteperdrix@xenomai.org>…

As board may need some specific support, implement inner functions to be called by the boards implementaions of ehci_hcd_start, ehci_hcd_stop.

...

Quoted 1 line

+ * OMAP4 EHCI port, copied from linux/drivers/usb/host/ehci-omap.c

Can you please provide exact reference? Please see
http://www.denx.de/wiki/view/U-Boot/Patches#Attributing_Code_Copyrights_Sign
bullet # 4

Thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Q: Why do PCs have a reset button on the front?
A: Because they are expected to run Microsoft operating systems.
#11 lore raw

PATCH 3/3 omap4_panda: add support for EHCI

In reply to Gilles Chanteperdrix
---
 board/ti/panda/Makefile     |    4 ++-
 board/ti/panda/ehci-panda.c |   59 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+), 1 deletions(-)
 create mode 100644 board/ti/panda/ehci-panda.c
board/ti/panda/Makefile +3 -1
index 2186403..253567c 100644
@@ -25,7 +25,9 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).o
 
-COBJS	:= panda.o
+COBJS-$(CONFIG_USB_EHCI) += ehci-panda.o
+
+COBJS	:= $(COBJS-y) panda.o
 
 SRCS	:= $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
board/ti/panda/ehci-panda.c new file +59 -0

59 lines not on this page · raw message

Signature · 1 line
1.7.2.5
#12 lore raw
In reply to Gilles Chanteperdrix
Quoted 12 lines · Gilles Chanteperdrix

Hi,

I am trying to tftpboot the panda board, this basically works, but I still have some issues.

The panda board uses an SMSC95xx chip, and so requires USB2.0

Using the u-boot git head, we have support for network adapters over USB, and the patches from Simon Glass, we get support for the ethernet chip. So, the only missing piece of the puzzle is USB EHCI for OMAP4/Panda.

Quoted 7 lines

I tried to implement it, the patches will follow shortly, but have several remaining issues:
- the EHCI stop routine, implemented as in the Linux kernel driver, has timeouts when trying to wait for the UHH reset;
- the SMSC95XX is unstable, if I start USB, stop USB, then start again, the SMSC95XX initialization hangs, this does not happen without this driver

This is a bug in USB net I think, rather than just this driver. I have not looked at it yet but patches are welcome!

Quoted 4 lines

- if I launch bootp, and say, the server does not answer to the bootp protocol, the smsc95xx driver does not seem to be able to recover from the first timeout, any further attempt causes a timeout.

This may or may not be related - again I have seen this and it also happens with Asix.

Regards,
Simon

Quoted 10 lines

Regards.

--
Gilles.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot