Re: [U-Boot] [U-Boot-Custodians] [RFC] enforce CONFIG_DM=y

2019-08-14 Thread Łukasz Dałek

On 8/13/19 1:12 PM, Tom Rini wrote:

On Tue, Aug 13, 2019 at 11:53:59AM +0200, Marek Vasut wrote:

On 8/13/19 11:34 AM, Simon Glass wrote:

On Fri, 9 Aug 2019 at 12:39, Heinrich Schuchardt  wrote:


The time lines set force in doc/driver-model/migration.rst for different
subsystems to move to the driver model have been passed.

I ran a test on Travis CI
https://travis-ci.org/xypron2/u-boot/builds/569776600
that showed only 8 boards remain that cannot be built with CONFIG_DM=y.

H2200
* h2200

Renesas
* sh7757lcr
* sh7752evb
* r2dplus
* sh7753evb
* sh7763rdp
* MigoR
* r7780mp.

I think it is time that we enforce CONFIG_DM=y in U-Boot and remove
boards that do not support it.


Agreed, that is a small list. I think Tom should make the call though.


Was there ever a warning about this , to notify the maintainers that the
boards need conversion ?


I think for H2200 we talked about dropping that during the last "can we
find a newer toolchain for everyone?" thread, and I'll check my email
again on that.  For the SH boards, you and I had a conversation about
them awhile ago that lead to you removing a number of platforms, so
those are the ones that are left that need converting or dropping.



I agree that H2200 board should be removed from main Das U-Boot tree.
I don't have enough time to support it correctly (to keep up with 
development of whole project).


Sincerely,
Lukasz Dalek
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] arm:board:h2200: Add CONFIG_SYS_GENERIC_BOARD

2014-06-12 Thread Łukasz Dałek

On 12.06.2014 14:58, Marek Vasut wrote:

On Thursday, June 12, 2014 at 12:46:53 AM, Lukasz Dalek wrote:

Signed-off-by: Lukasz Dalek luk0...@gmail.com


A commit message would be nice.

btw. do you think this would work on other PXA boards ?


No idea.



Best regards,
Marek Vasut



Lukasz D.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] usb: gadget: Use unaligned access for wMaxPacketSize

2013-05-13 Thread Łukasz Dałek

On 13.05.2013 12:23, Vivek Gautam wrote:

Use get_unaligned() while fetching wMaxPacketSize to avoid
voilating any alignment rules.

Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
Cc: Lukasz Majewski l.majew...@samsung.com
Cc: Piotr Wilczek p.wilc...@samsung.com
Cc: Kyungmin Park kyungmin.p...@samsung.com
Cc: Lukasz Dalek luk0...@gmail.com
Cc: Marek Vasut ma...@denx.de
---

Just did a build test on u-boot-usb/master branch.
Need to be tested further.

Based on u-boot-usb/next.

  drivers/usb/gadget/f_mass_storage.c |3 ++-
  drivers/usb/gadget/pxa25x_udc.c |   13 +++--
  2 files changed, 9 insertions(+), 7 deletions(-)


Tested pxa25x_udc.c on u-boot/master on h2200 (PXA255) and works fine.

Yours sincerely,
Lukasz Dalek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] h2200: Add board reset support

2013-01-12 Thread Łukasz Dałek

On 13.01.2013 00:54, Marek Vasut wrote:

Dear Lukasz Dalek,


+void board_reset(void)
+{
+   /* Enable VLIO interface on Hamcop */
+   writeb(0x1, 0x4000);
+
+   /* Reset board (cold reset) */
+   writeb(0xff, 0x4002);
+}
Can you not reimplement reset_cpu() ?


reset_cpu() doesn't have __attribute__((weak)) so if I would try to 
implement it

compiler will return with error.

Yours sincerely,
Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] pxa25x_udc: Remove usbdescriptors.h

2012-11-29 Thread Łukasz Dałek

On 29.11.2012 15:27, Marek Vasut wrote:

Dear Lukasz Dalek,


usbdescriptors.h conflicts with linux/usb/ch9.h.
Remove it.

Applied, thanks


Signed-off-by: Lukasz Dalekluk0...@gmail.com
---
  drivers/usb/gadget/pxa25x_udc.c |1 -
  1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/pxa25x_udc.c
b/drivers/usb/gadget/pxa25x_udc.c index dd74143..9ce98f0 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -40,7 +40,6 @@
  #includeasm/io.h
  #includeasm/arch/pxa.h

-#includeusbdescriptors.h
  #includelinux/usb/ch9.h
  #includelinux/usb/gadget.h
  #includeusb/lin_gadget_compat.h

Best regards,
Marek Vasut

One more question. I've send you before patch which enables
support for USB in h2200 device, which you accepted but
didn't push. Did you find more problem out there or just forgot to
apply?

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] h2200 fails to build on current u-boot/next

2012-10-09 Thread Łukasz Dałek

On 10.10.2012 00:27, Albert ARIBAUD wrote:

Hi Łukasz,

On Tue, 9 Oct 2012 14:45:33 -0700, Tom Rinitr...@ti.com  wrote:


On Tue, Oct 09, 2012 at 05:34:13PM +0200, Albert ARIBAUD wrote:


Hi Tom,

The following changes since commit 661c21dd46e857b74682b0610d83cfea7f3ac3c2:

   usb.h: Add udc_disconnect prototype to usb.h (2012-10-08 18:01:17 -0700)

are available in the git repository at:

   git://git.denx.de/u-boot-arm next

for you to fetch changes up to 0d6b8f29a3c59306d6cd8f2baa92897f56b06695:

   configs: mx6qsabre_common.h: Use default clock definitions (2012-10-09 
16:52:18 +0200)

[snip]

Lukasz Dalek (2):
   h2200: Add support for iPAQ h2200 palmtop

This doesn't compile in next due to not having been updated for the
serial changes:
serial_pxa.c:297:2: error: #error Bad CONFIG_CONS_INDEX.

Do you want me to pull or do you want to fix this first?  Thanks.

Cc:ing Marek as PXA custodian and serial patcher...

Łukasz, can you have a look at why h2200 above u-boot/next fails to
build, and can you quickly provide a new patch version to fix it?

Amicalement,

Yes, I will prepare patch soon.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 3/3] h2200: Add USB CDC ethernet support

2012-10-03 Thread Łukasz Dałek

On 03.10.2012 03:04, Marek Vasut wrote:

Dear Łukasz Dałek,


On 03.10.2012 02:25, Marek Vasut wrote:

Dear Łukasz Dałek,


On 03.10.2012 02:18, Marek Vasut wrote:

Dear Łukasz Dałek,


On 03.10.2012 02:06, Marek Vasut wrote:

Dear Lukasz Dalek,


Add support for ethernet over USB which can be used for e.g. booting
process. It works with tftp and dhcp clients code.

Signed-off-by: Lukasz Dalekluk0...@gmail.com
---

Changes for v5:
- Surrendered #includeusb.h with CONFIGs

 board/h2200/h2200.c |   17 +
 boards.cfg  |1 +
 include/configs/h2200.h |   27 +++
 3 files changed, 45 insertions(+), 0 deletions(-)

[...]


diff --git a/boards.cfg b/boards.cfg
index ab10938..a03a469 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -283,6 +283,7 @@ pdnb3arm ixp
pdnb3   prodriv scpu arm
ixp

  pdnb3   prodrive   -   pdnb3:SCPU
  balloon3

  arm pxa

 h2200arm pxa

+h2200_usbeth arm pxa h2200

-

I told you to enable the USB ethernet by default, so why do you add
this board?

I don't understand.
We agreed to split h2200 support into two parts. First one adding
basic support for device, second one adding support for usb ethernet
for h2200.

Yes, but I fail to understand why you need TWO board entries for that.
Adding the USB ethernet support is just a feature, you don't need
additional board entry for that ... so what is the idea behind adding
it?

Because easier is to type make h2200_usbeth_config than modifiy config.

Why don't you enable the USB ethernet by default for h2200 target then?

Best regards,
Marek Vasut

I will enable. This two entries really look weird.

Ok, so we're clear there'll be one entry with ethernet enabled called h2200,
yes?

Best regards,
Marek Vasut

Yes

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6] h2200: Add USB CDC ethernet support

2012-10-03 Thread Łukasz Dałek

On 03.10.2012 20:34, Marek Vasut wrote:

Dear Lukasz Dalek,


Add support for ethernet over USB which can be used for e.g. booting
process. It works with tftp and dhcp clients code.

Signed-off-by: Lukasz Dalekluk0...@gmail.com
---
Changes for v6:
- Defined only one entire for board
Changes for v5:
- Surrendered #includeusb.h  with CONFIGs

  board/h2200/h2200.c |   17 +
  boards.cfg  |2 +-
  include/configs/h2200.h |   27 +++
  3 files changed, 45 insertions(+), 1 deletions(-)

diff --git a/board/h2200/h2200.c b/board/h2200/h2200.c
index 3076306..617bb04 100644
--- a/board/h2200/h2200.c
+++ b/board/h2200/h2200.c
@@ -22,9 +22,20 @@
  #includeasm/arch/pxa.h
  #includeasm/arch/pxa-regs.h
  #includeasm/io.h
+#ifdef CONFIG_H2200_USBETH

It's always defined, remove it.


+# includeusb.h
+#endif

  DECLARE_GLOBAL_DATA_PTR;

+#ifdef CONFIG_H2200_USBETH
+int board_eth_init(bd_t *bis)
+{
+   usb_eth_initialize(bis);
+   return 0;
+}
+#endif
+
  int board_init(void)
  {
/* We have RAM, disable cache */
@@ -36,6 +47,12 @@ int board_init(void)
/* adress of boot parameters */
gd-bd-bi_boot_params = 0xa100;

+   /* Let host see that device is disconnected */
+#if defined(CONFIG_H2200_USBETH)
+   udc_disconnect();
+   mdelay(500);
+#endif
+
return 0;
  }

diff --git a/boards.cfg b/boards.cfg
index ab10938..f557c2b 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -282,7 +282,7 @@ dvlhost  arm ixp
  pdnb3arm ixp pdnb3
prodrive scpu arm ixp pdnb3
prodrive   -   pdnb3:SCPU balloon3
arm pxa
-h2200arm pxa
+h2200arm pxa h2200   -
  -   h2200:H2200_USBETH lubbock

[...]

This change isn't needed if you remove CONFIG_H2200_USBETH


diff --git a/include/configs/h2200.h b/include/configs/h2200.h
index de5299b..4c5a1ae 100644
--- a/include/configs/h2200.h
+++ b/include/configs/h2200.h
@@ -153,4 +153,31 @@

  #define CONFIG_BOOTARGS root=/dev/ram0 ro console=ttyS0,115200n8

+#ifdef CONFIG_H2200_USBETH

ifdef - endif not needed, otherwise good.


+# define CONFIG_SYS_CONSOLE_IS_IN_ENV
+# define CONFIG_USB_DEV_PULLUP_GPIO33
+/* USB VBUS GPIO 3 */
+
+# define CONFIG_CMD_NET
+# define CONFIG_CMD_PING
+
+# define CONFIG_BOOTDELAY  2
+# define CONFIG_BOOTCOMMAND\
+   setenv downloaded 0 ; while test $downloaded -eq 0 ; do  \
+   if bootp ; then setenv downloaded 1 ; fi ; done ;  \
+   source :script ;  \
+   bootm ; 
+
+# define CONFIG_USB_GADGET_PXA2XX
+# define CONFIG_USB_ETHER
+# define CONFIG_USB_ETH_SUBSET
+
+# define CONFIG_USBNET_DEV_ADDRde:ad:be:ef:00:01
+# define CONFIG_USBNET_HOST_ADDR   de:ad:be:ef:00:02
+# define CONFIG_EXTRA_ENV_SETTINGS \
+   stdin=serial\0 \
+   stdout=serial\0 \
+   stderr=serial\0
+#endif
+
  #endif /* __CONFIG_H */

Why do I have to remove CONFIG_H2200_USBETH? If I do so, I'm not be able to
disable USB ethernet support.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6] h2200: Add USB CDC ethernet support

2012-10-03 Thread Łukasz Dałek

On 03.10.2012 21:22, Marek Vasut wrote:

Dear Łukasz Dałek,


On 03.10.2012 20:34, Marek Vasut wrote:

Dear Lukasz Dalek,


Add support for ethernet over USB which can be used for e.g. booting
process. It works with tftp and dhcp clients code.

Signed-off-by: Lukasz Dalekluk0...@gmail.com
---

Changes for v6:
- Defined only one entire for board

Changes for v5:
- Surrendered #includeusb.h   with CONFIGs

   board/h2200/h2200.c |   17 +
   boards.cfg  |2 +-
   include/configs/h2200.h |   27 +++
   3 files changed, 45 insertions(+), 1 deletions(-)

diff --git a/board/h2200/h2200.c b/board/h2200/h2200.c
index 3076306..617bb04 100644
--- a/board/h2200/h2200.c
+++ b/board/h2200/h2200.c
@@ -22,9 +22,20 @@

   #includeasm/arch/pxa.h
   #includeasm/arch/pxa-regs.h
   #includeasm/io.h

+#ifdef CONFIG_H2200_USBETH

It's always defined, remove it.


+# includeusb.h
+#endif

   DECLARE_GLOBAL_DATA_PTR;

+#ifdef CONFIG_H2200_USBETH
+int board_eth_init(bd_t *bis)
+{
+   usb_eth_initialize(bis);
+   return 0;
+}
+#endif
+

   int board_init(void)
   {

/* We have RAM, disable cache */

@@ -36,6 +47,12 @@ int board_init(void)

/* adress of boot parameters */
gd-bd-bi_boot_params = 0xa100;

+   /* Let host see that device is disconnected */
+#if defined(CONFIG_H2200_USBETH)
+   udc_disconnect();
+   mdelay(500);
+#endif
+

return 0;

   }

diff --git a/boards.cfg b/boards.cfg
index ab10938..f557c2b 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -282,7 +282,7 @@ dvlhost  arm ixp

   pdnb3arm ixp pdnb3

prodrive scpu arm ixp pdnb3

 prodrive   -   pdnb3:SCPU balloon3

arm pxa
-h2200arm pxa
+h2200arm pxa h2200
  -

   -   h2200:H2200_USBETH lubbock

[...]

This change isn't needed if you remove CONFIG_H2200_USBETH


diff --git a/include/configs/h2200.h b/include/configs/h2200.h
index de5299b..4c5a1ae 100644
--- a/include/configs/h2200.h
+++ b/include/configs/h2200.h
@@ -153,4 +153,31 @@

   #define CONFIG_BOOTARGS root=/dev/ram0 ro console=ttyS0,115200n8

+#ifdef CONFIG_H2200_USBETH

ifdef - endif not needed, otherwise good.


+# define CONFIG_SYS_CONSOLE_IS_IN_ENV
+# define CONFIG_USB_DEV_PULLUP_GPIO33
+/* USB VBUS GPIO 3 */
+
+# define CONFIG_CMD_NET
+# define CONFIG_CMD_PING
+
+# define CONFIG_BOOTDELAY  2
+# define CONFIG_BOOTCOMMAND\
+   setenv downloaded 0 ; while test $downloaded -eq 0 ; do  \
+   if bootp ; then setenv downloaded 1 ; fi ; done ;  \
+   source :script ;  \
+   bootm ; 
+
+# define CONFIG_USB_GADGET_PXA2XX
+# define CONFIG_USB_ETHER
+# define CONFIG_USB_ETH_SUBSET
+
+# define CONFIG_USBNET_DEV_ADDRde:ad:be:ef:00:01
+# define CONFIG_USBNET_HOST_ADDR   de:ad:be:ef:00:02
+# define CONFIG_EXTRA_ENV_SETTINGS \
+   stdin=serial\0 \
+   stdout=serial\0 \
+   stderr=serial\0
+#endif
+

   #endif /* __CONFIG_H */

Why do I have to remove CONFIG_H2200_USBETH? If I do so, I'm not be able to
disable USB ethernet support.

Why would you disable it?

Because of other gadgets, e.g. ttyACM

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6] h2200: Add USB CDC ethernet support

2012-10-03 Thread Łukasz Dałek

On 03.10.2012 22:02, Marek Vasut wrote:

Dear Łukasz Dałek,


On 03.10.2012 21:40, Marek Vasut wrote:

Dear Łukasz Dałek,

[...]


Why do I have to remove CONFIG_H2200_USBETH? If I do so, I'm not be
able to disable USB ethernet support.

Why would you disable it?

Because of other gadgets, e.g. ttyACM

Can't these co-exist?

Best regards,
Marek Vasut

No they can't.

Not even with the composite driver ? What's ttyacm and where is it in u-boot btw
?

Best regards,
Marek Vasut


As far as I know they can't exists on pxa25x. I don't know how about pxa27x.

ttyacm is a serial over usb.

Driver exists in u-boot for pxa27x (gadget/usb/pxa27x_udc.c) but I have 
my own

for pxa25x not published.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 2/8] pxa: Add some stuff to examine cpu model and rev

2012-10-02 Thread Łukasz Dałek

On 02.10.2012 21:36, Marek Vasut wrote:

Dear Lukasz Dalek,


Add function which return CPU model and revision which can be used for
cpu detection.

Signed-off-by: Lukasz Dalekluk0...@gmail.com

[...]

s/some stuff/code/ would be really nicer.

I think the rest of the patches are ok ... unless they changed?


Nothing changed except patch 7/8 where I only added nicer comment

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/8] h2200: Add support for iPAQ h2200 palmtop

2012-10-02 Thread Łukasz Dałek

On 02.10.2012 21:35, Marek Vasut wrote:

Dear Lukasz Dalek,


Add basic support for HP iPAQ h2200 palmtop. h2200 palmtop was targeted
to general consumers. It has 64 MB of RAM, 32 MB flash. No intergrated
Wi-Fi nor Ethernet. Based on Intel PXA255 processor. It was shipped with
Windows CE 4.2 operating system.

Signed-off-by: Lukasz Dalekluk0...@gmail.com
---
  board/h2200/Makefile   |   51 ++
  board/h2200/h2200-header.S |   27 
  board/h2200/h2200.c|   53 +++
  boards.cfg |1 +
  include/configs/h2200.h|  156
 5 files changed, 288
insertions(+), 0 deletions(-)
  create mode 100644 board/h2200/Makefile
  create mode 100644 board/h2200/h2200-header.S
  create mode 100644 board/h2200/h2200.c
  create mode 100644 include/configs/h2200.h

Will you please learn to write patch changelog ?


I will, I promise.




diff --git a/board/h2200/Makefile b/board/h2200/Makefile
new file mode 100644
index 000..2265aa9
--- /dev/null
+++ b/board/h2200/Makefile
@@ -0,0 +1,51 @@
+#
+# h2200 Support
+#
+# Copyright (C) 2012 Lukasz Dalekluk0...@gmail.com
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := h2200.o
+
+SRCS   := $(COBJS:.o=.c) h2200-header.S
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+ALL: $(LIB) h2200-header.bin
+
+h2200-header.o: h2200-header.S
+   $(CC) $(CFLAGS) -c -o $@ $

Try building with BUILD_DIR=somewhere  ./MAKEALL h2200


what toolchain do you recommend? I use codesourcery and it complains
about some enums.



hint: you're missing $(obj) all around here so the resulting files are still in
the source tree, not the BUILD_DIR, which is wrong of course.


Can you recommend board which has proper Makefile?


Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/8] h2200: Add support for iPAQ h2200 palmtop

2012-10-02 Thread Łukasz Dałek

On 02.10.2012 22:19, Marek Vasut wrote:

hint: you're missing $(obj) all around here so the resulting files are
still in the source tree, not the BUILD_DIR, which is wrong of course.

Can you recommend board which has proper Makefile?

All of them should, did you detect such problem elsewhere?

No. I'll fix this.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 3/3] h2200: Add USB CDC ethernet support

2012-10-02 Thread Łukasz Dałek

On 03.10.2012 02:06, Marek Vasut wrote:

Dear Lukasz Dalek,


Add support for ethernet over USB which can be used for e.g. booting
process. It works with tftp and dhcp clients code.

Signed-off-by: Lukasz Dalekluk0...@gmail.com
---
Changes for v5:
- Surrendered #includeusb.h  with CONFIGs

  board/h2200/h2200.c |   17 +
  boards.cfg  |1 +
  include/configs/h2200.h |   27 +++
  3 files changed, 45 insertions(+), 0 deletions(-)


[...]

diff --git a/boards.cfg b/boards.cfg
index ab10938..a03a469 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -283,6 +283,7 @@ pdnb3arm ixp
pdnb3   prodriv scpu arm ixp
   pdnb3   prodrive   -   pdnb3:SCPU balloon3
   arm pxa
  h2200arm pxa
+h2200_usbeth arm pxa h2200   -

I told you to enable the USB ethernet by default, so why do you add this board?


I don't understand.
We agreed to split h2200 support into two parts. First one adding basic
support for device, second one adding support for usb ethernet for
h2200.


Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 3/3] h2200: Add USB CDC ethernet support

2012-10-02 Thread Łukasz Dałek

On 03.10.2012 02:18, Marek Vasut wrote:

Dear Łukasz Dałek,


On 03.10.2012 02:06, Marek Vasut wrote:

Dear Lukasz Dalek,


Add support for ethernet over USB which can be used for e.g. booting
process. It works with tftp and dhcp clients code.

Signed-off-by: Lukasz Dalekluk0...@gmail.com
---

Changes for v5:
- Surrendered #includeusb.h   with CONFIGs

   board/h2200/h2200.c |   17 +
   boards.cfg  |1 +
   include/configs/h2200.h |   27 +++
   3 files changed, 45 insertions(+), 0 deletions(-)

[...]


diff --git a/boards.cfg b/boards.cfg
index ab10938..a03a469 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -283,6 +283,7 @@ pdnb3arm ixp
pdnb3   prodriv scpu arm ixp

pdnb3   prodrive   -   pdnb3:SCPU
balloon3

arm pxa

   h2200arm pxa

+h2200_usbeth arm pxa h2200
  -

I told you to enable the USB ethernet by default, so why do you add this
board?

I don't understand.
We agreed to split h2200 support into two parts. First one adding basic
support for device, second one adding support for usb ethernet for
h2200.

Yes, but I fail to understand why you need TWO board entries for that. Adding
the USB ethernet support is just a feature, you don't need additional board
entry for that ... so what is the idea behind adding it?


Because easier is to type make h2200_usbeth_config than modifiy config.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 3/3] h2200: Add USB CDC ethernet support

2012-10-02 Thread Łukasz Dałek

On 03.10.2012 02:25, Marek Vasut wrote:

Dear Łukasz Dałek,


On 03.10.2012 02:18, Marek Vasut wrote:

Dear Łukasz Dałek,


On 03.10.2012 02:06, Marek Vasut wrote:

Dear Lukasz Dalek,


Add support for ethernet over USB which can be used for e.g. booting
process. It works with tftp and dhcp clients code.

Signed-off-by: Lukasz Dalekluk0...@gmail.com
---

Changes for v5:
- Surrendered #includeusb.hwith CONFIGs

board/h2200/h2200.c |   17 +
boards.cfg  |1 +
include/configs/h2200.h |   27 +++
3 files changed, 45 insertions(+), 0 deletions(-)

[...]


diff --git a/boards.cfg b/boards.cfg
index ab10938..a03a469 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -283,6 +283,7 @@ pdnb3arm ixp
pdnb3   prodriv scpu arm
ixp

 pdnb3   prodrive   -   pdnb3:SCPU
 balloon3

 arm pxa

h2200arm pxa

+h2200_usbeth arm pxa h2200

   -

I told you to enable the USB ethernet by default, so why do you add
this board?

I don't understand.
We agreed to split h2200 support into two parts. First one adding basic
support for device, second one adding support for usb ethernet for
h2200.

Yes, but I fail to understand why you need TWO board entries for that.
Adding the USB ethernet support is just a feature, you don't need
additional board entry for that ... so what is the idea behind adding
it?

Because easier is to type make h2200_usbeth_config than modifiy config.

Why don't you enable the USB ethernet by default for h2200 target then?

Best regards,
Marek Vasut

I will enable. This two entries really look weird.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] h2200: Add support for iPAQ h2200 palmtop

2012-09-26 Thread Łukasz Dałek

On 26.09.2012 17:29, Marek Vasut wrote:

Dear Lukasz Dalek,


Basic support of HP iPAQ h2200 palmtop. Support includes also USB
ethernet gadget.

Two minor nits ... can you extend the patch description?


Signed-off-by: Lukasz Dalekluk0...@gmail.com
[...]
+h2200arm pxa
+h2200_usbeth arm pxa h2200   -

Can you not enable USB ethernet by default?

[...]


I don't understand.

make h2200_config creates config without usb ethernet
make h2200_usbeth_config creates config with usb ethernet

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] h2200: Add support for iPAQ h2200 palmtop

2012-09-26 Thread Łukasz Dałek

On 26.09.2012 18:13, Marek Vasut wrote:

Dear Łukasz Dałek,


On 26.09.2012 17:29, Marek Vasut wrote:

Dear Lukasz Dalek,


Basic support of HP iPAQ h2200 palmtop. Support includes also USB
ethernet gadget.

Two minor nits ... can you extend the patch description?


Signed-off-by: Lukasz Dalekluk0...@gmail.com
[...]
+h2200arm pxa
+h2200_usbeth arm pxa h2200
  -

Can you not enable USB ethernet by default?

[...]

I don't understand.

make h2200_config creates config without usb ethernet
make h2200_usbeth_config creates config with usb ethernet

Why not just make config with usb ethernet then?


Sorry but I don't understand. You've asked me that can I not
enable USB ethernet by default.

When you type make h2200_config it won't be enabled.
It will compile simple u-boot with nothing enabled but
console and serial.

When you type make h2200_usbeth_config then setup
will define CONFIG_H2200_USBETH and compile h2200
with usbeth support.

So by default (with noting defined) it will compile simple
h2200 support.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] h2200: Add support for iPAQ h2200 palmtop

2012-09-26 Thread Łukasz Dałek

On 27.09.2012 01:32, Marek Vasut wrote:

Dear Łukasz Dałek,


On 26.09.2012 18:13, Marek Vasut wrote:

Dear Łukasz Dałek,


On 26.09.2012 17:29, Marek Vasut wrote:

Dear Lukasz Dalek,


Basic support of HP iPAQ h2200 palmtop. Support includes also USB
ethernet gadget.

Two minor nits ... can you extend the patch description?


Signed-off-by: Lukasz Dalekluk0...@gmail.com
[...]
+h2200arm pxa
+h2200_usbeth arm pxa h2200

   -

Can you not enable USB ethernet by default?

[...]

I don't understand.

make h2200_config creates config without usb ethernet
make h2200_usbeth_config creates config with usb ethernet

Why not just make config with usb ethernet then?

Sorry but I don't understand. You've asked me that can I not
enable USB ethernet by default.

I think you misunderstood. I was never against enabling the USB ethernet. I was
against enabling it before the USB ethernet code is in, so it won't break
bisectability.

If I did really say so, I'm sorry for the confusion.

So you want from me to split h2200 patches? I mean to prepare 2 patches:
1st one only adding support for device and 2nd one adding support for
ethernet?

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb.h: Add udc_disconnect prototype to usb.h

2012-09-26 Thread Łukasz Dałek

On 26.09.2012 17:31, Marek Vasut wrote:

Dear Lukasz Dalek,


PXA25x gadget implements common function usb_disconnect().
This patch adds this function prototype into usb.h for boards using it.

[...]


+/*
+ * This isn't host
+ */

The comment doesn't need to be multiline. It'd be cool if it was meaningful ...
like pxa25x can only do gadget mode, thus the following ... etc. Otherwise,
we're basically there.


Ok



Can you repost the whole patchset please?


Whole? Including ethernet driver, pxa cpu detection etc...?
If so, I'll resend them.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] h2200: Add support for iPAQ h2200 palmtop

2012-09-26 Thread Łukasz Dałek

On 27.09.2012 01:58, Marek Vasut wrote:

Dear Łukasz Dałek,


On 27.09.2012 01:32, Marek Vasut wrote:

Dear Łukasz Dałek,


On 26.09.2012 18:13, Marek Vasut wrote:

Dear Łukasz Dałek,


On 26.09.2012 17:29, Marek Vasut wrote:

Dear Lukasz Dalek,


Basic support of HP iPAQ h2200 palmtop. Support includes also USB
ethernet gadget.

Two minor nits ... can you extend the patch description?


Signed-off-by: Lukasz Dalekluk0...@gmail.com
[...]
+h2200arm pxa
+h2200_usbeth arm pxa h2200

-

Can you not enable USB ethernet by default?

[...]

I don't understand.

make h2200_config creates config without usb ethernet
make h2200_usbeth_config creates config with usb ethernet

Why not just make config with usb ethernet then?

Sorry but I don't understand. You've asked me that can I not
enable USB ethernet by default.

I think you misunderstood. I was never against enabling the USB ethernet.
I was against enabling it before the USB ethernet code is in, so it
won't break bisectability.

If I did really say so, I'm sorry for the confusion.

So you want from me to split h2200 patches? I mean to prepare 2 patches:
1st one only adding support for device and 2nd one adding support for
ethernet?

Oh, that would work nicely, good idea.


Ok, I will prepare them. But not sooner than tommorow.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb.h: Add udc_disconnect prototype to usb.h

2012-09-26 Thread Łukasz Dałek

On 27.09.2012 01:58, Marek Vasut wrote:

Dear Łukasz Dałek,


On 26.09.2012 17:31, Marek Vasut wrote:

Dear Lukasz Dalek,


PXA25x gadget implements common function usb_disconnect().
This patch adds this function prototype into usb.h for boards using it.

[...]


+/*
+ * This isn't host
+ */

The comment doesn't need to be multiline. It'd be cool if it was
meaningful ... like pxa25x can only do gadget mode, thus the following
... etc. Otherwise, we're basically there.

Ok


Can you repost the whole patchset please?

Whole? Including ethernet driver, pxa cpu detection etc...?
If so, I'll resend them.

Yes, in correct order please. We're almost there now.

btw. do you want to hack further on uboot? Maybe some PXA improvements cleanups
etc?


Yes, but before I want to complete what I've started with h2200...

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] h2200: Add support for iPAQ h2200 palmtop

2012-09-26 Thread Łukasz Dałek

On 27.09.2012 02:07, Marek Vasut wrote:

Dear Łukasz Dałek,


On 27.09.2012 01:58, Marek Vasut wrote:

Dear Łukasz Dałek,


On 27.09.2012 01:32, Marek Vasut wrote:

Dear Łukasz Dałek,


On 26.09.2012 18:13, Marek Vasut wrote:

Dear Łukasz Dałek,


On 26.09.2012 17:29, Marek Vasut wrote:

Dear Lukasz Dalek,


Basic support of HP iPAQ h2200 palmtop. Support includes also USB
ethernet gadget.

Two minor nits ... can you extend the patch description?


Signed-off-by: Lukasz Dalekluk0...@gmail.com
[...]
+h2200arm pxa
+h2200_usbeth arm pxa h2200

 -

Can you not enable USB ethernet by default?

[...]

I don't understand.

make h2200_config creates config without usb ethernet
make h2200_usbeth_config creates config with usb ethernet

Why not just make config with usb ethernet then?

Sorry but I don't understand. You've asked me that can I not
enable USB ethernet by default.

I think you misunderstood. I was never against enabling the USB
ethernet. I was against enabling it before the USB ethernet code is
in, so it won't break bisectability.

If I did really say so, I'm sorry for the confusion.

So you want from me to split h2200 patches? I mean to prepare 2 patches:
1st one only adding support for device and 2nd one adding support for
ethernet?

Oh, that would work nicely, good idea.

Ok, I will prepare them. But not sooner than tommorow.

Take your time ... PXA won't run anywhere anyway. btw. you're polish? I might
actually find you some old PXA device.


Yes, I'm polish. I've one: pxa25x.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb.h: Add udc_disconnect prototype to usb.h

2012-09-26 Thread Łukasz Dałek

On 27.09.2012 02:06, Marek Vasut wrote:

Dear Łukasz Dałek,


On 27.09.2012 01:58, Marek Vasut wrote:

Dear Łukasz Dałek,


On 26.09.2012 17:31, Marek Vasut wrote:

Dear Lukasz Dalek,


PXA25x gadget implements common function usb_disconnect().
This patch adds this function prototype into usb.h for boards using
it.

[...]


+/*
+ * This isn't host
+ */

The comment doesn't need to be multiline. It'd be cool if it was
meaningful ... like pxa25x can only do gadget mode, thus the following
... etc. Otherwise, we're basically there.

Ok


Can you repost the whole patchset please?

Whole? Including ethernet driver, pxa cpu detection etc...?
If so, I'll resend them.

Yes, in correct order please. We're almost there now.

btw. do you want to hack further on uboot? Maybe some PXA improvements
cleanups etc?

Yes, but before I want to complete what I've started with h2200...

You're basically there!


What do you mean saying that I am there?



btw sorry if I sound a bit crazy, I've been pretty loaded recently so I might
have forgotten what I have told you a few days ago ...


No problem.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb.h: Add udc_disconnect prototype to usb.h

2012-09-26 Thread Łukasz Dałek

On 27.09.2012 02:30, Marek Vasut wrote:

Dear Łukasz Dałek,


On 27.09.2012 02:06, Marek Vasut wrote:

Dear Łukasz Dałek,


On 27.09.2012 01:58, Marek Vasut wrote:

Dear Łukasz Dałek,


On 26.09.2012 17:31, Marek Vasut wrote:

Dear Lukasz Dalek,


PXA25x gadget implements common function usb_disconnect().
This patch adds this function prototype into usb.h for boards using
it.

[...]


+/*
+ * This isn't host
+ */

The comment doesn't need to be multiline. It'd be cool if it was
meaningful ... like pxa25x can only do gadget mode, thus the
following ... etc. Otherwise, we're basically there.

Ok


Can you repost the whole patchset please?

Whole? Including ethernet driver, pxa cpu detection etc...?
If so, I'll resend them.

Yes, in correct order please. We're almost there now.

btw. do you want to hack further on uboot? Maybe some PXA improvements
cleanups etc?

Yes, but before I want to complete what I've started with h2200...

You're basically there!

What do you mean saying that I am there?

That you've walked most of the journey already, there's only the one small final
step for you to do ...


Yes, indeed.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] h2200: Add support for iPAQ h2200 palmtop

2012-09-26 Thread Łukasz Dałek

On 27.09.2012 02:31, Marek Vasut wrote:

Dear Łukasz Dałek,


On 27.09.2012 02:07, Marek Vasut wrote:

Dear Łukasz Dałek,


On 27.09.2012 01:58, Marek Vasut wrote:

Dear Łukasz Dałek,


On 27.09.2012 01:32, Marek Vasut wrote:

Dear Łukasz Dałek,


On 26.09.2012 18:13, Marek Vasut wrote:

Dear Łukasz Dałek,


On 26.09.2012 17:29, Marek Vasut wrote:

Dear Lukasz Dalek,


Basic support of HP iPAQ h2200 palmtop. Support includes also
USB ethernet gadget.

Two minor nits ... can you extend the patch description?


Signed-off-by: Lukasz Dalekluk0...@gmail.com
[...]
+h2200arm pxa
+h2200_usbeth arm pxa h2200

  -

Can you not enable USB ethernet by default?

[...]

I don't understand.

make h2200_config creates config without usb ethernet
make h2200_usbeth_config creates config with usb ethernet

Why not just make config with usb ethernet then?

Sorry but I don't understand. You've asked me that can I not
enable USB ethernet by default.

I think you misunderstood. I was never against enabling the USB
ethernet. I was against enabling it before the USB ethernet code is
in, so it won't break bisectability.

If I did really say so, I'm sorry for the confusion.

So you want from me to split h2200 patches? I mean to prepare 2
patches: 1st one only adding support for device and 2nd one adding
support for ethernet?

Oh, that would work nicely, good idea.

Ok, I will prepare them. But not sooner than tommorow.

Take your time ... PXA won't run anywhere anyway. btw. you're polish? I
might actually find you some old PXA device.

Yes, I'm polish. I've one: pxa25x.

I have a pile of PXA boards here ... I think you can make do with the pxa255 for
now and I'll see if I can find something for you.


Ok, so for now we will focus on pxa255 :-)

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/6] pxa25x: Add support for USB ethernet gadget

2012-09-23 Thread Łukasz Dałek

On 23.09.2012 17:44, Marek Vasut wrote:

Dear Lukasz Dalek,


Add to pxa25x based devices support for USB ethernet gadget. This is a
port of pxa25x UDC driver from Linux kernel.

Signed-off-by: Lukasz Dalekluk0...@gmail.com
---
  drivers/usb/gadget/Makefile |1 +
  drivers/usb/gadget/pxa25x_udc.c | 2059
+++ drivers/usb/gadget/pxa25x_udc.h |
162 +++
  3 files changed,  insertions(+), 0 deletions(-)
  create mode 100644 drivers/usb/gadget/pxa25x_udc.c
  create mode 100644 drivers/usb/gadget/pxa25x_udc.h

[...]

So what's the change here? Or is it a repost?

Best regards,
Marek Vasut


Everything was fine except DEBUG_NOISY defintions. I fixed them and
I have resend patch.

Can I ask what about patches 3,4,5,6?

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/6] pxa25x: Add support for USB ethernet gadget

2012-09-23 Thread Łukasz Dałek

On 23.09.2012 20:24, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 17:44, Marek Vasut wrote:

Dear Lukasz Dalek,


Add to pxa25x based devices support for USB ethernet gadget. This is a
port of pxa25x UDC driver from Linux kernel.

Signed-off-by: Lukasz Dalekluk0...@gmail.com
---

   drivers/usb/gadget/Makefile |1 +
   drivers/usb/gadget/pxa25x_udc.c | 2059

+++ drivers/usb/gadget/pxa25x_udc.h
| 162 +++

   3 files changed,  insertions(+), 0 deletions(-)
   create mode 100644 drivers/usb/gadget/pxa25x_udc.c
   create mode 100644 drivers/usb/gadget/pxa25x_udc.h

[...]

So what's the change here? Or is it a repost?

Best regards,
Marek Vasut

Everything was fine except DEBUG_NOISY defintions. I fixed them and
I have resend patch.

http://www.denx.de/wiki/U-Boot/Patches did you read this? Worth reading so I
don't have to repeat myself ;-)

Yes.




Can I ask what about patches 3,4,5,6?

I think they're fine ... did you do any changes to them ?



If they are ok then my job is done :-)

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/6] h2200: Add support for iPAQ h2200 palmtop

2012-09-23 Thread Łukasz Dałek

On 23.09.2012 17:43, Marek Vasut wrote:

+   gd-ram_size = CONFIG_SYS_SDRAM_SIZE;
+   return 0;
+}
diff --git a/board/h2200/h2200.h b/board/h2200/h2200.h
new file mode 100644

Do you need this file at all? Can the udc_disconnect() not be put somewhere into
usb.h ?


Can I just move this declaration into h2200.c?

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/6] h2200: Add support for iPAQ h2200 palmtop

2012-09-23 Thread Łukasz Dałek

On 23.09.2012 21:31, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 17:43, Marek Vasut wrote:

+   gd-ram_size = CONFIG_SYS_SDRAM_SIZE;
+   return 0;
+}
diff --git a/board/h2200/h2200.h b/board/h2200/h2200.h
new file mode 100644

Do you need this file at all? Can the udc_disconnect() not be put
somewhere into usb.h ?

Can I just move this declaration into h2200.c?

extern ... ? No, checkpatch will scream and extern is prohibited for a good
reason.


So where should I put it?

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/6] pxa25x: Add support for USB ethernet gadget

2012-09-23 Thread Łukasz Dałek

On 23.09.2012 21:32, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 20:24, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 17:44, Marek Vasut wrote:

Dear Lukasz Dalek,


Add to pxa25x based devices support for USB ethernet gadget. This is a
port of pxa25x UDC driver from Linux kernel.

Signed-off-by: Lukasz Dalekluk0...@gmail.com
---

drivers/usb/gadget/Makefile |1 +
drivers/usb/gadget/pxa25x_udc.c | 2059

+++
drivers/usb/gadget/pxa25x_udc.h

| 162 +++
|
3 files changed,  insertions(+), 0 deletions(-)
create mode 100644 drivers/usb/gadget/pxa25x_udc.c
create mode 100644 drivers/usb/gadget/pxa25x_udc.h

[...]

So what's the change here? Or is it a repost?

Best regards,
Marek Vasut

Everything was fine except DEBUG_NOISY defintions. I fixed them and
I have resend patch.

http://www.denx.de/wiki/U-Boot/Patches did you read this? Worth reading
so I don't have to repeat myself ;-)

Yes.


Can I ask what about patches 3,4,5,6?

I think they're fine ... did you do any changes to them ?

If they are ok then my job is done :-)

You did not answer my question ... and no, your job isn't done ... once your
code is mainline, you're the maintainer, every change to common code will also
be your responsibility to at least review/test on your hardware etc ... you know
the drill.

Even though PXA is semi-dead, so I don't expect much happening there.


No, since last email I didn't change anything.

But for now you have said that they're fine, so all I have to wait. Am I 
wrong?


Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/6] h2200: Add support for iPAQ h2200 palmtop

2012-09-23 Thread Łukasz Dałek

On 23.09.2012 22:05, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 21:31, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 17:43, Marek Vasut wrote:

+   gd-ram_size = CONFIG_SYS_SDRAM_SIZE;
+   return 0;
+}
diff --git a/board/h2200/h2200.h b/board/h2200/h2200.h
new file mode 100644

Do you need this file at all? Can the udc_disconnect() not be put
somewhere into usb.h ?

Can I just move this declaration into h2200.c?

extern ... ? No, checkpatch will scream and extern is prohibited for a
good reason.

So where should I put it?

Isn't it a general call? some include/usb.h ?


For old layer maybe it is.

I'm not sure but include/usb.h is for device implementing usb host but
pxa can only be device. Including usb.h generate error.

I'm going to add sd card support and other functions, maybe leaving it
would be better idea?

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/6] h2200: Add support for iPAQ h2200 palmtop

2012-09-23 Thread Łukasz Dałek

On 23.09.2012 22:52, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 22:05, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 21:31, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 17:43, Marek Vasut wrote:

+   gd-ram_size = CONFIG_SYS_SDRAM_SIZE;
+   return 0;
+}
diff --git a/board/h2200/h2200.h b/board/h2200/h2200.h
new file mode 100644

Do you need this file at all? Can the udc_disconnect() not be put
somewhere into usb.h ?

Can I just move this declaration into h2200.c?

extern ... ? No, checkpatch will scream and extern is prohibited for a
good reason.

So where should I put it?

Isn't it a general call? some include/usb.h ?

For old layer maybe it is.

I'm not sure but include/usb.h is for device implementing usb host but
pxa can only be device.

PXA can be both, actually u-boot is mostly about host. Just put it there.


Including usb.h generate error.

I'm going to add sd card support and other functions, maybe leaving it
would be better idea?

Why do you think usb.h is not a good place ?

Because:
#if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \
defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \
defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \
defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \
defined(CONFIG_USB_OMAP3) || defined(CONFIG_USB_DA8XX) || \
defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X)
...
#else
#error USB Lowlevel not defined
#endif

All of these definitions are usb host implementation (maybe OTG too) but pxa
cannot be host.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/6] h2200: Add support for iPAQ h2200 palmtop

2012-09-23 Thread Łukasz Dałek

On 23.09.2012 23:04, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 22:52, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 22:05, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 21:31, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 17:43, Marek Vasut wrote:

+   gd-ram_size = CONFIG_SYS_SDRAM_SIZE;
+   return 0;
+}
diff --git a/board/h2200/h2200.h b/board/h2200/h2200.h
new file mode 100644

Do you need this file at all? Can the udc_disconnect() not be put
somewhere into usb.h ?

Can I just move this declaration into h2200.c?

extern ... ? No, checkpatch will scream and extern is prohibited for
a good reason.

So where should I put it?

Isn't it a general call? some include/usb.h ?

For old layer maybe it is.

I'm not sure but include/usb.h is for device implementing usb host but
pxa can only be device.

PXA can be both, actually u-boot is mostly about host. Just put it there.


Including usb.h generate error.

I'm going to add sd card support and other functions, maybe leaving it
would be better idea?

Why do you think usb.h is not a good place ?

Because:
#if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \
  defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \
  defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \
  defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \
  defined(CONFIG_USB_OMAP3) || defined(CONFIG_USB_DA8XX) || \
  defined(CONFIG_USB_BLACKFIN) || defined(CONFIG_USB_AM35X)
...
#else
#error USB Lowlevel not defined
#endif

All of these definitions are usb host implementation (maybe OTG too) but
pxa cannot be host.

PXA2xx is OHCI host with one OTG port.


From pxa255 documentation:
The UDC supports 16 endpoints and can operate half-duplex at a rate of 
12 Mbps (as a slave only,

not as a host or hub controller).


what about include/usb/pxa27x_udc.h ... btw can't pxa27x and pxa25x UDC use the
same driver?


pxa27x_udc driver is using older layer which doesn't work with usb 
ethernet driver.


Btw. pxa27x can be host, pxa25x can't.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/6] h2200: Add support for iPAQ h2200 palmtop

2012-09-23 Thread Łukasz Dałek

On 23.09.2012 23:31, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 23:04, Marek Vasut wrote:


PXA2xx is OHCI host with one OTG port.

   From pxa255 documentation:
The UDC supports 16 endpoints and can operate half-duplex at a rate of
12 Mbps (as a slave only,
not as a host or hub controller).


what about include/usb/pxa27x_udc.h ... btw can't pxa27x and pxa25x UDC
use the same driver?

pxa27x_udc driver is using older layer which doesn't work with usb
ethernet driver.

Btw. pxa27x can be host, pxa25x can't.

Can you update the new gadget driver to be compatible with pxa27x then ?

I don't have any board with pxa27x processor. And I'm quite sure that
differences between pxa25x and pxa27x usb are too big. Even in
Linux kernel are two separate drivers for 25x and 27x chips.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/6] h2200: Add support for iPAQ h2200 palmtop

2012-09-23 Thread Łukasz Dałek

On 24.09.2012 01:05, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 23:31, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 23:04, Marek Vasut wrote:

PXA2xx is OHCI host with one OTG port.


 From pxa255 documentation:
The UDC supports 16 endpoints and can operate half-duplex at a rate of
12 Mbps (as a slave only,
not as a host or hub controller).


what about include/usb/pxa27x_udc.h ... btw can't pxa27x and pxa25x UDC
use the same driver?

pxa27x_udc driver is using older layer which doesn't work with usb
ethernet driver.

Btw. pxa27x can be host, pxa25x can't.

Can you update the new gadget driver to be compatible with pxa27x then ?

I don't have any board with pxa27x processor. And I'm quite sure that
differences between pxa25x and pxa27x usb are too big. Even in
Linux kernel are two separate drivers for 25x and 27x chips.

Isn't the 25x only a subset of the 27x ?


Maybe it is.

You've asked me if I could update driver to compatible with pxa27x and my
answer is no. Maybe someone with pxa27x chip could.

I will left that h2200.h header. I'm sure that it will be helpful some day.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/6] h2200: Add support for iPAQ h2200 palmtop

2012-09-23 Thread Łukasz Dałek

On 24.09.2012 01:25, Marek Vasut wrote:

Dear Łukasz Dałek,


On 24.09.2012 01:05, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 23:31, Marek Vasut wrote:

Dear Łukasz Dałek,


On 23.09.2012 23:04, Marek Vasut wrote:

PXA2xx is OHCI host with one OTG port.


   From pxa255 documentation:
The UDC supports 16 endpoints and can operate half-duplex at a rate
of 12 Mbps (as a slave only,
not as a host or hub controller).


what about include/usb/pxa27x_udc.h ... btw can't pxa27x and pxa25x
UDC use the same driver?

pxa27x_udc driver is using older layer which doesn't work with usb
ethernet driver.

Btw. pxa27x can be host, pxa25x can't.

Can you update the new gadget driver to be compatible with pxa27x then
?

I don't have any board with pxa27x processor. And I'm quite sure that
differences between pxa25x and pxa27x usb are too big. Even in
Linux kernel are two separate drivers for 25x and 27x chips.

Isn't the 25x only a subset of the 27x ?

Maybe it is.

You've asked me if I could update driver to compatible with pxa27x and my
answer is no. Maybe someone with pxa27x chip could.

I can test it. It'd be good to have only one driver and get rid of the old one
seems to be the way to go.


Does this driver work with usb ethernet gadget?




I will left that h2200.h header. I'm sure that it will be helpful some day.

For what exactly? Just put it into include/usb.h .

I can't. It doesn't compile because of #error at 170 line.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200

2012-09-22 Thread Łukasz Dałek

On 19.09.2012 23:02, Marek Vasut wrote:

and at the offset
+ * 0x40 ascii characters 'ECEC', secondly 1st stage
+ * loads code from flash into SDRAM at address 0xa004
+ * so all instructions which reinitializes memory
+ * controller have to be disabled.
+ */
+
+static inline void writelrb(uint32_t val, uint32_t addr)

Replace this with clrsetbits_le32()


I've copied writelrb and pxa2xx_dram_init from pxa2xx.c
and I think there is a reason why it's done that way and not by
clrsetbits_le32. But if you insist I can replace all calls to writelrb
by clrsetbits.


+{
+   writel(val, addr);
+   asm volatile( : : : memory);
+   readl(addr);
+   asm volatile( : : : memory);
+}
+
+static void h2200_pxa2xx_dram_init(void)

Why do you duplicate it ?!

[...]


Because code in pxa2xx.c disable and then re-enable memory.
And u-boot is executed from memory (1st stage bootloder
copied it there).


+
+# define CONFIG_USB_ETHER  1
+# define CONFIG_USBNET_DEV_ADDRde:ad:be:ef:00:01
+# define CONFIG_USBNET_HOST_ADDR   de:ad:be:ef:00:02
Definitelly not, any mac address setting should not be present, Joe ?


So tell me how should I specify mac addresses? By EXTRA_ENV_SETTINGS?

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200

2012-09-22 Thread Łukasz Dałek

On 22.09.2012 19:04, Marek Vasut wrote:

Dear Łukasz Dałek,


On 19.09.2012 23:02, Marek Vasut wrote:

and at the offset
+ * 0x40 ascii characters 'ECEC', secondly 1st stage
+ * loads code from flash into SDRAM at address 0xa004
+ * so all instructions which reinitializes memory
+ * controller have to be disabled.
+ */
+
+static inline void writelrb(uint32_t val, uint32_t addr)

Replace this with clrsetbits_le32()

I've copied writelrb and pxa2xx_dram_init from pxa2xx.c
and I think there is a reason why it's done that way and not by
clrsetbits_le32. But if you insist I can replace all calls to writelrb
by clrsetbits.

And can you elaborate on the reason please?

(hint: clrsetbits() wasn't there by the time)


I don't know what was the reason. I didn't change becuse I didn't
want to break it.


+{
+   writel(val, addr);
+   asm volatile( : : : memory);
+   readl(addr);
+   asm volatile( : : : memory);
+}
+
+static void h2200_pxa2xx_dram_init(void)

Why do you duplicate it ?!

[...]

Because code in pxa2xx.c disable and then re-enable memory.
And u-boot is executed from memory (1st stage bootloder
copied it there).

So don't reinit the memory at all, just skip this whole part.


1st stage loader doesn't init everything (for example MSC).


+
+# define CONFIG_USB_ETHER  1
+# define CONFIG_USBNET_DEV_ADDRde:ad:be:ef:00:01
+# define CONFIG_USBNET_HOST_ADDR   de:ad:be:ef:00:02
Definitelly not, any mac address setting should not be present, Joe ?

So tell me how should I specify mac addresses? By EXTRA_ENV_SETTINGS?

Joe explained it, your adapter doesn't carry it's own mac?


No.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200

2012-09-22 Thread Łukasz Dałek

On 22.09.2012 20:00, Marek Vasut wrote:

Dear Łukasz Dałek,


On 22.09.2012 19:04, Marek Vasut wrote:

Dear Łukasz Dałek,


On 19.09.2012 23:02, Marek Vasut wrote:

and at the offset
+ * 0x40 ascii characters 'ECEC', secondly 1st stage
+ * loads code from flash into SDRAM at address 0xa004
+ * so all instructions which reinitializes memory
+ * controller have to be disabled.
+ */
+
+static inline void writelrb(uint32_t val, uint32_t addr)

Replace this with clrsetbits_le32()

I've copied writelrb and pxa2xx_dram_init from pxa2xx.c
and I think there is a reason why it's done that way and not by
clrsetbits_le32. But if you insist I can replace all calls to writelrb
by clrsetbits.

And can you elaborate on the reason please?

(hint: clrsetbits() wasn't there by the time)

I don't know what was the reason. I didn't change becuse I didn't
want to break it.

If you have time, replace it with clrsetbits() please ... in the original file.


In arch/arm/cpu/pxa/pxa2xx.c?


+{
+   writel(val, addr);
+   asm volatile( : : : memory);
+   readl(addr);
+   asm volatile( : : : memory);
+}
+
+static void h2200_pxa2xx_dram_init(void)

Why do you duplicate it ?!

[...]

Because code in pxa2xx.c disable and then re-enable memory.
And u-boot is executed from memory (1st stage bootloder
copied it there).

So don't reinit the memory at all, just skip this whole part.

1st stage loader doesn't init everything (for example MSC).

So I checked ... every board calls the dram init on it's own in dram_init() ...
so just don't do that.


Do what? Don't call modified pxa2xx_dram_init?




+
+# define CONFIG_USB_ETHER  1
+# define CONFIG_USBNET_DEV_ADDRde:ad:be:ef:00:01
+# define CONFIG_USBNET_HOST_ADDR   de:ad:be:ef:00:02
Definitelly not, any mac address setting should not be present, Joe ?

So tell me how should I specify mac addresses? By EXTRA_ENV_SETTINGS?

Joe explained it, your adapter doesn't carry it's own mac?

No.

Then leave it in ?


leave CONFIG_USBNET_DEV_ADDR...?

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200

2012-09-22 Thread Łukasz Dałek

On 22.09.2012 20:21, Marek Vasut wrote:

+{
+   writel(val, addr);
+   asm volatile( : : : memory);
+   readl(addr);
+   asm volatile( : : : memory);
+}
+
+static void h2200_pxa2xx_dram_init(void)

Why do you duplicate it ?!

[...]

Because code in pxa2xx.c disable and then re-enable memory.
And u-boot is executed from memory (1st stage bootloder
copied it there).

So don't reinit the memory at all, just skip this whole part.

1st stage loader doesn't init everything (for example MSC).

So I checked ... every board calls the dram init on it's own in
dram_init() ... so just don't do that.

Do what? Don't call modified pxa2xx_dram_init?

What exactly do you need to do ? What registers do you need to set ? How come
the bootloader kick dram in, but won't configure MSC ?

Split out the MSC config and memory config maybe ?


Ok, I will rewrite that.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200

2012-09-22 Thread Łukasz Dałek

On 22.09.2012 20:37, Marek Vasut wrote:

Dear Łukasz Dałek,


On 22.09.2012 20:21, Marek Vasut wrote:

+{
+   writel(val, addr);
+   asm volatile( : : : memory);
+   readl(addr);
+   asm volatile( : : : memory);
+}
+
+static void h2200_pxa2xx_dram_init(void)

Why do you duplicate it ?!

[...]

Because code in pxa2xx.c disable and then re-enable memory.
And u-boot is executed from memory (1st stage bootloder
copied it there).

So don't reinit the memory at all, just skip this whole part.

1st stage loader doesn't init everything (for example MSC).

So I checked ... every board calls the dram init on it's own in
dram_init() ... so just don't do that.

Do what? Don't call modified pxa2xx_dram_init?

What exactly do you need to do ? What registers do you need to set ? How
come the bootloader kick dram in, but won't configure MSC ?

Split out the MSC config and memory config maybe ?

Ok, I will rewrite that.

Just pull it out, but make sure you don't break the other boards ...


I was only thinking about my board...

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/6] iPAQ h2200 support

2012-09-19 Thread Łukasz Dałek
This is set of patches adding support for iPAQ h2200 device

Ad. [PATCH 1/6] h2200: Add support for iPAQ h2200
I've added device id to the mach-types.h file. But I'm pretty
sure this is the bad way. The id I took from
http://www.arm.linux.org.uk/developer/machines/list.php?id=341

Device's 1st stage bootloader requires from 2nd stage loader
specific header which I've defined in file h2200-header.S.
For now it is build to h2200-header.bin which has to be concatenated
with u-boot.bin (cat h2200-header.bin u-boot.bin  u-boot.rdy).
I don't know how I can do this another way.

One more, can I add to device folder program which generates packed
binary with header which device's rescue bootloader can flash
into memory?

Ad. [PATCH 3/6] pxa: Add some stuff to examine cpu model and rev
This patch shuld be already in pxa tree but it's not. Maybe I
overlooked or sth. If so I'm sorry for sending it again.

Łukasz Dałek (6):
  h2200: Add support for iPAQ h2200
  pxa25x: Add USB Ethernet driver
  pxa: Add some stuff to examine cpu model and rev
  usbether: Fixed bug when using with PXA25X chips
  usbether: Define CONFIG_USB_ETH_{CDC,SUBSET}
  usbether: Removed DEV_CONFIG_{CDC,SUBSET}

 arch/arm/cpu/pxa/cpuinfo.c  |   11 +-
 arch/arm/include/asm/arch-pxa/pxa.h |   13 +
 arch/arm/include/asm/mach-types.h   |1 +
 board/h2200/Makefile|   51 +
 board/h2200/h2200-header.S  |   27 +
 board/h2200/h2200.c |  197 
 board/h2200/h2200.h |   28 +
 boards.cfg  |2 +
 drivers/usb/gadget/Makefile |1 +
 drivers/usb/gadget/ether.c  |   69 +-
 drivers/usb/gadget/pxa25x_udc.c | 2059 +++
 drivers/usb/gadget/pxa25x_udc.h |  162 +++
 include/configs/h2200.h |  168 +++
 13 files changed, 2757 insertions(+), 32 deletions(-)
 create mode 100644 board/h2200/Makefile
 create mode 100644 board/h2200/h2200-header.S
 create mode 100644 board/h2200/h2200.c
 create mode 100644 board/h2200/h2200.h
 create mode 100644 drivers/usb/gadget/pxa25x_udc.c
 create mode 100644 drivers/usb/gadget/pxa25x_udc.h
 create mode 100644 include/configs/h2200.h

-- 
1.7.8.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200

2012-09-19 Thread Łukasz Dałek
Signed-off-by: Łukasz Dałek luk0...@gmail.com
---
 arch/arm/include/asm/mach-types.h |1 +
 board/h2200/Makefile  |   51 ++
 board/h2200/h2200-header.S|   27 +
 board/h2200/h2200.c   |  197 +
 board/h2200/h2200.h   |   28 +
 boards.cfg|2 +
 include/configs/h2200.h   |  168 +++
 7 files changed, 474 insertions(+), 0 deletions(-)
 create mode 100644 board/h2200/Makefile
 create mode 100644 board/h2200/h2200-header.S
 create mode 100644 board/h2200/h2200.c
 create mode 100644 board/h2200/h2200.h
 create mode 100644 include/configs/h2200.h

diff --git a/arch/arm/include/asm/mach-types.h 
b/arch/arm/include/asm/mach-types.h
index 2d5c3bc..b03f385 100644
--- a/arch/arm/include/asm/mach-types.h
+++ b/arch/arm/include/asm/mach-types.h
@@ -74,6 +74,7 @@ extern unsigned int __machine_arch_type;
 #define MACH_TYPE_IXDP2801 300
 #define MACH_TYPE_IQ31244  327
 #define MACH_TYPE_BAST 331
+#define MACH_TYPE_H2200341
 #define MACH_TYPE_H1940347
 #define MACH_TYPE_ENP2611  356
 #define MACH_TYPE_S3C2440  362
diff --git a/board/h2200/Makefile b/board/h2200/Makefile
new file mode 100644
index 000..39da114
--- /dev/null
+++ b/board/h2200/Makefile
@@ -0,0 +1,51 @@
+#
+# h2200 Support
+#
+# Copyright (C) 2012 Łukasz Dałek luk0...@gmail.com
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := h2200.o
+
+SRCS   := $(COBJS:.o=.c) h2200-header.S
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+ALL: $(LIB) h2200-header.bin
+
+h2200-header.o: h2200-header.S
+   $(CC) $(CFLAGS) -c -o $@ $
+
+h2200-header.bin: h2200-header.o
+   $(OBJCOPY) -O binary $ $@
+
+all: $(LIB) h2200-header.bin
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/h2200/h2200-header.S b/board/h2200/h2200-header.S
new file mode 100644
index 000..146795f
--- /dev/null
+++ b/board/h2200/h2200-header.S
@@ -0,0 +1,27 @@
+/*
+ * iPAQ h2200 header
+ *
+ * Copyright (C) 2012 Łukasz Dałek luk0...@gmail.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+   .word 0xea0003fe /* b 0x1000 */
+
+   .org 0x40
+   .ascii ECEC
+
+   .org 0x1000 - 1
+   .byte 0x0
diff --git a/board/h2200/h2200.c b/board/h2200/h2200.c
new file mode 100644
index 000..d31c67f
--- /dev/null
+++ b/board/h2200/h2200.c
@@ -0,0 +1,197 @@
+/*
+ * iPAQ h2200 board configuration
+ *
+ * Copyright (C) 2012 Łukasz Dałek luk0...@gmail.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330

[U-Boot] [PATCH 3/6] pxa: Add some stuff to examine cpu model and rev

2012-09-19 Thread Łukasz Dałek
Signed-off-by: Łukasz Dałek luk0...@gmail.com
---
 arch/arm/cpu/pxa/cpuinfo.c  |   11 +--
 arch/arm/include/asm/arch-pxa/pxa.h |   13 +
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/pxa/cpuinfo.c b/arch/arm/cpu/pxa/cpuinfo.c
index f1cdd40..bab6340 100644
--- a/arch/arm/cpu/pxa/cpuinfo.c
+++ b/arch/arm/cpu/pxa/cpuinfo.c
@@ -24,9 +24,11 @@
 #include errno.h
 #include linux/compiler.h
 
-#defineCPU_MASK_PXA_REVID  0x00f
+#defineCPU_MASK_PXA_PRODID 0x03f0
+#defineCPU_MASK_PXA_REVID  0x000f
+
+#defineCPU_MASK_PRODREV(CPU_MASK_PXA_PRODID | 
CPU_MASK_PXA_REVID)
 
-#defineCPU_MASK_PXA_PRODID 0x3f0
 #defineCPU_VALUE_PXA25X0x100
 #defineCPU_VALUE_PXA27X0x110
 
@@ -51,6 +53,11 @@ int cpu_is_pxa27x(void)
return id == CPU_VALUE_PXA27X;
 }
 
+uint32_t pxa_get_cpu_revision(void)
+{
+   return pxa_get_cpuid()  CPU_MASK_PRODREV;
+}
+
 #ifdef CONFIG_DISPLAY_CPUINFO
 static const char *pxa25x_get_revision(void)
 {
diff --git a/arch/arm/include/asm/arch-pxa/pxa.h 
b/arch/arm/include/asm/arch-pxa/pxa.h
index 49c6552..b67d8f2 100644
--- a/arch/arm/include/asm/arch-pxa/pxa.h
+++ b/arch/arm/include/asm/arch-pxa/pxa.h
@@ -22,8 +22,21 @@
 #ifndef__PXA_H__
 #define__PXA_H__
 
+#define PXA255_A0  0x0106
+#define PXA250_C0  0x0105
+#define PXA250_B2  0x0104
+#define PXA250_B1  0x0103
+#define PXA250_B0  0x0102
+#define PXA250_A1  0x0101
+#define PXA250_A0  0x0100
+#define PXA210_C0  0x0125
+#define PXA210_B2  0x0124
+#define PXA210_B1  0x0123
+#define PXA210_B0  0x0122
+
 int cpu_is_pxa25x(void);
 int cpu_is_pxa27x(void);
+uint32_t pxa_get_cpu_revision(void);
 void pxa2xx_dram_init(void);
 
 #endif /* __PXA_H__ */
-- 
1.7.8.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 4/6] usbether: Fixed bug when using with PXA25X chips

2012-09-19 Thread Łukasz Dałek
PXA25X chips don't support alternate settings so driver uses non-CDC
driver.
But only code defined between DEV_CONFIG_CDC signals that network is up.
This patch is fixing this bug by signaling that network is up after USB
SET_INTERFACE request.

Signed-off-by: Łukasz Dałek luk0...@gmail.com
---
 drivers/usb/gadget/ether.c |   17 -
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index d975fb6..9ce2c17 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -44,7 +44,12 @@ extern struct platform_data brd;
 
 unsigned packet_received, packet_sent;
 
-#define DEV_CONFIG_CDC 1
+#ifdef CONFIG_USB_GADGET_PXA2XX
+# undef DEV_CONFIG_CDC
+# define DEV_CONFIG_SUBSET 1
+#else
+# define DEV_CONFIG_CDC1
+#endif
 #define GFP_ATOMIC ((gfp_t) 0)
 #define GFP_KERNEL ((gfp_t) 0)
 
@@ -864,7 +869,9 @@ static struct usb_gadget_stringsstringtab = {
 
 
/**/
 static u8 control_req[USB_BUFSIZ];
+#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 static u8 status_req[STATUS_BYTECOUNT] __attribute__ ((aligned(4)));
+#endif
 
 
 /**
@@ -1352,6 +1359,14 @@ eth_setup(struct usb_gadget *gadget, const struct 
usb_ctrlrequest *ctrl)
if (gadget_is_pxa(gadget)) {
value = eth_set_config(dev, DEV_CONFIG_VALUE,
GFP_ATOMIC);
+   /*
+* PXA25x driver use non-CDC ethernet gadget.
+* But only _CDC and _RNDIS code can signalize
+* that network is working. So we signalize it
+* here.
+*/
+   l_ethdev.network_started = 1;
+   debug(USB network up!\n);
goto done_set_intf;
}
 
-- 
1.7.8.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 5/6] usbether: Define CONFIG_USB_ETH_{CDC,SUBSET}

2012-09-19 Thread Łukasz Dałek
Introduced CONFIG_USB_ETH_CDC and CONFIG_USB_ETH_SUBSET as preparation
for removal DEV_CONFIG_CDC and DEV_CONFIG_SUBSET

Signed-off-by: Łukasz Dałek luk0...@gmail.com
---
 drivers/usb/gadget/ether.c |   19 ++-
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 9ce2c17..7e6491d 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -44,12 +44,21 @@ extern struct platform_data brd;
 
 unsigned packet_received, packet_sent;
 
-#ifdef CONFIG_USB_GADGET_PXA2XX
-# undef DEV_CONFIG_CDC
-# define DEV_CONFIG_SUBSET 1
-#else
-# define DEV_CONFIG_CDC1
+#undef DEV_CONFIG_CDC
+#undef DEV_CONFIG_SUBSET
+
+#if !defined(CONFIG_USB_ETH_CDC)  !defined(CONFIG_USB_ETH_SUBSET)
+# define DEV_CONFIG_CDC1   /* preserve default behavior */
+#endif
+
+#if defined(CONFIG_USB_ETH_CDC)
+# define DEV_CONFIG_CDC1
 #endif
+
+#if defined(CONFIG_USB_ETH_SUBSET)
+# define DEV_CONFIG_SUBSET 1
+#endif
+
 #define GFP_ATOMIC ((gfp_t) 0)
 #define GFP_KERNEL ((gfp_t) 0)
 
-- 
1.7.8.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 6/6] usbether: Removed DEV_CONFIG_{CDC,SUBSET}

2012-09-19 Thread Łukasz Dałek
Removed DEV_CONFIG_CDC and DEV_CONFIG_SUBSET and replaced it with
CONFIG_USB_ETH_CDC and CONFIG_USB_ETH_SUBSET.

Signed-off-by: Łukasz Dałek luk0...@gmail.com
---
 drivers/usb/gadget/ether.c |   75 +--
 1 files changed, 30 insertions(+), 45 deletions(-)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 7e6491d..1e187e5 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -44,21 +44,6 @@ extern struct platform_data brd;
 
 unsigned packet_received, packet_sent;
 
-#undef DEV_CONFIG_CDC
-#undef DEV_CONFIG_SUBSET
-
-#if !defined(CONFIG_USB_ETH_CDC)  !defined(CONFIG_USB_ETH_SUBSET)
-# define DEV_CONFIG_CDC1   /* preserve default behavior */
-#endif
-
-#if defined(CONFIG_USB_ETH_CDC)
-# define DEV_CONFIG_CDC1
-#endif
-
-#if defined(CONFIG_USB_ETH_SUBSET)
-# define DEV_CONFIG_SUBSET 1
-#endif
-
 #define GFP_ATOMIC ((gfp_t) 0)
 #define GFP_KERNEL ((gfp_t) 0)
 
@@ -174,9 +159,9 @@ static struct usb_gadget_driver eth_driver;
 /* main config is either CDC, or its simple subset */
 static inline int is_cdc(struct eth_dev *dev)
 {
-#if!defined(DEV_CONFIG_SUBSET)
+#if!defined(CONFIG_USB_ETH_SUBSET)
return 1;   /* only cdc possible */
-#elif  !defined(DEV_CONFIG_CDC)
+#elif  !defined(CONFIG_USB_ETH_CDC)
return 0;   /* only subset possible */
 #else
return dev-cdc;/* depends on what hardware we found */
@@ -420,7 +405,7 @@ rndis_config = {
  * get those drivers from MCCI, or bundled with various products.
  */
 
-#ifdef DEV_CONFIG_CDC
+#ifdef CONFIG_USB_ETH_CDC
 static struct usb_interface_descriptor
 control_intf = {
.bLength =  sizeof control_intf,
@@ -459,7 +444,7 @@ static const struct usb_cdc_header_desc header_desc = {
.bcdCDC =   __constant_cpu_to_le16(0x0110),
 };
 
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 
 static const struct usb_cdc_union_desc union_desc = {
.bLength =  sizeof union_desc,
@@ -493,7 +478,7 @@ static const struct usb_cdc_acm_descriptor acm_descriptor = 
{
 
 #endif
 
-#ifndef DEV_CONFIG_CDC
+#ifndef CONFIG_USB_ETH_CDC
 
 /*
  * SAFE loosely follows CDC WMC MDLM, violating the spec in various
@@ -543,7 +528,7 @@ static const struct usb_cdc_ether_desc ether_desc = {
.bNumberPowerFilters =  0,
 };
 
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 
 /*
  * include the status endpoint if we can, even where it's optional.
@@ -575,7 +560,7 @@ fs_status_desc = {
 };
 #endif
 
-#ifdef DEV_CONFIG_CDC
+#ifdef CONFIG_USB_ETH_CDC
 
 /* the default data interface has no endpoints ... */
 
@@ -630,7 +615,7 @@ rndis_data_intf = {
 
 #endif
 
-#ifdef DEV_CONFIG_SUBSET
+#ifdef CONFIG_USB_ETH_SUBSET
 
 /*
  * Simple CDC-subset option is a simple vendor-neutral model that most
@@ -676,7 +661,7 @@ fs_sink_desc = {
 
 static const struct usb_descriptor_header *fs_eth_function[11] = {
(struct usb_descriptor_header *) otg_descriptor,
-#ifdef DEV_CONFIG_CDC
+#ifdef CONFIG_USB_ETH_CDC
/* cdc mode descriptors */
(struct usb_descriptor_header *) control_intf,
(struct usb_descriptor_header *) header_desc,
@@ -690,12 +675,12 @@ static const struct usb_descriptor_header 
*fs_eth_function[11] = {
(struct usb_descriptor_header *) fs_source_desc,
(struct usb_descriptor_header *) fs_sink_desc,
NULL,
-#endif /* DEV_CONFIG_CDC */
+#endif /* CONFIG_USB_ETH_CDC */
 };
 
 static inline void fs_subset_descriptors(void)
 {
-#ifdef DEV_CONFIG_SUBSET
+#ifdef CONFIG_USB_ETH_SUBSET
/* behavior is CDC Subset; extra descriptors say SAFE */
fs_eth_function[1] = (struct usb_descriptor_header *) subset_data_intf;
fs_eth_function[2] = (struct usb_descriptor_header *) header_desc;
@@ -733,7 +718,7 @@ static const struct usb_descriptor_header 
*fs_rndis_function[] = {
  * descriptors, unless they only run at full speed.
  */
 
-#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
+#if defined(CONFIG_USB_ETH_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 static struct usb_endpoint_descriptor
 hs_status_desc = {
.bLength =  USB_DT_ENDPOINT_SIZE,
@@ -743,7 +728,7 @@ hs_status_desc = {
.wMaxPacketSize =   __constant_cpu_to_le16(STATUS_BYTECOUNT),
.bInterval =LOG2_STATUS_INTERVAL_MSEC + 4,
 };
-#endif /* DEV_CONFIG_CDC */
+#endif /* CONFIG_USB_ETH_CDC */
 
 static struct usb_endpoint_descriptor
 hs_source_desc = {
@@ -776,7 +761,7 @@ dev_qualifier = {
 
 static const struct usb_descriptor_header *hs_eth_function[11] = {
(struct usb_descriptor_header *) otg_descriptor,
-#ifdef DEV_CONFIG_CDC
+#ifdef CONFIG_USB_ETH_CDC
/* cdc mode descriptors */
(struct usb_descriptor_header

Re: [U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200

2012-09-19 Thread Łukasz Dałek

On 19.09.2012 23:43, Marek Vasut wrote:

+#endif
+
+   return 0;
+}
+
+/*
+ * iPAQ h2200 has two stage bootloader.
+ * We only replace 2nd stage, so u-boot needs to be
+ * adpopted to the way how 1st stage bootloader works.
+ * Firstly, code needs to have first 4 bytes equal to
+ * 0xea0003fe (arm instruction b 0x1000)

GCC/GAS won't generate it so you use .word ?

No. GCC generates sth else than 0xea0003fe.

Try b 0x9098 ... is that it ?


Yes, GCC/GAS generate 0xeafe (b 0x9098).

Can you tell me why? Can I left .word?

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200

2012-09-19 Thread Łukasz Dałek

On 20.09.2012 00:01, Marek Vasut wrote:

Yes, GCC/GAS generate 0xeafe (b 0x9098).

Can you tell me why? Can I left .word?
Why is the jump offset 0x9098 ?



I figured out that 0xeafe is a loop (b -4) but I don't know
why toolchain generate b -4 instead of b 0x1000 and I don't
know how to fix it (without .word).

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200

2012-09-19 Thread Łukasz Dałek

On 20.09.2012 00:42, Marek Vasut wrote:

Dear Łukasz Dałek,


On 20.09.2012 00:01, Marek Vasut wrote:

Yes, GCC/GAS generate 0xeafe (b 0x9098).

Can you tell me why? Can I left .word?
Why is the jump offset 0x9098 ?

I figured out that 0xeafe is a loop (b -4)

ldr pc, pc, #-4


but I don't know
why toolchain generate b -4 instead of b 0x1000 and I don't
know how to fix it (without .word).

I don't follow, sorry. How did you even get to 0xeafe ?



My point is that GCC/GAS generate 0xeafe instead of 0xea0003fe when
I use 'b 0x1000'. That's why I use directive .word 0xea0003fe instead of
asm instruction 'b 0x1000'. But I don't know that: Can I leave that .word
directive or I can not.

Another question: I asked in cover letter question about tools. Can I add
them in h2200 directory or should I put them somwhere else?

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200

2012-09-19 Thread Łukasz Dałek

On 20.09.2012 00:56, Marek Vasut wrote:

That's why I use directive .word 0xea0003fe

Check some arm instruction quick ref for what 0xea0003fe really is and if it
really is necessary or anything else work just fine as well.


0xea0003fe is a branch instruction. 0x3fe is an offset (0x3fe  2 + 8 = 
0x1000)

And I will left it. Bootloader checks for 4 bytes which have to be equal
0xfe, 0x03, 0x00, 0xea and for 4 bytes at the offset 0x40 which have to
be equal E, C, E, C


instead of
asm instruction 'b 0x1000'. But I don't know that: Can I leave that .word
directive or I can not.

Another question: I asked in cover letter question about tools. Can I add
them in h2200 directory or should I put them somwhere else?

I didn't receive the cover letter.


Weird, I sent it with patches. With your address in CC field.
Btw. Did you got all 6 patches?

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200

2012-09-19 Thread Łukasz Dałek

On 20.09.2012 01:09, Marek Vasut wrote:

Dear Łukasz Dałek,


On 20.09.2012 00:56, Marek Vasut wrote:

That's why I use directive .word 0xea0003fe

Check some arm instruction quick ref for what 0xea0003fe really is and if
it really is necessary or anything else work just fine as well.

0xea0003fe is a branch instruction. 0x3fe is an offset (0x3fe  2 + 8 =
0x1000)
And I will left it. Bootloader checks for 4 bytes which have to be equal
0xfe, 0x03, 0x00, 0xea and for 4 bytes at the offset 0x40 which have to
be equal E, C, E, C

It checks the branch instruction? What a piece of crap ... can't you replace it
as well?


I can't. I would have to prepare sth like x-loader used in ti omap 
processors.

And I want to add driver for sdcard and flash and keyboard and lcd would be
nice... So I will left it as it is for now.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200

2012-09-19 Thread Łukasz Dałek

On 20.09.2012 01:25, Marek Vasut wrote:

Dear Łukasz Dałek,


On 20.09.2012 01:09, Marek Vasut wrote:

Dear Łukasz Dałek,


On 20.09.2012 00:56, Marek Vasut wrote:

That's why I use directive .word 0xea0003fe

Check some arm instruction quick ref for what 0xea0003fe really is and
if it really is necessary or anything else work just fine as well.

0xea0003fe is a branch instruction. 0x3fe is an offset (0x3fe   2 + 8 =
0x1000)
And I will left it. Bootloader checks for 4 bytes which have to be equal
0xfe, 0x03, 0x00, 0xea and for 4 bytes at the offset 0x40 which have to
be equal E, C, E, C

It checks the branch instruction? What a piece of crap ... can't you
replace it as well?

I can't. I would have to prepare sth like x-loader used in ti omap
processors.

What? Why?


h2200 uses companion chip from Samsung. When device is powered on
chip loads 16kb of flash into internal SRAM and PXA executes it.
That program is 1st stage bootloader.
But u-boot for my device has ~180kb. So it's to big for SRAM.

And I want to add driver for sdcard and flash and keyboard and lcd would be
nice... So I will left it as it is for now.

these drivers are already in uboot


I haven't seen any MediaQ 1178 drivers (LCD).
Also SD card and FLASH controllers are embedded in companion chip.
Chip is based on S3C440 (or 410?) processor but needs some tweaks and
tests.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/6] h2200: Add support for iPAQ h2200

2012-09-19 Thread Łukasz Dałek

On 20.09.2012 01:43, Marek Vasut wrote:

h2200 uses companion chip from Samsung.
OneNAND ?


When device is powered on
chip loads 16kb of flash into internal SRAM and PXA executes it.
That program is 1st stage bootloader.

Check OneNAND SPL


I'm not sure I didn't checked yet.



But u-boot for my device has ~180kb. So it's to big for SRAM.


And I want to add driver for sdcard and flash and keyboard and lcd would
be nice... So I will left it as it is for now.

these drivers are already in uboot

I haven't seen any MediaQ 1178 drivers (LCD).

oh it has separate LCD or it uses PXA LCDIF ?


MQ1178 is a separate SoC.


Also SD card and FLASH controllers are embedded in companion chip.

ASIC3 ?


Hamcop


Chip is based on S3C440 (or 410?) processor but needs some tweaks and
tests.

Uhhh ?


Hamcop chip looks like s3c2440 processor without ARM core and
with internal data busses limited to 16bytes. Really weird and buggy
thing.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/2] PXA25x: USB ethernet driver

2012-08-30 Thread Łukasz Dałek

On 30.08.2012 21:09, Marek Vasut wrote:

Dear Łukasz Dałek,


I've moved cpu revision detection to arch/arm/cpu/pxa as you suggest.
Cleaned ethernet driver. Soon I would also send patches for
drivers/usb/gadget/ether.c to work correctly with this pxa driver.

Łukasz Dałek (2):
   pxa: Add some stuff to examine cpu model and rev
   pxa25x: Add USB ethernet gadget

  arch/arm/cpu/pxa/cpuinfo.c  |   11 +-
  arch/arm/include/asm/arch-pxa/pxa.h |   13 +
  drivers/usb/gadget/Makefile |1 +
  drivers/usb/gadget/pxa25x_udc.c | 2059
+++ drivers/usb/gadget/pxa25x_udc.h |
168 +++
  5 files changed, 2250 insertions(+), 2 deletions(-)
  create mode 100644 drivers/usb/gadget/pxa25x_udc.c
  create mode 100644 drivers/usb/gadget/pxa25x_udc.h

Just a dumb question -- do we have any actual user for this stuff?

Best regards,
Marek Vasut

Me. I have iPAQ h2200 but my patches for this paltmop aren't in the
source tree. There is a chance that we don't have any device which
uses this.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/2] PXA25x: USB ethernet driver

2012-08-30 Thread Łukasz Dałek

On 31.08.2012 00:04, Marek Vasut wrote:

Dear Łukasz Dałek,


On 30.08.2012 21:09, Marek Vasut wrote:

Dear Łukasz Dałek,


I've moved cpu revision detection to arch/arm/cpu/pxa as you suggest.
Cleaned ethernet driver. Soon I would also send patches for
drivers/usb/gadget/ether.c to work correctly with this pxa driver.

Łukasz Dałek (2):
pxa: Add some stuff to examine cpu model and rev
pxa25x: Add USB ethernet gadget

   arch/arm/cpu/pxa/cpuinfo.c  |   11 +-
   arch/arm/include/asm/arch-pxa/pxa.h |   13 +
   drivers/usb/gadget/Makefile |1 +
   drivers/usb/gadget/pxa25x_udc.c | 2059

+++ drivers/usb/gadget/pxa25x_udc.h
| 168 +++

   5 files changed, 2250 insertions(+), 2 deletions(-)
   create mode 100644 drivers/usb/gadget/pxa25x_udc.c
   create mode 100644 drivers/usb/gadget/pxa25x_udc.h

Just a dumb question -- do we have any actual user for this stuff?

Best regards,
Marek Vasut

Me. I have iPAQ h2200 but my patches for this paltmop aren't in the
source tree. There is a chance that we don't have any device which
uses this.

Why don't you add support for this ipaq too then ?

I will but first of all I want to finish with pxa25x udc drivers and
with bugs in CDC ether driver (ether.c). Then I will send patches
adding support for my device.


Łukasz Dałek

Best regards,
Marek Vasut


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/2] PXA25x: USB ethernet driver

2012-08-21 Thread Łukasz Dałek
I've moved cpu revision detection to arch/arm/cpu/pxa as you suggest.
Cleaned ethernet driver. Soon I would also send patches for
drivers/usb/gadget/ether.c to work correctly with this pxa driver.

Łukasz Dałek (2):
  pxa: Add some stuff to examine cpu model and rev
  pxa25x: Add USB ethernet gadget

 arch/arm/cpu/pxa/cpuinfo.c  |   11 +-
 arch/arm/include/asm/arch-pxa/pxa.h |   13 +
 drivers/usb/gadget/Makefile |1 +
 drivers/usb/gadget/pxa25x_udc.c | 2059 +++
 drivers/usb/gadget/pxa25x_udc.h |  168 +++
 5 files changed, 2250 insertions(+), 2 deletions(-)
 create mode 100644 drivers/usb/gadget/pxa25x_udc.c
 create mode 100644 drivers/usb/gadget/pxa25x_udc.h

-- 
1.7.8.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] pxa: Add some stuff to examine cpu model and rev

2012-08-21 Thread Łukasz Dałek
Signed-off-by: Łukasz Dałek luk0...@gmail.com
---
 arch/arm/cpu/pxa/cpuinfo.c  |   11 +--
 arch/arm/include/asm/arch-pxa/pxa.h |   13 +
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/pxa/cpuinfo.c b/arch/arm/cpu/pxa/cpuinfo.c
index f1cdd40..bab6340 100644
--- a/arch/arm/cpu/pxa/cpuinfo.c
+++ b/arch/arm/cpu/pxa/cpuinfo.c
@@ -24,9 +24,11 @@
 #include errno.h
 #include linux/compiler.h
 
-#defineCPU_MASK_PXA_REVID  0x00f
+#defineCPU_MASK_PXA_PRODID 0x03f0
+#defineCPU_MASK_PXA_REVID  0x000f
+
+#defineCPU_MASK_PRODREV(CPU_MASK_PXA_PRODID | 
CPU_MASK_PXA_REVID)
 
-#defineCPU_MASK_PXA_PRODID 0x3f0
 #defineCPU_VALUE_PXA25X0x100
 #defineCPU_VALUE_PXA27X0x110
 
@@ -51,6 +53,11 @@ int cpu_is_pxa27x(void)
return id == CPU_VALUE_PXA27X;
 }
 
+uint32_t pxa_get_cpu_revision(void)
+{
+   return pxa_get_cpuid()  CPU_MASK_PRODREV;
+}
+
 #ifdef CONFIG_DISPLAY_CPUINFO
 static const char *pxa25x_get_revision(void)
 {
diff --git a/arch/arm/include/asm/arch-pxa/pxa.h 
b/arch/arm/include/asm/arch-pxa/pxa.h
index 49c6552..b67d8f2 100644
--- a/arch/arm/include/asm/arch-pxa/pxa.h
+++ b/arch/arm/include/asm/arch-pxa/pxa.h
@@ -22,8 +22,21 @@
 #ifndef__PXA_H__
 #define__PXA_H__
 
+#define PXA255_A0  0x0106
+#define PXA250_C0  0x0105
+#define PXA250_B2  0x0104
+#define PXA250_B1  0x0103
+#define PXA250_B0  0x0102
+#define PXA250_A1  0x0101
+#define PXA250_A0  0x0100
+#define PXA210_C0  0x0125
+#define PXA210_B2  0x0124
+#define PXA210_B1  0x0123
+#define PXA210_B0  0x0122
+
 int cpu_is_pxa25x(void);
 int cpu_is_pxa27x(void);
+uint32_t pxa_get_cpu_revision(void);
 void pxa2xx_dram_init(void);
 
 #endif /* __PXA_H__ */
-- 
1.7.8.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] pxa25x: Add UDC registers definitions

2012-08-18 Thread Łukasz Dałek
Signed-off-by: Łukasz Dałek luk0...@gmail.com
---
 arch/arm/include/asm/arch-pxa/regs-usb.h |  160 ++
 1 files changed, 160 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-pxa/regs-usb.h

diff --git a/arch/arm/include/asm/arch-pxa/regs-usb.h 
b/arch/arm/include/asm/arch-pxa/regs-usb.h
new file mode 100644
index 000..661ffe2
--- /dev/null
+++ b/arch/arm/include/asm/arch-pxa/regs-usb.h
@@ -0,0 +1,160 @@
+/*
+ * PXA25x UDC definitions
+ *
+ * Copyright (C) Łukasz Dałek luk0...@gmail.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __REGS_USB_H__
+#define __REGS_USB_H__
+
+struct pxa25x_udc_regs {
+
+   /* UDC Control Register */
+   uint32_tudccr; /* 0x000 */
+   uint32_treserved1;
+
+   /* UDC Control Function Register */
+   uint32_tudccfr; /* 0x008 */
+   uint32_treserved2;
+
+   /* UDC Endpoint Control/Status Registers */
+   uint32_tudccs[16]; /* 0x010 - 0x04c */
+
+   /* UDC Interrupt Control/Status Registers */
+   uint32_tuicr0; /* 0x050 */
+   uint32_tuicr1; /* 0x054 */
+   uint32_tusir0; /* 0x058 */
+   uint32_tusir1; /* 0x05c */
+
+   /* UDC Frame Number/Byte Count Registers */
+   uint32_tufnrh;  /* 0x060 */
+   uint32_tufnrl;  /* 0x064 */
+   uint32_tubcr2;  /* 0x068 */
+   uint32_tubcr4;  /* 0x06c */
+   uint32_tubcr7;  /* 0x070 */
+   uint32_tubcr9;  /* 0x074 */
+   uint32_tubcr12; /* 0x078 */
+   uint32_tubcr14; /* 0x07c */
+
+   /* UDC Endpoint Data Registers */
+   uint32_tuddr0;  /* 0x080 */
+   uint32_treserved3[7];
+   uint32_tuddr5;  /* 0x0a0 */
+   uint32_treserved4[7];
+   uint32_tuddr10; /* 0x0c0 */
+   uint32_treserved5[7];
+   uint32_tuddr15; /* 0x0e0 */
+   uint32_treserved6[7];
+   uint32_tuddr1;  /* 0x100 */
+   uint32_treserved7[31];
+   uint32_tuddr2;  /* 0x180 */
+   uint32_treserved8[31];
+   uint32_tuddr3;  /* 0x200 */
+   uint32_treserved9[127];
+   uint32_tuddr4;  /* 0x400 */
+   uint32_treserved10[127];
+   uint32_tuddr6;  /* 0x600 */
+   uint32_treserved11[31];
+   uint32_tuddr7;  /* 0x680 */
+   uint32_treserved12[31];
+   uint32_tuddr8;  /* 0x700 */
+   uint32_treserved13[127];
+   uint32_tuddr9;  /* 0x900 */
+   uint32_treserved14[127];
+   uint32_tuddr11; /* 0xb00 */
+   uint32_treserved15[31];
+   uint32_tuddr12; /* 0xb80 */
+   uint32_treserved16[31];
+   uint32_tuddr13; /* 0xc00 */
+   uint32_treserved17[127];
+   uint32_tuddr14; /* 0xe00 */
+
+};
+
+#define PXA25X_UDC_BASE0x4060
+
+#define UDCCR_UDE  (1  0)
+#define UDCCR_UDA  (1  1)
+#define UDCCR_RSM  (1  2)
+#define UDCCR_RESIR(1  3)
+#define UDCCR_SUSIR(1  4)
+#define UDCCR_SRM  (1  5)
+#define UDCCR_RSTIR(1  6)
+#define UDCCR_REM  (1  7)
+
+/* Bulk IN endpoint 1/6/11 */
+#define UDCCS_BI_TSP   (1  7)
+#define UDCCS_BI_FST   (1  5)
+#define UDCCS_BI_SST   (1  4)
+#define UDCCS_BI_TUR   (1  3)
+#define UDCCS_BI_FTF   (1  2)
+#define UDCCS_BI_TPC   (1  1)
+#define UDCCS_BI_TFS   (1  0)
+
+/* Bulk OUT endpoint 2/7/12 */
+#define UDCCS_BO_RSP   (1  7)
+#define UDCCS_BO_RNE   (1  6)
+#define UDCCS_BO_FST   (1  5)
+#define UDCCS_BO_SST   (1  4)
+#define UDCCS_BO_DME   (1  3)
+#define UDCCS_BO_RPC   (1  1)
+#define UDCCS_BO_RFS   (1  0)
+
+/* Isochronous OUT endpoint 4/9/14 */
+#define UDCCS_IO_RSP   (1  7)
+#define UDCCS_IO_RNE   (1  6)
+#define UDCCS_IO_DME   (1  3)
+#define UDCCS_IO_ROF   (1  2)
+#define UDCCS_IO_RPC   (1  1)
+#define UDCCS_IO_RFS   (1  0)
+
+/* Control endpoint 0 */
+#define UDCCS0_OPR

[U-Boot] [PATCH 1/3] usbether: Fixed bug when using with PXA25X chips

2012-08-17 Thread Łukasz Dałek
PXA25X chips don't support alternate settings so code in ether.c
disables usage of CDC.
But only code defined between DEV_CONFIG_CDC signals that network is up.
This patch is fixing this bug by addding pxa_connect_gadget() which on
pxa25x chips signals that network is up and do nothing on any other
chips.

Signed-off-by: Łukasz Dałek luk0...@gmail.com
---
 drivers/usb/gadget/ether.c |   21 -
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index d975fb6..964fe2e 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -44,7 +44,12 @@ extern struct platform_data brd;
 
 unsigned packet_received, packet_sent;
 
-#define DEV_CONFIG_CDC 1
+#ifdef CONFIG_USB_GADGET_PXA2XX
+# undef DEV_CONFIG_CDC
+# define DEV_CONFIG_SUBSET 1
+#else
+# define DEV_CONFIG_CDC1
+#endif
 #define GFP_ATOMIC ((gfp_t) 0)
 #define GFP_KERNEL ((gfp_t) 0)
 
@@ -864,7 +869,9 @@ static struct usb_gadget_stringsstringtab = {
 
 
/**/
 static u8 control_req[USB_BUFSIZ];
+#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 static u8 status_req[STATUS_BYTECOUNT] __attribute__ ((aligned(4)));
+#endif
 
 
 /**
@@ -1252,6 +1259,17 @@ static void rndis_command_complete(struct usb_ep *ep, 
struct usb_request *req)
 
 #endif /* RNDIS */
 
+#ifdef CONFIG_USB_GADGET_PXA2XX
+static inline void pxa_connect_gadget(void)
+{
+   debug(PXA connecting gadget...\n);
+   l_ethdev.network_started = 1;
+   printf(USB network up!\n);
+}
+#else
+static inline void pxa_connect_gadget(void) { }
+#endif
+
 /*
  * The setup() callback implements all the ep0 functionality that's not
  * handled lower down.  CDC has a number of less-common features:
@@ -1352,6 +1370,7 @@ eth_setup(struct usb_gadget *gadget, const struct 
usb_ctrlrequest *ctrl)
if (gadget_is_pxa(gadget)) {
value = eth_set_config(dev, DEV_CONFIG_VALUE,
GFP_ATOMIC);
+   pxa_connect_gadget();
goto done_set_intf;
}
 
-- 
1.7.8.6

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/3] pxa25x: Add UDC registers definitions

2012-08-17 Thread Łukasz Dałek
Signed-off-by: Łukasz Dałek luk0...@gmail.com
---
 arch/arm/include/asm/arch-pxa/regs-usb.h |  174 ++
 1 files changed, 174 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-pxa/regs-usb.h

diff --git a/arch/arm/include/asm/arch-pxa/regs-usb.h 
b/arch/arm/include/asm/arch-pxa/regs-usb.h
new file mode 100644
index 000..8e4a4a4
--- /dev/null
+++ b/arch/arm/include/asm/arch-pxa/regs-usb.h
@@ -0,0 +1,174 @@
+/*
+ * PXA25x UDC definitions
+ *
+ * Copyright (C) Łukasz Dałek luk0...@gmail.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __REGS_USB_H__
+#define __REGS_USB_H__
+
+#include linux/compiler.h
+
+struct pxa25x_udc_regs {
+
+   /* UDC Control Register */
+   uint32_tudccr; /* 0x000 */
+   uint8_t reserved1[4];
+
+   /* UDC Control Function Register */
+   uint32_tudccfr; /* 0x008 */
+   uint8_t reserved2[4];
+
+   /* UDC Endpoint Control/Status Registers */
+   uint32_tudccs0; /* 0x010 */
+   uint32_tudccs1; /* 0x014 */
+   uint32_tudccs2; /* 0x018 */
+   uint32_tudccs3; /* 0x01c */
+   uint32_tudccs4; /* 0x020 */
+   uint32_tudccs5; /* 0x024 */
+   uint32_tudccs6; /* 0x028 */
+   uint32_tudccs7; /* 0x02c */
+   uint32_tudccs8; /* 0x030 */
+   uint32_tudccs9; /* 0x034 */
+   uint32_tudccs10; /* 0x038 */
+   uint32_tudccs11; /* 0x03c */
+   uint32_tudccs12; /* 0x040 */
+   uint32_tudccs13; /* 0x044 */
+   uint32_tudccs14; /* 0x048 */
+   uint32_tudccs15; /* 0x04c */
+
+   /* UDC Interrupt Control/Status Registers */
+   uint32_tuicr0; /* 0x050 */
+   uint32_tuicr1; /* 0x054 */
+   uint32_tusir0; /* 0x058 */
+   uint32_tusir1; /* 0x05c */
+
+   /* UDC Frame Number/Byte Count Registers */
+   uint32_tufnrh;  /* 0x060 */
+   uint32_tufnrl;  /* 0x064 */
+   uint32_tubcr2;  /* 0x068 */
+   uint32_tubcr4;  /* 0x06c */
+   uint32_tubcr7;  /* 0x070 */
+   uint32_tubcr9;  /* 0x074 */
+   uint32_tubcr12; /* 0x078 */
+   uint32_tubcr14; /* 0x07c */
+
+   /* UDC Endpoint Data Registers */
+   uint32_tuddr0;  /* 0x080 */
+   uint8_t reserved3[28];
+   uint32_tuddr5;  /* 0x0a0 */
+   uint8_t reserved4[28];
+   uint32_tuddr10; /* 0x0c0 */
+   uint8_t reserved5[28];
+   uint32_tuddr15; /* 0x0e0 */
+   uint8_t reserved6[28];
+   uint32_tuddr1;  /* 0x100 */
+   uint8_t reserved7[124];
+   uint32_tuddr2;  /* 0x180 */
+   uint8_t reserved8[124];
+   uint32_tuddr3;  /* 0x200 */
+   uint8_t reserved9[508];
+   uint32_tuddr4;  /* 0x400 */
+   uint8_t reserved10[508];
+   uint32_tuddr6;  /* 0x600 */
+   uint8_t reserved11[124];
+   uint32_tuddr7;  /* 0x680 */
+   uint8_t reserved12[124];
+   uint32_tuddr8;  /* 0x700 */
+   uint8_t reserved13[508];
+   uint32_tuddr9;  /* 0x900 */
+   uint8_t reserved14[508];
+   uint32_tuddr11; /* 0xb00 */
+   uint8_t reserved15[124];
+   uint32_tuddr12; /* 0xb80 */
+   uint8_t reserved16[124];
+   uint32_tuddr13; /* 0xc00 */
+   uint8_t reserved17[508];
+   uint32_tuddr14; /* 0xe00 */
+
+} __packed;
+
+#define PXA25X_UDC_BASE0x4060
+
+#define UDCCR_UDE  (1  0)
+#define UDCCR_UDA  (1  1)
+#define UDCCR_RSM  (1  2)
+#define UDCCR_RESIR(1  3)
+#define UDCCR_SUSIR(1  4)
+#define UDCCR_SRM  (1  5)
+#define UDCCR_RSTIR(1  6)
+#define UDCCR_REM  (1  7)
+
+/* Bulk IN endpoint 1/6/11 */
+#define UDCCS_BI_TSP   (1  7)
+#define UDCCS_BI_FST   (1  5)
+#define UDCCS_BI_SST   (1  4)
+#define UDCCS_BI_TUR   (1  3)
+#define UDCCS_BI_FTF   (1  2

Re: [U-Boot] [PATCH 3/3] pxa25x: Add USB ethernet gadget driver

2012-08-17 Thread Łukasz Dałek

On 17.08.2012 22:57, Marek Vasut wrote:

+ /* let loose that packet. maybe try writing another one,
Wrong comment , fix globally ... doens't checkpatch catch those?

no


+* double buffering might work.  TSP, TPC, and TFS
+* bit values are the same for all normal IN endpoints.
+*/
+   writel(UDCCS_BI_TPC, ep-reg_udccs);
+   if (is_short)
+   writel(UDCCS_BI_TSP, ep-reg_udccs);
+
+   /* requests complete when all IN data is in the FIFO */
+   if (is_last) {
+   done(ep, req, 0);
+   if (list_empty(ep-queue))
+   pio_irq_disable(ep-bEndpointAddress);
+   return 1;
+   }
+
+   /* TODO experiment: how robust can fifo mode tweaking be?
+* double buffering is off in the default fifo mode, which
+* prevents TFS from being set here. */
+
+   } while (readl(ep-reg_udccs)  UDCCS_BI_TFS);
+   return 0;
+}
+
+/* caller asserts req-pending (ep0 irq status nyet cleared); starts
+ * ep0 data stage.  these chips want very simple state transitions.
+ */
+static inline
+void ep0start(struct pxa25x_udc *dev, u32 flags, const char *tag)
+{
+   writel(flags|UDCCS0_SA|UDCCS0_OPR,dev-regs-udccs0);
+   /* writel(USIR0_IR0,dev-regs-usir0); */

What the heck ?

I've left this line commented out because I think that on
pxa chips with revision other than a0, code can make troubles.
I have only pxa255 a0 and I can't test it. On my board code
works very well.


+/* until it's enabled, this UDC should be completely invisible
+ * to any USB host.
+ */
+static void udc_enable(struct pxa25x_udc *dev)
+{
+   debug(udc: enabling udc\n);
+
+   udc_clear_mask_UDCCR(UDCCR_UDE);
+
+   /* try to clear these bits before we enable the udc */
+   udc_ack_int_UDCCR(UDCCR_SUSIR|/*UDCCR_RSTIR|*/UDCCR_RESIR);
Why is this commented out ?

as above

Replace with debug() 

I've defined noisy() because they sometimes help me when
debugging code. Can't be left there?

+#ifdef NOISY_DEBUG
+# define noisy(x...)   debug(x)
+#else
+# define noisy(x...)   do {} while (0)
+#endif
+
+#else
+
+#definedump_udccr(x)   do {} while (0)
+#definedump_udccs0(x)  do {} while (0)
+#definedump_state(x)   do {} while (0)
+#define noisy(x...)do {} while (0)
+
+#endif
+
+#endif /* __LINUX_USB_GADGET_PXA25X_H */


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] pxa25x: Add UDC registers definitions

2012-08-17 Thread Łukasz Dałek

On 17.08.2012 22:50, Marek Vasut wrote:

Dear Łukasz Dałek,


+   /* UDC Endpoint Control/Status Registers */
+   uint32_tudccs0; /* 0x010 */
+   uint32_tudccs1; /* 0x014 */
+   uint32_tudccs2; /* 0x018 */
+   uint32_tudccs3; /* 0x01c */
+   uint32_tudccs4; /* 0x020 */
+   uint32_tudccs5; /* 0x024 */
+   uint32_tudccs6; /* 0x028 */
+   uint32_tudccs7; /* 0x02c */
+   uint32_tudccs8; /* 0x030 */
+   uint32_tudccs9; /* 0x034 */
+   uint32_tudccs10; /* 0x038 */
+   uint32_tudccs11; /* 0x03c */
+   uint32_tudccs12; /* 0x040 */
+   uint32_tudccs13; /* 0x044 */
+   uint32_tudccs14; /* 0x048 */
+   uint32_tudccs15; /* 0x04c */

Use array here maybe? ;-)

Yes, array is a good idea.


+   uint32_tuddr9;  /* 0x900 */
+   uint8_t reserved14[508];
+   uint32_tuddr11; /* 0xb00 */
+   uint8_t reserved15[124];
+   uint32_tuddr12; /* 0xb80 */
+   uint8_t reserved16[124];
+   uint32_tuddr13; /* 0xc00 */
+   uint8_t reserved17[508];
+   uint32_tuddr14; /* 0xe00 */
+
+} __packed;

You don't need this.

Why? GCC on ARM doesn't align structures?


+#define UDCCFR_AREN(1  7) /* ACK response enable (now) */
+#define UDCCFR_ACM (1  2) /* ACK control mode (wait for AREN) */
+/* latest pxa255 errata define new must be one bits in UDCCFR */
+#define UDCCFR_MB1 (0xff  ~(UDCCFR_AREN | UDCCFR_ACM))

What errata and where? Please document it in the comment. Also, is the register
only 8 bit wide?

Ok, I will document. All registers are 32 bits wide. But some you have to
access like they are 8 bits wide.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] usbether: Fixed bug when using with PXA25X chips

2012-08-17 Thread Łukasz Dałek

On 17.08.2012 22:48, Marek Vasut wrote:

Dear Łukasz Dałek,


PXA25X chips don't support alternate settings so code in ether.c
disables usage of CDC.
But only code defined between DEV_CONFIG_CDC signals that network is up.
This patch is fixing this bug by addding pxa_connect_gadget() which on
pxa25x chips signals that network is up and do nothing on any other
chips.

You're getting better, it's a good sign you're learning, I'm glad to see it :-)
It's my first big project in which I got involved so I'm ready for 
criticism.



Signed-off-by: Łukasz Dałekluk0...@gmail.com
---
  drivers/usb/gadget/ether.c |   21 -
  1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index d975fb6..964fe2e 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -44,7 +44,12 @@ extern struct platform_data brd;

  unsigned packet_received, packet_sent;

-#define DEV_CONFIG_CDC 1
+#ifdef CONFIG_USB_GADGET_PXA2XX
+# undef DEV_CONFIG_CDC
+# define DEV_CONFIG_SUBSET 1

Can't we make it into a config value?

Does this work for you:
1) Add:
CONFIG_USB_ETH_SUBSET
CONFIG_USB_ETH_CDC

2) Change this to

#if !defined(...SUBSET) || !defined(...CDC) || !defined(RNDIS)
#define DEV_CONFIG_CDC /* preserve default behavior */
#endif

#if defined(...SUBSET)
#define DEV_CONFIG_SUBSET
#endif

#if defined(...CDC)
#define DEV_CONFIG_CDC
#endif

/* Note that RNDIS is already fixed */

Ok.



-- FROM HERE IT GOES INTO DIFFERENT PATCH --

3) Replace DEV_CONFIG_CDC with CONFIG_USB_ETH_CDC, remove the last #if defined
above

Which one #if? That one I'd define in previous patch?


4) DTTO for SUBSET

5) define SUBSET in your header file

In my board's header file?


+#else
+# define DEV_CONFIG_CDC1
+#endif
  #define GFP_ATOMIC ((gfp_t) 0)
  #define GFP_KERNEL ((gfp_t) 0)

@@ -864,7 +869,9 @@ static struct usb_gadget_stringsstringtab = {

  /*
*/ static u8 control_req[USB_BUFSIZ];
+#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
  static u8 status_req[STATUS_BYTECOUNT] __attribute__ ((aligned(4)));
+#endif

What trouble do you face here?

Tom, this aligned(4) doesn't look correct, some ALLOC_ALIGNED or friend would
help here, right ? :)

If you don't define DEV_CONFIG_CDC nor ...RNDIS and define DEV_CONFIG_SUBSET
then it won't compile (because of STATUS_BYTECOUNT).


  /**
@@ -1252,6 +1259,17 @@ static void rndis_command_complete(struct usb_ep
*ep, struct usb_request *req)

  #endif/* RNDIS */

+#ifdef CONFIG_USB_GADGET_PXA2XX
+static inline void pxa_connect_gadget(void)
+{
+   debug(PXA connecting gadget...\n);
+   l_ethdev.network_started = 1;
+   printf(USB network up!\n);

Definitelly not printf(), but is this really PXA specific or is this part of the
CDC subset goo?
I've took pattern from code in this file. What should I use instead of 
printf?

CDC subset disable some code for PXA which signalise that network was
started (l_ethdev... = 1) so this is quick-fix for this bug.

Łukasz Dałek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/5] pxa255: Add UDC registers definitions

2012-07-27 Thread Łukasz Dałek
This patch starts series of patches adding support for USB support on
PXA255 chips.

Signed-off-by: Łukasz Dałek luk0...@gmail.com
---
 arch/arm/include/asm/arch-pxa/pxa-regs.h |  247 ++
 1 files changed, 247 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-pxa/pxa-regs.h 
b/arch/arm/include/asm/arch-pxa/pxa-regs.h
index b81b42c..114e9a2 100644
--- a/arch/arm/include/asm/arch-pxa/pxa-regs.h
+++ b/arch/arm/include/asm/arch-pxa/pxa-regs.h
@@ -2498,6 +2498,253 @@ typedef void(*ExcpHndlr) (void) ;
 
 #endif /* CONFIG_CPU_PXA27X */
 
+#if defined(CONFIG_CPU_PXA25X)
+
+#ifdef CONFIG_PXA25X_UDC_LINUX
+# define UDCCR *((volatile u32 *)0x4060)
+#else
+# define UDCCR 0x4060
+#endif
+
+#define UDCCR_UDE  (1  0)
+#define UDCCR_UDA  (1  1)
+#define UDCCR_RSM  (1  2)
+#define UDCCR_RESIR(1  3)
+#define UDCCR_SUSIR(1  4)
+#define UDCCR_SRM  (1  5)
+#define UDCCR_RSTIR(1  6)
+#define UDCCR_REM  (1  7)
+
+#ifdef CONFIG_PXA25X_UDC_LINUX
+# define UDCCFR*((volatile u32 *)0x4068)
+#else
+# define UDCCFR0x4068
+#endif
+
+#define UDCCFR_AREN(1  7)
+#define UDCCFR_ACM (1  2)
+#define UDCCFR_MB1 (0xff  ~(UDCCFR_AREN | UDCCFR_ACM))
+
+#ifdef CONFIG_PXA25X_UDC_LINUX
+# define UICR0 *((volatile u32 *)0x40600050)
+#else
+# define UICR0 0x40600050
+#endif
+
+#define UICR0_MASK 0xf
+#define UICR0_IM0  (1  0)
+
+#ifdef CONFIG_PXA25X_UDC_LINUX
+# define UICR1 *((volatile u32 *)0x40600054)
+#else
+# define UICR1 0x40600054
+#endif
+
+#define UICR1_MASK 0xf
+
+#ifdef CONFIG_PXA25X_UDC_LINUX
+# define USIR0 *((volatile u32 *)0x40600058)
+#else
+# define USIR0 0x40600058
+#endif
+
+#define USIR0_MASK 0xf
+#define USIR0_IR0  (1  0)
+#define USIR0_IR1  (1  1)
+#define USIR0_IR2  (1  2)
+#define USIR0_IR3  (1  3)
+#define USIR0_IR4  (1  4)
+#define USIR0_IR5  (1  5)
+#define USIR0_IR6  (1  6)
+#define USIR0_IR7  (1  7)
+
+#ifdef CONFIG_PXA25X_UDC_LINUX
+# define USIR1 *((volatile u32 *)0x4060005c)
+#else
+# define USIR1 0x4060005c
+#endif
+
+#define USIR1_MASK 0xf
+#define USIR1_IR8  (1  0)
+#define USIR1_IR9  (1  1)
+#define USIR1_IR10 (1  2)
+#define USIR1_IR11 (1  3)
+#define USIR1_IR12 (1  4)
+#define USIR1_IR13 (1  5)
+#define USIR1_IR14 (1  6)
+#define USIR1_IR15 (1  7)
+
+#ifdef CONFIG_PXA25X_UDC_LINUX
+# define UDCCS0*((volatile u32 *)0x40600010)
+# define UDCCS1*((volatile u32 *)0x40600014)
+# define UDCCS2*((volatile u32 *)0x40600018)
+# define UDCCS3*((volatile u32 *)0x4060001c)
+# define UDCCS4*((volatile u32 *)0x40600020)
+# define UDCCS5*((volatile u32 *)0x40600024)
+# define UDCCS6*((volatile u32 *)0x40600028)
+# define UDCCS7*((volatile u32 *)0x4060002c)
+# define UDCCS8*((volatile u32 *)0x40600030)
+# define UDCCS9*((volatile u32 *)0x40600034)
+# define UDCCS10   *((volatile u32 *)0x40600038)
+# define UDCCS11   *((volatile u32 *)0x4060003c)
+# define UDCCS12   *((volatile u32 *)0x40600040)
+# define UDCCS13   *((volatile u32 *)0x40600044)
+# define UDCCS14   *((volatile u32 *)0x40600048)
+# define UDCCS15   *((volatile u32 *)0x4060004c)
+#else
+# define UDCCS(x)  (0x40600010 + 4 * (x))
+# define UDCCS0UDCCS(0)
+#endif
+
+/* Control endpoint 0 */
+#define UDCCS_CTRL_OPR (1  0)
+#define UDCCS_CTRL_IPR (1  1)
+#define UDCCS_CTRL_FTF (1  2)
+#define UDCCS_CTRL_DRWF(1  3)
+#define UDCCS_CTRL_SST (1  4)
+#define UDCCS_CTRL_FST (1  5)
+#define UDCCS_CTRL_RNE (1  6)
+#define UDCCS_CTRL_SA  (1  7)
+
+/* Linux compat */
+#define UDCCS0_SA  UDCCS_CTRL_SA
+#define UDCCS0_RNE UDCCS_CTRL_RNE
+#define UDCCS0_FST UDCCS_CTRL_FST
+#define UDCCS0_SST UDCCS_CTRL_SST
+#define UDCCS0_DRWFUDCCS_CTRL_DRWF
+#define UDCCS0_FTF UDCCS_CTRL_FTF
+#define UDCCS0_IPR UDCCS_CTRL_IPR
+#define UDCCS0_OPR UDCCS_CTRL_OPR
+
+/* Bulk IN endpoint 1/6/11 */
+#define UDCCS_BULK_IN_TSP  (1  7)
+#define UDCCS_BULK_IN_FST  (1  5)
+#define UDCCS_BULK_IN_SST  (1  4)
+#define UDCCS_BULK_IN_TUR  (1  3)
+#define UDCCS_BULK_IN_FTF  (1  2)
+#define

[U-Boot] [PATCH 2/5] drivers/usb/gadget/Makefile: Add UDC ACM and Ether

2012-07-27 Thread Łukasz Dałek
Compile USB ttyACM and Ethernet drivers on pxa255.

Signed-off-by: Łukasz Dałek luk0...@gmail.com
---
 drivers/usb/gadget/Makefile |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 87d1918..7307595 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -34,6 +34,7 @@ ifdef CONFIG_USB_ETHER
 COBJS-y += ether.o epautoconf.o config.o usbstring.o
 COBJS-$(CONFIG_USB_ETH_RNDIS) += rndis.o
 COBJS-$(CONFIG_MV_UDC) += mv_udc.o
+COBJS-$(CONFIG_CPU_PXA25X) += pxa25x_udc_linux.o
 else
 # Devices not related to the new gadget layer depend on CONFIG_USB_DEVICE
 ifdef CONFIG_USB_DEVICE
@@ -43,6 +44,7 @@ COBJS-$(CONFIG_DW_UDC) += designware_udc.o
 COBJS-$(CONFIG_OMAP1510) += omap1510_udc.o
 COBJS-$(CONFIG_OMAP1610) += omap1510_udc.o
 COBJS-$(CONFIG_MPC885_FAMILY) += mpc8xx_udc.o
+COBJS-$(CONFIG_CPU_PXA25X) += pxa25x_udc.o
 COBJS-$(CONFIG_CPU_PXA27X) += pxa27x_udc.o
 endif
 endif
-- 
1.7.3.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/5] pxa255: Add USB CDC ACM driver

2012-07-27 Thread Łukasz Dałek
Signed-off-by: Łukasz Dałek luk0...@gmail.com
---
 drivers/serial/usbtty.h |2 +
 drivers/usb/gadget/pxa25x_udc.c |  939 +++
 include/usb/pxa25x_udc.h|   65 +++
 3 files changed, 1006 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/pxa25x_udc.c
 create mode 100644 include/usb/pxa25x_udc.h

diff --git a/drivers/serial/usbtty.h b/drivers/serial/usbtty.h
index eb670da..632b54e 100644
--- a/drivers/serial/usbtty.h
+++ b/drivers/serial/usbtty.h
@@ -31,6 +31,8 @@
 #include usb/omap1510_udc.h
 #elif defined(CONFIG_MUSB_UDC)
 #include usb/musb_udc.h
+#elif defined(CONFIG_CPU_PXA25X)
+#include usb/pxa25x_udc.h
 #elif defined(CONFIG_CPU_PXA27X)
 #include usb/pxa27x_udc.h
 #elif defined(CONFIG_DW_UDC)
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
new file mode 100644
index 000..4ff98cc
--- /dev/null
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -0,0 +1,939 @@
+/*
+ * PXA25x USB device driver for u-boot.
+ *
+ * Copyright (C) 2012 Łukasz Dałek luk0...@gmail.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ * based on drivers/usb/gadget/pxa27x_udc.c
+ *
+ */
+
+#include common.h
+#include config.h
+#include usb/pxa25x_udc.h
+#include asm/io.h
+#include asm/arch/hardware.h
+#include ep0.h
+
+struct pxa25x_endpoint {
+   u8  num;
+   u32 uddr;
+   u32 udccs;
+   u32 ubcr;
+};
+
+static struct pxa25x_endpoint eps[] = {
+   { 0, UDDR0, UDCCS(0), 0 },
+   { 1, UDDR1, UDCCS(1), 0 },
+   { 2, UDDR2, UDCCS(2), UBCR2 },
+   { 3, UDDR3, UDCCS(3), 0 },
+   { 4, UDDR4, UDCCS(4), UBCR4 },
+   { 5, UDDR5, UDCCS(5), 0 },
+   { 6, UDDR6, UDCCS(6), 0 },
+   { 7, UDDR7, UDCCS(7), UBCR7 },
+   { 8, UDDR8, UDCCS(8), 0 },
+   { 9, UDDR9, UDCCS(9), UBCR9 },
+   { 10, UDDR10, UDCCS(10), 0 },
+   { 11, UDDR11, UDCCS(11), 0 },
+   { 12, UDDR12, UDCCS(12), UBCR12 },
+   { 13, UDDR13, UDCCS(13), 0 },
+   { 14, UDDR14, UDCCS(14), UBCR14 },
+   { 15, UDDR15, UDCCS(15), 0 },
+};
+
+static struct usb_device_instance *udc_device;
+static struct urb *ep0_urb;
+static int ep0state = EP0_IDLE;
+static int ep0laststate = EP0_IDLE;
+
+static inline void udc_set_reg(u32 reg, u32 mask)
+{
+   u32 val;
+
+   val = readl(reg);
+   val |= mask;
+   writel(val, reg);
+}
+
+static inline void udc_clear_reg(u32 reg, u32 mask)
+{
+   u32 val;
+
+   val = readl(reg);
+   val = ~mask;
+   writel(val, reg);
+}
+
+/* static void udc_dump_buffer(char *name, u8 *buf, int len)
+{
+   usbdbg(%s - buf %p, len %d, name, buf, len);
+   print_buffer(0, buf, 1, len, 0);
+} */
+
+static void udc_dump_buffer(u8 *data, int len)
+{
+   u8 buff[8 * 5 + 1]; /* 8 characters 0x??_ + null */
+   int i;
+
+   for (i = 0; i  len; ++i) {
+   int n = i % 8;
+   buff[n * 5 + 0] = '0';
+   buff[n * 5 + 1] = 'x';
+
+   u8 ch = data[i]  4;
+   buff[n * 5 + 2] = (ch  10)?(ch + '0'):(ch - 10 + 'a');
+   ch = data[i]  0xf;
+   buff[n * 5 + 3] = (ch  10)?(ch + '0'):(ch - 10 + 'a');
+   buff[n * 5 + 4] = ' ';
+
+   buff[n * 5 + 5] = 0x0;
+
+   if (n == 7)
+   usbdbg(%s, buff);
+   }
+
+}
+
+static void udc_flush_fifo(struct usb_endpoint_instance *endpoint)
+{
+   int ep_num = endpoint-endpoint_address  USB_ENDPOINT_NUMBER_MASK,
+   isout = 
+   (endpoint-endpoint_address  USB_ENDPOINT_DIR_MASK) == 
USB_DIR_OUT;
+   int ep_type;
+   u32 val;
+
+   if (ep_num  15) {
+   usberr(%s: endpoint out of range %d, __func__, ep_num);
+   return ;
+   }
+
+   if (!ep_num) {
+   while (readl(UDCCS0)  UDCCS_CTRL_RNE)
+   readl(UDDR0);
+   writel(UDCCS_CTRL_FTF, UDCCS0);
+   usbdbg(flushed endpoint 0 (udccs0 0x%02X),
+   readl(UDCCS0)  0xff);
+   return ;
+   }
+
+   if (isout) {
+   while (readl(eps[ep_num].udccs)  UDCCS_BULK_OUT_RNE)
+   readl(eps[ep_num].uddr);
+   usbdbg(out endpoint %d flushed, ep_num);
+   return

[U-Boot] [PATCH 5/5] usbether: Fixed bug when using with PXA25X chips

2012-07-27 Thread Łukasz Dałek
PXA25X chips don't support alternate settings so code in ether.c
disables usage of CDC.
But only code defined between DEV_CONFIG_CDC signals that network is up.
This patch is fixing this bug by addding pxa_connect_gadget() which on
pxa25x chips signals that network is up and do nothing on any other
chips.

Signed-off-by: Łukasz Dałek luk0...@gmail.com
---
 drivers/usb/gadget/ether.c |   21 -
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index d975fb6..964fe2e 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -44,7 +44,12 @@ extern struct platform_data brd;
 
 unsigned packet_received, packet_sent;
 
-#define DEV_CONFIG_CDC 1
+#ifdef CONFIG_USB_GADGET_PXA2XX
+# undef DEV_CONFIG_CDC
+# define DEV_CONFIG_SUBSET 1
+#else
+# define DEV_CONFIG_CDC1
+#endif
 #define GFP_ATOMIC ((gfp_t) 0)
 #define GFP_KERNEL ((gfp_t) 0)
 
@@ -864,7 +869,9 @@ static struct usb_gadget_stringsstringtab = {
 
 
/**/
 static u8 control_req[USB_BUFSIZ];
+#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 static u8 status_req[STATUS_BYTECOUNT] __attribute__ ((aligned(4)));
+#endif
 
 
 /**
@@ -1252,6 +1259,17 @@ static void rndis_command_complete(struct usb_ep *ep, 
struct usb_request *req)
 
 #endif /* RNDIS */
 
+#ifdef CONFIG_USB_GADGET_PXA2XX
+static inline void pxa_connect_gadget(void)
+{
+   debug(PXA connecting gadget...\n);
+   l_ethdev.network_started = 1;
+   printf(USB network up!\n);
+}
+#else
+static inline void pxa_connect_gadget(void) { }
+#endif
+
 /*
  * The setup() callback implements all the ep0 functionality that's not
  * handled lower down.  CDC has a number of less-common features:
@@ -1352,6 +1370,7 @@ eth_setup(struct usb_gadget *gadget, const struct 
usb_ctrlrequest *ctrl)
if (gadget_is_pxa(gadget)) {
value = eth_set_config(dev, DEV_CONFIG_VALUE,
GFP_ATOMIC);
+   pxa_connect_gadget();
goto done_set_intf;
}
 
-- 
1.7.3.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot