[U-Boot] [PATCH v2 2/3] usb:gadget:composite: Support for composite at gadget.h

2012-04-17 Thread Lukasz Majewski
Add device data pointer to the USB gadget's device struct.
Wrapper for extracting usb_gadget from Linux's usb device

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 

---
Changes for v2:
- Two separate patches regarding gadget.h file squashed together
---
 include/linux/usb/gadget.h |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 275cb5f..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 */
 };
 
 /**
@@ -481,6 +482,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 v2 3/3] usb:udc:samsung Add functions for storing private gadget data in UDC driver

2012-04-17 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 v2 0/3] usb:gadget:composite: Support for composite gadget framework

2012-04-17 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 to u-boot.

Code supporting this framework has been added to gadget.h and Samsung's 
UDC driver as well.

---
Changes for v2:
- Squash the kernel files with u-boot compatibility layer.
- Removal of dead/kernel specific code.
- Comments corrected according to u-boot coding style.
- Two separate patches regarding gadget.h file squashed together.

Lukasz Majewski (3):
  usb:gadget:composite USB composite gadget support
  usb:gadget:composite: Support for composite at gadget.h
  usb:udc:samsung Add functions for storing private gadget data in UDC
driver

 drivers/usb/gadget/composite.c   | 1091 ++
 drivers/usb/gadget/s3c_udc_otg.c |   12 +
 include/linux/usb/composite.h|  350 
 include/linux/usb/gadget.h   |6 +
 include/usb/lin_gadget_compat.h  |   25 +-
 5 files changed, 1482 insertions(+), 2 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 v2 1/3] usb:gadget:composite USB composite gadget support

2012-04-17 Thread Lukasz Majewski
USB Composite gadget implementation for u-boot. It builds on top
of USB UDC drivers.

This commit is based on following files from Linux Kernel v2.6.36:

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

SHA1: d187abb9a83e6c6b6e9f2ca17962bdeafb4bc903

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 

---
Changes for v2:
- Squash the kernel files with u-boot compatibility layer.
- Removal of dead/kernel specific code
- Comments corrected according to u-boot coding style
---
 drivers/usb/gadget/composite.c  | 1091 +++
 include/linux/usb/composite.h   |  350 +
 include/usb/lin_gadget_compat.h |   25 +-
 3 files changed, 1464 insertions(+), 2 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..e7b4835
--- /dev/null
+++ b/drivers/usb/gadget/composite.c
@@ -0,0 +1,1091 @@
+/*
+ * composite.c - infrastructure for Composite USB Gadgets
+ *
+ * Copyright (C) 2006-2008 David Brownell
+ * U-boot porting: 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 
+
+/* big enough to hold our biggest descriptor */
+#define USB_BUFSIZ 4096
+
+static struct usb_composite_driver *composite;
+
+/**
+ * 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;
+
+   debug("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);
+
+   if (function->bind) {
+   value = function->bind(config, function);
+   if (value < 0) {
+   list_del(&function->list);
+   function->config = NULL;
+   }
+   } else
+   value = 0;
+
+   if (!config->fullspeed && function->descriptors)
+   config->fullspeed = 1;
+   if (!config->highspeed && function->hs_descriptors)
+   config->highspeed = 1;
+
+done:
+   if (value)
+   debug("adding '%s'/%p --> %d\n",
+   function->name, function, value);
+   return value;
+}
+
+/**
+ * usb_function_deactivate - prevent function and gadget enumeration
+ * @function: the function that isn't yet ready to respond
+ *
+ * Blocks response of the gadget driver to host enumeration by
+ * preventing the data line pullup from being activated.  This is
+ * normally called during @bind() processing to change from the
+ * initial "ready to respond" state, or when a required resource
+ * becomes available.
+ *
+ * For example, drivers that serve as a passthrough to a userspace
+ * daemon can block enumeration unless that daemon (such as an OBEX,
+ * MTP, or print server) is ready to handle host requests.
+ *
+ * Not all systems support software control of their USB peripheral
+ * data pullups.
+ *
+ * Returns zero on success, else negative errno.
+ */
+int usb_function_deactivate(struct usb_function *function)
+{
+   struct usb_composite_dev*cdev = function->config->cdev;
+   int status = 0;
+
+   if (cdev->deactivations == 0)
+   status = usb_gadget_disconnect(cdev->gadget);
+   if (status == 0)
+   cdev->deactivations++;
+
+   return status;
+}
+
+/**
+ * usb_function_activate - allow function and gadget enumerat

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

2012-04-17 Thread Marek Vasut
Dear 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);

debug()

> + 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,

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 1/3] usb:gadget:composite USB composite gadget support

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

> USB Composite gadget implementation for u-boot. It builds on top
> of USB UDC drivers.
> 
> This commit is based on following files from Linux Kernel v2.6.36:
> 
> ./include/linux/usb/composite.h
> ./drivers/usb/gadget/composite.c
> 
> SHA1: d187abb9a83e6c6b6e9f2ca17962bdeafb4bc903
> 
> Signed-off-by: Lukasz Majewski 
> Signed-off-by: Kyungmin Park 
> Cc: Marek Vasut 
> 
> ---
> Changes for v2:
> - Squash the kernel files with u-boot compatibility layer.
> - Removal of dead/kernel specific code
> - Comments corrected according to u-boot coding style
> ---
>  drivers/usb/gadget/composite.c  | 1091
> +++ include/linux/usb/composite.h   | 
> 350 +
>  include/usb/lin_gadget_compat.h |   25 +-
>  3 files changed, 1464 insertions(+), 2 deletions(-)
>  create mode 100644 drivers/usb/gadget/composite.c
>  create mode 100644 include/linux/usb/composite.h

[...]

> +int usb_string_ids_n(struct usb_composite_dev *c, unsigned n)
> +{
> + unsigned next = c->next_string_id;
> + if (unlikely(n > 254 || (unsigned)next + n > 254))

This unlikely() call is unlikely part of uboot :)

> + return -ENODEV;
> + c->next_string_id += n;
> + return next + 1;
> +}
> +
> +static void composite_setup_complete(struct usb_ep *ep, struct usb_request
> *req) +{
> + if (req->status || req->actual != req->length)
> + debug("%s: setup complete --> %d, %d/%d\n", __func__,
> + req->status, req->actual, req->length);
> +}
> +
> +/*

[...]

> +
> +static void composite_unbind(struct usb_gadget *gadget)
> +{
> + struct usb_composite_dev*cdev = get_gadget_data(gadget);
> +
> + /*
> +  * composite_disconnect() must already have been called
> +  * by the underlying peripheral controller driver!
> +  * so there's no i/o concurrency that could affect the
> +  * state protected by cdev->lock.
> +  */
> + BUG_ON(cdev->config);

Do we have BUG_ON() defined in uboot ?

> +
> + while (!list_empty(&cdev->configs)) {
> + struct usb_configuration*c;
> +
> + c = list_first_entry(&cdev->configs,
> + struct usb_configuration, list);
> + while (!list_empty(&c->functions)) {
> + struct usb_function *f;
> +
> + f = list_first_entry(&c->functions,
> + struct usb_function, list);
> + list_del(&f->list);
> + if (f->unbind) {
> + debug("unbind function '%s'/%p\n",
> + f->name, f);
> + f->unbind(c, f);
> + }
> + }
> + list_del(&c->list);
> + if (c->unbind) {
> + debug("unbind config '%s'/%p\n", c->label, c);
> + c->unbind(c);
> + }
> + }
> + if (composite->unbind)
> + composite->unbind(cdev);
> +
> + if (cdev->req) {
> + kfree(cdev->req->buf);
> + usb_ep_free_request(gadget->ep0, cdev->req);
> + }
> + kfree(cdev);
> + set_gadget_data(gadget, NULL);
> +
> + composite = NULL;
> +}
> +
> +static int composite_bind(struct usb_gadget *gadget)
> +{
> + struct usb_composite_dev*cdev;
> + int status = -ENOMEM;
> +
> + cdev = calloc(sizeof *cdev, 1);
> + if (!cdev)
> + return status;
> +
> + cdev->gadget = gadget;
> + set_gadget_data(gadget, cdev);
> + INIT_LIST_HEAD(&cdev->configs);
> +
> + /* preallocate control response and buffer */
> + cdev->req = usb_ep_alloc_request(gadget->ep0, GFP_KERNEL);
> + if (!cdev->req)
> + goto fail;
> + cdev->req->buf = kmalloc(USB_BUFSIZ, GFP_KERNEL);
> + if (!cdev->req->buf)
> + goto fail;
> + cdev->req->complete = composite_setup_complete;
> + gadget->ep0->driver_data = cdev;
> +
> + cdev->bufsiz = USB_BUFSIZ;
> + cdev->driver = composite;
> +
> + usb_gadget_set_selfpowered(gadget);
> + usb_ep_autoconfig_reset(cdev->gadget);
> +
> + status = composite->bind(cdev);
> + if (status < 0)
> + goto fail;
> +
> + cdev->desc = *composite->dev;
> + cdev->desc.bMaxPacketSize0 = gadget->ep0->maxpacket;
> +
> + debug("%s: ready\n", composite->name);
> + return 0;
> +
> +fail:
> + composite_unbind(gadget);
> + return status;
> +}
> +
> +static void
> +composite_suspend(struct usb_gadget *gadget)
> +{
> + struct usb_composite_dev*cdev = get_gadget_data(gadget);
> + struct usb_function *f;
> +
> + debug("%s: suspend\n", __func__);
> + if (cdev->config) {
> + list_for_each_entry(f, &cdev->config->functions, list) {
> + if (f->suspend)
> + 

[U-Boot] MXS NAND: DMA read error

2012-04-17 Thread Lauri Hintsala

Hello,

I'm trying to compile latest U-Boot to mx28evk (rev D) with NAND 
support. U-Boot boots up but NAND chip is not detected and DMA read 
error is popped up.



Here is console output:

U-Boot 2012.04-rc2-dirty (Apr 17 2012 - 10:58:50)

Freescale i.MX28 family at 454 MHz
DRAM:  128 MiB
NAND:  MXS NAND: DMA read error (-110)
MXS NAND: DMA read error (-110)
MXS NAND: Error sending command
MXS NAND: DMA read error (-110)
MXS NAND: DMA read error (-110)
MXS NAND: Error sending command
MXS NAND: DMA read error (-110)
MXS NAND: DMA read error (-110)
MXS NAND: DMA read error (-110)
MXS NAND: DMA read error (-110)
MXS NAND: DMA read error (-110)
MXS NAND: DMA read error (-110)
MXS NAND: DMA read error (-110)
MXS NAND: DMA read error (-110)
No NAND device found!!!
0 MiB


I did following changes to mainline code. Did I forget something?

diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c
index 9c95811..93e54da 100644
--- a/drivers/mtd/nand/mxs_nand.c
+++ b/drivers/mtd/nand/mxs_nand.c
@@ -465,7 +465,7 @@ static void mxs_nand_read_buf(struct mtd_info *mtd, 
uint8_t *buf, int length)

/* Execute the DMA chain. */
ret = mxs_dma_go(channel);
if (ret) {
-   printf("MXS NAND: DMA read error\n");
+   printf("MXS NAND: DMA read error (%d)\n", ret);
goto rtn;
}

diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 02f3366..a0bd2db 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -148,6 +148,15 @@
 #endif

 /*
+ * NAND
+ */
+#define CONFIG_CMD_NAND
+#define CONFIG_NAND_MXS
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_SYS_NAND_BASE   0x6000
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+
+/*
  * Ethernet on SOC (FEC)
  */
 #ifdef CONFIG_CMD_NET


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


Re: [U-Boot] MXS NAND: DMA read error

2012-04-17 Thread Marek Vasut
Dear Lauri Hintsala,

> Hello,
> 
> I'm trying to compile latest U-Boot to mx28evk (rev D) with NAND
> support. U-Boot boots up but NAND chip is not detected and DMA read
> error is popped up.

MX28 EVK has no NAND, right?

Otherwise, check if you have APBH DMA enabled in your include/configs/mx28evk.h

btw Fabio, can you please ping me on jabber?

> Here is console output:
> 
> U-Boot 2012.04-rc2-dirty (Apr 17 2012 - 10:58:50)
> 
> Freescale i.MX28 family at 454 MHz
> DRAM:  128 MiB
> NAND:  MXS NAND: DMA read error (-110)
> MXS NAND: DMA read error (-110)
> MXS NAND: Error sending command
> MXS NAND: DMA read error (-110)
> MXS NAND: DMA read error (-110)
> MXS NAND: Error sending command
> MXS NAND: DMA read error (-110)
> MXS NAND: DMA read error (-110)
> MXS NAND: DMA read error (-110)
> MXS NAND: DMA read error (-110)
> MXS NAND: DMA read error (-110)
> MXS NAND: DMA read error (-110)
> MXS NAND: DMA read error (-110)
> MXS NAND: DMA read error (-110)
> No NAND device found!!!
> 0 MiB
> 
> 
> I did following changes to mainline code. Did I forget something?
> 
> diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c
> index 9c95811..93e54da 100644
> --- a/drivers/mtd/nand/mxs_nand.c
> +++ b/drivers/mtd/nand/mxs_nand.c
> @@ -465,7 +465,7 @@ static void mxs_nand_read_buf(struct mtd_info *mtd,
> uint8_t *buf, int length)
>   /* Execute the DMA chain. */
>   ret = mxs_dma_go(channel);
>   if (ret) {
> - printf("MXS NAND: DMA read error\n");
> + printf("MXS NAND: DMA read error (%d)\n", ret);
>   goto rtn;
>   }
> 
> diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
> index 02f3366..a0bd2db 100644
> --- a/include/configs/mx28evk.h
> +++ b/include/configs/mx28evk.h
> @@ -148,6 +148,15 @@
>   #endif
> 
>   /*
> + * NAND
> + */
> +#define CONFIG_CMD_NAND
> +#define CONFIG_NAND_MXS
> +#define CONFIG_SYS_MAX_NAND_DEVICE   1
> +#define CONFIG_SYS_NAND_BASE 0x6000
> +#define CONFIG_SYS_NAND_5_ADDR_CYCLE
> +
> +/*
>* Ethernet on SOC (FEC)
>*/
>   #ifdef  CONFIG_CMD_NET
> 
> 
> BR,
> Lauri Hintsala

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


Re: [U-Boot] MXS NAND: DMA read error

2012-04-17 Thread Lauri Hintsala

Hi Marek,

On 04/17/2012 11:17 AM, Marek Vasut wrote:

I'm trying to compile latest U-Boot to mx28evk (rev D) with NAND
support. U-Boot boots up but NAND chip is not detected and DMA read
error is popped up.


MX28 EVK has no NAND, right?


MX28 EVK has NAND slot and I have installed NAND chip on it. I'm using 
same chip with older pached U-Boot and Linux and chip is working fine 
with them.




Otherwise, check if you have APBH DMA enabled in your include/configs/mx28evk.h


Config file include/configs/mx28evk.h has following line.

#define CONFIG_APBH_DMA


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


Re: [U-Boot] MXS NAND: DMA read error

2012-04-17 Thread Marek Vasut
Dear Lauri Hintsala,

> Hi Marek,
> 
> On 04/17/2012 11:17 AM, Marek Vasut wrote:
> >> I'm trying to compile latest U-Boot to mx28evk (rev D) with NAND
> >> support. U-Boot boots up but NAND chip is not detected and DMA read
> >> error is popped up.
> > 
> > MX28 EVK has no NAND, right?
> 
> MX28 EVK has NAND slot and I have installed NAND chip on it. I'm using
> same chip with older pached U-Boot and Linux and chip is working fine
> with them.
> 
> > Otherwise, check if you have APBH DMA enabled in your
> > include/configs/mx28evk.h
> 
> Config file include/configs/mx28evk.h has following line.
> 
> #define CONFIG_APBH_DMA
> 

And you have dcache and icache disabled ?

> 
> BR,
> Lauri

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


Re: [U-Boot] MXS NAND: DMA read error

2012-04-17 Thread Lauri Hintsala

On 04/17/2012 11:29 AM, Marek Vasut wrote:

On 04/17/2012 11:17 AM, Marek Vasut wrote:

I'm trying to compile latest U-Boot to mx28evk (rev D) with NAND
support. U-Boot boots up but NAND chip is not detected and DMA read
error is popped up.


MX28 EVK has no NAND, right?


MX28 EVK has NAND slot and I have installed NAND chip on it. I'm using
same chip with older pached U-Boot and Linux and chip is working fine
with them.


Otherwise, check if you have APBH DMA enabled in your
include/configs/mx28evk.h


Config file include/configs/mx28evk.h has following line.

#define CONFIG_APBH_DMA



And you have dcache and icache disabled ?


Yes, they seem to be disabled:

#define CONFIG_SYS_ICACHE_OFF
#define CONFIG_SYS_DCACHE_OFF

I'm using latest U-Boot and default mx28evk.h config:
http://git.denx.de/?p=u-boot.git;a=blob;f=include/configs/mx28evk.h;h=02f3366ed263ff66fe3b9b2089ec95ef461a92c0;hb=HEAD

I have added only NAND related lines I sent in first message.

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


Re: [U-Boot] MXS NAND: DMA read error

2012-04-17 Thread Marek Vasut
Dear Lauri Hintsala,

> On 04/17/2012 11:29 AM, Marek Vasut wrote:
> >> On 04/17/2012 11:17 AM, Marek Vasut wrote:
>  I'm trying to compile latest U-Boot to mx28evk (rev D) with NAND
>  support. U-Boot boots up but NAND chip is not detected and DMA read
>  error is popped up.
> >>> 
> >>> MX28 EVK has no NAND, right?
> >> 
> >> MX28 EVK has NAND slot and I have installed NAND chip on it. I'm using
> >> same chip with older pached U-Boot and Linux and chip is working fine
> >> with them.
> >> 
> >>> Otherwise, check if you have APBH DMA enabled in your
> >>> include/configs/mx28evk.h
> >> 
> >> Config file include/configs/mx28evk.h has following line.
> >> 
> >> #define CONFIG_APBH_DMA
> > 
> > And you have dcache and icache disabled ?
> 
> Yes, they seem to be disabled:
> 
> #define CONFIG_SYS_ICACHE_OFF
> #define CONFIG_SYS_DCACHE_OFF
> 
> I'm using latest U-Boot and default mx28evk.h config:
> http://git.denx.de/?p=u-boot.git;a=blob;f=include/configs/mx28evk.h;h=02f33
> 66ed263ff66fe3b9b2089ec95ef461a92c0;hb=HEAD
> 
> I have added only NAND related lines I sent in first message.

Lauri, as much as I'd love to help you, MX28EVK is Fabio's board. So let's see 
what he has to say ;-)

> 
> BR,
> Lauri

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 v7] kirkwood: add NAS62x0 board support

2012-04-17 Thread Prafulla Wadaskar


> -Original Message-
> From: u-boot-boun...@lists.denx.de [mailto:u-boot-
> boun...@lists.denx.de] On Behalf Of Simon Baatz
> Sent: 17 April 2012 04:34
> To: u-boot@lists.denx.de; drea...@doukki.net; Luka Perkov
> Subject: Re: [U-Boot] [PATCH v7] kirkwood: add NAS62x0 board support
> 
> Hi,
> 
> Am 14.04.2012 19:25, schrieb Luka Perkov:
> > NAS6210 eSATA port is not working from uboot... That is why there
> are
> > CONFIG_BOARD_IS_IB_NAS6210 and CONFIG_BOARD_IS_IB_NAS6220 in
> ib62x0.h
> > config file.
> >
> >
> I think I have found the reason why the eSATA port is not working on
> the
> 6210. I think the second port on the 6220 does not work either.
> Surprisingly, the reason is completely unrelated to this board and has
> also been described before (see for example
> http://www.varkey.in/2011/06/boot-debian-from-sata-seagate-goflex-net/
> which states:
> 
> Shutdown the GoFlex Net, connect the hard disk to the **right** side
> SATA port. There seems to be a bug in Jeff's uBoot for GoFlex Net, so
> within uBoot only the right port works.
> )
> 
> If you compile the patch for the 6220 and use it on the 6210, the
> first
> hard disk is detected twice and the second one is not detected at all.
> The problem is a mismatch in "include/ide.h" and "common/cmd_ide.c".
> ide.h defines:
> 
> #define IDE_BUS(dev) (dev >> 1)
> 
> However, cmd_ide.c uses the following in ide_init():
> 
> for (bus = 0; bus < CONFIG_SYS_IDE_MAXBUS; ++bus) {
> int dev =
> bus * (CONFIG_SYS_IDE_MAXDEVICE /
> CONFIG_SYS_IDE_MAXBUS);
> 
> In this case CONFIG_SYS_IDE_MAXDEVICE and CONFIG_SYS_IDE_MAXDEVICE are
> both 2 since there are two SATA ports with max one device each.
> 
> However, IDE_BUS seems to assume that each bus has two devices and
> thus
> returns the first bus even when the second one should be probed. I
> don't
> know whether it is the proper fix for this, but
> 
> #define IDE_BUS(dev) (dev / (CONFIG_SYS_IDE_MAXDEVICE /
> CONFIG_SYS_IDE_MAXBUS))
> 
> in ide.h fixes the problem for me and detects both the internal hard
> disk and the hard disk at the eSATA port.
> 
> This also means that the 6210/6220 patch should not make a difference
> between the two boards.

Hi Simon

This is a good findings indeed.

Hi Luka
May you please check the same and resubmit the clean patch, you may keep ide 
patch separate mentioning dependency.

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


Re: [U-Boot] MXS NAND: DMA read error

2012-04-17 Thread Lauri Hintsala

Hi Marek,

On 04/17/2012 12:05 PM, Marek Vasut wrote:

Lauri, as much as I'd love to help you, MX28EVK is Fabio's board. So let's see
what he has to say ;-)


I found the solution myself. The issue was caused by the missing 
iomuxing. I'll do the patch...


Thank you for your friendly and fast responses.

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


Re: [U-Boot] MXS NAND: DMA read error

2012-04-17 Thread Marek Vasut
Dear Lauri Hintsala,

> Hi Marek,
> 
> On 04/17/2012 12:05 PM, Marek Vasut wrote:
> > Lauri, as much as I'd love to help you, MX28EVK is Fabio's board. So
> > let's see what he has to say ;-)
> 
> I found the solution myself. The issue was caused by the missing
> iomuxing. I'll do the patch...

Can you please submit a patch?

> Thank you for your friendly and fast responses.

You're welcome ;-)

> BR,
> Lauri

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


[U-Boot] [PATCH] mx28evk: add NAND support

2012-04-17 Thread Lauri Hintsala
NAND support is not enabled by default because Eval Kit is not delivered
with NAND chip. To enable NAND support add CONFIG_CMD_NAND to board config.

Signed-off-by: Lauri Hintsala 
---
 board/freescale/mx28evk/iomux.c |   21 +
 include/configs/mx28evk.h   |   10 ++
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/board/freescale/mx28evk/iomux.c b/board/freescale/mx28evk/iomux.c
index 396761b..6587c45 100644
--- a/board/freescale/mx28evk/iomux.c
+++ b/board/freescale/mx28evk/iomux.c
@@ -26,6 +26,7 @@
 #include 
 
 #defineMUX_CONFIG_SSP0 (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP)
+#defineMUX_CONFIG_GPMI (MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_NOPULL)
 #defineMUX_CONFIG_ENET (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP)
 #defineMUX_CONFIG_EMI  (MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_NOPULL)
 #defineMUX_CONFIG_SSP2 (MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_PULLUP)
@@ -55,6 +56,26 @@ const iomux_cfg_t iomux_setup[] = {
MX28_PAD_PWM3__GPIO_3_28 |
(MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
 
+#ifdef CONFIG_NAND_MXS
+   /* GPMI NAND */
+   MX28_PAD_GPMI_D00__GPMI_D0 | MUX_CONFIG_GPMI,
+   MX28_PAD_GPMI_D01__GPMI_D1 | MUX_CONFIG_GPMI,
+   MX28_PAD_GPMI_D02__GPMI_D2 | MUX_CONFIG_GPMI,
+   MX28_PAD_GPMI_D03__GPMI_D3 | MUX_CONFIG_GPMI,
+   MX28_PAD_GPMI_D04__GPMI_D4 | MUX_CONFIG_GPMI,
+   MX28_PAD_GPMI_D05__GPMI_D5 | MUX_CONFIG_GPMI,
+   MX28_PAD_GPMI_D06__GPMI_D6 | MUX_CONFIG_GPMI,
+   MX28_PAD_GPMI_D07__GPMI_D7 | MUX_CONFIG_GPMI,
+   MX28_PAD_GPMI_CE0N__GPMI_CE0N | MUX_CONFIG_GPMI,
+   MX28_PAD_GPMI_RDY0__GPMI_READY0 | MUX_CONFIG_GPMI,
+   MX28_PAD_GPMI_RDN__GPMI_RDN |
+   (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP),
+   MX28_PAD_GPMI_WRN__GPMI_WRN | MUX_CONFIG_GPMI,
+   MX28_PAD_GPMI_ALE__GPMI_ALE | MUX_CONFIG_GPMI,
+   MX28_PAD_GPMI_CLE__GPMI_CLE | MUX_CONFIG_GPMI,
+   MX28_PAD_GPMI_RESETN__GPMI_RESETN | MUX_CONFIG_GPMI,
+#endif
+
/* FEC0 */
MX28_PAD_ENET0_MDC__ENET0_MDC | MUX_CONFIG_ENET,
MX28_PAD_ENET0_MDIO__ENET0_MDIO | MUX_CONFIG_ENET,
diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 02f3366..2a44baa 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -148,6 +148,16 @@
 #endif
 
 /*
+ * NAND Driver
+ */
+#ifdef CONFIG_CMD_NAND
+#define CONFIG_NAND_MXS
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_SYS_NAND_BASE   0x6000
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+#endif
+
+/*
  * Ethernet on SOC (FEC)
  */
 #ifdef CONFIG_CMD_NET
-- 
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] drivers/mtd/onenand/onenand_base.c: fix build warning

2012-04-17 Thread Lukasz Majewski
Hi Anatolij,

> Fix:
> onenand_base.c: In function 'onenand_probe':
> onenand_base.c:2577:6: warning: variable 'maf_id' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Anatolij Gustschin 
> Cc: Lukasz Majewski 
> ---
>  drivers/mtd/onenand/onenand_base.c |3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/onenand/onenand_base.c
> b/drivers/mtd/onenand/onenand_base.c index 480ae7a..229682c 100644
> --- a/drivers/mtd/onenand/onenand_base.c
> +++ b/drivers/mtd/onenand/onenand_base.c
> @@ -2574,7 +2574,7 @@ static int onenand_chip_probe(struct mtd_info
> *mtd) int onenand_probe(struct mtd_info *mtd)
>  {
>   struct onenand_chip *this = mtd->priv;
> - int maf_id, dev_id, ver_id;
> + int dev_id, ver_id;
>   int density;
>   int ret;
>  
> @@ -2583,7 +2583,6 @@ int onenand_probe(struct mtd_info *mtd)
>   return ret;
>  
>   /* Read manufacturer and device IDs from Register */
> - maf_id = this->read_word(this->base +
> ONENAND_REG_MANUFACTURER_ID); dev_id = this->read_word(this->base +
> ONENAND_REG_DEVICE_ID); ver_id = this->read_word(this->base +
> ONENAND_REG_VERSION_ID); this->technology =
> this->read_word(this->base + ONENAND_REG_TECHNOLOGY);

Is this a regression for -rc or the current master branch (recently
Wolfgang has pull some onenand related code)?


-- 
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


Re: [U-Boot] [PATCH] mx28evk: add NAND support

2012-04-17 Thread Marek Vasut
Dear Lauri Hintsala,

> NAND support is not enabled by default because Eval Kit is not delivered
> with NAND chip. To enable NAND support add CONFIG_CMD_NAND to board config.
> 
> Signed-off-by: Lauri Hintsala 

Acked-by: Marek Vasut 

I think we can schedule it for .04 release as this is basically a fix? Fabio ?

> ---
>  board/freescale/mx28evk/iomux.c |   21 +
>  include/configs/mx28evk.h   |   10 ++
>  2 files changed, 31 insertions(+), 0 deletions(-)
> 
> diff --git a/board/freescale/mx28evk/iomux.c
> b/board/freescale/mx28evk/iomux.c index 396761b..6587c45 100644
> --- a/board/freescale/mx28evk/iomux.c
> +++ b/board/freescale/mx28evk/iomux.c
> @@ -26,6 +26,7 @@
>  #include 
> 
>  #define  MUX_CONFIG_SSP0 (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP)
> +#define  MUX_CONFIG_GPMI (MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_NOPULL)
>  #define  MUX_CONFIG_ENET (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP)
>  #define  MUX_CONFIG_EMI  (MXS_PAD_3V3 | MXS_PAD_12MA | MXS_PAD_NOPULL)
>  #define  MUX_CONFIG_SSP2 (MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_PULLUP)
> @@ -55,6 +56,26 @@ const iomux_cfg_t iomux_setup[] = {
>   MX28_PAD_PWM3__GPIO_3_28 |
>   (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
> 
> +#ifdef CONFIG_NAND_MXS
> + /* GPMI NAND */
> + MX28_PAD_GPMI_D00__GPMI_D0 | MUX_CONFIG_GPMI,
> + MX28_PAD_GPMI_D01__GPMI_D1 | MUX_CONFIG_GPMI,
> + MX28_PAD_GPMI_D02__GPMI_D2 | MUX_CONFIG_GPMI,
> + MX28_PAD_GPMI_D03__GPMI_D3 | MUX_CONFIG_GPMI,
> + MX28_PAD_GPMI_D04__GPMI_D4 | MUX_CONFIG_GPMI,
> + MX28_PAD_GPMI_D05__GPMI_D5 | MUX_CONFIG_GPMI,
> + MX28_PAD_GPMI_D06__GPMI_D6 | MUX_CONFIG_GPMI,
> + MX28_PAD_GPMI_D07__GPMI_D7 | MUX_CONFIG_GPMI,
> + MX28_PAD_GPMI_CE0N__GPMI_CE0N | MUX_CONFIG_GPMI,
> + MX28_PAD_GPMI_RDY0__GPMI_READY0 | MUX_CONFIG_GPMI,
> + MX28_PAD_GPMI_RDN__GPMI_RDN |
> + (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP),
> + MX28_PAD_GPMI_WRN__GPMI_WRN | MUX_CONFIG_GPMI,
> + MX28_PAD_GPMI_ALE__GPMI_ALE | MUX_CONFIG_GPMI,
> + MX28_PAD_GPMI_CLE__GPMI_CLE | MUX_CONFIG_GPMI,
> + MX28_PAD_GPMI_RESETN__GPMI_RESETN | MUX_CONFIG_GPMI,
> +#endif
> +
>   /* FEC0 */
>   MX28_PAD_ENET0_MDC__ENET0_MDC | MUX_CONFIG_ENET,
>   MX28_PAD_ENET0_MDIO__ENET0_MDIO | MUX_CONFIG_ENET,
> diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
> index 02f3366..2a44baa 100644
> --- a/include/configs/mx28evk.h
> +++ b/include/configs/mx28evk.h
> @@ -148,6 +148,16 @@
>  #endif
> 
>  /*
> + * NAND Driver
> + */
> +#ifdef CONFIG_CMD_NAND
> +#define CONFIG_NAND_MXS
> +#define CONFIG_SYS_MAX_NAND_DEVICE   1
> +#define CONFIG_SYS_NAND_BASE 0x6000
> +#define CONFIG_SYS_NAND_5_ADDR_CYCLE
> +#endif
> +
> +/*
>   * Ethernet on SOC (FEC)
>   */
>  #ifdef   CONFIG_CMD_NET

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] drivers/mtd/onenand/onenand_base.c: fix build warning

2012-04-17 Thread Anatolij Gustschin
Hi Lukasz,

On Tue, 17 Apr 2012 13:15:41 +0200
Lukasz Majewski  wrote:
...
> Is this a regression for -rc or the current master branch (recently
> Wolfgang has pull some onenand related code)?

This patch should be applied to current master. Since Wolfgang has
pulled u-boot-onenand.git, I see this warning when compiling with
GCC 4.6.x.

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


Re: [U-Boot] [PATCH] drivers/mtd/onenand/onenand_base.c: fix build warning

2012-04-17 Thread Lukasz Majewski
Hi Anatolij,

> Hi Lukasz,
> 
> On Tue, 17 Apr 2012 13:15:41 +0200
> Lukasz Majewski  wrote:
> ...
> > Is this a regression for -rc or the current master branch (recently
> > Wolfgang has pull some onenand related code)?
> 
> This patch should be applied to current master. Since Wolfgang has
> pulled u-boot-onenand.git, I see this warning when compiling with
> GCC 4.6.x.
> 
> Thanks,
> Anatolij

Mine fault - I was looking into -rc1 :-)

Acked-by: Lukasz Majewski  

Test HW: S5PC110 GONI:

Tested-by: Lukasz Majewski  

-- 
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


Re: [U-Boot] [PATCH v2 1/3] usb:gadget:composite USB composite gadget support

2012-04-17 Thread Lukasz Majewski
Hi Marek,


> 
> > +int usb_string_ids_n(struct usb_composite_dev *c, unsigned n)
> > +{
> > +   unsigned next = c->next_string_id;
> > +   if (unlikely(n > 254 || (unsigned)next + n > 254))
> 
> This unlikely() call is unlikely part of uboot :)
> 

Nope, but will be removed :-)

> 
> > +
> > +static void composite_unbind(struct usb_gadget *gadget)
> > +{
> > +   struct usb_composite_dev*cdev =
> > get_gadget_data(gadget); +
> > +   /*
> > +* composite_disconnect() must already have been called
> > +* by the underlying peripheral controller driver!
> > +* so there's no i/o concurrency that could affect the
> > +* state protected by cdev->lock.
> > +*/
> > +   BUG_ON(cdev->config);
> 
> Do we have BUG_ON() defined in uboot ?

It is defined at include/common.h

But it can be removed if you wish.


> 
> I think this patch is getting much better ;-)
> 
Nice to hear :-)



-- 
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] MTD Partitioning does not work.

2012-04-17 Thread Axel Beierlein

Sorry for Crossposting but i think it better fits here.

Hello,

i have compiled a 3.1.5 Kernel for a TQM5200 Board.
But what i missed is the correct partitioning of the flash after the 
boot. Do i have to use another way as with Kernel 2.4.25?



With Kernel 2.4.25 i define the cmdline like:

Kernel command line: root=/dev/ram rw 
mtdparts=TQM5200-0:512k(u-boot),512k(env),2m(kernel),16m(ramfs1),5m(ramfs2),8m(jffs2) 
ip=192.168.0.50:192.168.0.133:::tqm5200:eth0:off panic=1 
console=ttyS0,115200


=> Partitioning no Problem.

Following some informations of my Setup.

My actual U-Boot Parameters for mtdpart:

mtdids=nor0=TQM5200-0
mtdparts=mtdparts=TQM5200-0:512k(u- \
boot),512k(env),2m(kernel),16m(ramfs1),5m(ramfs2),8m(jffs2)

Output in U-Boot:

=> mtdpart

device nor0 , # parts = 6
 #: namesizeoffsetmask_flags
 0: u-boot  0x00080x0
 1: env 0x00080x00080
 2: kernel  0x00200x00100
 3: ramfs1  0x01000x00300
 4: ramfs2  0x00500x01300
 5: jffs2   0x00800x01800

active partition: nor0,0 - (u-boot) 0x0008 @ 0x

defaults:
mtdids  : nor0=TQM5200-0
mtdparts: 
mtdparts=TQM5200-0:512k(u-boot),512k(env),2m(kernel),16m(ramfs1),5m(ramfs2),8m(jffs2)

=>

My Kernelconfig Section MTD:

CONFIG_MTD=y
# CONFIG_MTD_DEBUG is not set
# CONFIG_MTD_TESTS is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_OF_PARTS=y
# CONFIG_MTD_AR7_PARTS is not set

#
# User Modules And Translation Layers
#
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set
# CONFIG_RFD_FTL is not set
# CONFIG_SSFDC is not set
# CONFIG_SM_FTL is not set
# CONFIG_MTD_OOPS is not set
# CONFIG_MTD_SWAP is not set

#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
# CONFIG_MTD_CFI_ADV_OPTIONS is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
# CONFIG_MTD_CFI_INTELEXT is not set
CONFIG_MTD_CFI_AMDSTD=y
# CONFIG_MTD_CFI_STAA is not set
CONFIG_MTD_CFI_UTIL=y
# CONFIG_MTD_RAM is not set
CONFIG_MTD_ROM=y
# CONFIG_MTD_ABSENT is not set

#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PHYSMAP is not set
CONFIG_MTD_PHYSMAP_OF=y
# CONFIG_MTD_PLATRAM is not set

#
# Self-contained MTD device drivers
#
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLOCK2MTD is not set

#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
# CONFIG_MTD_NAND is not set
# CONFIG_MTD_ONENAND is not set

#
# LPDDR flash memory drivers
#
# CONFIG_MTD_LPDDR is not set
# CONFIG_MTD_UBI is not set

Thanks in advance

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


Re: [U-Boot] [PATCH] mx28evk: add NAND support

2012-04-17 Thread Fabio Estevam
On 4/17/12, Marek Vasut  wrote:
> Dear Lauri Hintsala,
>
>> NAND support is not enabled by default because Eval Kit is not delivered
>> with NAND chip. To enable NAND support add CONFIG_CMD_NAND to board
>> config.
>>
>> Signed-off-by: Lauri Hintsala 
>
> Acked-by: Marek Vasut 
>
> I think we can schedule it for .04 release as this is basically a fix? Fabio
> ?

Looks good to me. My only suggestion (can be part of a separate patch)
is to modify the mx28evk README and explain that mx28evk can also boot
from NAND and explain the boot mode settings, etc.

Thanks,

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


[U-Boot] Pull request (additional): u-boot-arm/master

2012-04-17 Thread Albert ARIBAUD

Hi Wolfgang,

The following changes since commit f5cdc11775c4b7fdbf52a6dd2f463d329804ab11:

  Prepare v2012.04-rc2; minor Coding Style cleanup (2012-04-16 23:13:51 
+0200)


are available in the git repository at:
  git://git.denx.de/u-boot-arm master

Dirk Behme (1):
  i.MX6: arm2: Add AXI cache and Qos setting

 board/freescale/mx6qarm2/imximage.cfg |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

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


Re: [U-Boot] Pull request: u-boot-imx

2012-04-17 Thread Albert ARIBAUD

Hi Stefano,
Le 17/04/2012 07:35, Stefano Babic a écrit :

Hi Albert,

please pull from u-boot-imx. Last fix before release, I hope.

The following changes since commit 2f002eceae44c21656b7f596624c636157ffdf1c:

   MX35: mx35pdk: wrong board revision (2012-04-16 14:53:59 +0200)

are available in the git repository at:
   git://www.denx.de/git/u-boot-imx.git master

Dirk Behme (1):
   i.MX6: arm2: Add AXI cache and Qos setting

  board/freescale/mx6qarm2/imximage.cfg |6 ++
  1 files changed, 6 insertions(+), 0 deletions(-)

Thanks,
Stefano


Applied to u-boot-arm/master, thanks!

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


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

2012-04-17 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 to u-boot.

Code supporting this framework has been added to gadget.h and Samsung's
UDC driver as well.

---
Changes for v2:
- Squash the kernel files with u-boot compatibility layer.
- Removal of dead/kernel specific code.
- Comments corrected according to u-boot coding style.
- Two separate patches regarding gadget.h file squashed together.
Changes for v3:
- Remove unlikely function call
- Code indentation fixup

Lukasz Majewski (3):
  usb:gadget:composite USB composite gadget support
  usb:gadget:composite: Support for composite at gadget.h
  usb:udc:samsung Add functions for storing private gadget data in UDC
driver

 drivers/usb/gadget/composite.c   | 1091 ++
 drivers/usb/gadget/s3c_udc_otg.c |   12 +
 include/linux/usb/composite.h|  350 
 include/linux/usb/gadget.h   |6 +
 include/usb/lin_gadget_compat.h  |   25 +-
 5 files changed, 1482 insertions(+), 2 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 v3 2/3] usb:gadget:composite: Support for composite at gadget.h

2012-04-17 Thread Lukasz Majewski
Add device data pointer to the USB gadget's device struct.
Wrapper for extracting usb_gadget from Linux's usb device

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 

---
Changes for v2:
- Two separate patches regarding gadget.h file squashed together
---
 include/linux/usb/gadget.h |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 275cb5f..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 */
 };
 
 /**
@@ -481,6 +482,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 v3 3/3] usb:udc:samsung Add functions for storing private gadget data in UDC driver

2012-04-17 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..925d2f2 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)
+{
+   DEBUG_SETUP("%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 v3 1/3] usb:gadget:composite USB composite gadget support

2012-04-17 Thread Lukasz Majewski
USB Composite gadget implementation for u-boot. It builds on top
of USB UDC drivers.

This commit is based on following files from Linux Kernel v2.6.36:

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

SHA1: d187abb9a83e6c6b6e9f2ca17962bdeafb4bc903

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 

---
Changes for v2:
- Squash the strict kernel files with u-boot compatibility layer.
- Removal of dead/kernel specific code
- Comments corrected according to u-boot coding style
Changes for v3:
- Remove unlikely function call
- Code indentation fixup

---
 drivers/usb/gadget/composite.c  | 1091 +++
 include/linux/usb/composite.h   |  350 +
 include/usb/lin_gadget_compat.h |   25 +-
 3 files changed, 1464 insertions(+), 2 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..0415aa4
--- /dev/null
+++ b/drivers/usb/gadget/composite.c
@@ -0,0 +1,1091 @@
+/*
+ * composite.c - infrastructure for Composite USB Gadgets
+ *
+ * Copyright (C) 2006-2008 David Brownell
+ * U-boot porting: 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 
+
+/* big enough to hold our biggest descriptor */
+#define USB_BUFSIZ 4096
+
+static struct usb_composite_driver *composite;
+
+/**
+ * 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;
+
+   debug("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);
+
+   if (function->bind) {
+   value = function->bind(config, function);
+   if (value < 0) {
+   list_del(&function->list);
+   function->config = NULL;
+   }
+   } else
+   value = 0;
+
+   if (!config->fullspeed && function->descriptors)
+   config->fullspeed = 1;
+   if (!config->highspeed && function->hs_descriptors)
+   config->highspeed = 1;
+
+done:
+   if (value)
+   debug("adding '%s'/%p --> %d\n",
+   function->name, function, value);
+   return value;
+}
+
+/**
+ * usb_function_deactivate - prevent function and gadget enumeration
+ * @function: the function that isn't yet ready to respond
+ *
+ * Blocks response of the gadget driver to host enumeration by
+ * preventing the data line pullup from being activated.  This is
+ * normally called during @bind() processing to change from the
+ * initial "ready to respond" state, or when a required resource
+ * becomes available.
+ *
+ * For example, drivers that serve as a passthrough to a userspace
+ * daemon can block enumeration unless that daemon (such as an OBEX,
+ * MTP, or print server) is ready to handle host requests.
+ *
+ * Not all systems support software control of their USB peripheral
+ * data pullups.
+ *
+ * Returns zero on success, else negative errno.
+ */
+int usb_function_deactivate(struct usb_function *function)
+{
+   struct usb_composite_dev*cdev = function->config->cdev;
+   int status = 0;
+
+   if (cdev->deactivations == 0)
+   status = usb_gadget_disconnect(cdev->gadget);
+   if (status == 0)
+   cdev->deactivations++;
+
+   return

Re: [U-Boot] [PATCH] mx28evk: add NAND support

2012-04-17 Thread Marek Vasut
Dear Fabio Estevam,

> On 4/17/12, Marek Vasut  wrote:
> > Dear Lauri Hintsala,
> > 
> >> NAND support is not enabled by default because Eval Kit is not delivered
> >> with NAND chip. To enable NAND support add CONFIG_CMD_NAND to board
> >> config.
> >> 
> >> Signed-off-by: Lauri Hintsala 
> > 
> > Acked-by: Marek Vasut 
> > 
> > I think we can schedule it for .04 release as this is basically a fix?
> > Fabio ?
> 
> Looks good to me. My only suggestion (can be part of a separate patch)
> is to modify the mx28evk README and explain that mx28evk can also boot
> from NAND and explain the boot mode settings, etc.

Good idea, but let's do this in a separate patch :)
> 
> Thanks,
> 
> Fabio Estevam

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] mx28evk: add NAND support

2012-04-17 Thread Stefano Babic
On 17/04/2012 13:21, Marek Vasut wrote:
> Dear Lauri Hintsala,
> 
>> NAND support is not enabled by default because Eval Kit is not delivered
>> with NAND chip. To enable NAND support add CONFIG_CMD_NAND to board config.
>>
>> Signed-off-by: Lauri Hintsala 
> 
> Acked-by: Marek Vasut 
> 
> I think we can schedule it for .04 release as this is basically a fix? Fabio ?

Well, this is not a fix because it adds a feature that is not yet
supported. It should be deferred to the next release.

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] [PATCH] i.MX28: Shut down the LCD controller before reset

2012-04-17 Thread Marek Vasut
If the LCD controller is on before the CPU goes into reset, the traffic on LCDIF
data pins interferes with the BootROM's boot mode sampling. So shut the
controller down.

Signed-off-by: Marek Vasut 
Cc: Wolfgang Denk 
Cc: Detlev Zundel 
Cc: Stefano Babic 
Cc: Fabio Estevam 
---
 arch/arm/cpu/arm926ejs/mx28/mx28.c |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/arm926ejs/mx28/mx28.c 
b/arch/arm/cpu/arm926ejs/mx28/mx28.c
index 01445cd..550207e 100644
--- a/arch/arm/cpu/arm926ejs/mx28/mx28.c
+++ b/arch/arm/cpu/arm926ejs/mx28/mx28.c
@@ -50,9 +50,16 @@ void reset_cpu(ulong ignored) __attribute__((noreturn));
 
 void reset_cpu(ulong ignored)
 {
-
struct mx28_rtc_regs *rtc_regs =
(struct mx28_rtc_regs *)MXS_RTC_BASE;
+   struct mx28_lcdif_regs *lcdif_regs =
+   (struct mx28_lcdif_regs *)MXS_LCDIF_BASE;
+
+   /*
+* Shut down the LCD controller as it interferes with BootROM boot mode
+* pads sampling.
+*/
+   writel(LCDIF_CTRL_RUN, &lcdif_regs->hw_lcdif_ctrl_clr);
 
/* Wait 1 uS before doing the actual watchdog reset */
writel(1, &rtc_regs->hw_rtc_watchdog);
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH] mx28evk: add NAND support

2012-04-17 Thread Marek Vasut
Dear Stefano Babic,

> On 17/04/2012 13:21, Marek Vasut wrote:
> > Dear Lauri Hintsala,
> > 
> >> NAND support is not enabled by default because Eval Kit is not delivered
> >> with NAND chip. To enable NAND support add CONFIG_CMD_NAND to board
> >> config.
> >> 
> >> Signed-off-by: Lauri Hintsala 
> > 
> > Acked-by: Marek Vasut 
> > 
> > I think we can schedule it for .04 release as this is basically a fix?
> > Fabio ?
> 
> Well, this is not a fix because it adds a feature that is not yet
> supported. It should be deferred to the next release.

Ok, I won't object either way as it doesn't concern me that much ;-)

> 
> Best regards,
> Stefano Babic

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 v3 1/3] usb:gadget:composite USB composite gadget support

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

> USB Composite gadget implementation for u-boot. It builds on top
> of USB UDC drivers.
> 
> This commit is based on following files from Linux Kernel v2.6.36:
> 
> ./include/linux/usb/composite.h
> ./drivers/usb/gadget/composite.c
> 
> SHA1: d187abb9a83e6c6b6e9f2ca17962bdeafb4bc903
> 
> Signed-off-by: Lukasz Majewski 
> Signed-off-by: Kyungmin Park 
> Cc: Marek Vasut 
> 
> ---
> Changes for v2:
> - Squash the strict kernel files with u-boot compatibility layer.
> - Removal of dead/kernel specific code
> - Comments corrected according to u-boot coding style
> Changes for v3:
> - Remove unlikely function call
> - Code indentation fixup
> 
> ---
>  drivers/usb/gadget/composite.c  | 1091
> +++ include/linux/usb/composite.h   | 
> 350 +
>  include/usb/lin_gadget_compat.h |   25 +-
>  3 files changed, 1464 insertions(+), 2 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..0415aa4
> --- /dev/null
> +++ b/drivers/usb/gadget/composite.c
> @@ -0,0 +1,1091 @@
> +/*
> + * composite.c - infrastructure for Composite USB Gadgets
> + *
> + * Copyright (C) 2006-2008 David Brownell
> + * U-boot porting: 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 
> +
> +/* big enough to hold our biggest descriptor */
> +#define USB_BUFSIZ   4096
> +
> +static struct usb_composite_driver *composite;
> +
> +/**
> + * 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;
> +
> + debug("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);
> +
> + if (function->bind) {
> + value = function->bind(config, function);
> + if (value < 0) {
> + list_del(&function->list);
> + function->config = NULL;
> + }
> + } else
> + value = 0;
> +
> + if (!config->fullspeed && function->descriptors)
> + config->fullspeed = 1;
> + if (!config->highspeed && function->hs_descriptors)
> + config->highspeed = 1;
> +
> +done:
> + if (value)
> + debug("adding '%s'/%p --> %d\n",
> + function->name, function, value);
> + return value;
> +}
> +
> +/**
> + * usb_function_deactivate - prevent function and gadget enumeration
> + * @function: the function that isn't yet ready to respond
> + *
> + * Blocks response of the gadget driver to host enumeration by
> + * preventing the data line pullup from being activated.  This is
> + * normally called during @bind() processing to change from the
> + * initial "ready to respond" state, or when a required resource
> + * becomes available.
> + *
> + * For example, drivers that serve as a passthrough to a userspace
> + * daemon can block enumeration unless that daemon (such as an OBEX,
> + * MTP, or print server) is ready to handle host requests.
> + *
> + * Not all systems support software control of their USB peripheral
> + * data pullups.
> + *
> + * Returns zero on success, else negative errno.
> + */
> +int usb_function_deactivate(struct usb_function *function)
> +{
> + struct usb_composite_dev*cdev = function->

Re: [U-Boot] FW: I want to use Barebox

2012-04-17 Thread ANDY KENNEDY
> > 1)  I have a concern that barebox is not mainstream enough yet.
> 
> I don't think 'maintstream' is the right focal point. Have a look at (for
> both busybox and U-Boot)
> 
>  - How often a patches committed to the public repository
>  - What is the patch review procedure - Has it changed recently? Why?
>do _you_ think it is a good procedure?
>  - How many people are actively contributing - Is there are large enough
>core contribution team that you believe can support you going forward
>  - What level of support can you expect from the community both now and in
>the future
>  - Are there any clear policies (either explicit or implicit). For example,
>U-Boot has a policy of not introducing board-breaking changes unless
>there is a really good reason. Also, U-Boot questions patches that
>cause code/data size increases for arches/boards which do not benifit
>from a particular new feature

Looking at the two choices side by side, these appear to be equal.  This
is one of those areas, however, that no one can be 100% sure about for
the next 5-10 years.  Barebox may overtake U-Boot just like U-Boot did
for RedBoot.  Or some other bootloader may take the center stage.  This
is an unknown risk that has to be owned by the company that chooses to
adopt any third party code.

> 
> > 2)  I have a feeling we will always be porting everyone's bsp (that
> >    already has a working u-boot) to barebox.
> 
> Which should not be _that_ hard considering that barebox is based on
> U-Boot, but I think the code has diverged quite a lot

Which is what I said below.  If it wasn't clear, these three "questions"
were presented to me in opposition of my choice to investigate more
Barebox as our universal bootloader.  And yes, you are correct, the code
appears to have changed drastically.  According to the Barebox list,
there would be a port required from U-Boot to Barebox for all drivers
that are needed from U-Boot as the driver model is more closely aligned
to the Linux kernel, though I never was answered whether drivers from
the Linux kernel would be easier to port.

> > 3)  I also don't really see the real advantage over standard u-boot
> >    (what's the 'killer' application?).
> 
> I like the idea of barebox's posix file system API and environment
> handling. But I think that comes at a cost of size and speed

The ability to have real mounted file systems in the bootloader, as well
as the posix like environment that Barebox uses are the two biggest
reasons for my wanting Adtran to use Barebox.  This seems to me to be
less cumbersome than the way that U-Boot requires scripts to be written
inside of variables.  Whereas I am use to this type of scripting (being
that I've been using U-Boot for ~6-8 years) I know that this approach
is foreign to the way of thinking inside this company.  The ability to
look at things more along the lines of files is appealing.

> 
> > From my point of view, the answer to 3 is clear:  It uses the Linux
> > kernel as part of the boot, it can house an initrd so that extending
> > the utilities of the bootloader will be easier to handle, etc.  If this
> > is in error, please correct me.
> 
> I do not think it uses the linux kernel. Like U-Boot, it borrows code from
> the kernel (I think the device driver model in barebox is closer to Linux,
> but maybe not close enough to allow native porting of drivers)

This was my misunderstanding, however, no one from the Barebox list
corrected me on this as you just did.  I do not know whether this is
because this is still a basically true statement, or whether this is
something that is the desired perception.

> 
> > As for 1 & 2, these I just don't know about.  I'm guessing that anything
> > supported in either the Linux kernel or already in u-boot should be
> > fairly easy to port into Barebox.  Here, however, I have to define for
> > Mgt clearly what does "fairly" mean.
> 
> I think you are looking at this from the wrong angle (or if you are, you
> are not expressing it clearly to us)...
> 
> What is it you need from the bootloader - Lay out the requirements and the
> specifications first. List them as a series of yes/no questions and rank
> them in order of importance. Answer each question yes/no/maybe/don't know
> for both barebox and U-Boot
> 
> Put the answers for U-Boot and barebox side-by-side and then come back to
> the U-Boot and barebox communities and start asking about the 'no', 'maybe'
> and 'don't know' answers. You should then get a bunch of answers like
> 
>  - yes out of the box
>  - no, and never will
>  - no, but it is being worked on
>  - no, but sounds like a great idea, let's do it
>  - no, but should be simple enough
>  - no, but hey, if you write it, there is no reason not to add it
> 
> don't get caught up be 'hey, that's a great feature, I want it' - That is
> how MS managed to become so massively 'popular'. Everyone _thought_ they
> needed all those fancy features but really, who uses them (let me remind

[U-Boot] [PATCH] mxs-i2c: Fix internal address byte order

2012-04-17 Thread Torsten Fleischer
Large EEPROMs, e.g. 24lc32, need 2 byte to address the internal memory.
These devices require that the high byte of the internal address has to be
written first.
The mxs_i2c driver currently writes the address' low byte first.

The following patch fixes the byte order of the internal address that should
be written to the I2C device.

Signed-off-by: Torsten Fleischer 

CC: Marek Vasut 
CC: Stefano Babic 
CC: Fabio Estevam 
---
 drivers/i2c/mxs_i2c.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/mxs_i2c.c b/drivers/i2c/mxs_i2c.c
index c8fea32..486 100644
--- a/drivers/i2c/mxs_i2c.c
+++ b/drivers/i2c/mxs_i2c.c
@@ -97,7 +97,7 @@ void mxs_i2c_write(uchar chip, uint addr, int alen,
 
for (i = 0; i < alen; i++) {
data >>= 8;
-   data |= ((char *)&addr)[i] << 24;
+   data |= ((char *)&addr)[alen - i - 1] << 24;
if ((i & 3) == 2)
writel(data, &i2c_regs->hw_i2c_data);
}
-- 
1.7.7

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


Re: [U-Boot] MTD Partitioning does not work.

2012-04-17 Thread Wolfgang Denk
Dear Axel Beierlein,

In message <4f8d679b.5080...@freenet.de> you wrote:
> Sorry for Crossposting but i think it better fits here.

No, you are off topic here.  This is a Linux issue only.

U-Boot can just pass the boot arguments; the rest is a Linux thing.

> My actual U-Boot Parameters for mtdpart:
> 
> mtdids=nor0=TQM5200-0
> mtdparts=mtdparts=TQM5200-0:512k(u- \
> boot),512k(env),2m(kernel),16m(ramfs1),5m(ramfs2),8m(jffs2)

Check your kernel boot  messages if the name of the flash device is
really "TQM5200-0"; this is probably wrong.I guess it's more
something like "fc00.flash" or so.

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
"God is a comedian playing to an audience too afraid to laugh."
- Voltaire
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 4/7] tegra: fdt: Add NAND controller binding and definitions

2012-04-17 Thread Simon Glass
Hi Stephen,

On Fri, Apr 13, 2012 at 2:05 PM, Stephen Warren  wrote:
> On 04/13/2012 12:29 PM, Simon Glass wrote:
>> Add a NAND controller along with a bindings file for review.
>>
>> Signed-off-by: Simon Glass 
>
>> +++ b/doc/device-tree-bindings/nand/nvidia-nand.txt
>
> I'd prefer this be called nvidia,tegra20-nand.txt so filenames are named
> according to compatible value. This makes it easier to look things up.

OK, changed

>
>> +The device node for a NAND flash device is as described in the document
>> +"Open Firmware Recommended Practice : Universal Serial Bus" with the
>
> This is really based on USB?

Well just in that it follows the conventions. I will remove this since
I'm not sure we use anything that isn't in the ePAPR.

>
>> +Required properties :
>> + - compatible : Should be "manufacture,device", "nand-flash"
>> + - nvidia,page-data-bytes : Number of bytes in the data area
>> + - nvidia,page-spare-bytes : * Number of bytes in spare area
>
> Not sure what that "*" is?

Removed

>
>> +Nvidia NAND Controller
>> +--
>> +
>> +The device node for a NAND flash controller is as described in the document
>> +"Open Firmware Recommended Practice : Universal Serial Bus" with the
>
> USB again?

Removed

>
>> +nand-controller@0x70008000 {
>> +     compatible = "nvidia,tegra20-nand";
>> +     wp-gpios = <&gpio 59 0>;                /* PH3 */
>> +     nvidia,width = <8>;
>> +     nvidia,timing = <26 100 20 80 20 10 12 10 70>;
>> +     nand@0 {
>> +             compatible = "hynix,hy27uf4g2b", "nand-flash";
>
> The TRM says there can be up to 8 chip selects. Don't the NAND device
> sub-nodes need a reg property to indicate which chip-select they're on?

We don't have driver support for this at present.

>
> Also, the TRM mentions async vs. ONFI devices. Don't we need properties
> somewhere to configure that kind of thing?

We don't have driver support for this at present, either :-(

>
>> +             nvidia,page-data-bytes = <2048>;
>> +             nvidia,tag-ecc-bytes = <4>;
>> +             nvidia,tag-bytes = <20>;
>> +             nvidia,data-ecc-bytes = <36>;
>> +             nvidia,skipped-spare-bytes = <4>;
>> +             nvidia,page-spare-bytes = <64>;
>> +     };
>> +};

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


Re: [U-Boot] [PATCH v2 4/7] tegra: fdt: Add NAND controller binding and definitions

2012-04-17 Thread Scott Wood
On 04/17/2012 01:33 PM, Simon Glass wrote:
> Hi Stephen,
> 
> On Fri, Apr 13, 2012 at 2:05 PM, Stephen Warren  wrote:
>> On 04/13/2012 12:29 PM, Simon Glass wrote:
>>> +nand-controller@0x70008000 {
>>> + compatible = "nvidia,tegra20-nand";
>>> + wp-gpios = <&gpio 59 0>;/* PH3 */
>>> + nvidia,width = <8>;
>>> + nvidia,timing = <26 100 20 80 20 10 12 10 70>;
>>> + nand@0 {
>>> + compatible = "hynix,hy27uf4g2b", "nand-flash";
>>
>> The TRM says there can be up to 8 chip selects. Don't the NAND device
>> sub-nodes need a reg property to indicate which chip-select they're on?
> 
> We don't have driver support for this at present.

That shouldn't matter.  The device tree is about describing the
hardware.  Ideally the device tree shouldn't have to change if in the
future you do get driver support for it.

Also, unit addresses should only be present if reg is present, and they
should match.

-Scott

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


[U-Boot] [PATCH v3 0/7] tegra: Add NAND flash support

2012-04-17 Thread Simon Glass
This series adds NAND flash support to Tegra and enables it on Seaboard.

Included here is a proposed device tree binding with most of the properties
private to "nvidia,". The binding includes information about the NAND
controller as well as the connected NAND device. The Seaboard has a
Hynix HY27UF4G2B.

The driver supports ECC-based access and uses DMA and NAND acceleration
features of the Tegra SOC to provide access at reasonable speed.

Changes in v2:
- Add new patch to align default buffers in nand_base
- Added comment about the behaviour of the 'resp' register
- Call set_bus_width_page_size() at init to report errors earlier
- Change set_bus_width_page_size() to return an error when needed
- Change timing structure member to u32 to match device tree
- Check for supported bus width in board_nand_init()
- Fix tegra nand header file to remove BIT defines
- Implement a dummy nand_select_chip() instead of nand_hwcontro()
- Make nand_command() display an error on an unknown command
- Minor code tidy-ups in driver for style
- Move cache logic into a separate dma_prepare() function
- Remove CMD_TRANS_SIZE_BYTESx enum
- Remove space after casts
- Remove use of 'register' variables
- Rename struct nand_info to struct nand_drv to avoid nand_info_t confusion
- Support 4096 byte page devices, drop 1024 and 2048
- Tidy up nand_waitfor_cmd_completion() logic
- Update NAND binding to add "nvidia," prefix
- Use s32 for device tree integer values

Changes in v3:
- Change note in fdt binding about the need for a hardware-specific binding
- Fix up typos in fdt binding, and rename the file
- Update fdt binding to make everything Nvidia-specific

Jim Lin (1):
  tegra: nand: Add Tegra NAND driver

Simon Glass (6):
  nand: Try to align the default buffers
  fdt: Add debugging to fdtdec_get_int/addr()
  tegra: Add NAND support to funcmux
  tegra: fdt: Add NAND controller binding and definitions
  tegra: fdt: Add NAND definitions to fdt
  tegra: Enable NAND on Seaboard

 arch/arm/cpu/armv7/tegra2/funcmux.c|7 +
 arch/arm/dts/tegra20.dtsi  |6 +
 arch/arm/include/asm/arch-tegra2/funcmux.h |3 +
 arch/arm/include/asm/arch-tegra2/tegra2.h  |1 +
 board/nvidia/dts/tegra2-seaboard.dts   |   15 +
 .../nand/nvidia,tegra20-nand.txt   |   61 ++
 drivers/mtd/nand/Makefile  |1 +
 drivers/mtd/nand/nand_base.c   |3 +-
 drivers/mtd/nand/tegra2_nand.c | 1095 
 drivers/mtd/nand/tegra2_nand.h |  257 +
 include/configs/seaboard.h |9 +
 include/fdtdec.h   |1 +
 include/linux/mtd/nand.h   |7 +-
 lib/fdtdec.c   |   23 +-
 14 files changed, 1479 insertions(+), 10 deletions(-)
 create mode 100644 doc/device-tree-bindings/nand/nvidia,tegra20-nand.txt
 create mode 100644 drivers/mtd/nand/tegra2_nand.c
 create mode 100644 drivers/mtd/nand/tegra2_nand.h

-- 
1.7.7.3

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


Re: [U-Boot] [PATCH v2 4/7] tegra: fdt: Add NAND controller binding and definitions

2012-04-17 Thread Simon Glass
Hi,

On Tue, Apr 17, 2012 at 11:38 AM, Scott Wood  wrote:
> On 04/17/2012 01:33 PM, Simon Glass wrote:
>> Hi Stephen,
>>
>> On Fri, Apr 13, 2012 at 2:05 PM, Stephen Warren  
>> wrote:
>>> On 04/13/2012 12:29 PM, Simon Glass wrote:
 +nand-controller@0x70008000 {
 +     compatible = "nvidia,tegra20-nand";
 +     wp-gpios = <&gpio 59 0>;                /* PH3 */
 +     nvidia,width = <8>;
 +     nvidia,timing = <26 100 20 80 20 10 12 10 70>;
 +     nand@0 {
 +             compatible = "hynix,hy27uf4g2b", "nand-flash";
>>>
>>> The TRM says there can be up to 8 chip selects. Don't the NAND device
>>> sub-nodes need a reg property to indicate which chip-select they're on?
>>
>> We don't have driver support for this at present.
>
> That shouldn't matter.  The device tree is about describing the
> hardware.  Ideally the device tree shouldn't have to change if in the
> future you do get driver support for it.
>
> Also, unit addresses should only be present if reg is present, and they
> should match.

OK I will leave @0 in there, and add a reg property to the node.

>
> -Scott
>

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


Re: [U-Boot] [PATCH v2 4/7] tegra: fdt: Add NAND controller binding and definitions

2012-04-17 Thread Scott Wood
On 04/17/2012 01:44 PM, Simon Glass wrote:
> Hi,
> 
> On Tue, Apr 17, 2012 at 11:38 AM, Scott Wood  wrote:
>> On 04/17/2012 01:33 PM, Simon Glass wrote:
>>> Hi Stephen,
>>>
>>> On Fri, Apr 13, 2012 at 2:05 PM, Stephen Warren  
>>> wrote:
 On 04/13/2012 12:29 PM, Simon Glass wrote:
> +nand-controller@0x70008000 {
> + compatible = "nvidia,tegra20-nand";
> + wp-gpios = <&gpio 59 0>;/* PH3 */
> + nvidia,width = <8>;
> + nvidia,timing = <26 100 20 80 20 10 12 10 70>;
> + nand@0 {
> + compatible = "hynix,hy27uf4g2b", "nand-flash";

 The TRM says there can be up to 8 chip selects. Don't the NAND device
 sub-nodes need a reg property to indicate which chip-select they're on?
>>>
>>> We don't have driver support for this at present.
>>
>> That shouldn't matter.  The device tree is about describing the
>> hardware.  Ideally the device tree shouldn't have to change if in the
>> future you do get driver support for it.
>>
>> Also, unit addresses should only be present if reg is present, and they
>> should match.
> 
> OK I will leave @0 in there, and add a reg property to the node.

Also set #address-cells = <1> and #size-cells = <0> in the controller node.

-Scott

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


Re: [U-Boot] [PATCH v7] kirkwood: add NAS62x0 board support

2012-04-17 Thread Luka Perkov
Hi Simon! Hi Prafulla!

On Tue, Apr 17, 2012 at 02:14:23AM -0700, Prafulla Wadaskar wrote:
> > #define IDE_BUS(dev) (dev / (CONFIG_SYS_IDE_MAXDEVICE /
> > CONFIG_SYS_IDE_MAXBUS))
> > 
> > in ide.h fixes the problem for me and detects both the internal hard
> > disk and the hard disk at the eSATA port.

Yes, this does the trick.

> > This also means that the 6210/6220 patch should not make a difference
> > between the two boards.

You are right. I'll rewrite it.

> Hi Simon
> 
> This is a good findings indeed.

I agree :)

> Hi Luka
> May you please check the same and resubmit the clean patch, you may keep ide 
> patch separate mentioning dependency.

Yes. I'll send patches soonish...

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


Re: [U-Boot] [PATCH v2 4/7] tegra: fdt: Add NAND controller binding and definitions

2012-04-17 Thread Simon Glass
Hi Scott,

On Tue, Apr 17, 2012 at 11:45 AM, Scott Wood  wrote:
> On 04/17/2012 01:44 PM, Simon Glass wrote:
>> Hi,
>>
>> On Tue, Apr 17, 2012 at 11:38 AM, Scott Wood  wrote:
>>> On 04/17/2012 01:33 PM, Simon Glass wrote:
 Hi Stephen,

 On Fri, Apr 13, 2012 at 2:05 PM, Stephen Warren  
 wrote:
> On 04/13/2012 12:29 PM, Simon Glass wrote:
>> +nand-controller@0x70008000 {
>> +     compatible = "nvidia,tegra20-nand";
>> +     wp-gpios = <&gpio 59 0>;                /* PH3 */
>> +     nvidia,width = <8>;
>> +     nvidia,timing = <26 100 20 80 20 10 12 10 70>;
>> +     nand@0 {
>> +             compatible = "hynix,hy27uf4g2b", "nand-flash";
>
> The TRM says there can be up to 8 chip selects. Don't the NAND device
> sub-nodes need a reg property to indicate which chip-select they're on?

 We don't have driver support for this at present.
>>>
>>> That shouldn't matter.  The device tree is about describing the
>>> hardware.  Ideally the device tree shouldn't have to change if in the
>>> future you do get driver support for it.
>>>
>>> Also, unit addresses should only be present if reg is present, and they
>>> should match.
>>
>> OK I will leave @0 in there, and add a reg property to the node.
>
> Also set #address-cells = <1> and #size-cells = <0> in the controller node.

Thanks, yes spotted that - dtc crashes if you have address cells as zero.

Will send a new series out in a minute.

>
> -Scott
>

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


Re: [U-Boot] [PATCH v3 0/7] tegra: Add NAND flash support

2012-04-17 Thread Simon Glass
On Tue, Apr 17, 2012 at 11:38 AM, Simon Glass  wrote:
> This series adds NAND flash support to Tegra and enables it on Seaboard.

Sorry, please ignore this email, will re-issue. - Simon

>
> Included here is a proposed device tree binding with most of the properties
> private to "nvidia,". The binding includes information about the NAND
> controller as well as the connected NAND device. The Seaboard has a
> Hynix HY27UF4G2B.
>
> The driver supports ECC-based access and uses DMA and NAND acceleration
> features of the Tegra SOC to provide access at reasonable speed.
>
> Changes in v2:
> - Add new patch to align default buffers in nand_base
> - Added comment about the behaviour of the 'resp' register
> - Call set_bus_width_page_size() at init to report errors earlier
> - Change set_bus_width_page_size() to return an error when needed
> - Change timing structure member to u32 to match device tree
> - Check for supported bus width in board_nand_init()
> - Fix tegra nand header file to remove BIT defines
> - Implement a dummy nand_select_chip() instead of nand_hwcontro()
> - Make nand_command() display an error on an unknown command
> - Minor code tidy-ups in driver for style
> - Move cache logic into a separate dma_prepare() function
> - Remove CMD_TRANS_SIZE_BYTESx enum
> - Remove space after casts
> - Remove use of 'register' variables
> - Rename struct nand_info to struct nand_drv to avoid nand_info_t confusion
> - Support 4096 byte page devices, drop 1024 and 2048
> - Tidy up nand_waitfor_cmd_completion() logic
> - Update NAND binding to add "nvidia," prefix
> - Use s32 for device tree integer values
>
> Changes in v3:
> - Change note in fdt binding about the need for a hardware-specific binding
> - Fix up typos in fdt binding, and rename the file
> - Update fdt binding to make everything Nvidia-specific
>
> Jim Lin (1):
>  tegra: nand: Add Tegra NAND driver
>
> Simon Glass (6):
>  nand: Try to align the default buffers
>  fdt: Add debugging to fdtdec_get_int/addr()
>  tegra: Add NAND support to funcmux
>  tegra: fdt: Add NAND controller binding and definitions
>  tegra: fdt: Add NAND definitions to fdt
>  tegra: Enable NAND on Seaboard
>
>  arch/arm/cpu/armv7/tegra2/funcmux.c                |    7 +
>  arch/arm/dts/tegra20.dtsi                          |    6 +
>  arch/arm/include/asm/arch-tegra2/funcmux.h         |    3 +
>  arch/arm/include/asm/arch-tegra2/tegra2.h          |    1 +
>  board/nvidia/dts/tegra2-seaboard.dts               |   15 +
>  .../nand/nvidia,tegra20-nand.txt                   |   61 ++
>  drivers/mtd/nand/Makefile                          |    1 +
>  drivers/mtd/nand/nand_base.c                       |    3 +-
>  drivers/mtd/nand/tegra2_nand.c                     | 1095 
> 
>  drivers/mtd/nand/tegra2_nand.h                     |  257 +
>  include/configs/seaboard.h                         |    9 +
>  include/fdtdec.h                                   |    1 +
>  include/linux/mtd/nand.h                           |    7 +-
>  lib/fdtdec.c                                       |   23 +-
>  14 files changed, 1479 insertions(+), 10 deletions(-)
>  create mode 100644 doc/device-tree-bindings/nand/nvidia,tegra20-nand.txt
>  create mode 100644 drivers/mtd/nand/tegra2_nand.c
>  create mode 100644 drivers/mtd/nand/tegra2_nand.h
>
> --
> 1.7.7.3
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 0/7] tegra: Add NAND flash support

2012-04-17 Thread Simon Glass
This series adds NAND flash support to Tegra and enables it on Seaboard.

Included here is a proposed device tree binding with most of the properties
private to "nvidia,". The binding includes information about the NAND
controller as well as the connected NAND device. The Seaboard has a
Hynix HY27UF4G2B.

The driver supports ECC-based access and uses DMA and NAND acceleration
features of the Tegra SOC to provide access at reasonable speed.

Changes in v2:
- Add new patch to align default buffers in nand_base
- Added comment about the behaviour of the 'resp' register
- Call set_bus_width_page_size() at init to report errors earlier
- Change set_bus_width_page_size() to return an error when needed
- Change timing structure member to u32 to match device tree
- Check for supported bus width in board_nand_init()
- Fix tegra nand header file to remove BIT defines
- Implement a dummy nand_select_chip() instead of nand_hwcontro()
- Make nand_command() display an error on an unknown command
- Minor code tidy-ups in driver for style
- Move cache logic into a separate dma_prepare() function
- Remove CMD_TRANS_SIZE_BYTESx enum
- Remove space after casts
- Remove use of 'register' variables
- Rename struct nand_info to struct nand_drv to avoid nand_info_t confusion
- Support 4096 byte page devices, drop 1024 and 2048
- Tidy up nand_waitfor_cmd_completion() logic
- Update NAND binding to add "nvidia," prefix
- Use s32 for device tree integer values

Changes in v3:
- Add reg property for unit address (should be used for chip select)
- Change note in fdt binding about the need for a hardware-specific binding
- Fix up typos in fdt binding, and rename the file
- Update fdt binding to make everything Nvidia-specific

Jim Lin (1):
  tegra: nand: Add Tegra NAND driver

Simon Glass (6):
  nand: Try to align the default buffers
  fdt: Add debugging to fdtdec_get_int/addr()
  tegra: Add NAND support to funcmux
  tegra: fdt: Add NAND controller binding and definitions
  tegra: fdt: Add NAND definitions to fdt
  tegra: Enable NAND on Seaboard

 arch/arm/cpu/armv7/tegra2/funcmux.c|7 +
 arch/arm/dts/tegra20.dtsi  |6 +
 arch/arm/include/asm/arch-tegra2/funcmux.h |3 +
 arch/arm/include/asm/arch-tegra2/tegra2.h  |1 +
 board/nvidia/dts/tegra2-seaboard.dts   |   16 +
 .../nand/nvidia,tegra20-nand.txt   |   68 ++
 drivers/mtd/nand/Makefile  |1 +
 drivers/mtd/nand/nand_base.c   |3 +-
 drivers/mtd/nand/tegra2_nand.c | 1095 
 drivers/mtd/nand/tegra2_nand.h |  257 +
 include/configs/seaboard.h |9 +
 include/fdtdec.h   |1 +
 include/linux/mtd/nand.h   |7 +-
 lib/fdtdec.c   |   23 +-
 14 files changed, 1487 insertions(+), 10 deletions(-)
 create mode 100644 doc/device-tree-bindings/nand/nvidia,tegra20-nand.txt
 create mode 100644 drivers/mtd/nand/tegra2_nand.c
 create mode 100644 drivers/mtd/nand/tegra2_nand.h

-- 
1.7.7.3

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


[U-Boot] [PATCH v3 1/7] nand: Try to align the default buffers

2012-04-17 Thread Simon Glass
The NAND layer needs to use cache-aligned buffers by default. Towards this
goal. align the default buffers and their members according to the minimum
DMA alignment defined for the architecture.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Add new patch to align default buffers in nand_base

 drivers/mtd/nand/nand_base.c |3 ++-
 include/linux/mtd/nand.h |7 ---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 44f7b91..7bfc29e 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2935,7 +2935,8 @@ int nand_scan_tail(struct mtd_info *mtd)
struct nand_chip *chip = mtd->priv;
 
if (!(chip->options & NAND_OWN_BUFFERS))
-   chip->buffers = kmalloc(sizeof(*chip->buffers), GFP_KERNEL);
+   chip->buffers = memalign(ARCH_DMA_MINALIGN,
+sizeof(*chip->buffers));
if (!chip->buffers)
return -ENOMEM;
 
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index da6fa18..ae0bdf6 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -391,9 +391,10 @@ struct nand_ecc_ctrl {
  * consecutive order.
  */
 struct nand_buffers {
-   uint8_t ecccalc[NAND_MAX_OOBSIZE];
-   uint8_t ecccode[NAND_MAX_OOBSIZE];
-   uint8_t databuf[NAND_MAX_PAGESIZE + NAND_MAX_OOBSIZE];
+   uint8_t ecccalc[ALIGN(NAND_MAX_OOBSIZE, ARCH_DMA_MINALIGN)];
+   uint8_t ecccode[ALIGN(NAND_MAX_OOBSIZE, ARCH_DMA_MINALIGN)];
+   uint8_t databuf[ALIGN(NAND_MAX_PAGESIZE + NAND_MAX_OOBSIZE,
+ ARCH_DMA_MINALIGN)];
 };
 
 /**
-- 
1.7.7.3

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


[U-Boot] [PATCH v3 2/7] fdt: Add debugging to fdtdec_get_int/addr()

2012-04-17 Thread Simon Glass
The new debugging shows the value of integers and addresses read
from the device tree.

Signed-off-by: Simon Glass 
---

 lib/fdtdec.c |   22 --
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 42c3e89..3885634 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -79,11 +79,16 @@ fdt_addr_t fdtdec_get_addr(const void *blob, int node,
const fdt_addr_t *cell;
int len;
 
-   debug("get_addr: %s\n", prop_name);
+   debug("%s: %s\n", __func__, prop_name);
cell = fdt_getprop(blob, node, prop_name, &len);
if (cell && (len == sizeof(fdt_addr_t) ||
-   len == sizeof(fdt_addr_t) * 2))
-   return fdt_addr_to_cpu(*cell);
+   len == sizeof(fdt_addr_t) * 2)) {
+   fdt_addr_t addr = fdt_addr_to_cpu(*cell);
+
+   debug("%p\n", (void *)addr);
+   return addr;
+   }
+   debug("(not found)\n");
return FDT_ADDR_T_NONE;
 }
 
@@ -93,10 +98,15 @@ s32 fdtdec_get_int(const void *blob, int node, const char 
*prop_name,
const s32 *cell;
int len;
 
-   debug("get_size: %s\n", prop_name);
+   debug("%s: %s: ", __func__, prop_name);
cell = fdt_getprop(blob, node, prop_name, &len);
-   if (cell && len >= sizeof(s32))
-   return fdt32_to_cpu(cell[0]);
+   if (cell && len >= sizeof(s32)) {
+   s32 val = fdt32_to_cpu(cell[0]);
+
+   debug("%#x (%d)\n", val, val);
+   return val;
+   }
+   debug("(not found)\n");
return default_val;
 }
 
-- 
1.7.7.3

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


[U-Boot] [PATCH v3 4/7] tegra: fdt: Add NAND controller binding and definitions

2012-04-17 Thread Simon Glass
Add a NAND controller along with a bindings file for review.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Update NAND binding to add "nvidia," prefix

Changes in v3:
- Add reg property for unit address (should be used for chip select)
- Change note in fdt binding about the need for a hardware-specific binding
- Fix up typos in fdt binding, and rename the file
- Update fdt binding to make everything Nvidia-specific

 arch/arm/dts/tegra20.dtsi  |6 ++
 .../nand/nvidia,tegra20-nand.txt   |   68 
 2 files changed, 74 insertions(+), 0 deletions(-)
 create mode 100644 doc/device-tree-bindings/nand/nvidia,tegra20-nand.txt

diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
index bc64f42..018a3c8 100644
--- a/arch/arm/dts/tegra20.dtsi
+++ b/arch/arm/dts/tegra20.dtsi
@@ -200,4 +200,10 @@
reg = <0x7000f400 0x200>;
};
 
+   nand: nand-controller@70008000 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "nvidia,tegra20-nand";
+   reg = <0x70008000 0x100>;
+   };
 };
diff --git a/doc/device-tree-bindings/nand/nvidia,tegra20-nand.txt 
b/doc/device-tree-bindings/nand/nvidia,tegra20-nand.txt
new file mode 100644
index 000..2484556
--- /dev/null
+++ b/doc/device-tree-bindings/nand/nvidia,tegra20-nand.txt
@@ -0,0 +1,68 @@
+NAND Flash
+--
+
+(there isn't yet a generic binding in Linux, so this describes what is in
+U-Boot. There should not be Linux-specific or U-Boot specific binding, just
+a binding that describes this hardware. But agreeing a binding in Linux in
+the absence of a driver may be beyond my powers.)
+
+The device node for a NAND flash device is as follows:
+
+Required properties :
+ - compatible : Should be "manufacturer,device", "nand-flash"
+ - nvidia,page-data-bytes : Number of bytes in the data area
+ - nvidia,page-spare-bytes : Number of bytes in spare area
+   spare area = skipped-spare-bytes + data-ecc-bytes + tag-bytes
+   + tag-ecc-bytes
+ - nvidia,skipped-spare-bytes : Number of bytes to skip at start of spare area
+   (these are typically used for bad block maintenance)
+ - nvidia,data-ecc-bytes : Number of ECC bytes for data area
+ - nvidia,tag-bytes :Number of tag bytes in spare area
+ - nvidia,tag-ecc-bytes : Number ECC bytes to be generated for tag bytes
+
+This node should sit inside its controller.
+
+
+Nvidia NAND Controller
+--
+
+The device node for a NAND flash controller is as follows:
+
+Optional properties:
+
+nvidia,wp-gpios : GPIO of write-protect line, three cells in the format:
+   phandle, parameter, flags
+nvidia,nand-width : bus width of the NAND device in bits
+
+ - nvidia,nand-timing : Timing parameters for the NAND. Each is in ns.
+   Order is: MAX_TRP_TREA, TWB, Max(tCS, tCH, tALS, tALH),
+   TWHR, Max(tCS, tCH, tALS, tALH), TWH, TWP, TRH, TADL
+
+   MAX_TRP_TREA is:
+   non-EDO mode: Max(tRP, tREA) + 6ns
+   EDO mode: tRP timing
+
+The 'reg' property should provide the chip select used by the flash chip.
+
+
+Example
+---
+
+nand-controller@0x70008000 {
+   compatible = "nvidia,tegra20-nand";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   nvidia,wp-gpios = <&gpio 59 0>; /* PH3 */
+   nvidia,nand-width = <8>;
+   nvidia,timing = <26 100 20 80 20 10 12 10 70>;
+   nand@0 {
+   reg = <0>;
+   compatible = "hynix,hy27uf4g2b", "nand-flash";
+   nvidia,page-data-bytes = <2048>;
+   nvidia,tag-ecc-bytes = <4>;
+   nvidia,tag-bytes = <20>;
+   nvidia,data-ecc-bytes = <36>;
+   nvidia,skipped-spare-bytes = <4>;
+   nvidia,page-spare-bytes = <64>;
+   };
+};
-- 
1.7.7.3

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


[U-Boot] [PATCH v3 3/7] tegra: Add NAND support to funcmux

2012-04-17 Thread Simon Glass
Add selection of NAND flash pins to the funcmux.

Signed-off-by: Simon Glass 
Acked-by: Stephen Warren 
---

 arch/arm/cpu/armv7/tegra2/funcmux.c|7 +++
 arch/arm/include/asm/arch-tegra2/funcmux.h |3 +++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/funcmux.c 
b/arch/arm/cpu/armv7/tegra2/funcmux.c
index c1d2dfe..8931d5e 100644
--- a/arch/arm/cpu/armv7/tegra2/funcmux.c
+++ b/arch/arm/cpu/armv7/tegra2/funcmux.c
@@ -169,6 +169,13 @@ int funcmux_select(enum periph_id id, int config)
}
break;
 
+   case PERIPH_ID_NDFLASH:
+   if (config == FUNCMUX_NDFLASH_ATC) {
+   pinmux_set_func(PINGRP_ATC, PMUX_FUNC_NAND);
+   pinmux_tristate_disable(PINGRP_ATC);
+   }
+   break;
+
default:
debug("%s: invalid periph_id %d", __func__, id);
return -1;
diff --git a/arch/arm/include/asm/arch-tegra2/funcmux.h 
b/arch/arm/include/asm/arch-tegra2/funcmux.h
index ae73c72..9419522 100644
--- a/arch/arm/include/asm/arch-tegra2/funcmux.h
+++ b/arch/arm/include/asm/arch-tegra2/funcmux.h
@@ -47,6 +47,9 @@ enum {
FUNCMUX_SDMMC4_ATC_ATD_8BIT = 0,
FUNCMUX_SDMMC4_ATB_GMA_4_BIT,
FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT,
+
+   /* NAND flags */
+   FUNCMUX_NDFLASH_ATC = 0,
 };
 
 /**
-- 
1.7.7.3

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


[U-Boot] [PATCH v3 5/7] tegra: fdt: Add NAND definitions to fdt

2012-04-17 Thread Simon Glass
Add a flash node to handle the NAND, including memory timings and
page / block size information.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Update NAND binding to add "nvidia," prefix

Changes in v3:
- Add reg property for unit address (should be used for chip select)
- Update fdt binding to make everything Nvidia-specific

 board/nvidia/dts/tegra2-seaboard.dts |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/board/nvidia/dts/tegra2-seaboard.dts 
b/board/nvidia/dts/tegra2-seaboard.dts
index 08ada8c..72a5f5d 100644
--- a/board/nvidia/dts/tegra2-seaboard.dts
+++ b/board/nvidia/dts/tegra2-seaboard.dts
@@ -126,4 +126,20 @@
0x 0x 0x 0x >;
};
};
+
+   nand-controller@70008000 {
+   nvidia,wp-gpios = <&gpio 59 0>; /* PH3 */
+   nvidia,width = <8>;
+   nvidia,timing = <26 100 20 80 20 10 12 10 70>;
+   nand@0 {
+   reg = <0>;
+   compatible = "hynix,hy27uf4g2b", "nand-flash";
+   nvidia,page-data-bytes = <2048>;
+   nvidia,tag-ecc-bytes = <4>;
+   nvidia,tag-bytes = <20>;
+   nvidia,data-ecc-bytes = <36>;
+   nvidia,skipped-spare-bytes = <4>;
+   nvidia,page-spare-bytes = <64>;
+   };
+   };
 };
-- 
1.7.7.3

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


[U-Boot] [PATCH v3 7/7] tegra: Enable NAND on Seaboard

2012-04-17 Thread Simon Glass
This enables NAND support for the Seaboard.

Signed-off-by: Simon Glass 
---

 include/configs/seaboard.h |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index 5d33dc5..3306622 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -105,4 +105,13 @@
 #define CONFIG_USB_STORAGE
 #define CONFIG_CMD_USB
 
+/* NAND support */
+#define CONFIG_CMD_NAND
+#define CONFIG_TEGRA2_NAND
+
+/* Max number of NAND devices */
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+
+/* Somewhat oddly, the NAND base address must be a config option */
+#define CONFIG_SYS_NAND_BASE   TEGRA2_NAND_BASE
 #endif /* __CONFIG_H */
-- 
1.7.7.3

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


[U-Boot] [PATCH v3 6/7] tegra: nand: Add Tegra NAND driver

2012-04-17 Thread Simon Glass
From: Jim Lin 

A device tree is used to configure the NAND, including memory
timings and block/pages sizes.

If this node is not present or is disabled, then NAND will not
be initialized.

Signed-off-by: Jim Lin 
Signed-off-by: Simon Glass 
---
Changes in v2:
- Added comment about the behaviour of the 'resp' register
- Call set_bus_width_page_size() at init to report errors earlier
- Change set_bus_width_page_size() to return an error when needed
- Change timing structure member to u32 to match device tree
- Check for supported bus width in board_nand_init()
- Fix tegra nand header file to remove BIT defines
- Implement a dummy nand_select_chip() instead of nand_hwcontro()
- Make nand_command() display an error on an unknown command
- Minor code tidy-ups in driver for style
- Move cache logic into a separate dma_prepare() function
- Remove CMD_TRANS_SIZE_BYTESx enum
- Remove space after casts
- Remove use of 'register' variables
- Rename struct nand_info to struct nand_drv to avoid nand_info_t confusion
- Support 4096 byte page devices, drop 1024 and 2048
- Tidy up nand_waitfor_cmd_completion() logic
- Update NAND binding to add "nvidia," prefix
- Use s32 for device tree integer values

Changes in v3:
- Update fdt binding to make everything Nvidia-specific

 arch/arm/include/asm/arch-tegra2/tegra2.h |1 +
 drivers/mtd/nand/Makefile |1 +
 drivers/mtd/nand/tegra2_nand.c| 1095 +
 drivers/mtd/nand/tegra2_nand.h|  257 +++
 include/fdtdec.h  |1 +
 lib/fdtdec.c  |1 +
 6 files changed, 1356 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/nand/tegra2_nand.c
 create mode 100644 drivers/mtd/nand/tegra2_nand.h

diff --git a/arch/arm/include/asm/arch-tegra2/tegra2.h 
b/arch/arm/include/asm/arch-tegra2/tegra2.h
index d4ada10..a080b63 100644
--- a/arch/arm/include/asm/arch-tegra2/tegra2.h
+++ b/arch/arm/include/asm/arch-tegra2/tegra2.h
@@ -39,6 +39,7 @@
 #define NV_PA_APB_UARTC_BASE   (NV_PA_APB_MISC_BASE + 0x6200)
 #define NV_PA_APB_UARTD_BASE   (NV_PA_APB_MISC_BASE + 0x6300)
 #define NV_PA_APB_UARTE_BASE   (NV_PA_APB_MISC_BASE + 0x6400)
+#define TEGRA2_NAND_BASE   (NV_PA_APB_MISC_BASE + 0x8000)
 #define TEGRA2_SPI_BASE(NV_PA_APB_MISC_BASE + 0xC380)
 #define TEGRA2_PMC_BASE(NV_PA_APB_MISC_BASE + 0xE400)
 #define TEGRA2_FUSE_BASE   (NV_PA_APB_MISC_BASE + 0xF800)
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 1d1b628..7efccf8 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -61,6 +61,7 @@ COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o
 COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o
 COBJS-$(CONFIG_NAND_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_NAND_SPEAR) += spr_nand.o
+COBJS-$(CONFIG_TEGRA2_NAND) += tegra2_nand.o
 COBJS-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
 COBJS-$(CONFIG_NAND_PLAT) += nand_plat.o
 endif
diff --git a/drivers/mtd/nand/tegra2_nand.c b/drivers/mtd/nand/tegra2_nand.c
new file mode 100644
index 000..55dd16f
--- /dev/null
+++ b/drivers/mtd/nand/tegra2_nand.c
@@ -0,0 +1,1095 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * (C) Copyright 2011 NVIDIA Corporation 
+ * (C) Copyright 2006 Detlev Zundel, d...@denx.de
+ * (C) Copyright 2006 DENX Software Engineering
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#define DEBUG
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "tegra2_nand.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define NAND_CMD_TIMEOUT_MS10
+
+static struct nand_ecclayout eccoob = {
+   .eccpos = {
+   4,  5,  6,  7,  8,  9,  10, 11, 12,
+   13, 14, 15, 16, 17, 18, 19, 20, 21,
+   22, 23, 24, 25, 26, 27, 28, 29, 30,
+   31, 32, 33, 34, 35, 36, 37, 38, 39,
+   60, 61, 62, 63,
+   },
+};
+
+enum {
+   ECC_OK,
+   ECC_TAG_ERROR = 1 << 0,
+   ECC_DATA_ERROR = 1 << 1
+};
+
+/* Timing parameters */
+enum {
+   FDT_NAND_MAX_TRP_TREA,
+   FDT_NAND_TWB,
+   FDT_NAND_MAX_TCR_TAR_TRR,
+   FDT_NAND_TWHR,
+   FDT_NAND_MAX_TCS_TCH_TALS_

[U-Boot] [PATCH v4 0/10] tegra: Enable keyboard with matrix keyboard driver

2012-04-17 Thread Simon Glass
Tegra2 has a built-in a keyboard controller which we can use to scan
a matrix keyboard. This series brings in a driver for this and adds
support for the QUERTY keyboard on Seaboard as an example.

This version uses the keyboard device-tree definition here:

http://patchwork.ozlabs.org/patch/134093/

so it should work seemlessly with the kernel keyboard device tree node.

Part of this series is an input library which is not tied to Tegra,
but hopes to be more generic. It supports converting key codes (or scan
codes as they are currently called) into ASCII characters, an input FIFO,
multiple key maps and dealing with duplicate key codes under key-repeat
situations (when a key is held down). Half of this library is taken from
keyboard.c and expanded to keep its state in a structure. The other half
of this library is new.

Another part of the series is a keyboard matrix library, which understands
how to convert (row, column) information into key codes in a device tree.

Both of these new libraries are used by the Tegra driver.

If this input library is accepted, then I will update keyboard.c and
i8042.c to use it. If not, then I could subsume it into the Tegra driver
for now. Or I could do something else. But it didn't seem right to add
a third key decoder (ignoring USB which does its own thing).

Changes in v2:
- Remove status = "okay" since this is the default anyway
- Use correct name for get_prop_check_min_len() function

Changes in v3:
- Add new patch for generic keyboard input handler
- Adjust decode logic to work with new Linux fdt keyboard binding
- Bring in linux/input.h header file in new patch
- Move to new Linux device tree mapping for Tegra keyboard
- Use funcmux to set up keyboard pinmux
- Use new input library to handle key decode, fifo, getc()/tstc()

Changes in v4:
- Implement key auto-repeat in the input layer
- Move matrix keyboard handling into a separate module
- Simplify driver as much as possible using input/key matrix layers
- Use new key_matrix handler to deal with key matrix decode

Anton Staff (3):
  fdt: Add fdtdec functions to read byte array
  tegra: fdt: Add keyboard controller definition
  tegra: fdt: Add keyboard definitions for Seaboard

Bernie Thompson (1):
  input: Add support for keyboard matrix decoding from an fdt

Rakesh Iyer (1):
  tegra: Add tegra keyboard driver

Simon Glass (5):
  input: Add linux/input.h for key code support
  input: Add generic keyboard input handler
  tegra: Add keyboard support to funcmux
  tegra: Switch on console mux and use environment for console
  tegra: Enable keyboard for Seaboard

 arch/arm/cpu/armv7/tegra2/funcmux.c  |   16 ++
 arch/arm/dts/tegra20.dtsi|5 +
 board/nvidia/dts/tegra2-seaboard.dts |   27 +++
 drivers/input/Makefile   |3 +
 drivers/input/input.c|  429 ++
 drivers/input/key_matrix.c   |  208 
 drivers/input/tegra-kbc.c|  375 +
 include/configs/seaboard.h   |9 +
 include/configs/tegra2-common.h  |9 +-
 include/fdtdec.h |   33 +++
 include/input.h  |  145 
 include/key_matrix.h |   99 
 include/linux/input.h|  155 
 include/tegra-kbc.h  |   33 +++
 lib/fdtdec.c |   25 ++
 15 files changed, 1570 insertions(+), 1 deletions(-)
 create mode 100644 drivers/input/input.c
 create mode 100644 drivers/input/key_matrix.c
 create mode 100644 drivers/input/tegra-kbc.c
 create mode 100644 include/input.h
 create mode 100644 include/key_matrix.h
 create mode 100644 include/linux/input.h
 create mode 100644 include/tegra-kbc.h

-- 
1.7.7.3

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


[U-Boot] [PATCH v4 01/10] fdt: Add fdtdec functions to read byte array

2012-04-17 Thread Simon Glass
From: Anton Staff 

Sometimes we don't need a full cell for each value. This provides
a simple function to read a byte array, both with and without
copying it.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Use correct name for get_prop_check_min_len() function

 include/fdtdec.h |   32 
 lib/fdtdec.c |   24 
 2 files changed, 56 insertions(+), 0 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 7bae2f8..5140f4a 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -350,3 +350,35 @@ int fdtdec_decode_gpio(const void *blob, int node, const 
char *prop_name,
  * @return 0 if all ok or gpio was FDT_GPIO_NONE; -1 on error
  */
 int fdtdec_setup_gpio(struct fdt_gpio_state *gpio);
+
+/*
+ * Look up a property in a node and return its contents in a byte
+ * array of given length. The property must have at least enough data for
+ * the array (count bytes). It may have more, but this will be ignored.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_namename of property to find
+ * @param arrayarray to fill with data
+ * @param countnumber of array elements
+ * @return 0 if ok, or -FDT_ERR_MISSING if the property is not found,
+ * or -FDT_ERR_BADLAYOUT if not enough data
+ */
+int fdtdec_get_byte_array(const void *blob, int node, const char *prop_name,
+   u8 *array, int count);
+
+/**
+ * Look up a property in a node and return a pointer to its contents as a
+ * byte array of given length. The property must have at least enough data
+ * for the array (count bytes). It may have more, but this will be ignored.
+ * The data is not copied.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_namename of property to find
+ * @param countnumber of array elements
+ * @return pointer to byte array if found, or NULL if the property is not
+ * found or there is not enough data
+ */
+const u8 *fdtdec_locate_byte_array(const void *blob, int node,
+const char *prop_name, int count);
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 2eb5b41..585dd6d 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -487,3 +487,27 @@ int fdtdec_setup_gpio(struct fdt_gpio_state *gpio)
return -1;
return 0;
 }
+
+int fdtdec_get_byte_array(const void *blob, int node, const char *prop_name,
+   u8 *array, int count)
+{
+   const u8 *cell;
+   int err;
+
+   cell = get_prop_check_min_len(blob, node, prop_name, count, &err);
+   if (!err)
+   memcpy(array, cell, count);
+   return err;
+}
+
+const u8 *fdtdec_locate_byte_array(const void *blob, int node,
+const char *prop_name, int count)
+{
+   const u8 *cell;
+   int err;
+
+   cell = get_prop_check_min_len(blob, node, prop_name, count, &err);
+   if (err)
+   return NULL;
+   return cell;
+}
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 02/10] input: Add linux/input.h for key code support

2012-04-17 Thread Simon Glass
We want to able to decode Linux fdt keymaps, so bring part of this
enormous header file over to U-Boot.

Signed-off-by: Simon Glass 
---
Changes in v3:
- Bring in linux/input.h header file in new patch

 include/linux/input.h |  155 +
 1 files changed, 155 insertions(+), 0 deletions(-)
 create mode 100644 include/linux/input.h

diff --git a/include/linux/input.h b/include/linux/input.h
new file mode 100644
index 000..44aec76
--- /dev/null
+++ b/include/linux/input.h
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 1999-2002 Vojtech Pavlik
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+
+#ifndef _LINUX_INPUT_H
+#define _LINUX_INPUT_H
+
+/*
+ * Keys and buttons
+ *
+ * Most of the keys/buttons are modeled after USB HUT 1.12
+ * (see http://www.usb.org/developers/hidpage).
+ * Abbreviations in the comments:
+ * AC - Application Control
+ * AL - Application Launch Button
+ * SC - System Control
+ */
+
+#define KEY_RESERVED   0
+#define KEY_ESC1
+#define KEY_1  2
+#define KEY_2  3
+#define KEY_3  4
+#define KEY_4  5
+#define KEY_5  6
+#define KEY_6  7
+#define KEY_7  8
+#define KEY_8  9
+#define KEY_9  10
+#define KEY_0  11
+#define KEY_MINUS  12
+#define KEY_EQUAL  13
+#define KEY_BACKSPACE  14
+#define KEY_TAB15
+#define KEY_Q  16
+#define KEY_W  17
+#define KEY_E  18
+#define KEY_R  19
+#define KEY_T  20
+#define KEY_Y  21
+#define KEY_U  22
+#define KEY_I  23
+#define KEY_O  24
+#define KEY_P  25
+#define KEY_LEFTBRACE  26
+#define KEY_RIGHTBRACE 27
+#define KEY_ENTER  28
+#define KEY_LEFTCTRL   29
+#define KEY_A  30
+#define KEY_S  31
+#define KEY_D  32
+#define KEY_F  33
+#define KEY_G  34
+#define KEY_H  35
+#define KEY_J  36
+#define KEY_K  37
+#define KEY_L  38
+#define KEY_SEMICOLON  39
+#define KEY_APOSTROPHE 40
+#define KEY_GRAVE  41
+#define KEY_LEFTSHIFT  42
+#define KEY_BACKSLASH  43
+#define KEY_Z  44
+#define KEY_X  45
+#define KEY_C  46
+#define KEY_V  47
+#define KEY_B  48
+#define KEY_N  49
+#define KEY_M  50
+#define KEY_COMMA  51
+#define KEY_DOT52
+#define KEY_SLASH  53
+#define KEY_RIGHTSHIFT 54
+#define KEY_KPASTERISK 55
+#define KEY_LEFTALT56
+#define KEY_SPACE  57
+#define KEY_CAPSLOCK   58
+#define KEY_F1 59
+#define KEY_F2 60
+#define KEY_F3 61
+#define KEY_F4 62
+#define KEY_F5 63
+#define KEY_F6 64
+#define KEY_F7 65
+#define KEY_F8 66
+#define KEY_F9 67
+#define KEY_F1068
+#define KEY_NUMLOCK69
+#define KEY_SCROLLLOCK 70
+#define KEY_KP771
+#define KEY_KP872
+#define KEY_KP973
+#define KEY_KPMINUS74
+#define KEY_KP475
+#define KEY_KP576
+#define KEY_KP677
+#define KEY_KPPLUS 78
+#define KEY_KP179
+#define KEY_KP280
+#define KEY_KP381
+#define KEY_KP082
+#define KEY_KPDOT  83
+
+#define KEY_ZENKAKUHANKAKU 85
+#define KEY_102ND  86
+#define KEY_F1187
+#define KEY_F1288
+#define KEY_RO 89
+#define KEY_KATAKANA   90
+#define KEY_HIRAGANA   91
+#define KEY_HENKAN 92
+#define KEY_KATAKANAHIRAGANA   93
+#define KEY_MUHENKAN   94
+#define KEY_KPJPCOMMA  95
+#define KEY_KPENTER96
+#define KEY_RIGHTCTRL  97
+#define KEY_KPSLASH98
+#define KEY_SYSRQ  99
+#define KEY_RIGHTALT   100
+#define KEY_LINEFEED   101
+#define KEY_HOME   102
+#define KEY_UP 103
+#define KEY_PAGEUP 104
+#define KEY_LEFT   105
+#define KEY_RIGHT  106
+#define KEY_END107
+#define KE

[U-Boot] [PATCH v4 03/10] input: Add generic keyboard input handler

2012-04-17 Thread Simon Glass
Add a module which understands converting key codes (or scan codes)
to ASCII characters. It includes FIFO support and can call back to
drivers to read new characters when its FIFO is empty.

Keycode maps are provided for un-modified, shift and ctrl keys.

The plan is to use this module where such mapping is required.

Signed-off-by: Simon Glass 
---
Changes in v3:
- Add new patch for generic keyboard input handler

Changes in v4:
- Implement key auto-repeat in the input layer

 drivers/input/Makefile |1 +
 drivers/input/input.c  |  429 
 include/input.h|  145 
 3 files changed, 575 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/input.c
 create mode 100644 include/input.h

diff --git a/drivers/input/Makefile b/drivers/input/Makefile
index 1f4dad3..d06acb9 100644
--- a/drivers/input/Makefile
+++ b/drivers/input/Makefile
@@ -30,6 +30,7 @@ ifdef CONFIG_PS2KBD
 COBJS-y += keyboard.o pc_keyb.o
 COBJS-$(CONFIG_PS2MULT) += ps2mult.o ps2ser.o
 endif
+COBJS-y += input.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/input/input.c b/drivers/input/input.c
new file mode 100644
index 000..9beebe3
--- /dev/null
+++ b/drivers/input/input.c
@@ -0,0 +1,429 @@
+/*
+ * Translate key codes into ASCII
+ *
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * (C) Copyright 2004 DENX Software Engineering, Wolfgang Denk, w...@denx.de
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+
+enum {
+   /* These correspond to the lights on the keyboard */
+   FLAG_NUM_LOCK   = 1 << 0,
+   FLAG_CAPS_LOCK  = 1 << 1,
+   FLAG_SCROLL_LOCK= 1 << 2,
+
+   /* Special flag ORed with key code to indicate release */
+   KEY_RELEASE = 1 << 15,
+   KEY_MASK= 0xfff,
+};
+
+/*
+ * These takes map key codes to ASCII. 0xff means no key, or special key.
+ * Three tables are provided - one for plain keys, one for when the shift
+ * 'modifier' key is pressed and one for when the ctrl modifier key is
+ * pressed.
+ */
+static const uchar kbd_plain_xlate[] = {
+   0xff, 0x1b, '1',  '2',  '3',  '4',  '5',  '6',
+   '7',  '8',  '9',  '0',  '-',  '=', '\b', '\t',  /* 0x00 - 0x0f */
+   'q',  'w',  'e',  'r',  't',  'y',  'u',  'i',
+   'o',  'p',  '[',  ']', '\r', 0xff,  'a',  's',  /* 0x10 - 0x1f */
+   'd',  'f',  'g',  'h',  'j',  'k',  'l',  ';',
+   '\'',  '`', 0xff, '\\', 'z',  'x',  'c',  'v',  /* 0x20 - 0x2f */
+   'b',  'n',  'm',  ',' ,  '.', '/', 0xff, 0xff, 0xff,
+   ' ', 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,/* 0x30 - 0x3f */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  '7',
+   '8',  '9',  '-',  '4',  '5',  '6',  '+',  '1',  /* 0x40 - 0x4f */
+   '2',  '3',  '0',  '.', 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x50 - 0x5F */
+   '\r', 0xff, 0xff
+};
+
+static unsigned char kbd_shift_xlate[] = {
+   0xff, 0x1b, '!', '@', '#', '$', '%', '^',
+   '&', '*', '(', ')', '_', '+', '\b', '\t',   /* 0x00 - 0x0f */
+   'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I',
+   'O', 'P', '{', '}', '\r', 0xff, 'A', 'S',   /* 0x10 - 0x1f */
+   'D', 'F', 'G', 'H', 'J', 'K', 'L', ':',
+   '"', '~', 0xff, '|', 'Z', 'X', 'C', 'V',/* 0x20 - 0x2f */
+   'B', 'N', 'M', '<', '>', '?', 0xff, 0xff, 0xff,
+   ' ', 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,/* 0x30 - 0x3f */
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, '7',
+   '8', '9', '-', '4', '5', '6', '+', '1', /* 0x40 - 0x4f */
+   '2', '3', '0', '.', 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,   /* 0x50 - 0x5F */
+   '\r', 0xff, 0xff
+};
+
+static unsigned char kbd_ctrl_xlate[] = {
+   0xff, 0x1b, '1', 0x00, '3', '4', '5', 0x1E,
+   '7', '8', '9', '0', 0x1F, '=', '\b', '\t',  /* 0x00 - 0x0f */
+   0x11, 0x17, 0x05, 0x12, 0x14, 0x18, 0x15, 0x09,
+   0x0f, 0x10, 0x1b, 0x1d, '\n', 0xff, 0x01, 0x13, /* 0x10 - 0x1f */
+   0x04, 0x06, 0x08, 0x09, 0x0a, 0x0b, 0x0c, ';',
+   '\'', '~', 0x00, 0x1c, 0x1a, 0x18, 0x03, 0x16,  /* 0x20 

[U-Boot] [PATCH v4 09/10] tegra: Switch on console mux and use environment for console

2012-04-17 Thread Simon Glass
All tegra boards will use these options by default.

Signed-off-by: Simon Glass 
---

 include/configs/tegra2-common.h |9 -
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
index c5870dd..068ce88 100644
--- a/include/configs/tegra2-common.h
+++ b/include/configs/tegra2-common.h
@@ -132,11 +132,18 @@
 
 #define CONFIG_SYS_NO_FLASH
 
-/* Environment information */
+/* Environment information, boards can override if required */
+#define CONFIG_CONSOLE_MUX
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define TEGRA2_DEVICE_SETTINGS "stdin=serial\0" \
+   "stdout=serial\0" \
+   "stderr=serial\0"
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
"console=ttyS0,115200n8\0" \
"mem=" TEGRA2_SYSMEM "\0" \
"smpflag=smp\0" \
+   TEGRA2_DEVICE_SETTINGS
 
 #define CONFIG_LOADADDR0x408000/* def. location for 
kernel */
 #define CONFIG_BOOTDELAY   2   /* -1 to disable auto boot */
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 06/10] tegra: fdt: Add keyboard controller definition

2012-04-17 Thread Simon Glass
From: Anton Staff 

The Tegra keyboard controller provides a simple interface to a matrix
keyboard.

Signed-off-by: Simon Glass 
---

 arch/arm/dts/tegra20.dtsi |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
index 018a3c8..5d214f2 100644
--- a/arch/arm/dts/tegra20.dtsi
+++ b/arch/arm/dts/tegra20.dtsi
@@ -206,4 +206,9 @@
compatible = "nvidia,tegra20-nand";
reg = <0x70008000 0x100>;
};
+
+   kbc@7000e200 {
+   compatible = "nvidia,tegra20-kbc";
+   reg = <0x7000e200 0x0078>;
+   };
 };
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 04/10] input: Add support for keyboard matrix decoding from an fdt

2012-04-17 Thread Simon Glass
From: Bernie Thompson 

Matrix keyboards require a key map to be set up, and must also deal with
key ghosting.

Create a keyboard matrix management implementation which can be leveraged
by various keyboard drivers. This includes code to read the keymap from
the FDT and perform debouncing.

Signed-off-by: Bernie Thompson 
Signed-off-by: Simon Glass 
---
Changes in v4:
- Move matrix keyboard handling into a separate module

 drivers/input/Makefile |1 +
 drivers/input/key_matrix.c |  208 
 include/key_matrix.h   |   99 +
 3 files changed, 308 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/key_matrix.c
 create mode 100644 include/key_matrix.h

diff --git a/drivers/input/Makefile b/drivers/input/Makefile
index d06acb9..b8d8623 100644
--- a/drivers/input/Makefile
+++ b/drivers/input/Makefile
@@ -31,6 +31,7 @@ COBJS-y += keyboard.o pc_keyb.o
 COBJS-$(CONFIG_PS2MULT) += ps2mult.o ps2ser.o
 endif
 COBJS-y += input.o
+COBJS-y += key_matrix.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/input/key_matrix.c b/drivers/input/key_matrix.c
new file mode 100644
index 000..84b898f
--- /dev/null
+++ b/drivers/input/key_matrix.c
@@ -0,0 +1,208 @@
+/*
+ * Manage Keyboard Matrices
+ *
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * (C) Copyright 2004 DENX Software Engineering, Wolfgang Denk, w...@denx.de
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+/**
+ * Determine if the current keypress configuration can cause key ghosting
+ *
+ * We figure this out by seeing if we have two or more keys in the same
+ * column, as well as two or more keys in the same row.
+ *
+ * @param config   Keyboard matrix config
+ * @param keys List of keys to check
+ * @param validNumber of valid keypresses to check
+ * @return 0 if no ghosting is possible, 1 if it is
+ */
+static int has_ghosting(struct key_matrix *config, struct key_matrix_key *keys,
+   int valid)
+{
+   int key_in_same_col = 0, key_in_same_row = 0;
+   int i, j;
+
+   for (i = 0; i < valid; i++) {
+   /*
+* Find 2 keys such that one key is in the same row
+* and the other is in the same column as the i-th key.
+*/
+   for (j = i + 1; j < valid; j++) {
+   if (keys[j].col == keys[i].col)
+   key_in_same_col = 1;
+   if (keys[j].row == keys[i].row)
+   key_in_same_row = 1;
+   }
+   }
+
+   if (key_in_same_col && key_in_same_row)
+   return 1;
+   else
+   return 0;
+}
+
+int key_matrix_decode(struct key_matrix *config, struct key_matrix_key keys[],
+ int num_keys, int keycode[], int max_keycodes)
+{
+   const u8 *keymap;
+   int valid, upto;
+   int pos;
+
+   debug("%s: num_keys = %d\n", __func__, num_keys);
+   keymap = config->plain_keycode;
+   for (valid = upto = 0; upto < num_keys; upto++) {
+   struct key_matrix_key *key = &keys[upto];
+
+   debug("  valid=%d, row=%d, col=%d\n", key->valid, key->row,
+ key->col);
+   if (!key->valid)
+   continue;
+   pos = key->row * config->num_cols + key->col;
+   if (config->fn_keycode && pos == config->fn_pos)
+   keymap = config->fn_keycode;
+
+   /* Convert the (row, col) values into a keycode */
+   if (valid < max_keycodes)
+   keycode[valid++] = keymap[pos];
+   debug("keycode=%d\n", keymap[pos]);
+   }
+
+   /* For a ghost key config, ignore the keypresses for this iteration. */
+   if (valid >= 3 && has_ghosting(config, keys, valid)) {
+   valid = 0;
+   debug("ghosting detected!\n");
+   }
+   debug("  %d valid keycodes found\n", valid);
+
+   return valid;
+}
+
+/**
+ * Create a new keycode map from some provided data
+ *
+ * This decodes a keycode map in the

[U-Boot] [PATCH v4 10/10] tegra: Enable keyboard for Seaboard

2012-04-17 Thread Simon Glass
This enables the standard keyboard on Seaboard.

Signed-off-by: Simon Glass 
---

 include/configs/seaboard.h |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index 3306622..1ee7e12 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -114,4 +114,13 @@
 
 /* Somewhat oddly, the NAND base address must be a config option */
 #define CONFIG_SYS_NAND_BASE   TEGRA2_NAND_BASE
+
+/* Enable keyboard */
+#define CONFIG_TEGRA2_KEYBOARD
+#define CONFIG_KEYBOARD
+
+#undef TEGRA2_DEVICE_SETTINGS
+#define TEGRA2_DEVICE_SETTINGS "stdin=serial,tegra-kbc\0" \
+   "stdout=serial\0" \
+   "stderr=serial\0"
 #endif /* __CONFIG_H */
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 07/10] tegra: fdt: Add keyboard definitions for Seaboard

2012-04-17 Thread Simon Glass
From: Anton Staff 

Seaboard uses a QUERTY keyboard. We add key codes for this to
enable key scanning to work.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Remove status = "okay" since this is the default anyway

Changes in v3:
- Move to new Linux device tree mapping for Tegra keyboard

 board/nvidia/dts/tegra2-seaboard.dts |   27 +++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/board/nvidia/dts/tegra2-seaboard.dts 
b/board/nvidia/dts/tegra2-seaboard.dts
index 72a5f5d..db72ef2 100644
--- a/board/nvidia/dts/tegra2-seaboard.dts
+++ b/board/nvidia/dts/tegra2-seaboard.dts
@@ -142,4 +142,31 @@
nvidia,page-spare-bytes = <64>;
};
};
+
+   kbc@7000e200 {
+   linux,keymap = <0x00020011 0x0003001f 0x0004001e 0x0005002c
+   0x000701d0 0x0107007d 0x02060064 0x02070038 0x0306
+   0x03010005 0x03020013 0x03030012 0x03040021 0x03050020
+   0x0306002d 0x0408 0x04010007 0x04020014 0x04030023
+   0x04040022 0x0405002f 0x0406002e 0x04070039 0x050a
+   0x05010009 0x05020016 0x05030015 0x05040024 0x05050031
+   0x05060030 0x0507002b 0x060c 0x0601000b 0x06020018
+   0x06030017 0x06040026 0x06050025 0x06060033 0x06070032
+   0x0701000d 0x0702001b 0x0703001c 0x0707008b 0x08040036
+   0x0805002a 0x09050061 0x0907001d 0x0b1a 0x0b010019
+   0x0b020028 0x0b030027 0x0b040035 0x0b050034 0x0c44
+   0x0c010043 0x0c02000e 0x0c030004 0x0c040003 0x0c050067
+   0x0c0600d2 0x0c070077 0x0d6e 0x0d01006f 0x0d030068
+   0x0d04006d 0x0d05006a 0x0d06006c 0x0d070069 0x0e57
+   0x0e010058 0x0e020042 0x0e030010 0x0e04003e 0x0e05003d
+   0x0e060002 0x0e070041 0x0f01 0x0f010029 0x0f02003f
+   0x0f03000f 0x0f04003b 0x0f05003c 0x0f06003a 0x0f070040
+   0x1447 0x1549 0x15010048 0x1502004b 0x1504004f
+   0x16010062 0x1602004d 0x1603004c 0x16040051 0x16050050
+   0x16070052 0x1b010037 0x1b03004a 0x1b04004e 0x1b050053
+   0x1c050073 0x1d030066 0x1d04006b 0x1d0500e0 0x1d060072
+   0x1d0700e1 0x1e45 0x1e010046 0x1e020071
+   0x1f04008a>;
+   linux,fn-keymap = <0x05040002>;
+   };
 };
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 08/10] tegra: Add tegra keyboard driver

2012-04-17 Thread Simon Glass
From: Rakesh Iyer 

Add support for internal matrix keyboard controller for Nvidia Tegra
platforms. This driver uses the fdt decode function to obtain its key
codes.

Support for the Ctrl modifier is provided. The left and right ctrl keys are
dealt with in the same way.

This uses the new keyboard input library (drivers/input/input.c) to decode
keys and handle most of the common input logic. The new key matrix library
is also used to decode (row, column) key positions into key codes.

The intent is to make this driver purely about dealing with the hardware.

Key detection before the driver is loaded is supported. This key will be
picked up when the keyboard driver is initialized.

Modified by Bernie Thompson  and
Simon Glass  for device tree, input layer, key matrix
and various other things.

Signed-off-by: Simon Glass 
---
Changes in v3:
- Adjust decode logic to work with new Linux fdt keyboard binding
- Use new input library to handle key decode, fifo, getc()/tstc()

Changes in v4:
- Simplify driver as much as possible using input/key matrix layers
- Use new key_matrix handler to deal with key matrix decode

 drivers/input/Makefile|1 +
 drivers/input/tegra-kbc.c |  375 +
 include/fdtdec.h  |1 +
 include/tegra-kbc.h   |   33 
 lib/fdtdec.c  |1 +
 5 files changed, 411 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/tegra-kbc.c
 create mode 100644 include/tegra-kbc.h

diff --git a/drivers/input/Makefile b/drivers/input/Makefile
index b8d8623..8b51dff 100644
--- a/drivers/input/Makefile
+++ b/drivers/input/Makefile
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB:= $(obj)libinput.o
 
 COBJS-$(CONFIG_I8042_KBD) += i8042.o
+COBJS-$(CONFIG_TEGRA2_KEYBOARD) += tegra-kbc.o
 ifdef CONFIG_PS2KBD
 COBJS-y += keyboard.o pc_keyb.o
 COBJS-$(CONFIG_PS2MULT) += ps2mult.o ps2ser.o
diff --git a/drivers/input/tegra-kbc.c b/drivers/input/tegra-kbc.c
new file mode 100644
index 000..f164791
--- /dev/null
+++ b/drivers/input/tegra-kbc.c
@@ -0,0 +1,375 @@
+/*
+ *  (C) Copyright 2011
+ *  NVIDIA Corporation 
+ *
+ * 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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+enum {
+   KBC_MAX_GPIO= 24,
+   KBC_MAX_KPENT   = 8,/* size of keypress entry queue */
+};
+
+#define KBC_FIFO_TH_CNT_SHIFT  14
+#define KBC_DEBOUNCE_CNT_SHIFT 4
+#define KBC_CONTROL_FIFO_CNT_INT_EN(1 << 3)
+#define KBC_CONTROL_KBC_EN (1 << 0)
+#define KBC_INT_FIFO_CNT_INT_STATUS(1 << 2)
+#define KBC_KPENT_VALID(1 << 7)
+#define KBC_ST_STATUS  (1 << 3)
+
+enum {
+   KBC_DEBOUNCE_COUNT  = 2,
+   KBC_REPEAT_RATE_MS  = 30,
+   KBC_REPEAT_DELAY_MS = 240,
+   KBC_CLOCK_KHZ   = 32,   /* Keyboard uses a 32KHz clock */
+};
+
+/* keyboard controller config and state */
+static struct keyb {
+   struct input_config input;  /* The input layer */
+   struct key_matrix matrix;   /* The key matrix layer */
+
+   struct kbc_tegra *kbc;  /* tegra keyboard controller */
+   unsigned char inited;   /* 1 if keyboard has been inited */
+   unsigned char first_scan;   /* 1 if this is our first key scan */
+
+   /*
+* After init we must wait a short time before polling the keyboard.
+* This gives the tegra keyboard controller time to react after reset
+* and lets us grab keys pressed during reset.
+*/
+   unsigned int init_dly_ms;   /* Delay before we can read keyboard */
+   unsigned int start_time_ms; /* Time that we inited (in ms) */
+   unsigned int last_poll_ms;  /* Time we should last polled */
+   unsigned int next_repeat_ms;/* Next time we repeat a key */
+} config;
+
+/**
+ * reads the keyboard fifo for current keypresses
+ *
+ * @param config   Keyboard config
+ * @param fifo Place to put fifo results
+ * @param max_keycodes Maximum number of key codes to put in the fifo
+ * @return number of items put in

[U-Boot] [PATCH] fix IDE_BUS(dev) macro

2012-04-17 Thread Luka Perkov
IDE_BUS assumes that each bus has two devices and thus returns the first
bus even when the second one should be probed.

Signed-off-by: Simon Baatz 
Tested-by: Luka Perkov 
---

Simon discovered this while adding support for new board IB NAS6210.

More info can be found here:

http://lists.denx.de/pipermail/u-boot/2012-April/122525.html

When this is commited I will do a coding style cleanup. There are tabs
after few "#define" parts in include/ide.h.

 include/ide.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/ide.h b/include/ide.h
index 8ecc9dd..385e909 100644
--- a/include/ide.h
+++ b/include/ide.h
@@ -24,7 +24,7 @@
 #ifndef_IDE_H
 #define _IDE_H
 
-#defineIDE_BUS(dev)(dev >> 1)
+#define IDE_BUS(dev)   (dev / (CONFIG_SYS_IDE_MAXDEVICE / 
CONFIG_SYS_IDE_MAXBUS))
 
 #defineATA_CURR_BASE(dev)  
(CONFIG_SYS_ATA_BASE_ADDR+ide_bus_offset[IDE_BUS(dev)])
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 4/7] tegra: fdt: Add NAND controller binding and definitions

2012-04-17 Thread Scott Wood
On 04/17/2012 01:50 PM, Simon Glass wrote:
> diff --git a/doc/device-tree-bindings/nand/nvidia,tegra20-nand.txt 
> b/doc/device-tree-bindings/nand/nvidia,tegra20-nand.txt
> new file mode 100644
> index 000..2484556
> --- /dev/null
> +++ b/doc/device-tree-bindings/nand/nvidia,tegra20-nand.txt
> @@ -0,0 +1,68 @@
> +NAND Flash
> +--
> +
> +(there isn't yet a generic binding in Linux, so this describes what is in
> +U-Boot. There should not be Linux-specific or U-Boot specific binding, just
> +a binding that describes this hardware. But agreeing a binding in Linux in
> +the absence of a driver may be beyond my powers.)
> +
> +The device node for a NAND flash device is as follows:
> +
> +Required properties :
> + - compatible : Should be "manufacturer,device", "nand-flash"

Again, "nand-flash" is not an appropriate compatible.  There is no
generic nand-flash binding.

> + - nvidia,page-data-bytes : Number of bytes in the data area
> + - nvidia,page-spare-bytes : Number of bytes in spare area
> +   spare area = skipped-spare-bytes + data-ecc-bytes + tag-bytes
> + + tag-ecc-bytes

Do you really need this stuff to be in the device tree?  You should be
able to determine this information from the ID table.

> + - nvidia,skipped-spare-bytes : Number of bytes to skip at start of spare 
> area
> + (these are typically used for bad block maintenance)

So this binding can't deal with the bad block marker being somewhere
other than the beginning of the spare area (e.g. 8-bit small page NAND)?

> + - nvidia,data-ecc-bytes : Number of ECC bytes for data area

Number of ECC bytes per page?  Number of ECC bytes per ECC block?
Number of data bytes per ECC block?

> + - nvidia,tag-bytes :Number of tag bytes in spare area

What are tag bytes?

> +Nvidia NAND Controller
> +--
> +
> +The device node for a NAND flash controller is as follows:
> +
> +Optional properties:
> +
> +nvidia,wp-gpios : GPIO of write-protect line, three cells in the format:
> + phandle, parameter, flags

Doesn't the number of cells depend on the GPIO controller binding?

> +nvidia,nand-width : bus width of the NAND device in bits
> +
> + - nvidia,nand-timing : Timing parameters for the NAND. Each is in ns.
> + Order is: MAX_TRP_TREA, TWB, Max(tCS, tCH, tALS, tALH),
> + TWHR, Max(tCS, tCH, tALS, tALH), TWH, TWP, TRH, TADL

Might want to point out that there's one cell per timing parameter.

-Scott

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


[U-Boot] [PATCH v4 05/10] tegra: Add keyboard support to funcmux

2012-04-17 Thread Simon Glass
Add funcmux support for the default keyboard mapping.

Signed-off-by: Simon Glass 
---
Changes in v3:
- Use funcmux to set up keyboard pinmux

 arch/arm/cpu/armv7/tegra2/funcmux.c |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/funcmux.c 
b/arch/arm/cpu/armv7/tegra2/funcmux.c
index 8931d5e..53e85ff 100644
--- a/arch/arm/cpu/armv7/tegra2/funcmux.c
+++ b/arch/arm/cpu/armv7/tegra2/funcmux.c
@@ -176,6 +176,22 @@ int funcmux_select(enum periph_id id, int config)
}
break;
 
+   case PERIPH_ID_KBC:
+   if (config == FUNCMUX_DEFAULT) {
+   enum pmux_pingrp grp[] = {PINGRP_KBCA, PINGRP_KBCB,
+   PINGRP_KBCC, PINGRP_KBCD, PINGRP_KBCE,
+   PINGRP_KBCF};
+   int i;
+
+   for (i = 0; i < ARRAY_SIZE(grp); i++) {
+   pinmux_tristate_disable(grp[i]);
+   pinmux_set_func(grp[i], PMUX_FUNC_KBC);
+   pinmux_set_pullupdown(grp[i], PMUX_PULL_UP);
+   }
+
+   break;
+   }
+
default:
debug("%s: invalid periph_id %d", __func__, id);
return -1;
-- 
1.7.7.3

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


[U-Boot] [PATCH v8] kirkwood: add NAS62x0 board support

2012-04-17 Thread Luka Perkov
Add support for new boards RaidSonic ICY BOX NAS6210 and NAS6220.

NAS6210 has 1 SATA and 1 eSATA port while NAS6220 has 2 SATA ports.

More information about the boards can be found here:

http://www.raidsonic.de/en/products/nas-systems.php?we_objectID=7036
http://www.raidsonic.de/en/products/nas-systems.php?we_objectID=7515

Signed-off-by: Luka Perkov 
Signed-off-by: Gerald Kerma 
Signed-off-by: Simon Baatz 
---

Changes from version v1:

 * use tools/checkpatch.pl to locate patch errors and fix them
 * add two entries in boards.cfg, one for each board
 * fixed CONFIG_RESET_PHY_R
 * don't define values for macros that enable features only
 * remove static RAM configuration
 * fix comments
 * use only CONFIG_ENV_OFFSET and remove CONFIG_ENV_ADDR
 * clean coding style
 * add entry in MAINTAINERS file

Changes from version v2:

 * use defined() in macros for board selection for robustness

Changes from version v3:

 * don't use utf8 for Geralds name
 * don't mix upper/lower case in kwbimage.cfg
 * fix prompt

Changes from version v4:
 * fix board Makefile (clean and distclean)
 * use generic way to handle arch number of the board
 * fix MAINTAINERS file
 * move code from Marvell to raidsonic folder
 * use CONFIG_MACH_TYPE
 * set only necessary GPIOs
 * use link instead of address for license
 * add few links about board being supported for quick reference
 * add previous change logs
 * multiple updates to kwbimage.cfg, thank you Simon

Changes from version v5:
 * remove typo from kwbimage.cfg (duplicated lines), thank you David
 * clean up comments in kwbimage.cfg

Changes from version v6:
 * replace KW_SATA_PORT0_OFFSET with MV_SATA_PORT0_OFFSET
 * change commit message

Changes from version v7:
 * use same config for both boards, because fix for second SATA or eSATA port
   is here:

   http://lists.denx.de/pipermail/u-boot/2012-April/122594.html

   Without that patch uboot *will* work.

 * change some files because of the above


 MAINTAINERS |4 +
 board/raidsonic/ib62x0/Makefile |   43 +
 board/raidsonic/ib62x0/ib62x0.c |   79 
 board/raidsonic/ib62x0/ib62x0.h |   40 +
 board/raidsonic/ib62x0/kwbimage.cfg |  169 +++
 boards.cfg  |1 +
 include/configs/ib62x0.h|  152 +++
 8 files changed, 489 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 708ded7..9d2aba7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -777,6 +777,10 @@ Linus Walleij 
integratorapvarious
integratorcpvarious
 
+Luka Perkov 
+
+   ib62x0  ARM926EJS
+
 Dave Peverley 
 
omap730p2   ARM926EJS
diff --git a/board/raidsonic/ib62x0/Makefile b/board/raidsonic/ib62x0/Makefile
new file mode 100644
index 000..d450f8d
--- /dev/null
+++ b/board/raidsonic/ib62x0/Makefile
@@ -0,0 +1,43 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor 
+# Written-by: Prafulla Wadaskar 
+#
+# 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, see .
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := ib62x0.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/raidsonic/ib62x0/ib62x0.c b/board/raidsonic/ib62x0/ib62x0.c
new file mode 100644
index 000..65f2c2e
--- /dev/null
+++ b/board/raidsonic/ib62x0/ib62x0.c
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2011-2012
+ * Gerald Kerma 
+ * Luka Perkov 
+ * Simon Baatz 
+ *
+ * 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,
+ * bu

Re: [U-Boot] [PATCH v7] kirkwood: add NAS62x0 board support

2012-04-17 Thread David Purdy
On Tue, Apr 17, 2012 at 1:47 PM, Luka Perkov  wrote:
> Hi Simon! Hi Prafulla!
>
> On Tue, Apr 17, 2012 at 02:14:23AM -0700, Prafulla Wadaskar wrote:
>> > #define IDE_BUS(dev) (dev / (CONFIG_SYS_IDE_MAXDEVICE /
>> > CONFIG_SYS_IDE_MAXBUS))
>> >
>> > in ide.h fixes the problem for me and detects both the internal hard
>> > disk and the hard disk at the eSATA port.
>
> Yes, this does the trick.
>
>> > This also means that the 6210/6220 patch should not make a difference
>> > between the two boards.
>
> You are right. I'll rewrite it.
>
>> Hi Simon
>>
>> This is a good findings indeed.
>
> I agree :)
>
>> Hi Luka
>> May you please check the same and resubmit the clean patch, you may keep ide 
>> patch separate mentioning dependency.
>
> Yes. I'll send patches soonish...
>
> Luka
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot


Simon, Luka, Prafulla,

Any chance this same patch would similarly help other Kirkwood boxes
that have two SATA ports?

regards,

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


Re: [U-Boot] [PATCH v7] kirkwood: add NAS62x0 board support

2012-04-17 Thread Luka Perkov
On Tue, Apr 17, 2012 at 02:19:16PM -0500, David Purdy wrote:
> On Tue, Apr 17, 2012 at 1:47 PM, Luka Perkov  wrote:
> Any chance this same patch would similarly help other Kirkwood boxes
> that have two SATA ports?

Yes. If you have another board to test please do so and give your
comment here:

http://lists.denx.de/pipermail/u-boot/2012-April/122594.html

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


[U-Boot] [PATCH V2] Add support for Mini2440

2012-04-17 Thread Gabriel Huau
A little review of my first patch. As you can see, I removed some
unnecessary modifications that I did in arm920t directory ... (I don't
really remember why I did it), and some modifications on drivers (nand
and i2c) that was unnecessary because I am not currently supporting
theses features.

I forget to say in my first mail that is a porting from an old version
of u-boot patched by BusError (Michel Pollet). 
>From 9cefb0a55332b094256447f32d1b27c4f3f7808a Mon Sep 17 00:00:00 2001
From: Gabriel Huau 
Date: Sun, 15 Apr 2012 00:10:22 +0200
Subject: [PATCH v2] Add support for MINI2440 (s3c2440). Documentation about
 the product can be found on:
 http://www.friendlyarm.net/products/mini2440

---
Changes for v2:
	- Coding style cleanup
	- Remove unnecessary files modification
	- Remove unnecessary board configuration set
---
 arch/arm/include/asm/arch-s3c24x0/s3c24x0.h |   51 +-
 board/friendlyarm/mini2440/Makefile |   45 +
 board/friendlyarm/mini2440/lowlevel_init.S  |  177 +
 board/friendlyarm/mini2440/mini2440.c   |  283 +++
 boards.cfg  |1 +
 include/configs/mini2440.h  |  203 +++
 6 files changed, 710 insertions(+), 50 deletions(-)
 create mode 100644 board/friendlyarm/mini2440/Makefile
 create mode 100644 board/friendlyarm/mini2440/lowlevel_init.S
 create mode 100644 board/friendlyarm/mini2440/mini2440.c
 create mode 100644 include/configs/mini2440.h

diff --git a/arch/arm/include/asm/arch-s3c24x0/s3c24x0.h b/arch/arm/include/asm/arch-s3c24x0/s3c24x0.h
index ca978c9..96e623b 100644
--- a/arch/arm/include/asm/arch-s3c24x0/s3c24x0.h
+++ b/arch/arm/include/asm/arch-s3c24x0/s3c24x0.h
@@ -416,7 +416,7 @@ struct s3c24x0_gpio {
 	u32	misccr;
 	u32	extint;
 #endif
-#ifdef CONFIG_S3C2410
+#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
 	u32	gpacon;
 	u32	gpadat;
 	u32	res1[2];
@@ -467,55 +467,6 @@ struct s3c24x0_gpio {
 	u32	gstatus4;
 #endif
 #if defined(CONFIG_S3C2440)
-	u32	gpacon;
-	u32	gpadat;
-	u32	res1[2];
-	u32	gpbcon;
-	u32	gpbdat;
-	u32	gpbup;
-	u32	res2;
-	u32	gpccon;
-	u32	gpcdat;
-	u32	gpcup;
-	u32	res3;
-	u32	gpdcon;
-	u32	gpddat;
-	u32	gpdup;
-	u32	res4;
-	u32	gpecon;
-	u32	gpedat;
-	u32	gpeup;
-	u32	res5;
-	u32	gpfcon;
-	u32	gpfdat;
-	u32	gpfup;
-	u32	res6;
-	u32	gpgcon;
-	u32	gpgdat;
-	u32	gpgup;
-	u32	res7;
-	u32	gphcon;
-	u32	gphdat;
-	u32	gphup;
-	u32	res8;
-
-	u32	misccr;
-	u32	dclkcon;
-	u32	extint0;
-	u32	extint1;
-	u32	extint2;
-	u32	eintflt0;
-	u32	eintflt1;
-	u32	eintflt2;
-	u32	eintflt3;
-	u32	eintmask;
-	u32	eintpend;
-	u32	gstatus0;
-	u32	gstatus1;
-	u32	gstatus2;
-	u32	gstatus3;
-	u32	gstatus4;
-
 	u32	res9;
 	u32	dsc0;
 	u32	dsc1;
diff --git a/board/friendlyarm/mini2440/Makefile b/board/friendlyarm/mini2440/Makefile
new file mode 100644
index 000..065f1db
--- /dev/null
+++ b/board/friendlyarm/mini2440/Makefile
@@ -0,0 +1,45 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# 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., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS	:= mini2440.o
+SOBJS	:= lowlevel_init.o
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
+	$(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/friendlyarm/mini2440/lowlevel_init.S b/board/friendlyarm/mini2440/lowlevel_init.S
new file mode 100644
index 000..2a057ea
--- /dev/null
+++ b/board/friendlyarm/mini2440/lowlevel_init.S
@@ -0,0 +1,177 @@
+/*
+ * Memory Setup stuff - taken from blob memsetup.S
+ *
+ * Copyright (C) 1999 2000 2001 Erik Mouw (j.a.k.m...@its.tudelft.nl) and
+ * Jan-Derk Bakker (j.d.bak...@its.tudelft.nl)
+ *
+ * Modified for the Samsung SMDK2410 by
+ * (C) Copyright 2002
+ * David Mueller, ELSOFT AG, 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ 

Re: [U-Boot] [PATCH v3 4/7] tegra: fdt: Add NAND controller binding and definitions

2012-04-17 Thread Simon Glass
+Jim, who wrote the driver originally

Hi Scott,

On Tue, Apr 17, 2012 at 12:06 PM, Scott Wood  wrote:
> On 04/17/2012 01:50 PM, Simon Glass wrote:
>> diff --git a/doc/device-tree-bindings/nand/nvidia,tegra20-nand.txt 
>> b/doc/device-tree-bindings/nand/nvidia,tegra20-nand.txt
>> new file mode 100644
>> index 000..2484556
>> --- /dev/null
>> +++ b/doc/device-tree-bindings/nand/nvidia,tegra20-nand.txt
>> @@ -0,0 +1,68 @@
>> +NAND Flash
>> +--
>> +
>> +(there isn't yet a generic binding in Linux, so this describes what is in
>> +U-Boot. There should not be Linux-specific or U-Boot specific binding, just
>> +a binding that describes this hardware. But agreeing a binding in Linux in
>> +the absence of a driver may be beyond my powers.)
>> +
>> +The device node for a NAND flash device is as follows:
>> +
>> +Required properties :
>> + - compatible : Should be "manufacturer,device", "nand-flash"
>
> Again, "nand-flash" is not an appropriate compatible.  There is no
> generic nand-flash binding.

OK, so I should just drop this.

>
>> + - nvidia,page-data-bytes : Number of bytes in the data area
>> + - nvidia,page-spare-bytes : Number of bytes in spare area
>> +       spare area = skipped-spare-bytes + data-ecc-bytes + tag-bytes
>> +                     + tag-ecc-bytes
>
> Do you really need this stuff to be in the device tree?  You should be
> able to determine this information from the ID table.

I suspect so - the driver originally had a lot of CONFIGs for this.
Maybe someone who wants to take it further could do this as part of
supporting ONFI?

I will see if Jim Lin can take another look.

>
>> + - nvidia,skipped-spare-bytes : Number of bytes to skip at start of spare 
>> area
>> +     (these are typically used for bad block maintenance)
>
> So this binding can't deal with the bad block marker being somewhere
> other than the beginning of the spare area (e.g. 8-bit small page NAND)?

I suppose it depends on what you want to put afterwards.

>
>> + - nvidia,data-ecc-bytes : Number of ECC bytes for data area
>
> Number of ECC bytes per page?  Number of ECC bytes per ECC block?
> Number of data bytes per ECC block?
>
>> + - nvidia,tag-bytes :Number of tag bytes in spare area
>
> What are tag bytes?

I know that term from YAFFS, but other than that I am not sure.

>
>> +Nvidia NAND Controller
>> +--
>> +
>> +The device node for a NAND flash controller is as follows:
>> +
>> +Optional properties:
>> +
>> +nvidia,wp-gpios : GPIO of write-protect line, three cells in the format:
>> +             phandle, parameter, flags
>
> Doesn't the number of cells depend on the GPIO controller binding?

Yes, but this is the binding Tegra uses.

>
>> +nvidia,nand-width : bus width of the NAND device in bits
>> +
>> + - nvidia,nand-timing : Timing parameters for the NAND. Each is in ns.
>> +     Order is: MAX_TRP_TREA, TWB, Max(tCS, tCH, tALS, tALH),
>> +     TWHR, Max(tCS, tCH, tALS, tALH), TWH, TWP, TRH, TADL
>
> Might want to point out that there's one cell per timing parameter.

OK.

I'm going to wait and see if Jim can pick up this driver and make the
device-tree change you requested.

>
> -Scott
>

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


Re: [U-Boot] [PATCH] mxs-i2c: Fix internal address byte order

2012-04-17 Thread Marek Vasut
Dear Torsten Fleischer,

> Large EEPROMs, e.g. 24lc32, need 2 byte to address the internal memory.
> These devices require that the high byte of the internal address has to be
> written first.
> The mxs_i2c driver currently writes the address' low byte first.
> 
> The following patch fixes the byte order of the internal address that
> should be written to the I2C device.
> 
> Signed-off-by: Torsten Fleischer 

Acked-by: Marek Vasut 

> 
> CC: Marek Vasut 
> CC: Stefano Babic 
> CC: Fabio Estevam 
> ---
>  drivers/i2c/mxs_i2c.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/i2c/mxs_i2c.c b/drivers/i2c/mxs_i2c.c
> index c8fea32..486 100644
> --- a/drivers/i2c/mxs_i2c.c
> +++ b/drivers/i2c/mxs_i2c.c
> @@ -97,7 +97,7 @@ void mxs_i2c_write(uchar chip, uint addr, int alen,
> 
>   for (i = 0; i < alen; i++) {
>   data >>= 8;
> - data |= ((char *)&addr)[i] << 24;
> + data |= ((char *)&addr)[alen - i - 1] << 24;
>   if ((i & 3) == 2)
>   writel(data, &i2c_regs->hw_i2c_data);
>   }

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 v3 4/7] tegra: fdt: Add NAND controller binding and definitions

2012-04-17 Thread Scott Wood
On 04/17/2012 03:18 PM, Simon Glass wrote:
> +Jim, who wrote the driver originally
> 
> Hi Scott,
> 
> On Tue, Apr 17, 2012 at 12:06 PM, Scott Wood  wrote:
>>> + - nvidia,page-data-bytes : Number of bytes in the data area
>>> + - nvidia,page-spare-bytes : Number of bytes in spare area
>>> +   spare area = skipped-spare-bytes + data-ecc-bytes + tag-bytes
>>> + + tag-ecc-bytes
>>
>> Do you really need this stuff to be in the device tree?  You should be
>> able to determine this information from the ID table.
> 
> I suspect so - the driver originally had a lot of CONFIGs for this.
> Maybe someone who wants to take it further could do this as part of
> supporting ONFI?
> 
> I will see if Jim Lin can take another look.

You don't need ONFI to get the page/spare size out of the ID table.

The generic NAND code should already be doing this for you (fills in
mtd->writesize and mtd->oobsize).  If you need it during setup, we now
have CONFIG_SYS_NAND_SELF_INIT that allows splitting up
nand_scan_ident() from nand_scan_tail().

>>> +Nvidia NAND Controller
>>> +--
>>> +
>>> +The device node for a NAND flash controller is as follows:
>>> +
>>> +Optional properties:
>>> +
>>> +nvidia,wp-gpios : GPIO of write-protect line, three cells in the format:
>>> + phandle, parameter, flags
>>
>> Doesn't the number of cells depend on the GPIO controller binding?
> 
> Yes, but this is the binding Tegra uses.

Still, it doesn't belong in the NAND binding.  Maybe a future chip wants
to use this NAND binding but a different GPIO binding.  If nothing else,
people tend to copy-and-paste such descriptions.  We've still got people
adding bindings for Freescale devices saying interrupts are encoded as a
pair of cells, even though the interrupt controller now uses four cells
per interrupt.

-Scott

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


Re: [U-Boot] [PATCH v3 4/7] tegra: fdt: Add NAND controller binding and definitions

2012-04-17 Thread Simon Glass
Hi Scott,

On Tue, Apr 17, 2012 at 1:31 PM, Scott Wood  wrote:
> On 04/17/2012 03:18 PM, Simon Glass wrote:
>> +Jim, who wrote the driver originally
>>
>> Hi Scott,
>>
>> On Tue, Apr 17, 2012 at 12:06 PM, Scott Wood  wrote:
 + - nvidia,page-data-bytes : Number of bytes in the data area
 + - nvidia,page-spare-bytes : Number of bytes in spare area
 +       spare area = skipped-spare-bytes + data-ecc-bytes + tag-bytes
 +                     + tag-ecc-bytes
>>>
>>> Do you really need this stuff to be in the device tree?  You should be
>>> able to determine this information from the ID table.
>>
>> I suspect so - the driver originally had a lot of CONFIGs for this.
>> Maybe someone who wants to take it further could do this as part of
>> supporting ONFI?
>>
>> I will see if Jim Lin can take another look.
>
> You don't need ONFI to get the page/spare size out of the ID table.
>
> The generic NAND code should already be doing this for you (fills in
> mtd->writesize and mtd->oobsize).  If you need it during setup, we now
> have CONFIG_SYS_NAND_SELF_INIT that allows splitting up
> nand_scan_ident() from nand_scan_tail().

OK, sounds good. It should just need to be changed over to calculate
these values from the nand layer.

>
 +Nvidia NAND Controller
 +--
 +
 +The device node for a NAND flash controller is as follows:
 +
 +Optional properties:
 +
 +nvidia,wp-gpios : GPIO of write-protect line, three cells in the format:
 +             phandle, parameter, flags
>>>
>>> Doesn't the number of cells depend on the GPIO controller binding?
>>
>> Yes, but this is the binding Tegra uses.
>
> Still, it doesn't belong in the NAND binding.  Maybe a future chip wants
> to use this NAND binding but a different GPIO binding.  If nothing else,
> people tend to copy-and-paste such descriptions.  We've still got people
> adding bindings for Freescale devices saying interrupts are encoded as a
> pair of cells, even though the interrupt controller now uses four cells
> per interrupt.

OK I see - are you are saying that we should just say something like:

"nvidia,wp-gpios : GPIO of write-protect line, as defined by gpio bindings"

>
> -Scott
>

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


Re: [U-Boot] [PATCH v2] Add support for MINI2440 (s3c2440). Documentation about the product can be found on: http://www.friendlyarm.net/products/mini2440

2012-04-17 Thread Marek Vasut
Dear Gabriel Huau,

> ---
> Changes for v2:
>   - Coding style cleanup
>   - Remove unnecessary files modification
>   - Remove unnecessary board configuration set
> ---
>  arch/arm/include/asm/arch-s3c24x0/s3c24x0.h |   51 +-
>  board/friendlyarm/mini2440/Makefile |   45 +
>  board/friendlyarm/mini2440/lowlevel_init.S  |  177 +
>  board/friendlyarm/mini2440/mini2440.c   |  283
> +++ boards.cfg  | 
>   1 +
>  include/configs/mini2440.h  |  203 +++
>  6 files changed, 710 insertions(+), 50 deletions(-)
>  create mode 100644 board/friendlyarm/mini2440/Makefile
>  create mode 100644 board/friendlyarm/mini2440/lowlevel_init.S
>  create mode 100644 board/friendlyarm/mini2440/mini2440.c
>  create mode 100644 include/configs/mini2440.h
> 
> diff --git a/arch/arm/include/asm/arch-s3c24x0/s3c24x0.h
> b/arch/arm/include/asm/arch-s3c24x0/s3c24x0.h index ca978c9..96e623b
> 100644
> --- a/arch/arm/include/asm/arch-s3c24x0/s3c24x0.h
> +++ b/arch/arm/include/asm/arch-s3c24x0/s3c24x0.h
> @@ -416,7 +416,7 @@ struct s3c24x0_gpio {
>   u32 misccr;
>   u32 extint;
>  #endif
> -#ifdef CONFIG_S3C2410
> +#if defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)
>   u32 gpacon;
>   u32 gpadat;
>   u32 res1[2];
> @@ -467,55 +467,6 @@ struct s3c24x0_gpio {
>   u32 gstatus4;
>  #endif
>  #if defined(CONFIG_S3C2440)
> - u32 gpacon;
> - u32 gpadat;
> - u32 res1[2];
> - u32 gpbcon;
> - u32 gpbdat;
> - u32 gpbup;
> - u32 res2;
> - u32 gpccon;
> - u32 gpcdat;
> - u32 gpcup;
> - u32 res3;
> - u32 gpdcon;
> - u32 gpddat;
> - u32 gpdup;
> - u32 res4;
> - u32 gpecon;
> - u32 gpedat;
> - u32 gpeup;
> - u32 res5;
> - u32 gpfcon;
> - u32 gpfdat;
> - u32 gpfup;
> - u32 res6;
> - u32 gpgcon;
> - u32 gpgdat;
> - u32 gpgup;
> - u32 res7;
> - u32 gphcon;
> - u32 gphdat;
> - u32 gphup;
> - u32 res8;
> -
> - u32 misccr;
> - u32 dclkcon;
> - u32 extint0;
> - u32 extint1;
> - u32 extint2;
> - u32 eintflt0;
> - u32 eintflt1;
> - u32 eintflt2;
> - u32 eintflt3;
> - u32 eintmask;
> - u32 eintpend;
> - u32 gstatus0;
> - u32 gstatus1;
> - u32 gstatus2;
> - u32 gstatus3;
> - u32 gstatus4;
> -

Why did you drop this? Also, put this in a separate patch please ...

>   u32 res9;
>   u32 dsc0;
>   u32 dsc1;
> diff --git a/board/friendlyarm/mini2440/Makefile
> b/board/friendlyarm/mini2440/Makefile new file mode 100644
> index 000..065f1db
> --- /dev/null
> +++ b/board/friendlyarm/mini2440/Makefile
> @@ -0,0 +1,45 @@
> +#
> +# (C) Copyright 2000-2006

2012 ;-)

> +# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
> +#
> +# 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., 59 Temple Place, Suite 330, Boston,
> +# MA 02111-1307 USA
> +#
> +
> +include $(TOPDIR)/config.mk
> +
> +LIB  = $(obj)lib$(BOARD).o
> +
> +COBJS:= mini2440.o
> +SOBJS:= lowlevel_init.o
> +
> +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
> +OBJS := $(addprefix $(obj),$(COBJS))
> +SOBJS:= $(addprefix $(obj),$(SOBJS))
> +
> +$(LIB):  $(obj).depend $(OBJS) $(SOBJS)
> + $(call cmd_link_o_target, $(OBJS) $(SOBJS))
> +
> +#
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#
> diff --git a/board/friendlyarm/mini2440/lowlevel_init.S
> b/board/friendlyarm/mini2440/lowlevel_init.S new file mode 100644
> index 000..2a057ea
> --- /dev/null
> +++ b/board/friendlyarm/mini2440/lowlevel_init.S
> @@ -0,0 +1,177 @@
> +/*
> + * Memory Setup stuff - taken from blob memsetup.S
> + *
> + * Copyright (C) 1999 2000 2001 Erik Mouw (j.a.k.m...@its.tudelft.nl) and
> + * Jan-Derk Bakker (j.d.bak...@i

Re: [U-Boot] [PATCH v3 4/7] tegra: fdt: Add NAND controller binding and definitions

2012-04-17 Thread Scott Wood
On 04/17/2012 03:36 PM, Simon Glass wrote:
> Hi Scott,
> 
> On Tue, Apr 17, 2012 at 1:31 PM, Scott Wood  wrote:
>> On 04/17/2012 03:18 PM, Simon Glass wrote:
>>> On Tue, Apr 17, 2012 at 12:06 PM, Scott Wood  
>>> wrote:
 Doesn't the number of cells depend on the GPIO controller binding?
>>>
>>> Yes, but this is the binding Tegra uses.
>>
>> Still, it doesn't belong in the NAND binding.  Maybe a future chip wants
>> to use this NAND binding but a different GPIO binding.  If nothing else,
>> people tend to copy-and-paste such descriptions.  We've still got people
>> adding bindings for Freescale devices saying interrupts are encoded as a
>> pair of cells, even though the interrupt controller now uses four cells
>> per interrupt.
> 
> OK I see - are you are saying that we should just say something like:
> 
> "nvidia,wp-gpios : GPIO of write-protect line, as defined by gpio bindings"

Yes.  If there were more than one GPIO line, you'd specify which one is
which, similar to reg and interrupts.

-Scott

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


Re: [U-Boot] FW: I want to use Barebox

2012-04-17 Thread Graeme Russ
Hi Andy,

On Wed, Apr 18, 2012 at 2:11 AM, ANDY KENNEDY  wrote:
>> > 1)  I have a concern that barebox is not mainstream enough yet.

[snip]

>> > 2)  I have a feeling we will always be porting everyone's bsp (that
>> >    already has a working u-boot) to barebox.
>>
>> Which should not be _that_ hard considering that barebox is based on
>> U-Boot, but I think the code has diverged quite a lot
>
> Which is what I said below.  If it wasn't clear, these three "questions"
> were presented to me in opposition of my choice to investigate more
> Barebox as our universal bootloader.  And yes, you are correct, the code
> appears to have changed drastically.  According to the Barebox list,
> there would be a port required from U-Boot to Barebox for all drivers
> that are needed from U-Boot as the driver model is more closely aligned
> to the Linux kernel, though I never was answered whether drivers from
> the Linux kernel would be easier to port.

I think you will find the answer is 'No, but it's not as bad as U-Boot'

barebox uses the same driver registration as the Linux kernel and also
uses the Linux 'initcall' mechanism so plugging in a driver is trivial

 - Write the driver
 - Add a device_initcall(driver_name) in the driver source
 - Add an entry to Kconfig

But you fall into the trap of thinking that driver porting from Linux is
trivial - I doubt this is the case as you do not have the feature rich
kernel API (locks, mutexes, memory management, etc)

>> > 3)  I also don't really see the real advantage over standard u-boot
>> >    (what's the 'killer' application?).
>>
>> I like the idea of barebox's posix file system API and environment
>> handling. But I think that comes at a cost of size and speed
>
> The ability to have real mounted file systems in the bootloader, as well
> as the posix like environment that Barebox uses are the two biggest
> reasons for my wanting Adtran to use Barebox.  This seems to me to be

Ditto - but what is the speed penalty?

> less cumbersome than the way that U-Boot requires scripts to be written
> inside of variables.  Whereas I am use to this type of scripting (being
> that I've been using U-Boot for ~6-8 years) I know that this approach
> is foreign to the way of thinking inside this company.  The ability to
> look at things more along the lines of files is appealing.

Yep

>> > From my point of view, the answer to 3 is clear:  It uses the Linux
>> > kernel as part of the boot, it can house an initrd so that extending
>> > the utilities of the bootloader will be easier to handle, etc.  If this
>> > is in error, please correct me.
>>
>> I do not think it uses the linux kernel. Like U-Boot, it borrows code from
>> the kernel (I think the device driver model in barebox is closer to Linux,
>> but maybe not close enough to allow native porting of drivers)
>
> This was my misunderstanding, however, no one from the Barebox list
> corrected me on this as you just did.  I do not know whether this is
> because this is still a basically true statement, or whether this is
> something that is the desired perception.

I think they would like to maintain the perception of 'looks and feels
like Linux' without needing to worry about what is under the hood. The
claim to be using the Linux timer API but I had a really good look, and
when push comes to shove, it isn't. Their timer API is much better than
U-Boot's, but it ain't Linux ;)

[snip]

>> What is it you need from the bootloader - Lay out the requirements and the
>> specifications first. List them as a series of yes/no questions and rank
>> them in order of importance. Answer each question yes/no/maybe/don't know
>> for both barebox and U-Boot

[snip]

> Right.  This is what we have done already.  The requirements list for
> the universal boot loader is not that vast.  There are truly only a few
> requirements:  Must be able to load a fail-safe application that would
> rebuild itself remotely, must be able to boot either our IP Binary
> image or a Linux kernel, must be able to read/write both NAND and NOR
> flash devices, and must support a wide range of platforms.
>
> As you see, the requirements fit both Barebox and U-Boot at the moment.
> My requirement of being easy to use, is not a requirement the company

Ah-Ha! Now we get to where we (the U-Boot community) need to have a good
hard look at ourselves. You imply that barebox is easier to use than U-Boot
Can you explain? Is it just the posix file API and the way barebox handles
scripting?

If support for U-Boot starts to drop because 'the other options are easier
to use', then we have to address that. But unless we know why 'Option B' is
easier to use than U-Boot, we don't stand a chance :(

> has enforced on us.

Regards,

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


Re: [U-Boot] [PATCH v4] AT91SAM9*: Change kernel address in dataflash to match u-boot's size

2012-04-17 Thread Ulf Samuelsson

On 2012-04-09 10:15, Wolfgang Denk wrote:

Dear Andreas,

In message<4f82835f.2030...@googlemail.com>  you wrote:

Where are these odd sizes like


  #define CONFIG_ENV_SIZE   0x4200

coming from?  Has a size of 0x4200 any special maning on these
systems?

please read Ulfs mail:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/123862/focus=125897

Thanks for the pointer.


I think it is OK to apply this patch.

I did not intend to object against this patch; I just wonered about
the odd numbers,


I think another point is that these Atmel devices became less important
than before in U-Boot (I see not really much users here even though a
lot of people use it):
  a) a lot of users favor the at91bootstrap SPL to boot linux (no need
for u-boot)


While AT91bootstrap supports booting linux, this is real minimal support.
Everything is hard-wired so for development it really sucks.
It is really only useful for production work.
I personally never used this capability.

This functionality is pretty new in AT91boostrap,
and the Atmel (non) presence in the mailing list is an older problem.

While I no longer work for Atmel, I have a feeling that the problem is 
as follows:


Users are using the Atmel version of U-Boot, not mainstream.
If not using the Atmel version, then they maybe using a build system
like OpenEmbedded where u-boot is built as a part of the build process
and people have very little incentive in modifying that part

There is very little incentive at Atmel to upgrade because
1. Patches provided by Atmel are ignored.
2. Patches are applied to mainline which keeps breaking the AT91 support.
3. All possible fixes to boot problem are rejected (discussion with 
Haavard).
4. It is considered more important to have a "clean" implementation, 
than a working implementation.

(Choice of NOR Flash Driver)

Atmel does not want to continuously spend effort on unbreaking other 
peoples work.


Problems are not fixed in the mainline due to problem (1).
Instead the problems are fixed in the buildsystem and it is not considered
worthwhile to submit such fixes to the mailinglist.

The action by the project to "solve" the problem by removing the boards 
from

the MAKEALL scripts and also to remove BSPs is not encouraging.

There used to be a rule that patches should not break board support, but
that rule seems to have gone down the drains.

The Atmel code is (IIRC) based on 0.3.4 so it is very old, so an update 
is really needed

but before U-Boot becomes "developer-friendly", I doubt that will happen.
If the project wants to have Atmel "on-board", then fixing problem (1) 
is key.





This could probably be changed if they were converted to using
U-Boot's SPL mechanism instead - but then, I also realize that there
is only very low interest for them.




I think you are right. Atmel wants control over this part.


  b) they have well-hung cores


Still plenty of ARM9 users out there, but a new core would be an obvious
way forward for the 2012 model AT91 application processors.
Don't see many reasons for updating the current SAM9Gx5 family.

"http://www.mscbp.hu/Documents/Atmel Q-Touch.pdf"
seems to hint at a Cortex-A5, but this document is from 2010,
so plans may have changed.


Indeed.

Best regards,

Wolfgang Denk


--
Best Regards
Ulf Samuelsson
u...@emagii.com


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


[U-Boot] [PATCH] sh: ecovec: Change macro from BOARD_LATE_INIT to CONFIG_BOARD_LATE_INIT

2012-04-17 Thread Nobuhiro Iwamatsu
When calling board_late_init, we need to define CONFIG_BOARD_LATE_INIT.
The latest ecovec config defines BOARD_LATE_INIT, board_late_init is not called.

Signed-off-by: Nobuhiro Iwamatsu 
---
 include/configs/ecovec.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/configs/ecovec.h b/include/configs/ecovec.h
index 901a0e0..4d09132 100644
--- a/include/configs/ecovec.h
+++ b/include/configs/ecovec.h
@@ -43,7 +43,7 @@
 #define CONFIG_SH4 1
 #define CONFIG_SH4A1
 #define CONFIG_CPU_SH7724  1
-#define BOARD_LATE_INIT1
+#define CONFIG_BOARD_LATE_INIT 1
 #define CONFIG_ECOVEC  1
 
 #define CONFIG_ECOVEC_ROMIMAGE_ADDR 0xA004
-- 
1.7.9.1

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


Re: [U-Boot] [PATCH] mmc:fix Call mmc_init() when executing mmc_get_dev()

2012-04-17 Thread Minkyu Kang
Hi Lukasz,

On 3 April 2012 23:24, Lukasz Majewski  wrote:
> This code adds call to mmc_init(), for partition related commands (e.g.
> fatls, fatinfo etc.).
>
> It is safe to call mmc_init() multiple times since mmc->has_init flag
> prevents from multiple initialization.
>
> The FAT related code calls get_dev high level method and then uses
> elements from mmc->block_dev, which is uninitialized until the mmc_init
> (and thereof mmc_startup) is called.
>
> This problem appears on boards, which don't use mmc as the default
> place for envs
>
> Signed-off-by: Lukasz Majewski 
> Signed-off-by: Kyungmin Park 
> Cc: Andy Fleming 
>
> ---
> Test HW:
> - GONI S5PC110
> - Universal C210 (Exynos4)
> ---
>  drivers/mmc/mmc.c |    6 +-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 618960e..1fa90e7 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -1305,8 +1305,12 @@ int mmc_register(struct mmc *mmc)
>  block_dev_desc_t *mmc_get_dev(int dev)
>  {
>        struct mmc *mmc = find_mmc_device(dev);
> +       if (mmc) {
> +               mmc_init(mmc);
> +               return &mmc->block_dev;
> +       }
>
> -       return mmc ? &mmc->block_dev : NULL;
> +       return NULL;
>  }
>  #endif
>

I think

if (!mmc)
return NULL;

mmc_init(mmc);
return &mmc->block_dev;

is better.
How you think?

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


[U-Boot] [PATCH] nds32: Change macro from BOARD_LATE_INIT to CONFIG_BOARD_LATE_INIT

2012-04-17 Thread Nobuhiro Iwamatsu
With almost all the architecture and board BOARD_LATE_INIT does not use.
CONFIG_BOARD_LATE_INIT is used instead.
This changed CONFIG_BOARD_LATE_INIT from BOARD_LATE_INIT.

Signed-off-by: Nobuhiro Iwamatsu 
CC: Macpaul Lin 
---
 arch/nds32/lib/board.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c
index 074aabf..a043b43 100644
--- a/arch/nds32/lib/board.c
+++ b/arch/nds32/lib/board.c
@@ -408,7 +408,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
copy_filename(BootFile, s, sizeof(BootFile));
 #endif
 
-#ifdef BOARD_LATE_INIT
+#ifdef CONFIG_BOARD_LATE_INIT
board_late_init();
 #endif
 
-- 
1.7.9.5

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


[U-Boot] [PATCH] arm: ea20: Change macro from BOARD_LATE_INIT to CONFIG_BOARD_LATE_INIT

2012-04-17 Thread Nobuhiro Iwamatsu
With almost all the architecture and board BOARD_LATE_INIT does not use.
CONFIG_BOARD_LATE_INIT is used instead.
This changed CONFIG_BOARD_LATE_INIT from BOARD_LATE_INIT.

Signed-off-by: Nobuhiro Iwamatsu 
CC: Stefano Babic 
---
 board/davinci/ea20/ea20.c |4 ++--
 include/configs/ea20.h|2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/board/davinci/ea20/ea20.c b/board/davinci/ea20/ea20.c
index 43632c2..7e00040 100644
--- a/board/davinci/ea20/ea20.c
+++ b/board/davinci/ea20/ea20.c
@@ -272,7 +272,7 @@ int board_init(void)
return 0;
 }
 
-#ifdef BOARD_LATE_INIT
+#ifdef CONFIG_BOARD_LATE_INIT
 
 int board_late_init(void)
 {
@@ -287,7 +287,7 @@ int board_late_init(void)
 
return 0;
 }
-#endif /* BOARD_LATE_INIT */
+#endif /* CONFIG_BOARD_LATE_INIT */
 
 #ifdef CONFIG_DRIVER_TI_EMAC
 
diff --git a/include/configs/ea20.h b/include/configs/ea20.h
index e059b30..2c44ddb 100644
--- a/include/configs/ea20.h
+++ b/include/configs/ea20.h
@@ -31,7 +31,7 @@
 #defineCONFIG_SYS_USE_NAND
 #define CONFIG_DRIVER_TI_EMAC_USE_RMII
 #define CONFIG_BOARD_EARLY_INIT_F
-#define BOARD_LATE_INIT
+#define CONFIG_BOARD_LATE_INIT
 #define CONFIG_VIDEO
 #define CONFIG_PREBOOT
 
-- 
1.7.9.5

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


[U-Boot] [PATCH] arm: cam_enc_4xx: Change macro from BOARD_LATE_INIT to CONFIG_BOARD_LATE_INIT

2012-04-17 Thread Nobuhiro Iwamatsu
With almost all the architecture and board BOARD_LATE_INIT does not use.
CONFIG_BOARD_LATE_INIT is used instead.
This changed CONFIG_BOARD_LATE_INIT from BOARD_LATE_INIT.

Signed-off-by: Nobuhiro Iwamatsu 
CC: Heiko Schocher 
---
 include/configs/cam_enc_4xx.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/cam_enc_4xx.h b/include/configs/cam_enc_4xx.h
index 99856eb..71faf1c 100644
--- a/include/configs/cam_enc_4xx.h
+++ b/include/configs/cam_enc_4xx.h
@@ -37,7 +37,7 @@
 
 #define CONFIG_HOSTNAMEcam_enc_4xx
 
-#defineBOARD_LATE_INIT
+#defineCONFIG_BOARD_LATE_INIT
 #define CONFIG_CAM_ENC_LED_MASK0x0fc0
 
 /* Memory Info */
-- 
1.7.9.5

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


[U-Boot] Pull request: u-boot-sh

2012-04-17 Thread Nobuhiro Iwamatsu
Dear Wolfgang Denk,

Please pull some fixes for v2012.04.

The following changes since commit f5cdc11775c4b7fdbf52a6dd2f463d329804ab11:

 Prepare v2012.04-rc2; minor Coding Style cleanup (2012-04-16 23:13:51 +0200)

are available in the git repository at:

 git://git.denx.de/u-boot-sh.git master

for you to fetch changes up to 77fe6e773af762676f4f30f646caa160e39a0bcc:

 sh: ecovec: Change macro from BOARD_LATE_INIT to
CONFIG_BOARD_LATE_INIT (2012-04-18 11:16:46 +0900)


Nobuhiro Iwamatsu (1):
 sh: ecovec: Change macro from BOARD_LATE_INIT to CONFIG_BOARD_LATE_INIT

Phil Edworthy (1):
 sh: Fix rsk7264 pin setup for on-board ethernet

 board/renesas/rsk7264/lowlevel_init.S |2 +-
 include/configs/ecovec.h  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] FW: I want to use Barebox

2012-04-17 Thread Mike Frysinger
On Tuesday 17 April 2012 19:40:08 Graeme Russ wrote:
> On Wed, Apr 18, 2012 at 2:11 AM, ANDY KENNEDY wrote:
> But you fall into the trap of thinking that driver porting from Linux is
> trivial - I doubt this is the case as you do not have the feature rich
> kernel API (locks, mutexes, memory management, etc)

it's good that you don't have that cruft :).  i've also found that many 
Blackfin linux drivers utilize IRQs/DMA heavily while the u-boot driver does 
polling/register banging.  sometimes this can make a huge difference to the 
code base, as well as hit a completely different set of issues (such as 
hardware or documentation bugs).
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] PowerPC: Change -fpic flag to -fPIC flag in the config.mk

2012-04-17 Thread Chunhe Lan
The -fPIC/-fpic flag belongs with -mrelocatable. The -fpic flag can
limit the size of the GOT and produce smaller binaries, so it causes
some GOT entries to be lost in the gcc 4.6 version. But -fPIC flag
allows the maximum possible size of the GOT entries.

However, currently -mrelocatable promotes -fpic flag to -fPIC flag.

This reverts that portion of the
commit 33ee4c92339ee386662c0ee2d221098c5cc8b07e.

Signed-off-by: Chunhe Lan 
---
 arch/powerpc/config.mk |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
index a307154..7c14ff6 100644
--- a/arch/powerpc/config.mk
+++ b/arch/powerpc/config.mk
@@ -25,7 +25,7 @@ CROSS_COMPILE ?= ppc_8xx-
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x4
 LDFLAGS_FINAL += --gc-sections
-PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections
+PLATFORM_RELFLAGS += -fPIC -mrelocatable -ffunction-sections -fdata-sections
 PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
 PLATFORM_LDFLAGS  += -n
 
-- 
1.5.6.5


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


Re: [U-Boot] [PATCH] PowerPC: Change -fpic flag to -fPIC flag in the config.mk

2012-04-17 Thread Wolfgang Denk
Dear Chunhe Lan,

In message <1334719161-3500-1-git-send-email-chunhe@freescale.com> you 
wrote:
> The -fPIC/-fpic flag belongs with -mrelocatable. The -fpic flag can
> limit the size of the GOT and produce smaller binaries, so it causes
> some GOT entries to be lost in the gcc 4.6 version. But -fPIC flag
> allows the maximum possible size of the GOT entries.
> 
> However, currently -mrelocatable promotes -fpic flag to -fPIC flag.
> 
> This reverts that portion of the
> commit 33ee4c92339ee386662c0ee2d221098c5cc8b07e.

As you state yourself, your modification has the negative impact of
increasing the image size.  What would be the benefits of it?

Are you trying to fix any specific problem? Which one?  I am not aware
of any related isses for any of the mainline PowerPC systems...

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
If ignorance is bliss, why aren't there more happy people?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] i.MX28: Shut down the LCD controller before reset

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

In message <1334673527-27361-1-git-send-email-ma...@denx.de> you wrote:
> If the LCD controller is on before the CPU goes into reset, the traffic on 
> LCDIF
> data pins interferes with the BootROM's boot mode sampling. So shut the
> controller down.
> 
> Signed-off-by: Marek Vasut 
> Cc: Wolfgang Denk 
> Cc: Detlev Zundel 
> Cc: Stefano Babic 
> Cc: Fabio Estevam 
> ---
>  arch/arm/cpu/arm926ejs/mx28/mx28.c |9 -
>  1 file changed, 8 insertions(+), 1 deletion(-)

Tested-by: Wolfgang Denk 
Acked-by: Wolfgang Denk 


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
If you believe that feeling bad or worrying long enough will change a
past or future event, then you are residing on another planet with  a
different reality system.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot