[U-Boot] [PATCH] usb:udc: Remove duplicated USB definitions from include/linux/usb/ch9.h file

2012-04-12 Thread Lukasz Majewski
Remove the repeated USB descriptor code and use usbdescriptors.h file.
ch9.h file has been copied from linux and is needed for USB gadget
related work.
Now usbdescriptors.h and ch9.h shall be used together.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 
---
 drivers/usb/gadget/config.c  |1 +
 drivers/usb/gadget/epautoconf.c  |1 +
 drivers/usb/gadget/ether.c   |1 +
 drivers/usb/gadget/s3c_udc_otg.c |1 +
 drivers/usb/gadget/usbstring.c   |1 +
 include/linux/usb/ch9.h  |   67 --
 include/usb/s3c_udc.h|1 +
 7 files changed, 6 insertions(+), 67 deletions(-)

diff --git a/drivers/usb/gadget/config.c b/drivers/usb/gadget/config.c
index f9163a8..f88d0c1 100644
--- a/drivers/usb/gadget/config.c
+++ b/drivers/usb/gadget/config.c
@@ -27,6 +27,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 5b8776e..b656c8b 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -23,6 +23,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 9fb0e80..f693fea 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c
index 1050a98..f7f7b54 100644
--- a/drivers/usb/gadget/s3c_udc_otg.c
+++ b/drivers/usb/gadget/s3c_udc_otg.c
@@ -37,6 +37,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
diff --git a/drivers/usb/gadget/usbstring.c b/drivers/usb/gadget/usbstring.c
index 9cf..4dbe060 100644
--- a/drivers/usb/gadget/usbstring.c
+++ b/drivers/usb/gadget/usbstring.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index 49b7483..ce1d1e1 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -204,28 +204,6 @@ struct usb_descriptor_header {
__u8  bDescriptorType;
 } __attribute__ ((packed));
 
-
-/*-*/
-
-/* USB_DT_DEVICE: Device descriptor */
-struct usb_device_descriptor {
-   __u8  bLength;
-   __u8  bDescriptorType;
-
-   __le16 bcdUSB;
-   __u8  bDeviceClass;
-   __u8  bDeviceSubClass;
-   __u8  bDeviceProtocol;
-   __u8  bMaxPacketSize0;
-   __le16 idVendor;
-   __le16 idProduct;
-   __le16 bcdDevice;
-   __u8  iManufacturer;
-   __u8  iProduct;
-   __u8  iSerialNumber;
-   __u8  bNumConfigurations;
-} __attribute__ ((packed));
-
 #define USB_DT_DEVICE_SIZE 18
 
 
@@ -282,56 +260,11 @@ struct usb_config_descriptor {
 #define USB_CONFIG_ATT_WAKEUP  (1 << 5)/* can wakeup */
 #define USB_CONFIG_ATT_BATTERY (1 << 4)/* battery powered */
 
-/*-*/
-
-/* USB_DT_STRING: String descriptor */
-struct usb_string_descriptor {
-   __u8  bLength;
-   __u8  bDescriptorType;
-
-   __le16 wData[1];/* UTF-16LE encoded */
-} __attribute__ ((packed));
-
 /* note that "string" zero is special, it holds language codes that
  * the device supports, not Unicode characters.
  */
 
-/*-*/
-
-/* USB_DT_INTERFACE: Interface descriptor */
-struct usb_interface_descriptor {
-   __u8  bLength;
-   __u8  bDescriptorType;
-
-   __u8  bInterfaceNumber;
-   __u8  bAlternateSetting;
-   __u8  bNumEndpoints;
-   __u8  bInterfaceClass;
-   __u8  bInterfaceSubClass;
-   __u8  bInterfaceProtocol;
-   __u8  iInterface;
-} __attribute__ ((packed));
-
 #define USB_DT_INTERFACE_SIZE  9
-
-/*-*/
-
-/* USB_DT_ENDPOINT: Endpoint descriptor */
-struct usb_endpoint_descriptor {
-   __u8  bLength;
-   __u8  bDescriptorType;
-
-   __u8  bEndpointAddress;
-   __u8  bmAttributes;
-   __le16 wMaxPacketSize;
-   __u8  bInterval;
-
-   /* NOTE:  these two are _only_ in audio endpoints. */
-   /* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */
-   __u8  bRefresh;
-   __u8  bSynchAddress;
-} __attribute__ ((packed));
-
 #define USB_DT_ENDPOINT_SIZE   7
 #define USB_DT_ENDPOINT_AUDIO_SIZE 9   /* Audio extension */
 
diff --git a/include/usb/s3c_udc.h b/include/usb/s3c_udc.h
index 6c973b6..3e6135a 100644
--- a/include/usb/s3c_udc.h
+++ b/include/usb/s3c_udc.h
@@ -24,6 +24,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
1.7.2.3

___
U-Boot mailing list
U-Boot@li

[U-Boot] [PATCH 3/4] usb:gadget: Wrapper for extracting usb_gadget from linux's device

2012-04-12 Thread Lukasz Majewski
Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 
---
 include/linux/usb/gadget.h |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 275cb5f..b0a0e1f 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -481,6 +481,11 @@ static inline void *get_gadget_data(struct usb_gadget 
*gadget)
return gadget->dev.driver_data;
 }
 
+static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev)
+{
+   return container_of(dev, struct usb_gadget, dev);
+}
+
 /* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */
 #define gadget_for_each_ep(tmp, gadget) \
list_for_each_entry(tmp, &(gadget)->ep_list, ep_list)
-- 
1.7.2.3

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


[U-Boot] [PATCH 0/4] usb:gadget:composite: Support for composite gadget framework

2012-04-12 Thread Lukasz Majewski
This patch set provides support for composite gadget framework.
Files from Linux kernel (2.6.36) - namely composite.{c|h} have been
ported.

Some extra "compatibility" code has been added as well. 

Lukasz Majewski (4):
  usb:gadget:composite Composite framework - files from Linux kernel
  usb:gadget:composite: Linux composite.{h/c} code adjustement for
u-boot
  usb:gadget: Wrapper for extracting usb_gadget from linux's device
  usb:gadget: Extend device struct to device_data pointer

 drivers/usb/gadget/composite.c | 1253 
 include/linux/usb/composite.h  |  417 +
 include/linux/usb/gadget.h |6 +
 3 files changed, 1676 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/composite.c
 create mode 100644 include/linux/usb/composite.h

-- 
1.7.2.3

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


[U-Boot] [PATCH 1/4] usb:gadget:composite Composite framework - files from Linux kernel

2012-04-12 Thread Lukasz Majewski
Two files from Linux kernel source tree have been ported
to u-boot (Linux Kernel v2.6.36):

./include/linux/usb/composite.h
./drivers/usb/gadget/composite.c

commit d187abb9a83e6c6b6e9f2ca17962bdeafb4bc903
Author: Randy Dunlap 
Date:   Wed Aug 11 12:07:13 2010 -0700

USB: gadget: fix composite kernel-doc warnings

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 
---
 drivers/usb/gadget/composite.c | 1235 
 include/linux/usb/composite.h  |  365 
 2 files changed, 1600 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/composite.c
 create mode 100644 include/linux/usb/composite.h

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
new file mode 100644
index 000..1160c55
--- /dev/null
+++ b/drivers/usb/gadget/composite.c
@@ -0,0 +1,1235 @@
+/*
+ * composite.c - infrastructure for Composite USB Gadgets
+ *
+ * Copyright (C) 2006-2008 David Brownell
+ *
+ * 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
+ */
+
+/* #define VERBOSE_DEBUG */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+
+/*
+ * The code in this file is utility code, used to build a gadget driver
+ * from one or more "function" drivers, one or more "configuration"
+ * objects, and a "usb_composite_driver" by gluing them together along
+ * with the relevant device-wide data.
+ */
+
+/* big enough to hold our biggest descriptor */
+#define USB_BUFSIZ 1024
+
+static struct usb_composite_driver *composite;
+
+/* Some systems will need runtime overrides for the  product identifers
+ * published in the device descriptor, either numbers or strings or both.
+ * String parameters are in UTF-8 (superset of ASCII's 7 bit characters).
+ */
+
+static ushort idVendor;
+module_param(idVendor, ushort, 0);
+MODULE_PARM_DESC(idVendor, "USB Vendor ID");
+
+static ushort idProduct;
+module_param(idProduct, ushort, 0);
+MODULE_PARM_DESC(idProduct, "USB Product ID");
+
+static ushort bcdDevice;
+module_param(bcdDevice, ushort, 0);
+MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)");
+
+static char *iManufacturer;
+module_param(iManufacturer, charp, 0);
+MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string");
+
+static char *iProduct;
+module_param(iProduct, charp, 0);
+MODULE_PARM_DESC(iProduct, "USB Product string");
+
+static char *iSerialNumber;
+module_param(iSerialNumber, charp, 0);
+MODULE_PARM_DESC(iSerialNumber, "SerialNumber string");
+
+/*-*/
+
+/**
+ * usb_add_function() - add a function to a configuration
+ * @config: the configuration
+ * @function: the function being added
+ * Context: single threaded during gadget setup
+ *
+ * After initialization, each configuration must have one or more
+ * functions added to it.  Adding a function involves calling its @bind()
+ * method to allocate resources such as interface and string identifiers
+ * and endpoints.
+ *
+ * This function returns the value of the function's bind(), which is
+ * zero for success else a negative errno value.
+ */
+int usb_add_function(struct usb_configuration *config,
+   struct usb_function *function)
+{
+   int value = -EINVAL;
+
+   DBG(config->cdev, "adding '%s'/%p to config '%s'/%p\n",
+   function->name, function,
+   config->label, config);
+
+   if (!function->set_alt || !function->disable)
+   goto done;
+
+   function->config = config;
+   list_add_tail(&function->list, &config->functions);
+
+   /* REVISIT *require* function->bind? */
+   if (function->bind) {
+   value = function->bind(config, function);
+   if (value < 0) {
+   list_del(&function->list);
+   function->config = NULL;
+   }
+   } else
+   value = 0;
+
+   /* We allow configurations that don't work at both speeds.
+* If we run into a lowspeed Linux system, treat it the same
+* as full speed ... it's the function drivers that will need
+* to avoid bulk and ISO transfers.
+*/
+   if (!config->fullspeed && function->descriptors)
+   config->fullspeed = true;
+   if (!config->h

[U-Boot] [PATCH 2/4] usb:gadget:composite: Linux composite.{h/c} code adjustement for u-boot

2012-04-12 Thread Lukasz Majewski
This commit fixes Linux kernel's composite.{h/c} code to work with u-boot.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Andrzej Pietrasiewicz 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 
---
 drivers/usb/gadget/composite.c |   58 ++--
 include/linux/usb/composite.h  |   52 +++
 2 files changed, 90 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 1160c55..6a20278 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -18,13 +18,14 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-/* #define VERBOSE_DEBUG */
+#define VERBOSE_DEBUG
 
-#include 
-#include 
-#include 
-#include 
+/* #include  */
+/* #include  */
+/* #include  */
+/* #include  */
 
+#include 
 #include 
 
 
@@ -36,7 +37,7 @@
  */
 
 /* big enough to hold our biggest descriptor */
-#define USB_BUFSIZ 1024
+#define USB_BUFSIZ 4096
 
 static struct usb_composite_driver *composite;
 
@@ -404,13 +405,23 @@ static int set_config(struct usb_composite_dev *cdev,
result = 0;
 
INFO(cdev, "%s speed config #%d: %s\n",
-   ({ char *speed;
-   switch (gadget->speed) {
-   case USB_SPEED_LOW: speed = "low"; break;
-   case USB_SPEED_FULL:speed = "full"; break;
-   case USB_SPEED_HIGH:speed = "high"; break;
-   default:speed = "?"; break;
-   } ; speed; }), number, c ? c->label : "unconfigured");
+({ char *speed;
+switch (gadget->speed) {
+case USB_SPEED_LOW:
+speed = "low";
+break;
+case USB_SPEED_FULL:
+speed = "full";
+break;
+case USB_SPEED_HIGH:
+speed = "high";
+break;
+default:
+speed = "?";
+break;
+};
+speed;
+}), number, c ? c->label : "unconfigured");
 
if (!c)
goto done;
@@ -779,6 +790,7 @@ composite_setup(struct usb_gadget *gadget, const struct 
usb_ctrlrequest *ctrl)
u16 w_length = le16_to_cpu(ctrl->wLength);
struct usb_function *f = NULL;
u8  endp;
+   boolstandard;
 
/* partial re-init of the response message; the function or the
 * gadget might need to intercept e.g. a control-OUT completion
@@ -788,6 +800,10 @@ composite_setup(struct usb_gadget *gadget, const struct 
usb_ctrlrequest *ctrl)
req->complete = composite_setup_complete;
req->length = USB_BUFSIZ;
gadget->ep0->driver_data = cdev;
+   standard = (ctrl->bRequestType & USB_TYPE_MASK)
+   == USB_TYPE_STANDARD;
+   if (!standard)
+   goto unknown;
 
switch (ctrl->bRequest) {
 
@@ -825,6 +841,8 @@ composite_setup(struct usb_gadget *gadget, const struct 
usb_ctrlrequest *ctrl)
if (value >= 0)
value = min(w_length, (u16) value);
break;
+   default:
+   goto unknown;
}
break;
 
@@ -963,7 +981,7 @@ static void composite_disconnect(struct usb_gadget *gadget)
 
 /*-*/
 
-static ssize_t composite_show_suspended(struct device *dev,
+/* static ssize_t composite_show_suspended(struct device *dev,
struct device_attribute *attr,
char *buf)
 {
@@ -973,7 +991,7 @@ static ssize_t composite_show_suspended(struct device *dev,
return sprintf(buf, "%d\n", cdev->suspended);
 }
 
-static DEVICE_ATTR(suspended, 0444, composite_show_suspended, NULL);
+static DEVICE_ATTR(suspended, 0444, composite_show_suspended, NULL); */
 
 static void
 composite_unbind(struct usb_gadget *gadget)
@@ -985,7 +1003,7 @@ composite_unbind(struct usb_gadget *gadget)
 * so there's no i/o concurrency that could affect the
 * state protected by cdev->lock.
 */
-   WARN_ON(cdev->config);
+   BUG_ON(cdev->config);
 
while (!list_empty(&cdev->configs)) {
struct usb_configuration*c;
@@ -1186,9 +1204,9 @@ static struct usb_gadget_driver composite_driver = {
.suspend= composite_suspend,
.resume = composite_resume,
 
-   .driver = {
+   /* .driver  = {
.owner  = THIS_MODULE,
-   },
+   }, */
 };
 
 /**
@@ -1213,8 +1231,8 @@ int

[U-Boot] [PATCH 4/4] usb:gadget: Extend device struct to device_data pointer

2012-04-12 Thread Lukasz Majewski
Add device data pointer to the USB gadget's device struct.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 
---
 include/linux/usb/gadget.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index b0a0e1f..eba865e 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -411,6 +411,7 @@ struct usb_gadget_ops {
 
 struct device {
void*driver_data;   /* data private to the driver */
+   void*device_data;   /* data private to the device */
 };
 
 /**
-- 
1.7.2.3

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


[U-Boot] [PATCH] usb:udc:samsung Add functions for storing private gadget data in UDC driver

2012-04-12 Thread Lukasz Majewski
This commit adds support for storing private data to Samsung's UDC
driver. This data is afterward used by usb gadget.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 
---
 drivers/usb/gadget/s3c_udc_otg.c |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c
index f7f7b54..cb4916c 100644
--- a/drivers/usb/gadget/s3c_udc_otg.c
+++ b/drivers/usb/gadget/s3c_udc_otg.c
@@ -133,6 +133,18 @@ static void nuke(struct s3c_ep *ep, int status);
 static int s3c_udc_set_halt(struct usb_ep *_ep, int value);
 static void s3c_udc_set_nak(struct s3c_ep *ep);
 
+void set_udc_gadget_private_data(void *p)
+{
+   printf("%s: the_controller: 0x%p, p: 0x%p\n", __func__,
+  the_controller, p);
+   the_controller->gadget.dev.device_data = p;
+}
+
+void *get_udc_gadget_private_data(struct usb_gadget *gadget)
+{
+   return gadget->dev.device_data;
+}
+
 static struct usb_ep_ops s3c_ep_ops = {
.enable = s3c_ep_enable,
.disable = s3c_ep_disable,
-- 
1.7.2.3

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


[U-Boot] [PATCH 1/6] usb:composite:g_dnl: Composite gadget (g_dnl) for USB downloading functions

2012-04-12 Thread Lukasz Majewski
Composite USB download gadget (g_dnl) for download functions (e.g. DFU,
THOR, others)

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 
---
 drivers/usb/gadget/Makefile |1 +
 drivers/usb/gadget/g_dnl.c  |  231 +++
 include/g_dnl.h |   97 ++
 3 files changed, 329 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/g_dnl.c
 create mode 100644 include/g_dnl.h

diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 87d1918..2c067c8 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -29,6 +29,7 @@ LIB   := $(obj)libusb_gadget.o
 ifdef CONFIG_USB_GADGET
 COBJS-y += epautoconf.o config.o usbstring.o
 COBJS-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
+COBJS-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
 endif
 ifdef CONFIG_USB_ETHER
 COBJS-y += ether.o epautoconf.o config.o usbstring.o
diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
new file mode 100644
index 000..425f4f6
--- /dev/null
+++ b/drivers/usb/gadget/g_dnl.c
@@ -0,0 +1,231 @@
+/*
+ * g_dnl.c -- USB Downloader Gadget
+ *
+ * Copyright (C) 2012 Samsung Electronics
+ * Lukasz Majewski  
+ *
+ * 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
+ */
+#undef DEBUG
+#define DEBUG
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include "usbd_thor.h"
+#include "gadget_chips.h"
+
+#include "composite.c"
+
+#define DRIVER_VERSION "usb_dnl 2.0"
+
+static const char shortname[] = "usb_dnl_";
+static const char product[] = "SLP USB download gadget";
+static const char manufacturer[] = "Samsung";
+
+static struct usb_device_descriptor device_desc = {
+   .bLength =  sizeof device_desc,
+   .bDescriptorType =  USB_DT_DEVICE,
+
+   .bcdUSB =   __constant_cpu_to_le16(0x0200),
+   .bDeviceClass = USB_CLASS_COMM,
+   .bDeviceSubClass =  0x02,   /*0x02:CDC-modem , 0x00:CDC-serial*/
+
+   .idVendor = __constant_cpu_to_le16(DRIVER_VENDOR_NUM),
+   .idProduct =__constant_cpu_to_le16(DRIVER_PRODUCT_NUM),
+   .iProduct = STRING_PRODUCT,
+   .bNumConfigurations =   1,
+};
+
+static const struct usb_descriptor_header *otg_desc[] = {
+   (struct usb_descriptor_header *) &(struct usb_otg_descriptor){
+   .bLength =  sizeof(struct usb_otg_descriptor),
+   .bDescriptorType =  USB_DT_OTG,
+   .bmAttributes = USB_OTG_SRP,
+   },
+   NULL,
+};
+
+/* static strings, in UTF-8 */
+static struct usb_string odin_string_defs[] = {
+   { 0, manufacturer, },
+   { 1, product, },
+};
+
+static struct usb_gadget_strings odin_string_tab = {
+   .language   = 0x0409,   /* en-us */
+   .strings= odin_string_defs,
+};
+
+static struct usb_gadget_strings *g_dnl_composite_strings[] = {
+   &odin_string_tab,
+   NULL,
+};
+
+static int g_dnl_unbind(struct usb_composite_dev *cdev)
+{
+   debug("%s\n", __func__);
+   return 0;
+}
+
+static int g_dnl_do_config(struct usb_configuration *c)
+{
+   int ret = -1;
+   char *s = (char *) c->cdev->driver->name;
+
+   debug("%s: c: 0x%p cdev: 0x%p\n", __func__, c, c->cdev);
+
+   if (gadget_is_otg(c->cdev->gadget)) {
+   c->descriptors = otg_desc;
+   c->bmAttributes |= USB_CONFIG_ATT_WAKEUP;
+   }
+
+   printf("GADGET DRIVER: %s\n", s);
+
+   if (!strcmp(s, "usb_dnl_thor"))
+   ret = f_usbd_add(c);
+
+   return ret;
+}
+
+static int g_dnl_config_register(struct usb_composite_dev *cdev)
+{
+   debug("%s:\n", __func__);
+   static struct usb_configuration config = {
+   .label = "usbd_thor_download",
+   .bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
+   .bConfigurationValue =  CONFIG_USBDOWNLOADER,
+   .iConfiguration =   STRING_USBDOWN,
+
+   .bind = g_dnl_do_config,
+   };
+
+   return usb_add_config(cdev, &config);
+}
+
+static int g_dnl_bind(struct usb_composite_dev *cdev)
+{
+   int gcnum;
+   int id, ret;
+   struc

[U-Boot] [PATCH 0/6] usb:composite:download Composite download gadget

2012-04-12 Thread Lukasz Majewski
This patch series provides a composite gadget for downloading code
to u-boot targets.

The Linux's composite gadget framework is used. For this series a 
special function (f_usbd_thor) has been added. It supports a THOR 
protocol for sending data.

Other functions and protocols backends can be easily added - for 
instance supporting DFU.

---
Dependences (commits):
- usb:udc: Remove duplicated USB definitions from include/linux/usb/ch9.h file
- usb:gadget:composite Composite framework (separate patch series)
- usb:udc:samsung Add functions for storing private gadget data in UDC driver


Lukasz Majewski (6):
  usb:composite:g_dnl: Composite gadget (g_dnl) for USB downloading
functions
  usb:g_dnl:f_usbd_thor: USB Download function to support THOR protocol
  usb:g_dnl:thor: THOR protocol back end support for f_usbd_thor
function
  usb:command: Support for USB Download command
  usb:g_dnl: Support for g_dnl download usb gadget for GONI board
  usb:g_dnl: Support for g_dnl download usb gadget for TRATS board

 board/samsung/goni/goni.c|8 +
 board/samsung/trats/trats.c  |8 +
 common/Makefile  |1 +
 common/cmd_usbd.c|  161 
 drivers/usb/gadget/Makefile  |2 +
 drivers/usb/gadget/f_usbd_thor.c |  808 ++
 drivers/usb/gadget/g_dnl.c   |  231 +++
 drivers/usb/gadget/prot_thor.c   |  247 
 drivers/usb/gadget/prot_thor.h   |  112 ++
 include/configs/s5p_goni.h   |   33 ++-
 include/configs/trats.h  |   17 +
 include/g_dnl.h  |   97 +
 include/linux/usb/f_usbd_thor.h  |   62 +++
 include/usbd_thor.h  |  108 +
 14 files changed, 1889 insertions(+), 6 deletions(-)
 create mode 100644 common/cmd_usbd.c
 create mode 100644 drivers/usb/gadget/f_usbd_thor.c
 create mode 100644 drivers/usb/gadget/g_dnl.c
 create mode 100644 drivers/usb/gadget/prot_thor.c
 create mode 100644 drivers/usb/gadget/prot_thor.h
 create mode 100644 include/g_dnl.h
 create mode 100644 include/linux/usb/f_usbd_thor.h
 create mode 100644 include/usbd_thor.h

-- 
1.7.2.3

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


[U-Boot] [PATCH 4/6] usb:command: Support for USB Download command

2012-04-12 Thread Lukasz Majewski
Support for usbdownload command, which starts USB Downloading process
compliant with Samsung's THOR protocol.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 
---
 common/Makefile   |1 +
 common/cmd_usbd.c |  161 +
 2 files changed, 162 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_usbd.c

diff --git a/common/Makefile b/common/Makefile
index d9f10f3..2392893 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -161,6 +161,7 @@ COBJS-y += cmd_usb.o
 COBJS-y += usb.o usb_hub.o
 COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
 endif
+COBJS-$(CONFIG_USBDOWNLOAD_GADGET) += cmd_usbd.o
 COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
 COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
 COBJS-$(CONFIG_CMD_SPL) += cmd_spl.o
diff --git a/common/cmd_usbd.c b/common/cmd_usbd.c
new file mode 100644
index 000..583f2a5
--- /dev/null
+++ b/common/cmd_usbd.c
@@ -0,0 +1,161 @@
+/*
+ * cmd_usbd.c -- USB THOR Downloader gadget
+ *
+ * Copyright (C) 2012 Lukasz Majewski 
+ * All rights reserved.
+ *
+ * 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
+ */
+#define DEBUG
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define STR_SIZE 16
+
+static char dnl_tab[4][STR_SIZE];
+
+char *find_dnl_entry(char* s, char *name)
+{
+   char *st, *c;
+
+   for (; s; strsep(&s, ";"), st = s) {
+   st = strchr(s, ' ');
+
+   if (!strncmp(s, name, st - s)) {
+   for (c = s; c; strsep(&c, ";"))
+   ;
+   return s;
+   }
+   }
+   return NULL;
+}
+
+int img_store(struct g_dnl *dnl, int medium)
+{
+   char cmd_buf[128];
+
+   memset(cmd_buf, '\0', sizeof(cmd_buf));
+
+   switch (medium) {
+   case MMC:
+   sprintf(cmd_buf, "%s write 0x%x %s %s", &dnl_tab[1][0],
+   (unsigned int) dnl->rx_buf, &dnl_tab[2][0],
+   &dnl_tab[3][0]);
+   break;
+   case FAT:
+   sprintf(cmd_buf, "%swrite mmc %s:%s 0x%x %s %x",
+   &dnl_tab[1][0], &dnl_tab[2][0], &dnl_tab[3][0],
+   (unsigned int) dnl->rx_buf, &dnl_tab[0][0],
+   dnl->file_size);
+   break;
+   case RAW:
+   sprintf(cmd_buf, "mmc write 0x%x %x %x",
+   (unsigned int) dnl->rx_buf, dnl->p, dnl->packet_size);
+   break;
+   }
+
+   debug("%s: %s\n", __func__, cmd_buf);
+   run_command(cmd_buf, 0);
+
+   return 0;
+}
+
+int do_usbd_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   /* Simple argv[0] passing is not working since 'usbdown' cmd can
+  be run by */
+   /* 'usb', 'usbd' or 'usbdown' */
+   char *str, *st, *str_env;
+
+   int ret = 0, i = 0;
+   static char *s = "thor";
+   static struct g_dnl *dnl;
+
+   dnl = memalign(CONFIG_SYS_CACHELINE_SIZE, sizeof(struct g_dnl));
+
+   puts("THOR Downloader\n");
+
+   g_dnl_init(s, dnl);
+
+   ret = dnl_init(dnl);
+   if (ret)
+   printf("%s: USBDOWN failed\n", __func__);
+
+   ret = dnl_command(dnl);
+   if (ret < 0)
+   printf("%s: COMMAND failed: %d\n", __func__, ret);
+
+   debug("DNL: file:%s size:%d\n", dnl->file_name, dnl->file_size);
+
+   str_env = getenv("dnl_info");
+   if (str_env == NULL) {
+   puts("DNL: \"dnl_info\" variable not defined!\n");
+   return -1;
+   }
+   debug("dnl_info: %s\n", str_env);
+
+   str = find_dnl_entry(str_env, dnl->file_name);
+   if (str == NULL) {
+   printf("File: %s not at \"dnl_info\"!\n", dnl->file_name);
+   return -1;
+   }
+
+   debug("%s:str: %s\n", __func__, str);
+
+   memset(dnl_tab, '\0', sizeof(dnl_tab));
+   do {
+   st = strsep(&str, " ");
+   strncpy(&dnl_tab[i++][0], st, strlen(st));
+
+   } while (str);
+
+   if (strncmp(dnl->file_name, &dnl_tab[0][0], strlen(&dnl_tab[0][0]))) {
+   printf("Parsed string not match file: %s!\n", dnl->file_name);
+   return -1;
+   }
+
+   debug("%s %s %s %s\n", &dnl_tab[0][0], &dnl_tab[1][0],
+  &dn

[U-Boot] [PATCH 3/6] usb:g_dnl:thor: THOR protocol back end support for f_usbd_thor function

2012-04-12 Thread Lukasz Majewski
Support for THOR download protocol. Those files are necessary for
proper f_usbd_thor function proper work.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 
---
 drivers/usb/gadget/prot_thor.c |  247 
 drivers/usb/gadget/prot_thor.h |  112 ++
 include/usbd_thor.h|  108 +
 3 files changed, 467 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/prot_thor.c
 create mode 100644 drivers/usb/gadget/prot_thor.h
 create mode 100644 include/usbd_thor.h

diff --git a/drivers/usb/gadget/prot_thor.c b/drivers/usb/gadget/prot_thor.c
new file mode 100644
index 000..9b2610d
--- /dev/null
+++ b/drivers/usb/gadget/prot_thor.c
@@ -0,0 +1,247 @@
+/*
+ * prot_thor.c -- USB THOR Downloader protocol
+ *
+ * Copyright (C) 2012 Samsung Electronics
+ * Lukasz Majewski 
+ *
+ * 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
+ *
+ */
+#undef DEBUG
+#include 
+#include 
+#include 
+#include "prot_thor.h"
+
+static void send_rsp(const rsp_box *rsp)
+{
+   /* should be copy on dma duffer */
+   memcpy(usbd_tx_data_buf, rsp, sizeof(rsp_box));
+   pkt_upload(usbd_tx_data_buf, sizeof(rsp_box));
+
+   debug("-RSP: %d, %d\n", rsp->rsp, rsp->rsp_data);
+}
+
+static void send_data_rsp(s32 ack, s32 count)
+{
+   data_rsp_box rsp;
+
+   rsp.ack = ack;
+   rsp.count = count;
+
+   /* should be copy on dma duffer */
+   memcpy(usbd_tx_data_buf, &rsp, sizeof(data_rsp_box));
+   pkt_upload(usbd_tx_data_buf, sizeof(data_rsp_box));
+
+   debug("-DATA RSP: %d, %d\n", ack, count);
+}
+
+static int process_rqt_info(const rqt_box *rqt)
+{
+   rsp_box rsp = {0, };
+
+   rsp.rsp = rqt->rqt;
+   rsp.rsp_data = rqt->rqt_data;
+
+   switch (rqt->rqt_data) {
+   case RQT_INFO_VER_PROTOCOL:
+   rsp.int_data[0] = VER_PROTOCOL_MAJOR;
+   rsp.int_data[1] = VER_PROTOCOL_MINOR;
+   break;
+   case RQT_INIT_VER_HW:
+   sprintf(rsp.str_data[0], "%x", checkboard());
+   break;
+   case RQT_INIT_VER_BOOT:
+   sprintf(rsp.str_data[0], "%s", getenv("ver"));
+   break;
+   case RQT_INIT_VER_KERNEL:
+   sprintf(rsp.str_data[0], "%s", "k unknown");
+   break;
+   case RQT_INIT_VER_PLATFORM:
+   sprintf(rsp.str_data[0], "%s", "p unknown");
+   break;
+   case RQT_INIT_VER_CSC:
+   sprintf(rsp.str_data[0], "%s", "c unknown");
+   break;
+   default:
+   return 0;
+   }
+
+   send_rsp(&rsp);
+   return 1;
+}
+
+static int process_rqt_cmd(const rqt_box *rqt)
+{
+   rsp_box rsp = {0, };
+
+   rsp.rsp = rqt->rqt;
+   rsp.rsp_data = rqt->rqt_data;
+
+   switch (rqt->rqt_data) {
+   case RQT_CMD_REBOOT:
+   debug("TARGET RESET\n");
+   send_rsp(&rsp);
+   run_command("reset", 0);
+   break;
+   case RQT_CMD_POWEROFF:
+   case RQT_CMD_EFSCLEAR:
+   send_rsp(&rsp);
+   default:
+   printf("Command not supported -> cmd: %d\n", rqt->rqt_data);
+   return -1;
+   }
+
+   return 0;
+}
+
+static unsigned long download(unsigned int total, unsigned int packet_size,
+ struct g_dnl *dnl)
+{
+   int count = 0;
+   unsigned int rcv_cnt;
+   static int sect_start = 92160; /* Hardcoded -> will be fixed -> */
+   unsigned int dma_buffer_address = CONFIG_SYS_DOWN_ADDR;
+
+   do {
+   if (packet_size == PKT_DOWNLOAD_SIZE)
+   dma_buffer_address =
+   CONFIG_SYS_DOWN_ADDR + (count * packet_size);
+
+   usbd_set_dma((char *) dma_buffer_address,
+packet_size);
+
+   rcv_cnt += usbd_rx_data();
+   debug("RCV data count: %u\n", rcv_cnt);
+
+   /* Store data after receiving a "chunk" packet */
+   if (packet_size == PKT_DOWNLOAD_CHUNK_SIZE &&
+   (rcv_cnt % PKT_DOWNLOAD_CHUNK_SIZE) == 0) {
+   dnl->p = (sect_start + count *
+ (PKT_DOWNLOAD_CHUNK_SIZE >> 9));
+

[U-Boot] [PATCH 2/6] usb:g_dnl:f_usbd_thor: USB Download function to support THOR protocol

2012-04-12 Thread Lukasz Majewski
Implementation of USB Download function supporting THOR protocol.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 
---
 drivers/usb/gadget/Makefile  |1 +
 drivers/usb/gadget/f_usbd_thor.c |  808 ++
 include/linux/usb/f_usbd_thor.h  |   62 +++
 3 files changed, 871 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/f_usbd_thor.c
 create mode 100644 include/linux/usb/f_usbd_thor.h

diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 2c067c8..0c48368 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -29,6 +29,7 @@ LIB   := $(obj)libusb_gadget.o
 ifdef CONFIG_USB_GADGET
 COBJS-y += epautoconf.o config.o usbstring.o
 COBJS-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
+COBJS-$(CONFIG_USBDOWNLOAD_FUNCTION) += f_usbd_thor.o prot_thor.o
 COBJS-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
 endif
 ifdef CONFIG_USB_ETHER
diff --git a/drivers/usb/gadget/f_usbd_thor.c b/drivers/usb/gadget/f_usbd_thor.c
new file mode 100644
index 000..e2394e3
--- /dev/null
+++ b/drivers/usb/gadget/f_usbd_thor.c
@@ -0,0 +1,808 @@
+/*
+ * f_usbd_thor.c -- USB THOR Downloader gadget function
+ *
+ * Copyright (C) 2011-2012 Samsung Electronics
+ * Lukasz Majewski 
+ *
+ * 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
+ */
+#undef DEBUG
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "usbd_thor.h"
+#include "prot_thor.h"
+#include "gadget_chips.h"
+
+#define DMA_BUFFER_SIZE(4096*4)
+
+static struct f_usbd *usbd_func;
+static const unsigned buflen = 512; /* Standard request buffer length */
+
+struct usbd_dev {
+   struct usb_gadget   *gadget;
+   struct usb_request  *req;   /* for control responses */
+
+   /* IN/OUT EP's and correspoinding requests */
+   struct usb_ep   *in_ep, *out_ep, *int_ep;
+   struct usb_request  *in_req, *out_req;
+
+   /* Control flow variables*/
+   int configuration_done;
+   int stop_done;
+   int rxdata;
+   int txdata;
+};
+
+struct f_usbd {
+   struct usb_function usb_function;
+   struct usbd_dev *dev;
+};
+
+static inline struct f_usbd *func_to_usbd(struct usb_function *f)
+{
+   return container_of(f, struct f_usbd, usb_function);
+}
+
+/* maxpacket and other transfer characteristics vary by speed. */
+static inline struct usb_endpoint_descriptor *
+ep_desc(struct usb_gadget *g, struct usb_endpoint_descriptor *hs,
+   struct usb_endpoint_descriptor *fs)
+{
+   if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH)
+   return hs;
+   return fs;
+}
+
+/* one interface in each configuration */
+static struct usb_interface_descriptor usb_downloader_intf_data = {
+   .bLength =  sizeof usb_downloader_intf_data,
+   .bDescriptorType =  USB_DT_INTERFACE,
+
+   .bNumEndpoints =2,
+   .bInterfaceClass =  USB_CLASS_CDC_DATA,
+};
+
+
+/* two full speed bulk endpoints; their use is config-dependent */
+static struct usb_endpoint_descriptor fs_in_desc = {
+   .bLength =  USB_DT_ENDPOINT_SIZE,
+   .bDescriptorType =  USB_DT_ENDPOINT,
+
+   .bEndpointAddress = USB_DIR_IN,
+   .bmAttributes = USB_ENDPOINT_XFER_BULK,
+};
+
+static struct usb_endpoint_descriptor fs_out_desc = {
+   .bLength =  USB_DT_ENDPOINT_SIZE,
+   .bDescriptorType =  USB_DT_ENDPOINT,
+
+   .bEndpointAddress = USB_DIR_OUT,
+   .bmAttributes = USB_ENDPOINT_XFER_BULK,
+};
+
+/* CDC configuration */
+
+static struct usb_interface_descriptor usb_downloader_intf_int = {
+   .bLength =  sizeof usb_downloader_intf_int,
+   .bDescriptorType =  USB_DT_INTERFACE,
+
+   .bNumEndpoints =1,
+   .bInterfaceClass =  USB_CLASS_COMM,
+/* 0x02 Abstract Line Control Model */
+   .bInterfaceSubClass =   COMMUNICATIONS_INTERFACE_CLASS_CONTROL,
+   /* 0x01 Common AT commands */
+   .bInterfaceProtocol =   COMMUNICATIONS_V25TER_PROTOCOL,
+};
+
+static struct usb_class_header_function_descriptor usb_downloader_cdc_header = 
{
+   .bFunctionLen

[U-Boot] [PATCH 6/6] usb:g_dnl: Support for g_dnl download usb gadget for TRATS board

2012-04-12 Thread Lukasz Majewski
Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Minkyu Kang 
---
 board/samsung/trats/trats.c |8 
 include/configs/trats.h |   17 +
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index a7b4e4a..31826a0 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -244,6 +244,14 @@ struct s3c_plat_otg_data s5pc210_otg_data = {
 };
 #endif
 
+#ifdef CONFIG_USBDOWNLOAD_GADGET
+void usbd_thor_udc_probe(void)
+{
+   puts("USB_udc_probe\n");
+   s3c_udc_probe(&s5pc210_otg_data);
+}
+#endif
+
 static void pmic_reset(void)
 {
struct exynos4_gpio_part2 *gpio =
diff --git a/include/configs/trats.h b/include/configs/trats.h
index 585fd71..af0bbd1 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -95,6 +95,14 @@
 #undef CONFIG_CMD_MTDPARTS
 #define CONFIG_CMD_MMC
 
+/* FAT */
+#define CONFIG_CMD_FAT
+#define CONFIG_FAT_WRITE
+
+/* USB Composite download gadget - g_dnl */
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USBDOWNLOAD_FUNCTION
+
 #define CONFIG_BOOTDELAY   1
 #define CONFIG_ZERO_BOOTDELAY_CHECK
 #define CONFIG_BOOTARGS"Please use defined boot"
@@ -104,6 +112,12 @@
 #define CONFIG_BOOTBLOCK   "10"
 #define CONFIG_ENV_COMMON_BOOT "${console} ${meminfo}"
 
+#define CONFIG_DNL_INFO \
+   "dnl_info=" \
+   "u-boot mmc 80 200;" \
+   "uImage fat 0 2;" \
+   "platform.img raw 0 3\0" \
+
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
@@ -213,5 +227,8 @@
 #define CONFIG_USB_GADGET
 #define CONFIG_USB_GADGET_S3C_UDC_OTG
 #define CONFIG_USB_GADGET_DUALSPEED
+#define CONFIG_USB_GADGET_VBUS_DRAW2
+
+#define CONFIG_SYS_DOWN_ADDR   CONFIG_SYS_SDRAM_BASE
 
 #endif /* __CONFIG_H */
-- 
1.7.2.3

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


[U-Boot] [PATCH 5/6] usb:g_dnl: Support for g_dnl download usb gadget for GONI board

2012-04-12 Thread Lukasz Majewski
Support for g_dnl download usb gadget driver for Samsung's GONI target.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Minkyu Kang 
---
 board/samsung/goni/goni.c  |8 
 include/configs/s5p_goni.h |   33 +++--
 2 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index e8fb1ea..ec92baf 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -146,3 +146,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = {
.usb_phy_ctrl = S5PC110_USB_PHY_CONTROL,
 };
 #endif
+
+#ifdef CONFIG_USBDOWNLOAD_GADGET
+void usbd_thor_udc_probe(void)
+{
+   puts("USB_udc_probe\n");
+   s3c_udc_probe(&s5pc110_otg_data);
+}
+#endif
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index 56b5547..638bf39 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -87,6 +87,14 @@
 #define CONFIG_CMD_MTDPARTS
 #define CONFIG_CMD_MMC
 
+/* FAT */
+#define CONFIG_CMD_FAT
+#define CONFIG_FAT_WRITE
+
+/* USB Composite download gadget - g_dnl */
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_USBDOWNLOAD_FUNCTION
+
 #define CONFIG_BOOTDELAY   1
 #define CONFIG_ZERO_BOOTDELAY_CHECK
 
@@ -107,7 +115,7 @@
 
 #define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
 
-#define CONFIG_BOOTCOMMAND "run ubifsboot"
+#define CONFIG_BOOTCOMMAND "run mmcboot"
 
 #define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"
 
@@ -126,6 +134,12 @@
 
 #define CONFIG_UBIFS_OPTION"rootflags=bulk_read,no_chk_data_crc"
 
+#define CONFIG_DNL_INFO \
+   "dnl_info=" \
+   "u-boot mmc 80 200;" \
+   "uImage fat 0 2;" \
+   "platform.img raw 0 3\0" \
+
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 #define CONFIG_EXTRA_ENV_SETTINGS  \
@@ -155,10 +169,9 @@
"ramboot=" \
"set bootargs " CONFIG_RAMDISK_BOOT \
" initrd=0x3300,8M ramdisk=8192\0" \
-   "mmcboot=" \
-   "set bootargs root=${mmcblk} rootfstype=${rootfstype}" \
-   CONFIG_UBI_MTD " ${opts} ${lcdinfo} " \
-   CONFIG_COMMON_BOOT "; run bootk\0" \
+   "mmcboot=set bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \
+   "rootwait ${console} ${meminfo} ${opts} ${lcdinfo}; " \
+   "run loaduimage; bootm 0x30007FC0\0" \
"boottrace=setenv opts initcall_debug; run bootcmd\0" \
"bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \
"verify=n\0" \
@@ -170,7 +183,12 @@
"bootblock=9\0" \
"ubiblock=8\0" \
"ubi=enabled\0" \
-   "opts=always_resume=1"
+   "loaduimage=fatload mmc ${mmcdev}:${mmcbootpart} 0x30007FC0 uImage\0" \
+   "mmcdev=0\0" \
+   "mmcbootpart=2\0" \
+   "mmcrootpart=3\0" \
+   "opts=always_resume=1\0" \
+   CONFIG_DNL_INFO
 
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_LONGHELP/* undef to save memory */
@@ -240,5 +258,8 @@
 #define CONFIG_USB_GADGET
 #define CONFIG_USB_GADGET_S3C_UDC_OTG
 #define CONFIG_USB_GADGET_DUALSPEED
+#define CONFIG_USB_GADGET_VBUS_DRAW2
+
+#define CONFIG_SYS_DOWN_ADDR   CONFIG_SYS_SDRAM_BASE
 
 #endif /* __CONFIG_H */
-- 
1.7.2.3

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


Re: [U-Boot] [PATCH] usb:udc: Remove duplicated USB definitions from include/linux/usb/ch9.h file

2012-04-12 Thread Marek Vasut
Dear Lukasz Majewski,

> Remove the repeated USB descriptor code and use usbdescriptors.h file.
> ch9.h file has been copied from linux and is needed for USB gadget
> related work.
> Now usbdescriptors.h and ch9.h shall be used together.

Please don't expect my response on these patches earlier than in 2 days time -- 
I have a slow build-test machine. Also, I'll be eventually scheduling these for 
next release, ok?

Though I'll likely review these today.

btw. this patch looks reasonable, but I'll need to build-test it .

> 
> Signed-off-by: Lukasz Majewski 
> Signed-off-by: Kyungmin Park 
> Cc: Marek Vasut 
> ---
>  drivers/usb/gadget/config.c  |1 +
>  drivers/usb/gadget/epautoconf.c  |1 +
>  drivers/usb/gadget/ether.c   |1 +
>  drivers/usb/gadget/s3c_udc_otg.c |1 +
>  drivers/usb/gadget/usbstring.c   |1 +
>  include/linux/usb/ch9.h  |   67
> -- include/usb/s3c_udc.h| 
>   1 +
>  7 files changed, 6 insertions(+), 67 deletions(-)
> 
> diff --git a/drivers/usb/gadget/config.c b/drivers/usb/gadget/config.c
> index f9163a8..f88d0c1 100644
> --- a/drivers/usb/gadget/config.c
> +++ b/drivers/usb/gadget/config.c
> @@ -27,6 +27,7 @@
>  #include 
> 
>  #include 
> +#include 
>  #include 
> 
> 
> diff --git a/drivers/usb/gadget/epautoconf.c
> b/drivers/usb/gadget/epautoconf.c index 5b8776e..b656c8b 100644
> --- a/drivers/usb/gadget/epautoconf.c
> +++ b/drivers/usb/gadget/epautoconf.c
> @@ -23,6 +23,7 @@
> 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
> index 9fb0e80..f693fea 100644
> --- a/drivers/usb/gadget/ether.c
> +++ b/drivers/usb/gadget/ether.c
> @@ -24,6 +24,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> diff --git a/drivers/usb/gadget/s3c_udc_otg.c
> b/drivers/usb/gadget/s3c_udc_otg.c index 1050a98..f7f7b54 100644
> --- a/drivers/usb/gadget/s3c_udc_otg.c
> +++ b/drivers/usb/gadget/s3c_udc_otg.c
> @@ -37,6 +37,7 @@
>  #include 
> 
>  #include 
> +#include 
>  #include 
> 
>  #include 
> diff --git a/drivers/usb/gadget/usbstring.c
> b/drivers/usb/gadget/usbstring.c index 9cf..4dbe060 100644
> --- a/drivers/usb/gadget/usbstring.c
> +++ b/drivers/usb/gadget/usbstring.c
> @@ -13,6 +13,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
> 
>  #include 
> diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
> index 49b7483..ce1d1e1 100644
> --- a/include/linux/usb/ch9.h
> +++ b/include/linux/usb/ch9.h
> @@ -204,28 +204,6 @@ struct usb_descriptor_header {
>   __u8  bDescriptorType;
>  } __attribute__ ((packed));
> 
> -
> -/*
> -*/ -
> -/* USB_DT_DEVICE: Device descriptor */
> -struct usb_device_descriptor {
> - __u8  bLength;
> - __u8  bDescriptorType;
> -
> - __le16 bcdUSB;
> - __u8  bDeviceClass;
> - __u8  bDeviceSubClass;
> - __u8  bDeviceProtocol;
> - __u8  bMaxPacketSize0;
> - __le16 idVendor;
> - __le16 idProduct;
> - __le16 bcdDevice;
> - __u8  iManufacturer;
> - __u8  iProduct;
> - __u8  iSerialNumber;
> - __u8  bNumConfigurations;
> -} __attribute__ ((packed));
> -
>  #define USB_DT_DEVICE_SIZE   18
> 
> 
> @@ -282,56 +260,11 @@ struct usb_config_descriptor {
>  #define USB_CONFIG_ATT_WAKEUP(1 << 5)/* can wakeup */
>  #define USB_CONFIG_ATT_BATTERY   (1 << 4)/* battery 
powered */
> 
> -/*
> -*/ -
> -/* USB_DT_STRING: String descriptor */
> -struct usb_string_descriptor {
> - __u8  bLength;
> - __u8  bDescriptorType;
> -
> - __le16 wData[1];/* UTF-16LE encoded */
> -} __attribute__ ((packed));
> -
>  /* note that "string" zero is special, it holds language codes that
>   * the device supports, not Unicode characters.
>   */
> 
> -/*
> -*/ -
> -/* USB_DT_INTERFACE: Interface descriptor */
> -struct usb_interface_descriptor {
> - __u8  bLength;
> - __u8  bDescriptorType;
> -
> - __u8  bInterfaceNumber;
> - __u8  bAlternateSetting;
> - __u8  bNumEndpoints;
> - __u8  bInterfaceClass;
> - __u8  bInterfaceSubClass;
> - __u8  bInterfaceProtocol;
> - __u8  iInterface;
> -} __attribute__ ((packed));
> -
>  #define USB_DT_INTERFACE_SIZE9
> -
> -/*
> -*/ -
> -/* USB_DT_ENDPOINT: Endpoint descriptor */
> -struct usb_endpoint_descriptor {
> - __u8  bLength;
> - __u8  bDescriptorType;
> -
> - __u8  bEndpointAddress;
> - __u8  bmAttributes;
> - __le16 wMaxPacketSize;
> - __u8  bInterval;
> -
> - /* NOTE:  these two are _only_ in audio endpoints. */
> - 

Re: [U-Boot] [PATCH] mx6qsabresd: Add basic support

2012-04-12 Thread Marek Vasut
Dear Wolfgang Denk,

> Dear Fabio Estevam,
> 
> In message <1334158122-15219-1-git-send-email-feste...@gmail.com> you wrote:
> > Add basic support for mx6qsabresd board.
> > 
> > Signed-off-by: Fabio Estevam 
> 
> Could you please add a bit information which sort of board this is,
> where to find documetnation about it, etc.?
> 
> > +#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
> > +#define CONFIG_SYS_PROMPT  "MX6QSABRESD U-Boot > "
> 
> Do we really need such verbose prompts?  This appears to be overkill,
> and is becoming more and more a nuisance. [I wonder when I will see
> the first board which puts the full version string in the prompt :-( ]

MX28EVK rev. D with U-Boot v2012.04-rc2 00025-g7ae6af4-dirty (Apr 12 2012 - 
05:36:01) >>> # _

;-D

> 
> > +#define CONFIG_SYS_MEMTEST_START   0x1000
> > +#define CONFIG_SYS_MEMTEST_END 0x1001
> 
> Does this make sense?

It probably does, it runs memtest on a small piece of memory.

> 
> Best regards,
> 
> Wolfgang Denk

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/7] EXYNOS: support display drivers

2012-04-12 Thread Minkyu Kang
Donghwa,

On 11 April 2012 04:28, Anatolij Gustschin  wrote:
> Hi,
>
> On Fri, 06 Apr 2012 14:36:07 +0900
> Donghwa Lee  wrote:
>
>> This patch support EXYNOS display drivers including Framebuffer and
>> MIPI DSI interface version 2.
>>
>> [PATCH v2 1/7] EXYNOS: definitions of system resgister and power management 
>> registers.
>> [PATCH v2 2/7] EXYNOS: add LCD and MIPI DSI clock interface.
>> [PATCH v2 3/7] LCD: add data structure for EXYNOS display driver
>> [PATCH v2 4/7] EXYNOS: support EXYNOS framebuffer and FIMD display drivers.
>> [PATCH v2 5/7] EXYNOS: support EXYNOS MIPI DSI interface driver.
>> [PATCH v2 6/7] LCD: support S6E8AX0 amoled driver based on EXYNOS MIPI DSI.
>> [PATCH v2 7/7] EXYNOS: support TRATS board display function
>>
>> change of v1:
>>       - modify minor issues(code style, remove compiler warnings, and so on)
>
> Thanks for reworking! I've added by ACK to video patches, so when v2012.04
> is out, this series could go into next release through u-boot-samsung tree.
>
> Thanks,
> Anatolij

applied to u-boot-samsung.

Thanks.
Minkyu Kang.
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb:udc: Remove duplicated USB definitions from include/linux/usb/ch9.h file

2012-04-12 Thread Lukasz Majewski

Hi Marek,

> Dear Lukasz Majewski,
> 
> > Remove the repeated USB descriptor code and use usbdescriptors.h
> > file. ch9.h file has been copied from linux and is needed for USB
> > gadget related work.
> > Now usbdescriptors.h and ch9.h shall be used together.


> 
> Please don't expect my response on these patches earlier than in 2
> days time -- I have a slow build-test machine. Also, I'll be
> eventually scheduling these for next release, ok?

I think that good testing is welcome, since  and 
are used widely (up to now separately) in USB. It can be submitted for
-rc or next release. It depends if we manage to test it thoroughly.

BTW: Can you share information how could I get toolchains for mips,
powerPC to test more architectures from MAKEALL script?

Do you use ELDK 5.1 or any "customized" toolchain?
I'm planning to setup some build server.

> 
> Though I'll likely review these today.

Great.
> 
> btw. this patch looks reasonable, but I'll need to build-test it .
> 


-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center
Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Question about toots/bmp_logo.c

2012-04-12 Thread Donghwa Lee
Hi, I have some questions about tools/bmp_logo.c that converts from *.bmp to 
include/bmp_logo* header files. 
I think bmp_logo.c can't support various *.bmp files becuase it uses 
bmp_logo_palette[]
that limited size to 240. It seems to assumed working with an 8-bits files.
When image files have so many colors, maybe I think bmp_logo_palette[] cannot 
be used.

Now I am working in order to convert bmp files that have colors more than 240 
to data
header files.
I think it can't use palette, so I want to create new files can convert from 
.bmp to 
data header.

What do you think about it? Does it can be merged in u-boot mainline?

Thank you,
Donghwa Lee

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


[U-Boot] Introducing myself

2012-04-12 Thread Timo Ketola

Dear u-boot,

I'm about to cooperate more with you here in the U-Boot list and thought that 
introducing myself first would be in order.


My name is Timo Ketola. I work for a smallish (17 fellows) finnish company 
called Exertus (www.exertus.fi). I have a 25 year career on embedded systems. 
Seven last years I have designed boards with many kinds of ARM-chips and have 
adapted U-Boot into some of them.


Regarding U-Boot, I am now working with a i.MX25 based board. I'm looking 
forward to get my board adaptation into the mainline of U-Boot.


This is the first time for me to work with a community. Working practices in a 
community (git procedures etc.) are all new for me. So, I'll expect 
constructive critic on my forthcoming posts.


--

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


[U-Boot] [PATCH 0/8] i.MX25: Miscellaneus fixes

2012-04-12 Thread Timo Ketola
These are the fixes I needed to do to get my board going.

[PATCH 1/8] i.MX25: add mxc_get_clock infrastructure

SD-controller (fsl_esdhc.c) needs a clock frequency in gd->sdhc_clk. I tried
to follow the idea of other architectures.

[PATCH 2/8] i.MX: Add target flashable to offset 0

Helps flashing with openocd

[PATCH 4/8] i.MX25: Has a GPIO4 too

GPIO4 is used in our board

[PATCH 5/8] MXC FEC: Resolve speed before configuring gasket

Without this 10BaseT doesn't work


First and second OOB bytes are used for bad block indication


USB controller in the i.MX25 has PORTSC register like the controller in i.MX31

BTW, I can't understand what is the meaning of writing into &ehci->control. I
can't find such a register from reference manuals of i.MX25, 28 nor 31.

[PATCH 3/8] Build: Ignore build tree and IDE control file
[PATCH 6/8] i.MX25: Add Exertus EXE4026 board

Maybe these does not belong into this series but I didn't know how to exclude
them from this series.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/8] i.MX25: add mxc_get_clock infrastructure

2012-04-12 Thread Timo Ketola
Signed-off-by: Timo Ketola 
---
 arch/arm/cpu/arm926ejs/mx25/generic.c  |   27 +++
 arch/arm/include/asm/arch-mx25/clock.h |   23 +++
 2 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/mx25/generic.c 
b/arch/arm/cpu/arm926ejs/mx25/generic.c
index 9cadb7c..8b07dae 100644
--- a/arch/arm/cpu/arm926ejs/mx25/generic.c
+++ b/arch/arm/cpu/arm926ejs/mx25/generic.c
@@ -28,10 +28,15 @@
 #include 
 #include 
 #include 
+#include 
 #ifdef CONFIG_MXC_MMC
 #include 
 #endif
 
+#ifdef CONFIG_FSL_ESDHC
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 /*
  *  get the system pll clock in Hz
  *
@@ -105,6 +110,20 @@ ulong imx_get_perclk(int clk)
return lldiv(fref, div);
 }
 
+unsigned int mxc_get_clock(enum mxc_clock clk)
+{
+   if (clk >= MXC_CLK_NUM)
+   return -1;
+   switch (clk) {
+   case MXC_ARM_CLK:
+   return imx_get_armclk();
+   case MXC_FEC_CLK:
+   return imx_get_ahbclk();
+   default:
+   return imx_get_perclk(clk);
+   }
+}
+
 u32 get_cpu_rev(void)
 {
u32 srev;
@@ -182,6 +201,14 @@ int cpu_eth_init(bd_t *bis)
 #endif
 }
 
+int get_clocks(void)
+{
+#ifdef CONFIG_FSL_ESDHC
+   gd->sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
+#endif
+   return 0;
+}
+
 /*
  * Initializes on-chip MMC controllers.
  * to override, implement board_mmc_init()
diff --git a/arch/arm/include/asm/arch-mx25/clock.h 
b/arch/arm/include/asm/arch-mx25/clock.h
index c59f588..0f47eaf 100644
--- a/arch/arm/include/asm/arch-mx25/clock.h
+++ b/arch/arm/include/asm/arch-mx25/clock.h
@@ -26,11 +26,34 @@
 #ifndef __ASM_ARCH_CLOCK_H
 #define __ASM_ARCH_CLOCK_H
 
+enum mxc_clock {
+   MXC_CSI_CLK,
+   MXC_EPIT_CLK,
+   MXC_ESAI_CLK,
+   MXC_ESDHC1_CLK,
+   MXC_ESDHC2_CLK,
+   MXC_GPT_CLK,
+   MXC_I2C_CLK,
+   MXC_LCDC_CLK,
+   MXC_NFC_CLK,
+   MXC_OWIRE_CLK,
+   MXC_PWM_CLK,
+   MXC_SIM1_CLK,
+   MXC_SIM2_CLK,
+   MXC_SSI1_CLK,
+   MXC_SSI2_CLK,
+   MXC_UART_CLK,
+   MXC_ARM_CLK,
+   MXC_FEC_CLK,
+   MXC_CLK_NUM
+};
+
 ulong imx_get_perclk(int clk);
 ulong imx_get_ahbclk(void);
 
 #define imx_get_uartclk() imx_get_perclk(15)
 #define imx_get_fecclk() (imx_get_ahbclk()/2)
 
+unsigned int mxc_get_clock(enum mxc_clock clk);
 
 #endif /* __ASM_ARCH_CLOCK_H */
-- 
1.7.5.4

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


[U-Boot] [PATCH 3/8] Build: Ignore build tree and IDE control file

2012-04-12 Thread Timo Ketola
Signed-off-by: Timo Ketola 
---
 .gitignore |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index e4e95e2..3f5eaa7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,6 +15,9 @@
 *.patch
 *.bin
 
+# Build tree
+/build-*
+
 #
 # Top-level generic files
 #
@@ -38,6 +41,7 @@
 /u-boot.ais
 /u-boot.dtb
 /u-boot.sb
+/u-boot.geany
 
 #
 # Generated files
-- 
1.7.5.4

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


[U-Boot] [PATCH 2/8] i.MX: Add target flashable to offset 0

2012-04-12 Thread Timo Ketola
.imx image directly from mkimage must be flashed at offset 0x400 into the nand. 
Thats a little hard with e.g. openocd.

Signed-off-by: Timo Ketola 
---
 Makefile |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 1446131..b3f1279 100644
--- a/Makefile
+++ b/Makefile
@@ -410,6 +410,9 @@ $(obj)u-boot.imx:   $(obj)u-boot.bin
$(obj)tools/mkimage -n  $(CONFIG_IMX_CONFIG) -T imximage \
-e $(CONFIG_SYS_TEXT_BASE) -d $< $@
 
+$(obj)u-boot-nand.imx: $(obj)u-boot.imx
+   dd if=$< of=$@ seek=2
+
 $(obj)u-boot.kwb:   $(obj)u-boot.bin
$(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
-- 
1.7.5.4

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


[U-Boot] [PATCH 4/8] i.MX25: Has a GPIO4 too

2012-04-12 Thread Timo Ketola
Signed-off-by: Timo Ketola 
---
 drivers/gpio/mxc_gpio.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
index df6..b5972fd 100644
--- a/drivers/gpio/mxc_gpio.c
+++ b/drivers/gpio/mxc_gpio.c
@@ -40,7 +40,7 @@ static unsigned long gpio_ports[] = {
[0] = GPIO1_BASE_ADDR,
[1] = GPIO2_BASE_ADDR,
[2] = GPIO3_BASE_ADDR,
-#if defined(CONFIG_MX51) || defined(CONFIG_MX53) || defined(CONFIG_MX6Q)
+#if defined(CONFIG_MX25) || defined(CONFIG_MX51) || defined(CONFIG_MX53) || 
defined(CONFIG_MX6Q)
[3] = GPIO4_BASE_ADDR,
 #endif
 #if defined(CONFIG_MX53) || defined(CONFIG_MX6Q)
-- 
1.7.5.4

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


[U-Boot] [PATCH 6/8] i.MX25: Add Exertus EXE4026 board

2012-04-12 Thread Timo Ketola
Signed-off-by: Timo Ketola 
---
 boards.cfg |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/boards.cfg b/boards.cfg
index 28cc345..44e80ed 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -155,6 +155,7 @@ rd6281a  arm arm926ejs   -  
 Marvell
 sheevaplug   arm arm926ejs   -   
Marvellkirkwood
 dockstar arm arm926ejs   -   
Seagatekirkwood
 jadecpu  arm arm926ejs   jadecpu 
syteco mb86r0x
+exe4026  arm arm926ejs   exe4026 
exertusmx25   
exe4026:IMX_CONFIG=board/exertus/exe4026/imximage.cfg
 mx25pdk  arm arm926ejs   mx25pdk 
freescale  mx25   
mx25pdk:IMX_CONFIG=board/freescale/mx25pdk/imximage.cfg
 tx25 arm arm926ejs   tx25karo  
 mx25
 zmx25arm arm926ejs   zmx25   
syteco mx25
-- 
1.7.5.4

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


[U-Boot] [PATCH 5/8] MXC FEC: Resolve speed before configuring gasket

2012-04-12 Thread Timo Ketola
Signed-off-by: Timo Ketola 
---
 drivers/net/fec_mxc.c |   41 ++---
 1 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 1fdd071..5d11df2 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -406,6 +406,22 @@ static int fec_open(struct eth_device *edev)
 */
writel(readl(&fec->eth->ecntrl) | FEC_ECNTRL_ETHER_EN,
&fec->eth->ecntrl);
+#ifdef CONFIG_PHYLIB
+   if (!fec->phydev)
+   fec_eth_phy_config(edev);
+   if (fec->phydev) {
+   /* Start up the PHY */
+   phy_startup(fec->phydev);
+   speed = fec->phydev->speed;
+   } else {
+   speed = _100BASET;
+   }
+#else
+   miiphy_wait_aneg(edev);
+   speed = miiphy_speed(edev->name, fec->phy_id);
+   // FIXME: useless call: miiphy_duplex(edev->name, fec->phy_id);
+#endif
+
 #if defined(CONFIG_MX25) || defined(CONFIG_MX53)
udelay(100);
/*
@@ -418,9 +434,12 @@ static int fec_open(struct eth_device *edev)
/* wait for the gasket to be disabled */
while (readw(&fec->eth->miigsk_enr) & MIIGSK_ENR_READY)
udelay(2);
-
-   /* configure gasket for RMII, 50 MHz, no loopback, and no echo */
-   writew(MIIGSK_CFGR_IF_MODE_RMII, &fec->eth->miigsk_cfgr);
+   if (speed == _100BASET)
+   /* configure gasket for RMII, 50 MHz, no loopback, and no echo 
*/
+   writew(MIIGSK_CFGR_IF_MODE_RMII, &fec->eth->miigsk_cfgr);
+   else
+   /* configure gasket for RMII, 5 MHz, no loopback, and no echo */
+   writew(MIIGSK_CFGR_IF_MODE_RMII | MIIGSK_CFGR_FRCONT, 
&fec->eth->miigsk_cfgr);
 
/* re-enable the gasket */
writew(MIIGSK_ENR_EN, &fec->eth->miigsk_enr);
@@ -435,22 +454,6 @@ static int fec_open(struct eth_device *edev)
}
 #endif
 
-#ifdef CONFIG_PHYLIB
-   if (!fec->phydev)
-   fec_eth_phy_config(edev);
-   if (fec->phydev) {
-   /* Start up the PHY */
-   phy_startup(fec->phydev);
-   speed = fec->phydev->speed;
-   } else {
-   speed = _100BASET;
-   }
-#else
-   miiphy_wait_aneg(edev);
-   speed = miiphy_speed(edev->name, fec->phy_id);
-   miiphy_duplex(edev->name, fec->phy_id);
-#endif
-
 #ifdef FEC_QUIRK_ENET_MAC
{
u32 ecr = readl(&fec->eth->ecntrl) & ~FEC_ECNTRL_SPEED;
-- 
1.7.5.4

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


[U-Boot] [PATCH 7/8] MXC NAND: Place BBT patterns into free OOB region

2012-04-12 Thread Timo Ketola
Signed-off-by: Timo Ketola 
---
 drivers/mtd/nand/mxc_nand.c |   35 +++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 35e89a0..73813a2 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -1302,12 +1302,47 @@ static void mxc_setup_config1(void)
 #define mxc_setup_config1()
 #endif
 
+#ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
+
+static u8 bbt_pattern[] = {'B', 'b', 't', '0' };
+static u8 mirror_pattern[] = {'1', 't', 'b', 'B' };
+
+static struct nand_bbt_descr bbt_main_descr = {
+   .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE |
+  NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
+   .offs = 2,
+   .len = 4,
+   .veroffs = 6,
+   .maxblocks = 4,
+   .pattern = bbt_pattern,
+};
+
+static struct nand_bbt_descr bbt_mirror_descr = {
+   .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE |
+  NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP,
+   .offs = 2,
+   .len = 4,
+   .veroffs = 6,
+   .maxblocks = 4,
+   .pattern = mirror_pattern,
+};
+
+#endif
+
 int board_nand_init(struct nand_chip *this)
 {
struct mtd_info *mtd;
uint16_t tmp;
int err = 0;
 
+#ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
+
+   this->options = NAND_USE_FLASH_BBT;
+   this->bbt_td = &bbt_main_descr;
+   this->bbt_md = &bbt_mirror_descr;
+
+#endif
+
/* structures must be linked */
mtd = &host->mtd;
mtd->priv = this;
-- 
1.7.5.4

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


[U-Boot] [PATCH 8/8] i.MX25: This model has almost the same USB-controller as i.MX31

2012-04-12 Thread Timo Ketola
Signed-off-by: Timo Ketola 
---
 drivers/usb/host/ehci-mxc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c
index 61dbccd..65f40a4 100644
--- a/drivers/usb/host/ehci-mxc.c
+++ b/drivers/usb/host/ehci-mxc.c
@@ -125,7 +125,7 @@ int ehci_hcd_init(void)
hcor = (struct ehci_hcor *)((uint32_t) hccr +
HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
setbits_le32(&ehci->usbmode, CM_HOST);
-#ifdef CONFIG_MX31
+#if defined(CONFIG_MX31) || defined(CONFIG_MX25)
setbits_le32(&ehci->control, USB_EN);
 
__raw_writel(CONFIG_MXC_USB_PORTSC, &ehci->portsc);
-- 
1.7.5.4

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


Re: [U-Boot] [PATCH 6/8] i.MX25: Add Exertus EXE4026 board

2012-04-12 Thread Fabio Estevam
Hi Timo,

On Thu, Apr 12, 2012 at 6:33 AM, Timo Ketola  wrote:
> Signed-off-by: Timo Ketola 
> ---
>  boards.cfg |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)

Thanks for your contributions.

Please provide some more details in the commit message about this
board, which peripherals are currently supported, where does it boot
from, etc.

Please also add an entry for your board in the MAINTAINERS file.

You seem to have missed to do a "git add" for the files you introduced
here ,ie, board/exertus/exe4026/ directory.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mx6qsabresd: Add basic support

2012-04-12 Thread Stefano Babic
On 11/04/2012 17:28, Fabio Estevam wrote:
> Add basic support for mx6qsabresd board.
> 
> Signed-off-by: Fabio Estevam 

Hi Fabio,


> ---
>  MAINTAINERS   |1 +
>  board/freescale/mx6qsabresd/Makefile  |   37 ++
>  board/freescale/mx6qsabresd/imximage.cfg  |  170 +++
>  board/freescale/mx6qsabresd/mx6qsabresd.c |  111 ++
>  boards.cfg|1 +
>  include/configs/mx6qsabresd.h |  178 
> +
>  6 files changed, 498 insertions(+), 0 deletions(-)
>  create mode 100644 board/freescale/mx6qsabresd/Makefile
>  create mode 100644 board/freescale/mx6qsabresd/imximage.cfg
>  create mode 100644 board/freescale/mx6qsabresd/mx6qsabresd.c
>  create mode 100644 include/configs/mx6qsabresd.h
> 

A general question: in your patch it seems to me that only SD is
currently supported on this board. Which is the difference between this
board and the mx6qsabrelite we have already mainlined ?


> +#
> diff --git a/board/freescale/mx6qsabresd/imximage.cfg 
> b/board/freescale/mx6qsabresd/imximage.cfg
> new file mode 100644
> index 000..c389427
> --- /dev/null
> +++ b/board/freescale/mx6qsabresd/imximage.cfg
> @@ -0,0 +1,170 @@
> +# Copyright (C) 2011 Freescale Semiconductor, Inc.
> +# Jason Liu 
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# 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. 51 Franklin Street Fifth Floor Boston,
> +# MA 02110-1301 USA
> +#
> +# Refer docs/README.imxmage for more details about how-to configure
> +# and create imximage boot image
> +#
> +# The syntax is taken as close as possible with the kwbimage
> +
> +# image version
> +
> +IMAGE_VERSION 2
> +
> +# Boot Device : one of
> +# spi, sd (the board has no nand neither onenand)
> +
> +BOOT_FROM  sd
> +
> +# Device Configuration Data (DCD)
> +#
> +# Each entry must have the format:
> +# Addr-type   AddressValue
> +#
> +# where:
> +#  Addr-type register length (1,2 or 4 bytes)
> +#  Address   absolute address of the register
> +#  value value to be stored in the register
> +DATA 4 0x020e05a8 0x0030
> +DATA 4 0x020e05b0 0x0030
> +DATA 4 0x020e0524 0x0030
> +DATA 4 0x020e051c 0x0030
> +
> +DATA 4 0x020e0518 0x0030
> +DATA 4 0x020e050c 0x0030
> +DATA 4 0x020e05b8 0x0030
> +DATA 4 0x020e05c0 0x0030
> +
> +DATA 4 0x020e05ac 0x00020030
> +DATA 4 0x020e05b4 0x00020030
> +DATA 4 0x020e0528 0x00020030
> +DATA 4 0x020e0520 0x00020030
> +
> +DATA 4 0x020e0514 0x00020030
> +DATA 4 0x020e0510 0x00020030
> +DATA 4 0x020e05bc 0x00020030
> +DATA 4 0x020e05c4 0x00020030
> +
> +DATA 4 0x020e056c 0x00020030
> +DATA 4 0x020e0578 0x00020030
> +DATA 4 0x020e0588 0x00020030
> +DATA 4 0x020e0594 0x00020030
> +
> +DATA 4 0x020e057c 0x00020030
> +DATA 4 0x020e0590 0x3000
> +DATA 4 0x020e0598 0x3000
> +DATA 4 0x020e058c 0x
> +
> +DATA 4 0x020e059c 0x3030
> +DATA 4 0x020e05a0 0x3030
> +DATA 4 0x020e0784 0x0030
> +DATA 4 0x020e0788 0x0030
> +
> +DATA 4 0x020e0794 0x0030
> +DATA 4 0x020e079c 0x0030
> +DATA 4 0x020e07a0 0x0030
> +DATA 4 0x020e07a4 0x0030
> +
> +DATA 4 0x020e07a8 0x0030
> +DATA 4 0x020e0748 0x0030
> +DATA 4 0x020e074c 0x0030
> +DATA 4 0x020e0750 0x0002
> +
> +DATA 4 0x020e0758 0x
> +DATA 4 0x020e0774 0x0002
> +DATA 4 0x020e078c 0x0030
> +DATA 4 0x020e0798 0x000C
> +
> +DATA 4 0x021b081c 0x
> +DATA 4 0x021b0820 0x
> +DATA 4 0x021b0824 0x
> +DATA 4 0x021b0828 0x
> +
> +DATA 4 0x021b481c 0x
> +DATA 4 0x021b4820 0x
> +DATA 4 0x021b4824 0x
> +DATA 4 0x021b4828 0x
> +
> +DATA 4 0x021b0018 0x00081740
> +
> +DATA 4 0x021b001c 0x8000
> +DATA 4 0x021b000c 0x555A7975
> +DATA 4 0x021b0010 0xFF538E64
> +DATA 4 0x021b0014 0x01FF00DB
> +DATA 4 0x021b002c 0x26D2
> +
> +DATA 4 0x021b0030 0x005B0E21
> +DATA 4 0x021b0008 0x09444040
> +DATA 4 0x021b0004 0x00025576
> +DATA 4 0x021b0040 0x0027
> +DATA 4 0x021b 0x831A
> +
> +DATA 4 0x021b001c 0x04088032
> +DATA 4 0x021b001c 0x0408803A
> +DATA 4 0x021b001c 0x8033
> +DATA 4 0x021b001c 0x803B
> +DATA 4 0x021b001c 0x00428031
> +D

Re: [U-Boot] [PATCH 6/8] i.MX25: Add Exertus EXE4026 board

2012-04-12 Thread Timo Ketola

On 12.04.2012 13:43, Fabio Estevam wrote:

Please provide some more details in the commit message about this
board, which peripherals are currently supported, where does it boot
from, etc.

Please also add an entry for your board in the MAINTAINERS file.

You seem to have missed to do a "git add" for the files you introduced
here ,ie, board/exertus/exe4026/ directory.


Yes, I will, but actually I didn't want to publish my board specific files and 
changes just yet. I committed all those changes into my git tree but now I 
don't know how to exclude this one (6/8, and perhaps 3/8) from git-send-email 
to send a cleaner series. I don't know either how to use git-send-email to send 
a single patch. I'll need to learn more about git - or can you or somebody here 
tell me right away? Do I perhaps have to create a second branch where I merge 
the relevant commits?


--

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


[U-Boot] [PATCH v5 0/4] mmc: support sdhci instead of s5p_mmc

2012-04-12 Thread Jaehoon Chung
This patchset is supported the sdhci controller for Samsung-SoC.
In mmc driver, already implemented the generic sdhci.
There is no reason that didn't use sdhci.c.
So, use the sdhci instead of s5p_mmc.

Changelog-v5:
- Tested with goni/trats board
- Fixed wrong condition checking
- Increased retry time
- Add the quirk_broken_r1b in s5p_sdhci.c
Changelog-v4:
- seperate the device driver and SoC patch.

Changelog-v3:
- Add the quirks for broken R1b response.
- Add the timeout to prevent infinite loop.

Changelog-v2:
- removed the s5p_mmc.c
- based-on u-boot-samsung repository.

Jaehoon Chung (4):
  mmc: sdhci: add the quirk for broken r1b response
  mmc: add the quirk to use the sdhci for samsung-soc
  mmc: support the sdhci instead of s5p_mmc for samsung-soc
  ARM: SAMSUNG: support sdhci controller

 arch/arm/include/asm/arch-exynos/mmc.h  |   93 +++---
 arch/arm/include/asm/arch-s5pc1xx/mmc.h |   93 +++---
 drivers/mmc/Makefile|2 +-
 drivers/mmc/s5p_mmc.c   |  490 ---
 drivers/mmc/s5p_sdhci.c |   98 ++
 drivers/mmc/sdhci.c |   24 ++
 include/configs/origen.h|3 +-
 include/configs/s5p_goni.h  |3 +-
 include/configs/s5pc210_universal.h |3 +-
 include/configs/smdk5250.h  |3 +-
 include/configs/smdkv310.h  |3 +-
 include/configs/trats.h |3 +-
 include/sdhci.h |7 +
 13 files changed, 236 insertions(+), 589 deletions(-)
 delete mode 100644 drivers/mmc/s5p_mmc.c
 create mode 100644 drivers/mmc/s5p_sdhci.c
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v5 1/4] mmc: sdhci: add the quirk for broken r1b response

2012-04-12 Thread Jaehoon Chung
When response type is R1b, mask value is added the SDHCI_INT_DAT_END.
but in while(), didn't check that flag.
So sdhci controller didn't work fine.
CMD6 didn't always complete.

So add the quirks for broken r1b response
and add the timeout value to prevent the infinite loop.

Signed-off-by: Jaehoon Chung 
Signed-off-by: Kyungmin Park 
Acked-by: Lei Wen
---
 drivers/mmc/sdhci.c |   12 
 include/sdhci.h |1 +
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index fc904b5..785e36e 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -128,6 +128,7 @@ int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
int trans_bytes = 0, is_aligned = 1;
u32 mask, flags, mode;
unsigned int timeout, start_addr = 0;
+   unsigned int retry = 1;
 
/* Wait max 10 ms */
timeout = 10;
@@ -210,8 +211,19 @@ int sdhci_send_command(struct mmc *mmc, struct mmc_cmd 
*cmd,
stat = sdhci_readl(host, SDHCI_INT_STATUS);
if (stat & SDHCI_INT_ERROR)
break;
+   if (--retry == 0)
+   break;
} while ((stat & mask) != mask);
 
+   if (retry == 0) {
+   if (host->quirks & SDHCI_QUIRK_BROKEN_R1B)
+   return 0;
+   else {
+   printf("Timeout for stauts update!\n");
+   return TIMEOUT;
+   }
+   }
+
if ((stat & (SDHCI_INT_ERROR | mask)) == mask) {
sdhci_cmd_done(host, cmd);
sdhci_writel(host, mask, SDHCI_INT_STATUS);
diff --git a/include/sdhci.h b/include/sdhci.h
index 800f9d9..a2415ba 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -216,6 +216,7 @@
  */
 #define SDHCI_QUIRK_32BIT_DMA_ADDR (1 << 0)
 #define SDHCI_QUIRK_REG32_RW   (1 << 1)
+#define SDHCI_QUIRK_BROKEN_R1B (1 << 2)
 
 /* to make gcc happy */
 struct sdhci_host;
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v5 2/4] mmc: add the quirk to use the sdhci for samsung-soc

2012-04-12 Thread Jaehoon Chung
To support the Samsung-SoC, added the basically functions.
Samsung-SoC didn't used the SDHCI_CTRL_HISPD.
And added set_control_reg callback for s3c64xx.

Signed-off-by: Jaehoon Chung 
Signed-off-by: Kyungmin Park 
Acked-by: Lei Wen
---
 drivers/mmc/sdhci.c |   12 
 include/sdhci.h |6 ++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 785e36e..6d2e049 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -337,6 +337,9 @@ void sdhci_set_ios(struct mmc *mmc)
u32 ctrl;
struct sdhci_host *host = (struct sdhci_host *)mmc->priv;
 
+   if (host->set_control_reg)
+   host->set_control_reg(host);
+
if (mmc->clock != host->clock)
sdhci_set_clock(mmc, mmc->clock);
 
@@ -360,6 +363,9 @@ void sdhci_set_ios(struct mmc *mmc)
else
ctrl &= ~SDHCI_CTRL_HISPD;
 
+   if (host->quirks & SDHCI_QUIRK_NO_HISPD_BIT)
+   ctrl &= ~SDHCI_CTRL_HISPD;
+
sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
 }
 
@@ -443,9 +449,15 @@ int add_sdhci(struct sdhci_host *host, u32 max_clk, u32 
min_clk)
mmc->voltages |= MMC_VDD_29_30 | MMC_VDD_30_31;
if (caps & SDHCI_CAN_VDD_180)
mmc->voltages |= MMC_VDD_165_195;
+
+   if (host->quirks & SDHCI_QUIRK_BROKEN_VOLTAGE)
+   mmc->voltages |= host->voltages;
+
mmc->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_4BIT;
if (caps & SDHCI_CAN_DO_8BIT)
mmc->host_caps |= MMC_MODE_8BIT;
+   if (host->host_caps)
+   mmc->host_caps |= host->host_caps;
 
sdhci_reset(host, SDHCI_RESET_ALL);
mmc_register(mmc);
diff --git a/include/sdhci.h b/include/sdhci.h
index a2415ba..9d37183 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -217,6 +217,8 @@
 #define SDHCI_QUIRK_32BIT_DMA_ADDR (1 << 0)
 #define SDHCI_QUIRK_REG32_RW   (1 << 1)
 #define SDHCI_QUIRK_BROKEN_R1B (1 << 2)
+#define SDHCI_QUIRK_NO_HISPD_BIT   (1 << 3)
+#define SDHCI_QUIRK_BROKEN_VOLTAGE (1 << 4)
 
 /* to make gcc happy */
 struct sdhci_host;
@@ -241,10 +243,14 @@ struct sdhci_host {
char *name;
void *ioaddr;
unsigned int quirks;
+   unsigned int host_caps;
unsigned int version;
unsigned int clock;
struct mmc *mmc;
const struct sdhci_ops *ops;
+
+   void (*set_control_reg)(struct sdhci_host *host);
+   uintvoltages;
 };
 
 #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v5 3/4] mmc: support the sdhci instead of s5p_mmc for samsung-soc

2012-04-12 Thread Jaehoon Chung
In driver mmc, generic s5p_sdhci code is implemented.
s5p_mmc file  is dupulicated.
we are good that use the generic sdhci.
This patch supported the sdhci  for Samsung-SoC.

Signed-off-by: Jaehoon Chung 
Signed-off-by: Kyungmin Park 
Acked-by: Lei Wen
---
 arch/arm/include/asm/arch-exynos/mmc.h  |   93 +++---
 arch/arm/include/asm/arch-s5pc1xx/mmc.h |   93 +++---
 drivers/mmc/Makefile|2 +-
 drivers/mmc/s5p_mmc.c   |  490 ---
 4 files changed, 95 insertions(+), 583 deletions(-)
 delete mode 100644 drivers/mmc/s5p_mmc.c

diff --git a/arch/arm/include/asm/arch-exynos/mmc.h 
b/arch/arm/include/asm/arch-exynos/mmc.h
index 30f82b8..0f701c9 100644
--- a/arch/arm/include/asm/arch-exynos/mmc.h
+++ b/arch/arm/include/asm/arch-exynos/mmc.h
@@ -21,53 +21,54 @@
 #ifndef __ASM_ARCH_MMC_H_
 #define __ASM_ARCH_MMC_H_
 
-#ifndef __ASSEMBLY__
-struct s5p_mmc {
-   unsigned intsysad;
-   unsigned short  blksize;
-   unsigned short  blkcnt;
-   unsigned intargument;
-   unsigned short  trnmod;
-   unsigned short  cmdreg;
-   unsigned intrspreg0;
-   unsigned intrspreg1;
-   unsigned intrspreg2;
-   unsigned intrspreg3;
-   unsigned intbdata;
-   unsigned intprnsts;
-   unsigned char   hostctl;
-   unsigned char   pwrcon;
-   unsigned char   blkgap;
-   unsigned char   wakcon;
-   unsigned short  clkcon;
-   unsigned char   timeoutcon;
-   unsigned char   swrst;
-   unsigned intnorintsts;  /* errintsts */
-   unsigned intnorintstsen;/* errintstsen */
-   unsigned intnorintsigen;/* errintsigen */
-   unsigned short  acmd12errsts;
-   unsigned char   res1[2];
-   unsigned intcapareg;
-   unsigned char   res2[4];
-   unsigned intmaxcurr;
-   unsigned char   res3[0x34];
-   unsigned intcontrol2;
-   unsigned intcontrol3;
-   unsigned char   res4[4];
-   unsigned intcontrol4;
-   unsigned char   res5[0x6e];
-   unsigned short  hcver;
-   unsigned char   res6[0xFF00];
-};
+#define SDHCI_CONTROL2 0x80
+#define SDHCI_CONTROL3 0x84
+#define SDHCI_CONTROL4 0x8C
 
-struct mmc_host {
-   struct s5p_mmc *reg;
-   unsigned int version;   /* SDHCI spec. version */
-   unsigned int clock; /* Current clock (MHz) */
-   int dev_index;
-};
+#define SDHCI_CTRL2_ENSTAASYNCCLR  (1 << 31)
+#define SDHCI_CTRL2_ENCMDCNFMSK(1 << 30)
+#define SDHCI_CTRL2_CDINVRXD3  (1 << 29)
+#define SDHCI_CTRL2_SLCARDOUT  (1 << 28)
 
-int s5p_mmc_init(int dev_index, int bus_width);
+#define SDHCI_CTRL2_FLTCLKSEL_MASK (0xf << 24)
+#define SDHCI_CTRL2_FLTCLKSEL_SHIFT(24)
+#define SDHCI_CTRL2_FLTCLKSEL(_x)  ((_x) << 24)
 
-#endif /* __ASSEMBLY__ */
+#define SDHCI_CTRL2_LVLDAT_MASK(0xff << 16)
+#define SDHCI_CTRL2_LVLDAT_SHIFT   (16)
+#define SDHCI_CTRL2_LVLDAT(_x) ((_x) << 16)
+
+#define SDHCI_CTRL2_ENFBCLKTX  (1 << 15)
+#define SDHCI_CTRL2_ENFBCLKRX  (1 << 14)
+#define SDHCI_CTRL2_SDCDSEL(1 << 13)
+#define SDHCI_CTRL2_SDSIGPC(1 << 12)
+#define SDHCI_CTRL2_ENBUSYCHKTXSTART   (1 << 11)
+
+#define SDHCI_CTRL2_DFCNT_MASK(_x) ((_x) << 9)
+#define SDHCI_CTRL2_DFCNT_SHIFT(9)
+
+#define SDHCI_CTRL2_ENCLKOUTHOLD   (1 << 8)
+#define SDHCI_CTRL2_RWAITMODE  (1 << 7)
+#define SDHCI_CTRL2_DISBUFRD   (1 << 6)
+#define SDHCI_CTRL2_SELBASECLK_MASK(_x)((_x) << 4)
+#define SDHCI_CTRL2_SELBASECLK_SHIFT   (4)
+#define SDHCI_CTRL2_PWRSYNC(1 << 3)
+#define SDHCI_CTRL2_ENCLKOUTMSKCON (1 << 1)
+#define SDHCI_CTRL2_HWINITFIN  (1 << 0)
+
+#define SDHCI_CTRL3_FCSEL3 (1 << 31)
+#define SDHCI_CTRL3_FCSEL2 (1 << 23)
+#define SDHCI_CTRL3_FCSEL1 (1 << 15)
+#define SDHCI_CTRL3_FCSEL0 (1 << 7)
+
+#define SDHCI_CTRL4_DRIVE_MASK(_x) ((_x) << 16)
+#define SDHCI_CTRL4_DRIVE_SHIFT(16)
+
+int s5p_sdhci_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks);
+
+static inline unsigned int s5p_mmc_init(int index, int bus_width)
+{
+   unsigned int base = samsung_get_base_mmc() + (0x1 * index);
+   return s5p_sdhci_init(base, 5200, 40, index);
+}
 #endif
diff --git a/arch/arm/include/asm/arch-s5pc1xx/mmc.h 
b/arch/arm/include/asm/arch-s5pc1xx/mmc.h
index adef4ee..0f701c9 100644
--- a/arch/arm/include/asm/arch-s5pc1xx/mmc.h
+++ b/arch/arm/include/asm/arch-s5pc1xx/mmc.h
@@ -21,53 +21,54 @@
 #ifndef __ASM_ARCH_MMC_H_
 #define __ASM_ARCH_MMC_H_
 
-#ifndef __ASSEMBLY__
-struct s5p_mmc {
-   unsigned intsysad;
-   unsigned short  blksize;
-   unsigned short  blkcnt;
-   unsigned intargument;
-   unsigned short  trnmod;
-   unsigned short  cmdreg;
-   unsigned intrspreg0;
-   unsigned 

[U-Boot] [PATCH v5 4/4] ARM: SAMSUNG: support sdhci controller

2012-04-12 Thread Jaehoon Chung
To support sdhci controller, remove the CONFIG_S5P_MMC..
Instead, use the CONFIG_S5P_SDHCI/CONFIG_SDHCI.

Signed-off-by: Jaehoon Chung 
Signed-off-by: Kyungmin Park 
Acked-by: Lei Wen
---
 include/configs/origen.h|3 ++-
 include/configs/s5p_goni.h  |3 ++-
 include/configs/s5pc210_universal.h |3 ++-
 include/configs/smdk5250.h  |3 ++-
 include/configs/smdkv310.h  |3 ++-
 include/configs/trats.h |3 ++-
 6 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/include/configs/origen.h b/include/configs/origen.h
index 8ede825..ea8066f 100644
--- a/include/configs/origen.h
+++ b/include/configs/origen.h
@@ -71,7 +71,8 @@
 /* SD/MMC configuration */
 #define CONFIG_GENERIC_MMC 1
 #define CONFIG_MMC 1
-#define CONFIG_S5P_MMC 1
+#define CONFIG_SDHCI   1
+#define CONFIG_S5P_SDHCI   1
 
 /* PWM */
 #define CONFIG_PWM 1
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index 56b5547..f659699 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -65,7 +65,8 @@
 /* MMC */
 #define CONFIG_GENERIC_MMC 1
 #define CONFIG_MMC 1
-#define CONFIG_S5P_MMC 1
+#define CONFIG_SDHCI   1
+#define CONFIG_S5P_SDHCI   1
 
 /* PWM */
 #define CONFIG_PWM 1
diff --git a/include/configs/s5pc210_universal.h 
b/include/configs/s5pc210_universal.h
index 1301275..241d209 100644
--- a/include/configs/s5pc210_universal.h
+++ b/include/configs/s5pc210_universal.h
@@ -68,7 +68,8 @@
 /* MMC */
 #define CONFIG_GENERIC_MMC 1
 #define CONFIG_MMC 1
-#define CONFIG_S5P_MMC 1
+#define CONFIG_SDHCI   1
+#define CONFIG_S5P_SDHCI   1
 
 /* PWM */
 #define CONFIG_PWM 1
diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
index 9659f9e..0f63040 100644
--- a/include/configs/smdk5250.h
+++ b/include/configs/smdk5250.h
@@ -78,7 +78,8 @@
 /* SD/MMC configuration */
 #define CONFIG_GENERIC_MMC
 #define CONFIG_MMC
-#define CONFIG_S5P_MMC
+#define CONFIG_SDHCI
+#define CONFIG_S5P_SDHCI
 
 #define CONFIG_BOARD_EARLY_INIT_F
 
diff --git a/include/configs/smdkv310.h b/include/configs/smdkv310.h
index 93c25da..077f0e0 100644
--- a/include/configs/smdkv310.h
+++ b/include/configs/smdkv310.h
@@ -70,7 +70,8 @@
 /* SD/MMC configuration */
 #define CONFIG_GENERIC_MMC 1
 #define CONFIG_MMC 1
-#define CONFIG_S5P_MMC 1
+#define CONFIG_SDHCI   1
+#define CONFIG_S5P_SDHCI   1
 
 /* PWM */
 #define CONFIG_PWM 1
diff --git a/include/configs/trats.h b/include/configs/trats.h
index 10f11d9..71b9393 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -74,7 +74,8 @@
 /* MMC */
 #define CONFIG_GENERIC_MMC
 #define CONFIG_MMC
-#define CONFIG_S5P_MMC
+#define CONFIG_S5P_SDHCI
+#define CONFIG_SDHCI
 
 /* PWM */
 #define CONFIG_PWM
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/8] i.MX: Add target flashable to offset 0

2012-04-12 Thread Stefano Babic
On 12/04/2012 11:33, Timo Ketola wrote:
> .imx image directly from mkimage must be flashed at offset 0x400 into the 
> nand. Thats a little hard with e.g. openocd.
> 
> Signed-off-by: Timo Ketola 
> ---

Hi Timo,

>  Makefile |3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 1446131..b3f1279 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -410,6 +410,9 @@ $(obj)u-boot.imx:   $(obj)u-boot.bin
>   $(obj)tools/mkimage -n  $(CONFIG_IMX_CONFIG) -T imximage \
>   -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
>  
> +$(obj)u-boot-nand.imx: $(obj)u-boot.imx
> + dd if=$< of=$@ seek=2
> +

I wonder why we need this in u-boot code and to set this rule in the
main Makefile. You can always do this after generating u-boot.

The rules here are to generate the u-boot.imx. Then the same image can
be stored at different addresses. Depending on the i.MX SOC, ofssets can
be different (MX5 / MX6 have different offsets for NOR / NAND / oneNAND).

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/8] Build: Ignore build tree and IDE control file

2012-04-12 Thread Stefano Babic
On 12/04/2012 11:33, Timo Ketola wrote:
> Signed-off-by: Timo Ketola 
> ---

Hi Timo,

> +/u-boot.geany

What is this ? I do not find any occurency in u-boot tree.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/8] i.MX25: Has a GPIO4 too

2012-04-12 Thread Stefano Babic
On 12/04/2012 11:33, Timo Ketola wrote:
> Signed-off-by: Timo Ketola 
> ---
>  drivers/gpio/mxc_gpio.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
> index df6..b5972fd 100644
> --- a/drivers/gpio/mxc_gpio.c
> +++ b/drivers/gpio/mxc_gpio.c
> @@ -40,7 +40,7 @@ static unsigned long gpio_ports[] = {
>   [0] = GPIO1_BASE_ADDR,
>   [1] = GPIO2_BASE_ADDR,
>   [2] = GPIO3_BASE_ADDR,
> -#if defined(CONFIG_MX51) || defined(CONFIG_MX53) || defined(CONFIG_MX6Q)
> +#if defined(CONFIG_MX25) || defined(CONFIG_MX51) || defined(CONFIG_MX53) || 
> defined(CONFIG_MX6Q)
>   [3] = GPIO4_BASE_ADDR,
>  #endif
>  #if defined(CONFIG_MX53) || defined(CONFIG_MX6Q)

Acked-by : Stefano Babic 

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/8] i.MX: Add target flashable to offset 0

2012-04-12 Thread Timo Ketola

On 12.04.2012 14:11, Stefano Babic wrote:

On 12/04/2012 11:33, Timo Ketola wrote:

+$(obj)u-boot-nand.imx: $(obj)u-boot.imx
+   dd if=$<  of=$@ seek=2
+


I wonder why we need this in u-boot code and to set this rule in the
main Makefile. You can always do this after generating u-boot.


Older U-Boot (from FreeScale) made an .imx image with 1KB padding which I could 
flash directly into the NAND at offset 0. Now I had to do manually that 
dd-magic (before I put it in Makefile) because openocd doesn't allow to flash 
at offset 0x400 (it demands write-page alignment).



The rules here are to generate the u-boot.imx. Then the same image can
be stored at different addresses. Depending on the i.MX SOC, ofssets can
be different (MX5 / MX6 have different offsets for NOR / NAND / oneNAND).


I prefer a build system which generates an image ready for flashing but perhaps 
I have to do that outside of U-Boot, somehow.


--

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


Re: [U-Boot] [PATCH 3/8] Build: Ignore build tree and IDE control file

2012-04-12 Thread Timo Ketola

On 12.04.2012 14:13, Stefano Babic wrote:

+/u-boot.geany


What is this ? I do not find any occurency in u-boot tree.


It is my IDE control file. I didn't want to publish this patch at all but I 
have still a lot of learning about git.


--

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


Re: [U-Boot] [PATCH 3/8] Build: Ignore build tree and IDE control file

2012-04-12 Thread Stefano Babic
On 12/04/2012 13:24, Timo Ketola wrote:
> On 12.04.2012 14:13, Stefano Babic wrote:
>>> +/u-boot.geany
>>
>> What is this ? I do not find any occurency in u-boot tree.
> 
> It is my IDE control file. I didn't want to publish this patch at all
> but I have still a lot of learning about git.

Ah, ok, do not worry. I wondered what it could be.

Can be helpful for you to define your global .gitignore file for your
own setup ?

You could add a ~/.gitignore with:

/build-*
/uboot.gean

and then in u-boot tree you can issue the command:

$ git config --global core.excludesfile ~/.gitignore

Then all files defined in your global setting are excluded.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/8] Build: Ignore build tree and IDE control file

2012-04-12 Thread Timo Ketola

On 12.04.2012 15:00, Stefano Babic wrote:

Can be helpful for you to define your global .gitignore ...


OK, thanks for that tip!

--

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


Re: [U-Boot] [PATCH 5/8] MXC FEC: Resolve speed before configuring gasket

2012-04-12 Thread Stefano Babic
On 12/04/2012 11:33, Timo Ketola wrote:
> Signed-off-by: Timo Ketola 
> ---

Hi Timo,

>  drivers/net/fec_mxc.c |   41 ++---
>  1 files changed, 22 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index 1fdd071..5d11df2 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c

Please consider to rebase your patch on u-boot-imx, next branch. There
are already a couple of patches related to gasket and MII.

> @@ -406,6 +406,22 @@ static int fec_open(struct eth_device *edev)
>*/
>   writel(readl(&fec->eth->ecntrl) | FEC_ECNTRL_ETHER_EN,
>   &fec->eth->ecntrl);
> +#ifdef CONFIG_PHYLIB
> + if (!fec->phydev)
> + fec_eth_phy_config(edev);
> + if (fec->phydev) {
> + /* Start up the PHY */
> + phy_startup(fec->phydev);
> + speed = fec->phydev->speed;
> + } else {
> + speed = _100BASET;
> + }
> +#else
> + miiphy_wait_aneg(edev);
> + speed = miiphy_speed(edev->name, fec->phy_id);
> + // FIXME: useless call: miiphy_duplex(edev->name, fec->phy_id);

This is dead code. // comments are not allowed, comment should be real
comments, not used to disable code. Why are you disabling ? Please
explain the reason and, if it is required, provide a separate patch for
this.

> +#endif
> +
>  #if defined(CONFIG_MX25) || defined(CONFIG_MX53)
>   udelay(100);
>   /*
> @@ -418,9 +434,12 @@ static int fec_open(struct eth_device *edev)
>   /* wait for the gasket to be disabled */
>   while (readw(&fec->eth->miigsk_enr) & MIIGSK_ENR_READY)
>   udelay(2);
> -
> - /* configure gasket for RMII, 50 MHz, no loopback, and no echo */
> - writew(MIIGSK_CFGR_IF_MODE_RMII, &fec->eth->miigsk_cfgr);
> + if (speed == _100BASET)
> + /* configure gasket for RMII, 50 MHz, no loopback, and no echo 
> */
> + writew(MIIGSK_CFGR_IF_MODE_RMII, &fec->eth->miigsk_cfgr);
> + else
> + /* configure gasket for RMII, 5 MHz, no loopback, and no echo */
> + writew(MIIGSK_CFGR_IF_MODE_RMII | MIIGSK_CFGR_FRCONT, 
> &fec->eth->miigsk_cfgr);

Right, this is correct for 10Mhz Ethernet.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/8] i.MX25: Add Exertus EXE4026 board

2012-04-12 Thread Stefano Babic
On 12/04/2012 11:33, Timo Ketola wrote:
> Signed-off-by: Timo Ketola 
> ---
>  boards.cfg |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/boards.cfg b/boards.cfg
> index 28cc345..44e80ed 100644
> --- a/boards.cfg
> +++ b/boards.cfg
> @@ -155,6 +155,7 @@ rd6281a  arm arm926ejs   -
>Marvell
>  sheevaplug   arm arm926ejs   -   
> Marvellkirkwood
>  dockstar arm arm926ejs   -   
> Seagatekirkwood
>  jadecpu  arm arm926ejs   jadecpu 
> syteco mb86r0x
> +exe4026  arm arm926ejs   exe4026 
> exertusmx25 
> exe4026:IMX_CONFIG=board/exertus/exe4026/imximage.cfg
>  mx25pdk  arm arm926ejs   mx25pdk 
> freescale  mx25 
> mx25pdk:IMX_CONFIG=board/freescale/mx25pdk/imximage.cfg
>  tx25 arm arm926ejs   tx25
> karo   mx25
>  zmx25arm arm926ejs   zmx25   
> syteco mx25

I assume you write also some code for this board. Maybe forgotten ?

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/8] i.MX25: Add Exertus EXE4026 board

2012-04-12 Thread Timo Ketola

On 12.04.2012 15:06, Stefano Babic wrote:

+exe4026  arm arm926ejs   exe4026 
exertusmx25   
exe4026:IMX_CONFIG=board/exertus/exe4026/imximage.cfg


I assume you write also some code for this board. Maybe forgotten ?


Yes, later. I have hard time with git-send-email selecting exactly what I want 
to send.


--

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


Re: [U-Boot] [PATCH 4/8] i.MX25: Has a GPIO4 too

2012-04-12 Thread Wolfgang Denk
Dear "Timo Ketola",

In message <1334223234-23383-5-git-send-email-t...@exertus.fi> you wrote:
> Signed-off-by: Timo Ketola 
> ---
>  drivers/gpio/mxc_gpio.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
> index df6..b5972fd 100644
> --- a/drivers/gpio/mxc_gpio.c
> +++ b/drivers/gpio/mxc_gpio.c
> @@ -40,7 +40,7 @@ static unsigned long gpio_ports[] = {
>   [0] = GPIO1_BASE_ADDR,
>   [1] = GPIO2_BASE_ADDR,
>   [2] = GPIO3_BASE_ADDR,
> -#if defined(CONFIG_MX51) || defined(CONFIG_MX53) || defined(CONFIG_MX6Q)
> +#if defined(CONFIG_MX25) || defined(CONFIG_MX51) || defined(CONFIG_MX53) || 
> defined(CONFIG_MX6Q)

line over 80 characters

Please make sure to run your patches through checkpatch !

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
On a clear disk you can seek forever.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/8] MXC FEC: Resolve speed before configuring gasket

2012-04-12 Thread Wolfgang Denk
Dear "Timo Ketola",

In message <1334223234-23383-6-git-send-email-t...@exertus.fi> you wrote:
> Signed-off-by: Timo Ketola 
> ---
>  drivers/net/fec_mxc.c |   41 ++---
>  1 files changed, 22 insertions(+), 19 deletions(-)
...
> + // FIXME: useless call: miiphy_duplex(edev->name, fec->phy_id);

ERROR: do not use C99 // comments

> + /* configure gasket for RMII, 50 MHz, no loopback, and no echo 
> */

WARNING: line over 80 characters

> + writew(MIIGSK_CFGR_IF_MODE_RMII, &fec->eth->miigsk_cfgr);
> + else
> + /* configure gasket for RMII, 5 MHz, no loopback, and no echo */
> + writew(MIIGSK_CFGR_IF_MODE_RMII | MIIGSK_CFGR_FRCONT, 
> &fec->eth->miigsk_cfgr);

WARNING: line over 80 characters


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"Beware of bugs in the above code; I have only proved it correct, not
tried it." - Donald Knuth
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/8] i.MX25: Has a GPIO4 too

2012-04-12 Thread Timo Ketola

On 12.04.2012 15:10, Wolfgang Denk wrote:

Please make sure to run your patches through checkpatch !


Sorry about that.

Now I could use some help about how to best edit my commits...

--

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


Re: [U-Boot] [PATCH 6/8] i.MX25: Add Exertus EXE4026 board

2012-04-12 Thread Stefano Babic
On 12/04/2012 14:09, Timo Ketola wrote:
> On 12.04.2012 15:06, Stefano Babic wrote:
>>> +exe4026  arm arm926ejs  
>>> exe4026 exertusmx25   
>>> exe4026:IMX_CONFIG=board/exertus/exe4026/imximage.cfg
>>

Hi Timo,

>> I assume you write also some code for this board. Maybe forgotten ?
> 
> Yes, later. I have hard time with git-send-email selecting exactly what
> I want to send.

If you don't already know, maybe this site can help:

http://www.denx.de/wiki/U-Boot/Patches

And if I understand what you are want, maybe the simple way is to add a
branch and to cherry-pick (git cherry-pick) only the commit you want
later send from your main branch. Then you can run "git format patch" to
get the patchset.

Please also add always a changelog in your patches, so we can easy find
changes from previous versions. And please help us adding in CC the
maintainer of the subsystem your patch is thought to change (me for i.MX
related parts).

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC][PATCH] INIT_FUNC - List madness

2012-04-12 Thread Graeme Russ
Hello All,

This patch is a little heads-up for my upcomming INIT_FUNC patch series

This is the INIT_FUNC 'engine' - It processes a file which consists of
entries created by the following macros:

#define INIT_FUNC(fn, init_name, man_reqs, pre_reqs, post_reqs) \
static const char __init_func_ ## fn[] __used \
__attribute__((__section__(".initfuncs"))) = \
"(f:" #fn ":" #init_name ":" #man_reqs " | " #pre_reqs " | " #post_reqs 
")\n";

#define SKIP_INIT(init_name) \
static const char __skip_init_ ## req[] __used \
__attribute__((__section__(".initfuncs"))) = \
"(s:" #init_name ")\n";

#define REPLACE_INIT(old_func, new_func) \
static const char __replace_init_ ## old_func[] __used \
__attribute__((__section__(".initfuncs"))) = \
"(r:" #old_func ":" #new_func ")\n";

So an 'function' entry will look like
(f:function_name:init_step:mandatory_req_1 mandatory_req_2 | optional_req_1 
optional_req_2 | post_req_1 post_req_2)

'init_step' allows multiple functions to be logically grouped (see below)

where:

mandatory_req_1 & mandatory_req_2 are functions or 'init steps' which MUST
exist and will be put  in the init sequence before 'function_name'

optional_req_1 & optional_req_2 are functions or 'init steps' which might
exist and (if they do) will be put in the init sequence before
'function_name'

post_req_1 & post_req_2 are are functions or 'init steps' which might
exist and (if they do) will be put  in the init sequence after
'function_name'

A 'skip' entry will look like:
(s:function_or_step_name)

The function named 'function_or_step_name' will not be included in the
init sequence. If 'function_or_step_name' is the name of a 'step' then
all functions which make up that step are skipped - This is to replace
a arch-level function (or set of functions) with board specific
alternatives.

A 'replace' entry will look like:
(r:old_name:new_name)

Any function named 'old_name' in the init sequence will be replaced with
'new_name' (this is like overriding a weak function without needing to
make the function weak)

So far this seems to work - It creates a list of functions with each
having a list of dependent functions (steps are expanded so the dependency
lists only have functions in them)

Now I just need to write the code that will order the function list

I think this single patch will more than double the use of struct list_head
in U-Boot. It took a while to get used to it's sematics, but the Linux
kernel list data structure is incredible

Regards,

Graeme

commit 1567e349f774d93e25b3ab2da01cab5e11632916
Author: Graeme Russ 
Date:   Sun Apr 8 22:09:42 2012 +1000

initcall: Some testing

diff --git a/tools/mkinitseq.c b/tools/mkinitseq.c
new file mode 100644
index 000..1e2bbb2
--- /dev/null
+++ b/tools/mkinitseq.c
@@ -0,0 +1,870 @@
+/*
+ * (C) Copyright 2012
+ * Graeme Russ 
+ *
+ * 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
+ */
+
+/**
+ * container_of - cast a member of a structure out to the containing structure
+ * @ptr:   the pointer to the member.
+ * @type:  the type of the container struct this is embedded in.
+ * @member:the name of the member within the struct.
+ *
+ */
+#define container_of(ptr, type, member) ({ \
+   const typeof( ((type *)0)->member ) *__mptr = (ptr);\
+   (type *)( (char *)__mptr - offsetof(type,member) );})
+
+
+#include "os_support.h"
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#undef MKINITSEQ_DEBUG
+
+#ifdef MKINITSEQ_DEBUG
+#define debug(fmt,args...) printf (fmt ,##args)
+#else
+#define debug(fmt,args...)
+#endif /* MKINITSEQ_DEBUG */
+
+#include 
+
+struct init_id {
+   struct list_head list;
+   char *name;
+};
+
+struct replace_def {
+   struct list_head list;
+   char *old_name;
+   char *new_name;
+};
+
+struct init_function {
+   struct list_head list;
+
+   char *function_name;
+   char *init_step_name;
+
+   struct list_head mandatory_deps;
+   struct list_head pre_deps;
+   struct list_head post_deps;
+};
+
+struct init_step {
+   struct list_head list;
+
+   char *name;
+
+   struct list_head functions;
+};
+
+struct list_head init_functions;
+struct li

Re: [U-Boot] [RFC][PATCH] INIT_FUNC - List madness

2012-04-12 Thread Detlev Zundel
Hi Graeme,

[...]

> Now I just need to write the code that will order the function list

Did you check 'man tsort'?

Cheers
  Detlev

-- 
I've been examining the existing [linux]  kernel configuration system, and I
have about concluded that the best favor we could do everybody involved with
it is to take it out behind the barn and shoot it through the head.
   -- Eric S. Raymond on linux-kbuild Mar 2000
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/8] i.MX25: Has a GPIO4 too

2012-04-12 Thread Detlev Zundel
Hi Timo,

> On 12.04.2012 15:10, Wolfgang Denk wrote:
>> Please make sure to run your patches through checkpatch !
>
> Sorry about that.
>
> Now I could use some help about how to best edit my commits...

What works very nicely for me is to do the changes, do "git add" on them
and then do a 

COMMIT= ; git commit --squash=$COMMIT ; git rebase -i --autosquash 
${COMMIT}^

(substitute  with the commit-ID of the commit in question).  In
the editor you can decide to add more to the messages, or simply leave
them as is.

I'm sure you will find the details on how this works and why in the
manual ;)

Cheers
  Detlev

-- 
Some mathematicians become so tense these days that they do not go to
sleep during seminars.
--
DENX Software Engineering GmbH,  MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: d...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/8] MXC FEC: Resolve speed before configuring gasket

2012-04-12 Thread Timo Ketola

On 12.04.2012 15:05, Stefano Babic wrote:

On 12/04/2012 11:33, Timo Ketola wrote:

Signed-off-by: Timo Ketola



--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c


Please consider to rebase your patch on u-boot-imx, next branch. There
are already a couple of patches related to gasket and MII.


u-boot-imx is separate repository, right? So I have to clone that and apply my 
patches manually, right?



+   // FIXME: useless call: miiphy_duplex(edev->name, fec->phy_id);


This is dead code. // comments are not allowed, comment should be real
comments, not used to disable code. Why are you disabling ? Please
explain the reason and, if it is required, provide a separate patch for
this.


Return value is discarded and I didn't find any side effects. So it seems to be 
dead call. If agreed, then I'll edit the patch.


--

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


Re: [U-Boot] [RFC][PATCH] INIT_FUNC - List madness

2012-04-12 Thread Wolfgang Denk
Dear Graeme Russ,

In message <4f86cdf0.2030...@gmail.com> you wrote:
> 
> This patch is a little heads-up for my upcomming INIT_FUNC patch series
> 
> This is the INIT_FUNC 'engine' - It processes a file which consists of
> entries created by the following macros:
> 
> #define INIT_FUNC(fn, init_name, man_reqs, pre_reqs, post_reqs) \
>   static const char __init_func_ ## fn[] __used \
>   __attribute__((__section__(".initfuncs"))) = \
>   "(f:" #fn ":" #init_name ":" #man_reqs " | " #pre_reqs " | " #post_reqs 
> ")\n";
> 
> #define SKIP_INIT(init_name) \
>   static const char __skip_init_ ## req[] __used \
>   __attribute__((__section__(".initfuncs"))) = \
>   "(s:" #init_name ")\n";
> 
> #define REPLACE_INIT(old_func, new_func) \
>   static const char __replace_init_ ## old_func[] __used \
>   __attribute__((__section__(".initfuncs"))) = \
>   "(r:" #old_func ":" #new_func ")\n";
> 
> So an 'function' entry will look like
> (f:function_name:init_step:mandatory_req_1 mandatory_req_2 | optional_req_1 
> optional_req_2 | post_req_1 post_req_2)

Looks OK so far...

> So far this seems to work - It creates a list of functions with each
> having a list of dependent functions (steps are expanded so the dependency
> lists only have functions in them)
> 
> Now I just need to write the code that will order the function list
> 
> I think this single patch will more than double the use of struct list_head
> in U-Boot. It took a while to get used to it's sematics, but the Linux
> kernel list data structure is incredible

Umm... why are you writing such code in C yourself?  Don't we have
sufficient tools to perform such sorting?  Detlev already recommended
"tsort" when we discussed this befopre, and now again.  This should
allow you to avoid most of this code.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Success in marriage is not so much finding the right person as it  is
being the right person.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/8] MXC FEC: Resolve speed before configuring gasket

2012-04-12 Thread Stefano Babic
On 12/04/2012 15:16, Timo Ketola wrote:
> On 12.04.2012 15:05, Stefano Babic wrote:
>> On 12/04/2012 11:33, Timo Ketola wrote:
>>> Signed-off-by: Timo Ketola
> 
>>> --- a/drivers/net/fec_mxc.c
>>> +++ b/drivers/net/fec_mxc.c
>>
>> Please consider to rebase your patch on u-boot-imx, next branch. There
>> are already a couple of patches related to gasket and MII.
> 
> u-boot-imx is separate repository, right? 

Right.

> So I have to clone that and
> apply my patches manually, right?

Yes, and maybe you should rebase some of them. Because we are very near
to the release, I put new patches into the -next branch.

> 
>>> +// FIXME: useless call: miiphy_duplex(edev->name, fec->phy_id);
>>
>> This is dead code. // comments are not allowed, comment should be real
>> comments, not used to disable code. Why are you disabling ? Please
>> explain the reason and, if it is required, provide a separate patch for
>> this.
> 
> Return value is discarded and I didn't find any side effects. So it
> seems to be dead call. If agreed, then I'll edit the patch.

Return value is discharged, but I presume the function is called to
print out the status. The function itself printf "PHY duplex" or "PHY AN
duplex", that you drop if you remove the call.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PULL] u-boot-staging/ma...@denx.de :: FOR u-boot/-next

2012-04-12 Thread Marek Vasut
Dear Daniel Schwierzeck,

> Hi Marek,
> 
> On Thu, Apr 12, 2012 at 5:44 AM, Marek Vasut  wrote:
> ...
> 
> >> thanks for picking this up but as I wrote in the other thread those
> >> patches are obsolete
> >> for now. That's why I extracted the three bugfix patches and resent a
> >> separate series.
> >> Please discard my remaining patches in patchwork.
> > 
> > You should get your patchwork account too and discard them yourself ;-)
> 
> ok, but I didn't want to interfere with your workflow ;)

It's all right. MIPS is now yours, you're free to take those patches away from 
me.
> 
> I changed all my remaining patches to either superseeded or accepted so all
> MIPS related patches in patchwork are in a clean state now.

Awesome, welcome abroad ;-)
> 
> Thanks and regards,
> Daniel

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] image: add support for Android's boot image format

2012-04-12 Thread Aneesh V

On 03/17/2012 03:05 PM, Wolfgang Denk wrote:

Dear Aneesh V,

In message<4f153c83.20...@ti.com>  you wrote:


What is your final call on this? The above arguments sound convincing
to me, but I have to admit that I am no legal expert. Either way, it
will be great to have a closure on this. Lack of fastboot support was
the greatest impediment to adoption of mainline U-Boot in our previous
platforms. It will be really unfortunate if the same happens to OMAP5
that has just arrived.

> The license issue was a mistake on my side.

However, there is still cleanup needed for the commit message.


Thanks. I will see if somebody can take it forward.

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


[U-Boot] imx53 - nandflash support ?

2012-04-12 Thread Vellemans, Noel
Hi all,

Anyone working on imx53 NAND-FLASH support ?

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


[U-Boot] Regression due to: arm: Add Prep subcommand support to bootm

2012-04-12 Thread Stephen Warren
I just tried the latest u-boot/master, at commit:

3f0675d Merge branch 'marek.va...@gmail.com' of
git://git.denx.de/u-boot-staging

This fails to boot a Linux kernel on my ARM Tegra board; the boot log is:


## Booting kernel from Legacy Image at 00408000 ...
Image Name: Linux-3.4.0-rc1-next-20120405-00
Image Type: ARM Linux Kernel Image (no loading done) (uncompressed)
Data Size: 2756424 Bytes = 2.6 MiB
Load Address: 
Entry Point: 
Verifying Checksum ... OK
## Flattened Device Tree blob at 0100
Booting using the fdt blob at 0x0100
XIP Kernel Image (no loading done) ... OK
OK
Loading Device Tree to 010fa000, end 010ff726 ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Warning: Neither atags nor dtb found


If I revert commit 0a672d4 "arm: Add Prep subcommand support to bootm",
then everything works fine again.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] using different architecture / toolchain for SPL build

2012-04-12 Thread Allen Martin
> > only option I found that worked was to use an armv4 toolchain for
> the
> > armv4 bits and armv7 toolchain for the armv7 bits.
> 
> I'm not an expert in this area, but this cannot be the right
> approach.
> Did you try asking on the binutils mailing list?  This is where
> experts should be available...

I drilled down on this some more and I found that with an armv4t linker I can 
force it to generate armv7 compatible interworking code if I use the "--use-bx" 
switch.  Unfortunately there doesn't seem to be any inverse, so with a armv7 
linker I can't force it to generate armv4t compatible interworking.  This does 
seem to be a linker limitation, I'll take it up on the linaro toolchain list.

> 
> > How is it possible then to build an SPL that builds from a
> different
> > arch subdirectory? It seems like the arch subdirectory is decided
> 
> We are not talking about a different architecture here - like a
> PowerPC SPL that boots an ARM U-Boot.  We are still in a single
> architecture, it's just different CPU models.  And when both GCC and
> the assembler are capable of being tuned to the respective CPU
> model,
> this should also be possible for the linker.

The problem I'm having with the SPL build is that a single entry in boards.cfg 
can have exactly one architecture and CPU model.  So there's no easy way to 
have the SPL build compile from arm720t and the non SPL build compile from 
armv7.  So I either have to have two board entries or what we have today which 
is a very fragile armv4t build out of the armv7 directory.  I'd really like to 
solve this since we could definitely clean up the tegra code a bit if we could 
remove the armv4t bits from the armv7 directory and we could also remove the 
dependency on USE_PRIVATE_LIBGCC for the tegra build.

-Allen

nvpublic


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


Re: [U-Boot] [PATCH] mx6qsabrelite: No need to set the direction for GPIO3_23 again

2012-04-12 Thread Dirk Behme

On 11.04.2012 22:22, Fabio Estevam wrote:

There is a 'gpio_direction_output(87, 0);' call previously, so the GPIO 
direction is
already established.

Use gpio_set_value() for changing the GPIO output then.

Signed-off-by: Fabio Estevam
---
  board/freescale/mx6qsabrelite/mx6qsabrelite.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c 
b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
index 1d09a72..2155d87 100644
--- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c
+++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
@@ -135,7 +135,7 @@ static void setup_iomux_enet(void)

/* Need delay 10ms according to KSZ9021 spec */
udelay(1000 * 10);
-   gpio_direction_output(87, 1);  /* GPIO 3-23 */
+   gpio_set_value(87, 1);  /* GPIO 3-23 */

imx_iomux_v3_setup_multiple_pads(enet_pads2, ARRAY_SIZE(enet_pads2));
  }


Acked-by: Dirk Behme 

Thanks

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


Re: [U-Boot] [PATCH 5/8] MXC FEC: Resolve speed before configuring gasket

2012-04-12 Thread Troy Kisky

On 4/12/2012 2:33 AM, Timo Ketola wrote:

Signed-off-by: Timo Ketola
---
  drivers/net/fec_mxc.c |   41 ++---
  1 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 1fdd071..5d11df2 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -406,6 +406,22 @@ static int fec_open(struct eth_device *edev)
 */
writel(readl(&fec->eth->ecntrl) | FEC_ECNTRL_ETHER_EN,
&fec->eth->ecntrl);
+#ifdef CONFIG_PHYLIB
+   if (!fec->phydev)
+   fec_eth_phy_config(edev);
+   if (fec->phydev) {
+   /* Start up the PHY */
+   phy_startup(fec->phydev);
+   speed = fec->phydev->speed;
+   } else {
+   speed = _100BASET;
+   }
+#else
+   miiphy_wait_aneg(edev);
+   speed = miiphy_speed(edev->name, fec->phy_id);
+   // FIXME: useless call: miiphy_duplex(edev->name, fec->phy_id);
+#endif
+
  #if defined(CONFIG_MX25) || defined(CONFIG_MX53)
udelay(100);
/*
@@ -418,9 +434,12 @@ static int fec_open(struct eth_device *edev)
/* wait for the gasket to be disabled */
while (readw(&fec->eth->miigsk_enr)&  MIIGSK_ENR_READY)
udelay(2);
-
-   /* configure gasket for RMII, 50 MHz, no loopback, and no echo */
-   writew(MIIGSK_CFGR_IF_MODE_RMII,&fec->eth->miigsk_cfgr);
+   if (speed == _100BASET)
+   /* configure gasket for RMII, 50 MHz, no loopback, and no echo 
*/
+   writew(MIIGSK_CFGR_IF_MODE_RMII,&fec->eth->miigsk_cfgr);
+   else
+   /* configure gasket for RMII, 5 MHz, no loopback, and no echo */
+   writew(MIIGSK_CFGR_IF_MODE_RMII | 
MIIGSK_CFGR_FRCONT,&fec->eth->miigsk_cfgr);
  

This will break gigabit speed.  How about

if (speed != _10BASET)




/* re-enable the gasket */
writew(MIIGSK_ENR_EN,&fec->eth->miigsk_enr);
@@ -435,22 +454,6 @@ static int fec_open(struct eth_device *edev)
}
  #endif

-#ifdef CONFIG_PHYLIB
-   if (!fec->phydev)
-   fec_eth_phy_config(edev);
-   if (fec->phydev) {
-   /* Start up the PHY */
-   phy_startup(fec->phydev);
-   speed = fec->phydev->speed;
-   } else {
-   speed = _100BASET;
-   }
-#else
-   miiphy_wait_aneg(edev);
-   speed = miiphy_speed(edev->name, fec->phy_id);
-   miiphy_duplex(edev->name, fec->phy_id);
-#endif
-
  #ifdef FEC_QUIRK_ENET_MAC
{
u32 ecr = readl(&fec->eth->ecntrl)&  ~FEC_ECNTRL_SPEED;


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


Re: [U-Boot] [PATCH 5/8] MXC FEC: Resolve speed before configuring gasket

2012-04-12 Thread Timo Ketola

On 12.04.2012 22:59, Troy Kisky wrote:

On 4/12/2012 2:33 AM, Timo Ketola wrote:

Signed-off-by: Timo Ketola
+ if (speed == _100BASET)

This will break gigabit speed. How about

if (speed != _10BASET)


Looks fine to me. I'll put it that way in v2.

--

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


Re: [U-Boot] [PATCH v3 1/3] mmc: sdhci: add the quirk for broken R1b response

2012-04-12 Thread Terry Lambert
Sorry for not properly threading, just joined the list formally.

inre: the subject, already replied to the author directly, but the
following comments:

The 'retriy' is post-decremented so the failure compare should be for -1.

The word 'status' is misspelled as 'stauts".

Other than that, LGTM when combined with the other 3 patches, which also LGTM.

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


Re: [U-Boot] using different architecture / toolchain for SPL build

2012-04-12 Thread Wolfgang Denk
Dear Allen Martin,

In message <3c7a7aca8617d24290826ec008b5cd08510f030...@hqmail03.nvidia.com> you 
wrote:
>
> > Did you try asking on the binutils mailing list?  This is where
> > experts should be available...
> 
> I drilled down on this some more and I found that with an armv4t
> linker I can force it to generate armv7 compatible interworking code
> if I use the "--use-bx" switch. Unfortunately there doesn't seem to
> be any inverse, so with a armv7 linker I can't force it to generate
> armv4t compatible interworking. This does seem to be a linker
> limitation, I'll take it up on the linaro toolchain list.

No, please do not.

Please take it to the binutils mailing list, so it gets solved in
mainline.  It does not help at all if Linaro provides a local fix for
their tools, and for everybody else the issue is still unsolved.

> > We are not talking about a different architecture here - like a
> > PowerPC SPL that boots an ARM U-Boot.  We are still in a single
> > architecture, it's just different CPU models.  And when both GCC and
> > the assembler are capable of being tuned to the respective CPU
> > model,
> > this should also be possible for the linker.
>
> The problem I'm having with the SPL build is that a single entry in
> boards.cfg can have exactly one architecture and CPU model. So

But you can define any tye of CONFIG_ settings, both in boards.cfg and
in your board config file.

> there's no easy way to have the SPL build compile from arm720t and
> the non SPL build compile from armv7. So I either have to have two

What would prevent you from extending the Makefiles to set build
options depending on CONFIG_ settings from your board configuration?


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
  Nail here --X-- for new monitor.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC][PATCH] INIT_FUNC - List madness

2012-04-12 Thread Graeme Russ
Hi Wolfgang,

On Thu, Apr 12, 2012 at 11:28 PM, Wolfgang Denk  wrote:
> Dear Graeme Russ,
>
> In message <4f86cdf0.2030...@gmail.com> you wrote:
>>
>> This patch is a little heads-up for my upcomming INIT_FUNC patch series
>>
>> This is the INIT_FUNC 'engine' - It processes a file which consists of
>> entries created by the following macros:
>>
>> #define INIT_FUNC(fn, init_name, man_reqs, pre_reqs, post_reqs) \
>>       static const char __init_func_ ## fn[] __used \
>>       __attribute__((__section__(".initfuncs"))) = \
>>       "(f:" #fn ":" #init_name ":" #man_reqs " | " #pre_reqs " | " 
>> #post_reqs ")\n";
>>
>> #define SKIP_INIT(init_name) \
>>       static const char __skip_init_ ## req[] __used \
>>       __attribute__((__section__(".initfuncs"))) = \
>>       "(s:" #init_name ")\n";
>>
>> #define REPLACE_INIT(old_func, new_func) \
>>       static const char __replace_init_ ## old_func[] __used \
>>       __attribute__((__section__(".initfuncs"))) = \
>>       "(r:" #old_func ":" #new_func ")\n";
>>
>> So an 'function' entry will look like
>> (f:function_name:init_step:mandatory_req_1 mandatory_req_2 | optional_req_1 
>> optional_req_2 | post_req_1 post_req_2)
>
> Looks OK so far...
>
>> So far this seems to work - It creates a list of functions with each
>> having a list of dependent functions (steps are expanded so the dependency
>> lists only have functions in them)
>>
>> Now I just need to write the code that will order the function list
>>
>> I think this single patch will more than double the use of struct list_head
>> in U-Boot. It took a while to get used to it's sematics, but the Linux
>> kernel list data structure is incredible
>
> Umm... why are you writing such code in C yourself?  Don't we have
> sufficient tools to perform such sorting?  Detlev already recommended
> "tsort" when we discussed this befopre, and now again.  This should
> allow you to avoid most of this code.

So far, the code (as posted above) doesn't do any sorting yet. What I have
so far is:
 - Reading the binary output of ld which has collected all the init
   function definitions dumped in the .initfuncs section
 - Replace NULLs with non-nulls so the .initfunc section can be processed
   as a single entity using standard C string functions
 - Use strtok_r to isolate and process each init entry - The entries are
   stored in various lists
 - Check all mandatory functions and steps have a matching INIT_FUNC
   entry
 - Check for duplicates between 'skip' and 'replace' entries (you cannot
   both skip and replace a function or step)
 - Remove all skipped functions and steps
 - Apply replacement entries
 - Expand init steps into the corresponding list of init functions

A couple of things still to be done before I can actually sort the list:
 - Remove references to non-mandatory functions which do not exist (i.e.
   so not have a matching INIT_FUNC entry)
 - Apply 'skip' processing to the init_steps list (I added init_steps
   which is used to expand steps to functions and didn't get a chance to
   add skip list processing)
 - A little more logic on 'replace' entries where an entire step is being
   replaced (replace the entry in the dependency lists and delete the
   step from the init_steps list)
 - Convert 'Post Requisites' into 'Pre-Requisites'

At which point I will have a look at tsort...

But, tsort works on paired entries, while INIT_FUNC allows functions to
have multiple dependencies. So to use tsort, I will need to process the
list to produce entry pairs - That should be a pretty simple operation.

Regards,

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


Re: [U-Boot] [PATCH v3 1/3] mmc: sdhci: add the quirk for broken R1b response

2012-04-12 Thread Jaehoon Chung
Hi Terry.

You're right.
I sent the patch-v5..did you check them?

Best Regards,
Jaehoon Chung
On 04/13/2012 05:21 AM, Terry Lambert wrote:

> Sorry for not properly threading, just joined the list formally.
> 
> inre: the subject, already replied to the author directly, but the
> following comments:
> 
> The 'retriy' is post-decremented so the failure compare should be for -1.
> 
> The word 'status' is misspelled as 'stauts".
> 
> Other than that, LGTM when combined with the other 3 patches, which also LGTM.
> 
> -- Terry
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
> 


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


Re: [U-Boot] [PATCH v5 3/4] mmc: support the sdhci instead of s5p_mmc for samsung-soc

2012-04-12 Thread Minkyu Kang
On 12 April 2012 19:59, Jaehoon Chung  wrote:
> In driver mmc, generic s5p_sdhci code is implemented.
> s5p_mmc file  is dupulicated.
> we are good that use the generic sdhci.
> This patch supported the sdhci  for Samsung-SoC.
>
> Signed-off-by: Jaehoon Chung 
> Signed-off-by: Kyungmin Park 
> Acked-by: Lei Wen
> ---
>  arch/arm/include/asm/arch-exynos/mmc.h  |   93 +++---
>  arch/arm/include/asm/arch-s5pc1xx/mmc.h |   93 +++---
>  drivers/mmc/Makefile                    |    2 +-
>  drivers/mmc/s5p_mmc.c                   |  490 
> ---
>  4 files changed, 95 insertions(+), 583 deletions(-)
>  delete mode 100644 drivers/mmc/s5p_mmc.c
>

Acked-by: Minkyu Kang 

-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 4/4] ARM: SAMSUNG: support sdhci controller

2012-04-12 Thread Minkyu Kang
On 12 April 2012 19:59, Jaehoon Chung  wrote:
> To support sdhci controller, remove the CONFIG_S5P_MMC..
> Instead, use the CONFIG_S5P_SDHCI/CONFIG_SDHCI.
>
> Signed-off-by: Jaehoon Chung 
> Signed-off-by: Kyungmin Park 
> Acked-by: Lei Wen
> ---
>  include/configs/origen.h            |    3 ++-
>  include/configs/s5p_goni.h          |    3 ++-
>  include/configs/s5pc210_universal.h |    3 ++-
>  include/configs/smdk5250.h          |    3 ++-
>  include/configs/smdkv310.h          |    3 ++-
>  include/configs/trats.h             |    3 ++-
>  6 files changed, 12 insertions(+), 6 deletions(-)
>

Acked-by: Minkyu Kang 

-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC][PATCH] INIT_FUNC - List madness

2012-04-12 Thread Graeme Russ
Hi Wolfgang, Detlev

> But, tsort works on paired entries, while INIT_FUNC allows functions to
> have multiple dependencies. So to use tsort, I will need to process the
> list to produce entry pairs - That should be a pretty simple operation.

Well the solution appears to be trivial anyway:

http://www.algorithmist.com/index.php/Topological_sort

for each init_functions list entry {
  Check all functions which are a mandatory dependency on any other
  function exist (already done)

  Strip from pre-deps and post-deps all functions which do not have an
  INIT_FUNC entry

  Move all entries from mandatory_deps into pre_deps

  Convert all post_dep entries into corresponding pre_dep entries
}

while (init_functions list is non-empty) {

  if (no init_functions entry has an empty pre_deps) {
Fail - cyclic dependencies
  }

  Get first entry in init_functions where pre_deps list is empty

  Add init_functions.function_name to final list

  for each init_functions list entry {
remove init_functions.function_name from pre_deps list
  }

  remove entry from init_functions list
}

so I don't need to reduce the entries down to a list of pairs and the
sorting function will probably be one of the smaller components of the
whole thing

Regards,

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


Re: [U-Boot] [PATCH 4/8] i.MX25: Has a GPIO4 too

2012-04-12 Thread Timo Ketola

On 12.04.2012 16:09, Detlev Zundel wrote:

What works very nicely for me is to do the changes, do "git add" on them
and then do a

COMMIT=  ; git commit --squash=$COMMIT ; git rebase -i --autosquash 
${COMMIT}^


Thanks - thats the kind of handholding I'm missing...

--

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


[U-Boot] U-boot customized

2012-04-12 Thread Allyson

Hi folks,

My name is Allyson, 
I need put u-boot on my board with ARM 920t (at91rm9200)

When I build u-boot-1.1.6 it is worked ok, but if I build u-boot-2011 don't
work.

I need help ... please!

Tks for all.
 
-- 
View this message in context: 
http://old.nabble.com/U-boot-customized-tp33679635p33679635.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

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



Re: [U-Boot] U-boot customized

2012-04-12 Thread Graeme Russ
Hi Allyson,

On Fri, Apr 13, 2012 at 1:57 PM, Allyson  wrote:
>
> Hi folks,
>
> My name is Allyson,
> I need put u-boot on my board with ARM 920t (at91rm9200)
>
> When I build u-boot-1.1.6 it is worked ok, but if I build u-boot-2011 don't
> work.
>
> I need help ... please!

And we will need a lot more detail before we can help...

 - Are you running 'mainline' U-Boot (versus some custom version)
 - What does 'don't work' mean - Does it compile? If so, is there any
output when you try to boot the board
 - If you are using 'mainline' U-Boot with no other patches, you
should try using 'git bisect' to find out when things stopped working

Please have a look at:

http://catb.org/esr/faqs/smart-questions.html

Regards,

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


Re: [U-Boot] [PATCH v5 4/4] ARM: SAMSUNG: support sdhci controller

2012-04-12 Thread Prabhakar Lad
Hi Jaehoon,

On Thu, Apr 12, 2012 at 4:29 PM, Jaehoon Chung  wrote:
> To support sdhci controller, remove the CONFIG_S5P_MMC..
> Instead, use the CONFIG_S5P_SDHCI/CONFIG_SDHCI.
>
> Signed-off-by: Jaehoon Chung 
> Signed-off-by: Kyungmin Park 
> Acked-by: Lei Wen
> ---
>  include/configs/origen.h            |    3 ++-
>  include/configs/s5p_goni.h          |    3 ++-
>  include/configs/s5pc210_universal.h |    3 ++-
>  include/configs/smdk5250.h          |    3 ++-
>  include/configs/smdkv310.h          |    3 ++-
>  include/configs/trats.h             |    3 ++-
>  6 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/include/configs/origen.h b/include/configs/origen.h
> index 8ede825..ea8066f 100644
> --- a/include/configs/origen.h
> +++ b/include/configs/origen.h
> @@ -71,7 +71,8 @@
>  /* SD/MMC configuration */
>  #define CONFIG_GENERIC_MMC             1
>  #define CONFIG_MMC                     1
> -#define CONFIG_S5P_MMC                 1
> +#define CONFIG_SDHCI                   1
> +#define CONFIG_S5P_SDHCI               1
>
>  /* PWM */
>  #define CONFIG_PWM                     1
> diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
> index 56b5547..f659699 100644
> --- a/include/configs/s5p_goni.h
> +++ b/include/configs/s5p_goni.h
> @@ -65,7 +65,8 @@
>  /* MMC */
>  #define CONFIG_GENERIC_MMC             1
>  #define CONFIG_MMC                     1
> -#define CONFIG_S5P_MMC                 1
> +#define CONFIG_SDHCI                   1
> +#define CONFIG_S5P_SDHCI               1
>
>  /* PWM */
>  #define CONFIG_PWM                     1
> diff --git a/include/configs/s5pc210_universal.h 
> b/include/configs/s5pc210_universal.h
> index 1301275..241d209 100644
> --- a/include/configs/s5pc210_universal.h
> +++ b/include/configs/s5pc210_universal.h
> @@ -68,7 +68,8 @@
>  /* MMC */
>  #define CONFIG_GENERIC_MMC     1
>  #define CONFIG_MMC             1
> -#define CONFIG_S5P_MMC         1
> +#define CONFIG_SDHCI           1
> +#define CONFIG_S5P_SDHCI       1
>
>  /* PWM */
>  #define CONFIG_PWM                     1
> diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
> index 9659f9e..0f63040 100644
> --- a/include/configs/smdk5250.h
> +++ b/include/configs/smdk5250.h
> @@ -78,7 +78,8 @@
>  /* SD/MMC configuration */
>  #define CONFIG_GENERIC_MMC
>  #define CONFIG_MMC
> -#define CONFIG_S5P_MMC
> +#define CONFIG_SDHCI
> +#define CONFIG_S5P_SDHCI
There is no consistency for the #define  CONFIG_S5P_SDHCI,
few have been assigned to value 1, And looking at the patchset
the value of it is not used if I am not wrong, depending or defined
or not some file is built. Best way could be not to assign any value
for such cases, just  #define CONFIG_S5P_SDHCI would make
sense. It would be good If you also do the same for other CONFIG'S
defined.

Thx,
--Prabhakar Lad

>
>  #define CONFIG_BOARD_EARLY_INIT_F
>
> diff --git a/include/configs/smdkv310.h b/include/configs/smdkv310.h
> index 93c25da..077f0e0 100644
> --- a/include/configs/smdkv310.h
> +++ b/include/configs/smdkv310.h
> @@ -70,7 +70,8 @@
>  /* SD/MMC configuration */
>  #define CONFIG_GENERIC_MMC             1
>  #define CONFIG_MMC                     1
> -#define CONFIG_S5P_MMC                 1
> +#define CONFIG_SDHCI                   1
> +#define CONFIG_S5P_SDHCI               1
>
>  /* PWM */
>  #define CONFIG_PWM                     1
> diff --git a/include/configs/trats.h b/include/configs/trats.h
> index 10f11d9..71b9393 100644
> --- a/include/configs/trats.h
> +++ b/include/configs/trats.h
> @@ -74,7 +74,8 @@
>  /* MMC */
>  #define CONFIG_GENERIC_MMC
>  #define CONFIG_MMC
> -#define CONFIG_S5P_MMC
> +#define CONFIG_S5P_SDHCI
> +#define CONFIG_SDHCI
>
>  /* PWM */
>  #define CONFIG_PWM
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 4/4] ARM: SAMSUNG: support sdhci controller

2012-04-12 Thread Graeme Russ
Hi Prabhakar,

On Fri, Apr 13, 2012 at 4:16 PM, Prabhakar Lad
 wrote:
> Hi Jaehoon,
>

[snip]

>    There is no consistency for the #define  CONFIG_S5P_SDHCI,
>    few have been assigned to value 1, And looking at the patchset
>    the value of it is not used if I am not wrong, depending or defined
>    or not some file is built. Best way could be not to assign any value
>    for such cases, just  #define CONFIG_S5P_SDHCI would make
>    sense. It would be good If you also do the same for other CONFIG'S
>    defined.

All boolean defines should be #define'd with no value

Patches should be submitted to cleanup any that are currently defined with
a value. Such patches should be marked 'cosmetic' and be distinctly
seperate from any patches that are adding new code, prefferable prior to
the patches addding new defines so each file always has a consistent style

Regards,

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


[U-Boot] [PATCH] i.MX6: arm2: Add AXI cache and Qos setting

2012-04-12 Thread Dirk Behme
Do the same AXI cache and Qos settings done already in the
SabreLite imximage.cfg for the ARM2 board, too.

It fixes a display flash issue caused by low priority of
the display IDMA channel.

Signed-off-by: Dirk Behme 
CC: Jason Chen 
CC: Jason Liu 
CC: Stefano Babic 
CC: Fabio Estevam 
---
 board/freescale/mx6qarm2/imximage.cfg |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/board/freescale/mx6qarm2/imximage.cfg 
b/board/freescale/mx6qarm2/imximage.cfg
index 5f0ee0d..ceecbf9 100644
--- a/board/freescale/mx6qarm2/imximage.cfg
+++ b/board/freescale/mx6qarm2/imximage.cfg
@@ -165,3 +165,9 @@ DATA 4 0x020c4074 0x3FF0
 DATA 4 0x020c4078 0x00FFF300
 DATA 4 0x020c407c 0x0FC3
 DATA 4 0x020c4080 0x03FF
+
+# enable AXI cache for VDOA/VPU/IPU
+DATA 4 0x020e0010 0xF0FF
+# set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7
+DATA 4 0x020e0018 0x007F007F
+DATA 4 0x020e001c 0x007F007F
-- 
1.7.0.4

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